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

igraph_community_to_membership:
  109|  6.80k|                                   igraph_vector_int_t *csize) {
  110|       |
  111|  6.80k|    const igraph_int_t no_of_nodes = nodes;
  112|  6.80k|    const igraph_int_t components = no_of_nodes - steps;
  113|  6.80k|    igraph_int_t found = 0;
  114|  6.80k|    igraph_vector_int_t tmp;
  115|  6.80k|    igraph_vector_bool_t already_merged;
  116|  6.80k|    igraph_vector_int_t own_membership;
  117|  6.80k|    igraph_bool_t using_own_membership = false;
  118|       |
  119|  6.80k|    if (steps > igraph_matrix_int_nrow(merges)) {
  ------------------
  |  Branch (119:9): [True: 0, False: 6.80k]
  ------------------
  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|  6.80k|    if (igraph_matrix_int_ncol(merges) != 2) {
  ------------------
  |  Branch (124:9): [True: 0, False: 6.80k]
  ------------------
  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|  6.80k|    if (steps < 0) {
  ------------------
  |  Branch (128:9): [True: 0, False: 6.80k]
  ------------------
  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|  6.80k|    if (csize != NULL && membership == NULL) {
  ------------------
  |  Branch (132:9): [True: 0, False: 6.80k]
  |  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|  6.80k|    if (membership) {
  ------------------
  |  Branch (140:9): [True: 6.80k, False: 0]
  ------------------
  141|  6.80k|        IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  142|  6.80k|        igraph_vector_int_null(membership);
  143|  6.80k|    }
  144|  6.80k|    if (csize) {
  ------------------
  |  Branch (144:9): [True: 0, False: 6.80k]
  ------------------
  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|  6.80k|    IGRAPH_VECTOR_BOOL_INIT_FINALLY(&already_merged, steps + no_of_nodes);
  ------------------
  |  |  109|  6.80k|    do { IGRAPH_CHECK(igraph_vector_bool_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.80k|    do { \
  |  |  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  6.80k|        IGRAPH_FINALLY(igraph_vector_bool_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.80k|    do { \
  |  |  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (110:65): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  150|  6.80k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&tmp, steps);
  ------------------
  |  |  119|  6.80k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.80k|    do { \
  |  |  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  6.80k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.80k|    do { \
  |  |  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  151|       |
  152|  76.1k|    for (igraph_int_t i = steps - 1; i >= 0; i--) {
  ------------------
  |  Branch (152:38): [True: 69.3k, False: 6.80k]
  ------------------
  153|  69.3k|        const igraph_int_t c1 = MATRIX(*merges, i, 0);
  ------------------
  |  |   83|  69.3k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  154|  69.3k|        const igraph_int_t c2 = MATRIX(*merges, i, 1);
  ------------------
  |  |   83|  69.3k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  155|       |
  156|  69.3k|        if (VECTOR(already_merged)[c1] == 0) {
  ------------------
  |  |   60|  69.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (156:13): [True: 69.3k, False: 0]
  ------------------
  157|  69.3k|            VECTOR(already_merged)[c1] = true;
  ------------------
  |  |   60|  69.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  158|  69.3k|        } 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|  69.3k|        if (VECTOR(already_merged)[c2] == 0) {
  ------------------
  |  |   60|  69.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (161:13): [True: 69.3k, False: 0]
  ------------------
  162|  69.3k|            VECTOR(already_merged)[c2] = true;
  ------------------
  |  |   60|  69.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  163|  69.3k|        } 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|  69.3k|        if (VECTOR(tmp)[i] == 0) {
  ------------------
  |  |   60|  69.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (168:13): [True: 21.6k, False: 47.7k]
  ------------------
  169|  21.6k|            found++;
  170|  21.6k|            VECTOR(tmp)[i] = found;
  ------------------
  |  |   60|  21.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  171|  21.6k|        }
  172|       |
  173|  69.3k|        if (c1 < no_of_nodes) {
  ------------------
  |  Branch (173:13): [True: 51.4k, False: 17.8k]
  ------------------
  174|  51.4k|            const igraph_int_t cid = VECTOR(tmp)[i] - 1;
  ------------------
  |  |   60|  51.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  175|  51.4k|            if (membership) {
  ------------------
  |  Branch (175:17): [True: 51.4k, False: 0]
  ------------------
  176|  51.4k|                VECTOR(*membership)[c1] = cid + 1;
  ------------------
  |  |   60|  51.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  177|  51.4k|            }
  178|  51.4k|            if (csize) {
  ------------------
  |  Branch (178:17): [True: 0, False: 51.4k]
  ------------------
  179|      0|                VECTOR(*csize)[cid] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  180|      0|            }
  181|  51.4k|        } else {
  182|  17.8k|            VECTOR(tmp)[c1 - no_of_nodes] = VECTOR(tmp)[i];
  ------------------
  |  |   60|  17.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(tmp)[c1 - no_of_nodes] = VECTOR(tmp)[i];
  ------------------
  |  |   60|  17.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  183|  17.8k|        }
  184|       |
  185|  69.3k|        if (c2 < no_of_nodes) {
  ------------------
  |  Branch (185:13): [True: 39.4k, False: 29.8k]
  ------------------
  186|  39.4k|            const igraph_int_t cid = VECTOR(tmp)[i] - 1;
  ------------------
  |  |   60|  39.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  187|  39.4k|            if (membership) {
  ------------------
  |  Branch (187:17): [True: 39.4k, False: 0]
  ------------------
  188|  39.4k|                VECTOR(*membership)[c2] = cid + 1;
  ------------------
  |  |   60|  39.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  189|  39.4k|            }
  190|  39.4k|            if (csize) {
  ------------------
  |  Branch (190:17): [True: 0, False: 39.4k]
  ------------------
  191|      0|                VECTOR(*csize)[cid] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  192|      0|            }
  193|  39.4k|        } else {
  194|  29.8k|            VECTOR(tmp)[c2 - no_of_nodes] = VECTOR(tmp)[i];
  ------------------
  |  |   60|  29.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(tmp)[c2 - no_of_nodes] = VECTOR(tmp)[i];
  ------------------
  |  |   60|  29.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  195|  29.8k|        }
  196|       |
  197|  69.3k|    }
  198|       |
  199|  6.80k|    if (membership || csize) {
  ------------------
  |  Branch (199:9): [True: 6.80k, 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|   311k|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (203:34): [True: 304k, False: 6.80k]
  ------------------
  204|   304k|            const igraph_int_t c = VECTOR(*membership)[i];
  ------------------
  |  |   60|   304k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  205|   304k|            if (c != 0) {
  ------------------
  |  Branch (205:17): [True: 90.9k, False: 213k]
  ------------------
  206|  90.9k|                VECTOR(*membership)[i] = c - 1;
  ------------------
  |  |   60|  90.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  207|   213k|            } else {
  208|   213k|                if (csize) {
  ------------------
  |  Branch (208:21): [True: 0, False: 213k]
  ------------------
  209|      0|                    VECTOR(*csize)[found] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  210|      0|                }
  211|   213k|                VECTOR(*membership)[i] = found;
  ------------------
  |  |   60|   213k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  212|   213k|                found++;
  213|   213k|            }
  214|   304k|        }
  215|  6.80k|    }
  216|       |
  217|  6.80k|    igraph_vector_int_destroy(&tmp);
  218|  6.80k|    igraph_vector_bool_destroy(&already_merged);
  219|  6.80k|    IGRAPH_FINALLY_CLEAN(2);
  220|       |
  221|  6.80k|    if (using_own_membership) {
  ------------------
  |  Branch (221:9): [True: 0, False: 6.80k]
  ------------------
  222|      0|        igraph_vector_int_destroy(&own_membership);
  223|      0|        IGRAPH_FINALLY_CLEAN(1);
  224|      0|    }
  225|       |
  226|  6.80k|    return IGRAPH_SUCCESS;
  227|  6.80k|}
igraph_i_reindex_membership_large:
  245|  40.6k|        igraph_int_t *nb_clusters) {
  246|       |
  247|  40.6k|    const igraph_int_t vcount = igraph_vector_int_size(membership);
  248|  40.6k|    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|  40.6k|    if (vcount == 0) {
  ------------------
  |  Branch (252:9): [True: 0, False: 40.6k]
  ------------------
  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|  40.6k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&permutation, vcount);
  ------------------
  |  |  119|  40.6k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  40.6k|    do { \
  |  |  |  |  657|  40.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  40.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  40.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 40.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  40.6k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  40.6k|    do { \
  |  |  |  |  604|  40.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  40.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  40.6k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  40.6k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 40.6k]
  |  |  |  |  ------------------
  |  |  |  |  608|  40.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  40.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 40.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 40.6k]
  |  |  ------------------
  ------------------
  263|       |
  264|  40.6k|    IGRAPH_CHECK(igraph_vector_int_sort_ind(membership, &permutation, IGRAPH_ASCENDING));
  ------------------
  |  |  656|  40.6k|    do { \
  |  |  657|  40.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  40.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  40.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 40.6k]
  |  |  ------------------
  ------------------
  265|       |
  266|  40.6k|    if (new_to_old) {
  ------------------
  |  Branch (266:9): [True: 0, False: 40.6k]
  ------------------
  267|      0|        igraph_vector_int_clear(new_to_old);
  268|      0|    }
  269|       |
  270|  40.6k|    igraph_int_t j = VECTOR(permutation)[0];
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  271|  40.6k|    igraph_int_t c_old = VECTOR(*membership)[j];
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  272|  40.6k|    igraph_int_t c_old_prev = c_old;
  273|  40.6k|    igraph_int_t c_new = 0;
  274|  40.6k|    if (new_to_old) {
  ------------------
  |  Branch (274:9): [True: 0, False: 40.6k]
  ------------------
  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|  40.6k|    VECTOR(*membership)[j] = c_new;
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  278|       |
  279|  2.29M|    for (igraph_int_t i=1; i < vcount; i++) {
  ------------------
  |  Branch (279:28): [True: 2.25M, False: 40.6k]
  ------------------
  280|  2.25M|        j = VECTOR(permutation)[i];
  ------------------
  |  |   60|  2.25M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  281|  2.25M|        c_old = VECTOR(*membership)[j];
  ------------------
  |  |   60|  2.25M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  282|  2.25M|        if (c_old != c_old_prev) {
  ------------------
  |  Branch (282:13): [True: 1.66M, False: 590k]
  ------------------
  283|  1.66M|            if (new_to_old) {
  ------------------
  |  Branch (283:17): [True: 0, False: 1.66M]
  ------------------
  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.66M|            c_new++;
  287|  1.66M|        }
  288|  2.25M|        c_old_prev = c_old;
  289|  2.25M|        VECTOR(*membership)[j] = c_new;
  ------------------
  |  |   60|  2.25M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  290|  2.25M|    }
  291|       |
  292|  40.6k|    if (nb_clusters) {
  ------------------
  |  Branch (292:9): [True: 40.6k, False: 0]
  ------------------
  293|  40.6k|        *nb_clusters = c_new+1;
  294|  40.6k|    }
  295|       |
  296|  40.6k|    igraph_vector_int_destroy(&permutation);
  297|  40.6k|    IGRAPH_FINALLY_CLEAN(1);
  298|       |
  299|  40.6k|    return IGRAPH_SUCCESS;
  300|  40.6k|}
igraph_reindex_membership:
  329|  88.9k|        igraph_int_t *nb_clusters) {
  330|       |
  331|  88.9k|    const igraph_int_t vcount = igraph_vector_int_size(membership);
  332|  88.9k|    igraph_vector_int_t new_cluster;
  333|  88.9k|    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|  88.9k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&new_cluster, vcount);
  ------------------
  |  |  119|  88.9k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  88.9k|    do { \
  |  |  |  |  657|  88.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  88.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  88.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 88.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|  88.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 88.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  88.9k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  88.9k|    do { \
  |  |  |  |  604|  88.9k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  88.9k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  88.9k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  88.9k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 88.9k]
  |  |  |  |  ------------------
  |  |  |  |  608|  88.9k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  88.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 88.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 88.9k]
  |  |  ------------------
  ------------------
  340|       |
  341|  88.9k|    if (new_to_old) {
  ------------------
  |  Branch (341:9): [True: 0, False: 88.9k]
  ------------------
  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|  88.9k|    i_nb_clusters = 1;
  348|  3.97M|    for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (348:30): [True: 3.88M, False: 88.9k]
  ------------------
  349|  3.88M|        igraph_int_t c = VECTOR(*membership)[i];
  ------------------
  |  |   60|  3.88M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  350|       |
  351|  3.88M|        if (c < 0 || c >= vcount) {
  ------------------
  |  Branch (351:13): [True: 0, False: 3.88M]
  |  Branch (351:22): [True: 0, False: 3.88M]
  ------------------
  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.88M|        if (VECTOR(new_cluster)[c] == 0) {
  ------------------
  |  |   60|  3.88M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (359:13): [True: 3.64M, False: 239k]
  ------------------
  360|  3.64M|            VECTOR(new_cluster)[c] = i_nb_clusters;
  ------------------
  |  |   60|  3.64M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  361|  3.64M|            i_nb_clusters += 1;
  362|  3.64M|            if (new_to_old) {
  ------------------
  |  Branch (362:17): [True: 0, False: 3.64M]
  ------------------
  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.64M|        }
  366|  3.88M|    }
  367|       |
  368|       |    /* Assign new membership */
  369|  3.97M|    for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (369:30): [True: 3.88M, False: 88.9k]
  ------------------
  370|  3.88M|        igraph_int_t c = VECTOR(*membership)[i];
  ------------------
  |  |   60|  3.88M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  371|  3.88M|        VECTOR(*membership)[i] = VECTOR(new_cluster)[c] - 1;
  ------------------
  |  |   60|  3.88M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*membership)[i] = VECTOR(new_cluster)[c] - 1;
  ------------------
  |  |   60|  3.88M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  372|  3.88M|    }
  373|       |
  374|  88.9k|    if (nb_clusters) {
  ------------------
  |  Branch (374:9): [True: 39.8k, False: 49.0k]
  ------------------
  375|       |        /* We used the cluster + 1, so correct */
  376|  39.8k|        *nb_clusters = i_nb_clusters - 1;
  377|  39.8k|    }
  378|       |
  379|  88.9k|    igraph_vector_int_destroy(&new_cluster);
  380|  88.9k|    IGRAPH_FINALLY_CLEAN(1);
  381|       |
  382|  88.9k|    return IGRAPH_SUCCESS;
  383|  88.9k|}
igraph_compare_communities:
  522|  16.9k|                               igraph_community_comparison_t method) {
  523|  16.9k|    igraph_vector_int_t c1, c2;
  524|       |
  525|  16.9k|    if (igraph_vector_int_size(comm1) != igraph_vector_int_size(comm2)) {
  ------------------
  |  Branch (525:9): [True: 0, False: 16.9k]
  ------------------
  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|  16.9k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&c1, comm1));
  ------------------
  |  |  656|  16.9k|    do { \
  |  |  657|  16.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  16.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  16.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.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|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  531|  16.9k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &c1);
  ------------------
  |  |  603|  16.9k|    do { \
  |  |  604|  16.9k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  16.9k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  16.9k|         * incorrect destructor function with the pointer */ \
  |  |  607|  16.9k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 16.9k]
  |  |  ------------------
  |  |  608|  16.9k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  532|       |
  533|  16.9k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&c2, comm2));
  ------------------
  |  |  656|  16.9k|    do { \
  |  |  657|  16.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  16.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  16.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.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|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  534|  16.9k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &c2);
  ------------------
  |  |  603|  16.9k|    do { \
  |  |  604|  16.9k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  16.9k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  16.9k|         * incorrect destructor function with the pointer */ \
  |  |  607|  16.9k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 16.9k]
  |  |  ------------------
  |  |  608|  16.9k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  535|       |
  536|  16.9k|    IGRAPH_CHECK(igraph_reindex_membership(&c1, NULL, NULL));
  ------------------
  |  |  656|  16.9k|    do { \
  |  |  657|  16.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  16.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  16.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.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|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  537|  16.9k|    IGRAPH_CHECK(igraph_reindex_membership(&c2, NULL, NULL));
  ------------------
  |  |  656|  16.9k|    do { \
  |  |  657|  16.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  16.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  16.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.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|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  538|       |
  539|  16.9k|    switch (method) {
  540|  3.40k|    case IGRAPH_COMMCMP_VI:
  ------------------
  |  Branch (540:5): [True: 3.40k, False: 13.5k]
  ------------------
  541|  3.40k|        IGRAPH_CHECK(igraph_i_compare_communities_vi(&c1, &c2, result));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  542|  3.40k|        break;
  543|       |
  544|  3.40k|    case IGRAPH_COMMCMP_NMI:
  ------------------
  |  Branch (544:5): [True: 3.40k, False: 13.5k]
  ------------------
  545|  3.40k|        IGRAPH_CHECK(igraph_i_compare_communities_nmi(&c1, &c2, result));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  546|  3.40k|        break;
  547|       |
  548|  3.40k|    case IGRAPH_COMMCMP_SPLIT_JOIN: {
  ------------------
  |  Branch (548:5): [True: 3.40k, False: 13.5k]
  ------------------
  549|  3.40k|        igraph_int_t d12, d21;
  550|  3.40k|        IGRAPH_CHECK(igraph_i_split_join_distance(&c1, &c2, &d12, &d21));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  551|  3.40k|        *result = d12 + d21;
  552|  3.40k|    }
  553|      0|    break;
  554|       |
  555|  3.38k|    case IGRAPH_COMMCMP_RAND:
  ------------------
  |  Branch (555:5): [True: 3.38k, False: 13.5k]
  ------------------
  556|  6.77k|    case IGRAPH_COMMCMP_ADJUSTED_RAND:
  ------------------
  |  Branch (556:5): [True: 3.38k, False: 13.5k]
  ------------------
  557|  6.77k|        IGRAPH_CHECK(igraph_i_compare_communities_rand(&c1, &c2, result,
  ------------------
  |  |  656|  6.77k|    do { \
  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  558|  6.77k|                     method == IGRAPH_COMMCMP_ADJUSTED_RAND));
  559|  6.77k|        break;
  560|       |
  561|  6.77k|    default:
  ------------------
  |  Branch (561:5): [True: 0, False: 16.9k]
  ------------------
  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|  16.9k|    }
  564|       |
  565|       |    /* Clean up everything */
  566|  16.9k|    igraph_vector_int_destroy(&c1);
  567|  16.9k|    igraph_vector_int_destroy(&c2);
  568|  16.9k|    IGRAPH_FINALLY_CLEAN(2);
  569|       |
  570|  16.9k|    return IGRAPH_SUCCESS;
  571|  16.9k|}
community_misc.c:igraph_i_compare_communities_nmi:
  759|  3.40k|                                     igraph_real_t* result) {
  760|  3.40k|    double h1, h2, mut_inf;
  761|       |
  762|  3.40k|    IGRAPH_CHECK(igraph_i_entropy_and_mutual_information(v1, v2, &h1, &h2, &mut_inf));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  763|       |
  764|  3.40k|    if (h1 == 0 && h2 == 0) {
  ------------------
  |  Branch (764:9): [True: 40, False: 3.36k]
  |  Branch (764:20): [True: 24, False: 16]
  ------------------
  765|     24|        *result = 1;
  766|  3.37k|    } else {
  767|  3.37k|        *result = 2 * mut_inf / (h1 + h2);
  768|  3.37k|    }
  769|       |
  770|  3.40k|    return IGRAPH_SUCCESS;
  771|  3.40k|}
community_misc.c:igraph_i_entropy_and_mutual_information:
  659|  6.80k|        const igraph_vector_int_t* v2, double* h1, double* h2, double* mut_inf) {
  660|  6.80k|    igraph_int_t i, n;
  661|  6.80k|    igraph_int_t k1;
  662|  6.80k|    igraph_int_t k2;
  663|  6.80k|    igraph_real_t *p1, *p2;
  664|  6.80k|    igraph_sparsemat_t m;
  665|  6.80k|    igraph_sparsemat_t mu; /* uncompressed */
  666|  6.80k|    igraph_sparsemat_iterator_t mit;
  667|       |
  668|  6.80k|    n = igraph_vector_int_size(v1);
  669|  6.80k|    if (n == 0) {
  ------------------
  |  Branch (669:9): [True: 2, False: 6.79k]
  ------------------
  670|      2|        *h1 = 0;
  671|      2|        *h2 = 0;
  672|      2|        *mut_inf = 0;
  673|      2|        return IGRAPH_SUCCESS;
  674|      2|    }
  675|  6.79k|    k1 = igraph_vector_int_max(v1) + 1;
  676|  6.79k|    k2 = igraph_vector_int_max(v2) + 1;
  677|  6.79k|    p1 = IGRAPH_CALLOC(k1, igraph_real_t);
  ------------------
  |  |   33|  6.79k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  13.5k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 6.79k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 6.79k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 6.79k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  678|  6.79k|    if (p1 == 0) {
  ------------------
  |  Branch (678:9): [True: 0, False: 6.79k]
  ------------------
  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|  6.79k|    IGRAPH_FINALLY(igraph_free, p1);
  ------------------
  |  |  603|  6.79k|    do { \
  |  |  604|  6.79k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.79k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.79k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.79k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.79k]
  |  |  ------------------
  |  |  608|  6.79k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.79k]
  |  |  ------------------
  ------------------
  682|  6.79k|    p2 = IGRAPH_CALLOC(k2, igraph_real_t);
  ------------------
  |  |   33|  6.79k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  13.5k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 6.79k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 6.79k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 6.79k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  683|  6.79k|    if (p2 == 0) {
  ------------------
  |  Branch (683:9): [True: 0, False: 6.79k]
  ------------------
  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|  6.79k|    IGRAPH_FINALLY(igraph_free, p2);
  ------------------
  |  |  603|  6.79k|    do { \
  |  |  604|  6.79k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.79k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.79k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.79k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.79k]
  |  |  ------------------
  |  |  608|  6.79k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.79k]
  |  |  ------------------
  ------------------
  687|       |
  688|       |    /* Calculate the entropy of v1 */
  689|  6.79k|    *h1 = 0.0;
  690|   311k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (690:17): [True: 304k, False: 6.79k]
  ------------------
  691|   304k|        p1[VECTOR(*v1)[i]]++;
  ------------------
  |  |   60|   304k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  692|   304k|    }
  693|   308k|    for (i = 0; i < k1; i++) {
  ------------------
  |  Branch (693:17): [True: 301k, False: 6.79k]
  ------------------
  694|   301k|        p1[i] /= n;
  695|   301k|        *h1 -= p1[i] * log(p1[i]);
  696|   301k|    }
  697|       |
  698|       |    /* Calculate the entropy of v2 */
  699|  6.79k|    *h2 = 0.0;
  700|   311k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (700:17): [True: 304k, False: 6.79k]
  ------------------
  701|   304k|        p2[VECTOR(*v2)[i]]++;
  ------------------
  |  |   60|   304k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  702|   304k|    }
  703|   258k|    for (i = 0; i < k2; i++) {
  ------------------
  |  Branch (703:17): [True: 251k, False: 6.79k]
  ------------------
  704|   251k|        p2[i] /= n;
  705|   251k|        *h2 -= p2[i] * log(p2[i]);
  706|   251k|    }
  707|       |
  708|       |    /* We will only need the logs of p1 and p2 from now on */
  709|   308k|    for (i = 0; i < k1; i++) {
  ------------------
  |  Branch (709:17): [True: 301k, False: 6.79k]
  ------------------
  710|   301k|        p1[i] = log(p1[i]);
  711|   301k|    }
  712|   258k|    for (i = 0; i < k2; i++) {
  ------------------
  |  Branch (712:17): [True: 251k, False: 6.79k]
  ------------------
  713|   251k|        p2[i] = log(p2[i]);
  714|   251k|    }
  715|       |
  716|       |    /* Calculate the mutual information of v1 and v2 */
  717|  6.79k|    *mut_inf = 0.0;
  718|  6.79k|    IGRAPH_CHECK(igraph_sparsemat_init(&mu, k1, k2, n));
  ------------------
  |  |  656|  6.79k|    do { \
  |  |  657|  6.79k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.79k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.79k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.79k]
  |  |  ------------------
  ------------------
  719|  6.79k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &mu);
  ------------------
  |  |  603|  6.79k|    do { \
  |  |  604|  6.79k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.79k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.79k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.79k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.79k]
  |  |  ------------------
  |  |  608|  6.79k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.79k]
  |  |  ------------------
  ------------------
  720|   311k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (720:17): [True: 304k, False: 6.79k]
  ------------------
  721|   304k|        IGRAPH_CHECK(igraph_sparsemat_entry(
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  722|   304k|            &mu, VECTOR(*v1)[i],
  723|   304k|            VECTOR(*v2)[i], 1
  724|   304k|        ));
  725|   304k|    }
  726|       |
  727|  6.79k|    IGRAPH_CHECK(igraph_sparsemat_compress(&mu, &m));
  ------------------
  |  |  656|  6.79k|    do { \
  |  |  657|  6.79k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.79k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.79k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.79k]
  |  |  ------------------
  ------------------
  728|  6.79k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &m);
  ------------------
  |  |  603|  6.79k|    do { \
  |  |  604|  6.79k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.79k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.79k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.79k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.79k]
  |  |  ------------------
  |  |  608|  6.79k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.79k]
  |  |  ------------------
  ------------------
  729|  6.79k|    IGRAPH_CHECK(igraph_sparsemat_dupl(&m));
  ------------------
  |  |  656|  6.79k|    do { \
  |  |  657|  6.79k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.79k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.79k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.79k]
  |  |  ------------------
  ------------------
  730|       |
  731|  6.79k|    IGRAPH_CHECK(igraph_sparsemat_iterator_init(&mit, &m));
  ------------------
  |  |  656|  6.79k|    do { \
  |  |  657|  6.79k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.79k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.79k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.79k]
  |  |  ------------------
  ------------------
  732|   308k|    while (!igraph_sparsemat_iterator_end(&mit)) {
  ------------------
  |  Branch (732:12): [True: 302k, False: 6.79k]
  ------------------
  733|   302k|        double p = igraph_sparsemat_iterator_get(&mit)/ n;
  734|   302k|        *mut_inf += p * (log(p) - p1[igraph_sparsemat_iterator_row(&mit)] - p2[igraph_sparsemat_iterator_col(&mit)]);
  735|   302k|        igraph_sparsemat_iterator_next(&mit);
  736|   302k|    }
  737|  6.79k|    igraph_sparsemat_destroy(&m);
  738|  6.79k|    igraph_sparsemat_destroy(&mu);
  739|  6.79k|    IGRAPH_FREE(p1); IGRAPH_FREE(p2);
  ------------------
  |  |   36|  6.79k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
                  IGRAPH_FREE(p1); IGRAPH_FREE(p2);
  ------------------
  |  |   36|  6.79k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  740|       |
  741|  6.79k|    IGRAPH_FINALLY_CLEAN(4);
  742|       |
  743|  6.79k|    return IGRAPH_SUCCESS;
  744|  6.79k|}
community_misc.c:igraph_i_compare_communities_vi:
  789|  3.40k|                                    igraph_real_t* result) {
  790|  3.40k|    double h1, h2, mut_inf;
  791|       |
  792|  3.40k|    IGRAPH_CHECK(igraph_i_entropy_and_mutual_information(v1, v2, &h1, &h2, &mut_inf));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  793|  3.40k|    *result = h1 + h2 - 2 * mut_inf;
  794|       |
  795|  3.40k|    return IGRAPH_SUCCESS;
  796|  3.40k|}
community_misc.c:igraph_i_split_join_distance:
  848|  3.40k|                                 igraph_int_t* distance12, igraph_int_t* distance21) {
  849|  3.40k|    igraph_int_t n = igraph_vector_int_size(v1);
  850|  3.40k|    igraph_vector_t rowmax, colmax;
  851|  3.40k|    igraph_sparsemat_t m;
  852|  3.40k|    igraph_sparsemat_t mu; /* uncompressed */
  853|  3.40k|    igraph_sparsemat_iterator_t mit;
  854|       |
  855|  3.40k|    if (n == 0) {
  ------------------
  |  Branch (855:9): [True: 1, False: 3.39k]
  ------------------
  856|      1|        *distance12 = 0;
  857|      1|        *distance21 = 0;
  858|      1|        return IGRAPH_SUCCESS;
  859|      1|    }
  860|       |    /* Calculate the confusion matrix */
  861|  3.39k|    IGRAPH_CHECK(igraph_sparsemat_init(&mu, 1, 1, 0));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  862|  3.39k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &mu);
  ------------------
  |  |  603|  3.39k|    do { \
  |  |  604|  3.39k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.39k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.39k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.39k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.39k]
  |  |  ------------------
  |  |  608|  3.39k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  863|  3.39k|    IGRAPH_CHECK(igraph_i_confusion_matrix(v1, v2, &mu));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  864|       |
  865|       |    /* Initialize vectors that will store the row/columnwise maxima */
  866|  3.39k|    IGRAPH_VECTOR_INIT_FINALLY(&rowmax, igraph_sparsemat_nrow(&mu));
  ------------------
  |  |  104|  3.39k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.39k|    do { \
  |  |  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.39k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.39k|    do { \
  |  |  |  |  604|  3.39k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.39k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.39k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.39k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.39k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.39k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.39k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  867|  3.39k|    IGRAPH_VECTOR_INIT_FINALLY(&colmax, igraph_sparsemat_ncol(&mu));
  ------------------
  |  |  104|  3.39k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.39k|    do { \
  |  |  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.39k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.39k|    do { \
  |  |  |  |  604|  3.39k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.39k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.39k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.39k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.39k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.39k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.39k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  868|       |
  869|       |    /* Find the row/columnwise maxima */
  870|  3.39k|    igraph_sparsemat_compress(&mu, &m);
  871|  3.39k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &m);
  ------------------
  |  |  603|  3.39k|    do { \
  |  |  604|  3.39k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.39k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.39k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.39k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.39k]
  |  |  ------------------
  |  |  608|  3.39k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  872|  3.39k|    IGRAPH_CHECK(igraph_sparsemat_dupl(&m));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  873|  3.39k|    IGRAPH_CHECK(igraph_sparsemat_iterator_init(&mit, &m));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  874|   154k|    while (!igraph_sparsemat_iterator_end(&mit)) {
  ------------------
  |  Branch (874:12): [True: 151k, False: 3.39k]
  ------------------
  875|   151k|        igraph_real_t value = igraph_sparsemat_iterator_get(&mit);
  876|   151k|        igraph_int_t row = igraph_sparsemat_iterator_row(&mit);
  877|   151k|        igraph_int_t col = igraph_sparsemat_iterator_col(&mit);
  878|   151k|        if (value > VECTOR(rowmax)[row]) {
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (878:13): [True: 150k, False: 105]
  ------------------
  879|   150k|            VECTOR(rowmax)[row] = value;
  ------------------
  |  |   60|   150k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  880|   150k|        }
  881|   151k|        if (value > VECTOR(colmax)[col]) {
  ------------------
  |  |   60|   151k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (881:13): [True: 125k, False: 25.2k]
  ------------------
  882|   125k|            VECTOR(colmax)[col] = value;
  ------------------
  |  |   60|   125k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  883|   125k|        }
  884|   151k|        igraph_sparsemat_iterator_next(&mit);
  885|   151k|    }
  886|       |
  887|       |    /* Calculate the distances */
  888|  3.39k|    *distance12 = (igraph_int_t) (n - igraph_vector_sum(&rowmax));
  889|  3.39k|    *distance21 = (igraph_int_t) (n - igraph_vector_sum(&colmax));
  890|       |
  891|  3.39k|    igraph_vector_destroy(&rowmax);
  892|  3.39k|    igraph_vector_destroy(&colmax);
  893|  3.39k|    igraph_sparsemat_destroy(&m);
  894|  3.39k|    igraph_sparsemat_destroy(&mu);
  895|  3.39k|    IGRAPH_FINALLY_CLEAN(4);
  896|       |
  897|  3.39k|    return IGRAPH_SUCCESS;
  898|  3.39k|}
community_misc.c:igraph_i_confusion_matrix:
  810|  10.1k|                              igraph_sparsemat_t *m) {
  811|  10.1k|    igraph_int_t k1, k2, i, n;
  812|       |
  813|  10.1k|    n = igraph_vector_int_size(v1);
  814|  10.1k|    if (n == 0) {
  ------------------
  |  Branch (814:9): [True: 0, False: 10.1k]
  ------------------
  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.1k|    k1 = igraph_vector_int_max(v1) + 1;
  820|  10.1k|    k2 = igraph_vector_int_max(v2) + 1;
  821|  10.1k|    IGRAPH_CHECK(igraph_sparsemat_resize(m, k1, k2, n));
  ------------------
  |  |  656|  10.1k|    do { \
  |  |  657|  10.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.1k]
  |  |  ------------------
  ------------------
  822|   466k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (822:17): [True: 456k, False: 10.1k]
  ------------------
  823|   456k|        IGRAPH_CHECK(igraph_sparsemat_entry(
  ------------------
  |  |  656|   456k|    do { \
  |  |  657|   456k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   456k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   456k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 456k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   456k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 456k]
  |  |  ------------------
  ------------------
  824|   456k|            m, VECTOR(*v1)[i], VECTOR(*v2)[i], 1
  825|   456k|        ));
  826|   456k|    }
  827|       |
  828|  10.1k|    return IGRAPH_SUCCESS;
  829|  10.1k|}
community_misc.c:igraph_i_compare_communities_rand:
  924|  6.77k|        igraph_real_t *result, igraph_bool_t adjust) {
  925|  6.77k|    igraph_sparsemat_t m;
  926|  6.77k|    igraph_sparsemat_t mu; /* uncompressed */
  927|  6.77k|    igraph_sparsemat_iterator_t mit;
  928|  6.77k|    igraph_vector_t rowsums, colsums;
  929|  6.77k|    igraph_int_t i, nrow, ncol;
  930|  6.77k|    igraph_real_t rand, n;
  931|  6.77k|    igraph_real_t frac_pairs_in_1, frac_pairs_in_2;
  932|       |
  933|  6.77k|    if (igraph_vector_int_size(v1) <= 1) {
  ------------------
  |  Branch (933:9): [True: 0, False: 6.77k]
  ------------------
  934|      0|        IGRAPH_ERRORF("Rand indices not defined for only zero or one vertices. "
  ------------------
  |  |  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|  6.77k|    IGRAPH_CHECK(igraph_sparsemat_init(&mu, 1, 1, 0));
  ------------------
  |  |  656|  6.77k|    do { \
  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  940|  6.77k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &mu);
  ------------------
  |  |  603|  6.77k|    do { \
  |  |  604|  6.77k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.77k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.77k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.77k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.77k]
  |  |  ------------------
  |  |  608|  6.77k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  941|  6.77k|    IGRAPH_CHECK(igraph_i_confusion_matrix(v1, v2, &mu));
  ------------------
  |  |  656|  6.77k|    do { \
  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  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|  6.77k|    nrow = igraph_sparsemat_nrow(&mu);
  974|  6.77k|    ncol = igraph_sparsemat_ncol(&mu);
  975|  6.77k|    n = igraph_vector_int_size(v1);
  976|  6.77k|    IGRAPH_VECTOR_INIT_FINALLY(&rowsums, nrow);
  ------------------
  |  |  104|  6.77k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.77k|    do { \
  |  |  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  6.77k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.77k|    do { \
  |  |  |  |  604|  6.77k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.77k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.77k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.77k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.77k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.77k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.77k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  977|  6.77k|    IGRAPH_VECTOR_INIT_FINALLY(&colsums, ncol);
  ------------------
  |  |  104|  6.77k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.77k|    do { \
  |  |  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  6.77k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.77k|    do { \
  |  |  |  |  604|  6.77k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.77k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.77k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.77k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.77k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.77k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.77k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  978|  6.77k|    IGRAPH_CHECK(igraph_sparsemat_rowsums(&mu, &rowsums));
  ------------------
  |  |  656|  6.77k|    do { \
  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  979|  6.77k|    IGRAPH_CHECK(igraph_sparsemat_colsums(&mu, &colsums));
  ------------------
  |  |  656|  6.77k|    do { \
  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  980|       |
  981|       |    /* Start calculating the unadjusted Rand index */
  982|  6.77k|    rand = 0.0;
  983|  6.77k|    igraph_sparsemat_compress(&mu, &m);
  984|  6.77k|    IGRAPH_FINALLY(igraph_sparsemat_destroy, &m);
  ------------------
  |  |  603|  6.77k|    do { \
  |  |  604|  6.77k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.77k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.77k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.77k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.77k]
  |  |  ------------------
  |  |  608|  6.77k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  985|  6.77k|    IGRAPH_CHECK(igraph_sparsemat_dupl(&m));
  ------------------
  |  |  656|  6.77k|    do { \
  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  986|       |
  987|  6.77k|    IGRAPH_CHECK(igraph_sparsemat_iterator_init(&mit, &m));
  ------------------
  |  |  656|  6.77k|    do { \
  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
  988|   308k|    while (!igraph_sparsemat_iterator_end(&mit)) {
  ------------------
  |  Branch (988:12): [True: 302k, False: 6.77k]
  ------------------
  989|   302k|        igraph_real_t value = igraph_sparsemat_iterator_get(&mit);
  990|   302k|        rand += (value / n) * (value - 1) / (n - 1);
  991|   302k|        igraph_sparsemat_iterator_next(&mit);
  992|   302k|    }
  993|       |
  994|  6.77k|    frac_pairs_in_1 = frac_pairs_in_2 = 0.0;
  995|   308k|    for (i = 0; i < nrow; i++) {
  ------------------
  |  Branch (995:17): [True: 301k, False: 6.77k]
  ------------------
  996|   301k|        frac_pairs_in_1 += (VECTOR(rowsums)[i] / n) * (VECTOR(rowsums)[i] - 1) / (n - 1);
  ------------------
  |  |   60|   301k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      frac_pairs_in_1 += (VECTOR(rowsums)[i] / n) * (VECTOR(rowsums)[i] - 1) / (n - 1);
  ------------------
  |  |   60|   301k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  997|   301k|    }
  998|   258k|    for (i = 0; i < ncol; i++) {
  ------------------
  |  Branch (998:17): [True: 251k, False: 6.77k]
  ------------------
  999|   251k|        frac_pairs_in_2 += (VECTOR(colsums)[i] / n) * (VECTOR(colsums)[i] - 1) / (n - 1);
  ------------------
  |  |   60|   251k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      frac_pairs_in_2 += (VECTOR(colsums)[i] / n) * (VECTOR(colsums)[i] - 1) / (n - 1);
  ------------------
  |  |   60|   251k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1000|   251k|    }
 1001|       |
 1002|  6.77k|    rand = 1.0 + 2 * rand - frac_pairs_in_1 - frac_pairs_in_2;
 1003|       |
 1004|  6.77k|    if (adjust) {
  ------------------
  |  Branch (1004:9): [True: 3.38k, False: 3.38k]
  ------------------
 1005|  3.38k|        double expected = frac_pairs_in_1 * frac_pairs_in_2 +
 1006|  3.38k|                          (1 - frac_pairs_in_1) * (1 - frac_pairs_in_2);
 1007|  3.38k|        rand = (rand - expected) / (1 - expected);
 1008|  3.38k|    }
 1009|       |
 1010|  6.77k|    igraph_vector_destroy(&rowsums);
 1011|  6.77k|    igraph_vector_destroy(&colsums);
 1012|  6.77k|    igraph_sparsemat_destroy(&m);
 1013|  6.77k|    igraph_sparsemat_destroy(&mu);
 1014|  6.77k|    IGRAPH_FINALLY_CLEAN(4);
 1015|       |
 1016|  6.77k|    *result = rand;
 1017|       |
 1018|  6.77k|    return IGRAPH_SUCCESS;
 1019|  6.77k|}

igraph_community_eb_get_merges:
  225|  3.40k|                                   igraph_vector_int_t *membership) {
  226|       |
  227|  3.40k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  228|  3.40k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  229|  3.40k|    igraph_vector_int_t ptr;
  230|  3.40k|    igraph_int_t midx = 0;
  231|  3.40k|    igraph_int_t no_comps;
  232|  3.40k|    const igraph_int_t no_removed_edges = igraph_vector_int_size(edges);
  233|  3.40k|    igraph_int_t max_merges;
  234|       |
  235|  3.40k|    if (! igraph_vector_int_isininterval(edges, 0, no_of_edges-1)) {
  ------------------
  |  Branch (235:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    if (no_removed_edges < no_of_edges) {
  ------------------
  |  Branch (241:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    if (no_of_nodes == 0) {
  ------------------
  |  Branch (248:9): [True: 1, False: 3.39k]
  ------------------
  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.39k|    if (membership || modularity) {
  ------------------
  |  Branch (265:9): [True: 3.39k, False: 0]
  |  Branch (265:23): [True: 0, False: 0]
  ------------------
  266|  3.39k|        return igraph_i_community_eb_get_merges2(graph,
  267|  3.39k|                directed && igraph_is_directed(graph),
  ------------------
  |  Branch (267:17): [True: 3.39k, False: 0]
  |  Branch (267:29): [True: 3.39k, False: 0]
  ------------------
  268|  3.39k|                edges, weights,
  269|  3.39k|                res, bridges, modularity, membership);
  270|  3.39k|    }
  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.40k|                                      const igraph_vector_t *lengths) {
  457|       |
  458|  3.40k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  459|  3.40k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  460|  3.40k|    double *distance, *tmpscore;
  461|  3.40k|    double *nrgeo;
  462|       |
  463|  3.40k|    igraph_inclist_t elist_out, elist_in, parents;
  464|  3.40k|    igraph_inclist_t *elist_out_p, *elist_in_p;
  465|  3.40k|    igraph_vector_int_t *neip;
  466|  3.40k|    igraph_int_t neino;
  467|  3.40k|    igraph_vector_t eb;
  468|  3.40k|    igraph_int_t maxedge, pos;
  469|  3.40k|    igraph_int_t from, to;
  470|  3.40k|    igraph_bool_t result_owned = false;
  471|  3.40k|    igraph_stack_int_t stack;
  472|  3.40k|    igraph_real_t steps, steps_done;
  473|  3.40k|    igraph_bitset_t passive;
  474|       |
  475|       |    /* Needed only for the unweighted case */
  476|  3.40k|    igraph_dqueue_int_t q;
  477|       |
  478|       |    /* Needed only for the weighted case */
  479|  3.40k|    igraph_2wheap_t heap;
  480|       |
  481|  3.40k|    if (removed_edges == NULL) {
  ------------------
  |  Branch (481:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    directed = directed && igraph_is_directed(graph);
  ------------------
  |  Branch (490:16): [True: 3.40k, False: 0]
  |  Branch (490:28): [True: 3.40k, False: 0]
  ------------------
  491|  3.40k|    if (directed) {
  ------------------
  |  Branch (491:9): [True: 3.40k, False: 0]
  ------------------
  492|  3.40k|        IGRAPH_CHECK(igraph_inclist_init(graph, &elist_out, IGRAPH_OUT, IGRAPH_LOOPS_ONCE));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  493|  3.40k|        IGRAPH_FINALLY(igraph_inclist_destroy, &elist_out);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  494|  3.40k|        IGRAPH_CHECK(igraph_inclist_init(graph, &elist_in, IGRAPH_IN, IGRAPH_LOOPS_ONCE));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  495|  3.40k|        IGRAPH_FINALLY(igraph_inclist_destroy, &elist_in);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  496|  3.40k|        elist_out_p = &elist_out;
  497|  3.40k|        elist_in_p = &elist_in;
  498|  3.40k|    } 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.40k|    distance = IGRAPH_CALLOC(no_of_nodes, double);
  ------------------
  |  |   33|  3.40k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.80k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.39k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  505|  3.40k|    IGRAPH_CHECK_OOM(distance, "Insufficient memory for edge betweenness-based community detection.");
  ------------------
  |  |  709|  3.40k|    do { \
  |  |  710|  3.40k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  506|  3.40k|    IGRAPH_FINALLY(igraph_free, distance);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  507|       |
  508|  3.40k|    nrgeo = IGRAPH_CALLOC(no_of_nodes, double);
  ------------------
  |  |   33|  3.40k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.80k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.39k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  509|  3.40k|    IGRAPH_CHECK_OOM(nrgeo, "Insufficient memory for edge betweenness-based community detection.");
  ------------------
  |  |  709|  3.40k|    do { \
  |  |  710|  3.40k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  510|  3.40k|    IGRAPH_FINALLY(igraph_free, nrgeo);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  511|       |
  512|  3.40k|    tmpscore = IGRAPH_CALLOC(no_of_nodes, double);
  ------------------
  |  |   33|  3.40k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.80k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.39k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|  3.40k|    IGRAPH_CHECK_OOM(tmpscore, "Insufficient memory for edge betweenness-based community detection.");
  ------------------
  |  |  709|  3.40k|    do { \
  |  |  710|  3.40k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  514|  3.40k|    IGRAPH_FINALLY(igraph_free, tmpscore);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  515|       |
  516|  3.40k|    if (weights) {
  ------------------
  |  Branch (516:9): [True: 3.40k, False: 0]
  ------------------
  517|  3.40k|        if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (517:13): [True: 0, False: 3.40k]
  ------------------
  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.40k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (521:13): [True: 3.35k, False: 43]
  ------------------
  522|       |            /* Must not call vector_min on empty vector */
  523|  3.35k|            igraph_real_t minweight = igraph_vector_min(weights);
  524|  3.35k|            if (minweight <= 0) {
  ------------------
  |  Branch (524:17): [True: 0, False: 3.35k]
  ------------------
  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.35k|            if (isnan(minweight)) {
  ------------------
  |  Branch (528:17): [True: 0, False: 3.35k]
  ------------------
  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.35k|        }
  532|  3.40k|    }
  533|       |
  534|  3.40k|    if (lengths == NULL) {
  ------------------
  |  Branch (534:9): [True: 3.40k, False: 0]
  ------------------
  535|  3.40k|        IGRAPH_DQUEUE_INT_INIT_FINALLY(&q, 100);
  ------------------
  |  |   61|  3.40k|    do { IGRAPH_CHECK(igraph_dqueue_int_init(q, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  3.40k|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, q); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  536|  3.40k|    } 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.40k|    IGRAPH_STACK_INT_INIT_FINALLY(&stack, no_of_nodes);
  ------------------
  |  |   61|  3.40k|    do { IGRAPH_CHECK(igraph_stack_int_init(s, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  3.40k|        IGRAPH_FINALLY(igraph_stack_int_destroy, s); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:63): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  560|       |
  561|  3.40k|    IGRAPH_CHECK(igraph_vector_int_resize(removed_edges, no_of_edges));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  562|  3.40k|    if (edge_betweenness) {
  ------------------
  |  Branch (562:9): [True: 3.40k, False: 0]
  ------------------
  563|  3.40k|        IGRAPH_CHECK(igraph_vector_resize(edge_betweenness, no_of_edges));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  564|  3.40k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (564:13): [True: 3.35k, False: 43]
  ------------------
  565|  3.35k|            VECTOR(*edge_betweenness)[no_of_edges - 1] = 0;
  ------------------
  |  |   60|  3.35k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  566|  3.35k|        }
  567|  3.40k|    }
  568|       |
  569|  3.40k|    IGRAPH_VECTOR_INIT_FINALLY(&eb, no_of_edges);
  ------------------
  |  |  104|  3.40k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.40k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  570|  3.40k|    IGRAPH_BITSET_INIT_FINALLY(&passive, no_of_edges);
  ------------------
  |  |  259|  3.40k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  3.40k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  3.40k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  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.40k|    steps = no_of_edges / 2.0 * (no_of_edges + 1);
  579|  3.40k|    steps_done = 0;
  580|       |
  581|  95.0k|    for (igraph_int_t e = 0; e < no_of_edges; steps_done += no_of_edges - e, e++) {
  ------------------
  |  Branch (581:30): [True: 91.6k, False: 3.40k]
  ------------------
  582|  91.6k|        IGRAPH_PROGRESS("Edge betweenness community detection: ",
  ------------------
  |  |  169|  91.6k|    do { \
  |  |  170|  91.6k|        IGRAPH_CHECK(igraph_progress((message), (percent), (data))); \
  |  |  ------------------
  |  |  |  |  656|  91.6k|    do { \
  |  |  |  |  657|  91.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  91.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  91.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 91.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|  91.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 91.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  91.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (171:14): [Folded, False: 91.6k]
  |  |  ------------------
  ------------------
  583|  91.6k|                        100.0 * steps_done / steps, NULL);
  584|       |
  585|  91.6k|        igraph_vector_null(&eb);
  586|       |
  587|  91.6k|        if (lengths == NULL) {
  ------------------
  |  Branch (587:13): [True: 91.6k, False: 0]
  ------------------
  588|       |            /* Unweighted variant follows */
  589|       |
  590|       |            /* The following for loop is copied almost intact from
  591|       |             * igraph_edge_betweenness_cutoff */
  592|  4.92M|            for (igraph_int_t source = 0; source < no_of_nodes; source++) {
  ------------------
  |  Branch (592:43): [True: 4.83M, False: 91.6k]
  ------------------
  593|       |
  594|  4.83M|                IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  4.83M|    do { \
  |  |   47|  4.83M|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 4.83M]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  4.83M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 4.83M]
  |  |  ------------------
  ------------------
  595|       |
  596|  4.83M|                memset(distance, 0, (size_t) no_of_nodes * sizeof(double));
  597|  4.83M|                memset(nrgeo, 0, (size_t) no_of_nodes * sizeof(double));
  598|  4.83M|                memset(tmpscore, 0, (size_t) no_of_nodes * sizeof(double));
  599|  4.83M|                igraph_stack_int_clear(&stack); /* it should be empty anyway... */
  600|       |
  601|  4.83M|                IGRAPH_CHECK(igraph_dqueue_int_push(&q, source));
  ------------------
  |  |  656|  4.83M|    do { \
  |  |  657|  4.83M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.83M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.83M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.83M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.83M]
  |  |  ------------------
  ------------------
  602|       |
  603|  4.83M|                nrgeo[source] = 1;
  604|  4.83M|                distance[source] = 0;
  605|       |
  606|  20.2M|                while (!igraph_dqueue_int_empty(&q)) {
  ------------------
  |  Branch (606:24): [True: 15.4M, False: 4.83M]
  ------------------
  607|  15.4M|                    igraph_int_t actnode = igraph_dqueue_int_pop(&q);
  608|       |
  609|  15.4M|                    neip = igraph_inclist_get(elist_out_p, actnode);
  ------------------
  |  |  102|  15.4M|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  610|  15.4M|                    neino = igraph_vector_int_size(neip);
  611|  44.0M|                    for (igraph_int_t i = 0; i < neino; i++) {
  ------------------
  |  Branch (611:46): [True: 28.6M, False: 15.4M]
  ------------------
  612|  28.6M|                        igraph_int_t edge = VECTOR(*neip)[i];
  ------------------
  |  |   60|  28.6M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  613|  28.6M|                        igraph_int_t neighbor = IGRAPH_OTHER(graph, edge, actnode);
  ------------------
  |  |  146|  28.6M|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  28.6M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  28.6M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|  3.41M|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  3.41M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  25.2M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  25.2M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 3.41M, False: 25.2M]
  |  |  ------------------
  ------------------
  614|  28.6M|                        if (nrgeo[neighbor] != 0) {
  ------------------
  |  Branch (614:29): [True: 18.0M, False: 10.6M]
  ------------------
  615|       |                            /* we've already seen this node, another shortest path? */
  616|  18.0M|                            if (distance[neighbor] == distance[actnode] + 1) {
  ------------------
  |  Branch (616:33): [True: 3.66M, False: 14.3M]
  ------------------
  617|  3.66M|                                nrgeo[neighbor] += nrgeo[actnode];
  618|  3.66M|                            }
  619|  18.0M|                        } else {
  620|       |                            /* we haven't seen this node yet */
  621|  10.6M|                            nrgeo[neighbor] += nrgeo[actnode];
  622|  10.6M|                            distance[neighbor] = distance[actnode] + 1;
  623|  10.6M|                            IGRAPH_CHECK(igraph_dqueue_int_push(&q, neighbor));
  ------------------
  |  |  656|  10.6M|    do { \
  |  |  657|  10.6M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.6M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.6M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.6M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.6M]
  |  |  ------------------
  ------------------
  624|  10.6M|                            IGRAPH_CHECK(igraph_stack_int_push(&stack, neighbor));
  ------------------
  |  |  656|  10.6M|    do { \
  |  |  657|  10.6M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.6M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.6M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.6M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.6M]
  |  |  ------------------
  ------------------
  625|  10.6M|                        }
  626|  28.6M|                    }
  627|  15.4M|                } /* 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|  15.4M|                while (!igraph_stack_int_empty(&stack)) {
  ------------------
  |  Branch (632:24): [True: 10.6M, False: 4.83M]
  ------------------
  633|  10.6M|                    igraph_int_t actnode = igraph_stack_int_pop(&stack);
  634|  10.6M|                    if (distance[actnode] < 1) {
  ------------------
  |  Branch (634:25): [True: 0, False: 10.6M]
  ------------------
  635|      0|                        continue;    /* skip source node */
  636|      0|                    }
  637|       |
  638|       |                    /* set the temporary score of the friends */
  639|  10.6M|                    neip = igraph_inclist_get(elist_in_p, actnode);
  ------------------
  |  |  102|  10.6M|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  640|  10.6M|                    neino = igraph_vector_int_size(neip);
  641|  46.0M|                    for (igraph_int_t i = 0; i < neino; i++) {
  ------------------
  |  Branch (641:46): [True: 35.4M, False: 10.6M]
  ------------------
  642|  35.4M|                        igraph_int_t edge = VECTOR(*neip)[i];
  ------------------
  |  |   60|  35.4M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  643|  35.4M|                        igraph_int_t neighbor = IGRAPH_OTHER(graph, edge, actnode);
  ------------------
  |  |  146|  35.4M|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  35.4M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  35.4M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|  35.4M|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  35.4M|#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: 35.4M, False: 0]
  |  |  ------------------
  ------------------
  644|  35.4M|                        if (distance[neighbor] == distance[actnode] - 1 &&
  ------------------
  |  Branch (644:29): [True: 17.6M, False: 17.7M]
  ------------------
  645|  17.6M|                            nrgeo[neighbor] != 0) {
  ------------------
  |  Branch (645:29): [True: 14.2M, False: 3.34M]
  ------------------
  646|  14.2M|                            tmpscore[neighbor] +=
  647|  14.2M|                                (tmpscore[actnode] + 1) * nrgeo[neighbor] / nrgeo[actnode];
  648|  14.2M|                            VECTOR(eb)[edge] +=
  ------------------
  |  |   60|  14.2M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  649|  14.2M|                                (tmpscore[actnode] + 1) * nrgeo[neighbor] / nrgeo[actnode];
  650|  14.2M|                        }
  651|  35.4M|                    }
  652|  10.6M|                }
  653|       |                /* Ok, we've the scores for this source */
  654|  4.83M|            } /* for source <= no_of_nodes */
  655|  91.6k|        } 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|  91.6k|        maxedge = igraph_i_which_max_active_ratio(&eb, weights, &passive);
  744|  91.6k|        VECTOR(*removed_edges)[e] = maxedge;
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  745|  91.6k|        if (edge_betweenness) {
  ------------------
  |  Branch (745:13): [True: 91.6k, False: 0]
  ------------------
  746|  91.6k|            VECTOR(*edge_betweenness)[e] = VECTOR(eb)[maxedge];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*edge_betweenness)[e] = VECTOR(eb)[maxedge];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  747|  91.6k|            if (!directed) {
  ------------------
  |  Branch (747:17): [True: 0, False: 91.6k]
  ------------------
  748|      0|                VECTOR(*edge_betweenness)[e] /= 2.0;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  749|      0|            }
  750|  91.6k|        }
  751|  91.6k|        IGRAPH_BIT_SET(passive, maxedge);
  ------------------
  |  |  103|  91.6k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  91.6k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  91.6k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  91.6k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  91.6k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|  91.6k|        IGRAPH_CHECK(igraph_edge(graph, maxedge, &from, &to));
  ------------------
  |  |  656|  91.6k|    do { \
  |  |  657|  91.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  91.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  91.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 91.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|  91.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 91.6k]
  |  |  ------------------
  ------------------
  753|       |
  754|  91.6k|        neip = igraph_inclist_get(elist_in_p, to);
  ------------------
  |  |  102|  91.6k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  755|  91.6k|        neino = igraph_vector_int_size(neip);
  756|  91.6k|        igraph_vector_int_search(neip, 0, maxedge, &pos);
  757|  91.6k|        VECTOR(*neip)[pos] = VECTOR(*neip)[neino - 1];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*neip)[pos] = VECTOR(*neip)[neino - 1];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  758|  91.6k|        igraph_vector_int_pop_back(neip);
  759|       |
  760|  91.6k|        neip = igraph_inclist_get(elist_out_p, from);
  ------------------
  |  |  102|  91.6k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  761|  91.6k|        neino = igraph_vector_int_size(neip);
  762|  91.6k|        igraph_vector_int_search(neip, 0, maxedge, &pos);
  763|  91.6k|        VECTOR(*neip)[pos] = VECTOR(*neip)[neino - 1];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*neip)[pos] = VECTOR(*neip)[neino - 1];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  764|  91.6k|        igraph_vector_int_pop_back(neip);
  765|  91.6k|    }
  766|       |
  767|  3.40k|    IGRAPH_PROGRESS("Edge betweenness community detection: ", 100.0, NULL);
  ------------------
  |  |  169|  3.40k|    do { \
  |  |  170|  3.40k|        IGRAPH_CHECK(igraph_progress((message), (percent), (data))); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (171:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  768|       |
  769|  3.40k|    igraph_bitset_destroy(&passive);
  770|  3.40k|    igraph_vector_destroy(&eb);
  771|  3.40k|    igraph_stack_int_destroy(&stack);
  772|  3.40k|    IGRAPH_FINALLY_CLEAN(3);
  773|       |
  774|  3.40k|    if (lengths == NULL) {
  ------------------
  |  Branch (774:9): [True: 3.40k, False: 0]
  ------------------
  775|  3.40k|        igraph_dqueue_int_destroy(&q);
  776|  3.40k|        IGRAPH_FINALLY_CLEAN(1);
  777|  3.40k|    } else {
  778|      0|        igraph_2wheap_destroy(&heap);
  779|      0|        igraph_inclist_destroy(&parents);
  780|      0|        IGRAPH_FINALLY_CLEAN(2);
  781|      0|    }
  782|  3.40k|    igraph_free(tmpscore);
  783|  3.40k|    igraph_free(nrgeo);
  784|  3.40k|    igraph_free(distance);
  785|  3.40k|    IGRAPH_FINALLY_CLEAN(3);
  786|       |
  787|  3.40k|    if (directed) {
  ------------------
  |  Branch (787:9): [True: 3.40k, False: 0]
  ------------------
  788|  3.40k|        igraph_inclist_destroy(&elist_out);
  789|  3.40k|        igraph_inclist_destroy(&elist_in);
  790|  3.40k|        IGRAPH_FINALLY_CLEAN(2);
  791|  3.40k|    } else {
  792|      0|        igraph_inclist_destroy(&elist_out);
  793|      0|        IGRAPH_FINALLY_CLEAN(1);
  794|      0|    }
  795|       |
  796|  3.40k|    if (merges || bridges || modularity || membership) {
  ------------------
  |  Branch (796:9): [True: 3.40k, 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.40k|        IGRAPH_CHECK(igraph_community_eb_get_merges(graph, directed, removed_edges, weights, merges,
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  798|  3.40k|                     bridges, modularity,
  799|  3.40k|                     membership));
  800|  3.40k|    }
  801|       |
  802|  3.40k|    if (result_owned) {
  ------------------
  |  Branch (802:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    return IGRAPH_SUCCESS;
  809|  3.40k|}
edge_betweenness.c:igraph_i_community_eb_get_merges2:
   68|  3.39k|                                             igraph_vector_int_t *membership) {
   69|       |
   70|  3.39k|    igraph_vector_int_t mymembership;
   71|  3.39k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
   72|  3.39k|    igraph_real_t maxmod = -1;
   73|  3.39k|    igraph_int_t midx = 0;
   74|  3.39k|    igraph_int_t no_comps;
   75|  3.39k|    const igraph_bool_t use_directed = directed && igraph_is_directed(graph);
  ------------------
  |  Branch (75:40): [True: 3.39k, False: 0]
  |  Branch (75:52): [True: 3.39k, False: 0]
  ------------------
   76|  3.39k|    igraph_int_t max_merges;
   77|       |
   78|  3.39k|    if (membership) {
  ------------------
  |  Branch (78:9): [True: 3.39k, False: 0]
  ------------------
   79|  3.39k|        IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
   80|  3.39k|    }
   81|  3.39k|    if (modularity || res || bridges) {
  ------------------
  |  Branch (81:9): [True: 3.39k, False: 0]
  |  Branch (81:23): [True: 0, False: 0]
  |  Branch (81:30): [True: 0, False: 0]
  ------------------
   82|  3.39k|        IGRAPH_CHECK(igraph_connected_components(graph, NULL, NULL, &no_comps, IGRAPH_WEAK));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
   83|  3.39k|        max_merges = no_of_nodes - no_comps;
   84|       |
   85|  3.39k|        if (modularity) {
  ------------------
  |  Branch (85:13): [True: 3.39k, False: 0]
  ------------------
   86|  3.39k|            IGRAPH_CHECK(igraph_vector_resize(modularity,
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
   87|  3.39k|                                              max_merges + 1));
   88|  3.39k|        }
   89|  3.39k|        if (res) {
  ------------------
  |  Branch (89:13): [True: 3.39k, False: 0]
  ------------------
   90|  3.39k|            IGRAPH_CHECK(igraph_matrix_int_resize(res, max_merges,
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
   91|  3.39k|                                              2));
   92|  3.39k|        }
   93|  3.39k|        if (bridges) {
  ------------------
  |  Branch (93:13): [True: 3.39k, False: 0]
  ------------------
   94|  3.39k|            IGRAPH_CHECK(igraph_vector_int_resize(bridges, max_merges));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
   95|  3.39k|        }
   96|  3.39k|    }
   97|       |
   98|  3.39k|    IGRAPH_CHECK(igraph_vector_int_init_range(&mymembership, 0, no_of_nodes));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
   99|  3.39k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &mymembership);
  ------------------
  |  |  603|  3.39k|    do { \
  |  |  604|  3.39k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.39k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.39k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.39k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.39k]
  |  |  ------------------
  |  |  608|  3.39k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  100|       |
  101|  3.39k|    if (membership) {
  ------------------
  |  Branch (101:9): [True: 3.39k, False: 0]
  ------------------
  102|  3.39k|        IGRAPH_CHECK(igraph_vector_int_update(membership, &mymembership));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  103|  3.39k|    }
  104|       |
  105|  3.39k|    IGRAPH_CHECK(igraph_modularity(graph, &mymembership, weights,
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  106|  3.39k|                                   /* resolution */ 1,
  107|  3.39k|                                   use_directed, &maxmod));
  108|  3.39k|    if (modularity) {
  ------------------
  |  Branch (108:9): [True: 3.39k, False: 0]
  ------------------
  109|  3.39k|        VECTOR(*modularity)[0] = maxmod;
  ------------------
  |  |   60|  3.39k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  110|  3.39k|    }
  111|       |
  112|  95.0k|    for (igraph_int_t i = igraph_vector_int_size(edges) - 1; i >= 0; i--) {
  ------------------
  |  Branch (112:62): [True: 91.6k, False: 3.39k]
  ------------------
  113|  91.6k|        igraph_int_t edge = VECTOR(*edges)[i];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  114|  91.6k|        igraph_int_t from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|  91.6k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  115|  91.6k|        igraph_int_t to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  91.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  116|  91.6k|        igraph_int_t c1 = VECTOR(mymembership)[from];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  117|  91.6k|        igraph_int_t c2 = VECTOR(mymembership)[to];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  118|  91.6k|        igraph_real_t actmod;
  119|       |
  120|  91.6k|        if (c1 != c2) {     /* this is a merge */
  ------------------
  |  Branch (120:13): [True: 40.6k, False: 50.9k]
  ------------------
  121|  40.6k|            if (res) {
  ------------------
  |  Branch (121:17): [True: 40.6k, False: 0]
  ------------------
  122|  40.6k|                MATRIX(*res, midx, 0) = c1;
  ------------------
  |  |   83|  40.6k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  123|  40.6k|                MATRIX(*res, midx, 1) = c2;
  ------------------
  |  |   83|  40.6k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  124|  40.6k|            }
  125|  40.6k|            if (bridges) {
  ------------------
  |  Branch (125:17): [True: 40.6k, False: 0]
  ------------------
  126|  40.6k|                VECTOR(*bridges)[midx] = i;
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  127|  40.6k|            }
  128|       |
  129|       |            /* The new cluster has id no_of_nodes+midx+1 */
  130|  2.33M|            for (igraph_int_t j = 0; j < no_of_nodes; j++) {
  ------------------
  |  Branch (130:38): [True: 2.29M, False: 40.6k]
  ------------------
  131|  2.29M|                if (VECTOR(mymembership)[j] == c1 ||
  ------------------
  |  |   60|  2.29M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (131:21): [True: 205k, False: 2.08M]
  ------------------
  132|  2.08M|                    VECTOR(mymembership)[j] == c2) {
  ------------------
  |  |   60|  2.08M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (132:21): [True: 209k, False: 1.87M]
  ------------------
  133|   414k|                    VECTOR(mymembership)[j] = no_of_nodes + midx;
  ------------------
  |  |   60|   414k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  134|   414k|                }
  135|  2.29M|            }
  136|       |
  137|  40.6k|            IGRAPH_CHECK(igraph_modularity(graph, &mymembership, weights,
  ------------------
  |  |  656|  40.6k|    do { \
  |  |  657|  40.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  40.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  40.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 40.6k]
  |  |  ------------------
  ------------------
  138|  40.6k|                                           /* resolution */ 1,
  139|  40.6k|                                           use_directed, &actmod));
  140|  40.6k|            if (modularity) {
  ------------------
  |  Branch (140:17): [True: 40.6k, False: 0]
  ------------------
  141|  40.6k|                VECTOR(*modularity)[midx + 1] = actmod;
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  142|  40.6k|                if (actmod > maxmod) {
  ------------------
  |  Branch (142:21): [True: 25.0k, False: 15.6k]
  ------------------
  143|  25.0k|                    maxmod = actmod;
  144|  25.0k|                    if (membership) {
  ------------------
  |  Branch (144:25): [True: 25.0k, False: 0]
  ------------------
  145|  25.0k|                        IGRAPH_CHECK(igraph_vector_int_update(membership, &mymembership));
  ------------------
  |  |  656|  25.0k|    do { \
  |  |  657|  25.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  25.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  25.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 25.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|  25.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  146|  25.0k|                    }
  147|  25.0k|                }
  148|  40.6k|            }
  149|       |
  150|  40.6k|            midx++;
  151|  40.6k|        }
  152|  91.6k|    }
  153|       |
  154|  3.39k|    if (membership) {
  ------------------
  |  Branch (154:9): [True: 3.39k, False: 0]
  ------------------
  155|  3.39k|        IGRAPH_CHECK(igraph_i_rewrite_membership_vector(membership));
  ------------------
  |  |  656|  3.39k|    do { \
  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
  156|  3.39k|    }
  157|       |
  158|  3.39k|    igraph_vector_int_destroy(&mymembership);
  159|  3.39k|    IGRAPH_FINALLY_CLEAN(1);
  160|       |
  161|  3.39k|    return IGRAPH_SUCCESS;
  162|  3.39k|}
edge_betweenness.c:igraph_i_rewrite_membership_vector:
   39|  3.39k|static igraph_error_t igraph_i_rewrite_membership_vector(igraph_vector_int_t *membership) {
   40|  3.39k|    const igraph_int_t no = igraph_vector_int_max(membership) + 1;
   41|  3.39k|    igraph_vector_int_t idx;
   42|  3.39k|    igraph_int_t realno = 0;
   43|  3.39k|    const igraph_int_t len = igraph_vector_int_size(membership);
   44|       |
   45|  3.39k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&idx, no);
  ------------------
  |  |  119|  3.39k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.39k|    do { \
  |  |  |  |  657|  3.39k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.39k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.39k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.39k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.39k|    do { \
  |  |  |  |  604|  3.39k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.39k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.39k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.39k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.39k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.39k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.39k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
   46|   155k|    for (igraph_int_t i = 0; i < len; i++) {
  ------------------
  |  Branch (46:30): [True: 152k, False: 3.39k]
  ------------------
   47|   152k|        const igraph_int_t t = VECTOR(*membership)[i];
  ------------------
  |  |   60|   152k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   48|   152k|        if (VECTOR(idx)[t]) {
  ------------------
  |  |   60|   152k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (48:13): [True: 26.5k, False: 125k]
  ------------------
   49|  26.5k|            VECTOR(*membership)[i] = VECTOR(idx)[t] - 1;
  ------------------
  |  |   60|  26.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*membership)[i] = VECTOR(idx)[t] - 1;
  ------------------
  |  |   60|  26.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   50|   125k|        } else {
   51|   125k|            VECTOR(idx)[t] = ++realno;
  ------------------
  |  |   60|   125k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   52|   125k|            VECTOR(*membership)[i] = VECTOR(idx)[t] - 1;
  ------------------
  |  |   60|   125k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*membership)[i] = VECTOR(idx)[t] - 1;
  ------------------
  |  |   60|   125k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   53|   125k|        }
   54|   152k|    }
   55|  3.39k|    igraph_vector_int_destroy(&idx);
   56|  3.39k|    IGRAPH_FINALLY_CLEAN(1);
   57|       |
   58|  3.39k|    return IGRAPH_SUCCESS;
   59|  3.39k|}
edge_betweenness.c:igraph_i_which_max_active_ratio:
  330|  91.6k|        igraph_bitset_t *passive) {
  331|       |
  332|  91.6k|    const igraph_int_t size = igraph_vector_size(v);
  333|  91.6k|    igraph_int_t which = igraph_bitset_countr_one(passive); /* start with first active element */
  334|  91.6k|    igraph_real_t max = VECTOR(*v)[which] / (w ? VECTOR(*w)[which] : 1.0);
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                  igraph_real_t max = VECTOR(*v)[which] / (w ? VECTOR(*w)[which] : 1.0);
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (334:46): [True: 91.6k, False: 0]
  ------------------
  335|       |
  336|  6.22M|    for (igraph_int_t i = which+1; i < size; i++) {
  ------------------
  |  Branch (336:36): [True: 6.13M, False: 91.6k]
  ------------------
  337|  6.13M|        igraph_real_t elem = VECTOR(*v)[i] / (w ? VECTOR(*w)[i] : 1.0);
  ------------------
  |  |   60|  6.13M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      igraph_real_t elem = VECTOR(*v)[i] / (w ? VECTOR(*w)[i] : 1.0);
  ------------------
  |  |   60|  6.13M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (337:47): [True: 6.13M, False: 0]
  ------------------
  338|  6.13M|        if (! IGRAPH_BIT_TEST(*passive, i) && elem > max) {
  ------------------
  |  |  142|  12.2M|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|  6.13M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|  6.13M|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  6.13M|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|  6.13M|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|  6.13M|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (338:13): [True: 3.72M, False: 2.40M]
  |  Branch (338:47): [True: 156k, False: 3.57M]
  ------------------
  339|   156k|            max = elem;
  340|   156k|            which = i;
  341|   156k|        }
  342|  6.13M|    }
  343|       |
  344|  91.6k|    return which;
  345|  91.6k|}

igraph_community_fastgreedy:
  608|  3.40k|                                igraph_vector_int_t *membership) {
  609|  3.40k|    igraph_int_t no_of_edges, no_of_nodes, no_of_joins, total_joins;
  610|  3.40k|    igraph_int_t i, j, k, n, m, from, to, dummy, best_no_of_joins;
  611|  3.40k|    igraph_eit_t edgeit;
  612|  3.40k|    igraph_i_fastgreedy_commpair *pairs, *p1, *p2;
  613|  3.40k|    igraph_i_fastgreedy_community_list communities;
  614|  3.40k|    igraph_vector_t a;
  615|  3.40k|    igraph_vector_int_t degrees;
  616|  3.40k|    igraph_real_t q, *dq, bestq, weight_sum, loop_weight_sum;
  617|  3.40k|    igraph_bool_t has_multiple;
  618|  3.40k|    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.40k|    no_of_nodes = igraph_vcount(graph);
  624|  3.40k|    no_of_edges = igraph_ecount(graph);
  625|       |
  626|  3.40k|    if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (626:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    total_joins = no_of_nodes > 0 ? no_of_nodes - 1 : 0;
  ------------------
  |  Branch (630:19): [True: 3.39k, False: 1]
  ------------------
  631|       |
  632|  3.40k|    if (weights) {
  ------------------
  |  Branch (632:9): [True: 3.40k, False: 0]
  ------------------
  633|  3.40k|        if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (633:13): [True: 0, False: 3.40k]
  ------------------
  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.40k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (636:13): [True: 3.30k, False: 97]
  ------------------
  637|  3.30k|            igraph_real_t minweight = igraph_vector_min(weights);
  638|  3.30k|            if (minweight < 0) {
  ------------------
  |  Branch (638:17): [True: 0, False: 3.30k]
  ------------------
  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.30k|            if (isnan(minweight)) {
  ------------------
  |  Branch (641:17): [True: 0, False: 3.30k]
  ------------------
  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.30k|        }
  645|  3.40k|        weight_sum = igraph_vector_sum(weights);
  646|  3.40k|    } else {
  647|      0|        weight_sum = no_of_edges;
  648|      0|    }
  649|       |
  650|  3.40k|    IGRAPH_CHECK(igraph_has_multiple(graph, &has_multiple));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  651|  3.40k|    if (has_multiple) {
  ------------------
  |  Branch (651:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    if (membership != NULL && merges == NULL) {
  ------------------
  |  Branch (655:9): [True: 3.40k, False: 0]
  |  Branch (655:31): [True: 0, False: 3.40k]
  ------------------
  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.40k|    if (merges != NULL) {
  ------------------
  |  Branch (663:9): [True: 3.40k, False: 0]
  ------------------
  664|  3.40k|        IGRAPH_CHECK(igraph_matrix_int_resize(merges, total_joins, 2));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  665|  3.40k|        igraph_matrix_int_null(merges);
  666|  3.40k|    }
  667|       |
  668|  3.40k|    if (modularity != NULL) {
  ------------------
  |  Branch (668:9): [True: 3.40k, False: 0]
  ------------------
  669|  3.40k|        IGRAPH_CHECK(igraph_vector_resize(modularity, total_joins + 1));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  670|  3.40k|    }
  671|       |
  672|       |    /* Create degree vector */
  673|  3.40k|    IGRAPH_VECTOR_INIT_FINALLY(&a, no_of_nodes);
  ------------------
  |  |  104|  3.40k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.40k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  674|  3.40k|    if (weights) {
  ------------------
  |  Branch (674:9): [True: 3.40k, False: 0]
  ------------------
  675|  3.40k|        debug("Calculating weighted degrees\n");
  676|  57.2k|        for (i = 0; i < no_of_edges; i++) {
  ------------------
  |  Branch (676:21): [True: 53.8k, False: 3.40k]
  ------------------
  677|  53.8k|            VECTOR(a)[IGRAPH_FROM(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |   60|  53.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(a)[IGRAPH_FROM(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |  115|  53.8k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  53.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                          VECTOR(a)[IGRAPH_FROM(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |   60|  53.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  678|  53.8k|            VECTOR(a)[IGRAPH_TO(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |   60|  53.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(a)[IGRAPH_TO(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |  128|  53.8k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  53.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                          VECTOR(a)[IGRAPH_TO(graph, i)] += VECTOR(*weights)[i];
  ------------------
  |  |   60|  53.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  679|  53.8k|        }
  680|  3.40k|    } 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.40k|    debug("Creating community list\n");
  693|  3.40k|    communities.n = no_of_nodes;
  694|  3.40k|    communities.no_of_communities = no_of_nodes;
  695|  3.40k|    communities.e = IGRAPH_CALLOC(no_of_nodes, igraph_i_fastgreedy_community);
  ------------------
  |  |   33|  3.40k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.80k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.39k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|  3.40k|    IGRAPH_CHECK_OOM(communities.e, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.40k|    do { \
  |  |  710|  3.40k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  697|  3.40k|    IGRAPH_FINALLY(igraph_free, communities.e);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  698|       |
  699|  3.40k|    communities.heap = IGRAPH_CALLOC(no_of_nodes, igraph_i_fastgreedy_community*);
  ------------------
  |  |   33|  3.40k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.80k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.39k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  700|  3.40k|    IGRAPH_CHECK_OOM(communities.heap, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.40k|    do { \
  |  |  710|  3.40k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  701|  3.40k|    IGRAPH_FINALLY(igraph_free, communities.heap);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  702|       |
  703|  3.40k|    communities.heapindex = IGRAPH_CALLOC(no_of_nodes, igraph_int_t);
  ------------------
  |  |   33|  3.40k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.80k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.39k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|  3.40k|    IGRAPH_CHECK_OOM(communities.heapindex, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.40k|    do { \
  |  |  710|  3.40k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  705|       |
  706|  3.40k|    IGRAPH_FINALLY_CLEAN(2);
  707|  3.40k|    IGRAPH_FINALLY(igraph_i_fastgreedy_community_list_destroy, &communities);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  708|       |
  709|   155k|    for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (709:17): [True: 152k, False: 3.40k]
  ------------------
  710|   152k|        IGRAPH_CHECK(igraph_vector_ptr_init(&communities.e[i].neis, 0));
  ------------------
  |  |  656|   152k|    do { \
  |  |  657|   152k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   152k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   152k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
  711|   152k|        communities.e[i].id = i;
  712|   152k|        communities.e[i].size = 1;
  713|   152k|    }
  714|       |
  715|       |    /* Create list of community pairs from edges */
  716|  3.40k|    debug("Allocating dq vector\n");
  717|  3.40k|    dq = IGRAPH_CALLOC(no_of_edges, igraph_real_t);
  ------------------
  |  |   33|  3.40k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.80k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.30k, False: 97]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  718|  3.40k|    IGRAPH_CHECK_OOM(dq, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.40k|    do { \
  |  |  710|  3.40k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  719|  3.40k|    IGRAPH_FINALLY(igraph_free, dq);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  720|       |
  721|  3.40k|    debug("Creating community pair list\n");
  722|  3.40k|    IGRAPH_CHECK(igraph_eit_create(graph, igraph_ess_all(IGRAPH_EDGEORDER_ID), &edgeit));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  723|  3.40k|    IGRAPH_FINALLY(igraph_eit_destroy, &edgeit);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  724|  3.40k|    pairs = IGRAPH_CALLOC(2 * no_of_edges, igraph_i_fastgreedy_commpair);
  ------------------
  |  |   33|  3.40k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.80k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.30k, False: 97]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  725|  3.40k|    IGRAPH_CHECK_OOM(pairs, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  3.40k|    do { \
  |  |  710|  3.40k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  726|  3.40k|    IGRAPH_FINALLY(igraph_free, pairs);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  727|       |
  728|  3.40k|    loop_weight_sum = 0;
  729|  57.2k|    for (i = 0, j = 0; !IGRAPH_EIT_END(edgeit); i += 2, j++, IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  371|  57.2k|#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|  53.8k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (729:24): [True: 53.8k, False: 3.40k]
  ------------------
  730|  53.8k|        igraph_int_t eidx = IGRAPH_EIT_GET(edgeit);
  ------------------
  |  |  405|  53.8k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 53.8k, False: 0]
  |  |  ------------------
  |  |  406|  53.8k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  731|       |
  732|       |        /* Create the pairs themselves */
  733|  53.8k|        from = IGRAPH_FROM(graph, eidx); to = IGRAPH_TO(graph, eidx);
  ------------------
  |  |  115|  53.8k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  53.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                      from = IGRAPH_FROM(graph, eidx); to = IGRAPH_TO(graph, eidx);
  ------------------
  |  |  128|  53.8k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  53.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  734|  53.8k|        if (from == to) {
  ------------------
  |  Branch (734:13): [True: 0, False: 53.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|  53.8k|        if (from > to) {
  ------------------
  |  Branch (739:13): [True: 53.8k, False: 0]
  ------------------
  740|  53.8k|            dummy = from; from = to; to = dummy;
  741|  53.8k|        }
  742|  53.8k|        if (weights) {
  ------------------
  |  Branch (742:13): [True: 53.8k, False: 0]
  ------------------
  743|  53.8k|            dq[j] = 2 * (VECTOR(*weights)[eidx] / (weight_sum * 2.0) - VECTOR(a)[from] * VECTOR(a)[to] / (4.0 * weight_sum * weight_sum));
  ------------------
  |  |   60|  53.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|  53.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|  53.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  744|  53.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|  53.8k|        pairs[i].first = from;
  748|  53.8k|        pairs[i].second = to;
  749|  53.8k|        pairs[i].dq = &dq[j];
  750|  53.8k|        pairs[i].opposite = &pairs[i + 1];
  751|  53.8k|        pairs[i + 1].first = to;
  752|  53.8k|        pairs[i + 1].second = from;
  753|  53.8k|        pairs[i + 1].dq = pairs[i].dq;
  754|  53.8k|        pairs[i + 1].opposite = &pairs[i];
  755|       |        /* Link the pair to the communities */
  756|  53.8k|        IGRAPH_CHECK(igraph_vector_ptr_push_back(&communities.e[from].neis, &pairs[i]));
  ------------------
  |  |  656|  53.8k|    do { \
  |  |  657|  53.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  53.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  53.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 53.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|  53.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 53.8k]
  |  |  ------------------
  ------------------
  757|  53.8k|        IGRAPH_CHECK(igraph_vector_ptr_push_back(&communities.e[to].neis, &pairs[i + 1]));
  ------------------
  |  |  656|  53.8k|    do { \
  |  |  657|  53.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  53.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  53.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 53.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|  53.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 53.8k]
  |  |  ------------------
  ------------------
  758|       |        /* Update maximums */
  759|  53.8k|        if (communities.e[from].maxdq == NULL || *communities.e[from].maxdq->dq < *pairs[i].dq) {
  ------------------
  |  Branch (759:13): [True: 13.5k, False: 40.3k]
  |  Branch (759:50): [True: 10.7k, False: 29.5k]
  ------------------
  760|  24.2k|            communities.e[from].maxdq = &pairs[i];
  761|  24.2k|        }
  762|  53.8k|        if (communities.e[to].maxdq == NULL || *communities.e[to].maxdq->dq < *pairs[i + 1].dq) {
  ------------------
  |  Branch (762:13): [True: 33.9k, False: 19.8k]
  |  Branch (762:48): [True: 7.83k, False: 12.0k]
  ------------------
  763|  41.7k|            communities.e[to].maxdq = &pairs[i + 1];
  764|  41.7k|        }
  765|  53.8k|    }
  766|  3.40k|    igraph_eit_destroy(&edgeit);
  767|  3.40k|    IGRAPH_FINALLY_CLEAN(1);
  768|       |
  769|       |    /* Sorting community neighbor lists by community IDs */
  770|  3.40k|    debug("Sorting community neighbor lists\n");
  771|   155k|    for (i = 0, j = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (771:24): [True: 152k, False: 3.40k]
  ------------------
  772|   152k|        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|   152k|        if (communities.e[i].maxdq != NULL) {
  ------------------
  |  Branch (775:13): [True: 47.4k, False: 104k]
  ------------------
  776|  47.4k|            communities.heap[j] = &communities.e[i];
  777|  47.4k|            communities.heapindex[i] = j;
  778|  47.4k|            j++;
  779|   104k|        } else {
  780|   104k|            communities.heapindex[i] = -1;
  781|   104k|        }
  782|   152k|    }
  783|  3.40k|    communities.no_of_communities = j;
  784|       |
  785|       |    /* Calculate proper vector a (see paper) and initial modularity */
  786|  3.40k|    q = 2.0 * (weights ? weight_sum : no_of_edges);
  ------------------
  |  Branch (786:16): [True: 3.40k, False: 0]
  ------------------
  787|  3.40k|    if (q == 0) {
  ------------------
  |  Branch (787:9): [True: 97, False: 3.30k]
  ------------------
  788|       |        /* All the weights are zero */
  789|  3.30k|    } else {
  790|  3.30k|        igraph_vector_scale(&a, 1.0 / q);
  791|  3.30k|        q = loop_weight_sum / q;
  792|   152k|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (792:21): [True: 149k, False: 3.30k]
  ------------------
  793|   149k|            q -= VECTOR(a)[i] * VECTOR(a)[i];
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          q -= VECTOR(a)[i] * VECTOR(a)[i];
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  794|   149k|        }
  795|  3.30k|    }
  796|       |
  797|       |    /* Initialize "best modularity" value and best merge counter */
  798|  3.40k|    bestq = q;
  799|  3.40k|    best_no_of_joins = 0;
  800|       |
  801|       |    /* Initializing community heap */
  802|  3.40k|    debug("Initializing community heap\n");
  803|  3.40k|    igraph_i_fastgreedy_community_list_build_heap(&communities);
  804|       |
  805|  3.40k|    debug("Initial modularity: %.4f\n", q);
  806|       |
  807|       |    /* Let's rock ;) */
  808|  3.40k|    no_of_joins = 0;
  809|  44.0k|    while (no_of_joins < total_joins) {
  ------------------
  |  Branch (809:12): [True: 43.5k, False: 478]
  ------------------
  810|  43.5k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  43.5k|    do { \
  |  |   47|  43.5k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 43.5k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  43.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 43.5k]
  |  |  ------------------
  ------------------
  811|  43.5k|        IGRAPH_PROGRESS("Fast greedy community detection", no_of_joins * 100.0 / total_joins, 0);
  ------------------
  |  |  169|  43.5k|    do { \
  |  |  170|  43.5k|        IGRAPH_CHECK(igraph_progress((message), (percent), (data))); \
  |  |  ------------------
  |  |  |  |  656|  43.5k|    do { \
  |  |  |  |  657|  43.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  43.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  43.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 43.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|  43.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 43.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  43.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (171:14): [Folded, False: 43.5k]
  |  |  ------------------
  ------------------
  812|       |
  813|       |        /* Store the modularity */
  814|  43.5k|        if (modularity) {
  ------------------
  |  Branch (814:13): [True: 43.5k, False: 0]
  ------------------
  815|  43.5k|            VECTOR(*modularity)[no_of_joins] = q;
  ------------------
  |  |   60|  43.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  816|  43.5k|        }
  817|       |
  818|       |        /* Update best modularity if needed */
  819|  43.5k|        if (q >= bestq) {
  ------------------
  |  Branch (819:13): [True: 39.8k, False: 3.70k]
  ------------------
  820|  39.8k|            bestq = q;
  821|  39.8k|            best_no_of_joins = no_of_joins;
  822|  39.8k|        }
  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|  43.5k|        if (communities.heap[0] == NULL) {
  ------------------
  |  Branch (848:13): [True: 82, False: 43.5k]
  ------------------
  849|     82|            break;    /* no more communities */
  850|     82|        }
  851|  43.5k|        if (communities.heap[0]->maxdq == NULL) {
  ------------------
  |  Branch (851:13): [True: 2.84k, False: 40.6k]
  ------------------
  852|  2.84k|            break;    /* there are only isolated comms */
  853|  2.84k|        }
  854|  40.6k|        to = communities.heap[0]->maxdq->second;
  855|  40.6k|        from = communities.heap[0]->maxdq->first;
  856|       |
  857|  40.6k|        debug("Q[%ld] = %.7f\tdQ = %.7f\t |H| = %ld\n",
  858|  40.6k|              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|  40.6k|        n = igraph_vector_ptr_size(&communities.e[to].neis);
  869|  40.6k|        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|  40.6k|        debug("  joining: %ld <- %ld\n", to, from);
  875|  40.6k|        q += *communities.heap[0]->maxdq->dq;
  876|       |
  877|       |        /* Merge the second community into the first */
  878|  40.6k|        i = j = 0;
  879|   233k|        while (i < n && j < m) {
  ------------------
  |  Branch (879:16): [True: 213k, False: 20.0k]
  |  Branch (879:25): [True: 192k, False: 20.6k]
  ------------------
  880|   192k|            p1 = (igraph_i_fastgreedy_commpair*)VECTOR(communities.e[to].neis)[i];
  ------------------
  |  |   60|   192k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  881|   192k|            p2 = (igraph_i_fastgreedy_commpair*)VECTOR(communities.e[from].neis)[j];
  ------------------
  |  |   60|   192k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  882|   192k|            debug("Pairs: %" IGRAPH_PRId "-%" IGRAPH_PRId " and %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p1->first, p1->second,
  883|   192k|                  p2->first, p2->second);
  884|   192k|            if (p1->second < p2->second) {
  ------------------
  |  Branch (884:17): [True: 97.0k, False: 95.3k]
  ------------------
  885|       |                /* Considering p1 from now on */
  886|  97.0k|                debug("    Considering: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p1->first, p1->second);
  887|  97.0k|                if (p1->second == from) {
  ------------------
  |  Branch (887:21): [True: 27.5k, False: 69.4k]
  ------------------
  888|  27.5k|                    debug("    WILL REMOVE: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", to, from);
  889|  69.4k|                } else {
  890|       |                    /* chain, case 1 */
  891|  69.4k|                    debug("    CHAIN(1): %ld-%ld %ld, now=%.7f, adding=%.7f, newdq(%ld,%ld)=%.7f\n",
  892|  69.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]);
  893|  69.4k|                    igraph_i_fastgreedy_community_update_dq(&communities, p1, *p1->dq - 2 * VECTOR(a)[from]*VECTOR(a)[p1->second]);
  ------------------
  |  |   60|  69.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|  69.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  894|  69.4k|                }
  895|  97.0k|                i++;
  896|  97.0k|            } else if (p1->second == p2->second) {
  ------------------
  |  Branch (896:24): [True: 13.1k, False: 82.2k]
  ------------------
  897|       |                /* p1->first, p1->second and p2->first form a triangle */
  898|  13.1k|                debug("    Considering: %" IGRAPH_PRId "-%" IGRAPH_PRId " and %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p1->first, p1->second,
  899|  13.1k|                      p2->first, p2->second);
  900|       |                /* Update dq value */
  901|  13.1k|                debug("    TRIANGLE: %ld-%ld-%ld, now=%.7f, adding=%.7f, newdq(%ld,%ld)=%.7f\n",
  902|  13.1k|                      to, p1->second, from, *p1->dq, *p2->dq, p1->first, p1->second, *p1->dq + *p2->dq);
  903|  13.1k|                igraph_i_fastgreedy_community_update_dq(&communities, p1, *p1->dq + *p2->dq);
  904|  13.1k|                igraph_i_fastgreedy_community_remove_nei(&communities, p1->second, from);
  905|  13.1k|                i++;
  906|  13.1k|                j++;
  907|  82.2k|            } else {
  908|  82.2k|                debug("    Considering: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p2->first, p2->second);
  909|  82.2k|                if (p2->second == to) {
  ------------------
  |  Branch (909:21): [True: 26.7k, False: 55.4k]
  ------------------
  910|  26.7k|                    debug("    WILL REMOVE: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p2->second, p2->first);
  911|  55.4k|                } else {
  912|       |                    /* chain, case 2 */
  913|  55.4k|                    debug("    CHAIN(2): %ld %ld-%ld, newdq(%ld,%ld)=%.7f\n",
  914|  55.4k|                          to, p2->second, from, to, p2->second, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  915|  55.4k|                    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|  55.4k|                    igraph_i_fastgreedy_community_sort_neighbors_of(
  924|  55.4k|                        &communities, p2->second, p2->opposite);
  925|       |                    /* link from.neis[j] to the current place in to.neis if
  926|       |                     * from.neis[j] != to */
  927|  55.4k|                    p2->first = to;
  928|  55.4k|                    IGRAPH_CHECK(igraph_vector_ptr_insert(&communities.e[to].neis, i, p2));
  ------------------
  |  |  656|  55.4k|    do { \
  |  |  657|  55.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  55.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  55.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 55.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|  55.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 55.4k]
  |  |  ------------------
  ------------------
  929|  55.4k|                    n++; i++;
  930|  55.4k|                    if (*p2->dq > *communities.e[to].maxdq->dq) {
  ------------------
  |  Branch (930:25): [True: 97, False: 55.3k]
  ------------------
  931|     97|                        communities.e[to].maxdq = p2;
  932|     97|                        k = igraph_i_fastgreedy_community_list_find_in_heap(&communities, to);
  ------------------
  |  |  222|     97|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  933|     97|                        igraph_i_fastgreedy_community_list_sift_up(&communities, k);
  934|     97|                    }
  935|  55.4k|                    igraph_i_fastgreedy_community_update_dq(&communities, p2, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  ------------------
  |  |   60|  55.4k|#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|  55.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  936|  55.4k|                }
  937|  82.2k|                j++;
  938|  82.2k|            }
  939|   192k|        }
  940|       |
  941|  40.6k|        p1 = NULL;
  942|   107k|        while (i < n) {
  ------------------
  |  Branch (942:16): [True: 66.4k, False: 40.6k]
  ------------------
  943|  66.4k|            p1 = (igraph_i_fastgreedy_commpair*)VECTOR(communities.e[to].neis)[i];
  ------------------
  |  |   60|  66.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  944|  66.4k|            if (p1->second == from) {
  ------------------
  |  Branch (944:17): [True: 13.0k, False: 53.3k]
  ------------------
  945|  13.0k|                debug("    WILL REMOVE: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", p1->first, from);
  946|  53.3k|            } else {
  947|       |                /* chain, case 1 */
  948|  53.3k|                debug("    CHAIN(1): %ld-%ld %ld, now=%.7f, adding=%.7f, newdq(%ld,%ld)=%.7f\n",
  949|  53.3k|                      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|  53.3k|                igraph_i_fastgreedy_community_update_dq(&communities, p1, *p1->dq - 2 * VECTOR(a)[from]*VECTOR(a)[p1->second]);
  ------------------
  |  |   60|  53.3k|#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|  53.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  951|  53.3k|            }
  952|  66.4k|            i++;
  953|  66.4k|        }
  954|  99.9k|        while (j < m) {
  ------------------
  |  Branch (954:16): [True: 59.2k, False: 40.6k]
  ------------------
  955|  59.2k|            p2 = (igraph_i_fastgreedy_commpair*)VECTOR(communities.e[from].neis)[j];
  ------------------
  |  |   60|  59.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  956|  59.2k|            if (to == p2->second) {
  ------------------
  |  Branch (956:17): [True: 13.8k, False: 45.4k]
  ------------------
  957|  13.8k|                j++;
  958|  13.8k|                continue;
  959|  13.8k|            }
  960|       |            /* chain, case 2 */
  961|  45.4k|            debug("    CHAIN(2): %ld %ld-%ld, newdq(%ld,%ld)=%.7f\n",
  962|  45.4k|                  to, p2->second, from, p1 ? p1->first : -1, p2->second, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  963|  45.4k|            p2->opposite->second = to;
  964|       |            /* need to re-sort community nei list `p2->second` */
  965|  45.4k|            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|  45.4k|            p2->first = to;
  969|  45.4k|            IGRAPH_CHECK(igraph_vector_ptr_push_back(&communities.e[to].neis, p2));
  ------------------
  |  |  656|  45.4k|    do { \
  |  |  657|  45.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  45.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  45.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 45.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|  45.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 45.4k]
  |  |  ------------------
  ------------------
  970|  45.4k|            if (*p2->dq > *communities.e[to].maxdq->dq) {
  ------------------
  |  Branch (970:17): [True: 26, False: 45.3k]
  ------------------
  971|     26|                communities.e[to].maxdq = p2;
  972|     26|                k = igraph_i_fastgreedy_community_list_find_in_heap(&communities, to);
  ------------------
  |  |  222|     26|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  973|     26|                igraph_i_fastgreedy_community_list_sift_up(&communities, k);
  974|     26|            }
  975|  45.4k|            igraph_i_fastgreedy_community_update_dq(&communities, p2, *p2->dq - 2 * VECTOR(a)[to]*VECTOR(a)[p2->second]);
  ------------------
  |  |   60|  45.4k|#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|  45.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  976|  45.4k|            j++;
  977|  45.4k|        }
  978|       |
  979|       |        /* Now, remove community `from` from the neighbors of community `to` */
  980|  40.6k|        if (communities.no_of_communities > 2) {
  ------------------
  |  Branch (980:13): [True: 37.3k, False: 3.30k]
  ------------------
  981|  37.3k|            debug("    REMOVING: %" IGRAPH_PRId "-%" IGRAPH_PRId "\n", to, from);
  982|  37.3k|            igraph_i_fastgreedy_community_remove_nei(&communities, to, from);
  983|  37.3k|            i = igraph_i_fastgreedy_community_list_find_in_heap(&communities, from);
  ------------------
  |  |  222|  37.3k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  984|  37.3k|            igraph_i_fastgreedy_community_list_remove(&communities, i);
  985|  37.3k|        }
  986|  40.6k|        communities.e[from].maxdq = NULL;
  987|       |
  988|       |        /* Update community sizes */
  989|  40.6k|        communities.e[to].size += communities.e[from].size;
  990|  40.6k|        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|  40.6k|        igraph_vector_ptr_destroy(&communities.e[from].neis);
  997|  40.6k|        if (merges) {
  ------------------
  |  Branch (997:13): [True: 40.6k, False: 0]
  ------------------
  998|  40.6k|            MATRIX(*merges, no_of_joins, 0) = communities.e[to].id;
  ------------------
  |  |   83|  40.6k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  999|  40.6k|            MATRIX(*merges, no_of_joins, 1) = communities.e[from].id;
  ------------------
  |  |   83|  40.6k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
 1000|  40.6k|            communities.e[to].id = no_of_nodes + no_of_joins;
 1001|  40.6k|        }
 1002|       |
 1003|       |        /* Update vector a */
 1004|  40.6k|        VECTOR(a)[to] += VECTOR(a)[from];
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(a)[to] += VECTOR(a)[from];
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1005|  40.6k|        VECTOR(a)[from] = 0.0;
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1006|       |
 1007|  40.6k|        no_of_joins++;
 1008|  40.6k|    }
 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.40k|    if (merges != NULL) {
  ------------------
  |  Branch (1013:9): [True: 3.40k, False: 0]
  ------------------
 1014|  3.40k|        if (no_of_joins < total_joins) {
  ------------------
  |  Branch (1014:13): [True: 2.92k, False: 478]
  ------------------
 1015|  2.92k|            igraph_int_t *ivec;
 1016|  2.92k|            igraph_int_t merges_nrow = igraph_matrix_int_nrow(merges);
 1017|       |
 1018|  2.92k|            ivec = IGRAPH_CALLOC(merges_nrow, igraph_int_t);
  ------------------
  |  |   33|  2.92k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  5.84k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 2.92k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 2.92k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 2.92k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1019|  2.92k|            IGRAPH_CHECK_OOM(ivec, "Insufficient memory for fast greedy community detection.");
  ------------------
  |  |  709|  2.92k|    do { \
  |  |  710|  2.92k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  2.92k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
 1020|  2.92k|            IGRAPH_FINALLY(igraph_free, ivec);
  ------------------
  |  |  603|  2.92k|    do { \
  |  |  604|  2.92k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  2.92k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  2.92k|         * incorrect destructor function with the pointer */ \
  |  |  607|  2.92k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 2.92k]
  |  |  ------------------
  |  |  608|  2.92k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  2.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
 1021|       |
 1022|  38.7k|            for (i = 0; i < no_of_joins; i++) {
  ------------------
  |  Branch (1022:25): [True: 35.7k, False: 2.92k]
  ------------------
 1023|  35.7k|                ivec[i] = i + 1;
 1024|  35.7k|            }
 1025|       |
 1026|  2.92k|            igraph_matrix_int_permdelete_rows(merges, ivec, total_joins - no_of_joins);
 1027|       |
 1028|  2.92k|            IGRAPH_FREE(ivec);
  ------------------
  |  |   36|  2.92k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1029|  2.92k|            IGRAPH_FINALLY_CLEAN(1);
 1030|  2.92k|        }
 1031|  3.40k|    }
 1032|  3.40k|    IGRAPH_PROGRESS("Fast greedy community detection", 100.0, 0);
  ------------------
  |  |  169|  3.40k|    do { \
  |  |  170|  3.40k|        IGRAPH_CHECK(igraph_progress((message), (percent), (data))); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (171:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1033|       |
 1034|  3.40k|    if (modularity) {
  ------------------
  |  Branch (1034:9): [True: 3.40k, False: 0]
  ------------------
 1035|  3.40k|        VECTOR(*modularity)[no_of_joins] = q;
  ------------------
  |  |   60|  3.40k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1036|  3.40k|        IGRAPH_CHECK(igraph_vector_resize(modularity, no_of_joins + 1));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1037|  3.40k|    }
 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.40k|    if (modularity && no_of_edges == 0) {
  ------------------
  |  Branch (1042:9): [True: 3.40k, False: 0]
  |  Branch (1042:23): [True: 97, False: 3.30k]
  ------------------
 1043|     97|        IGRAPH_ASSERT(no_of_joins == 0);
  ------------------
  |  |  924|     97|    do { \
  |  |  925|     97|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|     97|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 97]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|     97|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 97]
  |  |  ------------------
  ------------------
 1044|     97|        VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |   60|     97|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |  138|     97|#define IGRAPH_NAN ((double)NAN)
  ------------------
 1045|     97|    }
 1046|       |
 1047|  3.40k|    debug("Freeing memory\n");
 1048|  3.40k|    IGRAPH_FREE(pairs);
  ------------------
  |  |   36|  3.40k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1049|  3.40k|    IGRAPH_FREE(dq);
  ------------------
  |  |   36|  3.40k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1050|  3.40k|    igraph_i_fastgreedy_community_list_destroy(&communities);
 1051|  3.40k|    igraph_vector_destroy(&a);
 1052|  3.40k|    IGRAPH_FINALLY_CLEAN(4);
 1053|       |
 1054|  3.40k|    if (membership) {
  ------------------
  |  Branch (1054:9): [True: 3.40k, False: 0]
  ------------------
 1055|  3.40k|        IGRAPH_CHECK(igraph_community_to_membership(merges,
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1056|  3.40k|                     no_of_nodes,
 1057|  3.40k|                     /*steps=*/ best_no_of_joins,
 1058|  3.40k|                     membership,
 1059|  3.40k|                     /*csize=*/ NULL));
 1060|  3.40k|    }
 1061|       |
 1062|  3.40k|    if (merges == &merges_local) {
  ------------------
  |  Branch (1062:9): [True: 0, False: 3.40k]
  ------------------
 1063|      0|        igraph_matrix_int_destroy(&merges_local);
 1064|      0|        IGRAPH_FINALLY_CLEAN(1);
 1065|      0|    }
 1066|       |
 1067|  3.40k|    return IGRAPH_SUCCESS;
 1068|  3.40k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_destroy:
  131|  3.40k|        igraph_i_fastgreedy_community_list *list) {
  132|  3.40k|    igraph_int_t i;
  133|   155k|    for (i = 0; i < list->n; i++) {
  ------------------
  |  Branch (133:17): [True: 152k, False: 3.40k]
  ------------------
  134|   152k|        igraph_vector_ptr_destroy(&list->e[i].neis);
  135|   152k|    }
  136|  3.40k|    IGRAPH_FREE(list->e);
  ------------------
  |  |   36|  3.40k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  137|  3.40k|    if (list->heapindex != NULL) {
  ------------------
  |  Branch (137:9): [True: 3.40k, False: 0]
  ------------------
  138|  3.40k|        IGRAPH_FREE(list->heapindex);
  ------------------
  |  |   36|  3.40k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  139|  3.40k|    }
  140|  3.40k|    if (list->heap != NULL) {
  ------------------
  |  Branch (140:9): [True: 3.40k, False: 0]
  ------------------
  141|       |        IGRAPH_FREE(list->heap);
  ------------------
  |  |   36|  3.40k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  142|  3.40k|    }
  143|  3.40k|}
fast_modularity.c:igraph_i_fastgreedy_community_sort_neighbors_of:
  378|   253k|        igraph_i_fastgreedy_commpair *changed_pair) {
  379|   253k|    igraph_vector_ptr_t *vec;
  380|   253k|    igraph_int_t i, n;
  381|   253k|    igraph_bool_t can_skip_sort = false;
  382|   253k|    igraph_i_fastgreedy_commpair *other_pair;
  383|       |
  384|   253k|    vec = &list->e[index].neis;
  385|   253k|    if (changed_pair != NULL) {
  ------------------
  |  Branch (385:9): [True: 100k, False: 152k]
  ------------------
  386|       |        /* Optimized sorting */
  387|       |
  388|       |        /* First we look for changed_pair in vec */
  389|   100k|        n = igraph_vector_ptr_size(vec);
  390|   183k|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (390:21): [True: 183k, False: 0]
  ------------------
  391|   183k|            if (VECTOR(*vec)[i] == changed_pair) {
  ------------------
  |  |   60|   183k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (391:17): [True: 100k, False: 82.1k]
  ------------------
  392|   100k|                break;
  393|   100k|            }
  394|   183k|        }
  395|       |
  396|       |        /* Did we find it? We should have -- otherwise it's a bug */
  397|   100k|        IGRAPH_ASSERT(i < n);
  ------------------
  |  |  924|   100k|    do { \
  |  |  925|   100k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   100k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 100k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   100k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 100k]
  |  |  ------------------
  ------------------
  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|   125k|        while (i > 0) {
  ------------------
  |  Branch (406:16): [True: 46.3k, False: 78.8k]
  ------------------
  407|  46.3k|            other_pair = VECTOR(*vec)[i - 1];
  ------------------
  |  |   60|  46.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  408|  46.3k|            if (other_pair->second > changed_pair->second) {
  ------------------
  |  Branch (408:17): [True: 24.3k, False: 22.0k]
  ------------------
  409|  24.3k|                VECTOR(*vec)[i] = other_pair;
  ------------------
  |  |   60|  24.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  410|  24.3k|                i--;
  411|  24.3k|            } else {
  412|  22.0k|                break;
  413|  22.0k|            }
  414|  46.3k|        }
  415|   100k|        VECTOR(*vec)[i] = changed_pair;
  ------------------
  |  |   60|   100k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  416|       |
  417|       |        /* Shifting to the right */
  418|   131k|        while (i < n - 1) {
  ------------------
  |  Branch (418:16): [True: 60.2k, False: 71.5k]
  ------------------
  419|  60.2k|            other_pair = VECTOR(*vec)[i + 1];
  ------------------
  |  |   60|  60.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  420|  60.2k|            if (other_pair->second < changed_pair->second) {
  ------------------
  |  Branch (420:17): [True: 30.9k, False: 29.3k]
  ------------------
  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|  29.3k|                break;
  425|  29.3k|            }
  426|  60.2k|        }
  427|   100k|        VECTOR(*vec)[i] = changed_pair;
  ------------------
  |  |   60|   100k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  428|       |
  429|       |        /* Mark that we don't need a full sort */
  430|   100k|        can_skip_sort = true;
  431|   100k|    }
  432|       |
  433|   253k|    if (!can_skip_sort) {
  ------------------
  |  Branch (433:9): [True: 152k, False: 100k]
  ------------------
  434|       |        /* Fallback to full sorting */
  435|   152k|        igraph_vector_ptr_sort(vec, igraph_i_fastgreedy_commpair_cmp);
  436|   152k|    }
  437|   253k|}
fast_modularity.c:igraph_i_fastgreedy_commpair_cmp:
  364|   117k|static int igraph_i_fastgreedy_commpair_cmp(const void *p1, const void *p2) {
  365|   117k|    igraph_i_fastgreedy_commpair *cp1, *cp2;
  366|   117k|    igraph_int_t diff;
  367|   117k|    cp1 = *(igraph_i_fastgreedy_commpair**)p1;
  368|   117k|    cp2 = *(igraph_i_fastgreedy_commpair**)p2;
  369|   117k|    diff = cp1->second - cp2->second;
  370|   117k|    return (diff < 0) ? -1 : (diff > 0) ? 1 : 0;
  ------------------
  |  Branch (370:12): [True: 73.9k, False: 43.2k]
  |  Branch (370:30): [True: 43.2k, False: 0]
  ------------------
  371|   117k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_build_heap:
  213|  3.40k|        igraph_i_fastgreedy_community_list *list) {
  214|  3.40k|    igraph_int_t i;
  215|  26.3k|    for (i = list->no_of_communities / 2 - 1; i >= 0; i--) {
  ------------------
  |  Branch (215:47): [True: 22.9k, False: 3.40k]
  ------------------
  216|  22.9k|        igraph_i_fastgreedy_community_list_sift_down(list, i);
  217|  22.9k|    }
  218|  3.40k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_sift_down:
  147|   287k|        igraph_i_fastgreedy_community_list *list, igraph_int_t idx) {
  148|   287k|    igraph_int_t root, child, c1, c2;
  149|   287k|    igraph_i_fastgreedy_community *dummy;
  150|   287k|    igraph_int_t dummy2;
  151|   287k|    igraph_i_fastgreedy_community** heap = list->heap;
  152|   287k|    igraph_int_t *heapindex = list->heapindex;
  153|       |
  154|   287k|    root = idx;
  155|   445k|    while (root * 2 + 1 < list->no_of_communities) {
  ------------------
  |  Branch (155:12): [True: 289k, False: 155k]
  ------------------
  156|   289k|        child = root * 2 + 1;
  157|   289k|        if (child + 1 < list->no_of_communities &&
  ------------------
  |  Branch (157:13): [True: 268k, False: 20.8k]
  ------------------
  158|   268k|            *heap[child]->maxdq->dq < *heap[child + 1]->maxdq->dq) {
  ------------------
  |  Branch (158:13): [True: 100k, False: 168k]
  ------------------
  159|   100k|            child++;
  160|   100k|        }
  161|   289k|        if (*heap[root]->maxdq->dq < *heap[child]->maxdq->dq) {
  ------------------
  |  Branch (161:13): [True: 157k, False: 132k]
  ------------------
  162|   157k|            c1 = heap[root]->maxdq->first;
  163|   157k|            c2 = heap[child]->maxdq->first;
  164|       |
  165|   157k|            dummy = heap[root];
  166|   157k|            heap[root] = heap[child];
  167|   157k|            heap[child] = dummy;
  168|       |
  169|   157k|            dummy2 = heapindex[c1];
  170|   157k|            heapindex[c1] = heapindex[c2];
  171|   157k|            heapindex[c2] = dummy2;
  172|       |
  173|   157k|            root = child;
  174|   157k|        } else {
  175|   132k|            break;
  176|   132k|        }
  177|   289k|    }
  178|   287k|}
fast_modularity.c:igraph_i_fastgreedy_community_update_dq:
  445|   236k|        igraph_i_fastgreedy_commpair *p, igraph_real_t newdq) {
  446|       |
  447|   236k|    igraph_int_t i, j, to, from;
  448|   236k|    igraph_real_t olddq;
  449|   236k|    igraph_i_fastgreedy_community *comm_to, *comm_from;
  450|   236k|    to = p->first; from = p->second;
  451|   236k|    comm_to = &list->e[to];
  452|   236k|    comm_from = &list->e[from];
  453|   236k|    if (comm_to->maxdq == p && newdq >= *p->dq) {
  ------------------
  |  Branch (453:9): [True: 8.34k, False: 228k]
  |  Branch (453:32): [True: 114, False: 8.23k]
  ------------------
  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|    114|        *p->dq = newdq;
  457|       |        /* The maximum was increased, so perform a sift-up in the heap */
  458|    114|        i = igraph_i_fastgreedy_community_list_find_in_heap(list, to);
  ------------------
  |  |  222|    114|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  459|    114|        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|    114|        if (comm_from->maxdq != p->opposite) {
  ------------------
  |  Branch (462:13): [True: 33, False: 81]
  ------------------
  463|     33|            if (*comm_from->maxdq->dq < newdq) {
  ------------------
  |  Branch (463:17): [True: 25, False: 8]
  ------------------
  464|       |                /* ...and it will become the maximal, we need to adjust and sift up */
  465|     25|                comm_from->maxdq = p->opposite;
  466|     25|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|     25|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  467|     25|                igraph_i_fastgreedy_community_list_sift_up(list, j);
  468|     25|            } 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|     81|        } else {
  473|       |            /* The pair was maximal in the opposite side, so we need to sift it up
  474|       |             * with the new value */
  475|     81|            j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|     81|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  476|     81|            igraph_i_fastgreedy_community_list_sift_up(list, j);
  477|     81|        }
  478|    114|        return true;
  479|   236k|    } else if (comm_to->maxdq != p && (newdq <= *comm_to->maxdq->dq)) {
  ------------------
  |  Branch (479:16): [True: 228k, False: 8.23k]
  |  Branch (479:39): [True: 227k, False: 795]
  ------------------
  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|   227k|        olddq = *p->dq;
  484|   227k|        *p->dq = newdq;
  485|       |        /* However, if the item was the maximum on the opposite side, we'd better
  486|       |         * re-scan it */
  487|   227k|        if (comm_from->maxdq == p->opposite) {
  ------------------
  |  Branch (487:13): [True: 152k, False: 75.6k]
  ------------------
  488|   152k|            if (olddq > newdq) {
  ------------------
  |  Branch (488:17): [True: 151k, False: 338]
  ------------------
  489|       |                /* Decreased the maximum on the other side, we have to re-scan for the
  490|       |                 * new maximum */
  491|   151k|                igraph_i_fastgreedy_community_rescan_max(comm_from);
  492|   151k|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|   151k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  493|   151k|                igraph_i_fastgreedy_community_list_sift_down(list, j);
  494|   151k|            } 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|    338|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|    338|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  498|    338|                igraph_i_fastgreedy_community_list_sift_up(list, j);
  499|    338|            }
  500|   152k|        }
  501|   227k|        return false;
  502|   227k|    } 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.03k|        *p->dq = newdq;
  511|  9.03k|        if (comm_to->maxdq != p) {
  ------------------
  |  Branch (511:13): [True: 795, False: 8.23k]
  ------------------
  512|       |            /* case (2) */
  513|    795|            comm_to->maxdq = p;
  514|       |            /* The maximum was increased, so perform a sift-up in the heap */
  515|    795|            i = igraph_i_fastgreedy_community_list_find_in_heap(list, to);
  ------------------
  |  |  222|    795|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  516|    795|            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|    795|            if (comm_from->maxdq != p->opposite) {
  ------------------
  |  Branch (519:17): [True: 520, False: 275]
  ------------------
  520|    520|                if (*comm_from->maxdq->dq < newdq) {
  ------------------
  |  Branch (520:21): [True: 505, False: 15]
  ------------------
  521|       |                    /* Yes, it will become the new maximum */
  522|    505|                    comm_from->maxdq = p->opposite;
  523|    505|                    j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|    505|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  524|    505|                    igraph_i_fastgreedy_community_list_sift_up(list, j);
  525|    505|                } else {
  526|       |                    /* No, nothing to do there */
  527|     15|                }
  528|    520|            } else {
  529|       |                /* Already increased the maximum on the opposite side, so sift it up */
  530|    275|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|    275|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  531|    275|                igraph_i_fastgreedy_community_list_sift_up(list, j);
  532|    275|            }
  533|  8.23k|        } 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.23k|            igraph_i_fastgreedy_community_rescan_max(comm_to);
  538|       |            /* The maximum was decreased, so perform a sift-down in the heap */
  539|  8.23k|            i = igraph_i_fastgreedy_community_list_find_in_heap(list, to);
  ------------------
  |  |  222|  8.23k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  540|  8.23k|            igraph_i_fastgreedy_community_list_sift_down(list, i);
  541|  8.23k|            if (comm_from->maxdq != p->opposite) {
  ------------------
  |  Branch (541:17): [True: 131, False: 8.10k]
  ------------------
  542|       |                /* The one that we decreased on the opposite side is not the
  543|       |                 * maximal one. Nothing to do. */
  544|  8.10k|            } else {
  545|       |                /* We decreased the maximal on the opposite side as well. Re-scan
  546|       |                 * and sift down */
  547|  8.10k|                igraph_i_fastgreedy_community_rescan_max(comm_from);
  548|  8.10k|                j = igraph_i_fastgreedy_community_list_find_in_heap(list, from);
  ------------------
  |  |  222|  8.10k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  549|  8.10k|                igraph_i_fastgreedy_community_list_sift_down(list, j);
  550|  8.10k|            }
  551|  8.23k|        }
  552|  9.03k|    }
  553|  9.03k|    return true;
  554|   236k|}
fast_modularity.c:igraph_i_fastgreedy_community_rescan_max:
   99|   207k|static igraph_bool_t igraph_i_fastgreedy_community_rescan_max(igraph_i_fastgreedy_community *comm) {
  100|   207k|    igraph_int_t i, n;
  101|   207k|    igraph_i_fastgreedy_commpair *p, *best;
  102|   207k|    igraph_real_t bestdq, currdq;
  103|       |
  104|   207k|    n = igraph_vector_ptr_size(&comm->neis);
  105|   207k|    if (n == 0) {
  ------------------
  |  Branch (105:9): [True: 3.46k, False: 203k]
  ------------------
  106|  3.46k|        comm->maxdq = NULL;
  107|  3.46k|        return true;
  108|  3.46k|    }
  109|       |
  110|   203k|    best = (igraph_i_fastgreedy_commpair*)VECTOR(comm->neis)[0];
  ------------------
  |  |   60|   203k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  111|   203k|    bestdq = *best->dq;
  112|   536k|    for (i = 1; i < n; i++) {
  ------------------
  |  Branch (112:17): [True: 332k, False: 203k]
  ------------------
  113|   332k|        p = (igraph_i_fastgreedy_commpair*)VECTOR(comm->neis)[i];
  ------------------
  |  |   60|   332k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  114|   332k|        currdq = *p->dq;
  115|   332k|        if (currdq > bestdq) {
  ------------------
  |  Branch (115:13): [True: 62.8k, False: 269k]
  ------------------
  116|  62.8k|            best = p;
  117|  62.8k|            bestdq = currdq;
  118|  62.8k|        }
  119|   332k|    }
  120|       |
  121|   203k|    if (best != comm->maxdq) {
  ------------------
  |  Branch (121:9): [True: 48.8k, False: 154k]
  ------------------
  122|  48.8k|        comm->maxdq = best;
  123|  48.8k|        return true;
  124|   154k|    } else {
  125|       |        return false;
  126|   154k|    }
  127|   203k|}
fast_modularity.c:igraph_i_fastgreedy_community_remove_nei:
  321|  50.5k|        igraph_i_fastgreedy_community_list *list, igraph_int_t c, igraph_int_t k) {
  322|  50.5k|    igraph_int_t i, n;
  323|  50.5k|    igraph_bool_t rescan = false;
  324|  50.5k|    igraph_i_fastgreedy_commpair *p;
  325|  50.5k|    igraph_i_fastgreedy_community *comm;
  326|  50.5k|    igraph_real_t olddq;
  327|       |
  328|  50.5k|    comm = &list->e[c];
  329|  50.5k|    n = igraph_vector_ptr_size(&comm->neis);
  330|   210k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (330:17): [True: 210k, False: 0]
  ------------------
  331|   210k|        p = (igraph_i_fastgreedy_commpair*)VECTOR(comm->neis)[i];
  ------------------
  |  |   60|   210k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  332|   210k|        if (p->second == k) {
  ------------------
  |  Branch (332:13): [True: 50.5k, False: 159k]
  ------------------
  333|       |            /* Check current maxdq */
  334|  50.5k|            if (comm->maxdq == p) {
  ------------------
  |  Branch (334:17): [True: 39.1k, False: 11.3k]
  ------------------
  335|  39.1k|                rescan = true;
  336|  39.1k|            }
  337|  50.5k|            break;
  338|  50.5k|        }
  339|   210k|    }
  340|  50.5k|    if (i < n) {
  ------------------
  |  Branch (340:9): [True: 50.5k, False: 0]
  ------------------
  341|  50.5k|        olddq = *comm->maxdq->dq;
  342|  50.5k|        igraph_vector_ptr_remove(&comm->neis, i);
  343|  50.5k|        if (rescan) {
  ------------------
  |  Branch (343:13): [True: 39.1k, False: 11.3k]
  ------------------
  344|  39.1k|            igraph_i_fastgreedy_community_rescan_max(comm);
  345|  39.1k|            i = igraph_i_fastgreedy_community_list_find_in_heap(list, c);
  ------------------
  |  |  222|  39.1k|#define igraph_i_fastgreedy_community_list_find_in_heap(list, idx) (list)->heapindex[idx]
  ------------------
  346|  39.1k|            if (comm->maxdq) {
  ------------------
  |  Branch (346:17): [True: 35.6k, False: 3.46k]
  ------------------
  347|  35.6k|                if (*comm->maxdq->dq > olddq) {
  ------------------
  |  Branch (347:21): [True: 329, False: 35.3k]
  ------------------
  348|    329|                    igraph_i_fastgreedy_community_list_sift_up(list, i);
  349|  35.3k|                } else {
  350|  35.3k|                    igraph_i_fastgreedy_community_list_sift_down(list, i);
  351|  35.3k|                }
  352|  35.6k|            } else {
  353|       |                /* no more neighbors for this community. we should remove this
  354|       |                 * community from the heap and restore the heap property */
  355|  3.46k|                debug("REMOVING (NO MORE NEIS): %" IGRAPH_PRId "\n", i);
  356|  3.46k|                igraph_i_fastgreedy_community_list_remove2(list, i, c);
  357|  3.46k|            }
  358|  39.1k|        }
  359|  50.5k|    }
  360|  50.5k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_remove2:
  292|  3.46k|        igraph_i_fastgreedy_community_list *list, igraph_int_t idx, igraph_int_t comm) {
  293|  3.46k|    igraph_int_t i;
  294|       |
  295|  3.46k|    if (idx == list->no_of_communities - 1) {
  ------------------
  |  Branch (295:9): [True: 73, False: 3.39k]
  ------------------
  296|       |        /* We removed the rightmost element on the bottom level, no problem,
  297|       |         * there's nothing to be done */
  298|     73|        list->heapindex[comm] = -1;
  299|     73|        list->no_of_communities--;
  300|     73|        return;
  301|     73|    }
  302|       |
  303|       |    /* First adjust the index */
  304|  3.39k|    i = list->heap[list->no_of_communities - 1]->maxdq->first;
  305|  3.39k|    list->heapindex[i] = idx;
  306|  3.39k|    list->heapindex[comm] = -1;
  307|       |
  308|       |    /* Now remove the element */
  309|  3.39k|    list->heap[idx] = list->heap[list->no_of_communities - 1];
  310|  3.39k|    list->no_of_communities--;
  311|       |
  312|       |    /* Recover heap property */
  313|  27.9k|    for (i = list->no_of_communities / 2 - 1; i >= 0; i--) {
  ------------------
  |  Branch (313:47): [True: 24.5k, False: 3.39k]
  ------------------
  314|  24.5k|        igraph_i_fastgreedy_community_list_sift_down(list, i);
  315|  24.5k|    }
  316|  3.39k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_sift_up:
  182|  2.90k|        igraph_i_fastgreedy_community_list *list, igraph_int_t idx) {
  183|  2.90k|    igraph_int_t root, parent, c1, c2;
  184|  2.90k|    igraph_i_fastgreedy_community *dummy;
  185|  2.90k|    igraph_int_t dummy2;
  186|  2.90k|    igraph_i_fastgreedy_community** heap = list->heap;
  187|  2.90k|    igraph_int_t *heapindex = list->heapindex;
  188|       |
  189|  2.90k|    root = idx;
  190|  5.69k|    while (root > 0) {
  ------------------
  |  Branch (190:12): [True: 4.54k, False: 1.14k]
  ------------------
  191|  4.54k|        parent = (root - 1) / 2;
  192|  4.54k|        if (*heap[parent]->maxdq->dq < *heap[root]->maxdq->dq) {
  ------------------
  |  Branch (192:13): [True: 2.78k, False: 1.76k]
  ------------------
  193|  2.78k|            c1 = heap[root]->maxdq->first;
  194|  2.78k|            c2 = heap[parent]->maxdq->first;
  195|       |
  196|  2.78k|            dummy = heap[parent];
  197|  2.78k|            heap[parent] = heap[root];
  198|  2.78k|            heap[root] = dummy;
  199|       |
  200|  2.78k|            dummy2 = heapindex[c1];
  201|  2.78k|            heapindex[c1] = heapindex[c2];
  202|  2.78k|            heapindex[c2] = dummy2;
  203|       |
  204|  2.78k|            root = parent;
  205|  2.78k|        } else {
  206|  1.76k|            break;
  207|  1.76k|        }
  208|  4.54k|    }
  209|  2.90k|}
fast_modularity.c:igraph_i_fastgreedy_community_list_remove:
  266|  37.3k|        igraph_i_fastgreedy_community_list *list, igraph_int_t idx) {
  267|  37.3k|    igraph_real_t old;
  268|  37.3k|    igraph_int_t commidx;
  269|       |
  270|       |    /* First adjust the index */
  271|  37.3k|    commidx = list->heap[list->no_of_communities - 1]->maxdq->first;
  272|  37.3k|    list->heapindex[commidx] = idx;
  273|  37.3k|    commidx = list->heap[idx]->maxdq->first;
  274|  37.3k|    list->heapindex[commidx] = -1;
  275|       |
  276|       |    /* Now remove the element */
  277|  37.3k|    old = *list->heap[idx]->maxdq->dq;
  278|  37.3k|    list->heap[idx] = list->heap[list->no_of_communities - 1];
  279|  37.3k|    list->no_of_communities--;
  280|       |
  281|       |    /* Recover heap property */
  282|  37.3k|    if (old > *list->heap[idx]->maxdq->dq) {
  ------------------
  |  Branch (282:9): [True: 37.0k, False: 322]
  ------------------
  283|  37.0k|        igraph_i_fastgreedy_community_list_sift_down(list, idx);
  284|  37.0k|    } else {
  285|    322|        igraph_i_fastgreedy_community_list_sift_up(list, idx);
  286|    322|    }
  287|  37.3k|}

igraph_community_label_propagation:
  554|  10.2k|        igraph_lpa_variant_t lpa_variant) {
  555|       |
  556|  10.2k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  557|  10.2k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  558|  10.2k|    igraph_int_t no_of_not_fixed_nodes = no_of_nodes;
  559|  10.2k|    igraph_int_t i, j, k;
  560|  10.2k|    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.2k|    igraph_vector_bool_t *fixed_copy = (igraph_vector_bool_t *) fixed;
  566|       |
  567|       |    /* Unlabelled nodes are represented with -1. */
  568|  10.2k|#define IS_UNLABELLED(x) (VECTOR(*membership)[x] < 0)
  569|       |
  570|       |    /* Do some initial checks */
  571|  10.2k|    if (fixed && igraph_vector_bool_size(fixed) != no_of_nodes) {
  ------------------
  |  Branch (571:9): [True: 0, False: 10.2k]
  |  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.2k|    if (weights) {
  ------------------
  |  Branch (574:9): [True: 10.2k, False: 0]
  ------------------
  575|  10.2k|        if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (575:13): [True: 0, False: 10.2k]
  ------------------
  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.2k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (578:13): [True: 10.0k, False: 129]
  ------------------
  579|  10.0k|            igraph_real_t minweight = igraph_vector_min(weights);
  580|  10.0k|            if (minweight < 0) {
  ------------------
  |  Branch (580:17): [True: 0, False: 10.0k]
  ------------------
  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.0k|            if (isnan(minweight)) {
  ------------------
  |  Branch (583:17): [True: 0, False: 10.0k]
  ------------------
  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.0k|        }
  587|  10.2k|    }
  588|  10.2k|    if (fixed && !initial) {
  ------------------
  |  Branch (588:9): [True: 0, False: 10.2k]
  |  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.2k|    IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  10.2k|    do { \
  |  |  657|  10.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  593|       |
  594|  10.2k|    if (initial) {
  ------------------
  |  Branch (594:9): [True: 0, False: 10.2k]
  ------------------
  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.2k|    } else {
  635|   466k|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (635:21): [True: 456k, False: 10.2k]
  ------------------
  636|   456k|            VECTOR(*membership)[i] = i;
  ------------------
  |  |   60|   456k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  637|   456k|        }
  638|  10.2k|    }
  639|       |
  640|       |    /* From this point onwards we use 'fixed_copy' instead of 'fixed' */
  641|  10.2k|    switch (lpa_variant) {
  642|  3.40k|    case IGRAPH_LPA_FAST:
  ------------------
  |  Branch (642:5): [True: 3.40k, False: 6.80k]
  ------------------
  643|  3.40k|        IGRAPH_CHECK(community_fast_label_propagation(graph, membership, mode, weights, fixed_copy));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  644|  3.40k|        break;
  645|       |
  646|  3.40k|    case IGRAPH_LPA_RETENTION:
  ------------------
  |  Branch (646:5): [True: 3.40k, False: 6.80k]
  ------------------
  647|  3.40k|        IGRAPH_CHECK(community_label_propagation(graph, membership, mode, weights, fixed_copy, /* retention */ true ));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  648|  3.40k|        break;
  649|       |
  650|  3.40k|    case IGRAPH_LPA_DOMINANCE:
  ------------------
  |  Branch (650:5): [True: 3.40k, False: 6.80k]
  ------------------
  651|  3.40k|        IGRAPH_CHECK(community_label_propagation(graph, membership, mode, weights, fixed_copy, /* retention */ false));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  652|  3.40k|        break;
  653|       |
  654|  3.40k|    default:
  ------------------
  |  Branch (654:5): [True: 0, False: 10.2k]
  ------------------
  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.2k|    }
  657|       |
  658|       |    /* Permute labels in increasing order */
  659|  10.2k|    igraph_vector_int_t relabel_label;
  660|  10.2k|    IGRAPH_CHECK(igraph_vector_int_init(&relabel_label, no_of_nodes));
  ------------------
  |  |  656|  10.2k|    do { \
  |  |  657|  10.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  661|  10.2k|    igraph_vector_int_fill(&relabel_label, -1);
  662|  10.2k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &relabel_label);
  ------------------
  |  |  603|  10.2k|    do { \
  |  |  604|  10.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  10.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  10.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  10.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 10.2k]
  |  |  ------------------
  |  |  608|  10.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  663|       |
  664|  10.2k|    j = 0;
  665|  10.2k|    unlabelled_left = false;
  666|   466k|    for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (666:17): [True: 456k, False: 10.2k]
  ------------------
  667|   456k|        k = VECTOR(*membership)[i];
  ------------------
  |  |   60|   456k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  668|   456k|        if (k >= 0) {
  ------------------
  |  Branch (668:13): [True: 456k, False: 0]
  ------------------
  669|   456k|            if (VECTOR(relabel_label)[k] == -1) {
  ------------------
  |  |   60|   456k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (669:17): [True: 346k, False: 109k]
  ------------------
  670|       |                /* We have seen this label for the first time */
  671|   346k|                VECTOR(relabel_label)[k] = j;
  ------------------
  |  |   60|   346k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  672|   346k|                k = j;
  673|   346k|                j++;
  674|   346k|            } else {
  675|   109k|                k = VECTOR(relabel_label)[k];
  ------------------
  |  |   60|   109k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  676|   109k|            }
  677|   456k|        } else {
  678|       |            /* This is an unlabeled vertex */
  679|      0|            unlabelled_left = true;
  680|      0|        }
  681|   456k|        VECTOR(*membership)[i] = k;
  ------------------
  |  |   60|   456k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  682|   456k|    }
  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.2k|    if (unlabelled_left) {
  ------------------
  |  Branch (692:9): [True: 0, False: 10.2k]
  ------------------
  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.2k|    igraph_vector_int_destroy(&relabel_label);
  756|  10.2k|    IGRAPH_FINALLY_CLEAN(1);
  757|       |
  758|  10.2k|    if (fixed != fixed_copy) {
  ------------------
  |  Branch (758:9): [True: 0, False: 10.2k]
  ------------------
  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.2k|    return IGRAPH_SUCCESS;
  765|  10.2k|}
label_propagation.c:community_fast_label_propagation:
  260|  3.40k|        const igraph_vector_bool_t *fixed) {
  261|       |
  262|  3.40k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  263|  3.40k|    igraph_int_t no_of_not_fixed_nodes = 0;
  264|  3.40k|    igraph_int_t i, j, k;
  265|  3.40k|    igraph_inclist_t il;
  266|  3.40k|    igraph_adjlist_t al;
  267|       |
  268|  3.40k|    igraph_vector_t label_weights;
  269|  3.40k|    igraph_vector_int_t dominant_labels, nonzero_labels, node_order;
  270|  3.40k|    igraph_dqueue_int_t queue;
  271|  3.40k|    igraph_vector_bool_t in_queue;
  272|  3.40k|    igraph_neimode_t reverse_mode;
  273|  3.40k|    int iter = 0; /* interruption counter */
  274|       |
  275|  3.40k|    reverse_mode = IGRAPH_REVERSE_MODE(mode);
  ------------------
  |  |  110|  3.40k|    ((mode) == IGRAPH_IN ? IGRAPH_OUT : ((mode) == IGRAPH_OUT ? IGRAPH_IN : (mode)))
  |  |  ------------------
  |  |  |  Branch (110:6): [True: 0, False: 3.40k]
  |  |  |  Branch (110:42): [True: 0, False: 3.40k]
  |  |  ------------------
  ------------------
  276|       |
  277|  3.40k|    if (weights) {
  ------------------
  |  Branch (277:9): [True: 3.40k, False: 0]
  ------------------
  278|  3.40k|        IGRAPH_CHECK(igraph_inclist_init(graph, &il, reverse_mode, IGRAPH_LOOPS_ONCE));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  279|  3.40k|        IGRAPH_FINALLY(igraph_inclist_destroy, &il);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  280|  3.40k|    } 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.40k|    IGRAPH_VECTOR_INIT_FINALLY(&label_weights, no_of_nodes);
  ------------------
  |  |  104|  3.40k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.40k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  287|  3.40k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&dominant_labels, 0);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  288|  3.40k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&nonzero_labels, 0);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  289|  3.40k|    IGRAPH_CHECK(igraph_vector_int_reserve(&dominant_labels, 2));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  290|       |
  291|       |    /* Initialize node ordering vector with only the not fixed nodes */
  292|  3.40k|    IGRAPH_DQUEUE_INT_INIT_FINALLY(&queue, no_of_nodes);
  ------------------
  |  |   61|  3.40k|    do { IGRAPH_CHECK(igraph_dqueue_int_init(q, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  3.40k|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, q); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  293|  3.40k|    IGRAPH_VECTOR_BOOL_INIT_FINALLY(&in_queue, no_of_nodes);
  ------------------
  |  |  109|  3.40k|    do { IGRAPH_CHECK(igraph_vector_bool_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  3.40k|        IGRAPH_FINALLY(igraph_vector_bool_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (110:65): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  294|       |
  295|       |    /* Initialize node ordering vector with only the not fixed nodes */
  296|  3.40k|    if (fixed) {
  ------------------
  |  Branch (296:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    } else {
  306|  3.40k|        IGRAPH_CHECK(igraph_vector_int_init_range(&node_order, 0, no_of_nodes));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  307|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &node_order);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  308|  3.40k|        no_of_not_fixed_nodes = no_of_nodes;
  309|  3.40k|    }
  310|       |
  311|   155k|    for (i = 0; i < no_of_not_fixed_nodes; i++) {
  ------------------
  |  Branch (311:17): [True: 152k, False: 3.40k]
  ------------------
  312|   152k|        IGRAPH_CHECK(igraph_dqueue_int_push(&queue, VECTOR(node_order)[i]));
  ------------------
  |  |  656|   152k|    do { \
  |  |  657|   152k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   152k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   152k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
  313|   152k|        VECTOR(in_queue)[VECTOR(node_order)[i]] = true;
  ------------------
  |  |   60|   152k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(in_queue)[VECTOR(node_order)[i]] = true;
  ------------------
  |  |   60|   152k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  314|   152k|    }
  315|  3.40k|    igraph_vector_int_destroy(&node_order);
  316|  3.40k|    IGRAPH_FINALLY_CLEAN(1);
  317|       |
  318|   168k|    while (!igraph_dqueue_int_empty(&queue)) {
  ------------------
  |  Branch (318:12): [True: 164k, False: 3.40k]
  ------------------
  319|   164k|        igraph_int_t v1, v2, e = -1, num_neis;
  320|   164k|        igraph_real_t max_count;
  321|   164k|        igraph_vector_int_t *neis;
  322|   164k|        igraph_bool_t was_zero;
  323|       |
  324|   164k|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1 << 8);
  ------------------
  |  |   71|   164k|    do { \
  |  |   72|   164k|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 1, False: 164k]
  |  |  ------------------
  |  |   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|   164k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 164k]
  |  |  ------------------
  ------------------
  325|       |
  326|   164k|        v1 = igraph_dqueue_int_pop(&queue);
  327|   164k|        VECTOR(in_queue)[v1] = false;
  ------------------
  |  |   60|   164k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  328|       |
  329|       |        /* Count the weights corresponding to different labels */
  330|   164k|        igraph_vector_int_clear(&dominant_labels);
  331|   164k|        igraph_vector_int_clear(&nonzero_labels);
  332|   164k|        max_count = 0.0;
  333|   164k|        if (weights) {
  ------------------
  |  Branch (333:13): [True: 164k, False: 0]
  ------------------
  334|   164k|            neis = igraph_inclist_get(&il, v1);
  ------------------
  |  |  102|   164k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  335|   164k|        } 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|   164k|        num_neis = igraph_vector_int_size(neis);
  340|   401k|        for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (340:21): [True: 236k, False: 164k]
  ------------------
  341|   236k|            if (weights) {
  ------------------
  |  Branch (341:17): [True: 236k, False: 0]
  ------------------
  342|   236k|                e = VECTOR(*neis)[j];
  ------------------
  |  |   60|   236k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  343|   236k|                v2 = IGRAPH_OTHER(graph, e, v1);
  ------------------
  |  |  146|   236k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   236k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   236k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   132k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   132k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   104k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   104k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 132k, False: 104k]
  |  |  ------------------
  ------------------
  344|   236k|            } else {
  345|      0|                v2 = VECTOR(*neis)[j];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  346|      0|            }
  347|   236k|            k = VECTOR(*membership)[v2];
  ------------------
  |  |   60|   236k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  348|   236k|            if (k < 0) {
  ------------------
  |  Branch (348:17): [True: 0, False: 236k]
  ------------------
  349|      0|                continue;    /* skip if it has no label yet */
  350|      0|            }
  351|   236k|            was_zero = (VECTOR(label_weights)[k] == 0);
  ------------------
  |  |   60|   236k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  352|   236k|            VECTOR(label_weights)[k] += (weights ? VECTOR(*weights)[e] : 1);
  ------------------
  |  |   60|   236k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(label_weights)[k] += (weights ? VECTOR(*weights)[e] : 1);
  ------------------
  |  |   60|   236k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (352:42): [True: 236k, False: 0]
  ------------------
  353|       |
  354|   236k|            if (was_zero && VECTOR(label_weights)[k] >= 0) {
  ------------------
  |  |   60|   134k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (354:17): [True: 134k, False: 101k]
  |  Branch (354:29): [True: 134k, False: 0]
  ------------------
  355|       |                /* counter just became non-negative */
  356|   134k|                IGRAPH_CHECK(igraph_vector_int_push_back(&nonzero_labels, k));
  ------------------
  |  |  656|   134k|    do { \
  |  |  657|   134k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   134k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   134k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 134k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   134k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 134k]
  |  |  ------------------
  ------------------
  357|   134k|            }
  358|       |
  359|   236k|            if (max_count < VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|   236k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (359:17): [True: 163k, False: 73.0k]
  ------------------
  360|   163k|                max_count = VECTOR(label_weights)[k];
  ------------------
  |  |   60|   163k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  361|   163k|                IGRAPH_CHECK(igraph_vector_int_resize(&dominant_labels, 1));
  ------------------
  |  |  656|   163k|    do { \
  |  |  657|   163k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   163k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   163k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 163k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   163k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 163k]
  |  |  ------------------
  ------------------
  362|   163k|                VECTOR(dominant_labels)[0] = k;
  ------------------
  |  |   60|   163k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  363|   163k|            } else if (max_count == VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|  73.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (363:24): [True: 3.05k, False: 70.0k]
  ------------------
  364|  3.05k|                IGRAPH_CHECK(igraph_vector_int_push_back(&dominant_labels, k));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  365|  3.05k|            }
  366|   236k|        }
  367|       |
  368|   164k|        if (igraph_vector_int_size(&dominant_labels) > 0) {
  ------------------
  |  Branch (368:13): [True: 60.2k, False: 104k]
  ------------------
  369|  60.2k|            igraph_int_t current_label = VECTOR(*membership)[v1];
  ------------------
  |  |   60|  60.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  370|       |
  371|       |            /* Select randomly from the dominant labels */
  372|  60.2k|            k = RNG_INTEGER(0, igraph_vector_int_size(&dominant_labels) - 1);
  ------------------
  |  |  152|  60.2k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  373|  60.2k|            igraph_int_t new_label = VECTOR(dominant_labels)[k]; /* a dominant label */
  ------------------
  |  |   60|  60.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  374|       |
  375|       |            /* Check if the _current_ label of the node is not the same */
  376|  60.2k|            if (new_label != current_label) {
  ------------------
  |  Branch (376:17): [True: 42.3k, False: 17.9k]
  ------------------
  377|       |                /* We still need to consider its neighbors not in the new community */
  378|   161k|                for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (378:29): [True: 119k, False: 42.3k]
  ------------------
  379|   119k|                    if (weights) {
  ------------------
  |  Branch (379:25): [True: 119k, False: 0]
  ------------------
  380|   119k|                        e = VECTOR(*neis)[j];
  ------------------
  |  |   60|   119k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  381|   119k|                        v2 = IGRAPH_OTHER(graph, e, v1);
  ------------------
  |  |  146|   119k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   119k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   119k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|  61.5k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  61.5k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  57.7k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  57.7k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 61.5k, False: 57.7k]
  |  |  ------------------
  ------------------
  382|   119k|                    } else {
  383|      0|                        v2 = VECTOR(*neis)[j];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  384|      0|                    }
  385|   119k|                    if (!VECTOR(in_queue)[v2]) {
  ------------------
  |  |   60|   119k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (385:25): [True: 37.2k, False: 82.0k]
  ------------------
  386|  37.2k|                        igraph_int_t neigh_label = VECTOR(*membership)[v2]; /* neighbor community */
  ------------------
  |  |   60|  37.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  387|  37.2k|                        if (neigh_label != new_label && /* not in new community */
  ------------------
  |  Branch (387:29): [True: 12.6k, False: 24.5k]
  ------------------
  388|  12.6k|                            (fixed == NULL || !VECTOR(*fixed)[v2]) ) { /* not fixed */
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (388:30): [True: 12.6k, False: 0]
  |  Branch (388:47): [True: 0, False: 0]
  ------------------
  389|  12.6k|                            IGRAPH_CHECK(igraph_dqueue_int_push(&queue, v2));
  ------------------
  |  |  656|  12.6k|    do { \
  |  |  657|  12.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  12.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  12.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.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|  12.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 12.6k]
  |  |  ------------------
  ------------------
  390|  12.6k|                            VECTOR(in_queue)[v2] = true;
  ------------------
  |  |   60|  12.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  391|  12.6k|                        }
  392|  37.2k|                    }
  393|   119k|                }
  394|  42.3k|            }
  395|  60.2k|            VECTOR(*membership)[v1] = new_label;
  ------------------
  |  |   60|  60.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  396|  60.2k|        }
  397|       |
  398|       |        /* Clear the nonzero elements in label_weights */
  399|   164k|        num_neis = igraph_vector_int_size(&nonzero_labels);
  400|   299k|        for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (400:21): [True: 134k, False: 164k]
  ------------------
  401|   134k|            VECTOR(label_weights)[VECTOR(nonzero_labels)[j]] = 0;
  ------------------
  |  |   60|   134k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(label_weights)[VECTOR(nonzero_labels)[j]] = 0;
  ------------------
  |  |   60|   134k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  402|   134k|        }
  403|   164k|    }
  404|       |
  405|  3.40k|    if (weights) {
  ------------------
  |  Branch (405:9): [True: 3.40k, False: 0]
  ------------------
  406|  3.40k|        igraph_inclist_destroy(&il);
  407|  3.40k|    } else {
  408|      0|        igraph_adjlist_destroy(&al);
  409|      0|    }
  410|  3.40k|    IGRAPH_FINALLY_CLEAN(1);
  411|       |
  412|  3.40k|    igraph_vector_bool_destroy(&in_queue);
  413|  3.40k|    igraph_dqueue_int_destroy(&queue);
  414|  3.40k|    igraph_vector_destroy(&label_weights);
  415|  3.40k|    igraph_vector_int_destroy(&dominant_labels);
  416|  3.40k|    igraph_vector_int_destroy(&nonzero_labels);
  417|  3.40k|    IGRAPH_FINALLY_CLEAN(5);
  418|       |
  419|  3.40k|    return IGRAPH_SUCCESS;
  420|  3.40k|}
label_propagation.c:community_label_propagation:
   35|  6.80k|        igraph_bool_t retention) {
   36|       |
   37|  6.80k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
   38|  6.80k|    igraph_int_t no_of_not_fixed_nodes = 0;
   39|  6.80k|    igraph_int_t i, j, k;
   40|  6.80k|    igraph_adjlist_t al;
   41|  6.80k|    igraph_inclist_t il;
   42|  6.80k|    igraph_bool_t running, control_iteration;
   43|       |
   44|  6.80k|    igraph_vector_t label_weights;
   45|  6.80k|    igraph_vector_int_t dominant_labels, nonzero_labels, node_order;
   46|  6.80k|    igraph_neimode_t reverse_mode;
   47|  6.80k|    int iter = 0; /* interruption counter */
   48|       |
   49|  6.80k|    reverse_mode = IGRAPH_REVERSE_MODE(mode);
  ------------------
  |  |  110|  6.80k|    ((mode) == IGRAPH_IN ? IGRAPH_OUT : ((mode) == IGRAPH_OUT ? IGRAPH_IN : (mode)))
  |  |  ------------------
  |  |  |  Branch (110:6): [True: 0, False: 6.80k]
  |  |  |  Branch (110:42): [True: 0, False: 6.80k]
  |  |  ------------------
  ------------------
   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|  6.80k|    if (weights) {
  ------------------
  |  Branch (54:9): [True: 6.80k, False: 0]
  ------------------
   55|  6.80k|        IGRAPH_CHECK(igraph_inclist_init(graph, &il, reverse_mode, IGRAPH_LOOPS_ONCE));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   56|  6.80k|        IGRAPH_FINALLY(igraph_inclist_destroy, &il);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   57|  6.80k|    } 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|  6.80k|    IGRAPH_VECTOR_INIT_FINALLY(&label_weights, no_of_nodes);
  ------------------
  |  |  104|  6.80k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.80k|    do { \
  |  |  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  6.80k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.80k|    do { \
  |  |  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   64|  6.80k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&dominant_labels, 0);
  ------------------
  |  |  119|  6.80k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.80k|    do { \
  |  |  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  6.80k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.80k|    do { \
  |  |  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   65|  6.80k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&nonzero_labels, 0);
  ------------------
  |  |  119|  6.80k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  6.80k|    do { \
  |  |  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  6.80k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  6.80k|    do { \
  |  |  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  6.80k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   66|  6.80k|    IGRAPH_CHECK(igraph_vector_int_reserve(&dominant_labels, 2));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   67|       |
   68|       |    /* Initialize node ordering vector with only the not fixed nodes */
   69|  6.80k|    if (fixed) {
  ------------------
  |  Branch (69:9): [True: 0, False: 6.80k]
  ------------------
   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|  6.80k|    } else {
   79|  6.80k|        IGRAPH_CHECK(igraph_vector_int_init_range(&node_order, 0, no_of_nodes));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   80|  6.80k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &node_order);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   81|  6.80k|        no_of_not_fixed_nodes = no_of_nodes;
   82|  6.80k|    }
   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|  6.80k|    control_iteration = true;
   99|  6.80k|    running = true;
  100|  29.5k|    while (running) {
  ------------------
  |  Branch (100:12): [True: 22.7k, False: 6.80k]
  ------------------
  101|  22.7k|        igraph_int_t v1, num_neis;
  102|  22.7k|        igraph_real_t max_count;
  103|  22.7k|        igraph_vector_int_t *neis;
  104|  22.7k|        igraph_vector_int_t *ineis;
  105|  22.7k|        igraph_bool_t was_zero;
  106|       |
  107|  22.7k|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1 << 8);
  ------------------
  |  |   71|  22.7k|    do { \
  |  |   72|  22.7k|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 0, False: 22.7k]
  |  |  ------------------
  |  |   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|  22.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 22.7k]
  |  |  ------------------
  ------------------
  108|       |
  109|  22.7k|        if (retention) {
  ------------------
  |  Branch (109:13): [True: 8.59k, False: 14.1k]
  ------------------
  110|       |            /* We stop in this iteration by default, unless a label changes */
  111|  8.59k|            running = false;
  112|       |            /* Shuffle the node ordering vector */
  113|  8.59k|            igraph_vector_int_shuffle(&node_order);
  114|  14.1k|        } else {
  115|  14.1k|            if (control_iteration) {
  ------------------
  |  Branch (115:17): [True: 8.79k, False: 5.39k]
  ------------------
  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|  8.79k|                running = false;
  120|  8.79k|            } else {
  121|       |                /* Shuffle the node ordering vector if we are in the label updating iteration */
  122|  5.39k|                igraph_vector_int_shuffle(&node_order);
  123|  5.39k|            }
  124|  14.1k|        }
  125|       |
  126|       |        /* In the prescribed order, loop over the vertices and reassign labels */
  127|  1.09M|        for (i = 0; i < no_of_not_fixed_nodes; i++) {
  ------------------
  |  Branch (127:21): [True: 1.07M, False: 22.7k]
  ------------------
  128|  1.07M|            v1 = VECTOR(node_order)[i];
  ------------------
  |  |   60|  1.07M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  129|       |
  130|       |            /* Count the weights corresponding to different labels */
  131|  1.07M|            igraph_vector_int_clear(&dominant_labels);
  132|  1.07M|            igraph_vector_int_clear(&nonzero_labels);
  133|  1.07M|            max_count = 0.0;
  134|  1.07M|            if (weights) {
  ------------------
  |  Branch (134:17): [True: 1.07M, False: 0]
  ------------------
  135|       |
  136|  1.07M|                ineis = igraph_inclist_get(&il, v1);
  ------------------
  |  |  102|  1.07M|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  137|  1.07M|                num_neis = igraph_vector_int_size(ineis);
  138|       |
  139|  2.44M|                for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (139:29): [True: 1.37M, False: 1.07M]
  ------------------
  140|  1.37M|                    k = VECTOR(*membership)[IGRAPH_OTHER(graph, VECTOR(*ineis)[j], v1)];
  ------------------
  |  |   60|  1.37M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  k = VECTOR(*membership)[IGRAPH_OTHER(graph, VECTOR(*ineis)[j], v1)];
  ------------------
  |  |  146|  1.37M|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|  1.37M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  1.37M|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   748k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   748k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   623k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   623k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 748k, False: 623k]
  |  |  ------------------
  ------------------
  141|  1.37M|                    if (k < 0) {
  ------------------
  |  Branch (141:25): [True: 0, False: 1.37M]
  ------------------
  142|      0|                        continue;    /* skip if it has no label yet */
  143|      0|                    }
  144|  1.37M|                    was_zero = (VECTOR(label_weights)[k] == 0);
  ------------------
  |  |   60|  1.37M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  145|  1.37M|                    VECTOR(label_weights)[k] += VECTOR(*weights)[VECTOR(*ineis)[j]];
  ------------------
  |  |   60|  1.37M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(label_weights)[k] += VECTOR(*weights)[VECTOR(*ineis)[j]];
  ------------------
  |  |   60|  1.37M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(label_weights)[k] += VECTOR(*weights)[VECTOR(*ineis)[j]];
  ------------------
  |  |   60|  1.37M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  146|       |
  147|  1.37M|                    if (was_zero && VECTOR(label_weights)[k] != 0) {
  ------------------
  |  |   60|   728k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (147:25): [True: 728k, False: 643k]
  |  Branch (147:37): [True: 728k, False: 0]
  ------------------
  148|       |                        /* weights just became nonzero */
  149|   728k|                        IGRAPH_CHECK(igraph_vector_int_push_back(&nonzero_labels, k));
  ------------------
  |  |  656|   728k|    do { \
  |  |  657|   728k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   728k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   728k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 728k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   728k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 728k]
  |  |  ------------------
  ------------------
  150|   728k|                    }
  151|       |
  152|  1.37M|                    if (max_count < VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|  1.37M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (152:25): [True: 1.04M, False: 323k]
  ------------------
  153|  1.04M|                        max_count = VECTOR(label_weights)[k];
  ------------------
  |  |   60|  1.04M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  154|  1.04M|                        IGRAPH_CHECK(igraph_vector_int_resize(&dominant_labels, 1));
  ------------------
  |  |  656|  1.04M|    do { \
  |  |  657|  1.04M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.04M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.04M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.04M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.04M]
  |  |  ------------------
  ------------------
  155|  1.04M|                        VECTOR(dominant_labels)[0] = k;
  ------------------
  |  |   60|  1.04M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  156|  1.04M|                    } else if (max_count == VECTOR(label_weights)[k]) {
  ------------------
  |  |   60|   323k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (156:32): [True: 13.8k, False: 309k]
  ------------------
  157|  13.8k|                        IGRAPH_CHECK(igraph_vector_int_push_back(&dominant_labels, k));
  ------------------
  |  |  656|  13.8k|    do { \
  |  |  657|  13.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  13.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  13.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 13.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|  13.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 13.8k]
  |  |  ------------------
  ------------------
  158|  13.8k|                    }
  159|  1.37M|                }
  160|  1.07M|            } 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.07M|            if (igraph_vector_int_size(&dominant_labels) > 0) {
  ------------------
  |  Branch (188:17): [True: 395k, False: 679k]
  ------------------
  189|   395k|                if (retention) {
  ------------------
  |  Branch (189:21): [True: 144k, False: 250k]
  ------------------
  190|       |                    /* If we are using retention, we first check if the current label
  191|       |                    is among the maximum label. */
  192|   144k|                    j = (long)VECTOR(*membership)[v1];
  ------------------
  |  |   60|   144k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  193|   144k|                    if (j < 0 || /* Doesn't have a label yet */
  ------------------
  |  Branch (193:25): [True: 0, False: 144k]
  ------------------
  194|   144k|                        VECTOR(label_weights)[j] == 0 || /* Label not present in neighbors */
  ------------------
  |  |   60|   144k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (194:25): [True: 37.7k, False: 106k]
  ------------------
  195|   106k|                        VECTOR(label_weights)[j] < max_count /* Label not dominant */) {
  ------------------
  |  |   60|   106k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (195:25): [True: 4.47k, False: 102k]
  ------------------
  196|       |                        /* Select randomly from the dominant labels */
  197|  42.2k|                        k = RNG_INTEGER(0, igraph_vector_int_size(&dominant_labels) - 1);
  ------------------
  |  |  152|  42.2k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  198|  42.2k|                        k = VECTOR(dominant_labels)[(long int)k];
  ------------------
  |  |   60|  42.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  199|       |                        /* If label changes, we will continue running */
  200|  42.2k|                        if (k != j) {
  ------------------
  |  Branch (200:29): [True: 42.2k, False: 0]
  ------------------
  201|  42.2k|                            running = true;
  202|  42.2k|                        }
  203|       |                        /* Actually change label */
  204|  42.2k|                        VECTOR(*membership)[v1] = k;
  ------------------
  |  |   60|  42.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  205|  42.2k|                    }
  206|   250k|                } else {
  207|       |                    /* We are not using retention, so check if we should do a control iteration
  208|       |                    or an update iteration. */
  209|   250k|                    if (control_iteration) {
  ------------------
  |  Branch (209:25): [True: 149k, False: 101k]
  ------------------
  210|       |                        /* Check if the _current_ label of the node is also dominant */
  211|   149k|                        k = VECTOR(*membership)[v1];
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  212|   149k|                        if (k < 0 ||                              /* No label assigned yet or */
  ------------------
  |  Branch (212:29): [True: 0, False: 149k]
  ------------------
  213|   149k|                            VECTOR(label_weights)[k] < max_count /* Label is not maximum */
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (213:29): [True: 52.0k, False: 97.1k]
  ------------------
  214|   149k|                           ) {
  215|       |                            /* Nope, we need at least one more iteration */
  216|  52.0k|                            running = true;
  217|  52.0k|                        }
  218|   149k|                    } else {
  219|       |                        /* Select randomly from the dominant labels */
  220|   101k|                        k = RNG_INTEGER(0, igraph_vector_int_size(&dominant_labels) - 1);
  ------------------
  |  |  152|   101k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  221|   101k|                        VECTOR(*membership)[v1] = VECTOR(dominant_labels)[k];
  ------------------
  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      VECTOR(*membership)[v1] = VECTOR(dominant_labels)[k];
  ------------------
  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  222|   101k|                    }
  223|   250k|                }
  224|   395k|            }
  225|       |
  226|       |            /* Clear the nonzero elements in label_weights */
  227|  1.07M|            num_neis = igraph_vector_int_size(&nonzero_labels);
  228|  1.80M|            for (j = 0; j < num_neis; j++) {
  ------------------
  |  Branch (228:25): [True: 728k, False: 1.07M]
  ------------------
  229|   728k|                VECTOR(label_weights)[VECTOR(nonzero_labels)[j]] = 0;
  ------------------
  |  |   60|   728k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(label_weights)[VECTOR(nonzero_labels)[j]] = 0;
  ------------------
  |  |   60|   728k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  230|   728k|            }
  231|  1.07M|        }
  232|       |
  233|       |        /* Alternating between control iterations and label updating iterations */
  234|  22.7k|        if (!retention) {
  ------------------
  |  Branch (234:13): [True: 14.1k, False: 8.59k]
  ------------------
  235|  14.1k|            control_iteration = !control_iteration;
  236|  14.1k|        }
  237|  22.7k|    }
  238|       |
  239|  6.80k|    if (weights) {
  ------------------
  |  Branch (239:9): [True: 6.80k, False: 0]
  ------------------
  240|  6.80k|        igraph_inclist_destroy(&il);
  241|  6.80k|    } else {
  242|      0|        igraph_adjlist_destroy(&al);
  243|      0|    }
  244|  6.80k|    IGRAPH_FINALLY_CLEAN(1);
  245|       |
  246|  6.80k|    igraph_vector_int_destroy(&node_order);
  247|  6.80k|    igraph_vector_int_destroy(&nonzero_labels);
  248|  6.80k|    igraph_vector_int_destroy(&dominant_labels);
  249|  6.80k|    igraph_vector_destroy(&label_weights);
  250|  6.80k|    IGRAPH_FINALLY_CLEAN(4);
  251|       |
  252|  6.80k|    return IGRAPH_SUCCESS;
  253|  6.80k|}

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

igraph_community_multilevel:
  597|  3.40k|                                           igraph_vector_t *modularity) {
  598|       |
  599|  3.40k|    igraph_t g;
  600|  3.40k|    igraph_vector_t w;
  601|  3.40k|    igraph_vector_int_t m;
  602|  3.40k|    igraph_vector_int_t level_membership;
  603|  3.40k|    igraph_real_t prev_q = -1, q = -1;
  604|  3.40k|    igraph_int_t level = 1;
  605|  3.40k|    igraph_int_t vcount = igraph_vcount(graph);
  606|  3.40k|    igraph_int_t ecount = igraph_ecount(graph);
  607|       |
  608|       |    /* Initial sanity checks on the input parameters */
  609|  3.40k|    if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (609:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    if (weights) {
  ------------------
  |  Branch (613:9): [True: 3.40k, False: 0]
  ------------------
  614|  3.40k|        if (igraph_vector_size(weights) != ecount) {
  ------------------
  |  Branch (614:13): [True: 0, False: 3.40k]
  ------------------
  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.40k|        if (ecount > 0) {
  ------------------
  |  Branch (617:13): [True: 3.30k, False: 97]
  ------------------
  618|  3.30k|            igraph_real_t minweight = igraph_vector_min(weights);
  619|  3.30k|            if (minweight < 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 3.30k]
  ------------------
  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.30k|            } else if (isnan(minweight)) {
  ------------------
  |  Branch (621:24): [True: 0, False: 3.30k]
  ------------------
  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.30k|        }
  625|  3.40k|    }
  626|  3.40k|    if (resolution < 0.0) {
  ------------------
  |  Branch (626:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    IGRAPH_CHECK(igraph_copy(&g, graph));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  632|  3.40k|    IGRAPH_FINALLY(igraph_destroy, &g);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  633|       |
  634|  3.40k|    if (weights) {
  ------------------
  |  Branch (634:9): [True: 3.40k, False: 0]
  ------------------
  635|  3.40k|        IGRAPH_CHECK(igraph_vector_init_copy(&w, weights));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  636|  3.40k|        IGRAPH_FINALLY(igraph_vector_destroy, &w);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  637|  3.40k|    } 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.40k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&m, vcount);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  643|  3.40k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&level_membership, vcount);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  644|       |
  645|  3.40k|    if (memberships || membership) {
  ------------------
  |  Branch (645:9): [True: 3.40k, False: 0]
  |  Branch (645:24): [True: 0, False: 0]
  ------------------
  646|       |        /* Put each vertex in its own community */
  647|   155k|        for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (647:34): [True: 152k, False: 3.40k]
  ------------------
  648|   152k|            VECTOR(level_membership)[i] = i;
  ------------------
  |  |   60|   152k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  649|   152k|        }
  650|  3.40k|    }
  651|  3.40k|    if (memberships) {
  ------------------
  |  Branch (651:9): [True: 3.40k, False: 0]
  ------------------
  652|       |        /* Resize the membership matrix to have vcount columns and no rows */
  653|  3.40k|        IGRAPH_CHECK(igraph_matrix_int_resize(memberships, 0, vcount));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  654|  3.40k|    }
  655|  3.40k|    if (modularity) {
  ------------------
  |  Branch (655:9): [True: 3.40k, False: 0]
  ------------------
  656|       |        /* Clear the modularity vector */
  657|  3.40k|        igraph_vector_clear(modularity);
  658|  3.40k|    }
  659|       |
  660|  7.53k|    while (true) {
  ------------------
  |  Branch (660:12): [True: 7.53k, Folded]
  ------------------
  661|       |        /* Remember the previous modularity and vertex count, do a single step */
  662|  7.53k|        igraph_int_t step_vcount = igraph_vcount(&g);
  663|       |
  664|  7.53k|        prev_q = q;
  665|  7.53k|        IGRAPH_CHECK(igraph_i_community_multilevel_step(&g, &w, &m, &q, resolution));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  666|       |
  667|       |        /* Were there any merges? If not, we have to stop the process */
  668|  7.53k|        if (igraph_vcount(&g) == step_vcount || q < prev_q) {
  ------------------
  |  Branch (668:13): [True: 3.39k, False: 4.13k]
  |  Branch (668:49): [True: 1, False: 4.13k]
  ------------------
  669|  3.40k|            break;
  670|  3.40k|        }
  671|       |
  672|  4.13k|        if (memberships || membership) {
  ------------------
  |  Branch (672:13): [True: 4.13k, False: 0]
  |  Branch (672:28): [True: 0, False: 0]
  ------------------
  673|   200k|            for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (673:38): [True: 196k, False: 4.13k]
  ------------------
  674|       |                /* Readjust the membership vector */
  675|   196k|                VECTOR(level_membership)[i] = VECTOR(m)[ VECTOR(level_membership)[i] ];
  ------------------
  |  |   60|   196k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(level_membership)[i] = VECTOR(m)[ VECTOR(level_membership)[i] ];
  ------------------
  |  |   60|   196k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(level_membership)[i] = VECTOR(m)[ VECTOR(level_membership)[i] ];
  ------------------
  |  |   60|   196k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  676|   196k|            }
  677|  4.13k|        }
  678|       |
  679|  4.13k|        if (modularity) {
  ------------------
  |  Branch (679:13): [True: 4.13k, False: 0]
  ------------------
  680|       |            /* If we have to return the modularity scores, add it to the modularity vector */
  681|  4.13k|            IGRAPH_CHECK(igraph_vector_push_back(modularity, q));
  ------------------
  |  |  656|  4.13k|    do { \
  |  |  657|  4.13k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.13k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.13k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.13k]
  |  |  ------------------
  ------------------
  682|  4.13k|        }
  683|       |
  684|  4.13k|        if (memberships) {
  ------------------
  |  Branch (684:13): [True: 4.13k, False: 0]
  ------------------
  685|       |            /* If we have to return the membership vectors at each level, store the new
  686|       |             * membership vector */
  687|  4.13k|            IGRAPH_CHECK(igraph_matrix_int_add_rows(memberships, 1));
  ------------------
  |  |  656|  4.13k|    do { \
  |  |  657|  4.13k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.13k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.13k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.13k]
  |  |  ------------------
  ------------------
  688|  4.13k|            IGRAPH_CHECK(igraph_matrix_int_set_row(memberships, &level_membership, level - 1));
  ------------------
  |  |  656|  4.13k|    do { \
  |  |  657|  4.13k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.13k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.13k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.13k]
  |  |  ------------------
  ------------------
  689|  4.13k|        }
  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.13k|        level++;
  696|  4.13k|    }
  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.40k|    if (modularity && igraph_vector_size(modularity) == 0) {
  ------------------
  |  Branch (700:9): [True: 3.40k, False: 0]
  |  Branch (700:23): [True: 97, False: 3.30k]
  ------------------
  701|     97|        igraph_vector_int_t tmp;
  702|     97|        igraph_real_t mod;
  703|       |
  704|     97|        IGRAPH_CHECK(igraph_vector_int_init_range(&tmp, 0, vcount));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  705|     97|        IGRAPH_FINALLY(igraph_vector_int_destroy, &tmp);
  ------------------
  |  |  603|     97|    do { \
  |  |  604|     97|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|     97|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|     97|         * incorrect destructor function with the pointer */ \
  |  |  607|     97|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 97]
  |  |  ------------------
  |  |  608|     97|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|     97|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 97]
  |  |  ------------------
  ------------------
  706|       |
  707|     97|        IGRAPH_CHECK(igraph_modularity(graph, &tmp, weights, resolution,
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  708|     97|                                       /* only undirected */ false, &mod));
  709|       |
  710|     97|        igraph_vector_int_destroy(&tmp);
  711|     97|        IGRAPH_FINALLY_CLEAN(1);
  712|       |
  713|     97|        IGRAPH_CHECK(igraph_vector_resize(modularity, 1));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  714|     97|        VECTOR(*modularity)[0] = mod;
  ------------------
  |  |   60|     97|#define VECTOR(v) ((v).stor_begin)
  ------------------
  715|     97|    }
  716|       |
  717|       |    /* If we need the final membership vector, copy it to the output */
  718|  3.40k|    if (membership) {
  ------------------
  |  Branch (718:9): [True: 3.40k, False: 0]
  ------------------
  719|  3.40k|        IGRAPH_CHECK(igraph_vector_int_resize(membership, vcount));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  720|   155k|        for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (720:34): [True: 152k, False: 3.40k]
  ------------------
  721|   152k|            VECTOR(*membership)[i] = VECTOR(level_membership)[i];
  ------------------
  |  |   60|   152k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*membership)[i] = VECTOR(level_membership)[i];
  ------------------
  |  |   60|   152k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  722|   152k|        }
  723|  3.40k|    }
  724|       |
  725|       |    /* Destroy the copy of the graph */
  726|  3.40k|    igraph_destroy(&g);
  727|       |
  728|       |    /* Destroy the temporary vectors */
  729|  3.40k|    igraph_vector_int_destroy(&m);
  730|  3.40k|    igraph_vector_destroy(&w);
  731|  3.40k|    igraph_vector_int_destroy(&level_membership);
  732|  3.40k|    IGRAPH_FINALLY_CLEAN(4);
  733|       |
  734|  3.40k|    return IGRAPH_SUCCESS;
  735|  3.40k|}
louvain.c:igraph_i_community_multilevel_step:
  327|  7.53k|        const igraph_real_t resolution) {
  328|       |
  329|  7.53k|    igraph_int_t vcount = igraph_vcount(graph);
  330|  7.53k|    igraph_int_t ecount = igraph_ecount(graph);
  331|  7.53k|    igraph_real_t q, pass_q;
  332|       |    /* int pass; // used only for debugging */
  333|  7.53k|    igraph_bool_t changed;
  334|  7.53k|    igraph_vector_int_t links_community;
  335|  7.53k|    igraph_vector_t links_weight;
  336|  7.53k|    igraph_vector_int_t edges;
  337|  7.53k|    igraph_vector_int_t temp_membership;
  338|  7.53k|    igraph_i_multilevel_community_list communities;
  339|  7.53k|    igraph_vector_int_t node_order;
  340|       |
  341|  7.53k|    IGRAPH_CHECK(igraph_vector_int_init_range(&node_order, 0, vcount));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  342|  7.53k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &node_order);
  ------------------
  |  |  603|  7.53k|    do { \
  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  ------------------
  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  343|  7.53k|    igraph_vector_int_shuffle(&node_order);
  344|       |
  345|       |    /* Initialize data structures */
  346|  7.53k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&links_community, 0);
  ------------------
  |  |  119|  7.53k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.53k|    do { \
  |  |  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.53k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.53k|    do { \
  |  |  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  347|  7.53k|    IGRAPH_VECTOR_INIT_FINALLY(&links_weight, 0);
  ------------------
  |  |  104|  7.53k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.53k|    do { \
  |  |  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  7.53k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.53k|    do { \
  |  |  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  348|  7.53k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  7.53k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.53k|    do { \
  |  |  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.53k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.53k|    do { \
  |  |  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  349|  7.53k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&temp_membership, vcount);
  ------------------
  |  |  119|  7.53k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.53k|    do { \
  |  |  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.53k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.53k|    do { \
  |  |  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  350|  7.53k|    IGRAPH_CHECK(igraph_vector_int_resize(membership, vcount));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  351|       |
  352|       |    /* Initialize list of communities from graph vertices */
  353|  7.53k|    communities.vertices_no = vcount;
  354|  7.53k|    communities.communities_no = vcount;
  355|  7.53k|    communities.weights = weights;
  356|  7.53k|    communities.weight_sum = 2.0 * igraph_vector_sum(weights);
  357|  7.53k|    communities.membership = membership;
  358|  7.53k|    communities.item = IGRAPH_CALLOC(vcount, igraph_i_multilevel_community);
  ------------------
  |  |   33|  7.53k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  15.0k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 7.53k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 7.53k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 7.53k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  359|  7.53k|    IGRAPH_CHECK_OOM(communities.item, "Multi-level community structure detection failed.");
  ------------------
  |  |  709|  7.53k|    do { \
  |  |  710|  7.53k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  360|  7.53k|    IGRAPH_FINALLY(igraph_free, communities.item);
  ------------------
  |  |  603|  7.53k|    do { \
  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  ------------------
  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  361|       |
  362|       |    /* Still initializing the communities data structure */
  363|   300k|    for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (363:30): [True: 293k, False: 7.53k]
  ------------------
  364|   293k|        VECTOR(*communities.membership)[i] = i;
  ------------------
  |  |   60|   293k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  365|   293k|        communities.item[i].size = 1;
  366|   293k|        communities.item[i].weight_inside = 0;
  367|   293k|        communities.item[i].weight_all = 0;
  368|   293k|    }
  369|       |
  370|       |    /* Some more initialization :) */
  371|  93.2k|    for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (371:30): [True: 85.6k, False: 7.53k]
  ------------------
  372|  85.6k|        igraph_int_t ffrom = IGRAPH_FROM(graph, i), fto = IGRAPH_TO(graph, i);
  ------------------
  |  |  115|  85.6k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                      igraph_int_t ffrom = IGRAPH_FROM(graph, i), fto = IGRAPH_TO(graph, i);
  ------------------
  |  |  128|  85.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  373|  85.6k|        igraph_real_t weight = 1;
  374|       |
  375|  85.6k|        weight = VECTOR(*weights)[i];
  ------------------
  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  376|  85.6k|        communities.item[ffrom].weight_all += weight;
  377|  85.6k|        communities.item[fto].weight_all += weight;
  378|  85.6k|        if (ffrom == fto) {
  ------------------
  |  Branch (378:13): [True: 17.2k, False: 68.4k]
  ------------------
  379|  17.2k|            communities.item[ffrom].weight_inside += 2 * weight;
  380|  17.2k|        }
  381|  85.6k|    }
  382|       |
  383|  7.53k|    q = igraph_i_multilevel_community_modularity(&communities, resolution);
  384|       |    /* pass = 1; */
  385|       |
  386|  19.3k|    do { /* Pass begin */
  387|  19.3k|        igraph_int_t temp_communities_no = communities.communities_no;
  388|       |
  389|  19.3k|        pass_q = q;
  390|  19.3k|        changed = false;
  391|       |
  392|       |        /* Save the current membership, it will be restored in case of worse result */
  393|  19.3k|        IGRAPH_CHECK(igraph_vector_int_update(&temp_membership, communities.membership));
  ------------------
  |  |  656|  19.3k|    do { \
  |  |  657|  19.3k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  19.3k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  19.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 19.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|  19.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 19.3k]
  |  |  ------------------
  ------------------
  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|  19.3k|        if (vcount > 1) {
  ------------------
  |  Branch (399:13): [True: 19.0k, False: 334]
  ------------------
  400|  19.0k|            igraph_int_t i1 = RNG_INTEGER(0, vcount-1);
  ------------------
  |  |  152|  19.0k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  401|  19.0k|            igraph_int_t i2 = RNG_INTEGER(0, vcount-1);
  ------------------
  |  |  152|  19.0k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  402|  19.0k|            igraph_int_t tmp = VECTOR(node_order)[i1];
  ------------------
  |  |   60|  19.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  403|  19.0k|            VECTOR(node_order)[i1] = VECTOR(node_order)[i2];
  ------------------
  |  |   60|  19.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(node_order)[i1] = VECTOR(node_order)[i2];
  ------------------
  |  |   60|  19.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  404|  19.0k|            VECTOR(node_order)[i2] = tmp;
  ------------------
  |  |   60|  19.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  405|  19.0k|        }
  406|       |
  407|   939k|        for (igraph_int_t i = 0; i < vcount; i++) {
  ------------------
  |  Branch (407:34): [True: 920k, False: 19.3k]
  ------------------
  408|       |            /* Exclude vertex from its current community */
  409|   920k|            igraph_real_t weight_all = 0;
  410|   920k|            igraph_real_t weight_inside = 0;
  411|   920k|            igraph_real_t weight_loop = 0;
  412|   920k|            igraph_real_t max_q_gain = 0;
  413|   920k|            igraph_real_t max_weight;
  414|   920k|            igraph_int_t old_id, new_id, n, ni;
  415|       |
  416|   920k|            ni = VECTOR(node_order)[i];
  ------------------
  |  |   60|   920k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  417|       |
  418|   920k|            igraph_i_multilevel_community_links(graph, &communities,
  419|   920k|                                                ni, &edges,
  420|   920k|                                                &weight_all, &weight_inside,
  421|   920k|                                                &weight_loop, &links_community,
  422|   920k|                                                &links_weight);
  423|       |
  424|   920k|            old_id = VECTOR(*(communities.membership))[ni];
  ------------------
  |  |   60|   920k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  425|   920k|            new_id = old_id;
  426|       |
  427|       |            /* Update old community */
  428|   920k|            VECTOR(*communities.membership)[ni] = -1;
  ------------------
  |  |   60|   920k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  429|   920k|            communities.item[old_id].size--;
  430|   920k|            if (communities.item[old_id].size == 0) {
  ------------------
  |  Branch (430:17): [True: 729k, False: 191k]
  ------------------
  431|   729k|                communities.communities_no--;
  432|   729k|            }
  433|   920k|            communities.item[old_id].weight_all -= weight_all;
  434|   920k|            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|   920k|            max_q_gain = 0;
  440|   920k|            max_weight = weight_inside;
  441|   920k|            n = igraph_vector_int_size(&links_community);
  442|       |
  443|  1.34M|            for (igraph_int_t j = 0; j < n; j++) {
  ------------------
  |  Branch (443:38): [True: 423k, False: 920k]
  ------------------
  444|   423k|                igraph_int_t c = VECTOR(links_community)[j];
  ------------------
  |  |   60|   423k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  445|   423k|                igraph_real_t w = VECTOR(links_weight)[j];
  ------------------
  |  |   60|   423k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  446|       |
  447|   423k|                igraph_real_t q_gain =
  448|   423k|                    igraph_i_multilevel_community_modularity_gain(&communities, c, ni,
  449|   423k|                                                                  weight_all, w, resolution);
  450|       |                /* debug("Link %ld -> %ld weight: %lf gain: %lf\n", ni, c, (double) w, (double) q_gain); */
  451|   423k|                if (q_gain > max_q_gain) {
  ------------------
  |  Branch (451:21): [True: 265k, False: 157k]
  ------------------
  452|   265k|                    new_id = c;
  453|   265k|                    max_q_gain = q_gain;
  454|   265k|                    max_weight = w;
  455|   265k|                }
  456|   423k|            }
  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|   920k|            VECTOR(*communities.membership)[ni] = new_id;
  ------------------
  |  |   60|   920k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  462|   920k|            if (communities.item[new_id].size == 0) {
  ------------------
  |  Branch (462:17): [True: 691k, False: 228k]
  ------------------
  463|   691k|                communities.communities_no++;
  464|   691k|            }
  465|   920k|            communities.item[new_id].size++;
  466|   920k|            communities.item[new_id].weight_all += weight_all;
  467|   920k|            communities.item[new_id].weight_inside += 2 * max_weight + weight_loop;
  468|       |
  469|   920k|            if (new_id != old_id) {
  ------------------
  |  Branch (469:17): [True: 47.9k, False: 872k]
  ------------------
  470|  47.9k|                changed = true;
  471|  47.9k|            }
  472|   920k|        }
  473|       |
  474|  19.3k|        q = igraph_i_multilevel_community_modularity(&communities, resolution);
  475|       |
  476|  19.3k|        if (changed && (q > pass_q)) {
  ------------------
  |  Branch (476:13): [True: 11.8k, False: 7.51k]
  |  Branch (476:24): [True: 11.8k, 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|  11.8k|        } else {
  481|       |            /* No changes or the modularity became worse, restore last membership */
  482|  7.53k|            IGRAPH_CHECK(igraph_vector_int_update(communities.membership, &temp_membership));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  483|  7.53k|            communities.communities_no = temp_communities_no;
  484|  7.53k|            break;
  485|  7.53k|        }
  486|       |
  487|  11.8k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  11.8k|    do { \
  |  |   47|  11.8k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 11.8k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  11.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 11.8k]
  |  |  ------------------
  ------------------
  488|  11.8k|    } while (changed && (q > pass_q)); /* Pass end */
  ------------------
  |  Branch (488:14): [True: 11.8k, False: 0]
  |  Branch (488:25): [True: 11.8k, False: 0]
  ------------------
  489|       |
  490|  7.53k|    if (modularity) {
  ------------------
  |  Branch (490:9): [True: 7.53k, False: 0]
  ------------------
  491|  7.53k|        *modularity = q;
  492|  7.53k|    }
  493|       |
  494|       |    /* debug("Result Communities: %ld Modularity: %lf\n",
  495|       |      communities.communities_no, (double) q); */
  496|       |
  497|  7.53k|    IGRAPH_CHECK(igraph_reindex_membership(membership, NULL, NULL));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  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.53k|    IGRAPH_CHECK(igraph_vector_int_update(&temp_membership, membership));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  504|  7.53k|    IGRAPH_CHECK(igraph_i_multilevel_shrink(graph, &temp_membership));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  505|  7.53k|    igraph_vector_int_destroy(&temp_membership);
  506|  7.53k|    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.53k|    IGRAPH_CHECK(igraph_i_multilevel_simplify_multiple(graph, &edges));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  512|       |
  513|       |    /* We reuse the links_weight vector to store the old edge weights */
  514|  7.53k|    IGRAPH_CHECK(igraph_vector_update(&links_weight, weights));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  515|  7.53k|    igraph_vector_null(weights);
  516|       |
  517|  93.2k|    for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (517:30): [True: 85.6k, False: 7.53k]
  ------------------
  518|  85.6k|        VECTOR(*weights)[VECTOR(edges)[i]] += VECTOR(links_weight)[i];
  ------------------
  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*weights)[VECTOR(edges)[i]] += VECTOR(links_weight)[i];
  ------------------
  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*weights)[VECTOR(edges)[i]] += VECTOR(links_weight)[i];
  ------------------
  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  519|  85.6k|    }
  520|       |
  521|  7.53k|    igraph_free(communities.item);
  522|  7.53k|    igraph_vector_int_destroy(&links_community);
  523|  7.53k|    igraph_vector_destroy(&links_weight);
  524|  7.53k|    igraph_vector_int_destroy(&edges);
  525|  7.53k|    igraph_vector_int_destroy(&node_order);
  526|  7.53k|    IGRAPH_FINALLY_CLEAN(5);
  527|       |
  528|  7.53k|    return IGRAPH_SUCCESS;
  529|  7.53k|}
louvain.c:igraph_i_multilevel_community_modularity:
   52|  26.8k|        const igraph_real_t resolution) {
   53|  26.8k|    igraph_real_t result = 0.0;
   54|  26.8k|    igraph_real_t m = communities->weight_sum;
   55|       |
   56|  1.24M|    for (igraph_int_t i = 0; i < communities->vertices_no; i++) {
  ------------------
  |  Branch (56:30): [True: 1.21M, False: 26.8k]
  ------------------
   57|  1.21M|        if (communities->item[i].size > 0) {
  ------------------
  |  Branch (57:13): [True: 1.04M, False: 168k]
  ------------------
   58|  1.04M|            result += (communities->item[i].weight_inside - resolution * communities->item[i].weight_all * communities->item[i].weight_all / m) / m;
   59|  1.04M|        }
   60|  1.21M|    }
   61|       |
   62|  26.8k|    return result;
   63|  26.8k|}
louvain.c:igraph_i_multilevel_community_links:
  178|   920k|        igraph_vector_int_t *links_community, igraph_vector_t *links_weight) {
  179|       |
  180|   920k|    igraph_int_t n, last = -1, c = -1;
  181|   920k|    igraph_real_t weight = 1;
  182|   920k|    igraph_int_t to, to_community;
  183|   920k|    igraph_int_t community = VECTOR(*(communities->membership))[vertex];
  ------------------
  |  |   60|   920k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  184|   920k|    igraph_i_multilevel_community_link *links;
  185|       |
  186|   920k|    *weight_all = *weight_inside = *weight_loop = 0;
  187|       |
  188|   920k|    igraph_vector_int_clear(links_community);
  189|   920k|    igraph_vector_clear(links_weight);
  190|       |
  191|       |    /* Get the list of incident edges */
  192|   920k|    IGRAPH_CHECK(igraph_incident(graph, edges, vertex, IGRAPH_ALL, IGRAPH_LOOPS));
  ------------------
  |  |  656|   920k|    do { \
  |  |  657|   920k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   920k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   920k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 920k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   920k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 920k]
  |  |  ------------------
  ------------------
  193|       |
  194|   920k|    n = igraph_vector_int_size(edges);
  195|   920k|    links = IGRAPH_CALLOC(n, igraph_i_multilevel_community_link);
  ------------------
  |  |   33|   920k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  1.84M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 920k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 920k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 245k, False: 674k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|   920k|    IGRAPH_CHECK_OOM(links, "Multi-level community structure detection failed.");
  ------------------
  |  |  709|   920k|    do { \
  |  |  710|   920k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   920k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 920k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|   920k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 920k]
  |  |  ------------------
  ------------------
  197|   920k|    IGRAPH_FINALLY(igraph_free, links);
  ------------------
  |  |  603|   920k|    do { \
  |  |  604|   920k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|   920k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|   920k|         * incorrect destructor function with the pointer */ \
  |  |  607|   920k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 920k]
  |  |  ------------------
  |  |  608|   920k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|   920k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 920k]
  |  |  ------------------
  ------------------
  198|       |
  199|  1.50M|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (199:30): [True: 589k, False: 920k]
  ------------------
  200|   589k|        igraph_int_t eidx = VECTOR(*edges)[i];
  ------------------
  |  |   60|   589k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  201|   589k|        weight = VECTOR(*communities->weights)[eidx];
  ------------------
  |  |   60|   589k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  202|       |
  203|   589k|        to = IGRAPH_OTHER(graph, eidx, vertex);
  ------------------
  |  |  146|   589k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   589k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   589k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  115|   320k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   320k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   268k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   268k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 320k, False: 268k]
  |  |  ------------------
  ------------------
  204|       |
  205|   589k|        *weight_all += weight;
  206|   589k|        if (to == vertex) {
  ------------------
  |  Branch (206:13): [True: 51.6k, False: 537k]
  ------------------
  207|  51.6k|            *weight_loop += weight;
  208|       |
  209|  51.6k|            links[i].community = community;
  210|  51.6k|            links[i].weight = 0;
  211|  51.6k|            continue;
  212|  51.6k|        }
  213|       |
  214|   537k|        to_community = VECTOR(*(communities->membership))[to];
  ------------------
  |  |   60|   537k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  215|   537k|        if (community == to_community) {
  ------------------
  |  Branch (215:13): [True: 299k, False: 238k]
  ------------------
  216|   299k|            *weight_inside += weight;
  217|   299k|        }
  218|       |
  219|       |        /* debug("Link %ld (C: %ld) <-> %ld (C: %ld)\n", vertex, community, to, to_community); */
  220|       |
  221|   537k|        links[i].community = to_community;
  222|   537k|        links[i].weight = weight;
  223|   537k|    }
  224|       |
  225|       |    /* Sort links by community ID and merge the same */
  226|   920k|    igraph_qsort((void*)links, (size_t) n, sizeof(igraph_i_multilevel_community_link),
  227|   920k|                 igraph_i_multilevel_community_link_cmp);
  228|  1.50M|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (228:30): [True: 589k, False: 920k]
  ------------------
  229|   589k|        to_community = links[i].community;
  230|   589k|        if (to_community != last) {
  ------------------
  |  Branch (230:13): [True: 423k, False: 165k]
  ------------------
  231|   423k|            IGRAPH_CHECK(igraph_vector_int_push_back(links_community, to_community));
  ------------------
  |  |  656|   423k|    do { \
  |  |  657|   423k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   423k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   423k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 423k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   423k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 423k]
  |  |  ------------------
  ------------------
  232|   423k|            IGRAPH_CHECK(igraph_vector_push_back(links_weight, links[i].weight));
  ------------------
  |  |  656|   423k|    do { \
  |  |  657|   423k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   423k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   423k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 423k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   423k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 423k]
  |  |  ------------------
  ------------------
  233|   423k|            last = to_community;
  234|   423k|            c++;
  235|   423k|        } else {
  236|   165k|            VECTOR(*links_weight)[c] += links[i].weight;
  ------------------
  |  |   60|   165k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  237|   165k|        }
  238|   589k|    }
  239|       |
  240|   920k|    igraph_free(links);
  241|   920k|    IGRAPH_FINALLY_CLEAN(1);
  242|       |
  243|   920k|    return IGRAPH_SUCCESS;
  244|   920k|}
louvain.c:igraph_i_multilevel_community_link_cmp:
  152|   570k|static int igraph_i_multilevel_community_link_cmp(const void *a, const void *b) {
  153|   570k|    igraph_int_t diff = (
  154|   570k|        ((igraph_i_multilevel_community_link*)a)->community -
  155|   570k|        ((igraph_i_multilevel_community_link*)b)->community
  156|   570k|    );
  157|   570k|    return diff < 0 ? -1 : diff > 0 ? 1 : 0;
  ------------------
  |  Branch (157:12): [True: 198k, False: 372k]
  |  Branch (157:28): [True: 198k, False: 173k]
  ------------------
  158|   570k|}
louvain.c:igraph_i_multilevel_community_modularity_gain:
  250|   423k|        const igraph_real_t resolution) {
  251|   423k|    IGRAPH_UNUSED(vertex);
  ------------------
  |  |   30|   423k|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
  252|   423k|    return weight_inside -
  253|   423k|           resolution * communities->item[community].weight_all * weight_all / communities->weight_sum;
  254|   423k|}
louvain.c:igraph_i_multilevel_shrink:
  262|  7.53k|static igraph_error_t igraph_i_multilevel_shrink(igraph_t *graph, igraph_vector_int_t *membership) {
  263|  7.53k|    igraph_vector_int_t edges;
  264|  7.53k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  265|  7.53k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  266|  7.53k|    igraph_bool_t directed = igraph_is_directed(graph);
  267|       |
  268|  7.53k|    IGRAPH_ASSERT(igraph_vector_int_size(membership) == no_of_nodes);
  ------------------
  |  |  924|  7.53k|    do { \
  |  |  925|  7.53k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  269|       |
  270|  7.53k|    if (no_of_nodes == 0) {
  ------------------
  |  Branch (270:9): [True: 1, False: 7.53k]
  ------------------
  271|      1|        return IGRAPH_SUCCESS;
  272|      1|    }
  273|       |
  274|  7.53k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 2*no_of_edges);
  ------------------
  |  |  119|  7.53k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.53k|    do { \
  |  |  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.53k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.53k|    do { \
  |  |  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  275|       |
  276|  7.53k|    IGRAPH_CHECK(igraph_reindex_membership(membership, NULL, NULL));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  277|       |
  278|       |    /* Create the new edgelist */
  279|  7.53k|    IGRAPH_CHECK(igraph_get_edgelist(graph, &edges, /* bycol= */ false));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  280|   178k|    for (igraph_int_t i=0; i < 2*no_of_edges; i++) {
  ------------------
  |  Branch (280:28): [True: 171k, False: 7.53k]
  ------------------
  281|   171k|        VECTOR(edges)[i] = VECTOR(*membership)[ VECTOR(edges)[i] ];
  ------------------
  |  |   60|   171k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(edges)[i] = VECTOR(*membership)[ VECTOR(edges)[i] ];
  ------------------
  |  |   60|   171k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(edges)[i] = VECTOR(*membership)[ VECTOR(edges)[i] ];
  ------------------
  |  |   60|   171k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  282|   171k|    }
  283|       |
  284|       |    /* Create the new graph */
  285|  7.53k|    igraph_destroy(graph);
  286|  7.53k|    no_of_nodes = igraph_vector_int_max(membership) + 1;
  287|  7.53k|    IGRAPH_CHECK(igraph_create(graph, &edges, no_of_nodes, directed));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  288|       |
  289|  7.53k|    igraph_vector_int_destroy(&edges);
  290|  7.53k|    IGRAPH_FINALLY_CLEAN(1);
  291|       |
  292|  7.53k|    return IGRAPH_SUCCESS;
  293|  7.53k|}
louvain.c:igraph_i_multilevel_simplify_multiple:
   94|  7.53k|static igraph_error_t igraph_i_multilevel_simplify_multiple(igraph_t *graph, igraph_vector_int_t *eids) {
   95|  7.53k|    igraph_int_t ecount = igraph_ecount(graph);
   96|  7.53k|    igraph_int_t l = -1, last_from = -1, last_to = -1;
   97|  7.53k|    igraph_bool_t directed = igraph_is_directed(graph);
   98|  7.53k|    igraph_vector_int_t edges;
   99|  7.53k|    igraph_i_multilevel_link *links;
  100|       |
  101|       |    /* Make sure there's enough space in eids to store the new edge IDs */
  102|  7.53k|    IGRAPH_CHECK(igraph_vector_int_resize(eids, ecount));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  103|       |
  104|  7.53k|    links = IGRAPH_CALLOC(ecount, igraph_i_multilevel_link);
  ------------------
  |  |   33|  7.53k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  15.0k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 7.53k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 7.53k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 7.44k, False: 97]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|  7.53k|    IGRAPH_CHECK_OOM(links, "Multi-level community structure detection failed.");
  ------------------
  |  |  709|  7.53k|    do { \
  |  |  710|  7.53k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  106|  7.53k|    IGRAPH_FINALLY(igraph_free, links);
  ------------------
  |  |  603|  7.53k|    do { \
  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  ------------------
  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  107|       |
  108|  93.2k|    for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (108:30): [True: 85.6k, False: 7.53k]
  ------------------
  109|  85.6k|        links[i].from = IGRAPH_FROM(graph, i);
  ------------------
  |  |  115|  85.6k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  110|  85.6k|        links[i].to = IGRAPH_TO(graph, i);
  ------------------
  |  |  128|  85.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  111|  85.6k|        links[i].id = i;
  112|  85.6k|    }
  113|       |
  114|  7.53k|    igraph_qsort(links, (size_t) ecount, sizeof(igraph_i_multilevel_link),
  115|  7.53k|                 igraph_i_multilevel_link_cmp);
  116|       |
  117|  7.53k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  7.53k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  7.53k|    do { \
  |  |  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  7.53k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  7.53k|    do { \
  |  |  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  7.53k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  118|  93.2k|    for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (118:30): [True: 85.6k, False: 7.53k]
  ------------------
  119|  85.6k|        if (links[i].from == last_from && links[i].to == last_to) {
  ------------------
  |  Branch (119:13): [True: 58.3k, False: 27.3k]
  |  Branch (119:43): [True: 38.8k, False: 19.4k]
  ------------------
  120|  38.8k|            VECTOR(*eids)[links[i].id] = l;
  ------------------
  |  |   60|  38.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  121|  38.8k|            continue;
  122|  38.8k|        }
  123|       |
  124|  46.8k|        last_from = links[i].from;
  125|  46.8k|        last_to = links[i].to;
  126|       |
  127|  46.8k|        IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last_from));
  ------------------
  |  |  656|  46.8k|    do { \
  |  |  657|  46.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  46.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  46.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 46.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|  46.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 46.8k]
  |  |  ------------------
  ------------------
  128|  46.8k|        IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last_to));
  ------------------
  |  |  656|  46.8k|    do { \
  |  |  657|  46.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  46.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  46.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 46.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|  46.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 46.8k]
  |  |  ------------------
  ------------------
  129|       |
  130|  46.8k|        l++;
  131|       |
  132|  46.8k|        VECTOR(*eids)[links[i].id] = l;
  ------------------
  |  |   60|  46.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  133|  46.8k|    }
  134|       |
  135|  7.53k|    IGRAPH_FREE(links);
  ------------------
  |  |   36|  7.53k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  136|  7.53k|    IGRAPH_FINALLY_CLEAN(1);
  137|       |
  138|  7.53k|    igraph_destroy(graph);
  139|  7.53k|    IGRAPH_CHECK(igraph_create(graph, &edges, igraph_vcount(graph), directed));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  140|       |
  141|  7.53k|    igraph_vector_int_destroy(&edges);
  142|  7.53k|    IGRAPH_FINALLY_CLEAN(1);
  143|       |
  144|  7.53k|    return IGRAPH_SUCCESS;
  145|  7.53k|}
louvain.c:igraph_i_multilevel_link_cmp:
   71|   261k|static int igraph_i_multilevel_link_cmp(const void *a, const void *b) {
   72|   261k|    igraph_int_t diff;
   73|       |
   74|   261k|    diff = ((igraph_i_multilevel_link*)a)->from - ((igraph_i_multilevel_link*)b)->from;
   75|       |
   76|   261k|    if (diff < 0) {
  ------------------
  |  Branch (76:9): [True: 75.3k, False: 186k]
  ------------------
   77|  75.3k|        return -1;
   78|   186k|    } else if (diff > 0) {
  ------------------
  |  Branch (78:16): [True: 92.0k, False: 94.4k]
  ------------------
   79|  92.0k|        return 1;
   80|  92.0k|    }
   81|       |
   82|  94.4k|    diff = ((igraph_i_multilevel_link*)a)->to - ((igraph_i_multilevel_link*)b)->to;
   83|       |
   84|  94.4k|    if (diff < 0) {
  ------------------
  |  Branch (84:9): [True: 24.6k, False: 69.8k]
  ------------------
   85|  24.6k|        return -1;
   86|  69.8k|    } else if (diff > 0) {
  ------------------
  |  Branch (86:16): [True: 25.8k, False: 43.9k]
  ------------------
   87|  25.8k|        return 1;
   88|  43.9k|    } else {
   89|  43.9k|        return 0;
   90|  43.9k|    }
   91|  94.4k|}

igraph_modularity:
  121|  50.8k|                      igraph_real_t *modularity) {
  122|       |
  123|  50.8k|    const igraph_int_t vcount = igraph_vcount(graph);
  124|  50.8k|    const igraph_int_t ecount = igraph_ecount(graph);
  125|  50.8k|    const igraph_vector_int_t *p_membership;
  126|  50.8k|    igraph_vector_int_t i_membership;
  127|  50.8k|    igraph_bool_t using_i_membership = false;
  128|  50.8k|    igraph_vector_t k_out, k_in;
  129|  50.8k|    igraph_int_t min_cluster_id, max_cluster_id, no_of_partitions;
  130|  50.8k|    igraph_real_t e; /* count/fraction of edges/weights within partitions */
  131|  50.8k|    igraph_real_t m; /* edge count / weight sum */
  132|  50.8k|    igraph_int_t c1, c2;
  133|       |    /* Only consider the graph as directed if it actually is directed */
  134|  50.8k|    igraph_bool_t use_directed = directed && igraph_is_directed(graph);
  ------------------
  |  Branch (134:34): [True: 47.3k, False: 3.51k]
  |  Branch (134:46): [True: 47.3k, False: 0]
  ------------------
  135|  50.8k|    igraph_real_t directed_multiplier = (use_directed ? 1 : 2);
  ------------------
  |  Branch (135:42): [True: 47.3k, False: 3.51k]
  ------------------
  136|       |
  137|  50.8k|    if (igraph_vector_int_size(membership) != vcount) {
  ------------------
  |  Branch (137:9): [True: 0, False: 50.8k]
  ------------------
  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|  50.8k|    if (resolution < 0.0) {
  ------------------
  |  Branch (141:9): [True: 0, False: 50.8k]
  ------------------
  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|  50.8k|    if (ecount == 0) {
  ------------------
  |  Branch (145:9): [True: 196, False: 50.6k]
  ------------------
  146|       |        /* Special case: the modularity of graphs with no edges is not
  147|       |         * well-defined */
  148|    196|        *modularity = IGRAPH_NAN;
  ------------------
  |  |  138|    196|#define IGRAPH_NAN ((double)NAN)
  ------------------
  149|    196|        return IGRAPH_SUCCESS;
  150|    196|    }
  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|  50.6k|    igraph_vector_int_minmax(membership, &min_cluster_id, &max_cluster_id);
  158|  50.6k|    if (min_cluster_id < 0 || max_cluster_id >= vcount) {
  ------------------
  |  Branch (158:9): [True: 0, False: 50.6k]
  |  Branch (158:31): [True: 40.6k, False: 10.0k]
  ------------------
  159|  40.6k|        IGRAPH_CHECK(igraph_vector_int_init_copy(&i_membership, membership));
  ------------------
  |  |  656|  40.6k|    do { \
  |  |  657|  40.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  40.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  40.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 40.6k]
  |  |  ------------------
  ------------------
  160|  40.6k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &i_membership);
  ------------------
  |  |  603|  40.6k|    do { \
  |  |  604|  40.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  40.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  40.6k|         * incorrect destructor function with the pointer */ \
  |  |  607|  40.6k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 40.6k]
  |  |  ------------------
  |  |  608|  40.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  40.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 40.6k]
  |  |  ------------------
  ------------------
  161|  40.6k|        IGRAPH_CHECK(igraph_i_reindex_membership_large(&i_membership, NULL, &no_of_partitions));
  ------------------
  |  |  656|  40.6k|    do { \
  |  |  657|  40.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  40.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  40.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 40.6k]
  |  |  ------------------
  ------------------
  162|  40.6k|        p_membership = &i_membership;
  163|  40.6k|        using_i_membership = true;
  164|  40.6k|    } else {
  165|  10.0k|        no_of_partitions = max_cluster_id + 1;
  166|  10.0k|        p_membership = membership;
  167|  10.0k|    }
  168|       |
  169|  50.6k|    IGRAPH_VECTOR_INIT_FINALLY(&k_out, no_of_partitions);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  170|  50.6k|    IGRAPH_VECTOR_INIT_FINALLY(&k_in, no_of_partitions);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  171|       |
  172|  50.6k|    e = 0.0;
  173|  50.6k|    if (weights) {
  ------------------
  |  Branch (173:9): [True: 50.6k, False: 0]
  ------------------
  174|  50.6k|        if (igraph_vector_size(weights) != ecount)
  ------------------
  |  Branch (174:13): [True: 0, False: 50.6k]
  ------------------
  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|  50.6k|                         IGRAPH_EINVAL);
  177|  50.6k|        m = 0.0;
  178|  2.50M|        for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (178:34): [True: 2.45M, False: 50.6k]
  ------------------
  179|  2.45M|            igraph_real_t w = VECTOR(*weights)[i];
  ------------------
  |  |   60|  2.45M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  180|  2.45M|            if (w < 0) {
  ------------------
  |  Branch (180:17): [True: 0, False: 2.45M]
  ------------------
  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.45M|            c1 = VECTOR(*p_membership)[ IGRAPH_FROM(graph, i) ];
  ------------------
  |  |   60|  2.45M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          c1 = VECTOR(*p_membership)[ IGRAPH_FROM(graph, i) ];
  ------------------
  |  |  115|  2.45M|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  2.45M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  184|  2.45M|            c2 = VECTOR(*p_membership)[ IGRAPH_TO(graph, i) ];
  ------------------
  |  |   60|  2.45M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          c2 = VECTOR(*p_membership)[ IGRAPH_TO(graph, i) ];
  ------------------
  |  |  128|  2.45M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  2.45M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  185|  2.45M|            if (c1 == c2) {
  ------------------
  |  Branch (185:17): [True: 1.27M, False: 1.18M]
  ------------------
  186|  1.27M|                e += directed_multiplier * w;
  187|  1.27M|            }
  188|  2.45M|            VECTOR(k_out)[c1] += w;
  ------------------
  |  |   60|  2.45M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  189|  2.45M|            VECTOR(k_in)[c2]  += w;
  ------------------
  |  |   60|  2.45M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  190|  2.45M|            m += w;
  191|  2.45M|        }
  192|  50.6k|    } 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|  50.6k|    if (!use_directed) {
  ------------------
  |  Branch (205:9): [True: 3.35k, False: 47.3k]
  ------------------
  206|       |        /* Graph is undirected, simply add vectors.
  207|       |         * Vectors are the same size, calls below can't fail. */
  208|  3.35k|        igraph_vector_add(&k_out, &k_in);
  209|  3.35k|        igraph_vector_update(&k_in, &k_out);
  210|  3.35k|    }
  211|       |
  212|       |    /* Divide all vectors by total weight. */
  213|  50.6k|    igraph_vector_scale(&k_out, 1.0/( directed_multiplier * m ) );
  214|  50.6k|    igraph_vector_scale(&k_in, 1.0/( directed_multiplier * m ) );
  215|  50.6k|    e /= directed_multiplier * m;
  216|       |
  217|  50.6k|    if (m > 0) {
  ------------------
  |  Branch (217:9): [True: 50.6k, False: 0]
  ------------------
  218|  50.6k|        *modularity = e;
  219|  2.18M|        for (igraph_int_t i = 0; i < no_of_partitions; i++) {
  ------------------
  |  Branch (219:34): [True: 2.13M, False: 50.6k]
  ------------------
  220|  2.13M|            *modularity -= resolution * VECTOR(k_out)[i] * VECTOR(k_in)[i];
  ------------------
  |  |   60|  2.13M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          *modularity -= resolution * VECTOR(k_out)[i] * VECTOR(k_in)[i];
  ------------------
  |  |   60|  2.13M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  221|  2.13M|        }
  222|  50.6k|    } else {
  223|      0|        *modularity = IGRAPH_NAN;
  ------------------
  |  |  138|      0|#define IGRAPH_NAN ((double)NAN)
  ------------------
  224|      0|    }
  225|       |
  226|  50.6k|    igraph_vector_destroy(&k_out);
  227|  50.6k|    igraph_vector_destroy(&k_in);
  228|  50.6k|    IGRAPH_FINALLY_CLEAN(2);
  229|       |
  230|  50.6k|    if (using_i_membership) {
  ------------------
  |  Branch (230:9): [True: 40.6k, False: 10.0k]
  ------------------
  231|  40.6k|        igraph_vector_int_destroy(&i_membership);
  232|  40.6k|        IGRAPH_FINALLY_CLEAN(1);
  233|  40.6k|    }
  234|       |
  235|  50.6k|    return IGRAPH_SUCCESS;
  236|  50.6k|}
igraph_modularity_matrix:
  327|  3.40k|                             igraph_bool_t directed) {
  328|       |
  329|  3.40k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  330|  3.40k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  331|  3.40k|    const igraph_real_t sw = weights ? igraph_vector_sum(weights) : no_of_edges;
  ------------------
  |  Branch (331:30): [True: 3.40k, False: 0]
  ------------------
  332|  3.40k|    igraph_vector_t deg, in_deg, out_deg;
  333|  3.40k|    igraph_real_t scaling_factor;
  334|       |
  335|  3.40k|    if (weights && igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (335:9): [True: 3.40k, False: 0]
  |  Branch (335:20): [True: 0, False: 3.40k]
  ------------------
  336|      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]
  |  |  ------------------
  ------------------
  337|      0|    }
  338|       |
  339|  3.40k|    if (resolution < 0.0) {
  ------------------
  |  Branch (339:9): [True: 0, False: 3.40k]
  ------------------
  340|      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]
  |  |  ------------------
  ------------------
  341|      0|    }
  342|       |
  343|  3.40k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (343:9): [True: 0, False: 3.40k]
  ------------------
  344|      0|        directed = false;
  345|      0|    }
  346|  3.40k|    IGRAPH_CHECK(igraph_i_modularity_matrix_get_adjacency(graph, modmat, weights, directed));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  347|       |
  348|       |    /* Performance notes:
  349|       |     *  - Iterating in column-major order makes a large difference.
  350|       |     *  - Applying the scaling_factor to in_deg (or out_deg) first to reduce the
  351|       |     *    number of multiplications does not make an appreciable performance
  352|       |     *    difference. However, doing this in the undirected case causes the result
  353|       |     *    matrix to sometimes not be strictly symmetric due to the non-associativity
  354|       |     *    of floating point multiplication.
  355|       |     */
  356|       |
  357|  3.40k|    if (directed) {
  ------------------
  |  Branch (357:9): [True: 3.40k, False: 0]
  ------------------
  358|  3.40k|        IGRAPH_VECTOR_INIT_FINALLY(&in_deg, no_of_nodes);
  ------------------
  |  |  104|  3.40k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.40k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  359|  3.40k|        IGRAPH_VECTOR_INIT_FINALLY(&out_deg, no_of_nodes);
  ------------------
  |  |  104|  3.40k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.40k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  360|       |
  361|  3.40k|        IGRAPH_CHECK(igraph_strength(graph, &in_deg, igraph_vss_all(), IGRAPH_IN,
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  362|  3.40k|                                     IGRAPH_LOOPS, weights));
  363|  3.40k|        IGRAPH_CHECK(igraph_strength(graph, &out_deg, igraph_vss_all(), IGRAPH_OUT,
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  364|  3.40k|                                     IGRAPH_LOOPS, weights));
  365|       |
  366|  3.40k|        scaling_factor = resolution / sw;
  367|       |
  368|   155k|        for (igraph_int_t j = 0; j < no_of_nodes; j++) {
  ------------------
  |  Branch (368:34): [True: 152k, False: 3.40k]
  ------------------
  369|  8.63M|            for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (369:38): [True: 8.48M, False: 152k]
  ------------------
  370|  8.48M|                MATRIX(*modmat, i, j) -= VECTOR(out_deg)[i] * VECTOR(in_deg)[j] * scaling_factor;
  ------------------
  |  |   83|  8.48M|#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.48M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              MATRIX(*modmat, i, j) -= VECTOR(out_deg)[i] * VECTOR(in_deg)[j] * scaling_factor;
  ------------------
  |  |   60|  8.48M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  371|  8.48M|            }
  372|   152k|        }
  373|  3.40k|        igraph_vector_destroy(&in_deg);
  374|  3.40k|        igraph_vector_destroy(&out_deg);
  375|  3.40k|        IGRAPH_FINALLY_CLEAN(2);
  376|  3.40k|    } else {
  377|      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]
  |  |  ------------------
  ------------------
  378|       |
  379|      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]
  |  |  ------------------
  ------------------
  380|      0|                                     IGRAPH_LOOPS, weights));
  381|       |
  382|      0|        scaling_factor = resolution / 2.0 / sw;
  383|       |
  384|      0|        for (igraph_int_t j = 0; j < no_of_nodes; j++) {
  ------------------
  |  Branch (384:34): [True: 0, False: 0]
  ------------------
  385|      0|            for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (385:38): [True: 0, False: 0]
  ------------------
  386|      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)
  ------------------
  387|      0|            }
  388|      0|        }
  389|      0|        igraph_vector_destroy(&deg);
  390|      0|        IGRAPH_FINALLY_CLEAN(1);
  391|      0|    }
  392|       |
  393|  3.40k|    return IGRAPH_SUCCESS;
  394|  3.40k|}
modularity.c:igraph_i_modularity_matrix_get_adjacency:
  240|  3.40k|           const igraph_vector_t *weights, igraph_bool_t directed) {
  241|       |
  242|       |    /* Specifically used to handle weights and/or ignore direction */
  243|  3.40k|    igraph_eit_t edgeit;
  244|  3.40k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  245|  3.40k|    igraph_int_t from, to;
  246|       |
  247|  3.40k|    IGRAPH_CHECK(igraph_matrix_resize(res, no_of_nodes, no_of_nodes));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  248|  3.40k|    igraph_matrix_null(res);
  249|  3.40k|    IGRAPH_CHECK(igraph_eit_create(graph, igraph_ess_all(IGRAPH_EDGEORDER_ID), &edgeit));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  250|  3.40k|    IGRAPH_FINALLY(igraph_eit_destroy, &edgeit);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  251|       |
  252|  3.40k|    if (weights) {
  ------------------
  |  Branch (252:9): [True: 3.40k, False: 0]
  ------------------
  253|  95.0k|        for (; !IGRAPH_EIT_END(edgeit); IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  371|  95.0k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                      for (; !IGRAPH_EIT_END(edgeit); IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  359|  91.6k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (253:16): [True: 91.6k, False: 3.40k]
  ------------------
  254|  91.6k|            igraph_int_t edge = IGRAPH_EIT_GET(edgeit);
  ------------------
  |  |  405|  91.6k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 91.6k, False: 0]
  |  |  ------------------
  |  |  406|  91.6k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  255|  91.6k|            from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|  91.6k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  256|  91.6k|            to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  91.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  257|  91.6k|            MATRIX(*res, from, to) += VECTOR(*weights)[edge];
  ------------------
  |  |   83|  91.6k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
                          MATRIX(*res, from, to) += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  258|  91.6k|            if (!directed) {
  ------------------
  |  Branch (258:17): [True: 0, False: 91.6k]
  ------------------
  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|  91.6k|        }
  262|  3.40k|    } 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.40k|    igraph_eit_destroy(&edgeit);
  275|  3.40k|    IGRAPH_FINALLY_CLEAN(1);
  276|  3.40k|    return IGRAPH_SUCCESS;
  277|  3.40k|}

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

_ZNK6DLListIP5NNodeE4SizeEv:
  120|   202k|    igraph_int_t Size() const {
  121|   202k|        return number_of_items;
  122|   202k|    }
_ZN7networkC2Ev:
  259|    463|    network() = default;
_ZN15DL_Indexed_ListIP5NNodeEC2Ev:
  139|    463|    DL_Indexed_List() = default;
_ZN6DLListIP5NNodeEC2Ev:
  355|  5.80k|DLList<L_DATA>::DLList() {
  356|  5.80k|    head = new DLItem<L_DATA>(NULL, 0); //fuer head und Tail gibt es das gleiche Array-Element!! Vorsicht!!
  357|  5.80k|    tail = new DLItem<L_DATA>(NULL, 0);
  358|       |
  359|  5.80k|    head->next = tail;
  360|  5.80k|    tail->previous = head;
  361|  5.80k|}
_ZN6DLItemIP5NNodeEC2ES1_l:
  347|  11.6k|    item(i), index(ind), previous(nullptr), next(nullptr) { }
_ZN6DLListIP5NNodeE7pInsertES1_P6DLItemIS1_E:
  388|  15.0k|DLItem<L_DATA> *DLList<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  389|  15.0k|    auto *i = new DLItem<L_DATA>(data, number_of_items + 1, pos->previous, pos);
  390|  15.0k|    pos->previous->next = i;
  391|  15.0k|    pos->previous = i;
  392|  15.0k|    number_of_items++;
  393|  15.0k|    return i;
  394|  15.0k|}
_ZN6DLItemIP5NNodeEC2ES1_lPS2_S3_:
  351|  20.3k|    item(i), index(ind), previous(p), next(n) { }
_ZN6DLListIP5NNodeE7pDeleteEP6DLItemIS1_E:
  397|  15.0k|L_DATA DLList<L_DATA>::pDelete(DLItem<L_DATA> *i) {
  398|  15.0k|    assert(number_of_items > 0);
  ------------------
  |  Branch (398:5): [True: 15.0k, False: 0]
  ------------------
  399|  15.0k|    L_DATA data = i->item;
  400|  15.0k|    i->previous->next = i->next;
  401|  15.0k|    i->next->previous = i->previous;
  402|  15.0k|    delete i;
  403|  15.0k|    number_of_items--;
  404|  15.0k|    return data;
  405|  15.0k|}
_ZN6DLListIP5NNodeE4PushES1_:
  425|  15.0k|L_DATA DLList<L_DATA>::Push(L_DATA data) {
  426|  15.0k|    DLItem<L_DATA> *tmp = pInsert(data, tail);
  427|  15.0k|    return tmp->item;
  428|  15.0k|}
_ZN9HugeArrayIP6DLItemIP5NNodeEEC2Ev:
  283|    463|HugeArray<DATA>::HugeArray() {
  284|    463|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|    463|    data[0] = 0;
  286|    463|    data[1] = 0;
  287|  14.8k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 14.8k, False: 463]
  ------------------
  288|  14.8k|        field = nullptr;
  289|  14.8k|    }
  290|    463|    fields[highest_field_index] = data;
  291|    463|}
_ZN6DLListIP5NNodeED2Ev:
  364|  5.80k|DLList<L_DATA>::~DLList() {
  365|  5.80k|    DLItem<L_DATA> *cur = head, *next;
  366|  17.4k|    while (cur) {
  ------------------
  |  Branch (366:12): [True: 11.6k, False: 5.80k]
  ------------------
  367|  11.6k|        next = cur->next;
  368|  11.6k|        delete cur;
  369|  11.6k|        cur = next;
  370|  11.6k|    }
  371|  5.80k|    number_of_items = 0;
  372|  5.80k|}
_ZN15DL_Indexed_ListIP5NNodeE7pInsertES1_P6DLItemIS1_E:
  468|  5.34k|DLItem<L_DATA> *DL_Indexed_List<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  469|  5.34k|    auto *i = new DLItem<L_DATA>(data, last_index, pos->previous, pos);
  470|  5.34k|    pos->previous->next = i;
  471|  5.34k|    pos->previous = i;
  472|  5.34k|    this->number_of_items++;
  473|  5.34k|    array[last_index] = i;
  474|  5.34k|    last_index++;
  475|  5.34k|    return i;
  476|  5.34k|}
_ZN9HugeArrayIP6DLItemIP5NNodeEEixEl:
   78|   120M|    DATA &operator[](igraph_int_t index) { return Set(index); }
_ZN9HugeArrayIP6DLItemIP5NNodeEE3SetEl:
  323|   120M|DATA &HugeArray<DATA>::Set(igraph_int_t index) {
  324|   120M|    igraph_int_t data_size;
  325|   120M|    while (size < index + 1) {
  ------------------
  |  Branch (325:12): [True: 833, False: 120M]
  ------------------
  326|    833|        highest_field_index++;
  327|    833|        data_size = igraph_int_t(1) << highest_field_index;
  328|    833|        data = new DATA[data_size];
  329|  6.09k|        for (igraph_int_t i = 0; i < data_size; i++) {
  ------------------
  |  Branch (329:34): [True: 5.26k, False: 833]
  ------------------
  330|  5.26k|            data[i] = 0;
  331|  5.26k|        }
  332|    833|        size = size + data_size; //overflow noch abfangen
  333|    833|        fields[highest_field_index] = data;
  334|    833|    }
  335|   120M|    HUGE_INDEX h_index = get_huge_index(index);
  336|   120M|    data = fields[h_index.field_index];
  337|   120M|    if (max_index < index) {
  ------------------
  |  Branch (337:9): [True: 4.87k, False: 120M]
  ------------------
  338|  4.87k|        max_index = index;
  339|  4.87k|    }
  340|   120M|    return data[h_index.in_field_index];
  341|   120M|}
_ZNK9HugeArrayIP6DLItemIP5NNodeEE14get_huge_indexEl:
  301|   120M|HUGE_INDEX HugeArray<DATA>::get_huge_index(igraph_int_t index) const {
  302|   120M|    HUGE_INDEX h_index;
  303|   120M|    unsigned int shift_index = 0;
  304|   120M|    igraph_int_t help_index;
  305|   120M|    help_index = index;
  306|   120M|    if (index < 2) {
  ------------------
  |  Branch (306:9): [True: 18.1M, False: 102M]
  ------------------
  307|  18.1M|        h_index.field_index = 0;
  308|  18.1M|        h_index.in_field_index = index;
  309|  18.1M|        return h_index;
  310|  18.1M|    }
  311|       |    // wie oft muessen wir help_index nach links shiften, damit das 31. Bit gesetzt ist??
  312|  2.91G|    while (!(max_bit_left & help_index)) {
  ------------------
  |  Branch (312:12): [True: 2.80G, False: 102M]
  ------------------
  313|  2.80G|        help_index <<= 1;
  314|  2.80G|        shift_index++;
  315|  2.80G|    }
  316|   102M|    h_index.field_index = 31 - shift_index;   // das hoechste  besetzte Bit im Index
  317|   102M|    help_index = igraph_int_t(1) << h_index.field_index;  // in help_index wird das hoechste besetzte Bit von Index gesetzt
  318|   102M|    h_index.in_field_index = (index ^ help_index); // index XOR help_index, womit alle bits unter dem hoechsten erhalten bleiben
  319|   102M|    return h_index;
  320|   120M|}
_ZN15DL_Indexed_ListIP5NNodeE7pDeleteEP6DLItemIS1_E:
  479|  5.34k|L_DATA DL_Indexed_List<L_DATA>::pDelete(DLItem<L_DATA> *i) {
  480|  5.34k|    assert(this->number_of_items > 0);
  ------------------
  |  Branch (480:5): [True: 5.34k, False: 0]
  ------------------
  481|  5.34k|    L_DATA data = i->item;
  482|  5.34k|    i->previous->next = i->next;
  483|  5.34k|    i->next->previous = i->previous;
  484|  5.34k|    array[i->index] = 0;
  485|  5.34k|    last_index = i->index;
  486|  5.34k|    delete i;
  487|  5.34k|    this->number_of_items--;
  488|  5.34k|    return data;
  489|  5.34k|}
_ZN15DL_Indexed_ListIP5NNodeE4PushES1_:
  491|  5.34k|L_DATA DL_Indexed_List<L_DATA>::Push(L_DATA data) {
  492|  5.34k|    DLItem<L_DATA> *tmp;
  493|  5.34k|    tmp = pInsert(data, this->tail);
  494|  5.34k|    return tmp->item;
  495|  5.34k|}
_ZN15DL_Indexed_ListIP5NNodeE3PopEv:
  498|  5.34k|L_DATA DL_Indexed_List<L_DATA>::Pop() {
  499|  5.34k|    return pDelete(this->tail->previous);
  500|  5.34k|}
_ZN15DL_Indexed_ListIP5NNodeE3GetEl:
  503|   120M|L_DATA DL_Indexed_List<L_DATA>::Get(igraph_int_t pos) {
  504|   120M|    if (pos > this->number_of_items - 1) {
  ------------------
  |  Branch (504:9): [True: 0, False: 120M]
  ------------------
  505|      0|        return 0;
  506|      0|    }
  507|   120M|    return array[pos]->item;
  508|   120M|}
_ZN15DL_Indexed_ListIP5NLinkEC2Ev:
  139|    463|    DL_Indexed_List() = default;
_ZN6DLListIP5NLinkEC2Ev:
  355|  5.80k|DLList<L_DATA>::DLList() {
  356|  5.80k|    head = new DLItem<L_DATA>(NULL, 0); //fuer head und Tail gibt es das gleiche Array-Element!! Vorsicht!!
  357|  5.80k|    tail = new DLItem<L_DATA>(NULL, 0);
  358|       |
  359|  5.80k|    head->next = tail;
  360|  5.80k|    tail->previous = head;
  361|  5.80k|}
_ZN6DLItemIP5NLinkEC2ES1_l:
  347|  11.6k|    item(i), index(ind), previous(nullptr), next(nullptr) { }
_ZN6DLListIP5NLinkE7pInsertES1_P6DLItemIS1_E:
  388|  15.0k|DLItem<L_DATA> *DLList<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  389|  15.0k|    auto *i = new DLItem<L_DATA>(data, number_of_items + 1, pos->previous, pos);
  390|  15.0k|    pos->previous->next = i;
  391|  15.0k|    pos->previous = i;
  392|  15.0k|    number_of_items++;
  393|  15.0k|    return i;
  394|  15.0k|}
_ZN6DLItemIP5NLinkEC2ES1_lPS2_S3_:
  351|  22.5k|    item(i), index(ind), previous(p), next(n) { }
_ZN6DLListIP5NLinkE7pDeleteEP6DLItemIS1_E:
  397|  15.0k|L_DATA DLList<L_DATA>::pDelete(DLItem<L_DATA> *i) {
  398|  15.0k|    assert(number_of_items > 0);
  ------------------
  |  Branch (398:5): [True: 15.0k, False: 0]
  ------------------
  399|  15.0k|    L_DATA data = i->item;
  400|  15.0k|    i->previous->next = i->next;
  401|  15.0k|    i->next->previous = i->previous;
  402|  15.0k|    delete i;
  403|  15.0k|    number_of_items--;
  404|  15.0k|    return data;
  405|  15.0k|}
_ZN6DLListIP5NLinkE4PushES1_:
  425|  15.0k|L_DATA DLList<L_DATA>::Push(L_DATA data) {
  426|  15.0k|    DLItem<L_DATA> *tmp = pInsert(data, tail);
  427|  15.0k|    return tmp->item;
  428|  15.0k|}
_ZN9HugeArrayIP6DLItemIP5NLinkEEC2Ev:
  283|    463|HugeArray<DATA>::HugeArray() {
  284|    463|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|    463|    data[0] = 0;
  286|    463|    data[1] = 0;
  287|  14.8k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 14.8k, False: 463]
  ------------------
  288|  14.8k|        field = nullptr;
  289|  14.8k|    }
  290|    463|    fields[highest_field_index] = data;
  291|    463|}
_ZN6DLListIP5NLinkED2Ev:
  364|  5.80k|DLList<L_DATA>::~DLList() {
  365|  5.80k|    DLItem<L_DATA> *cur = head, *next;
  366|  17.4k|    while (cur) {
  ------------------
  |  Branch (366:12): [True: 11.6k, False: 5.80k]
  ------------------
  367|  11.6k|        next = cur->next;
  368|  11.6k|        delete cur;
  369|  11.6k|        cur = next;
  370|  11.6k|    }
  371|  5.80k|    number_of_items = 0;
  372|  5.80k|}
_ZN15DL_Indexed_ListIP5NLinkE7pInsertES1_P6DLItemIS1_E:
  468|  7.52k|DLItem<L_DATA> *DL_Indexed_List<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  469|  7.52k|    auto *i = new DLItem<L_DATA>(data, last_index, pos->previous, pos);
  470|  7.52k|    pos->previous->next = i;
  471|  7.52k|    pos->previous = i;
  472|  7.52k|    this->number_of_items++;
  473|  7.52k|    array[last_index] = i;
  474|  7.52k|    last_index++;
  475|  7.52k|    return i;
  476|  7.52k|}
_ZN9HugeArrayIP6DLItemIP5NLinkEEixEl:
   78|  15.0k|    DATA &operator[](igraph_int_t index) { return Set(index); }
_ZN9HugeArrayIP6DLItemIP5NLinkEE3SetEl:
  323|  15.0k|DATA &HugeArray<DATA>::Set(igraph_int_t index) {
  324|  15.0k|    igraph_int_t data_size;
  325|  15.8k|    while (size < index + 1) {
  ------------------
  |  Branch (325:12): [True: 816, False: 15.0k]
  ------------------
  326|    816|        highest_field_index++;
  327|    816|        data_size = igraph_int_t(1) << highest_field_index;
  328|    816|        data = new DATA[data_size];
  329|  10.3k|        for (igraph_int_t i = 0; i < data_size; i++) {
  ------------------
  |  Branch (329:34): [True: 9.56k, False: 816]
  ------------------
  330|  9.56k|            data[i] = 0;
  331|  9.56k|        }
  332|    816|        size = size + data_size; //overflow noch abfangen
  333|    816|        fields[highest_field_index] = data;
  334|    816|    }
  335|  15.0k|    HUGE_INDEX h_index = get_huge_index(index);
  336|  15.0k|    data = fields[h_index.field_index];
  337|  15.0k|    if (max_index < index) {
  ------------------
  |  Branch (337:9): [True: 7.06k, False: 7.98k]
  ------------------
  338|  7.06k|        max_index = index;
  339|  7.06k|    }
  340|  15.0k|    return data[h_index.in_field_index];
  341|  15.0k|}
_ZNK9HugeArrayIP6DLItemIP5NLinkEE14get_huge_indexEl:
  301|  15.0k|HUGE_INDEX HugeArray<DATA>::get_huge_index(igraph_int_t index) const {
  302|  15.0k|    HUGE_INDEX h_index;
  303|  15.0k|    unsigned int shift_index = 0;
  304|  15.0k|    igraph_int_t help_index;
  305|  15.0k|    help_index = index;
  306|  15.0k|    if (index < 2) {
  ------------------
  |  Branch (306:9): [True: 1.71k, False: 13.3k]
  ------------------
  307|  1.71k|        h_index.field_index = 0;
  308|  1.71k|        h_index.in_field_index = index;
  309|  1.71k|        return h_index;
  310|  1.71k|    }
  311|       |    // wie oft muessen wir help_index nach links shiften, damit das 31. Bit gesetzt ist??
  312|   368k|    while (!(max_bit_left & help_index)) {
  ------------------
  |  Branch (312:12): [True: 354k, False: 13.3k]
  ------------------
  313|   354k|        help_index <<= 1;
  314|   354k|        shift_index++;
  315|   354k|    }
  316|  13.3k|    h_index.field_index = 31 - shift_index;   // das hoechste  besetzte Bit im Index
  317|  13.3k|    help_index = igraph_int_t(1) << h_index.field_index;  // in help_index wird das hoechste besetzte Bit von Index gesetzt
  318|  13.3k|    h_index.in_field_index = (index ^ help_index); // index XOR help_index, womit alle bits unter dem hoechsten erhalten bleiben
  319|  13.3k|    return h_index;
  320|  15.0k|}
_ZN15DL_Indexed_ListIP5NLinkE7pDeleteEP6DLItemIS1_E:
  479|  7.52k|L_DATA DL_Indexed_List<L_DATA>::pDelete(DLItem<L_DATA> *i) {
  480|  7.52k|    assert(this->number_of_items > 0);
  ------------------
  |  Branch (480:5): [True: 7.52k, False: 0]
  ------------------
  481|  7.52k|    L_DATA data = i->item;
  482|  7.52k|    i->previous->next = i->next;
  483|  7.52k|    i->next->previous = i->previous;
  484|  7.52k|    array[i->index] = 0;
  485|  7.52k|    last_index = i->index;
  486|  7.52k|    delete i;
  487|  7.52k|    this->number_of_items--;
  488|  7.52k|    return data;
  489|  7.52k|}
_ZN15DL_Indexed_ListIP5NLinkE4PushES1_:
  491|  7.52k|L_DATA DL_Indexed_List<L_DATA>::Push(L_DATA data) {
  492|  7.52k|    DLItem<L_DATA> *tmp;
  493|  7.52k|    tmp = pInsert(data, this->tail);
  494|  7.52k|    return tmp->item;
  495|  7.52k|}
_ZN15DL_Indexed_ListIP5NLinkE3PopEv:
  498|  7.52k|L_DATA DL_Indexed_List<L_DATA>::Pop() {
  499|  7.52k|    return pDelete(this->tail->previous);
  500|  7.52k|}
_ZN15DL_Indexed_ListIP6DLListIP5NNodeEEC2Ev:
  139|    463|    DL_Indexed_List() = default;
_ZN6DLListIPS_IP5NNodeEEC2Ev:
  355|    463|DLList<L_DATA>::DLList() {
  356|    463|    head = new DLItem<L_DATA>(NULL, 0); //fuer head und Tail gibt es das gleiche Array-Element!! Vorsicht!!
  357|    463|    tail = new DLItem<L_DATA>(NULL, 0);
  358|       |
  359|    463|    head->next = tail;
  360|    463|    tail->previous = head;
  361|    463|}
_ZN6DLItemIP6DLListIP5NNodeEEC2ES4_l:
  347|    926|    item(i), index(ind), previous(nullptr), next(nullptr) { }
_ZN9HugeArrayIP6DLItemIP6DLListIP5NNodeEEEC2Ev:
  283|    463|HugeArray<DATA>::HugeArray() {
  284|    463|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|    463|    data[0] = 0;
  286|    463|    data[1] = 0;
  287|  14.8k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 14.8k, False: 463]
  ------------------
  288|  14.8k|        field = nullptr;
  289|  14.8k|    }
  290|    463|    fields[highest_field_index] = data;
  291|    463|}
_ZN6DLListIPS_IP5NNodeEED2Ev:
  364|    463|DLList<L_DATA>::~DLList() {
  365|    463|    DLItem<L_DATA> *cur = head, *next;
  366|  1.38k|    while (cur) {
  ------------------
  |  Branch (366:12): [True: 926, False: 463]
  ------------------
  367|    926|        next = cur->next;
  368|    926|        delete cur;
  369|    926|        cur = next;
  370|    926|    }
  371|    463|    number_of_items = 0;
  372|    463|}
_ZN9HugeArrayIP6DLItemIP6DLListIP5NNodeEEED2Ev:
  293|    463|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|    926|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 463, False: 463]
  ------------------
  295|    463|        data = fields[i];
  296|    463|        delete [] data;
  297|    463|    }
  298|    463|}
_ZN9HugeArrayIP6DLItemIP5NLinkEED2Ev:
  293|    463|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  1.74k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 1.27k, False: 463]
  ------------------
  295|  1.27k|        data = fields[i];
  296|  1.27k|        delete [] data;
  297|  1.27k|    }
  298|    463|}
_ZN9HugeArrayIP6DLItemIP5NNodeEED2Ev:
  293|    463|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  1.75k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 1.29k, False: 463]
  ------------------
  295|  1.29k|        data = fields[i];
  296|  1.29k|        delete [] data;
  297|  1.29k|    }
  298|    463|}
_ZN7networkD2Ev:
  263|    463|    ~network() {
  264|    463|        ClusterList<NNode*> *cl_cur;
  265|       |
  266|  7.98k|        while (link_list.Size()) {
  ------------------
  |  Branch (266:16): [True: 7.52k, False: 463]
  ------------------
  267|  7.52k|            delete link_list.Pop();
  268|  7.52k|        }
  269|  5.80k|        while (node_list.Size()) {
  ------------------
  |  Branch (269:16): [True: 5.34k, False: 463]
  ------------------
  270|  5.34k|            delete node_list.Pop();
  271|  5.34k|        }
  272|    463|        while (cluster_list.Size()) {
  ------------------
  |  Branch (272:16): [True: 0, False: 463]
  ------------------
  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|    463|    }
_ZNK6DLListIP5NLinkE4SizeEv:
  120|  8.91k|    igraph_int_t Size() const {
  121|  8.91k|        return number_of_items;
  122|  8.91k|    }
_ZN5NLinkD2Ev:
  241|  7.52k|    ~NLink() { start->Disconnect_From(end); }
_ZN5NNodeD2Ev:
  185|  5.34k|    ~NNode() { Disconnect_From_All(); }
_ZNK6DLListIPS_IP5NNodeEE4SizeEv:
  120|    463|    igraph_int_t Size() const {
  121|    463|        return number_of_items;
  122|    463|    }
_ZN5NNodeC2EllP6DLListIP5NLinkEPKc:
  179|  5.34k|            index(ind), cluster_index(c_ind), global_link_list(ll)
  180|  5.34k|    {
  181|  5.34k|        strcpy(name, n);
  182|  5.34k|    }
_ZNK5NNode9Get_IndexEv:
  187|  5.34k|    igraph_int_t Get_Index() const {
  188|  5.34k|        return index;
  189|  5.34k|    }
_ZNK5NNode16Get_ClusterIndexEv:
  190|   928M|    igraph_int_t Get_ClusterIndex() const {
  191|   928M|        return cluster_index;
  192|   928M|    }
_ZN5NNode16Set_ClusterIndexEl:
  199|  56.5M|    void Set_ClusterIndex(igraph_int_t ci) {
  200|  56.5M|        cluster_index = ci;
  201|  56.5M|    }
_ZNK5NNode10Get_DegreeEv:
  202|  5.98k|    igraph_int_t Get_Degree() const {
  203|  5.98k|        return (neighbours.Size());
  204|  5.98k|    }
_ZNK5NNode10Get_WeightEv:
  211|   121M|    double Get_Weight() const {
  212|   121M|        return weight;
  213|   121M|    }
_ZN5NNode10Set_WeightEd:
  214|  10.6k|    void Set_Weight(double w) {
  215|  10.6k|        weight = w;
  216|  10.6k|    }
_ZNK5NNode14Get_NeighboursEv:
  218|  5.34k|    const DLList<NNode*> *Get_Neighbours() const {
  219|  5.34k|        return &neighbours;
  220|  5.34k|    }
_ZNK5NNode9Get_LinksEv:
  221|   177M|    const DLList<NLink*> *Get_Links() const {
  222|   177M|        return &n_links;
  223|   177M|    }
_ZN5NLinkC2EP5NNodeS1_d:
  238|  7.52k|    NLink(NNode *s, NNode *e, double w) : start(s), end(e), weight(w) { }
_ZN5NLink9Get_StartEv:
  243|   681M|    NNode *Get_Start() { return start; }
_ZN5NLink7Get_EndEv:
  244|   239M|    NNode *Get_End() { return end; }
_ZNK5NLink10Get_WeightEv:
  248|   460M|    double Get_Weight() const { return weight; }
_ZN6DLListIP5NNodeE10Is_In_ListES1_:
  450|  7.52k|igraph_int_t DLList<L_DATA>::Is_In_List(L_DATA data) {
  451|  7.52k|    DLItem<L_DATA> *cur = head, *next;
  452|  7.52k|    igraph_int_t pos = 0;
  453|  30.9k|    while (cur) {
  ------------------
  |  Branch (453:12): [True: 23.4k, False: 7.52k]
  ------------------
  454|  23.4k|        next = cur->next;
  455|  23.4k|        if (cur->item == data) {
  ------------------
  |  Branch (455:13): [True: 0, False: 23.4k]
  ------------------
  456|      0|            return pos ;
  457|      0|        }
  458|  23.4k|        cur = next;
  459|  23.4k|        pos++;
  460|  23.4k|    }
  461|  7.52k|    return 0;
  462|  7.52k|}
_ZN11DLList_IterIP5NLinkE5FirstEPK6DLListIS1_E:
  531|   177M|L_DATA DLList_Iter<L_DATA>::First(const DLList<L_DATA> *l) {
  532|   177M|    list = l;
  533|   177M|    current = list->head->next;
  534|   177M|    if (current == (list->tail)) {
  ------------------
  |  Branch (534:9): [True: 0, False: 177M]
  ------------------
  535|      0|        end_reached = true;
  536|   177M|    } else {
  537|   177M|        end_reached = false;
  538|   177M|    }
  539|   177M|    return (current->item);
  540|   177M|}
_ZNK11DLList_IterIP5NLinkE3EndEv:
  157|   638M|    bool End() const {
  158|   638M|        return end_reached;
  159|   638M|    }
_ZN11DLList_IterIP5NLinkE4NextEv:
  513|   460M|L_DATA DLList_Iter<L_DATA>::Next() {
  514|   460M|    current = current->next;
  515|   460M|    if (current == (list->tail)) {
  ------------------
  |  Branch (515:9): [True: 177M, False: 283M]
  ------------------
  516|   177M|        end_reached = true;
  517|   177M|    }
  518|   460M|    return (current->item);
  519|   460M|}
_ZN6DLListIP5NNodeE7fDeleteES1_:
  409|  15.0k|int DLList<L_DATA>::fDelete(L_DATA data) {
  410|  15.0k|    if ((number_of_items == 0) || (!data)) {
  ------------------
  |  Branch (410:9): [True: 0, False: 15.0k]
  |  Branch (410:35): [True: 0, False: 15.0k]
  ------------------
  411|      0|        return 0;
  412|      0|    }
  413|  15.0k|    DLItem<L_DATA> *cur;
  414|  15.0k|    cur = head->next;
  415|  73.2k|    while ((cur != tail) && (cur->item != data)) {
  ------------------
  |  Branch (415:12): [True: 73.2k, False: 0]
  |  Branch (415:29): [True: 58.2k, False: 15.0k]
  ------------------
  416|  58.2k|        cur = cur->next;
  417|  58.2k|    }
  418|  15.0k|    if (cur != tail) {
  ------------------
  |  Branch (418:9): [True: 15.0k, False: 0]
  ------------------
  419|  15.0k|        return (pDelete(cur) != 0);
  420|  15.0k|    }
  421|      0|    return 0;
  422|  15.0k|}
_ZN6DLListIP5NLinkE7fDeleteES1_:
  409|  15.0k|int DLList<L_DATA>::fDelete(L_DATA data) {
  410|  15.0k|    if ((number_of_items == 0) || (!data)) {
  ------------------
  |  Branch (410:9): [True: 0, False: 15.0k]
  |  Branch (410:35): [True: 0, False: 15.0k]
  ------------------
  411|      0|        return 0;
  412|      0|    }
  413|  15.0k|    DLItem<L_DATA> *cur;
  414|  15.0k|    cur = head->next;
  415|  73.2k|    while ((cur != tail) && (cur->item != data)) {
  ------------------
  |  Branch (415:12): [True: 73.2k, False: 0]
  |  Branch (415:29): [True: 58.2k, False: 15.0k]
  ------------------
  416|  58.2k|        cur = cur->next;
  417|  58.2k|    }
  418|  15.0k|    if (cur != tail) {
  ------------------
  |  Branch (418:9): [True: 15.0k, False: 0]
  ------------------
  419|  15.0k|        return (pDelete(cur) != 0);
  420|  15.0k|    }
  421|      0|    return 0;
  422|  15.0k|}
_ZN15DL_Indexed_ListIPlEC2Ev:
  139|    926|    DL_Indexed_List() = default;
_ZN6DLListIPlEC2Ev:
  355|    926|DLList<L_DATA>::DLList() {
  356|    926|    head = new DLItem<L_DATA>(NULL, 0); //fuer head und Tail gibt es das gleiche Array-Element!! Vorsicht!!
  357|    926|    tail = new DLItem<L_DATA>(NULL, 0);
  358|       |
  359|    926|    head->next = tail;
  360|    926|    tail->previous = head;
  361|    926|}
_ZN6DLItemIPlEC2ES0_l:
  347|  1.85k|    item(i), index(ind), previous(nullptr), next(nullptr) { }
_ZN6DLItemIPlEC2ES0_lPS1_S2_:
  351|  10.6k|    item(i), index(ind), previous(p), next(n) { }
_ZN9HugeArrayIP6DLItemIPlEEC2Ev:
  283|    926|HugeArray<DATA>::HugeArray() {
  284|    926|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|    926|    data[0] = 0;
  286|    926|    data[1] = 0;
  287|  29.6k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 29.6k, False: 926]
  ------------------
  288|  29.6k|        field = nullptr;
  289|  29.6k|    }
  290|    926|    fields[highest_field_index] = data;
  291|    926|}
_ZN6DLListIPlED2Ev:
  364|    926|DLList<L_DATA>::~DLList() {
  365|    926|    DLItem<L_DATA> *cur = head, *next;
  366|  13.4k|    while (cur) {
  ------------------
  |  Branch (366:12): [True: 12.5k, False: 926]
  ------------------
  367|  12.5k|        next = cur->next;
  368|  12.5k|        delete cur;
  369|  12.5k|        cur = next;
  370|  12.5k|    }
  371|    926|    number_of_items = 0;
  372|    926|}
_ZN15DL_Indexed_ListIPlE7pInsertES0_P6DLItemIS0_E:
  468|  10.6k|DLItem<L_DATA> *DL_Indexed_List<L_DATA>::pInsert(L_DATA data, DLItem<L_DATA> *pos) {
  469|  10.6k|    auto *i = new DLItem<L_DATA>(data, last_index, pos->previous, pos);
  470|  10.6k|    pos->previous->next = i;
  471|  10.6k|    pos->previous = i;
  472|  10.6k|    this->number_of_items++;
  473|  10.6k|    array[last_index] = i;
  474|  10.6k|    last_index++;
  475|  10.6k|    return i;
  476|  10.6k|}
_ZN9HugeArrayIP6DLItemIPlEEixEl:
   78|  10.6k|    DATA &operator[](igraph_int_t index) { return Set(index); }
_ZN9HugeArrayIP6DLItemIPlEE3SetEl:
  323|  10.6k|DATA &HugeArray<DATA>::Set(igraph_int_t index) {
  324|  10.6k|    igraph_int_t data_size;
  325|  12.3k|    while (size < index + 1) {
  ------------------
  |  Branch (325:12): [True: 1.66k, False: 10.6k]
  ------------------
  326|  1.66k|        highest_field_index++;
  327|  1.66k|        data_size = igraph_int_t(1) << highest_field_index;
  328|  1.66k|        data = new DATA[data_size];
  329|  12.1k|        for (igraph_int_t i = 0; i < data_size; i++) {
  ------------------
  |  Branch (329:34): [True: 10.5k, False: 1.66k]
  ------------------
  330|  10.5k|            data[i] = 0;
  331|  10.5k|        }
  332|  1.66k|        size = size + data_size; //overflow noch abfangen
  333|  1.66k|        fields[highest_field_index] = data;
  334|  1.66k|    }
  335|  10.6k|    HUGE_INDEX h_index = get_huge_index(index);
  336|  10.6k|    data = fields[h_index.field_index];
  337|  10.6k|    if (max_index < index) {
  ------------------
  |  Branch (337:9): [True: 9.75k, False: 926]
  ------------------
  338|  9.75k|        max_index = index;
  339|  9.75k|    }
  340|  10.6k|    return data[h_index.in_field_index];
  341|  10.6k|}
_ZNK9HugeArrayIP6DLItemIPlEE14get_huge_indexEl:
  301|  10.6k|HUGE_INDEX HugeArray<DATA>::get_huge_index(igraph_int_t index) const {
  302|  10.6k|    HUGE_INDEX h_index;
  303|  10.6k|    unsigned int shift_index = 0;
  304|  10.6k|    igraph_int_t help_index;
  305|  10.6k|    help_index = index;
  306|  10.6k|    if (index < 2) {
  ------------------
  |  Branch (306:9): [True: 1.85k, False: 8.82k]
  ------------------
  307|  1.85k|        h_index.field_index = 0;
  308|  1.85k|        h_index.in_field_index = index;
  309|  1.85k|        return h_index;
  310|  1.85k|    }
  311|       |    // wie oft muessen wir help_index nach links shiften, damit das 31. Bit gesetzt ist??
  312|   251k|    while (!(max_bit_left & help_index)) {
  ------------------
  |  Branch (312:12): [True: 242k, False: 8.82k]
  ------------------
  313|   242k|        help_index <<= 1;
  314|   242k|        shift_index++;
  315|   242k|    }
  316|  8.82k|    h_index.field_index = 31 - shift_index;   // das hoechste  besetzte Bit im Index
  317|  8.82k|    help_index = igraph_int_t(1) << h_index.field_index;  // in help_index wird das hoechste besetzte Bit von Index gesetzt
  318|  8.82k|    h_index.in_field_index = (index ^ help_index); // index XOR help_index, womit alle bits unter dem hoechsten erhalten bleiben
  319|  8.82k|    return h_index;
  320|  10.6k|}
_ZN9HugeArrayIP6DLItemIPlEED2Ev:
  293|    926|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  3.51k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 2.59k, False: 926]
  ------------------
  295|  2.59k|        data = fields[i];
  296|  2.59k|        delete [] data;
  297|  2.59k|    }
  298|    926|}
_ZN9HugeArrayIPS_IdEEC2Ev:
  283|    463|HugeArray<DATA>::HugeArray() {
  284|    463|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|    463|    data[0] = 0;
  286|    463|    data[1] = 0;
  287|  14.8k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 14.8k, False: 463]
  ------------------
  288|  14.8k|        field = nullptr;
  289|  14.8k|    }
  290|    463|    fields[highest_field_index] = data;
  291|    463|}
_ZN9HugeArrayIPS_IdEED2Ev:
  293|    463|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|    926|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 463, False: 463]
  ------------------
  295|    463|        data = fields[i];
  296|    463|        delete [] data;
  297|    463|    }
  298|    463|}
_ZN11DLList_IterIP5NNodeE5FirstEPK6DLListIS1_E:
  531|   139k|L_DATA DLList_Iter<L_DATA>::First(const DLList<L_DATA> *l) {
  532|   139k|    list = l;
  533|   139k|    current = list->head->next;
  534|   139k|    if (current == (list->tail)) {
  ------------------
  |  Branch (534:9): [True: 0, False: 139k]
  ------------------
  535|      0|        end_reached = true;
  536|   139k|    } else {
  537|   139k|        end_reached = false;
  538|   139k|    }
  539|   139k|    return (current->item);
  540|   139k|}
_ZNK11DLList_IterIP5NNodeE3EndEv:
  157|  1.37M|    bool End() const {
  158|  1.37M|        return end_reached;
  159|  1.37M|    }
_ZN15DL_Indexed_ListIPlE4PushES0_:
  491|  10.6k|L_DATA DL_Indexed_List<L_DATA>::Push(L_DATA data) {
  492|  10.6k|    DLItem<L_DATA> *tmp;
  493|  10.6k|    tmp = pInsert(data, this->tail);
  494|  10.6k|    return tmp->item;
  495|  10.6k|}
_ZN11DLList_IterIP5NNodeE4NextEv:
  513|  1.23M|L_DATA DLList_Iter<L_DATA>::Next() {
  514|  1.23M|    current = current->next;
  515|  1.23M|    if (current == (list->tail)) {
  ------------------
  |  Branch (515:9): [True: 139k, False: 1.09M]
  ------------------
  516|   139k|        end_reached = true;
  517|   139k|    }
  518|  1.23M|    return (current->item);
  519|  1.23M|}
_ZN6DLListIPlE12delete_itemsEv:
  375|    926|void DLList<L_DATA>::delete_items() {
  376|    926|    DLItem<L_DATA> *cur, *next;
  377|    926|    cur = this->head;
  378|  13.4k|    while (cur) {
  ------------------
  |  Branch (378:12): [True: 12.5k, False: 926]
  ------------------
  379|  12.5k|        next = cur->next;
  380|  12.5k|        cur->del();
  381|  12.5k|        cur = next;
  382|  12.5k|    }
  383|    926|    this->number_of_items = 0;
  384|    926|}
_ZN6DLItemIPlE3delEv:
  101|  12.5k|    void del() {
  102|  12.5k|        delete item;
  103|  12.5k|    }
_ZN11DLList_IterIPlE5FirstEPK6DLListIS0_E:
  531|   185k|L_DATA DLList_Iter<L_DATA>::First(const DLList<L_DATA> *l) {
  532|   185k|    list = l;
  533|   185k|    current = list->head->next;
  534|   185k|    if (current == (list->tail)) {
  ------------------
  |  Branch (534:9): [True: 0, False: 185k]
  ------------------
  535|      0|        end_reached = true;
  536|   185k|    } else {
  537|   185k|        end_reached = false;
  538|   185k|    }
  539|   185k|    return (current->item);
  540|   185k|}
_ZN11DLList_IterIPlE4NextEv:
  513|  1.64M|L_DATA DLList_Iter<L_DATA>::Next() {
  514|  1.64M|    current = current->next;
  515|  1.64M|    if (current == (list->tail)) {
  ------------------
  |  Branch (515:9): [True: 185k, False: 1.45M]
  ------------------
  516|   185k|        end_reached = true;
  517|   185k|    }
  518|  1.64M|    return (current->item);
  519|  1.64M|}
_ZN9HugeArrayIiEC2Ev:
  283|  1.38k|HugeArray<DATA>::HugeArray() {
  284|  1.38k|    data = new DATA[2]; //ein extra Platz fuer das Nullelement
  285|  1.38k|    data[0] = 0;
  286|  1.38k|    data[1] = 0;
  287|  44.4k|    for (auto & field : fields) {
  ------------------
  |  Branch (287:23): [True: 44.4k, False: 1.38k]
  ------------------
  288|  44.4k|        field = nullptr;
  289|  44.4k|    }
  290|  1.38k|    fields[highest_field_index] = data;
  291|  1.38k|}
_ZN9HugeArrayIiED2Ev:
  293|  1.38k|template <class DATA> HugeArray<DATA>::~HugeArray() {
  294|  6.94k|    for (unsigned int i = 0; i <= highest_field_index; i++) {
  ------------------
  |  Branch (294:30): [True: 5.55k, False: 1.38k]
  ------------------
  295|  5.55k|        data = fields[i];
  296|  5.55k|        delete [] data;
  297|  5.55k|    }
  298|  1.38k|}
_ZN9HugeArrayIiEixEl:
   78|  47.4k|    DATA &operator[](igraph_int_t index) { return Set(index); }
_ZN9HugeArrayIiE3SetEl:
  323|  47.4k|DATA &HugeArray<DATA>::Set(igraph_int_t index) {
  324|  47.4k|    igraph_int_t data_size;
  325|  51.6k|    while (size < index + 1) {
  ------------------
  |  Branch (325:12): [True: 4.16k, False: 47.4k]
  ------------------
  326|  4.16k|        highest_field_index++;
  327|  4.16k|        data_size = igraph_int_t(1) << highest_field_index;
  328|  4.16k|        data = new DATA[data_size];
  329|  23.6k|        for (igraph_int_t i = 0; i < data_size; i++) {
  ------------------
  |  Branch (329:34): [True: 19.4k, False: 4.16k]
  ------------------
  330|  19.4k|            data[i] = 0;
  331|  19.4k|        }
  332|  4.16k|        size = size + data_size; //overflow noch abfangen
  333|  4.16k|        fields[highest_field_index] = data;
  334|  4.16k|    }
  335|  47.4k|    HUGE_INDEX h_index = get_huge_index(index);
  336|  47.4k|    data = fields[h_index.field_index];
  337|  47.4k|    if (max_index < index) {
  ------------------
  |  Branch (337:9): [True: 13.8k, False: 33.5k]
  ------------------
  338|  13.8k|        max_index = index;
  339|  13.8k|    }
  340|  47.4k|    return data[h_index.in_field_index];
  341|  47.4k|}
_ZNK9HugeArrayIiE14get_huge_indexEl:
  301|  47.4k|HUGE_INDEX HugeArray<DATA>::get_huge_index(igraph_int_t index) const {
  302|  47.4k|    HUGE_INDEX h_index;
  303|  47.4k|    unsigned int shift_index = 0;
  304|  47.4k|    igraph_int_t help_index;
  305|  47.4k|    help_index = index;
  306|  47.4k|    if (index < 2) {
  ------------------
  |  Branch (306:9): [True: 5.15k, False: 42.2k]
  ------------------
  307|  5.15k|        h_index.field_index = 0;
  308|  5.15k|        h_index.in_field_index = index;
  309|  5.15k|        return h_index;
  310|  5.15k|    }
  311|       |    // wie oft muessen wir help_index nach links shiften, damit das 31. Bit gesetzt ist??
  312|  1.26M|    while (!(max_bit_left & help_index)) {
  ------------------
  |  Branch (312:12): [True: 1.22M, False: 42.2k]
  ------------------
  313|  1.22M|        help_index <<= 1;
  314|  1.22M|        shift_index++;
  315|  1.22M|    }
  316|  42.2k|    h_index.field_index = 31 - shift_index;   // das hoechste  besetzte Bit im Index
  317|  42.2k|    help_index = igraph_int_t(1) << h_index.field_index;  // in help_index wird das hoechste besetzte Bit von Index gesetzt
  318|  42.2k|    h_index.in_field_index = (index ^ help_index); // index XOR help_index, womit alle bits unter dem hoechsten erhalten bleiben
  319|  42.2k|    return h_index;
  320|  47.4k|}

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

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

_ZN10PottsModelC2EP7networkli:
   56|    463|        net(n), q(qvalue), operation_mode(m), Qmatrix(qvalue+1)
   57|    463|{
   58|    463|    DLList_Iter<NNode*> iter;
   59|    463|    const NNode *n_cur;
   60|    463|    igraph_int_t *i_ptr;
   61|       |    //needed in calculating modularity
   62|    463|    Qa     = new double[q + 1];
   63|       |    //weights for each spin state needed in Monte Carlo process
   64|    463|    weights = new double[q + 1];
   65|       |    //bookkeeping of occupation numbers of spin states or the number of links in community
   66|    463|    color_field = new double[q + 1];
   67|    463|    neighbours = new double[q + 1];
   68|       |
   69|    463|    num_of_nodes = net->node_list.Size();
   70|    463|    num_of_links = net->link_list.Size();
   71|       |
   72|    463|    n_cur = iter.First(&net->node_list);
   73|  5.80k|    while (!iter.End()) {
  ------------------
  |  Branch (73:12): [True: 5.34k, False: 463]
  ------------------
   74|  5.34k|        if (k_max < n_cur->Get_Degree()) {
  ------------------
  |  Branch (74:13): [True: 649, False: 4.69k]
  ------------------
   75|    649|            k_max = n_cur->Get_Degree();
   76|    649|        }
   77|  5.34k|        i_ptr = new igraph_int_t;
   78|  5.34k|        *i_ptr = 0;
   79|  5.34k|        new_spins.Push(i_ptr);
   80|  5.34k|        i_ptr = new igraph_int_t;
   81|  5.34k|        *i_ptr = 0;
   82|  5.34k|        previous_spins.Push(i_ptr);
   83|  5.34k|        n_cur = iter.Next();
   84|  5.34k|    }
   85|    463|}
_ZN10PottsModelD2Ev:
   89|    463|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|    463|    new_spins.delete_items();
   94|    463|    previous_spins.delete_items();
   95|    463|    delete [] Qa;
   96|    463|    delete [] weights;
   97|    463|    delete [] color_field;
   98|    463|    delete [] neighbours;
   99|    463|}
_ZN10PottsModel19assign_initial_confEl:
  106|    926|igraph_int_t PottsModel::assign_initial_conf(igraph_int_t spin) {
  107|    926|    igraph_int_t s;
  108|    926|    DLList_Iter<NNode*> iter;
  109|    926|    DLList_Iter<NLink*> l_iter;
  110|    926|    NNode *n_cur;
  111|    926|    const NLink *l_cur;
  112|    926|    double sum_weight;
  113|       |
  114|       |    // initialize colorfield
  115|  11.1k|    for (igraph_int_t i = 0; i <= q; i++) {
  ------------------
  |  Branch (115:30): [True: 10.1k, False: 926]
  ------------------
  116|  10.1k|        color_field[i] = 0.0;
  117|  10.1k|    }
  118|       |    //
  119|    926|    total_degree_sum = 0.0;
  120|    926|    n_cur = iter.First(&net->node_list);
  121|  11.6k|    while (!iter.End()) {
  ------------------
  |  Branch (121:12): [True: 10.6k, False: 926]
  ------------------
  122|  10.6k|        if (spin < 0) {
  ------------------
  |  Branch (122:13): [True: 10.6k, False: 0]
  ------------------
  123|  10.6k|            s = RNG_INTEGER(1, q);
  ------------------
  |  |  152|  10.6k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  124|  10.6k|        } else {
  125|      0|            s = spin;
  126|      0|        }
  127|  10.6k|        n_cur->Set_ClusterIndex(s);
  128|  10.6k|        l_cur = l_iter.First(n_cur->Get_Links());
  129|  10.6k|        sum_weight = 0;
  130|  40.7k|        while (!l_iter.End()) {
  ------------------
  |  Branch (130:16): [True: 30.0k, False: 10.6k]
  ------------------
  131|  30.0k|            sum_weight += l_cur->Get_Weight(); //weight should be one, in case we are not using it.
  132|  30.0k|            l_cur = l_iter.Next();
  133|  30.0k|        }
  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.6k|        n_cur->Set_Weight(sum_weight);
  137|       |
  138|       |        // in case we want all links to be contribute equally - parameter gamm=fixed
  139|  10.6k|        if (operation_mode == 0) {
  ------------------
  |  Branch (139:13): [True: 0, False: 10.6k]
  ------------------
  140|      0|            color_field[s]++;
  141|  10.6k|        } else {
  142|  10.6k|            color_field[s] += sum_weight;
  143|  10.6k|        }
  144|       |        // or in case we want to use a weight of each link that is proportional to k_i\times k_j
  145|  10.6k|        total_degree_sum += sum_weight;
  146|  10.6k|        n_cur = iter.Next();
  147|  10.6k|    }
  148|       |
  149|    926|    return net->node_list.Size();
  150|    926|}
_ZN10PottsModel18initialize_QmatrixEv:
  159|    463|double PottsModel::initialize_Qmatrix() {
  160|    463|    DLList_Iter<NLink*> l_iter;
  161|    463|    NLink *l_cur;
  162|    463|    igraph_int_t i, j;
  163|       |    //initialize with zeros
  164|    463|    num_of_links = net->link_list.Size();
  165|  5.55k|    for (i = 0; i <= q; i++) {
  ------------------
  |  Branch (165:17): [True: 5.09k, False: 463]
  ------------------
  166|  5.09k|        Qa[i] = 0.0;
  167|  35.6k|        for (j = i; j <= q; j++) {
  ------------------
  |  Branch (167:21): [True: 30.5k, False: 5.09k]
  ------------------
  168|  30.5k|            Qmatrix[i][j] = 0.0;
  169|  30.5k|            Qmatrix[j][i] = 0.0;
  170|  30.5k|        }
  171|  5.09k|    }
  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|    463|    l_cur = l_iter.First(&net->link_list);
  175|  7.98k|    while (!l_iter.End()) {
  ------------------
  |  Branch (175:12): [True: 7.52k, False: 463]
  ------------------
  176|  7.52k|        i = l_cur->Get_Start()->Get_ClusterIndex();
  177|  7.52k|        j = l_cur->Get_End()->Get_ClusterIndex();
  178|  7.52k|        Qmatrix[i][j] += l_cur->Get_Weight();
  179|  7.52k|        Qmatrix[j][i] += l_cur->Get_Weight();
  180|       |
  181|  7.52k|        l_cur = l_iter.Next();
  182|  7.52k|    }
  183|       |    //Finally, calculate sum over rows and keep in Qa
  184|  5.55k|    for (i = 0; i <= q; i++) {
  ------------------
  |  Branch (184:17): [True: 5.09k, False: 463]
  ------------------
  185|  61.1k|        for (j = 0; j <= q; j++) {
  ------------------
  |  Branch (185:21): [True: 56.0k, False: 5.09k]
  ------------------
  186|  56.0k|            Qa[i] += Qmatrix[i][j];
  187|  56.0k|        }
  188|  5.09k|    }
  189|    463|    return calculate_Q();
  190|    463|}
_ZN10PottsModel11calculate_QEv:
  195|    463|double PottsModel::calculate_Q() {
  196|    463|    double Q = 0.0;
  197|  5.55k|    for (igraph_int_t i = 0; i <= q; i++) {
  ------------------
  |  Branch (197:30): [True: 5.09k, False: 463]
  ------------------
  198|  5.09k|        Q += Qmatrix[i][i] - Qa[i] * Qa[i] / double(2.0 * net->sum_weights);
  199|  5.09k|    }
  200|    463|    Q /= double(2.0 * net->sum_weights);
  201|    463|    return Q;
  202|    463|}
_ZN10PottsModel13FindStartTempEddd:
  209|    463|double PottsModel::FindStartTemp(double gamma, double prob, double ts) {
  210|    463|    double kT;
  211|    463|    kT = ts;
  212|       |    //assing random initial condition
  213|    463|    assign_initial_conf(-1);
  214|       |    //initialize Modularity matrix, from now on, it will be updated at every spin change
  215|    463|    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|  1.98k|    while (acceptance < (1.0 - 1.0 / double(q)) * 0.95) { //want 95% acceptance
  ------------------
  |  Branch (219:12): [True: 1.51k, False: 463]
  ------------------
  220|  1.51k|        kT = kT * 1.1;
  221|  1.51k|        HeatBathParallelLookup(gamma, prob, kT, 50);
  222|  1.51k|    }
  223|    463|    kT *= 1.1; // just to be sure...
  224|    463|    return kT;
  225|    463|}
_ZN10PottsModel22HeatBathParallelLookupEdddj:
  471|  1.51k|igraph_int_t PottsModel::HeatBathParallelLookup(double gamma, double prob, double kT, unsigned int max_sweeps) {
  472|  1.51k|    DLList_Iter<NNode*> net_iter;
  473|  1.51k|    DLList_Iter<NLink*> l_iter;
  474|  1.51k|    DLList_Iter<igraph_int_t*> i_iter, i_iter2;
  475|  1.51k|    NNode *node, *n_cur;
  476|  1.51k|    NLink *l_cur;
  477|  1.51k|    igraph_int_t new_spin, spin_opt, old_spin;
  478|  1.51k|    igraph_int_t *SPIN, *P_SPIN;
  479|  1.51k|    unsigned int sweep;
  480|  1.51k|    igraph_int_t max_q;
  481|  1.51k|    igraph_int_t changes;
  482|  1.51k|    double h, delta = 0, norm, r, beta, minweight, prefac = 0, w, degree;
  483|  1.51k|    bool cyclic = false/*, found*/;
  484|  1.51k|    igraph_int_t number_of_nodes;
  485|       |
  486|  1.51k|    sweep = 0;
  487|  1.51k|    changes = 1;
  488|  1.51k|    number_of_nodes = net->node_list.Size();
  489|  63.2k|    while (sweep < max_sweeps && changes) {
  ------------------
  |  Branch (489:12): [True: 62.1k, False: 1.06k]
  |  Branch (489:34): [True: 61.6k, False: 455]
  ------------------
  490|  61.6k|        cyclic = true;
  491|  61.6k|        sweep++;
  492|  61.6k|        changes = 0;
  493|       |        //Loop over all nodes
  494|  61.6k|        node = net_iter.First(&net->node_list);
  495|  61.6k|        SPIN = i_iter.First(&new_spins);
  496|   609k|        while (!net_iter.End()) {
  ------------------
  |  Branch (496:16): [True: 547k, False: 61.6k]
  ------------------
  497|       |            // Initialize neighbours and weights
  498|  6.57M|            for (igraph_int_t i = 0; i <= q; i++) {
  ------------------
  |  Branch (498:38): [True: 6.02M, False: 547k]
  ------------------
  499|  6.02M|                neighbours[i] = 0;
  500|  6.02M|                weights[i] = 0;
  501|  6.02M|            }
  502|   547k|            norm = 0.0;
  503|   547k|            degree = node->Get_Weight();
  504|       |            //Loop over all links (=neighbours)
  505|   547k|            l_cur = l_iter.First(node->Get_Links());
  506|  2.04M|            while (!l_iter.End()) {
  ------------------
  |  Branch (506:20): [True: 1.49M, False: 547k]
  ------------------
  507|  1.49M|                w = l_cur->Get_Weight();
  508|  1.49M|                if (node == l_cur->Get_Start()) {
  ------------------
  |  Branch (508:21): [True: 747k, False: 747k]
  ------------------
  509|   747k|                    n_cur = l_cur->Get_End();
  510|   747k|                } else {
  511|   747k|                    n_cur = l_cur->Get_Start();
  512|   747k|                }
  513|  1.49M|                neighbours[n_cur->Get_ClusterIndex()] += w;
  514|  1.49M|                l_cur = l_iter.Next();
  515|  1.49M|            }
  516|       |            //Search optimal Spin
  517|   547k|            old_spin = node->Get_ClusterIndex();
  518|   547k|            switch (operation_mode) {
  519|      0|            case 0: {
  ------------------
  |  Branch (519:13): [True: 0, False: 547k]
  ------------------
  520|      0|                prefac = 1.0;
  521|      0|                delta = 1.0;
  522|      0|                break;
  523|      0|            }
  524|   547k|            case 1: { //newman modularity
  ------------------
  |  Branch (524:13): [True: 547k, False: 0]
  ------------------
  525|   547k|                prefac = 1.0;
  526|   547k|                prob = degree / total_degree_sum;
  527|   547k|                delta = degree;
  528|   547k|                break;
  529|      0|            }
  530|      0|            default:
  ------------------
  |  Branch (530:13): [True: 0, False: 547k]
  ------------------
  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|   547k|            }
  533|   547k|            spin_opt = old_spin;
  534|   547k|            beta = 1.0 / kT * prefac;
  535|   547k|            minweight = 0.0;
  536|   547k|            weights[old_spin] = 0.0;
  537|  6.02M|            for (igraph_int_t spin = 1; spin <= q; spin++) { // loop over all possible new spins
  ------------------
  |  Branch (537:41): [True: 5.47M, False: 547k]
  ------------------
  538|  5.47M|                if (spin != old_spin) { // only if we have a different than old spin!
  ------------------
  |  Branch (538:21): [True: 4.93M, False: 547k]
  ------------------
  539|  4.93M|                    h = color_field[spin] + delta - color_field[old_spin];
  540|  4.93M|                    weights[spin] = double(neighbours[old_spin] - neighbours[spin]) + gamma * prob * double(h);
  541|  4.93M|                    if (weights[spin] < minweight) {
  ------------------
  |  Branch (541:25): [True: 828k, False: 4.10M]
  ------------------
  542|   828k|                        minweight = weights[spin];
  543|   828k|                    }
  544|  4.93M|                }
  545|  5.47M|            }   // for spin
  546|  6.02M|            for (igraph_int_t spin = 1; spin <= q; spin++) { // loop over all possibe spins
  ------------------
  |  Branch (546:41): [True: 5.47M, False: 547k]
  ------------------
  547|  5.47M|                weights[spin] -= minweight;       // subtract minweight
  548|       |                // to avoid numerical problems with large exponents
  549|  5.47M|                weights[spin] = exp(-beta * weights[spin]);
  550|  5.47M|                norm += weights[spin];
  551|  5.47M|            }   // for spin
  552|       |
  553|       |            //now choose a new spin
  554|   547k|            r = RNG_UNIF(0, norm);
  ------------------
  |  |  154|   547k|#define RNG_UNIF(l,h)    (igraph_rng_get_unif(igraph_rng_default(),(l),(h)))
  ------------------
  555|   547k|            new_spin = 1;
  556|  2.98M|            while (new_spin <= q) {
  ------------------
  |  Branch (556:20): [True: 2.98M, False: 0]
  ------------------
  557|  2.98M|                if (r <= weights[new_spin]) {
  ------------------
  |  Branch (557:21): [True: 547k, False: 2.44M]
  ------------------
  558|   547k|                    spin_opt = new_spin;
  559|   547k|                    break;
  560|  2.44M|                } else {
  561|  2.44M|                    r -= weights[new_spin];
  562|  2.44M|                }
  563|  2.44M|                new_spin++;
  564|  2.44M|            }
  565|       |            //Put new spin on list
  566|   547k|            *SPIN = spin_opt;
  567|       |
  568|   547k|            node = net_iter.Next();
  569|   547k|            SPIN = i_iter.Next();
  570|   547k|        } // while !net_iter.End()
  571|       |
  572|       |        //-------------------------------
  573|       |        //now update all spins
  574|  61.6k|        node = net_iter.First(&net->node_list);
  575|  61.6k|        SPIN = i_iter.First(&new_spins);
  576|  61.6k|        P_SPIN = i_iter2.First(&previous_spins);
  577|   609k|        while (!net_iter.End()) {
  ------------------
  |  Branch (577:16): [True: 547k, False: 61.6k]
  ------------------
  578|   547k|            old_spin = node->Get_ClusterIndex();
  579|   547k|            new_spin = *SPIN;
  580|   547k|            if (new_spin != old_spin) { // Did we really change something??
  ------------------
  |  Branch (580:17): [True: 459k, False: 88.8k]
  ------------------
  581|   459k|                changes++;
  582|   459k|                node->Set_ClusterIndex(new_spin);
  583|   459k|                if (new_spin != *P_SPIN) {
  ------------------
  |  Branch (583:21): [True: 385k, False: 73.7k]
  ------------------
  584|   385k|                    cyclic = false;
  585|   385k|                }
  586|   459k|                *P_SPIN = old_spin;
  587|   459k|                color_field[old_spin] -= delta;
  588|   459k|                color_field[new_spin] += delta;
  589|       |
  590|       |                //Qmatrix update
  591|       |                //iteration over all neighbours
  592|   459k|                l_cur = l_iter.First(node->Get_Links());
  593|  1.57M|                while (!l_iter.End()) {
  ------------------
  |  Branch (593:24): [True: 1.12M, False: 459k]
  ------------------
  594|  1.12M|                    w = l_cur->Get_Weight();
  595|  1.12M|                    if (node == l_cur->Get_Start()) {
  ------------------
  |  Branch (595:25): [True: 624k, False: 495k]
  ------------------
  596|   624k|                        n_cur = l_cur->Get_End();
  597|   624k|                    } else {
  598|   495k|                        n_cur = l_cur->Get_Start();
  599|   495k|                    }
  600|  1.12M|                    Qmatrix[old_spin][n_cur->Get_ClusterIndex()] -= w;
  601|  1.12M|                    Qmatrix[new_spin][n_cur->Get_ClusterIndex()] += w;
  602|  1.12M|                    Qmatrix[n_cur->Get_ClusterIndex()][old_spin] -= w;
  603|  1.12M|                    Qmatrix[n_cur->Get_ClusterIndex()][new_spin] += w;
  604|  1.12M|                    Qa[old_spin] -= w;
  605|  1.12M|                    Qa[new_spin] += w;
  606|  1.12M|                    l_cur = l_iter.Next();
  607|  1.12M|                }  // while l_iter
  608|   459k|            }
  609|   547k|            node = net_iter.Next();
  610|   547k|            SPIN = i_iter.Next();
  611|   547k|            P_SPIN = i_iter2.Next();
  612|   547k|        } // while (!net_iter.End())
  613|       |
  614|  61.6k|    }  // while markov
  615|  1.51k|    max_q = 0;
  616|  16.7k|    for (igraph_int_t i = 1; i <= q; i++) if (color_field[i] > max_q) {
  ------------------
  |  Branch (616:30): [True: 15.1k, False: 1.51k]
  |  Branch (616:47): [True: 3.93k, False: 11.2k]
  ------------------
  617|  3.93k|            max_q = igraph_int_t(color_field[i]);
  618|  3.93k|        }
  619|       |
  620|       |    //again, we would not like to end up in cyclic attractors
  621|  1.51k|    if (cyclic && changes)  {
  ------------------
  |  Branch (621:9): [True: 498, False: 1.02k]
  |  Branch (621:19): [True: 43, False: 455]
  ------------------
  622|     43|        acceptance = double(changes) / double(number_of_nodes);
  623|     43|        return 0;
  624|  1.47k|    } else {
  625|  1.47k|        acceptance = double(changes) / double(number_of_nodes);
  626|  1.47k|        return changes;
  627|  1.47k|    }
  628|  1.51k|}
_ZN10PottsModel14HeatBathLookupEdddj:
  633|   181k|double PottsModel::HeatBathLookup(double gamma, double prob, double kT, unsigned int max_sweeps) {
  634|   181k|    DLList_Iter<NLink*> l_iter;
  635|   181k|    NNode *node, *n_cur;
  636|   181k|    NLink *l_cur;
  637|   181k|    igraph_int_t new_spin, spin_opt, old_spin;
  638|   181k|    unsigned int sweep;
  639|   181k|    igraph_int_t max_q;
  640|   181k|    igraph_int_t rn;
  641|   181k|    igraph_int_t changes;
  642|   181k|    double degree, w, delta = 0, h;
  643|   181k|    double norm, r, beta, minweight, prefac = 0;
  644|   181k|    igraph_int_t number_of_nodes;
  645|   181k|    sweep = 0;
  646|   181k|    changes = 0;
  647|   181k|    number_of_nodes = net->node_list.Size();
  648|  9.23M|    while (sweep < max_sweeps) {
  ------------------
  |  Branch (648:12): [True: 9.05M, False: 181k]
  ------------------
  649|  9.05M|        sweep++;
  650|       |        //loop over all nodes in network
  651|   129M|        for (igraph_int_t n = 0; n < number_of_nodes; n++) {
  ------------------
  |  Branch (651:34): [True: 120M, False: 9.05M]
  ------------------
  652|   120M|            rn = RNG_INTEGER(0, number_of_nodes - 1);
  ------------------
  |  |  152|   120M|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  653|       |
  654|   120M|            node = net->node_list.Get(rn);
  655|       |            // initialize the neighbours and the weights
  656|  1.44G|            for (igraph_int_t i = 0; i <= q; i++) {
  ------------------
  |  Branch (656:38): [True: 1.32G, False: 120M]
  ------------------
  657|  1.32G|                neighbours[i] = 0.0;
  658|  1.32G|                weights[i] = 0.0;
  659|  1.32G|            }
  660|   120M|            norm = 0.0;
  661|   120M|            degree = node->Get_Weight();
  662|       |            //Loop over all links (=neighbours)
  663|   120M|            l_cur = l_iter.First(node->Get_Links());
  664|   464M|            while (!l_iter.End()) {
  ------------------
  |  Branch (664:20): [True: 343M, False: 120M]
  ------------------
  665|   343M|                w = l_cur->Get_Weight();
  666|   343M|                if (node == l_cur->Get_Start()) {
  ------------------
  |  Branch (666:21): [True: 171M, False: 171M]
  ------------------
  667|   171M|                    n_cur = l_cur->Get_End();
  668|   171M|                } else {
  669|   171M|                    n_cur = l_cur->Get_Start();
  670|   171M|                }
  671|   343M|                neighbours[n_cur->Get_ClusterIndex()] += w;
  672|   343M|                l_cur = l_iter.Next();
  673|   343M|            }
  674|       |
  675|       |            //Look for optimal spin
  676|       |
  677|   120M|            old_spin = node->Get_ClusterIndex();
  678|   120M|            switch (operation_mode) {
  679|      0|            case 0: {
  ------------------
  |  Branch (679:13): [True: 0, False: 120M]
  ------------------
  680|      0|                prefac = 1.0;
  681|      0|                delta = 1.0;
  682|      0|                break;
  683|      0|            }
  684|   120M|            case 1:  {//newman modularity
  ------------------
  |  Branch (684:13): [True: 120M, False: 0]
  ------------------
  685|   120M|                prefac = 1.0;
  686|   120M|                prob = degree / total_degree_sum;
  687|   120M|                delta = degree;
  688|   120M|                break;
  689|      0|            }
  690|      0|            default:
  ------------------
  |  Branch (690:13): [True: 0, False: 120M]
  ------------------
  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|   120M|            }
  693|   120M|            spin_opt = old_spin;
  694|   120M|            beta = 1.0 / kT * prefac;
  695|   120M|            minweight = 0.0;
  696|   120M|            weights[old_spin] = 0.0;
  697|  1.32G|            for (igraph_int_t spin = 1; spin <= q; spin++) { // all possible new spins
  ------------------
  |  Branch (697:41): [True: 1.20G, False: 120M]
  ------------------
  698|  1.20G|                if (spin != old_spin) { // except the old one!
  ------------------
  |  Branch (698:21): [True: 1.08G, False: 120M]
  ------------------
  699|  1.08G|                    h = color_field[spin] - (color_field[old_spin] - delta);
  700|  1.08G|                    weights[spin] = neighbours[old_spin] - neighbours[spin] + gamma * prob * h;
  701|  1.08G|                    if (weights[spin] < minweight) {
  ------------------
  |  Branch (701:25): [True: 92.8M, False: 991M]
  ------------------
  702|  92.8M|                        minweight = weights[spin];
  703|  92.8M|                    }
  704|  1.08G|                }
  705|  1.20G|            }   // for spin
  706|  1.32G|            for (igraph_int_t spin = 1; spin <= q; spin++) { // all possible new spins
  ------------------
  |  Branch (706:41): [True: 1.20G, False: 120M]
  ------------------
  707|  1.20G|                weights[spin] -= minweight;       // subtract minweigt
  708|       |                // for numerical stability
  709|  1.20G|                weights[spin] = exp(-beta * weights[spin]);
  710|  1.20G|                norm += weights[spin];
  711|  1.20G|            }   // for spin
  712|       |
  713|       |
  714|       |            //choose a new spin
  715|   120M|            r = RNG_UNIF(0, norm);
  ------------------
  |  |  154|   120M|#define RNG_UNIF(l,h)    (igraph_rng_get_unif(igraph_rng_default(),(l),(h)))
  ------------------
  716|   120M|            new_spin = 1;
  717|   654M|            while (new_spin <= q) {
  ------------------
  |  Branch (717:20): [True: 654M, False: 0]
  ------------------
  718|   654M|                if (r <= weights[new_spin]) {
  ------------------
  |  Branch (718:21): [True: 120M, False: 533M]
  ------------------
  719|   120M|                    spin_opt = new_spin;
  720|   120M|                    break;
  721|   533M|                } else {
  722|   533M|                    r -= weights[new_spin];
  723|   533M|                }
  724|   533M|                new_spin++;
  725|   533M|            }
  726|       |            //-------------------------------
  727|       |            //now set the new spin
  728|   120M|            new_spin = spin_opt;
  729|   120M|            if (new_spin != old_spin) { // Did we really change something??
  ------------------
  |  Branch (729:17): [True: 56.0M, False: 64.4M]
  ------------------
  730|  56.0M|                changes++;
  731|  56.0M|                node->Set_ClusterIndex(new_spin);
  732|  56.0M|                color_field[old_spin] -= delta;
  733|  56.0M|                color_field[new_spin] += delta;
  734|       |
  735|       |                //Qmatrix update
  736|       |                //iteration over all neighbours
  737|  56.0M|                l_cur = l_iter.First(node->Get_Links());
  738|   170M|                while (!l_iter.End()) {
  ------------------
  |  Branch (738:24): [True: 114M, False: 56.0M]
  ------------------
  739|   114M|                    w = l_cur->Get_Weight();
  740|   114M|                    if (node == l_cur->Get_Start()) {
  ------------------
  |  Branch (740:25): [True: 66.3M, False: 47.8M]
  ------------------
  741|  66.3M|                        n_cur = l_cur->Get_End();
  742|  66.3M|                    } else {
  743|  47.8M|                        n_cur = l_cur->Get_Start();
  744|  47.8M|                    }
  745|   114M|                    Qmatrix[old_spin][n_cur->Get_ClusterIndex()] -= w;
  746|   114M|                    Qmatrix[new_spin][n_cur->Get_ClusterIndex()] += w;
  747|   114M|                    Qmatrix[n_cur->Get_ClusterIndex()][old_spin] -= w;
  748|   114M|                    Qmatrix[n_cur->Get_ClusterIndex()][new_spin] += w;
  749|   114M|                    Qa[old_spin] -= w;
  750|   114M|                    Qa[new_spin] += w;
  751|   114M|                    l_cur = l_iter.Next();
  752|   114M|                }  // while l_iter
  753|  56.0M|            }
  754|   120M|        } // for n
  755|  9.05M|    }  // while markov
  756|   181k|    max_q = 0;
  757|       |
  758|  1.99M|    for (igraph_int_t i = 1; i <= q; i++) if (color_field[i] > max_q) {
  ------------------
  |  Branch (758:30): [True: 1.81M, False: 181k]
  |  Branch (758:47): [True: 488k, False: 1.32M]
  ------------------
  759|   488k|            max_q = igraph_int_t(color_field[i] + 0.5);
  760|   488k|        }
  761|       |
  762|   181k|    acceptance = double(changes) / double(number_of_nodes) / double(sweep);
  763|   181k|    return acceptance;
  764|   181k|}
_ZNK10PottsModel13WriteClustersEPdS0_P19igraph_vector_int_tS2_dd:
  996|    463|                               double kT, double gamma) const {
  997|    463|    const NNode *n_cur, *n_cur2;
  998|    463|    DLList_Iter<NNode*> iter, iter2;
  999|    463|    HugeArray<int> inner_links;
 1000|    463|    HugeArray<int> outer_links;
 1001|    463|    HugeArray<int> nodes;
 1002|       |
 1003|    463|    if (temperature) {
  ------------------
  |  Branch (1003:9): [True: 0, False: 463]
  ------------------
 1004|      0|        *temperature = kT;
 1005|      0|    }
 1006|       |
 1007|    463|    if (csize || membership || modularity) {
  ------------------
  |  Branch (1007:9): [True: 0, False: 463]
  |  Branch (1007:18): [True: 463, False: 0]
  |  Branch (1007:32): [True: 0, False: 0]
  ------------------
 1008|       |        // TODO: count the number of clusters
 1009|  5.09k|        for (igraph_int_t spin = 1; spin <= q; spin++) {
  ------------------
  |  Branch (1009:37): [True: 4.63k, False: 463]
  ------------------
 1010|  4.63k|            inner_links[spin] = 0;
 1011|  4.63k|            outer_links[spin] = 0;
 1012|  4.63k|            nodes[spin] = 0;
 1013|  4.63k|            n_cur = iter.First(&net->node_list);
 1014|  58.0k|            while (!iter.End()) {
  ------------------
  |  Branch (1014:20): [True: 53.4k, False: 4.63k]
  ------------------
 1015|  53.4k|                if (n_cur->Get_ClusterIndex() == spin) {
  ------------------
  |  Branch (1015:21): [True: 5.34k, False: 48.0k]
  ------------------
 1016|  5.34k|                    nodes[spin]++;
 1017|  5.34k|                    n_cur2 = iter2.First(n_cur->Get_Neighbours());
 1018|  20.3k|                    while (!iter2.End()) {
  ------------------
  |  Branch (1018:28): [True: 15.0k, False: 5.34k]
  ------------------
 1019|  15.0k|                        if (n_cur2->Get_ClusterIndex() == spin) {
  ------------------
  |  Branch (1019:29): [True: 8.43k, False: 6.61k]
  ------------------
 1020|  8.43k|                            inner_links[spin]++;
 1021|  8.43k|                        } else {
 1022|  6.61k|                            outer_links[spin]++;
 1023|  6.61k|                        }
 1024|  15.0k|                        n_cur2 = iter2.Next();
 1025|  15.0k|                    }
 1026|  5.34k|                }
 1027|  53.4k|                n_cur = iter.Next();
 1028|  53.4k|            }
 1029|  4.63k|        }
 1030|    463|    }
 1031|    463|    if (modularity) {
  ------------------
  |  Branch (1031:9): [True: 463, False: 0]
  ------------------
 1032|    463|        *modularity = 0.0;
 1033|  5.09k|        for (igraph_int_t spin = 1; spin <= q; spin++) {
  ------------------
  |  Branch (1033:37): [True: 4.63k, False: 463]
  ------------------
 1034|  4.63k|            if (nodes[spin] > 0) {
  ------------------
  |  Branch (1034:17): [True: 1.29k, False: 3.33k]
  ------------------
 1035|  1.29k|                double t1 = inner_links[spin] / net->sum_weights / 2.0;
 1036|  1.29k|                double t2 = (inner_links[spin] + outer_links[spin]) /
 1037|  1.29k|                            net->sum_weights / 2.0;
 1038|  1.29k|                *modularity += t1;
 1039|  1.29k|                *modularity -= gamma * t2 * t2;
 1040|  1.29k|            }
 1041|  4.63k|        }
 1042|    463|    }
 1043|    463|    if (csize) {
  ------------------
  |  Branch (1043:9): [True: 0, False: 463]
  ------------------
 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|    463|    if (membership) {
  ------------------
  |  Branch (1054:9): [True: 463, False: 0]
  ------------------
 1055|    463|        igraph_int_t no = -1;
 1056|    463|        IGRAPH_CHECK(igraph_vector_int_resize(membership, num_of_nodes));
  ------------------
  |  |  656|    463|    do { \
  |  |  657|    463|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    463|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    463|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 463]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    463|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 463]
  |  |  ------------------
  ------------------
 1057|  5.09k|        for (igraph_int_t spin = 1; spin <= q; spin++) {
  ------------------
  |  Branch (1057:37): [True: 4.63k, False: 463]
  ------------------
 1058|  4.63k|            if (nodes[spin] > 0) {
  ------------------
  |  Branch (1058:17): [True: 1.29k, False: 3.33k]
  ------------------
 1059|  1.29k|                no++;
 1060|  1.29k|            }
 1061|  4.63k|            n_cur = iter.First(&net->node_list);
 1062|  58.0k|            while (!iter.End()) {
  ------------------
  |  Branch (1062:20): [True: 53.4k, False: 4.63k]
  ------------------
 1063|  53.4k|                if (n_cur->Get_ClusterIndex() == spin) {
  ------------------
  |  Branch (1063:21): [True: 5.34k, False: 48.0k]
  ------------------
 1064|  5.34k|                    VECTOR(*membership)[ n_cur->Get_Index() ] = no;
  ------------------
  |  |   60|  5.34k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1065|  5.34k|                }
 1066|  53.4k|                n_cur = iter.Next();
 1067|  53.4k|            }
 1068|  4.63k|        }
 1069|    463|    }
 1070|       |
 1071|    463|    return num_of_nodes;
 1072|    463|}

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

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

igraph_community_walktrap:
  136|  3.40k|                              igraph_vector_int_t *membership) {
  137|       |
  138|  3.40k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  139|  3.40k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  140|  3.40k|    igraph_int_t comp_count;
  141|  3.40k|    igraph_matrix_int_t imerges, *pmerges = merges;
  142|  3.40k|    igraph_vector_t imodularity, *pmodularity = modularity;
  143|       |
  144|  3.40k|    if (steps <= 0) {
  ------------------
  |  Branch (144:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    if (steps > INT_MAX) {
  ------------------
  |  Branch (148:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    int length = steps;
  153|       |
  154|  3.40k|    if (weights) {
  ------------------
  |  Branch (154:9): [True: 3.40k, False: 0]
  ------------------
  155|  3.40k|        if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (155:13): [True: 0, False: 3.40k]
  ------------------
  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.40k|        if (no_of_edges > 0) {
  ------------------
  |  Branch (159:13): [True: 3.35k, False: 43]
  ------------------
  160|  3.35k|            igraph_real_t minweight = igraph_vector_min(weights);
  161|  3.35k|            if (minweight < 0) {
  ------------------
  |  Branch (161:17): [True: 0, False: 3.35k]
  ------------------
  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.35k|            } else if (isnan(minweight)) {
  ------------------
  |  Branch (163:24): [True: 0, False: 3.35k]
  ------------------
  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.35k|        }
  167|  3.40k|    }
  168|       |
  169|  3.40k|    if (membership) {
  ------------------
  |  Branch (169:9): [True: 3.40k, 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.40k|        if (! modularity) {
  ------------------
  |  Branch (173:13): [True: 0, False: 3.40k]
  ------------------
  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.40k|        if (! merges) {
  ------------------
  |  Branch (178:13): [True: 0, False: 3.40k]
  ------------------
  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.40k|    }
  183|       |
  184|  6.80k|    IGRAPH_HANDLE_EXCEPTIONS(
  ------------------
  |  |   30|  3.40k|    IGRAPH_HANDLE_EXCEPTIONS_BEGIN; \
  |  |  ------------------
  |  |  |  |   21|  3.40k|    try {
  |  |  ------------------
  |  |   31|   315k|    code; \
  |  |  ------------------
  |  |  |  Branch (31:5): [Folded, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 3.40k]
  |  |  |  Branch (31:5): [Folded, False: 3.40k]
  |  |  |  Branch (31:5): [True: 3.40k, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 0]
  |  |  |  Branch (31:5): [Folded, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 3.40k]
  |  |  |  Branch (31:5): [Folded, False: 3.40k]
  |  |  |  Branch (31:5): [Folded, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 3.40k]
  |  |  |  Branch (31:5): [Folded, False: 3.40k]
  |  |  |  Branch (31:5): [True: 3.40k, False: 0]
  |  |  |  Branch (31:5): [Folded, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 3.40k]
  |  |  |  Branch (31:5): [Folded, False: 3.40k]
  |  |  |  Branch (31:5): [True: 3.40k, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 0]
  |  |  |  Branch (31:5): [True: 0, False: 40.6k]
  |  |  |  Branch (31:5): [Folded, False: 40.6k]
  |  |  |  Branch (31:5): [True: 40.6k, False: 3.40k]
  |  |  ------------------
  |  |   32|  3.40k|    IGRAPH_HANDLE_EXCEPTIONS_END;
  |  |  ------------------
  |  |  |  |   23|  3.40k|    } \
  |  |  |  |   24|  3.40k|    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.40k|    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.40k|    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.40k|    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|  6.80k|        Graph G;
  186|  6.80k|        IGRAPH_CHECK(G.convert_from_igraph(graph, weights));
  187|       |
  188|  6.80k|        if (pmerges || pmodularity) {
  189|  6.80k|            IGRAPH_CHECK(igraph_connected_components(graph, /*membership=*/ NULL, /*csize=*/ NULL,
  190|  6.80k|                                                     &comp_count, IGRAPH_WEAK));
  191|  6.80k|        }
  192|  6.80k|        if (pmerges) {
  193|  6.80k|            IGRAPH_CHECK(igraph_matrix_int_resize(pmerges, no_of_nodes - comp_count, 2));
  194|  6.80k|        }
  195|  6.80k|        if (pmodularity) {
  196|  6.80k|            IGRAPH_CHECK(igraph_vector_resize(pmodularity, no_of_nodes - comp_count + 1));
  197|  6.80k|            igraph_vector_null(pmodularity);
  198|  6.80k|        }
  199|  6.80k|        Communities C(&G, length, pmerges, pmodularity);
  200|       |
  201|  6.80k|        while (!C.H->is_empty()) {
  202|  6.80k|            IGRAPH_ALLOW_INTERRUPTION();
  203|  6.80k|            C.merge_nearest_communities();
  204|  6.80k|        }
  205|  6.80k|    );
  206|       |
  207|  6.80k|    if (membership) {
  ------------------
  |  Branch (207:9): [True: 3.40k, False: 0]
  ------------------
  208|  3.40k|        igraph_int_t m;
  209|  3.40k|        m = no_of_nodes > 0 ? igraph_vector_which_max(pmodularity) : 0;
  ------------------
  |  Branch (209:13): [True: 3.39k, False: 1]
  ------------------
  210|  3.40k|        IGRAPH_CHECK(igraph_community_to_membership(pmerges, no_of_nodes,
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  211|  3.40k|                    /*steps=*/ m,
  212|  3.40k|                    membership,
  213|  3.40k|                    /*csize=*/ NULL));
  214|       |
  215|  3.40k|        if (! merges) {
  ------------------
  |  Branch (215:13): [True: 0, False: 3.40k]
  ------------------
  216|      0|            igraph_matrix_int_destroy(&imerges);
  217|      0|            IGRAPH_FINALLY_CLEAN(1);
  218|      0|        }
  219|  3.40k|        if (! modularity) {
  ------------------
  |  Branch (219:13): [True: 0, False: 3.40k]
  ------------------
  220|      0|            igraph_vector_destroy(&imodularity);
  221|      0|            IGRAPH_FINALLY_CLEAN(1);
  222|      0|        }
  223|  3.40k|    }
  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.40k|    if (modularity && no_of_edges == 0) {
  ------------------
  |  Branch (228:9): [True: 3.40k, False: 0]
  |  Branch (228:23): [True: 43, False: 3.35k]
  ------------------
  229|     43|        VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |   60|     43|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*modularity)[0] = IGRAPH_NAN;
  ------------------
  |  |  138|     43|#define IGRAPH_NAN ((double)NAN)
  ------------------
  230|     43|    }
  231|       |
  232|  3.40k|    return IGRAPH_SUCCESS;
  233|  6.80k|}

_ZN6igraph8walktrap8NeighborC2Ev:
   76|   284k|Neighbor::Neighbor() {
   77|   284k|    next_community1 = nullptr;
   78|   284k|    previous_community1 = nullptr;
   79|   284k|    next_community2 = nullptr;
   80|   284k|    previous_community2 = nullptr;
   81|   284k|    heap_index = -1;
   82|   284k|}
_ZN6igraph8walktrap13ProbabilitiesD2Ev:
   84|  88.0k|Probabilities::~Probabilities() {
   85|  88.0k|    delete[] P;
   86|  88.0k|    delete[] vertices;
   87|  88.0k|}
_ZN6igraph8walktrap13ProbabilitiesC2Ei:
   89|  47.4k|Probabilities::Probabilities(int community) {
   90|  47.4k|    Graph* G = C->G;
   91|  47.4k|    int nb_vertices1 = 0;
   92|  47.4k|    int nb_vertices2 = 0;
   93|       |
   94|  47.4k|    double initial_proba = 1. / static_cast<double>(C->communities[community].size);
   95|  47.4k|    int last =  C->members[C->communities[community].last_member];
   96|  94.8k|    for (int m = C->communities[community].first_member; m != last; m = C->members[m]) {
  ------------------
  |  Branch (96:58): [True: 47.4k, False: 47.4k]
  ------------------
   97|  47.4k|        tmp_vector1[m] = initial_proba;
   98|  47.4k|        vertices1[nb_vertices1++] = m;
   99|  47.4k|    }
  100|       |
  101|   189k|    for (int t = 0; t < length; t++) {
  ------------------
  |  Branch (101:21): [True: 142k, False: 47.4k]
  ------------------
  102|   142k|        current_id++;
  103|   142k|        if (nb_vertices1 > (G->nb_vertices / 2)) {
  ------------------
  |  Branch (103:13): [True: 9.16k, False: 133k]
  ------------------
  104|  9.16k|            nb_vertices2 = G->nb_vertices;
  105|   380k|            for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (105:29): [True: 371k, False: 9.16k]
  ------------------
  106|   371k|                tmp_vector2[i] = 0.;
  107|   371k|            }
  108|  9.16k|            if (nb_vertices1 == G->nb_vertices) {
  ------------------
  |  Branch (108:17): [True: 2.45k, False: 6.71k]
  ------------------
  109|  40.2k|                for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (109:33): [True: 37.7k, False: 2.45k]
  ------------------
  110|  37.7k|                    double proba = tmp_vector1[i] / G->vertices[i].total_weight;
  111|   154k|                    for (int j = 0; j < G->vertices[i].degree; j++) {
  ------------------
  |  Branch (111:37): [True: 116k, False: 37.7k]
  ------------------
  112|   116k|                        tmp_vector2[G->vertices[i].edges[j].neighbor] += proba * G->vertices[i].edges[j].weight;
  113|   116k|                    }
  114|  37.7k|                }
  115|  6.71k|            } else {
  116|   230k|                for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (116:33): [True: 224k, False: 6.71k]
  ------------------
  117|   224k|                    int v1 = vertices1[i];
  118|   224k|                    double proba = tmp_vector1[v1] / G->vertices[v1].total_weight;
  119|  1.30M|                    for (int j = 0; j < G->vertices[v1].degree; j++) {
  ------------------
  |  Branch (119:37): [True: 1.08M, False: 224k]
  ------------------
  120|  1.08M|                        tmp_vector2[G->vertices[v1].edges[j].neighbor] += proba * G->vertices[v1].edges[j].weight;
  121|  1.08M|                    }
  122|   224k|                }
  123|  6.71k|            }
  124|   133k|        } else {
  125|   133k|            nb_vertices2 = 0;
  126|   708k|            for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (126:29): [True: 575k, False: 133k]
  ------------------
  127|   575k|                int v1 = vertices1[i];
  128|   575k|                double proba = tmp_vector1[v1] / G->vertices[v1].total_weight;
  129|  3.23M|                for (int j = 0; j < G->vertices[v1].degree; j++) {
  ------------------
  |  Branch (129:33): [True: 2.65M, False: 575k]
  ------------------
  130|  2.65M|                    int v2 = G->vertices[v1].edges[j].neighbor;
  131|  2.65M|                    if (id[v2] == current_id) {
  ------------------
  |  Branch (131:25): [True: 1.29M, False: 1.36M]
  ------------------
  132|  1.29M|                        tmp_vector2[v2] += proba * G->vertices[v1].edges[j].weight;
  133|  1.36M|                    } else {
  134|  1.36M|                        tmp_vector2[v2] = proba * G->vertices[v1].edges[j].weight;
  135|  1.36M|                        id[v2] = current_id;
  136|  1.36M|                        vertices2[nb_vertices2++] = v2;
  137|  1.36M|                    }
  138|  2.65M|                }
  139|   575k|            }
  140|   133k|        }
  141|   142k|        double* tmp = tmp_vector2;
  142|   142k|        tmp_vector2 = tmp_vector1;
  143|   142k|        tmp_vector1 = tmp;
  144|       |
  145|   142k|        int* tmp2 = vertices2;
  146|   142k|        vertices2 = vertices1;
  147|   142k|        vertices1 = tmp2;
  148|       |
  149|   142k|        nb_vertices1 = nb_vertices2;
  150|   142k|    }
  151|       |
  152|  47.4k|    if (nb_vertices1 > (G->nb_vertices / 2)) {
  ------------------
  |  Branch (152:9): [True: 13.0k, False: 34.4k]
  ------------------
  153|  13.0k|        P = new double[G->nb_vertices];
  154|  13.0k|        size = G->nb_vertices;
  155|  13.0k|        vertices = nullptr;
  156|  13.0k|        if (nb_vertices1 == G->nb_vertices) {
  ------------------
  |  Branch (156:13): [True: 7.92k, False: 5.09k]
  ------------------
  157|   368k|            for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (157:29): [True: 360k, False: 7.92k]
  ------------------
  158|   360k|                P[i] = tmp_vector1[i] / sqrt(G->vertices[i].total_weight);
  159|   360k|            }
  160|  7.92k|        } else {
  161|   303k|            for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (161:29): [True: 298k, False: 5.09k]
  ------------------
  162|   298k|                P[i] = 0.;
  163|   298k|            }
  164|   204k|            for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (164:29): [True: 198k, False: 5.09k]
  ------------------
  165|   198k|                P[vertices1[i]] = tmp_vector1[vertices1[i]] / sqrt(G->vertices[vertices1[i]].total_weight);
  166|   198k|            }
  167|  5.09k|        }
  168|  34.4k|    } else {
  169|  34.4k|        P = new double[nb_vertices1];
  170|  34.4k|        size = nb_vertices1;
  171|  34.4k|        vertices = new int[nb_vertices1];
  172|  34.4k|        int j = 0;
  173|  2.02M|        for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (173:25): [True: 1.99M, False: 34.4k]
  ------------------
  174|  1.99M|            if (id[i] == current_id) {
  ------------------
  |  Branch (174:17): [True: 384k, False: 1.60M]
  ------------------
  175|   384k|                P[j] = tmp_vector1[i] / sqrt(G->vertices[i].total_weight);
  176|   384k|                vertices[j] = i;
  177|   384k|                j++;
  178|   384k|            }
  179|  1.99M|        }
  180|  34.4k|    }
  181|  47.4k|}
_ZN6igraph8walktrap13ProbabilitiesC2Eii:
  183|  40.6k|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|  40.6k|    Probabilities* P1 = C->communities[community1].P;
  187|  40.6k|    Probabilities* P2 = C->communities[community2].P;
  188|       |
  189|  40.6k|    double w1 = C->communities[community1].size / static_cast<double>(C->communities[community1].size + C->communities[community2].size);
  190|  40.6k|    double w2 = C->communities[community2].size / static_cast<double>(C->communities[community1].size + C->communities[community2].size);
  191|       |
  192|       |
  193|  40.6k|    if (P1->size == C->G->nb_vertices) {
  ------------------
  |  Branch (193:9): [True: 12.8k, False: 27.7k]
  ------------------
  194|  12.8k|        P = new double[C->G->nb_vertices];
  195|  12.8k|        size = C->G->nb_vertices;
  196|  12.8k|        vertices = nullptr;
  197|       |
  198|  12.8k|        if (P2->size == C->G->nb_vertices) { // two full vectors
  ------------------
  |  Branch (198:13): [True: 12.2k, False: 632]
  ------------------
  199|   656k|            for (int i = 0; i < C->G->nb_vertices; i++) {
  ------------------
  |  Branch (199:29): [True: 644k, False: 12.2k]
  ------------------
  200|   644k|                P[i] = P1->P[i] * w1 + P2->P[i] * w2;
  201|   644k|            }
  202|  12.2k|        } else { // P1 full vector, P2 partial vector
  203|    632|            int j = 0;
  204|  12.8k|            for (int i = 0; i < P2->size; i++) {
  ------------------
  |  Branch (204:29): [True: 12.2k, False: 632]
  ------------------
  205|  31.6k|                for (; j < P2->vertices[i]; j++) {
  ------------------
  |  Branch (205:24): [True: 19.4k, False: 12.2k]
  ------------------
  206|  19.4k|                    P[j] = P1->P[j] * w1;
  207|  19.4k|                }
  208|  12.2k|                P[j] = P1->P[j] * w1 + P2->P[i] * w2;
  209|  12.2k|                j++;
  210|  12.2k|            }
  211|  2.40k|            for (; j < C->G->nb_vertices; j++) {
  ------------------
  |  Branch (211:20): [True: 1.77k, False: 632]
  ------------------
  212|  1.77k|                P[j] = P1->P[j] * w1;
  213|  1.77k|            }
  214|    632|        }
  215|  27.7k|    } else {
  216|  27.7k|        if (P2->size == C->G->nb_vertices) { // P1 partial vector, P2 full vector
  ------------------
  |  Branch (216:13): [True: 2.98k, False: 24.7k]
  ------------------
  217|  2.98k|            P = new double[C->G->nb_vertices];
  218|  2.98k|            size = C->G->nb_vertices;
  219|  2.98k|            vertices = nullptr;
  220|       |
  221|  2.98k|            int j = 0;
  222|  65.8k|            for (int i = 0; i < P1->size; i++) {
  ------------------
  |  Branch (222:29): [True: 62.8k, False: 2.98k]
  ------------------
  223|   161k|                for (; j < P1->vertices[i]; j++) {
  ------------------
  |  Branch (223:24): [True: 98.6k, False: 62.8k]
  ------------------
  224|  98.6k|                    P[j] = P2->P[j] * w2;
  225|  98.6k|                }
  226|  62.8k|                P[j] = P1->P[i] * w1 + P2->P[j] * w2;
  227|  62.8k|                j++;
  228|  62.8k|            }
  229|  11.8k|            for (; j < C->G->nb_vertices; j++) {
  ------------------
  |  Branch (229:20): [True: 8.89k, False: 2.98k]
  ------------------
  230|  8.89k|                P[j] = P2->P[j] * w2;
  231|  8.89k|            }
  232|  24.7k|        } else { // two partial vectors
  233|  24.7k|            int i = 0;
  234|  24.7k|            int j = 0;
  235|  24.7k|            int nb_vertices1 = 0;
  236|   341k|            while ((i < P1->size) && (j < P2->size)) {
  ------------------
  |  Branch (236:20): [True: 317k, False: 23.8k]
  |  Branch (236:38): [True: 316k, False: 902]
  ------------------
  237|   316k|                if (P1->vertices[i] < P2->vertices[j]) {
  ------------------
  |  Branch (237:21): [True: 12.1k, False: 304k]
  ------------------
  238|  12.1k|                    tmp_vector1[P1->vertices[i]] = P1->P[i] * w1;
  239|  12.1k|                    vertices1[nb_vertices1++] = P1->vertices[i];
  240|  12.1k|                    i++;
  241|  12.1k|                    continue;
  242|  12.1k|                }
  243|   304k|                if (P1->vertices[i] > P2->vertices[j]) {
  ------------------
  |  Branch (243:21): [True: 29.5k, False: 275k]
  ------------------
  244|  29.5k|                    tmp_vector1[P2->vertices[j]] = P2->P[j] * w2;
  245|  29.5k|                    vertices1[nb_vertices1++] = P2->vertices[j];
  246|  29.5k|                    j++;
  247|  29.5k|                    continue;
  248|  29.5k|                }
  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|  24.7k|            if (i == P1->size) {
  ------------------
  |  Branch (254:17): [True: 23.8k, False: 902]
  ------------------
  255|  27.9k|                for (; j < P2->size; j++) {
  ------------------
  |  Branch (255:24): [True: 4.07k, False: 23.8k]
  ------------------
  256|  4.07k|                    tmp_vector1[P2->vertices[j]] = P2->P[j] * w2;
  257|  4.07k|                    vertices1[nb_vertices1++] = P2->vertices[j];
  258|  4.07k|                }
  259|  23.8k|            } else {
  260|  2.49k|                for (; i < P1->size; i++) {
  ------------------
  |  Branch (260:24): [True: 1.59k, False: 902]
  ------------------
  261|  1.59k|                    tmp_vector1[P1->vertices[i]] = P1->P[i] * w1;
  262|  1.59k|                    vertices1[nb_vertices1++] = P1->vertices[i];
  263|  1.59k|                }
  264|    902|            }
  265|       |
  266|  24.7k|            if (nb_vertices1 > (C->G->nb_vertices / 2)) {
  ------------------
  |  Branch (266:17): [True: 188, False: 24.6k]
  ------------------
  267|    188|                P = new double[C->G->nb_vertices];
  268|    188|                size = C->G->nb_vertices;
  269|    188|                vertices = nullptr;
  270|  11.1k|                for (int i = 0; i < C->G->nb_vertices; i++) {
  ------------------
  |  Branch (270:33): [True: 11.0k, False: 188]
  ------------------
  271|  11.0k|                    P[i] = 0.;
  272|  11.0k|                }
  273|  6.06k|                for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (273:33): [True: 5.87k, False: 188]
  ------------------
  274|  5.87k|                    P[vertices1[i]] = tmp_vector1[vertices1[i]];
  275|  5.87k|                }
  276|  24.6k|            } else {
  277|  24.6k|                P = new double[nb_vertices1];
  278|  24.6k|                size = nb_vertices1;
  279|  24.6k|                vertices = new int[nb_vertices1];
  280|   341k|                for (int i = 0; i < nb_vertices1; i++) {
  ------------------
  |  Branch (280:33): [True: 316k, False: 24.6k]
  ------------------
  281|   316k|                    vertices[i] = vertices1[i];
  282|   316k|                    P[i] = tmp_vector1[vertices1[i]];
  283|   316k|                }
  284|  24.6k|            }
  285|  24.7k|        }
  286|  27.7k|    }
  287|  40.6k|}
_ZNK6igraph8walktrap13Probabilities16compute_distanceEPKS1_:
  289|   135k|double Probabilities::compute_distance(const Probabilities* P2) const {
  290|   135k|    double r = 0.0;
  291|   135k|    if (vertices) {
  ------------------
  |  Branch (291:9): [True: 76.8k, False: 58.1k]
  ------------------
  292|  76.8k|        if (P2->vertices) { // two partial vectors
  ------------------
  |  Branch (292:13): [True: 67.9k, False: 8.91k]
  ------------------
  293|  67.9k|            int i = 0;
  294|  67.9k|            int j = 0;
  295|  1.14M|            while ((i < size) && (j < P2->size)) {
  ------------------
  |  Branch (295:20): [True: 1.07M, False: 65.3k]
  |  Branch (295:34): [True: 1.07M, False: 2.58k]
  ------------------
  296|  1.07M|                if (vertices[i] < P2->vertices[j]) {
  ------------------
  |  Branch (296:21): [True: 35.8k, False: 1.03M]
  ------------------
  297|  35.8k|                    r += P[i] * P[i];
  298|  35.8k|                    i++;
  299|  35.8k|                    continue;
  300|  35.8k|                }
  301|  1.03M|                if (vertices[i] > P2->vertices[j]) {
  ------------------
  |  Branch (301:21): [True: 68.7k, False: 971k]
  ------------------
  302|  68.7k|                    r += P2->P[j] * P2->P[j];
  303|  68.7k|                    j++;
  304|  68.7k|                    continue;
  305|  68.7k|                }
  306|   971k|                r += (P[i] - P2->P[j]) * (P[i] - P2->P[j]);
  307|   971k|                i++;
  308|   971k|                j++;
  309|   971k|            }
  310|  67.9k|            if (i == size) {
  ------------------
  |  Branch (310:17): [True: 65.3k, False: 2.58k]
  ------------------
  311|  74.7k|                for (; j < P2->size; j++) {
  ------------------
  |  Branch (311:24): [True: 9.32k, False: 65.3k]
  ------------------
  312|  9.32k|                    r += P2->P[j] * P2->P[j];
  313|  9.32k|                }
  314|  65.3k|            } else {
  315|  6.87k|                for (; i < size; i++) {
  ------------------
  |  Branch (315:24): [True: 4.29k, False: 2.58k]
  ------------------
  316|  4.29k|                    r += P[i] * P[i];
  317|  4.29k|                }
  318|  2.58k|            }
  319|  67.9k|        } else { // P1 partial vector, P2 full vector
  320|       |
  321|  8.91k|            int i = 0;
  322|   212k|            for (int j = 0; j < size; j++) {
  ------------------
  |  Branch (322:29): [True: 203k, False: 8.91k]
  ------------------
  323|   499k|                for (; i < vertices[j]; i++) {
  ------------------
  |  Branch (323:24): [True: 295k, False: 203k]
  ------------------
  324|   295k|                    r += P2->P[i] * P2->P[i];
  325|   295k|                }
  326|   203k|                r += (P[j] - P2->P[i]) * (P[j] - P2->P[i]);
  327|   203k|                i++;
  328|   203k|            }
  329|  32.1k|            for (; i < P2->size; i++) {
  ------------------
  |  Branch (329:20): [True: 23.2k, False: 8.91k]
  ------------------
  330|  23.2k|                r += P2->P[i] * P2->P[i];
  331|  23.2k|            }
  332|  8.91k|        }
  333|  76.8k|    } else {
  334|  58.1k|        if (P2->vertices) { // P1 full vector, P2 partial vector
  ------------------
  |  Branch (334:13): [True: 2.83k, False: 55.3k]
  ------------------
  335|  2.83k|            int i = 0;
  336|  68.8k|            for (int j = 0; j < P2->size; j++) {
  ------------------
  |  Branch (336:29): [True: 65.9k, False: 2.83k]
  ------------------
  337|   153k|                for (; i < P2->vertices[j]; i++) {
  ------------------
  |  Branch (337:24): [True: 87.1k, False: 65.9k]
  ------------------
  338|  87.1k|                    r += P[i] * P[i];
  339|  87.1k|                }
  340|  65.9k|                r += (P[i] - P2->P[j]) * (P[i] - P2->P[j]);
  341|  65.9k|                i++;
  342|  65.9k|            }
  343|  9.62k|            for (; i < size; i++) {
  ------------------
  |  Branch (343:20): [True: 6.79k, False: 2.83k]
  ------------------
  344|  6.79k|                r += P[i] * P[i];
  345|  6.79k|            }
  346|  55.3k|        } else { // two full vectors
  347|  3.25M|            for (int i = 0; i < size; i++) {
  ------------------
  |  Branch (347:29): [True: 3.19M, False: 55.3k]
  ------------------
  348|  3.19M|                r += (P[i] - P2->P[i]) * (P[i] - P2->P[i]);
  349|  3.19M|            }
  350|  55.3k|        }
  351|  58.1k|    }
  352|   135k|    return r;
  353|   135k|}
_ZN6igraph8walktrap9CommunityC2Ev:
  355|   304k|Community::Community() {
  356|   304k|    P = nullptr;
  357|   304k|    first_neighbor = nullptr;
  358|   304k|    last_neighbor = nullptr;
  359|   304k|    sub_community_of = -1;
  360|   304k|    sub_communities[0] = -1;
  361|   304k|    sub_communities[1] = -1;
  362|   304k|    sigma = 0.;
  363|   304k|    internal_weight = 0.;
  364|   304k|    total_weight = 0.;
  365|   304k|}
_ZN6igraph8walktrap9CommunityD2Ev:
  367|   304k|Community::~Community() {
  368|   304k|    delete P;
  369|   304k|}
_ZN6igraph8walktrap11CommunitiesC2EPNS0_5GraphEiP19igraph_matrix_int_tP15igraph_vector_t:
  374|  3.40k|                         igraph_vector_t *pmodularity) {
  375|  3.40k|    G = graph;
  376|  3.40k|    merges = pmerges;
  377|  3.40k|    mergeidx = 0;
  378|  3.40k|    modularity = pmodularity;
  379|       |
  380|  3.40k|    Probabilities::C = this;
  381|  3.40k|    Probabilities::length = random_walks_length;
  382|  3.40k|    Probabilities::tmp_vector1 = new double[G->nb_vertices];
  383|  3.40k|    Probabilities::tmp_vector2 = new double[G->nb_vertices];
  384|  3.40k|    Probabilities::id = new int[G->nb_vertices];
  385|   155k|    for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (385:21): [True: 152k, False: 3.40k]
  ------------------
  386|   152k|        Probabilities::id[i] = 0;
  387|   152k|    }
  388|  3.40k|    Probabilities::vertices1 = new int[G->nb_vertices];
  389|  3.40k|    Probabilities::vertices2 = new int[G->nb_vertices];
  390|  3.40k|    Probabilities::current_id = 0;
  391|       |
  392|  3.40k|    members = new int[G->nb_vertices];
  393|   155k|    for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (393:21): [True: 152k, False: 3.40k]
  ------------------
  394|   152k|        members[i] = -1;
  395|   152k|    }
  396|       |
  397|  3.40k|    H = new Neighbor_heap(G->nb_edges);
  398|  3.40k|    IGRAPH_ASSUME(G->nb_vertices >= 0); // avoid false-positive GCC warnings
  ------------------
  |  |   56|  3.40k|#    define IGRAPH_ASSUME(expr) __builtin_assume(expr)
  ------------------
  399|  3.40k|    communities = new Community[2 * G->nb_vertices];
  400|       |
  401|       |    // init the n single vertex communities
  402|       |
  403|   155k|    for (int i = 0; i < G->nb_vertices; i++) {
  ------------------
  |  Branch (403:21): [True: 152k, False: 3.40k]
  ------------------
  404|   152k|        communities[i].this_community = i;
  405|   152k|        communities[i].first_member = i;
  406|   152k|        communities[i].last_member = i;
  407|   152k|        communities[i].size = 1;
  408|   152k|        communities[i].sub_community_of = 0;
  409|   152k|    }
  410|       |
  411|  3.40k|    nb_communities = G->nb_vertices;
  412|  3.40k|    nb_active_communities = G->nb_vertices;
  413|       |
  414|   155k|    for (int i = 0; i < G->nb_vertices; i++)
  ------------------
  |  Branch (414:21): [True: 152k, False: 3.40k]
  ------------------
  415|   412k|        for (int j = 0; j < G->vertices[i].degree; j++)
  ------------------
  |  Branch (415:25): [True: 259k, False: 152k]
  ------------------
  416|   259k|            if (i < G->vertices[i].edges[j].neighbor) {
  ------------------
  |  Branch (416:17): [True: 53.8k, False: 206k]
  ------------------
  417|  53.8k|                communities[i].total_weight += G->vertices[i].edges[j].weight / 2.;
  418|  53.8k|                communities[G->vertices[i].edges[j].neighbor].total_weight += G->vertices[i].edges[j].weight / 2.;
  419|  53.8k|                Neighbor* N = new Neighbor;
  420|  53.8k|                N->community1 = i;
  421|  53.8k|                N->community2 = G->vertices[i].edges[j].neighbor;
  422|  53.8k|                N->delta_sigma = -1. / double(min(G->vertices[i].degree,  G->vertices[G->vertices[i].edges[j].neighbor].degree));
  423|  53.8k|                N->weight = G->vertices[i].edges[j].weight;
  424|  53.8k|                N->exact = false;
  425|  53.8k|                add_neighbor(N);
  426|  53.8k|            }
  427|       |
  428|       |    /*   int c = 0; */
  429|  3.40k|    Neighbor* N = H->get_first();
  430|  3.40k|    if (N == nullptr) {
  ------------------
  |  Branch (430:9): [True: 97, False: 3.30k]
  ------------------
  431|     97|        return;    /* this can happen if there are no edges */
  432|     97|    }
  433|  57.1k|    while (!N->exact) {
  ------------------
  |  Branch (433:12): [True: 53.8k, False: 3.30k]
  ------------------
  434|  53.8k|        update_neighbor(N, compute_delta_sigma(N->community1, N->community2));
  435|  53.8k|        N->exact = true;
  436|  53.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|  53.8k|    }
  446|       |
  447|  3.30k|    if (modularity) {
  ------------------
  |  Branch (447:9): [True: 3.30k, False: 0]
  ------------------
  448|  3.30k|        double Q = 0.0;
  449|   152k|        for (int i = 0; i < nb_communities; i++) {
  ------------------
  |  Branch (449:25): [True: 149k, False: 3.30k]
  ------------------
  450|   149k|            if (communities[i].sub_community_of == 0) {
  ------------------
  |  Branch (450:17): [True: 149k, False: 0]
  ------------------
  451|   149k|                Q += (communities[i].internal_weight - communities[i].total_weight * communities[i].total_weight / G->total_weight);
  452|   149k|            }
  453|   149k|        }
  454|  3.30k|        Q /= G->total_weight;
  455|  3.30k|        VECTOR(*modularity)[mergeidx] = Q;
  ------------------
  |  |   60|  3.30k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  456|  3.30k|    }
  457|  3.30k|}
_ZN6igraph8walktrap11CommunitiesD2Ev:
  459|  3.40k|Communities::~Communities() {
  460|  3.40k|    delete[] members;
  461|  3.40k|    delete[] communities;
  462|  3.40k|    delete H;
  463|       |
  464|  3.40k|    delete[] Probabilities::tmp_vector1;
  465|  3.40k|    delete[] Probabilities::tmp_vector2;
  466|  3.40k|    delete[] Probabilities::id;
  467|  3.40k|    delete[] Probabilities::vertices1;
  468|  3.40k|    delete[] Probabilities::vertices2;
  469|  3.40k|}
_ZN6igraph8walktrap9Community12add_neighborEPNS0_8NeighborE:
  471|   569k|void Community::add_neighbor(Neighbor* N) { // add a new neighbor at the end of the list
  472|   569k|    if (last_neighbor) {
  ------------------
  |  Branch (472:9): [True: 340k, False: 229k]
  ------------------
  473|   340k|        if (last_neighbor->community1 == this_community) {
  ------------------
  |  Branch (473:13): [True: 89.3k, False: 250k]
  ------------------
  474|  89.3k|            last_neighbor->next_community1 = N;
  475|   250k|        } else {
  476|   250k|            last_neighbor->next_community2 = N;
  477|   250k|        }
  478|       |
  479|   340k|        if (N->community1 == this_community) {
  ------------------
  |  Branch (479:13): [True: 122k, False: 217k]
  ------------------
  480|   122k|            N->previous_community1 = last_neighbor;
  481|   217k|        } else {
  482|   217k|            N->previous_community2 = last_neighbor;
  483|   217k|        }
  484|   340k|    } else {
  485|   229k|        first_neighbor = N;
  486|   229k|        if (N->community1 == this_community) {
  ------------------
  |  Branch (486:13): [True: 161k, False: 67.8k]
  ------------------
  487|   161k|            N->previous_community1 = nullptr;
  488|   161k|        } else {
  489|  67.8k|            N->previous_community2 = nullptr;
  490|  67.8k|        }
  491|   229k|    }
  492|   569k|    last_neighbor = N;
  493|   569k|}
_ZN6igraph8walktrap9Community15remove_neighborEPNS0_8NeighborE:
  495|   569k|void Community::remove_neighbor(Neighbor* N) {  // remove a neighbor from the list
  496|   569k|    if (N->community1 == this_community) {
  ------------------
  |  Branch (496:9): [True: 284k, False: 284k]
  ------------------
  497|   284k|        if (N->next_community1) {
  ------------------
  |  Branch (497:13): [True: 68.6k, False: 216k]
  ------------------
  498|       |//      if (N->next_community1->community1 == this_community)
  499|  68.6k|            N->next_community1->previous_community1 = N->previous_community1;
  500|       |//      else
  501|       |//  N->next_community1->previous_community2 = N->previous_community1;
  502|   216k|        } else {
  503|   216k|            last_neighbor = N->previous_community1;
  504|   216k|        }
  505|   284k|        if (N->previous_community1) {
  ------------------
  |  Branch (505:13): [True: 56.5k, False: 228k]
  ------------------
  506|  56.5k|            if (N->previous_community1->community1 == this_community) {
  ------------------
  |  Branch (506:17): [True: 35.7k, False: 20.7k]
  ------------------
  507|  35.7k|                N->previous_community1->next_community1 = N->next_community1;
  508|  35.7k|            } else {
  509|  20.7k|                N->previous_community1->next_community2 = N->next_community1;
  510|  20.7k|            }
  511|   228k|        } else {
  512|   228k|            first_neighbor = N->next_community1;
  513|   228k|        }
  514|   284k|    } else {
  515|   284k|        if (N->next_community2) {
  ------------------
  |  Branch (515:13): [True: 228k, False: 56.1k]
  ------------------
  516|   228k|            if (N->next_community2->community1 == this_community) {
  ------------------
  |  Branch (516:17): [True: 28.1k, False: 200k]
  ------------------
  517|  28.1k|                N->next_community2->previous_community1 = N->previous_community2;
  518|   200k|            } else {
  519|   200k|                N->next_community2->previous_community2 = N->previous_community2;
  520|   200k|            }
  521|   228k|        } else {
  522|  56.1k|            last_neighbor = N->previous_community2;
  523|  56.1k|        }
  524|   284k|        if (N->previous_community2) {
  ------------------
  |  Branch (524:13): [True: 47.6k, False: 237k]
  ------------------
  525|       |//      if (N->previous_community2->community1 == this_community)
  526|       |//  N->previous_community2->next_community1 = N->next_community2;
  527|       |//      else
  528|  47.6k|            N->previous_community2->next_community2 = N->next_community2;
  529|   237k|        } else {
  530|   237k|            first_neighbor = N->next_community2;
  531|   237k|        }
  532|   284k|    }
  533|   569k|}
_ZN6igraph8walktrap11Communities15remove_neighborEPNS0_8NeighborE:
  535|   284k|void Communities::remove_neighbor(Neighbor* N) {
  536|   284k|    communities[N->community1].remove_neighbor(N);
  537|   284k|    communities[N->community2].remove_neighbor(N);
  538|   284k|    H->remove(N);
  539|   284k|}
_ZN6igraph8walktrap11Communities12add_neighborEPNS0_8NeighborE:
  541|   284k|void Communities::add_neighbor(Neighbor* N) {
  542|   284k|    communities[N->community1].add_neighbor(N);
  543|   284k|    communities[N->community2].add_neighbor(N);
  544|   284k|    H->add(N);
  545|   284k|}
_ZN6igraph8walktrap11Communities15update_neighborEPNS0_8NeighborEd:
  547|   135k|void Communities::update_neighbor(Neighbor* N, double new_delta_sigma) {
  548|   135k|    N->delta_sigma = new_delta_sigma;
  549|   135k|    H->update(N);
  550|   135k|}
_ZN6igraph8walktrap11Communities17merge_communitiesEPNS0_8NeighborE:
  552|  40.6k|void Communities::merge_communities(Neighbor* merge_N) {
  553|  40.6k|    int c1 = merge_N->community1;
  554|  40.6k|    int c2 = merge_N->community2;
  555|       |
  556|  40.6k|    communities[nb_communities].first_member = communities[c1].first_member;  // merge the
  557|  40.6k|    communities[nb_communities].last_member = communities[c2].last_member;    // two lists
  558|  40.6k|    members[communities[c1].last_member] = communities[c2].first_member;      // of members
  559|       |
  560|  40.6k|    communities[nb_communities].size = communities[c1].size + communities[c2].size;
  561|  40.6k|    communities[nb_communities].this_community = nb_communities;
  562|  40.6k|    communities[nb_communities].sub_community_of = 0;
  563|  40.6k|    communities[nb_communities].sub_communities[0] = c1;
  564|  40.6k|    communities[nb_communities].sub_communities[1] = c2;
  565|  40.6k|    communities[nb_communities].total_weight = communities[c1].total_weight + communities[c2].total_weight;
  566|  40.6k|    communities[nb_communities].internal_weight = communities[c1].internal_weight + communities[c2].internal_weight + merge_N->weight;
  567|  40.6k|    communities[nb_communities].sigma = communities[c1].sigma + communities[c2].sigma + merge_N->delta_sigma;
  568|       |
  569|  40.6k|    communities[c1].sub_community_of = nb_communities;
  570|  40.6k|    communities[c2].sub_community_of = nb_communities;
  571|       |
  572|       |// update the new probability vector...
  573|       |
  574|  40.6k|    if (communities[c1].P && communities[c2].P) {
  ------------------
  |  Branch (574:9): [True: 40.6k, False: 0]
  |  Branch (574:30): [True: 40.6k, False: 0]
  ------------------
  575|  40.6k|        communities[nb_communities].P = new Probabilities(c1, c2);
  576|  40.6k|    }
  577|       |
  578|  40.6k|    if (communities[c1].P) {
  ------------------
  |  Branch (578:9): [True: 40.6k, False: 0]
  ------------------
  579|  40.6k|        delete communities[c1].P;
  580|  40.6k|        communities[c1].P = nullptr;
  581|  40.6k|    }
  582|  40.6k|    if (communities[c2].P) {
  ------------------
  |  Branch (582:9): [True: 40.6k, False: 0]
  ------------------
  583|  40.6k|        delete communities[c2].P;
  584|  40.6k|        communities[c2].P = nullptr;
  585|  40.6k|    }
  586|       |
  587|       |// update the new neighbors
  588|       |// by enumerating all the neighbors of c1 and c2
  589|       |
  590|  40.6k|    Neighbor* N1 = communities[c1].first_neighbor;
  591|  40.6k|    Neighbor* N2 = communities[c2].first_neighbor;
  592|       |
  593|   101k|    while (N1 && N2) {
  ------------------
  |  Branch (593:12): [True: 67.9k, False: 33.9k]
  |  Branch (593:18): [True: 61.2k, False: 6.69k]
  ------------------
  594|  61.2k|        int neighbor_community1;
  595|  61.2k|        int neighbor_community2;
  596|       |
  597|  61.2k|        if (N1->community1 == c1) {
  ------------------
  |  Branch (597:13): [True: 44.8k, False: 16.4k]
  ------------------
  598|  44.8k|            neighbor_community1 = N1->community2;
  599|  44.8k|        } else {
  600|  16.4k|            neighbor_community1 = N1->community1;
  601|  16.4k|        }
  602|  61.2k|        if (N2->community1 == c2) {
  ------------------
  |  Branch (602:13): [True: 19.7k, False: 41.4k]
  ------------------
  603|  19.7k|            neighbor_community2 = N2->community2;
  604|  41.4k|        } else {
  605|  41.4k|            neighbor_community2 = N2->community1;
  606|  41.4k|        }
  607|       |
  608|  61.2k|        if (neighbor_community1 < neighbor_community2) {
  ------------------
  |  Branch (608:13): [True: 17.1k, False: 44.1k]
  ------------------
  609|  17.1k|            Neighbor* tmp = N1;
  610|  17.1k|            if (N1->community1 == c1) {
  ------------------
  |  Branch (610:17): [True: 10.7k, False: 6.37k]
  ------------------
  611|  10.7k|                N1 = N1->next_community1;
  612|  10.7k|            } else {
  613|  6.37k|                N1 = N1->next_community2;
  614|  6.37k|            }
  615|  17.1k|            remove_neighbor(tmp);
  616|  17.1k|            Neighbor* N = new Neighbor;
  617|  17.1k|            N->weight = tmp->weight;
  618|  17.1k|            N->community1 = neighbor_community1;
  619|  17.1k|            N->community2 = nb_communities;
  620|  17.1k|            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.1k|            N->exact = false;
  622|  17.1k|            delete tmp;
  623|  17.1k|            add_neighbor(N);
  624|  17.1k|        }
  625|       |
  626|  61.2k|        if (neighbor_community2 < neighbor_community1) {
  ------------------
  |  Branch (626:13): [True: 30.9k, False: 30.2k]
  ------------------
  627|  30.9k|            Neighbor* tmp = N2;
  628|  30.9k|            if (N2->community1 == c2) {
  ------------------
  |  Branch (628:17): [True: 4.87k, False: 26.1k]
  ------------------
  629|  4.87k|                N2 = N2->next_community1;
  630|  26.1k|            } else {
  631|  26.1k|                N2 = N2->next_community2;
  632|  26.1k|            }
  633|  30.9k|            remove_neighbor(tmp);
  634|  30.9k|            Neighbor* N = new Neighbor;
  635|  30.9k|            N->weight = tmp->weight;
  636|  30.9k|            N->community1 = neighbor_community2;
  637|  30.9k|            N->community2 = nb_communities;
  638|  30.9k|            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|  30.9k|            N->exact = false;
  640|  30.9k|            delete tmp;
  641|  30.9k|            add_neighbor(N);
  642|  30.9k|        }
  643|       |
  644|  61.2k|        if (neighbor_community1 == neighbor_community2) {
  ------------------
  |  Branch (644:13): [True: 13.1k, False: 48.1k]
  ------------------
  645|  13.1k|            Neighbor* tmp1 = N1;
  646|  13.1k|            Neighbor* tmp2 = N2;
  647|  13.1k|            bool exact = N1->exact && N2->exact;
  ------------------
  |  Branch (647:26): [True: 8.23k, False: 4.90k]
  |  Branch (647:39): [True: 5.03k, False: 3.19k]
  ------------------
  648|  13.1k|            if (N1->community1 == c1) {
  ------------------
  |  Branch (648:17): [True: 9.74k, False: 3.39k]
  ------------------
  649|  9.74k|                N1 = N1->next_community1;
  650|  9.74k|            } else {
  651|  3.39k|                N1 = N1->next_community2;
  652|  3.39k|            }
  653|  13.1k|            if (N2->community1 == c2) {
  ------------------
  |  Branch (653:17): [True: 5.85k, False: 7.28k]
  ------------------
  654|  5.85k|                N2 = N2->next_community1;
  655|  7.28k|            } else {
  656|  7.28k|                N2 = N2->next_community2;
  657|  7.28k|            }
  658|  13.1k|            remove_neighbor(tmp1);
  659|  13.1k|            remove_neighbor(tmp2);
  660|  13.1k|            Neighbor* N = new Neighbor;
  661|  13.1k|            N->weight = tmp1->weight + tmp2->weight;
  662|  13.1k|            N->community1 = neighbor_community1;
  663|  13.1k|            N->community2 = nb_communities;
  664|  13.1k|            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.1k|            N->exact = exact;
  666|  13.1k|            delete tmp1;
  667|  13.1k|            delete tmp2;
  668|  13.1k|            add_neighbor(N);
  669|  13.1k|        }
  670|  61.2k|    }
  671|       |
  672|       |
  673|  40.6k|    if (!N1) {
  ------------------
  |  Branch (673:9): [True: 33.9k, False: 6.69k]
  ------------------
  674|   184k|        while (N2) {
  ------------------
  |  Branch (674:16): [True: 150k, False: 33.9k]
  ------------------
  675|       |//      double delta_sigma2 = N2->delta_sigma;
  676|   150k|            int neighbor_community;
  677|   150k|            if (N2->community1 == c2) {
  ------------------
  |  Branch (677:17): [True: 11.6k, False: 138k]
  ------------------
  678|  11.6k|                neighbor_community = N2->community2;
  679|   138k|            } else {
  680|   138k|                neighbor_community = N2->community1;
  681|   138k|            }
  682|   150k|            Neighbor* tmp = N2;
  683|   150k|            if (N2->community1 == c2) {
  ------------------
  |  Branch (683:17): [True: 11.6k, False: 138k]
  ------------------
  684|  11.6k|                N2 = N2->next_community1;
  685|   138k|            } else {
  686|   138k|                N2 = N2->next_community2;
  687|   138k|            }
  688|   150k|            remove_neighbor(tmp);
  689|   150k|            Neighbor* N = new Neighbor;
  690|   150k|            N->weight = tmp->weight;
  691|   150k|            N->community1 = neighbor_community;
  692|   150k|            N->community2 = nb_communities;
  693|   150k|            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|   150k|            N->exact = false;
  695|   150k|            delete tmp;
  696|   150k|            add_neighbor(N);
  697|   150k|        }
  698|  33.9k|    }
  699|  40.6k|    if (!N2) {
  ------------------
  |  Branch (699:9): [True: 40.6k, False: 0]
  ------------------
  700|  60.4k|        while (N1) {
  ------------------
  |  Branch (700:16): [True: 19.7k, False: 40.6k]
  ------------------
  701|       |//      double delta_sigma1 = N1->delta_sigma;
  702|  19.7k|            int neighbor_community;
  703|  19.7k|            if (N1->community1 == c1) {
  ------------------
  |  Branch (703:17): [True: 17.3k, False: 2.40k]
  ------------------
  704|  17.3k|                neighbor_community = N1->community2;
  705|  17.3k|            } else {
  706|  2.40k|                neighbor_community = N1->community1;
  707|  2.40k|            }
  708|  19.7k|            Neighbor* tmp = N1;
  709|  19.7k|            if (N1->community1 == c1) {
  ------------------
  |  Branch (709:17): [True: 17.3k, False: 2.40k]
  ------------------
  710|  17.3k|                N1 = N1->next_community1;
  711|  17.3k|            } else {
  712|  2.40k|                N1 = N1->next_community2;
  713|  2.40k|            }
  714|  19.7k|            remove_neighbor(tmp);
  715|  19.7k|            Neighbor* N = new Neighbor;
  716|  19.7k|            N->weight = tmp->weight;
  717|  19.7k|            N->community1 = neighbor_community;
  718|  19.7k|            N->community2 = nb_communities;
  719|  19.7k|            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|  19.7k|            N->exact = false;
  721|  19.7k|            delete tmp;
  722|  19.7k|            add_neighbor(N);
  723|  19.7k|        }
  724|  40.6k|    }
  725|       |
  726|  40.6k|    nb_communities++;
  727|  40.6k|    nb_active_communities--;
  728|  40.6k|}
_ZN6igraph8walktrap11Communities25merge_nearest_communitiesEv:
  730|  40.6k|double Communities::merge_nearest_communities() {
  731|  40.6k|    Neighbor* N = H->get_first();
  732|   121k|    while (!N->exact) {
  ------------------
  |  Branch (732:12): [True: 81.2k, False: 40.6k]
  ------------------
  733|  81.2k|        update_neighbor(N, compute_delta_sigma(N->community1, N->community2));
  734|  81.2k|        N->exact = true;
  735|  81.2k|        N = H->get_first();
  736|  81.2k|    }
  737|       |
  738|  40.6k|    double d = N->delta_sigma;
  739|  40.6k|    remove_neighbor(N);
  740|       |
  741|  40.6k|    merge_communities(N);
  742|       |
  743|  40.6k|    if (merges) {
  ------------------
  |  Branch (743:9): [True: 40.6k, False: 0]
  ------------------
  744|  40.6k|        MATRIX(*merges, mergeidx, 0) = N->community1;
  ------------------
  |  |   83|  40.6k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  745|  40.6k|        MATRIX(*merges, mergeidx, 1) = N->community2;
  ------------------
  |  |   83|  40.6k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  746|  40.6k|    }
  747|       |
  748|  40.6k|    mergeidx++;
  749|       |
  750|  40.6k|    if (modularity) {
  ------------------
  |  Branch (750:9): [True: 40.6k, False: 0]
  ------------------
  751|  40.6k|        double Q = 0.0;
  752|  2.92M|        for (int i = 0; i < nb_communities; i++) {
  ------------------
  |  Branch (752:25): [True: 2.88M, False: 40.6k]
  ------------------
  753|  2.88M|            if (communities[i].sub_community_of == 0) {
  ------------------
  |  Branch (753:17): [True: 1.70M, False: 1.18M]
  ------------------
  754|  1.70M|                Q += (communities[i].internal_weight - communities[i].total_weight * communities[i].total_weight / G->total_weight);
  755|  1.70M|            }
  756|  2.88M|        }
  757|  40.6k|        Q /= G->total_weight;
  758|  40.6k|        VECTOR(*modularity)[mergeidx] = Q;
  ------------------
  |  |   60|  40.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  759|  40.6k|    }
  760|       |
  761|  40.6k|    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|  40.6k|    return d;
  771|  40.6k|}
_ZNK6igraph8walktrap11Communities19compute_delta_sigmaEii:
  773|   135k|double Communities::compute_delta_sigma(int community1, int community2) const {
  774|   135k|    if (!communities[community1].P) {
  ------------------
  |  Branch (774:9): [True: 18.0k, False: 117k]
  ------------------
  775|  18.0k|        communities[community1].P = new Probabilities(community1);
  776|  18.0k|    }
  777|   135k|    if (!communities[community2].P) {
  ------------------
  |  Branch (777:9): [True: 29.4k, False: 105k]
  ------------------
  778|  29.4k|        communities[community2].P = new Probabilities(community2);
  779|  29.4k|    }
  780|       |
  781|   135k|    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|   135k|}

_ZN6igraph8walktrapltERKNS0_4EdgeES3_:
   69|  1.08M|bool operator<(const Edge& E1, const Edge& E2) {
   70|  1.08M|    return (E1.neighbor < E2.neighbor);
   71|  1.08M|}
_ZN6igraph8walktrap6VertexC2Ev:
   74|   152k|Vertex::Vertex() {
   75|   152k|    degree = 0;
   76|   152k|    edges = nullptr;
   77|   152k|    total_weight = 0.;
   78|   152k|}
_ZN6igraph8walktrap6VertexD2Ev:
   80|   152k|Vertex::~Vertex() {
   81|   152k|    delete[] edges;
   82|   152k|}
_ZN6igraph8walktrap5GraphC2Ev:
   84|  3.40k|Graph::Graph() {
   85|  3.40k|    nb_vertices = 0;
   86|  3.40k|    nb_edges = 0;
   87|  3.40k|    vertices = nullptr;
   88|  3.40k|    total_weight = 0.;
   89|  3.40k|}
_ZN6igraph8walktrap5GraphD2Ev:
   91|  3.40k|Graph::~Graph () {
   92|  3.40k|    delete[] vertices;
   93|  3.40k|}
_ZN6igraph8walktrap9Edge_list3addEiid:
  120|  91.6k|void Edge_list::add(int v1, int v2, double w) {
  121|  91.6k|    if (size == size_max) {
  ------------------
  |  Branch (121:9): [True: 0, False: 91.6k]
  ------------------
  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|  91.6k|    V1[size] = v1;
  139|  91.6k|    V2[size] = v2;
  140|  91.6k|    W[size] = w;
  141|  91.6k|    size++;
  142|  91.6k|}
_ZN6igraph8walktrap5Graph19convert_from_igraphEPK8igraph_tPK15igraph_vector_t:
  145|  3.40k|                               const igraph_vector_t *weights) {
  146|  3.40k|    Graph &G = *this;
  147|       |
  148|  3.40k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  149|  3.40k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  150|       |
  151|       |    // Avoid warnings with GCC when compiling with LTO.
  152|  3.40k|    IGRAPH_ASSUME(no_of_nodes >= 0);
  ------------------
  |  |   56|  3.40k|#    define IGRAPH_ASSUME(expr) __builtin_assume(expr)
  ------------------
  153|  3.40k|    IGRAPH_ASSUME(no_of_edges >= 0);
  ------------------
  |  |   56|  3.40k|#    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.40k|    if (no_of_nodes > INT_MAX || no_of_edges > INT_MAX) {
  ------------------
  |  Branch (157:9): [True: 0, False: 3.40k]
  |  Branch (157:34): [True: 0, False: 3.40k]
  ------------------
  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.40k|    Edge_list EL;
  162|       |
  163|  95.0k|    for (igraph_int_t i = 0; i < no_of_edges; i++) {
  ------------------
  |  Branch (163:30): [True: 91.6k, False: 3.40k]
  ------------------
  164|  91.6k|        igraph_real_t w = weights ? VECTOR(*weights)[i] : 1.0;
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (164:27): [True: 91.6k, False: 0]
  ------------------
  165|  91.6k|        EL.add(IGRAPH_FROM(graph, i), IGRAPH_TO(graph, i), w);
  ------------------
  |  |  115|  91.6k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                      EL.add(IGRAPH_FROM(graph, i), IGRAPH_TO(graph, i), w);
  ------------------
  |  |  128|  91.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  166|  91.6k|    }
  167|       |
  168|  3.40k|    G.nb_vertices = no_of_nodes;
  169|  3.40k|    G.vertices = new Vertex[G.nb_vertices];
  170|  3.40k|    G.nb_edges = 0;
  171|  3.40k|    G.total_weight = 0.0;
  172|       |
  173|  95.0k|    for (int i = 0; i < EL.size; i++) {
  ------------------
  |  Branch (173:21): [True: 91.6k, False: 3.40k]
  ------------------
  174|  91.6k|        G.vertices[EL.V1[i]].degree++;
  175|  91.6k|        G.vertices[EL.V2[i]].degree++;
  176|  91.6k|        G.vertices[EL.V1[i]].total_weight += EL.W[i];
  177|  91.6k|        G.vertices[EL.V2[i]].total_weight += EL.W[i];
  178|  91.6k|        G.nb_edges++;
  179|  91.6k|        G.total_weight += EL.W[i];
  180|  91.6k|    }
  181|       |
  182|   155k|    for (int i = 0; i < G.nb_vertices; i++) {
  ------------------
  |  Branch (182:21): [True: 152k, False: 3.40k]
  ------------------
  183|   152k|        int deg = G.vertices[i].degree;
  184|   152k|        double w = (deg == 0) ? 1.0 : (G.vertices[i].total_weight / double(deg));
  ------------------
  |  Branch (184:20): [True: 104k, False: 47.5k]
  ------------------
  185|   152k|        G.vertices[i].edges = new Edge[deg + 1];
  186|   152k|        G.vertices[i].edges[0].neighbor = i;
  187|   152k|        G.vertices[i].edges[0].weight = w;
  188|   152k|        G.vertices[i].total_weight += w;
  189|   152k|        G.vertices[i].degree = 1;
  190|   152k|    }
  191|       |
  192|  95.0k|    for (int i = 0; i < EL.size; i++) {
  ------------------
  |  Branch (192:21): [True: 91.6k, False: 3.40k]
  ------------------
  193|  91.6k|        G.vertices[EL.V1[i]].edges[G.vertices[EL.V1[i]].degree].neighbor = EL.V2[i];
  194|  91.6k|        G.vertices[EL.V1[i]].edges[G.vertices[EL.V1[i]].degree].weight = EL.W[i];
  195|  91.6k|        G.vertices[EL.V1[i]].degree++;
  196|  91.6k|        G.vertices[EL.V2[i]].edges[G.vertices[EL.V2[i]].degree].neighbor = EL.V1[i];
  197|  91.6k|        G.vertices[EL.V2[i]].edges[G.vertices[EL.V2[i]].degree].weight = EL.W[i];
  198|  91.6k|        G.vertices[EL.V2[i]].degree++;
  199|  91.6k|    }
  200|       |
  201|   155k|    for (int i = 0; i < G.nb_vertices; i++) {
  ------------------
  |  Branch (201:21): [True: 152k, False: 3.40k]
  ------------------
  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|   152k|        if (G.vertices[i].total_weight == 0) {
  ------------------
  |  Branch (204:13): [True: 0, False: 152k]
  ------------------
  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|   152k|        sort(G.vertices[i].edges, G.vertices[i].edges + G.vertices[i].degree);
  210|   152k|    }
  211|       |
  212|   155k|    for (int i = 0; i < G.nb_vertices; i++) { // merge multi edges
  ------------------
  |  Branch (212:21): [True: 152k, False: 3.40k]
  ------------------
  213|   152k|        int a = 0;
  214|   335k|        for (int b = 1; b < G.vertices[i].degree; b++) {
  ------------------
  |  Branch (214:25): [True: 183k, False: 152k]
  ------------------
  215|   183k|            if (G.vertices[i].edges[b].neighbor == G.vertices[i].edges[a].neighbor) {
  ------------------
  |  Branch (215:17): [True: 75.7k, False: 107k]
  ------------------
  216|  75.7k|                G.vertices[i].edges[a].weight += G.vertices[i].edges[b].weight;
  217|   107k|            } else {
  218|   107k|                G.vertices[i].edges[++a] = G.vertices[i].edges[b];
  219|   107k|            }
  220|   183k|        }
  221|   152k|        G.vertices[i].degree = a + 1;
  222|   152k|    }
  223|       |
  224|  3.40k|    return IGRAPH_SUCCESS;
  225|  3.40k|}
_ZN6igraph8walktrap9Edge_listC2Ev:
  105|  3.40k|    Edge_list() {
  106|  3.40k|        size = 0;
  107|  3.40k|        size_max = 1024;
  108|  3.40k|        V1 = new int[1024];
  109|  3.40k|        V2 = new int[1024];
  110|  3.40k|        W = new double[1024];
  111|  3.40k|    }
_ZN6igraph8walktrap9Edge_listD2Ev:
  113|  3.40k|    ~Edge_list() {
  114|  3.40k|        delete[] V1;
  115|  3.40k|        delete[] V2;
  116|  3.40k|        delete[] W;
  117|  3.40k|    }

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

igraph_connected_components:
   85|  13.5k|) {
   86|  13.5k|    if (mode == IGRAPH_WEAK || !igraph_is_directed(graph)) {
  ------------------
  |  Branch (86:9): [True: 13.5k, False: 0]
  |  Branch (86:32): [True: 0, False: 0]
  ------------------
   87|  13.5k|        return igraph_i_connected_components_weak(graph, membership, csize, no);
   88|  13.5k|    } else if (mode == IGRAPH_STRONG) {
  ------------------
  |  Branch (88:16): [True: 0, False: 0]
  ------------------
   89|      0|        return igraph_i_connected_components_strong(graph, membership, csize, no);
   90|      0|    }
   91|       |
   92|      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]
  |  |  ------------------
  ------------------
   93|      0|}
igraph_is_connected:
  433|  3.86k|                        igraph_connectedness_t mode) {
  434|       |
  435|  3.86k|    igraph_cached_property_t prop;
  436|  3.86k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  437|  3.86k|    igraph_int_t no;
  438|       |
  439|  3.86k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (439:9): [True: 3.86k, False: 0]
  ------------------
  440|  3.86k|        mode = IGRAPH_WEAK;
  441|  3.86k|    }
  442|       |
  443|  3.86k|    switch (mode) {
  444|  3.86k|        case IGRAPH_WEAK:
  ------------------
  |  Branch (444:9): [True: 3.86k, False: 0]
  ------------------
  445|  3.86k|            prop = IGRAPH_PROP_IS_WEAKLY_CONNECTED;
  446|  3.86k|            break;
  447|       |
  448|      0|        case IGRAPH_STRONG:
  ------------------
  |  Branch (448:9): [True: 0, False: 3.86k]
  ------------------
  449|      0|            prop = IGRAPH_PROP_IS_STRONGLY_CONNECTED;
  450|      0|            break;
  451|       |
  452|      0|        default:
  ------------------
  |  Branch (452:9): [True: 0, False: 3.86k]
  ------------------
  453|      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]
  |  |  ------------------
  ------------------
  454|  3.86k|    }
  455|       |
  456|  3.86k|    IGRAPH_RETURN_IF_CACHED_BOOL(graph, prop, res);
  ------------------
  |  |   97|  3.86k|    do { \
  |  |   98|  3.86k|        if (igraph_i_property_cache_has((graphptr), (prop))) { \
  |  |  ------------------
  |  |  |  Branch (98:13): [True: 3.86k, False: 0]
  |  |  ------------------
  |  |   99|  3.86k|            *(resptr) = igraph_i_property_cache_get_bool((graphptr), (prop)); \
  |  |  100|  3.86k|            return IGRAPH_SUCCESS; \
  |  |  101|  3.86k|        } \
  |  |  102|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  457|       |
  458|      0|    if (no_of_nodes == 0) {
  ------------------
  |  Branch (458:9): [True: 0, False: 0]
  ------------------
  459|       |        /* Changed in igraph 0.9; see https://github.com/igraph/igraph/issues/1539
  460|       |         * for the reasoning behind the change */
  461|      0|        *res = false;
  462|      0|    } else if (no_of_nodes == 1) {
  ------------------
  |  Branch (462:16): [True: 0, False: 0]
  ------------------
  463|      0|        *res = true;
  464|      0|    } else if (mode == IGRAPH_WEAK) {
  ------------------
  |  Branch (464:16): [True: 0, False: 0]
  ------------------
  465|      0|        IGRAPH_CHECK(igraph_i_is_connected_weak(graph, res));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  466|      0|    } else {   /* mode == IGRAPH_STRONG */
  467|       |        /* A strongly connected graph has at least as many edges as vertices,
  468|       |         * except for the singleton graph, which is handled above. */
  469|      0|        if (igraph_ecount(graph) < no_of_nodes) {
  ------------------
  |  Branch (469:13): [True: 0, False: 0]
  ------------------
  470|      0|            *res = false;
  471|      0|        } else {
  472|      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]
  |  |  ------------------
  ------------------
  473|      0|            *res = (no == 1);
  474|      0|        }
  475|      0|    }
  476|       |
  477|       |    /* Cache updates are done in igraph_i_connected_components_strong() and
  478|       |     * igraph_i_is_connected_weak() because those might be called from other
  479|       |     * places and we want to make use of the caching if so */
  480|       |
  481|      0|    return IGRAPH_SUCCESS;
  482|      0|}
components.c:igraph_i_connected_components_weak:
   98|  13.5k|) {
   99|       |
  100|  13.5k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  101|  13.5k|    igraph_int_t no_of_components;
  102|  13.5k|    igraph_bitset_t already_added;
  103|  13.5k|    igraph_dqueue_int_t q = IGRAPH_DQUEUE_NULL;
  ------------------
  |  |   56|  13.5k|#define IGRAPH_DQUEUE_NULL { 0,0,0,0 }
  ------------------
  104|  13.5k|    igraph_vector_int_t neis = IGRAPH_VECTOR_NULL;
  ------------------
  |  |   99|  13.5k|    #define IGRAPH_VECTOR_NULL { 0,0,0 }
  ------------------
  105|       |
  106|       |    /* Memory for result, csize is dynamically allocated */
  107|  13.5k|    if (membership) {
  ------------------
  |  Branch (107:9): [True: 6.80k, False: 6.79k]
  ------------------
  108|  6.80k|        IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  109|  6.80k|    }
  110|  13.5k|    if (csize) {
  ------------------
  |  Branch (110:9): [True: 0, False: 13.5k]
  ------------------
  111|      0|        igraph_vector_int_clear(csize);
  112|      0|    }
  113|       |
  114|       |    /* Try to make use of cached information. */
  115|  13.5k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_IS_WEAKLY_CONNECTED) &&
  ------------------
  |  Branch (115:9): [True: 6.79k, False: 6.80k]
  ------------------
  116|  6.79k|        igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_IS_WEAKLY_CONNECTED)) {
  ------------------
  |  Branch (116:9): [True: 954, False: 5.84k]
  ------------------
  117|       |        /* If we know that the graph is weakly connected from the cache,
  118|       |         * we can return the result right away. We keep in mind that
  119|       |         * the null graph is considered disconnected, therefore any connected
  120|       |         * graph has precisely one component. */
  121|    954|        if (membership) {
  ------------------
  |  Branch (121:13): [True: 477, False: 477]
  ------------------
  122|       |            /* All vertices are members of the same component,
  123|       |             * component number 0. */
  124|    477|            igraph_vector_int_null(membership);
  125|    477|        }
  126|    954|        if (csize) {
  ------------------
  |  Branch (126:13): [True: 0, False: 954]
  ------------------
  127|       |            /* The size of the single component is the same as the vertex count. */
  128|      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]
  |  |  ------------------
  ------------------
  129|      0|        }
  130|    954|        if (no) {
  ------------------
  |  Branch (130:13): [True: 477, False: 477]
  ------------------
  131|       |            /* There is one component. */
  132|    477|            *no = 1;
  133|    477|        }
  134|    954|        return IGRAPH_SUCCESS;
  135|    954|    }
  136|       |
  137|  12.6k|    IGRAPH_BITSET_INIT_FINALLY(&already_added, no_of_nodes);
  ------------------
  |  |  259|  12.6k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  12.6k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  12.6k|    do { \
  |  |  |  |  657|  12.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  12.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  12.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.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|  12.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 12.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  12.6k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  12.6k|    do { \
  |  |  |  |  604|  12.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  12.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  12.6k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  12.6k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 12.6k]
  |  |  |  |  ------------------
  |  |  |  |  608|  12.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  12.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 12.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 12.6k]
  |  |  ------------------
  ------------------
  138|  12.6k|    IGRAPH_DQUEUE_INT_INIT_FINALLY(&q, no_of_nodes > 100000 ? 10000 : no_of_nodes / 10);
  ------------------
  |  |   61|  12.6k|    do { IGRAPH_CHECK(igraph_dqueue_int_init(q, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  12.6k|    do { \
  |  |  |  |  657|  25.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (657:40): [True: 0, False: 12.6k]
  |  |  |  |  ------------------
  |  |  |  |  658|  12.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  12.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.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|  12.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 12.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  12.6k|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, q); } while (0)
  |  |  ------------------
  |  |  |  |  603|  12.6k|    do { \
  |  |  |  |  604|  12.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  12.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  12.6k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  12.6k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 12.6k]
  |  |  |  |  ------------------
  |  |  |  |  608|  12.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  12.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 12.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:64): [Folded, False: 12.6k]
  |  |  ------------------
  ------------------
  139|  12.6k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&neis, 0);
  ------------------
  |  |  119|  12.6k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  12.6k|    do { \
  |  |  |  |  657|  12.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  12.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  12.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 12.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|  12.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 12.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  12.6k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  12.6k|    do { \
  |  |  |  |  604|  12.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  12.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  12.6k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  12.6k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 12.6k]
  |  |  |  |  ------------------
  |  |  |  |  608|  12.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  12.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 12.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 12.6k]
  |  |  ------------------
  ------------------
  140|       |
  141|       |    /* The algorithm */
  142|       |
  143|  12.6k|    no_of_components = 0;
  144|   610k|    for (igraph_int_t first_node = 0; first_node < no_of_nodes; ++first_node) {
  ------------------
  |  Branch (144:39): [True: 598k, False: 12.6k]
  ------------------
  145|   598k|        igraph_int_t act_component_size;
  146|       |
  147|   598k|        if (IGRAPH_BIT_TEST(already_added, first_node)) {
  ------------------
  |  |  142|   598k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   598k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   598k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   598k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   598k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   598k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (142:36): [True: 152k, False: 445k]
  |  |  ------------------
  ------------------
  148|   152k|            continue;
  149|   152k|        }
  150|   445k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|   445k|    do { \
  |  |   47|   445k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 445k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|   445k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 445k]
  |  |  ------------------
  ------------------
  151|       |
  152|   445k|        IGRAPH_BIT_SET(already_added, first_node);
  ------------------
  |  |  103|   445k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   445k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   445k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   445k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   445k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   445k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|   445k|        act_component_size = 1;
  154|   445k|        if (membership) {
  ------------------
  |  Branch (154:13): [True: 222k, False: 222k]
  ------------------
  155|   222k|            VECTOR(*membership)[first_node] = no_of_components;
  ------------------
  |  |   60|   222k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  156|   222k|        }
  157|   445k|        IGRAPH_CHECK(igraph_dqueue_int_push(&q, first_node));
  ------------------
  |  |  656|   445k|    do { \
  |  |  657|   445k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   445k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   445k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 445k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   445k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 445k]
  |  |  ------------------
  ------------------
  158|       |
  159|  1.04M|        while ( !igraph_dqueue_int_empty(&q) ) {
  ------------------
  |  Branch (159:17): [True: 598k, False: 445k]
  ------------------
  160|   598k|            igraph_int_t act_node = igraph_dqueue_int_pop(&q);
  161|   598k|            IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|   598k|    do { \
  |  |  657|   598k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   598k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   598k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 598k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   598k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 598k]
  |  |  ------------------
  ------------------
  162|   598k|                graph, &neis, act_node, IGRAPH_ALL, IGRAPH_NO_LOOPS, IGRAPH_MULTIPLE
  163|   598k|            ));
  164|   598k|            igraph_int_t nei_count = igraph_vector_int_size(&neis);
  165|  1.07M|            for (igraph_int_t i = 0; i < nei_count; i++) {
  ------------------
  |  Branch (165:38): [True: 481k, False: 598k]
  ------------------
  166|   481k|                igraph_int_t neighbor = VECTOR(neis)[i];
  ------------------
  |  |   60|   481k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  167|   481k|                if (IGRAPH_BIT_TEST(already_added, neighbor)) {
  ------------------
  |  |  142|   481k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   481k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   481k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   481k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   481k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   481k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (142:36): [True: 328k, False: 152k]
  |  |  ------------------
  ------------------
  168|   328k|                    continue;
  169|   328k|                }
  170|   152k|                IGRAPH_CHECK(igraph_dqueue_int_push(&q, neighbor));
  ------------------
  |  |  656|   152k|    do { \
  |  |  657|   152k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   152k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   152k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
  171|   152k|                IGRAPH_BIT_SET(already_added, neighbor);
  ------------------
  |  |  103|   152k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   152k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   152k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   152k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   152k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   152k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|   152k|                act_component_size++;
  173|   152k|                if (membership) {
  ------------------
  |  Branch (173:21): [True: 76.4k, False: 76.4k]
  ------------------
  174|  76.4k|                    VECTOR(*membership)[neighbor] = no_of_components;
  ------------------
  |  |   60|  76.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  175|  76.4k|                }
  176|   152k|            }
  177|   598k|        }
  178|       |
  179|   445k|        no_of_components++;
  180|   445k|        if (csize) {
  ------------------
  |  Branch (180:13): [True: 0, False: 445k]
  ------------------
  181|      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]
  |  |  ------------------
  ------------------
  182|      0|        }
  183|   445k|    }
  184|       |
  185|       |    /* Cleaning up */
  186|       |
  187|  12.6k|    if (no) {
  ------------------
  |  Branch (187:9): [True: 6.32k, False: 6.32k]
  ------------------
  188|  6.32k|        *no = no_of_components;
  189|  6.32k|    }
  190|       |
  191|       |    /* Clean up */
  192|  12.6k|    igraph_bitset_destroy(&already_added);
  193|  12.6k|    igraph_dqueue_int_destroy(&q);
  194|  12.6k|    igraph_vector_int_destroy(&neis);
  195|  12.6k|    IGRAPH_FINALLY_CLEAN(3);
  196|       |
  197|       |    /* Update cache */
  198|  12.6k|    igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_IS_WEAKLY_CONNECTED, no_of_components == 1);
  199|       |
  200|  12.6k|    return IGRAPH_SUCCESS;
  201|  12.6k|}

igraph_create:
   54|  34.6k|                             igraph_int_t n, igraph_bool_t directed) {
   55|  34.6k|    igraph_bool_t has_edges = igraph_vector_int_size(edges) > 0;
   56|  34.6k|    igraph_int_t max;
   57|       |
   58|  34.6k|    if (igraph_vector_int_size(edges) % 2 != 0) {
  ------------------
  |  Branch (58:9): [True: 0, False: 34.6k]
  ------------------
   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|  34.6k|    if (!igraph_vector_int_isininterval(edges, 0, IGRAPH_VCOUNT_MAX-1)) {
  ------------------
  |  |  100|  34.6k|#define IGRAPH_VCOUNT_MAX (IGRAPH_INTEGER_MAX-1)
  |  |  ------------------
  |  |  |  |   72|  34.6k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  |  |  ------------------
  ------------------
  |  Branch (61:9): [True: 0, False: 34.6k]
  ------------------
   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|  34.6k|    max = has_edges ? igraph_vector_int_max(edges) + 1 : 0;
  ------------------
  |  Branch (67:11): [True: 33.4k, False: 1.12k]
  ------------------
   68|       |
   69|  34.6k|    IGRAPH_CHECK(igraph_empty(graph, n, directed));
  ------------------
  |  |  656|  34.6k|    do { \
  |  |  657|  34.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  34.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  34.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 34.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|  34.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 34.6k]
  |  |  ------------------
  ------------------
   70|  34.6k|    IGRAPH_FINALLY(igraph_destroy, graph);
  ------------------
  |  |  603|  34.6k|    do { \
  |  |  604|  34.6k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  34.6k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  34.6k|         * incorrect destructor function with the pointer */ \
  |  |  607|  34.6k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 34.6k]
  |  |  ------------------
  |  |  608|  34.6k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  34.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 34.6k]
  |  |  ------------------
  ------------------
   71|  34.6k|    if (has_edges) {
  ------------------
  |  Branch (71:9): [True: 33.4k, False: 1.12k]
  ------------------
   72|  33.4k|        n = igraph_vcount(graph);
   73|  33.4k|        if (n < max) {
  ------------------
  |  Branch (73:13): [True: 2.92k, False: 30.5k]
  ------------------
   74|  2.92k|            IGRAPH_CHECK(igraph_add_vertices(graph, (max - n), 0));
  ------------------
  |  |  656|  2.92k|    do { \
  |  |  657|  2.92k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  2.92k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  2.92k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
   75|  2.92k|        }
   76|  33.4k|        IGRAPH_CHECK(igraph_add_edges(graph, edges, 0));
  ------------------
  |  |  656|  33.4k|    do { \
  |  |  657|  33.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  33.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  33.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 33.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|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
   77|  33.4k|    }
   78|       |
   79|  34.6k|    IGRAPH_FINALLY_CLEAN(1);
   80|  34.6k|    return IGRAPH_SUCCESS;
   81|  34.6k|}

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

igraph_dqueue_int_init:
   75|  38.9k|igraph_error_t FUNCTION(igraph_dqueue, init)(TYPE(igraph_dqueue)* q, igraph_int_t capacity) {
   76|  38.9k|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  38.9k|    do { \
  |  |  925|  38.9k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  38.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  38.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
   77|  38.9k|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|  38.9k|    do { \
  |  |  925|  38.9k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  38.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  38.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
   78|       |
   79|  38.9k|    if (capacity == 0) capacity = 1;
  ------------------
  |  Branch (79:9): [True: 1.41k, False: 37.5k]
  ------------------
   80|       |
   81|  38.9k|    q->stor_begin = IGRAPH_CALLOC(capacity, BASE);
  ------------------
  |  |   33|  38.9k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  77.8k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 38.9k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 38.9k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 38.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   82|  38.9k|    IGRAPH_CHECK_OOM(q->stor_begin, "Cannot initialize dqueue.");
  ------------------
  |  |  709|  38.9k|    do { \
  |  |  710|  38.9k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  38.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.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|  38.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
   83|  38.9k|    q->stor_end = q->stor_begin + capacity;
   84|  38.9k|    q->begin = q->stor_begin;
   85|  38.9k|    q->end = NULL;
   86|       |
   87|  38.9k|    return IGRAPH_SUCCESS;
   88|  38.9k|}
igraph_dqueue_int_destroy:
  100|  38.9k|void FUNCTION(igraph_dqueue, destroy)(TYPE(igraph_dqueue)* q) {
  101|  38.9k|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  38.9k|    do { \
  |  |  925|  38.9k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  38.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 38.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  38.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
  102|  38.9k|    IGRAPH_FREE(q->stor_begin); /* sets to NULL */
  ------------------
  |  |   36|  38.9k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  103|  38.9k|}
igraph_dqueue_int_empty:
  117|  22.3M|igraph_bool_t FUNCTION(igraph_dqueue, empty)(const TYPE(igraph_dqueue)* q) {
  118|  22.3M|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  22.3M|    do { \
  |  |  925|  22.3M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  22.3M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 22.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  22.3M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 22.3M]
  |  |  ------------------
  ------------------
  119|  22.3M|    IGRAPH_ASSERT(q->stor_begin != NULL);
  ------------------
  |  |  924|  22.3M|    do { \
  |  |  925|  22.3M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  22.3M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 22.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  22.3M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 22.3M]
  |  |  ------------------
  ------------------
  120|  22.3M|    return q->end == NULL;
  121|  22.3M|}
igraph_dqueue_int_pop:
  240|  17.0M|BASE FUNCTION(igraph_dqueue, pop)(TYPE(igraph_dqueue)* q) {
  241|  17.0M|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  17.0M|    do { \
  |  |  925|  17.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.0M]
  |  |  ------------------
  ------------------
  242|  17.0M|    IGRAPH_ASSERT(q->stor_begin != NULL);
  ------------------
  |  |  924|  17.0M|    do { \
  |  |  925|  17.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.0M]
  |  |  ------------------
  ------------------
  243|  17.0M|    IGRAPH_ASSERT(q->stor_end != NULL); /* queue is not empty */
  ------------------
  |  |  924|  17.0M|    do { \
  |  |  925|  17.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.0M]
  |  |  ------------------
  ------------------
  244|  17.0M|    BASE tmp = *(q->begin);
  ------------------
  |  |   66|  17.0M|    #define BASE igraph_int_t
  ------------------
  245|  17.0M|    (q->begin)++;
  246|  17.0M|    if (q->begin == q->stor_end) {
  ------------------
  |  Branch (246:9): [True: 261k, False: 16.8M]
  ------------------
  247|   261k|        q->begin = q->stor_begin;
  248|   261k|    }
  249|  17.0M|    if (q->begin == q->end) {
  ------------------
  |  Branch (249:9): [True: 6.79M, False: 10.2M]
  ------------------
  250|  6.79M|        q->end = NULL;
  251|  6.79M|    }
  252|       |
  253|  17.0M|    return tmp;
  254|  17.0M|}
igraph_dqueue_int_push:
  307|  17.0M|igraph_error_t FUNCTION(igraph_dqueue, push)(TYPE(igraph_dqueue)* q, BASE elem) {
  308|  17.0M|    IGRAPH_ASSERT(q != NULL);
  ------------------
  |  |  924|  17.0M|    do { \
  |  |  925|  17.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.0M]
  |  |  ------------------
  ------------------
  309|  17.0M|    IGRAPH_ASSERT(q->stor_begin != NULL);
  ------------------
  |  |  924|  17.0M|    do { \
  |  |  925|  17.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  17.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.0M]
  |  |  ------------------
  ------------------
  310|  17.0M|    if (q->begin != q->end) {
  ------------------
  |  Branch (310:9): [True: 17.0M, False: 10.7k]
  ------------------
  311|       |        /* not full */
  312|  17.0M|        if (q->end == NULL) {
  ------------------
  |  Branch (312:13): [True: 6.79M, False: 10.2M]
  ------------------
  313|  6.79M|            q->end = q->begin;
  314|  6.79M|        }
  315|  17.0M|        *(q->end) = elem;
  316|  17.0M|        (q->end)++;
  317|  17.0M|        if (q->end == q->stor_end) {
  ------------------
  |  Branch (317:13): [True: 271k, False: 16.8M]
  ------------------
  318|   271k|            q->end = q->stor_begin;
  319|   271k|        }
  320|  17.0M|    } else {
  321|       |        /* full, allocate more storage */
  322|       |
  323|  10.7k|        BASE *bigger = NULL, *old = q->stor_begin;
  ------------------
  |  |   66|  10.7k|    #define BASE igraph_int_t
  ------------------
  324|  10.7k|        igraph_int_t old_size = q->stor_end - q->stor_begin;
  325|  10.7k|        igraph_int_t new_capacity = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  10.7k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_capacity = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  10.7k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (325:37): [True: 10.7k, False: 0]
  ------------------
  326|       |
  327|  10.7k|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|  10.7k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (327:13): [True: 0, False: 10.7k]
  ------------------
  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|  10.7k|        if (new_capacity == 0) {
  ------------------
  |  Branch (330:13): [True: 0, False: 10.7k]
  ------------------
  331|      0|            new_capacity = 1;
  332|      0|        }
  333|       |
  334|  10.7k|        bigger = IGRAPH_CALLOC(new_capacity, BASE);
  ------------------
  |  |   33|  10.7k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  21.4k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 10.7k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 10.7k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 10.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  335|  10.7k|        IGRAPH_CHECK_OOM(bigger, "Cannot push to dqueue.");
  ------------------
  |  |  709|  10.7k|    do { \
  |  |  710|  10.7k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  10.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 10.7k]
  |  |  ------------------
  ------------------
  336|       |
  337|  10.7k|        if (q->stor_end - q->begin > 0) {
  ------------------
  |  Branch (337:13): [True: 10.7k, False: 0]
  ------------------
  338|  10.7k|            memcpy(bigger, q->begin,
  339|  10.7k|                   (size_t)(q->stor_end - q->begin) * sizeof(BASE));
  340|  10.7k|        }
  341|  10.7k|        if (q->end - q->stor_begin > 0) {
  ------------------
  |  Branch (341:13): [True: 5.14k, False: 5.57k]
  ------------------
  342|  5.14k|            memcpy(bigger + (q->stor_end - q->begin), q->stor_begin,
  343|  5.14k|                   (size_t)(q->end - q->stor_begin) * sizeof(BASE));
  344|  5.14k|        }
  345|       |
  346|  10.7k|        q->end        = bigger + old_size;
  347|  10.7k|        q->stor_end   = bigger + new_capacity;
  348|  10.7k|        q->stor_begin = bigger;
  349|  10.7k|        q->begin      = bigger;
  350|       |
  351|  10.7k|        *(q->end) = elem;
  352|  10.7k|        (q->end)++;
  353|  10.7k|        if (q->end == q->stor_end) {
  ------------------
  |  Branch (353:13): [True: 1.36k, False: 9.35k]
  ------------------
  354|  1.36k|            q->end = q->stor_begin;
  355|  1.36k|        }
  356|       |
  357|  10.7k|        IGRAPH_FREE(old);
  ------------------
  |  |   36|  10.7k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  358|  10.7k|    }
  359|       |
  360|  17.0M|    return IGRAPH_SUCCESS;
  361|  17.0M|}

IGRAPH_FINALLY_REAL:
  320|  6.03M|void IGRAPH_FINALLY_REAL(void (*func)(void*), void* ptr) {
  321|  6.03M|    int no = igraph_i_finally_stack_size;
  322|  6.03M|    if (no < 0) {
  ------------------
  |  Branch (322:9): [True: 0, False: 6.03M]
  ------------------
  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|  6.03M|    if (no >= (int) (sizeof(igraph_i_finally_stack) / sizeof(igraph_i_finally_stack[0]))) {
  ------------------
  |  Branch (327:9): [True: 0, False: 6.03M]
  ------------------
  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|  6.03M|    igraph_i_finally_stack[no].ptr = ptr;
  333|  6.03M|    igraph_i_finally_stack[no].func = func;
  334|  6.03M|    igraph_i_finally_stack[no].level = igraph_i_finally_stack_level;
  335|  6.03M|    igraph_i_finally_stack_size++;
  336|  6.03M|}
IGRAPH_FINALLY_CLEAN:
  338|  2.52M|void IGRAPH_FINALLY_CLEAN(int minus) {
  339|  2.52M|    igraph_i_finally_stack_size -= minus;
  340|  2.52M|    if (igraph_i_finally_stack_size < 0) {
  ------------------
  |  Branch (340:9): [True: 0, False: 2.52M]
  ------------------
  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|  2.52M|}
IGRAPH_FINALLY_STACK_SIZE:
  359|  3.43k|int IGRAPH_FINALLY_STACK_SIZE(void) {
  360|  3.43k|    return igraph_i_finally_stack_size;
  361|  3.43k|}
IGRAPH_FINALLY_ENTER:
  377|  84.5k|void IGRAPH_FINALLY_ENTER(void) {
  378|  84.5k|    int no = igraph_i_finally_stack_size;
  379|       |    /* Level indices must always be in increasing order in the finally stack */
  380|  84.5k|    if (no > 0 && igraph_i_finally_stack[no-1].level > igraph_i_finally_stack_level) {
  ------------------
  |  Branch (380:9): [True: 84.5k, False: 0]
  |  Branch (380:19): [True: 0, False: 84.5k]
  ------------------
  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|  84.5k|    igraph_i_finally_stack_level++;
  386|  84.5k|}
IGRAPH_FINALLY_EXIT:
  399|  84.5k|void IGRAPH_FINALLY_EXIT(void) {
  400|  84.5k|    igraph_i_finally_stack_level--;
  401|  84.5k|    if (igraph_i_finally_stack_level < 0) {
  ------------------
  |  Branch (401:9): [True: 0, False: 84.5k]
  ------------------
  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|  84.5k|}
igraph_set_warning_handler:
  514|  3.44k|igraph_warning_handler_t *igraph_set_warning_handler(igraph_warning_handler_t *new_handler) {
  515|  3.44k|    igraph_warning_handler_t *previous_handler = igraph_i_warning_handler;
  516|  3.44k|    igraph_i_warning_handler = new_handler;
  517|  3.44k|    return previous_handler;
  518|  3.44k|}

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

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

igraph_matrix_init:
   64|  3.40k|        TYPE(igraph_matrix) *m, igraph_int_t nrow, igraph_int_t ncol) {
   65|  3.40k|    igraph_int_t size;
   66|  3.40k|    IGRAPH_ASSERT(nrow >= 0 && ncol >= 0);
  ------------------
  |  |  924|  3.40k|    do { \
  |  |  925|  3.40k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  |  Branch (612:52): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 3.40k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
   67|  3.40k|    IGRAPH_SAFE_MULT(nrow, ncol, &size);
  ------------------
  |  |   57|  3.40k|    do { \
  |  |   58|  3.40k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  3.40k|        igraph_int_t _safe_prod; \
  |  |   60|  3.40k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 3.40k]
  |  |  ------------------
  |  |   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.40k|        *(res) = _safe_prod; \
  |  |   64|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
   68|  3.40k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(&m->data, size));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
   69|  3.40k|    m->nrow = nrow;
   70|  3.40k|    m->ncol = ncol;
   71|  3.40k|    return IGRAPH_SUCCESS;
   72|  3.40k|}
igraph_matrix_destroy:
  176|  3.40k|void FUNCTION(igraph_matrix, destroy)(TYPE(igraph_matrix) *m) {
  177|  3.40k|    FUNCTION(igraph_vector, destroy)(&m->data);
  ------------------
  |  |  170|  3.40k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.40k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.40k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|  3.40k|}
igraph_matrix_resize:
  229|  3.40k|igraph_error_t FUNCTION(igraph_matrix, resize)(TYPE(igraph_matrix) *m, igraph_int_t nrow, igraph_int_t ncol) {
  230|  3.40k|    igraph_int_t size;
  231|  3.40k|    IGRAPH_ASSERT(nrow >= 0 && ncol >= 0);
  ------------------
  |  |  924|  3.40k|    do { \
  |  |  925|  3.40k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  |  Branch (612:52): [True: 3.40k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 3.40k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  232|  3.40k|    IGRAPH_SAFE_MULT(nrow, ncol, &size);
  ------------------
  |  |   57|  3.40k|    do { \
  |  |   58|  3.40k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  3.40k|        igraph_int_t _safe_prod; \
  |  |   60|  3.40k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 3.40k]
  |  |  ------------------
  |  |   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.40k|        *(res) = _safe_prod; \
  |  |   64|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  233|  3.40k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(&m->data, size));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  234|  3.40k|    m->nrow = nrow;
  235|  3.40k|    m->ncol = ncol;
  236|  3.40k|    return IGRAPH_SUCCESS;
  237|  3.40k|}
igraph_matrix_null:
  380|  3.40k|void FUNCTION(igraph_matrix, null)(TYPE(igraph_matrix) *m) {
  381|  3.40k|    FUNCTION(igraph_vector, null)(&m->data);
  ------------------
  |  |  170|  3.40k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.40k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.40k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  382|  3.40k|}
igraph_matrix_int_init:
   64|  6.80k|        TYPE(igraph_matrix) *m, igraph_int_t nrow, igraph_int_t ncol) {
   65|  6.80k|    igraph_int_t size;
   66|  6.80k|    IGRAPH_ASSERT(nrow >= 0 && ncol >= 0);
  ------------------
  |  |  924|  6.80k|    do { \
  |  |  925|  6.80k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  13.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  |  Branch (612:52): [True: 6.80k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 6.80k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   67|  6.80k|    IGRAPH_SAFE_MULT(nrow, ncol, &size);
  ------------------
  |  |   57|  6.80k|    do { \
  |  |   58|  6.80k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  6.80k|        igraph_int_t _safe_prod; \
  |  |   60|  6.80k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 6.80k]
  |  |  ------------------
  |  |   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|  6.80k|        *(res) = _safe_prod; \
  |  |   64|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   68|  6.80k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(&m->data, size));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
   69|  6.80k|    m->nrow = nrow;
   70|  6.80k|    m->ncol = ncol;
   71|  6.80k|    return IGRAPH_SUCCESS;
   72|  6.80k|}
igraph_matrix_int_destroy:
  176|  6.80k|void FUNCTION(igraph_matrix, destroy)(TYPE(igraph_matrix) *m) {
  177|  6.80k|    FUNCTION(igraph_vector, destroy)(&m->data);
  ------------------
  |  |  178|  6.80k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.80k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.80k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|  6.80k|}
igraph_matrix_int_resize:
  229|  16.5k|igraph_error_t FUNCTION(igraph_matrix, resize)(TYPE(igraph_matrix) *m, igraph_int_t nrow, igraph_int_t ncol) {
  230|  16.5k|    igraph_int_t size;
  231|  16.5k|    IGRAPH_ASSERT(nrow >= 0 && ncol >= 0);
  ------------------
  |  |  924|  16.5k|    do { \
  |  |  925|  16.5k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  33.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.5k]
  |  |  |  |  |  Branch (612:52): [True: 16.5k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 16.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  16.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 16.5k]
  |  |  ------------------
  ------------------
  232|  16.5k|    IGRAPH_SAFE_MULT(nrow, ncol, &size);
  ------------------
  |  |   57|  16.5k|    do { \
  |  |   58|  16.5k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  16.5k|        igraph_int_t _safe_prod; \
  |  |   60|  16.5k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 16.5k]
  |  |  ------------------
  |  |   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|  16.5k|        *(res) = _safe_prod; \
  |  |   64|  16.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 16.5k]
  |  |  ------------------
  ------------------
  233|  16.5k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(&m->data, size));
  ------------------
  |  |  656|  16.5k|    do { \
  |  |  657|  16.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  16.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  16.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.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|  16.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 16.5k]
  |  |  ------------------
  ------------------
  234|  16.5k|    m->nrow = nrow;
  235|  16.5k|    m->ncol = ncol;
  236|  16.5k|    return IGRAPH_SUCCESS;
  237|  16.5k|}
igraph_matrix_int_nrow:
  285|  9.72k|igraph_int_t FUNCTION(igraph_matrix, nrow)(const TYPE(igraph_matrix) *m) {
  286|  9.72k|    return m->nrow;
  287|  9.72k|}
igraph_matrix_int_ncol:
  300|  6.80k|igraph_int_t FUNCTION(igraph_matrix, ncol)(const TYPE(igraph_matrix) *m) {
  301|  6.80k|    return m->ncol;
  302|  6.80k|}
igraph_matrix_int_null:
  380|  3.40k|void FUNCTION(igraph_matrix, null)(TYPE(igraph_matrix) *m) {
  381|  3.40k|    FUNCTION(igraph_vector, null)(&m->data);
  ------------------
  |  |  178|  3.40k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  3.40k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  3.40k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  382|  3.40k|}
igraph_matrix_int_add_rows:
  417|  4.13k|igraph_error_t FUNCTION(igraph_matrix, add_rows)(TYPE(igraph_matrix) *m, igraph_int_t n) {
  418|  4.13k|    igraph_int_t new_nrow, new_size;
  419|  4.13k|    IGRAPH_SAFE_ADD(m->nrow, n, &new_nrow);
  ------------------
  |  |   47|  4.13k|    do { \
  |  |   48|  4.13k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|  4.13k|        igraph_int_t _safe_sum; \
  |  |   50|  4.13k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 4.13k]
  |  |  ------------------
  |  |   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.13k|        *(res) = _safe_sum; \
  |  |   54|  4.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 4.13k]
  |  |  ------------------
  ------------------
  420|  4.13k|    IGRAPH_SAFE_MULT(m->ncol, new_nrow, &new_size);
  ------------------
  |  |   57|  4.13k|    do { \
  |  |   58|  4.13k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   59|  4.13k|        igraph_int_t _safe_prod; \
  |  |   60|  4.13k|        if (__builtin_mul_overflow(_safe_a, _safe_b, &_safe_prod)) { \
  |  |  ------------------
  |  |  |  Branch (60:13): [True: 0, False: 4.13k]
  |  |  ------------------
  |  |   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.13k|        *(res) = _safe_prod; \
  |  |   64|  4.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (64:14): [Folded, False: 4.13k]
  |  |  ------------------
  ------------------
  421|  4.13k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(&m->data, new_size));
  ------------------
  |  |  656|  4.13k|    do { \
  |  |  657|  4.13k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  4.13k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  4.13k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 4.13k]
  |  |  ------------------
  ------------------
  422|   200k|    for (igraph_int_t i = m->ncol - 1; i >= 0; i--) {
  ------------------
  |  Branch (422:40): [True: 196k, False: 4.13k]
  ------------------
  423|   196k|        FUNCTION(igraph_vector, move_interval)(&m->data, (m->nrow)*i, (m->nrow) * (i + 1),
  ------------------
  |  |  178|   196k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   196k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   196k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|   196k|                                                new_nrow * i);
  425|   196k|    }
  426|  4.13k|    m->nrow = new_nrow;
  427|  4.13k|    return IGRAPH_SUCCESS;
  428|  4.13k|}
igraph_matrix_int_permdelete_rows:
  459|  2.92k|        TYPE(igraph_matrix) *m, igraph_int_t *index, igraph_int_t nremove) {
  460|  2.92k|    igraph_int_t i, j;
  461|   146k|    for (j = 0; j < m->nrow; j++) {
  ------------------
  |  Branch (461:17): [True: 143k, False: 2.92k]
  ------------------
  462|   143k|        if (index[j] != 0) {
  ------------------
  |  Branch (462:13): [True: 35.7k, False: 108k]
  ------------------
  463|   107k|            for (i = 0; i < m->ncol; i++) {
  ------------------
  |  Branch (463:25): [True: 71.5k, False: 35.7k]
  ------------------
  464|  71.5k|                MATRIX(*m, index[j] - 1, i) = MATRIX(*m, j, i);
  ------------------
  |  |   83|  71.5k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
                              MATRIX(*m, index[j] - 1, i) = MATRIX(*m, j, i);
  ------------------
  |  |   83|  71.5k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  465|  71.5k|            }
  466|  35.7k|        }
  467|   143k|    }
  468|       |    /* Remove unnecessary elements from the end of each column */
  469|  8.76k|    for (i = 0; i < m->ncol; i++)
  ------------------
  |  Branch (469:17): [True: 5.84k, False: 2.92k]
  ------------------
  470|  5.84k|        FUNCTION(igraph_vector, remove_section)(&m->data,
  ------------------
  |  |  178|  5.84k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  5.84k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  5.84k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  471|  5.84k|                                                (i + 1) * (m->nrow - nremove), (i + 1) * (m->nrow - nremove) + nremove);
  472|  2.92k|    IGRAPH_CHECK(FUNCTION(igraph_matrix, resize)(m, m->nrow - nremove, m->ncol));
  ------------------
  |  |  656|  2.92k|    do { \
  |  |  657|  2.92k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  2.92k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  2.92k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
  473|       |
  474|  2.92k|    return IGRAPH_SUCCESS;
  475|  2.92k|}
igraph_matrix_int_set_row:
 1144|  4.13k|                                     const TYPE(igraph_vector) *v, igraph_int_t index) {
 1145|  4.13k|    const igraph_int_t rows = m->nrow, cols = m->ncol;
 1146|       |
 1147|  4.13k|    if (index >= rows) {
  ------------------
  |  Branch (1147:9): [True: 0, False: 4.13k]
  ------------------
 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.13k|    if (FUNCTION(igraph_vector, size)(v) != cols) {
  ------------------
  |  |  178|  4.13k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  4.13k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  4.13k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1150:9): [True: 0, False: 4.13k]
  ------------------
 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|   200k|    for (igraph_int_t i = index, j = 0; j < cols; i += rows, j++) {
  ------------------
  |  Branch (1153:41): [True: 196k, False: 4.13k]
  ------------------
 1154|   196k|        VECTOR(m->data)[i] = VECTOR(*v)[j];
  ------------------
  |  |   60|   196k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(m->data)[i] = VECTOR(*v)[j];
  ------------------
  |  |   60|   196k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1155|   196k|    }
 1156|  4.13k|    return IGRAPH_SUCCESS;
 1157|  4.13k|}

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

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

igraph_sparsemat_init:
  109|  16.9k|        igraph_int_t cols, igraph_int_t nzmax) {
  110|  16.9k|    IGRAPH_STATIC_ASSERT(sizeof(igraph_int_t) == sizeof(CS_INT));
  ------------------
  |  |   68|  16.9k|#define IGRAPH_STATIC_ASSERT(condition) ((void)sizeof(char[1 - 2*!(condition)]))
  ------------------
  111|  16.9k|    IGRAPH_STATIC_ASSERT(sizeof(igraph_real_t) == sizeof(CS_ENTRY));
  ------------------
  |  |   68|  16.9k|#define IGRAPH_STATIC_ASSERT(condition) ((void)sizeof(char[1 - 2*!(condition)]))
  ------------------
  112|       |
  113|  16.9k|    if (rows < 0) {
  ------------------
  |  Branch (113:9): [True: 0, False: 16.9k]
  ------------------
  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|  16.9k|    if (cols < 0) {
  ------------------
  |  Branch (116:9): [True: 0, False: 16.9k]
  ------------------
  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|  16.9k|    A->cs = cs_spalloc( rows, cols, nzmax, /*values=*/ 1,
  ------------------
  |  |  250|  16.9k|#define cs_spalloc CS_NAME (_spalloc)
  |  |  ------------------
  |  |  |  |  213|  16.9k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  121|  16.9k|                        /*triplet=*/ 1);
  122|  16.9k|    if (!A->cs) {
  ------------------
  |  Branch (122:9): [True: 0, False: 16.9k]
  ------------------
  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|  16.9k|    return IGRAPH_SUCCESS;
  127|  16.9k|}
igraph_sparsemat_destroy:
  181|  33.9k|void igraph_sparsemat_destroy(igraph_sparsemat_t *A) {
  182|  33.9k|    cs_spfree(A->cs);
  ------------------
  |  |  251|  33.9k|#define cs_spfree CS_NAME (_spfree)
  |  |  ------------------
  |  |  |  |  213|  33.9k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  183|  33.9k|}
igraph_sparsemat_realloc:
  201|  10.1k|igraph_error_t igraph_sparsemat_realloc(igraph_sparsemat_t *A, igraph_int_t nzmax) {
  202|  10.1k|    if (!cs_sprealloc(A->cs, nzmax)) {
  ------------------
  |  |  252|  10.1k|#define cs_sprealloc CS_NAME (_sprealloc)
  |  |  ------------------
  |  |  |  |  213|  10.1k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  |  Branch (202:9): [True: 0, False: 10.1k]
  ------------------
  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.1k|    return IGRAPH_SUCCESS;
  206|  10.1k|}
igraph_sparsemat_nrow:
  218|  10.1k|igraph_int_t igraph_sparsemat_nrow(const igraph_sparsemat_t *A) {
  219|  10.1k|    return A->cs->m;
  220|  10.1k|}
igraph_sparsemat_ncol:
  232|  10.1k|igraph_int_t igraph_sparsemat_ncol(const igraph_sparsemat_t *A) {
  233|  10.1k|    return A->cs->n;
  234|  10.1k|}
igraph_sparsemat_is_triplet:
  265|  1.26M|igraph_bool_t igraph_sparsemat_is_triplet(const igraph_sparsemat_t *A) {
  266|  1.26M|    return A->cs->nz >= 0;
  267|  1.26M|}
igraph_sparsemat_is_cc:
  281|  27.1k|igraph_bool_t igraph_sparsemat_is_cc(const igraph_sparsemat_t *A) {
  282|  27.1k|    return A->cs->nz < 0;
  283|  27.1k|}
igraph_sparsemat_entry:
  540|   760k|        igraph_int_t row, igraph_int_t col, igraph_real_t elem) {
  541|   760k|    if (!igraph_sparsemat_is_triplet(A)) {
  ------------------
  |  Branch (541:9): [True: 0, False: 760k]
  ------------------
  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|   760k|    if (!cs_entry(A->cs, row, col, elem)) {
  ------------------
  |  |  235|   760k|#define cs_entry CS_NAME (_entry)
  |  |  ------------------
  |  |  |  |  213|   760k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  |  Branch (546:9): [True: 0, False: 760k]
  ------------------
  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|   760k|    return IGRAPH_SUCCESS;
  552|   760k|}
igraph_sparsemat_compress:
  571|  16.9k|                              igraph_sparsemat_t *res) {
  572|       |
  573|  16.9k|    if (! igraph_sparsemat_is_triplet(A)) {
  ------------------
  |  Branch (573:9): [True: 0, False: 16.9k]
  ------------------
  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|  16.9k|    res->cs = cs_compress(A->cs);
  ------------------
  |  |  241|  16.9k|#define cs_compress CS_NAME (_compress)
  |  |  ------------------
  |  |  |  |  213|  16.9k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  577|  16.9k|    if (!res->cs) {
  ------------------
  |  Branch (577:9): [True: 0, False: 16.9k]
  ------------------
  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|  16.9k|    return IGRAPH_SUCCESS;
  582|  16.9k|}
igraph_sparsemat_dupl:
  763|  16.9k|igraph_error_t igraph_sparsemat_dupl(igraph_sparsemat_t *A) {
  764|       |
  765|  16.9k|    if (! igraph_sparsemat_is_cc(A)) {
  ------------------
  |  Branch (765:9): [True: 0, False: 16.9k]
  ------------------
  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|  16.9k|    if (!cs_dupl(A->cs)) {
  ------------------
  |  |  234|  16.9k|#define cs_dupl CS_NAME (_dupl)
  |  |  ------------------
  |  |  |  |  213|  16.9k|#define CS_NAME(nm) cs_igraph ## nm
  |  |  ------------------
  ------------------
  |  Branch (769:9): [True: 0, False: 16.9k]
  ------------------
  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|  16.9k|    return IGRAPH_SUCCESS;
  774|  16.9k|}
igraph_sparsemat_rowsums:
 2190|  6.77k|                             igraph_vector_t *res) {
 2191|  6.77k|    if (igraph_sparsemat_is_triplet(A)) {
  ------------------
  |  Branch (2191:9): [True: 6.77k, False: 0]
  ------------------
 2192|  6.77k|        return igraph_i_sparsemat_rowsums_triplet(A, res);
 2193|  6.77k|    } else {
 2194|      0|        return igraph_i_sparsemat_rowsums_cc(A, res);
 2195|      0|    }
 2196|  6.77k|}
igraph_sparsemat_colsums:
 2595|  6.77k|                             igraph_vector_t *res) {
 2596|  6.77k|    if (igraph_sparsemat_is_triplet(A)) {
  ------------------
  |  Branch (2596:9): [True: 6.77k, False: 0]
  ------------------
 2597|  6.77k|        return igraph_i_sparsemat_colsums_triplet(A, res);
 2598|  6.77k|    } else {
 2599|      0|        return igraph_i_sparsemat_colsums_cc(A, res);
 2600|      0|    }
 2601|  6.77k|}
igraph_sparsemat_resize:
 2697|  10.1k|                            igraph_int_t ncol, igraph_int_t nzmax) {
 2698|       |
 2699|  10.1k|    if (igraph_sparsemat_is_cc(A)) {
  ------------------
  |  Branch (2699:9): [True: 0, False: 10.1k]
  ------------------
 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.1k|    } else {
 2705|  10.1k|        IGRAPH_CHECK(igraph_sparsemat_realloc(A, nzmax));
  ------------------
  |  |  656|  10.1k|    do { \
  |  |  657|  10.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.1k]
  |  |  ------------------
  ------------------
 2706|  10.1k|        A->cs->m = nrow;
 2707|  10.1k|        A->cs->n = ncol;
 2708|  10.1k|        A->cs->nz = 0;
 2709|  10.1k|    }
 2710|  10.1k|    return IGRAPH_SUCCESS;
 2711|  10.1k|}
igraph_sparsemat_iterator_init:
 3126|  16.9k|) {
 3127|       |
 3128|  16.9k|    it->mat = sparsemat;
 3129|  16.9k|    igraph_sparsemat_iterator_reset(it);
 3130|  16.9k|    return IGRAPH_SUCCESS;
 3131|  16.9k|}
igraph_sparsemat_iterator_reset:
 3143|  16.9k|igraph_error_t igraph_sparsemat_iterator_reset(igraph_sparsemat_iterator_t *it) {
 3144|  16.9k|    it->pos = 0;
 3145|  16.9k|    it->col = 0;
 3146|  16.9k|    if (!igraph_sparsemat_is_triplet(it->mat)) {
  ------------------
  |  Branch (3146:9): [True: 16.9k, False: 0]
  ------------------
 3147|  16.9k|        while (it->col < it->mat->cs->n &&
  ------------------
  |  Branch (3147:16): [True: 16.9k, False: 0]
  ------------------
 3148|  16.9k|               it->mat->cs->p[it->col + 1] == it->pos) {
  ------------------
  |  Branch (3148:16): [True: 0, False: 16.9k]
  ------------------
 3149|      0|            it->col ++;
 3150|      0|        }
 3151|  16.9k|    }
 3152|  16.9k|    return IGRAPH_SUCCESS;
 3153|  16.9k|}
igraph_sparsemat_iterator_end:
 3167|   772k|igraph_sparsemat_iterator_end(const igraph_sparsemat_iterator_t *it) {
 3168|   772k|    CS_INT nz = it->mat->cs->nz == -1 ? it->mat->cs->p[it->mat->cs->n] :
  ------------------
  |  |  209|   772k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|   772k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
  |  Branch (3168:17): [True: 772k, False: 0]
  ------------------
 3169|   772k|                it->mat->cs->nz;
 3170|   772k|    return it->pos >= nz;
 3171|   772k|}
igraph_sparsemat_iterator_row:
 3183|   453k|igraph_int_t igraph_sparsemat_iterator_row(const igraph_sparsemat_iterator_t *it) {
 3184|   453k|    return it->mat->cs->i[it->pos];
 3185|   453k|}
igraph_sparsemat_iterator_col:
 3197|   453k|igraph_int_t igraph_sparsemat_iterator_col(const igraph_sparsemat_iterator_t *it) {
 3198|   453k|    if (igraph_sparsemat_is_triplet(it->mat)) {
  ------------------
  |  Branch (3198:9): [True: 0, False: 453k]
  ------------------
 3199|      0|        return it->mat->cs->p[it->pos];
 3200|   453k|    } else {
 3201|   453k|        return it->col;
 3202|   453k|    }
 3203|   453k|}
igraph_sparsemat_iterator_get:
 3216|   755k|igraph_sparsemat_iterator_get(const igraph_sparsemat_iterator_t *it) {
 3217|   755k|    return it->mat->cs->x[it->pos];
 3218|   755k|}
igraph_sparsemat_iterator_next:
 3230|   755k|igraph_int_t igraph_sparsemat_iterator_next(igraph_sparsemat_iterator_t *it) {
 3231|   755k|    it->pos += 1;
 3232|  1.38M|    while (it->col < it->mat->cs->n &&
  ------------------
  |  Branch (3232:12): [True: 1.36M, False: 16.9k]
  ------------------
 3233|  1.36M|           it->mat->cs->p[it->col + 1] == it->pos) {
  ------------------
  |  Branch (3233:12): [True: 628k, False: 738k]
  ------------------
 3234|   628k|        it->col++;
 3235|   628k|    }
 3236|   755k|    return it->pos;
 3237|   755k|}
sparsemat.c:igraph_i_sparsemat_rowsums_triplet:
 2146|  6.77k|                                              igraph_vector_t *res) {
 2147|  6.77k|    CS_INT i;
  ------------------
  |  |  209|  6.77k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|  6.77k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
 2148|  6.77k|    CS_INT *pi = A->cs->i;
  ------------------
  |  |  209|  6.77k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|  6.77k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
 2149|  6.77k|    CS_ENTRY *px = A->cs->x;
  ------------------
  |  |  212|  6.77k|#define CS_ENTRY double
  ------------------
 2150|       |
 2151|  6.77k|    IGRAPH_CHECK(igraph_vector_resize(res, A->cs->m));
  ------------------
  |  |  656|  6.77k|    do { \
  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
 2152|  6.77k|    igraph_vector_null(res);
 2153|       |
 2154|   311k|    for (i = 0; i < A->cs->nz; i++, pi++, px++) {
  ------------------
  |  Branch (2154:17): [True: 304k, False: 6.77k]
  ------------------
 2155|   304k|        VECTOR(*res)[ *pi ] += *px;
  ------------------
  |  |   60|   304k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2156|   304k|    }
 2157|       |
 2158|  6.77k|    return IGRAPH_SUCCESS;
 2159|  6.77k|}
sparsemat.c:igraph_i_sparsemat_colsums_triplet:
 2545|  6.77k|                                              igraph_vector_t *res) {
 2546|  6.77k|    CS_INT i;
  ------------------
  |  |  209|  6.77k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|  6.77k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
 2547|  6.77k|    CS_INT *pp = A->cs->p;
  ------------------
  |  |  209|  6.77k|#define CS_INT cs_long_t
  |  |  ------------------
  |  |  |  |   64|  6.77k|#define cs_long_t       igraph_int_t
  |  |  ------------------
  ------------------
 2548|  6.77k|    CS_ENTRY *px = A->cs->x;
  ------------------
  |  |  212|  6.77k|#define CS_ENTRY double
  ------------------
 2549|       |
 2550|  6.77k|    IGRAPH_CHECK(igraph_vector_resize(res, A->cs->n));
  ------------------
  |  |  656|  6.77k|    do { \
  |  |  657|  6.77k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.77k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.77k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.77k]
  |  |  ------------------
  ------------------
 2551|  6.77k|    igraph_vector_null(res);
 2552|       |
 2553|   311k|    for (i = 0; i < A->cs->nz; i++, pp++, px++) {
  ------------------
  |  Branch (2553:17): [True: 304k, False: 6.77k]
  ------------------
 2554|   304k|        VECTOR(*res)[ *pp ] += *px;
  ------------------
  |  |   60|   304k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2555|   304k|    }
 2556|       |
 2557|  6.77k|    return IGRAPH_SUCCESS;
 2558|  6.77k|}

igraph_stack_int_init:
   44|  22.8k|igraph_error_t FUNCTION(igraph_stack, init)(TYPE(igraph_stack)* s, igraph_int_t capacity) {
   45|  22.8k|    igraph_int_t alloc_size;
   46|  22.8k|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|  22.8k|    do { \
  |  |  925|  22.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  22.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 22.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  22.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 22.8k]
  |  |  ------------------
  ------------------
   47|  22.8k|    alloc_size = capacity > 0 ? capacity : 1;
  ------------------
  |  Branch (47:18): [True: 22.8k, False: 5]
  ------------------
   48|  22.8k|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  22.8k|    do { \
  |  |  925|  22.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  22.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 22.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  22.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 22.8k]
  |  |  ------------------
  ------------------
   49|  22.8k|    s->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  22.8k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  45.7k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 22.8k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 22.8k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 22.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   50|  22.8k|    if (s->stor_begin == NULL) {
  ------------------
  |  Branch (50:9): [True: 0, False: 22.8k]
  ------------------
   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|  22.8k|    s->stor_end = s->stor_begin + alloc_size;
   54|  22.8k|    s->end = s->stor_begin;
   55|       |
   56|  22.8k|    return IGRAPH_SUCCESS;
   57|  22.8k|}
igraph_stack_int_destroy:
   72|  22.8k|void FUNCTION(igraph_stack, destroy)    (TYPE(igraph_stack)* s) {
   73|  22.8k|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  22.8k|    do { \
  |  |  925|  22.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  22.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 22.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  22.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 22.8k]
  |  |  ------------------
  ------------------
   74|  22.8k|    if (s->stor_begin != NULL) {
  ------------------
  |  Branch (74:9): [True: 22.8k, False: 0]
  ------------------
   75|  22.8k|        IGRAPH_FREE(s->stor_begin);
  ------------------
  |  |   36|  22.8k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
   76|       |        s->stor_begin = NULL;
   77|  22.8k|    }
   78|  22.8k|}
igraph_stack_int_empty:
  154|  15.4M|igraph_bool_t FUNCTION(igraph_stack, empty)(TYPE(igraph_stack)* s) {
  155|  15.4M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  15.4M|    do { \
  |  |  925|  15.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  15.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 15.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  15.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 15.4M]
  |  |  ------------------
  ------------------
  156|  15.4M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  15.4M|    do { \
  |  |  925|  15.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  15.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 15.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  15.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 15.4M]
  |  |  ------------------
  ------------------
  157|  15.4M|    return s->stor_begin == s->end;
  158|  15.4M|}
igraph_stack_int_clear:
  187|  4.83M|void FUNCTION(igraph_stack, clear)(TYPE(igraph_stack)* s) {
  188|  4.83M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  4.83M|    do { \
  |  |  925|  4.83M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.83M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.83M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.83M]
  |  |  ------------------
  ------------------
  189|  4.83M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  4.83M|    do { \
  |  |  925|  4.83M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.83M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.83M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.83M]
  |  |  ------------------
  ------------------
  190|  4.83M|    s->end = s->stor_begin;
  191|  4.83M|}
igraph_stack_int_push:
  208|  11.4M|igraph_error_t FUNCTION(igraph_stack, push)(TYPE(igraph_stack)* s, BASE elem) {
  209|  11.4M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  11.4M|    do { \
  |  |  925|  11.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  11.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  11.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 11.4M]
  |  |  ------------------
  ------------------
  210|  11.4M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  11.4M|    do { \
  |  |  925|  11.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  11.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  11.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 11.4M]
  |  |  ------------------
  ------------------
  211|       |
  212|  11.4M|    if (s->stor_end == s->end) {
  ------------------
  |  Branch (212:9): [True: 0, False: 11.4M]
  ------------------
  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|  11.4M|    *(s->end) = elem;
  226|  11.4M|    s->end += 1;
  227|       |
  228|  11.4M|    return IGRAPH_SUCCESS;
  229|  11.4M|}
igraph_stack_int_pop:
  244|  11.4M|BASE FUNCTION(igraph_stack, pop)(TYPE(igraph_stack)* s) {
  245|  11.4M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  11.4M|    do { \
  |  |  925|  11.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  11.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  11.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 11.4M]
  |  |  ------------------
  ------------------
  246|  11.4M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  11.4M|    do { \
  |  |  925|  11.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  11.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  11.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 11.4M]
  |  |  ------------------
  ------------------
  247|  11.4M|    IGRAPH_ASSERT(s->end != NULL);
  ------------------
  |  |  924|  11.4M|    do { \
  |  |  925|  11.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  11.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  11.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 11.4M]
  |  |  ------------------
  ------------------
  248|  11.4M|    IGRAPH_ASSERT(s->end != s->stor_begin);
  ------------------
  |  |  924|  11.4M|    do { \
  |  |  925|  11.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  11.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 11.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  11.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 11.4M]
  |  |  ------------------
  ------------------
  249|       |
  250|  11.4M|    (s->end)--;
  251|       |
  252|  11.4M|    return *(s->end);
  253|  11.4M|}
igraph_stack_int_top:
  268|  1.73M|BASE FUNCTION(igraph_stack, top)(const TYPE(igraph_stack)* s) {
  269|  1.73M|    IGRAPH_ASSERT(s != NULL);
  ------------------
  |  |  924|  1.73M|    do { \
  |  |  925|  1.73M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.73M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.73M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.73M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.73M]
  |  |  ------------------
  ------------------
  270|  1.73M|    IGRAPH_ASSERT(s->stor_begin != NULL);
  ------------------
  |  |  924|  1.73M|    do { \
  |  |  925|  1.73M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.73M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.73M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.73M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.73M]
  |  |  ------------------
  ------------------
  271|  1.73M|    IGRAPH_ASSERT(s->end != NULL);
  ------------------
  |  |  924|  1.73M|    do { \
  |  |  925|  1.73M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.73M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.73M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.73M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.73M]
  |  |  ------------------
  ------------------
  272|  1.73M|    IGRAPH_ASSERT(s->end != s->stor_begin);
  ------------------
  |  |  924|  1.73M|    do { \
  |  |  925|  1.73M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.73M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.73M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.73M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.73M]
  |  |  ------------------
  ------------------
  273|       |
  274|  1.73M|    return *(s->end - 1);
  275|  1.73M|}

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

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

igraph_vector_init:
  134|  1.43M|igraph_error_t FUNCTION(igraph_vector, init)(TYPE(igraph_vector) *v, igraph_int_t size) {
  135|  1.43M|    igraph_int_t alloc_size;
  136|  1.43M|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|  1.43M|    do { \
  |  |  925|  1.43M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.43M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.43M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.43M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.43M]
  |  |  ------------------
  ------------------
  137|  1.43M|    alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (137:18): [True: 1.29M, False: 139k]
  ------------------
  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|  1.43M|    v->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  1.43M|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  2.87M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 1.43M, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 1.43M, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 1.43M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|  1.43M|    IGRAPH_CHECK_OOM(v->stor_begin, "Insufficient memory to initialize vector.");
  ------------------
  |  |  709|  1.43M|    do { \
  |  |  710|  1.43M|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  1.43M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.43M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.43M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 1.43M]
  |  |  ------------------
  ------------------
  145|  1.43M|    v->stor_end = v->stor_begin + alloc_size;
  146|  1.43M|    v->end = v->stor_begin + size;
  147|       |
  148|  1.43M|    return IGRAPH_SUCCESS;
  149|  1.43M|}
igraph_vector_destroy:
  408|  1.43M|void FUNCTION(igraph_vector, destroy)(TYPE(igraph_vector) *v) {
  409|  1.43M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  1.43M|    do { \
  |  |  925|  1.43M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.43M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.43M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.43M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.43M]
  |  |  ------------------
  ------------------
  410|       |    /* vector_init() will leave stor_begin set to NULL when it fails.
  411|       |     * We handle these cases gracefully. */
  412|  1.43M|    if (v->stor_begin != NULL) {
  ------------------
  |  Branch (412:9): [True: 1.43M, False: 0]
  ------------------
  413|  1.43M|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  1.43M|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  414|       |        v->stor_begin = NULL;
  415|  1.43M|    }
  416|  1.43M|}
igraph_vector_capacity:
  436|   183k|igraph_int_t FUNCTION(igraph_vector, capacity)(const TYPE(igraph_vector) *v) {
  437|   183k|    return v->stor_end - v->stor_begin;
  438|   183k|}
igraph_vector_reserve:
  468|   176k|igraph_error_t FUNCTION(igraph_vector, reserve)(TYPE(igraph_vector) *v, igraph_int_t capacity) {
  469|   176k|    igraph_int_t current_capacity;
  470|   176k|    BASE *tmp;
  ------------------
  |  |   29|   176k|    #define BASE igraph_real_t
  ------------------
  471|       |
  472|   176k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   176k|    do { \
  |  |  925|   176k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   176k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 176k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   176k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 176k]
  |  |  ------------------
  ------------------
  473|   176k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   176k|    do { \
  |  |  925|   176k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   176k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 176k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   176k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 176k]
  |  |  ------------------
  ------------------
  474|   176k|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|   176k|    do { \
  |  |  925|   176k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   176k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 176k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   176k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 176k]
  |  |  ------------------
  ------------------
  475|       |
  476|   176k|    current_capacity = FUNCTION(igraph_vector, capacity)(v);
  ------------------
  |  |  170|   176k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   176k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   176k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|       |
  478|   176k|    if (capacity <= current_capacity) {
  ------------------
  |  Branch (478:9): [True: 57.9k, False: 118k]
  ------------------
  479|  57.9k|        return IGRAPH_SUCCESS;
  480|  57.9k|    }
  481|       |
  482|   118k|    tmp = IGRAPH_REALLOC(v->stor_begin, capacity, BASE);
  ------------------
  |  |   35|   118k|#define IGRAPH_REALLOC(p,n,t) IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, realloc((void*)(p), sizeof(t) * ((n) > 0 ? (n) : 1)))
  |  |  ------------------
  |  |  |  |   31|   237k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 118k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 118k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 118k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   118k|    IGRAPH_CHECK_OOM(tmp, "Cannot reserve space for vector.");
  ------------------
  |  |  709|   118k|    do { \
  |  |  710|   118k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   118k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 118k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|   118k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 118k]
  |  |  ------------------
  ------------------
  484|       |
  485|   118k|    v->end = tmp + (v->end - v->stor_begin);
  486|   118k|    v->stor_begin = tmp;
  487|   118k|    v->stor_end = v->stor_begin + capacity;
  488|       |
  489|   118k|    return IGRAPH_SUCCESS;
  490|   118k|}
igraph_vector_empty:
  503|   832k|igraph_bool_t FUNCTION(igraph_vector, empty)(const TYPE(igraph_vector) *v) {
  504|   832k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   832k|    do { \
  |  |  925|   832k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   832k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 832k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   832k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 832k]
  |  |  ------------------
  ------------------
  505|   832k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   832k|    do { \
  |  |  925|   832k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   832k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 832k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   832k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 832k]
  |  |  ------------------
  ------------------
  506|   832k|    return v->stor_begin == v->end;
  507|   832k|}
igraph_vector_size:
  522|  2.84M|igraph_int_t FUNCTION(igraph_vector, size)(const TYPE(igraph_vector) *v) {
  523|  2.84M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  2.84M|    do { \
  |  |  925|  2.84M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.84M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.84M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.84M]
  |  |  ------------------
  ------------------
  524|  2.84M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  2.84M|    do { \
  |  |  925|  2.84M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.84M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.84M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.84M]
  |  |  ------------------
  ------------------
  525|  2.84M|    return v->end - v->stor_begin;
  526|  2.84M|}
igraph_vector_clear:
  542|  1.19M|void FUNCTION(igraph_vector, clear)(TYPE(igraph_vector)* v) {
  543|  1.19M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  1.19M|    do { \
  |  |  925|  1.19M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.19M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.19M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.19M]
  |  |  ------------------
  ------------------
  544|  1.19M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  1.19M|    do { \
  |  |  925|  1.19M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.19M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.19M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.19M]
  |  |  ------------------
  ------------------
  545|  1.19M|    v->end = v->stor_begin;
  546|  1.19M|}
igraph_vector_push_back:
  573|  1.06M|igraph_error_t FUNCTION(igraph_vector, push_back)(TYPE(igraph_vector) *v, BASE e) {
  574|  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]
  |  |  ------------------
  ------------------
  575|  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]
  |  |  ------------------
  ------------------
  576|       |
  577|  1.06M|    if (v->stor_end == v->end) {
  ------------------
  |  Branch (577:9): [True: 37.5k, False: 1.03M]
  ------------------
  578|       |        /* full, allocate more storage */
  579|  37.5k|        igraph_int_t old_size = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  170|  37.5k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  37.5k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  37.5k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  580|  37.5k|        igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  37.5k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  37.5k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (580:33): [True: 37.5k, False: 0]
  ------------------
  581|  37.5k|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|  37.5k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (581:13): [True: 0, False: 37.5k]
  ------------------
  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|  37.5k|        if (new_size == 0) {
  ------------------
  |  Branch (584:13): [True: 0, False: 37.5k]
  ------------------
  585|      0|            new_size = 1;
  586|      0|        }
  587|  37.5k|        IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|  37.5k|    do { \
  |  |  657|  37.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  37.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  37.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 37.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|  37.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 37.5k]
  |  |  ------------------
  ------------------
  588|  37.5k|    }
  589|       |
  590|  1.06M|    *(v->end) = e;
  591|  1.06M|    v->end += 1;
  592|       |
  593|  1.06M|    return IGRAPH_SUCCESS;
  594|  1.06M|}
igraph_vector_null:
  725|   133k|void FUNCTION(igraph_vector, null)(TYPE(igraph_vector) *v) {
  726|   133k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   133k|    do { \
  |  |  925|   133k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   133k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 133k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   133k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 133k]
  |  |  ------------------
  ------------------
  727|   133k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   133k|    do { \
  |  |  925|   133k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   133k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 133k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   133k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 133k]
  |  |  ------------------
  ------------------
  728|   133k|    if (FUNCTION(igraph_vector, size)(v) > 0) {
  ------------------
  |  |  170|   133k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   133k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   133k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (728:9): [True: 132k, False: 101]
  ------------------
  729|   132k|        memset(v->stor_begin, 0, sizeof(BASE) * FUNCTION(igraph_vector, size)(v));
  ------------------
  |  |  170|   132k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   132k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   132k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|   132k|    }
  731|   133k|}
igraph_vector_fill:
  745|  10.1k|void FUNCTION(igraph_vector, fill)(TYPE(igraph_vector) *v, BASE e) {
  746|  10.1k|    BASE *ptr;
  ------------------
  |  |   29|  10.1k|    #define BASE igraph_real_t
  ------------------
  747|  10.1k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  10.1k|    do { \
  |  |  925|  10.1k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.1k]
  |  |  ------------------
  ------------------
  748|  10.1k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  10.1k|    do { \
  |  |  925|  10.1k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.1k]
  |  |  ------------------
  ------------------
  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|   464k|    for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (766:31): [True: 453k, False: 10.1k]
  ------------------
  767|   453k|        *ptr = e;
  768|   453k|    }
  769|  10.1k|}
igraph_vector_pop_back:
  838|   535k|BASE FUNCTION(igraph_vector, pop_back)(TYPE(igraph_vector) *v) {
  839|   535k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   535k|    do { \
  |  |  925|   535k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   535k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 535k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   535k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 535k]
  |  |  ------------------
  ------------------
  840|   535k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   535k|    do { \
  |  |  925|   535k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   535k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 535k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   535k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 535k]
  |  |  ------------------
  ------------------
  841|   535k|    IGRAPH_ASSERT(v->end != NULL);
  ------------------
  |  |  924|   535k|    do { \
  |  |  925|   535k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   535k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 535k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   535k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 535k]
  |  |  ------------------
  ------------------
  842|   535k|    IGRAPH_ASSERT(v->end != v->stor_begin);
  ------------------
  |  |  924|   535k|    do { \
  |  |  925|   535k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   535k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 535k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   535k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 535k]
  |  |  ------------------
  ------------------
  843|       |
  844|   535k|    (v->end)--;
  845|       |
  846|   535k|    return *(v->end);
  847|   535k|}
igraph_vector_sort_ind:
 1045|  3.30k|        igraph_order_t order) {
 1046|       |
 1047|  3.30k|    igraph_int_t i, n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  170|  3.30k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.30k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.30k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|  3.30k|    BASE **vind, *first;
  ------------------
  |  |   29|  3.30k|    #define BASE igraph_real_t
  ------------------
 1049|  3.30k|    IGRAPH_CHECK(igraph_vector_int_resize(inds, n));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
 1050|  3.30k|    if (n == 0) {
  ------------------
  |  Branch (1050:9): [True: 0, False: 3.30k]
  ------------------
 1051|      0|        return IGRAPH_SUCCESS;
 1052|      0|    }
 1053|  3.30k|    vind = IGRAPH_CALLOC(n, BASE*);
  ------------------
  |  |   33|  3.30k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.60k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.30k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.30k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.30k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  3.30k|    IGRAPH_CHECK_OOM(vind, "Insufficient memory to sort vector.");
  ------------------
  |  |  709|  3.30k|    do { \
  |  |  710|  3.30k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
 1055|   152k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1055:17): [True: 149k, False: 3.30k]
  ------------------
 1056|   149k|        vind[i] = &VECTOR(*v)[i];
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1057|   149k|    }
 1058|  3.30k|    first = vind[0];
 1059|  3.30k|    if (order == IGRAPH_ASCENDING) {
  ------------------
  |  Branch (1059:9): [True: 0, False: 3.30k]
  ------------------
 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.30k|    } else {
 1062|  3.30k|        igraph_qsort(vind, n, sizeof(BASE*), FUNCTION(igraph_vector, i_sort_ind_cmp_desc));
  ------------------
  |  |  170|  3.30k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.30k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.30k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1063|  3.30k|    }
 1064|   152k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1064:17): [True: 149k, False: 3.30k]
  ------------------
 1065|   149k|        VECTOR(*inds)[i] = vind[i] - first;
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1066|   149k|    }
 1067|       |    IGRAPH_FREE(vind);
  ------------------
  |  |   36|  3.30k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1068|  3.30k|    return IGRAPH_SUCCESS;
 1069|  3.30k|}
igraph_vector_resize:
 1264|   139k|igraph_error_t FUNCTION(igraph_vector, resize)(TYPE(igraph_vector)* v, igraph_int_t new_size) {
 1265|   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]
  |  |  ------------------
  ------------------
 1266|   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]
  |  |  ------------------
  ------------------
 1267|   139k|    IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 1268|   139k|    v->end = v->stor_begin + new_size;
 1269|   139k|    return IGRAPH_SUCCESS;
 1270|   139k|}
igraph_vector_which_max:
 1365|  3.39k|igraph_int_t FUNCTION(igraph_vector, which_max)(const TYPE(igraph_vector) *v) {
 1366|  3.39k|    BASE *max;
  ------------------
  |  |   29|  3.39k|    #define BASE igraph_real_t
  ------------------
 1367|  3.39k|    BASE *ptr;
  ------------------
  |  |   29|  3.39k|    #define BASE igraph_real_t
  ------------------
 1368|  3.39k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  3.39k|    do { \
  |  |  925|  3.39k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.39k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.39k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.39k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
 1369|  3.39k|    max = ptr = v->stor_begin;
 1370|  3.39k|#if defined(BASE_IGRAPH_REAL)
 1371|  3.39k|    if (isnan(*ptr)) { return ptr - v->stor_begin; } /* Result is NaN */
  ------------------
  |  Branch (1371:9): [True: 0, False: 3.39k]
  ------------------
 1372|  3.39k|#endif
 1373|  3.39k|    ptr++;
 1374|  44.0k|    while (ptr < v->end) {
  ------------------
  |  Branch (1374:12): [True: 40.6k, False: 3.39k]
  ------------------
 1375|  40.6k|        if (*ptr > *max) {
  ------------------
  |  Branch (1375:13): [True: 32.1k, False: 8.54k]
  ------------------
 1376|  32.1k|            max = ptr;
 1377|  32.1k|        }
 1378|  8.54k|#if defined(BASE_IGRAPH_REAL)
 1379|  8.54k|        else if (isnan(*ptr)) {
  ------------------
  |  Branch (1379:18): [True: 0, False: 8.54k]
  ------------------
 1380|      0|            return ptr - v->stor_begin; /* Result is NaN */
 1381|      0|        }
 1382|  40.6k|#endif
 1383|  40.6k|        ptr++;
 1384|  40.6k|    }
 1385|  3.39k|    return max - v->stor_begin;
 1386|  3.39k|}
igraph_vector_min:
 1401|  33.7k|BASE FUNCTION(igraph_vector, min)(const TYPE(igraph_vector) *v) {
 1402|  33.7k|    BASE min;
  ------------------
  |  |   29|  33.7k|    #define BASE igraph_real_t
  ------------------
 1403|  33.7k|    BASE *ptr;
  ------------------
  |  |   29|  33.7k|    #define BASE igraph_real_t
  ------------------
 1404|  33.7k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  33.7k|    do { \
  |  |  925|  33.7k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  33.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 33.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  33.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 33.7k]
  |  |  ------------------
  ------------------
 1405|  33.7k|    min = *(v->stor_begin);
 1406|  33.7k|#if defined(BASE_IGRAPH_REAL)
 1407|  33.7k|    if (isnan(min)) { return min; }; /* Result is NaN */
  ------------------
  |  Branch (1407:9): [True: 0, False: 33.7k]
  ------------------
 1408|  33.7k|#endif
 1409|  33.7k|    ptr = v->stor_begin + 1;
 1410|   739k|    while (ptr < v->end) {
  ------------------
  |  Branch (1410:12): [True: 705k, False: 33.7k]
  ------------------
 1411|   705k|        if ((*ptr) < min) {
  ------------------
  |  Branch (1411:13): [True: 36.6k, False: 668k]
  ------------------
 1412|  36.6k|            min = *ptr;
 1413|  36.6k|        }
 1414|   668k|#if defined(BASE_IGRAPH_REAL)
 1415|   668k|        else if (isnan(*ptr)) {
  ------------------
  |  Branch (1415:18): [True: 0, False: 668k]
  ------------------
 1416|      0|            return *ptr; /* Result is NaN */
 1417|      0|        }
 1418|   705k|#endif
 1419|   705k|        ptr++;
 1420|   705k|    }
 1421|  33.7k|    return min;
 1422|  33.7k|}
igraph_vector_init_copy:
 1538|  3.40k|) {
 1539|  3.40k|    igraph_int_t from_size;
 1540|       |
 1541|  3.40k|    IGRAPH_ASSERT(from != NULL);
  ------------------
  |  |  924|  3.40k|    do { \
  |  |  925|  3.40k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1542|  3.40k|    IGRAPH_ASSERT(from->stor_begin != NULL);
  ------------------
  |  |  924|  3.40k|    do { \
  |  |  925|  3.40k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1543|       |
 1544|  3.40k|    from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  170|  3.40k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.40k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.40k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1545|  3.40k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(to, from_size));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1546|       |
 1547|  3.40k|    memcpy(to->stor_begin, from->stor_begin, from_size * sizeof(BASE));
 1548|       |
 1549|  3.40k|    return IGRAPH_SUCCESS;
 1550|  3.40k|}
igraph_vector_sum:
 1566|  21.1k|BASE FUNCTION(igraph_vector, sum)(const TYPE(igraph_vector) *v) {
 1567|  21.1k|    BASE res = ZERO;
  ------------------
  |  |   29|  21.1k|    #define BASE igraph_real_t
  ------------------
                  BASE res = ZERO;
  ------------------
  |  |   38|  21.1k|    #define ZERO 0.0
  ------------------
 1568|  21.1k|    const BASE *p;
 1569|  21.1k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  21.1k|    do { \
  |  |  925|  21.1k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  21.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 21.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  21.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 21.1k]
  |  |  ------------------
  ------------------
 1570|  21.1k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  21.1k|    do { \
  |  |  925|  21.1k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  21.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 21.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  21.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 21.1k]
  |  |  ------------------
  ------------------
 1571|   587k|    for (p = v->stor_begin; p < v->end; p++) {
  ------------------
  |  Branch (1571:29): [True: 566k, False: 21.1k]
  ------------------
 1572|       |#ifdef SUM
 1573|       |        SUM(res, res, *p);
 1574|       |#else
 1575|   566k|        res += *p;
 1576|   566k|#endif
 1577|   566k|    }
 1578|  21.1k|    return res;
 1579|  21.1k|}
igraph_vector_binsearch_slice:
 2165|   254k|        BASE what, igraph_int_t *pos, igraph_int_t start, igraph_int_t end) {
 2166|   254k|    igraph_int_t left  = start;
 2167|   254k|    igraph_int_t right = end - 1;
 2168|       |
 2169|   254k|    if (left < 0)
  ------------------
  |  Branch (2169:9): [True: 0, False: 254k]
  ------------------
 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|   254k|    if (right >= FUNCTION(igraph_vector, size)(v))
  ------------------
  |  |  170|   254k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   254k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   254k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2172:9): [True: 0, False: 254k]
  ------------------
 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|   254k|    if (left > right)
  ------------------
  |  Branch (2175:9): [True: 0, False: 254k]
  ------------------
 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|   254k|                     IGRAPH_EINVAL);
 2178|       |
 2179|   254k|    return FUNCTION(igraph_i_vector, binsearch_slice)(v, what, pos, start, end);
  ------------------
  |  |  170|   254k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   254k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   254k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2180|   254k|}
igraph_vector_scale:
 2258|   104k|void FUNCTION(igraph_vector, scale)(TYPE(igraph_vector) *v, BASE by) {
 2259|   104k|    const igraph_int_t n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  170|   104k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   104k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   104k|#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|   104k|    if (by == ONE) {
  ------------------
  |  |   39|   104k|    #define ONE 1.0
  ------------------
  |  Branch (2266:9): [True: 298, False: 104k]
  ------------------
 2267|    298|        return;
 2268|    298|    }
 2269|   104k|#endif
 2270|  4.50M|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (2270:30): [True: 4.39M, False: 104k]
  ------------------
 2271|       |#ifdef PROD
 2272|       |        PROD(VECTOR(*v)[i], VECTOR(*v)[i], by);
 2273|       |#else
 2274|  4.39M|        VECTOR(*v)[i] *= by;
  ------------------
  |  |   60|  4.39M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2275|  4.39M|#endif
 2276|  4.39M|    }
 2277|   104k|}
igraph_vector_append:
 2427|  6.80k|                                               const TYPE(igraph_vector) *from) {
 2428|  6.80k|    IGRAPH_ASSERT(to != NULL);
  ------------------
  |  |  924|  6.80k|    do { \
  |  |  925|  6.80k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
 2429|  6.80k|    IGRAPH_ASSERT(to->stor_begin != NULL);
  ------------------
  |  |  924|  6.80k|    do { \
  |  |  925|  6.80k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
 2430|       |
 2431|  6.80k|    const igraph_int_t to_size = FUNCTION(igraph_vector, size)(to);
  ------------------
  |  |  170|  6.80k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  6.80k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  6.80k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2432|  6.80k|    const igraph_int_t from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  170|  6.80k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  6.80k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  6.80k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2433|  6.80k|    const igraph_int_t to_capacity = FUNCTION(igraph_vector, capacity)(to);
  ------------------
  |  |  170|  6.80k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  6.80k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  6.80k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2434|  6.80k|    igraph_int_t new_to_size;
 2435|       |
 2436|  6.80k|    IGRAPH_SAFE_ADD(to_size, from_size, &new_to_size);
  ------------------
  |  |   47|  6.80k|    do { \
  |  |   48|  6.80k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|  6.80k|        igraph_int_t _safe_sum; \
  |  |   50|  6.80k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 6.80k]
  |  |  ------------------
  |  |   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|  6.80k|        *(res) = _safe_sum; \
  |  |   54|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
 2437|       |
 2438|  6.80k|    if (to_capacity < new_to_size) {
  ------------------
  |  Branch (2438:9): [True: 0, False: 6.80k]
  ------------------
 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|  6.80k|    memcpy(to->stor_begin + to_size, from->stor_begin,
 2447|  6.80k|           sizeof(BASE) * from_size);
 2448|  6.80k|    to->end = to->stor_begin + new_to_size;
 2449|       |
 2450|  6.80k|    return IGRAPH_SUCCESS;
 2451|  6.80k|}
igraph_vector_update:
 2524|  57.8k|                                    const TYPE(igraph_vector) *from) {
 2525|  57.8k|    igraph_int_t n = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  170|  57.8k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  57.8k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  57.8k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|  57.8k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(to, n));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 2527|  57.8k|    memcpy(to->stor_begin, from->stor_begin, sizeof(BASE)*n);
 2528|  57.8k|    return IGRAPH_SUCCESS;
 2529|  57.8k|}
igraph_vector_add:
 2696|  3.35k|                                 const TYPE(igraph_vector) *v2) {
 2697|       |
 2698|  3.35k|    igraph_int_t n1 = FUNCTION(igraph_vector, size)(v1);
  ------------------
  |  |  170|  3.35k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.35k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.35k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2699|  3.35k|    igraph_int_t n2 = FUNCTION(igraph_vector, size)(v2);
  ------------------
  |  |  170|  3.35k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.35k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.35k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2700|  3.35k|    igraph_int_t i;
 2701|  3.35k|    if (n1 != n2) {
  ------------------
  |  Branch (2701:9): [True: 0, False: 3.35k]
  ------------------
 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|   152k|    for (i = 0; i < n1; i++) {
  ------------------
  |  Branch (2706:17): [True: 149k, False: 3.35k]
  ------------------
 2707|       |#ifdef SUM
 2708|       |        SUM(VECTOR(*v1)[i], VECTOR(*v1)[i], VECTOR(*v2)[i]);
 2709|       |#else
 2710|   149k|        VECTOR(*v1)[i] += VECTOR(*v2)[i];
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*v1)[i] += VECTOR(*v2)[i];
  ------------------
  |  |   60|   149k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2711|   149k|#endif
 2712|   149k|    }
 2713|       |
 2714|  3.35k|    return IGRAPH_SUCCESS;
 2715|  3.35k|}
igraph_vector_mul:
 2767|  6.60k|                                 const TYPE(igraph_vector) *v2) {
 2768|       |
 2769|  6.60k|    igraph_int_t n1 = FUNCTION(igraph_vector, size)(v1);
  ------------------
  |  |  170|  6.60k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  6.60k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  6.60k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2770|  6.60k|    igraph_int_t n2 = FUNCTION(igraph_vector, size)(v2);
  ------------------
  |  |  170|  6.60k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  6.60k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  6.60k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2771|  6.60k|    igraph_int_t i;
 2772|  6.60k|    if (n1 != n2) {
  ------------------
  |  Branch (2772:9): [True: 0, False: 6.60k]
  ------------------
 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|   211k|    for (i = 0; i < n1; i++) {
  ------------------
  |  Branch (2777:17): [True: 204k, False: 6.60k]
  ------------------
 2778|       |#ifdef PROD
 2779|       |        PROD(VECTOR(*v1)[i], VECTOR(*v1)[i], VECTOR(*v2)[i]);
 2780|       |#else
 2781|   204k|        VECTOR(*v1)[i] *= VECTOR(*v2)[i];
  ------------------
  |  |   60|   204k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*v1)[i] *= VECTOR(*v2)[i];
  ------------------
  |  |   60|   204k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2782|   204k|#endif
 2783|   204k|    }
 2784|       |
 2785|  6.60k|    return IGRAPH_SUCCESS;
 2786|  6.60k|}
igraph_vector_bool_init:
  134|  10.2k|igraph_error_t FUNCTION(igraph_vector, init)(TYPE(igraph_vector) *v, igraph_int_t size) {
  135|  10.2k|    igraph_int_t alloc_size;
  136|  10.2k|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|  10.2k|    do { \
  |  |  925|  10.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  137|  10.2k|    alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (137:18): [True: 10.1k, 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.2k|    v->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  10.2k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  20.4k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 10.2k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 10.2k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 10.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|  10.2k|    IGRAPH_CHECK_OOM(v->stor_begin, "Insufficient memory to initialize vector.");
  ------------------
  |  |  709|  10.2k|    do { \
  |  |  710|  10.2k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  145|  10.2k|    v->stor_end = v->stor_begin + alloc_size;
  146|  10.2k|    v->end = v->stor_begin + size;
  147|       |
  148|  10.2k|    return IGRAPH_SUCCESS;
  149|  10.2k|}
igraph_vector_bool_destroy:
  408|  10.2k|void FUNCTION(igraph_vector, destroy)(TYPE(igraph_vector) *v) {
  409|  10.2k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  10.2k|    do { \
  |  |  925|  10.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  410|       |    /* vector_init() will leave stor_begin set to NULL when it fails.
  411|       |     * We handle these cases gracefully. */
  412|  10.2k|    if (v->stor_begin != NULL) {
  ------------------
  |  Branch (412:9): [True: 10.2k, False: 0]
  ------------------
  413|  10.2k|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  10.2k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  414|       |        v->stor_begin = NULL;
  415|  10.2k|    }
  416|  10.2k|}
igraph_vector_int_init:
  134|  5.49M|igraph_error_t FUNCTION(igraph_vector, init)(TYPE(igraph_vector) *v, igraph_int_t size) {
  135|  5.49M|    igraph_int_t alloc_size;
  136|  5.49M|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  137|  5.49M|    alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (137:18): [True: 2.31M, False: 3.17M]
  ------------------
  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|  5.49M|    v->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  5.49M|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  10.9M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 5.49M, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 5.49M, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 5.49M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|  5.49M|    IGRAPH_CHECK_OOM(v->stor_begin, "Insufficient memory to initialize vector.");
  ------------------
  |  |  709|  5.49M|    do { \
  |  |  710|  5.49M|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  5.49M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 5.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|  5.49M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 5.49M]
  |  |  ------------------
  ------------------
  145|  5.49M|    v->stor_end = v->stor_begin + alloc_size;
  146|  5.49M|    v->end = v->stor_begin + size;
  147|       |
  148|  5.49M|    return IGRAPH_SUCCESS;
  149|  5.49M|}
igraph_vector_int_destroy:
  408|  5.49M|void FUNCTION(igraph_vector, destroy)(TYPE(igraph_vector) *v) {
  409|  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]
  |  |  ------------------
  ------------------
  410|       |    /* vector_init() will leave stor_begin set to NULL when it fails.
  411|       |     * We handle these cases gracefully. */
  412|  5.49M|    if (v->stor_begin != NULL) {
  ------------------
  |  Branch (412:9): [True: 5.49M, False: 0]
  ------------------
  413|  5.49M|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  5.49M|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  414|       |        v->stor_begin = NULL;
  415|  5.49M|    }
  416|  5.49M|}
igraph_vector_int_capacity:
  436|  11.0M|igraph_int_t FUNCTION(igraph_vector, capacity)(const TYPE(igraph_vector) *v) {
  437|  11.0M|    return v->stor_end - v->stor_begin;
  438|  11.0M|}
igraph_vector_int_reserve:
  468|  10.8M|igraph_error_t FUNCTION(igraph_vector, reserve)(TYPE(igraph_vector) *v, igraph_int_t capacity) {
  469|  10.8M|    igraph_int_t current_capacity;
  470|  10.8M|    BASE *tmp;
  ------------------
  |  |   66|  10.8M|    #define BASE igraph_int_t
  ------------------
  471|       |
  472|  10.8M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  10.8M|    do { \
  |  |  925|  10.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.8M]
  |  |  ------------------
  ------------------
  473|  10.8M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  10.8M|    do { \
  |  |  925|  10.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.8M]
  |  |  ------------------
  ------------------
  474|  10.8M|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|  10.8M|    do { \
  |  |  925|  10.8M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.8M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.8M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.8M]
  |  |  ------------------
  ------------------
  475|       |
  476|  10.8M|    current_capacity = FUNCTION(igraph_vector, capacity)(v);
  ------------------
  |  |  178|  10.8M|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  10.8M|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  10.8M|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|       |
  478|  10.8M|    if (capacity <= current_capacity) {
  ------------------
  |  Branch (478:9): [True: 10.4M, False: 443k]
  ------------------
  479|  10.4M|        return IGRAPH_SUCCESS;
  480|  10.4M|    }
  481|       |
  482|   443k|    tmp = IGRAPH_REALLOC(v->stor_begin, capacity, BASE);
  ------------------
  |  |   35|   443k|#define IGRAPH_REALLOC(p,n,t) IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, realloc((void*)(p), sizeof(t) * ((n) > 0 ? (n) : 1)))
  |  |  ------------------
  |  |  |  |   31|   886k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 443k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 443k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 443k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   443k|    IGRAPH_CHECK_OOM(tmp, "Cannot reserve space for vector.");
  ------------------
  |  |  709|   443k|    do { \
  |  |  710|   443k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   443k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 443k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|   443k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 443k]
  |  |  ------------------
  ------------------
  484|       |
  485|   443k|    v->end = tmp + (v->end - v->stor_begin);
  486|   443k|    v->stor_begin = tmp;
  487|   443k|    v->stor_end = v->stor_begin + capacity;
  488|       |
  489|   443k|    return IGRAPH_SUCCESS;
  490|   443k|}
igraph_vector_int_empty:
  503|   132k|igraph_bool_t FUNCTION(igraph_vector, empty)(const TYPE(igraph_vector) *v) {
  504|   132k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   132k|    do { \
  |  |  925|   132k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   132k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 132k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   132k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 132k]
  |  |  ------------------
  ------------------
  505|   132k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   132k|    do { \
  |  |  925|   132k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   132k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 132k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   132k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 132k]
  |  |  ------------------
  ------------------
  506|   132k|    return v->stor_begin == v->end;
  507|   132k|}
igraph_vector_int_size:
  522|  40.0M|igraph_int_t FUNCTION(igraph_vector, size)(const TYPE(igraph_vector) *v) {
  523|  40.0M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  40.0M|    do { \
  |  |  925|  40.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  40.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  40.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 40.0M]
  |  |  ------------------
  ------------------
  524|  40.0M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  40.0M|    do { \
  |  |  925|  40.0M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  40.0M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  40.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 40.0M]
  |  |  ------------------
  ------------------
  525|  40.0M|    return v->end - v->stor_begin;
  526|  40.0M|}
igraph_vector_int_clear:
  542|  3.91M|void FUNCTION(igraph_vector, clear)(TYPE(igraph_vector)* v) {
  543|  3.91M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  3.91M|    do { \
  |  |  925|  3.91M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.91M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.91M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.91M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.91M]
  |  |  ------------------
  ------------------
  544|  3.91M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  3.91M|    do { \
  |  |  925|  3.91M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.91M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.91M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.91M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.91M]
  |  |  ------------------
  ------------------
  545|  3.91M|    v->end = v->stor_begin;
  546|  3.91M|}
igraph_vector_int_push_back:
  573|  4.54M|igraph_error_t FUNCTION(igraph_vector, push_back)(TYPE(igraph_vector) *v, BASE e) {
  574|  4.54M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  4.54M|    do { \
  |  |  925|  4.54M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.54M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.54M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.54M]
  |  |  ------------------
  ------------------
  575|  4.54M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  4.54M|    do { \
  |  |  925|  4.54M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.54M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.54M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.54M]
  |  |  ------------------
  ------------------
  576|       |
  577|  4.54M|    if (v->stor_end == v->end) {
  ------------------
  |  Branch (577:9): [True: 128k, False: 4.41M]
  ------------------
  578|       |        /* full, allocate more storage */
  579|   128k|        igraph_int_t old_size = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|   128k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   128k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   128k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  580|   128k|        igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|   128k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|   128k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (580:33): [True: 128k, False: 0]
  ------------------
  581|   128k|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|   128k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (581:13): [True: 0, False: 128k]
  ------------------
  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|   128k|        if (new_size == 0) {
  ------------------
  |  Branch (584:13): [True: 0, False: 128k]
  ------------------
  585|      0|            new_size = 1;
  586|      0|        }
  587|   128k|        IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|   128k|    do { \
  |  |  657|   128k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   128k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   128k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 128k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   128k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 128k]
  |  |  ------------------
  ------------------
  588|   128k|    }
  589|       |
  590|  4.54M|    *(v->end) = e;
  591|  4.54M|    v->end += 1;
  592|       |
  593|  4.54M|    return IGRAPH_SUCCESS;
  594|  4.54M|}
igraph_vector_int_null:
  725|   454k|void FUNCTION(igraph_vector, null)(TYPE(igraph_vector) *v) {
  726|   454k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   454k|    do { \
  |  |  925|   454k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   454k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 454k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   454k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 454k]
  |  |  ------------------
  ------------------
  727|   454k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   454k|    do { \
  |  |  925|   454k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   454k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 454k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   454k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 454k]
  |  |  ------------------
  ------------------
  728|   454k|    if (FUNCTION(igraph_vector, size)(v) > 0) {
  ------------------
  |  |  178|   454k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   454k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   454k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (728:9): [True: 453k, False: 26]
  ------------------
  729|   453k|        memset(v->stor_begin, 0, sizeof(BASE) * FUNCTION(igraph_vector, size)(v));
  ------------------
  |  |  178|   453k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   453k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   453k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|   453k|    }
  731|   454k|}
igraph_vector_int_fill:
  745|  20.3k|void FUNCTION(igraph_vector, fill)(TYPE(igraph_vector) *v, BASE e) {
  746|  20.3k|    BASE *ptr;
  ------------------
  |  |   66|  20.3k|    #define BASE igraph_int_t
  ------------------
  747|  20.3k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  20.3k|    do { \
  |  |  925|  20.3k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  20.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  20.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 20.3k]
  |  |  ------------------
  ------------------
  748|  20.3k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  20.3k|    do { \
  |  |  925|  20.3k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  20.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  20.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 20.3k]
  |  |  ------------------
  ------------------
  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|  20.3k|#if defined(BASE_INT)
  754|  20.3k|    if (e == 0) {
  ------------------
  |  Branch (754:9): [True: 0, False: 20.3k]
  ------------------
  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|  20.3k|    if (e == -1) {
  ------------------
  |  Branch (758:9): [True: 20.3k, False: 0]
  ------------------
  759|   924k|        for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (759:35): [True: 904k, False: 20.3k]
  ------------------
  760|   904k|            *ptr = -1;
  761|   904k|        }
  762|  20.3k|        return;
  763|  20.3k|    }
  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|  6.99k|igraph_error_t FUNCTION(igraph_vector, range)(TYPE(igraph_vector) *v, BASE start, BASE end) {
  792|  6.99k|    BASE *p;
  ------------------
  |  |   66|  6.99k|    #define BASE igraph_int_t
  ------------------
  793|  6.99k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(v, (end - start)));
  ------------------
  |  |  656|  6.99k|    do { \
  |  |  657|  6.99k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.99k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.99k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.99k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.99k]
  |  |  ------------------
  ------------------
  794|       |
  795|   316k|    for (p = v->stor_begin; p < v->end; p++) {
  ------------------
  |  Branch (795:29): [True: 309k, False: 6.99k]
  ------------------
  796|   309k|        *p = start;
  797|   309k|        start = start + ONE;
  ------------------
  |  |   72|   309k|    #define ONE 1
  ------------------
  798|   309k|    }
  799|       |
  800|  6.99k|    return IGRAPH_SUCCESS;
  801|  6.99k|}
igraph_vector_int_pop_back:
  838|   718k|BASE FUNCTION(igraph_vector, pop_back)(TYPE(igraph_vector) *v) {
  839|   718k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   718k|    do { \
  |  |  925|   718k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   718k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 718k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   718k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 718k]
  |  |  ------------------
  ------------------
  840|   718k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   718k|    do { \
  |  |  925|   718k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   718k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 718k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   718k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 718k]
  |  |  ------------------
  ------------------
  841|   718k|    IGRAPH_ASSERT(v->end != NULL);
  ------------------
  |  |  924|   718k|    do { \
  |  |  925|   718k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   718k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 718k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   718k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 718k]
  |  |  ------------------
  ------------------
  842|   718k|    IGRAPH_ASSERT(v->end != v->stor_begin);
  ------------------
  |  |  924|   718k|    do { \
  |  |  925|   718k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   718k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 718k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   718k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 718k]
  |  |  ------------------
  ------------------
  843|       |
  844|   718k|    (v->end)--;
  845|       |
  846|   718k|    return *(v->end);
  847|   718k|}
igraph_vector_int_sort_ind:
 1045|  40.6k|        igraph_order_t order) {
 1046|       |
 1047|  40.6k|    igraph_int_t i, n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|  40.6k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  40.6k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  40.6k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|  40.6k|    BASE **vind, *first;
  ------------------
  |  |   66|  40.6k|    #define BASE igraph_int_t
  ------------------
 1049|  40.6k|    IGRAPH_CHECK(igraph_vector_int_resize(inds, n));
  ------------------
  |  |  656|  40.6k|    do { \
  |  |  657|  40.6k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  40.6k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  40.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 40.6k]
  |  |  ------------------
  ------------------
 1050|  40.6k|    if (n == 0) {
  ------------------
  |  Branch (1050:9): [True: 0, False: 40.6k]
  ------------------
 1051|      0|        return IGRAPH_SUCCESS;
 1052|      0|    }
 1053|  40.6k|    vind = IGRAPH_CALLOC(n, BASE*);
  ------------------
  |  |   33|  40.6k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  81.3k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 40.6k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 40.6k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 40.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  40.6k|    IGRAPH_CHECK_OOM(vind, "Insufficient memory to sort vector.");
  ------------------
  |  |  709|  40.6k|    do { \
  |  |  710|  40.6k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  40.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 40.6k]
  |  |  ------------------
  ------------------
 1055|  2.33M|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1055:17): [True: 2.29M, False: 40.6k]
  ------------------
 1056|  2.29M|        vind[i] = &VECTOR(*v)[i];
  ------------------
  |  |   60|  2.29M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1057|  2.29M|    }
 1058|  40.6k|    first = vind[0];
 1059|  40.6k|    if (order == IGRAPH_ASCENDING) {
  ------------------
  |  Branch (1059:9): [True: 40.6k, False: 0]
  ------------------
 1060|  40.6k|        igraph_qsort(vind, n, sizeof(BASE*), FUNCTION(igraph_vector, i_sort_ind_cmp_asc));
  ------------------
  |  |  178|  40.6k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  40.6k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  40.6k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1061|  40.6k|    } 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.33M|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1064:17): [True: 2.29M, False: 40.6k]
  ------------------
 1065|  2.29M|        VECTOR(*inds)[i] = vind[i] - first;
  ------------------
  |  |   60|  2.29M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1066|  2.29M|    }
 1067|       |    IGRAPH_FREE(vind);
  ------------------
  |  |   36|  40.6k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1068|  40.6k|    return IGRAPH_SUCCESS;
 1069|  40.6k|}
igraph_vector_int_resize:
 1264|  10.5M|igraph_error_t FUNCTION(igraph_vector, resize)(TYPE(igraph_vector)* v, igraph_int_t new_size) {
 1265|  10.5M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  10.5M|    do { \
  |  |  925|  10.5M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.5M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.5M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.5M]
  |  |  ------------------
  ------------------
 1266|  10.5M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  10.5M|    do { \
  |  |  925|  10.5M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.5M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.5M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.5M]
  |  |  ------------------
  ------------------
 1267|  10.5M|    IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|  10.5M|    do { \
  |  |  657|  10.5M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.5M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.5M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.5M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.5M]
  |  |  ------------------
  ------------------
 1268|  10.5M|    v->end = v->stor_begin + new_size;
 1269|  10.5M|    return IGRAPH_SUCCESS;
 1270|  10.5M|}
igraph_vector_int_max:
 1327|  81.7k|BASE FUNCTION(igraph_vector, max)(const TYPE(igraph_vector) *v) {
 1328|  81.7k|    BASE max;
  ------------------
  |  |   66|  81.7k|    #define BASE igraph_int_t
  ------------------
 1329|  81.7k|    BASE *ptr;
  ------------------
  |  |   66|  81.7k|    #define BASE igraph_int_t
  ------------------
 1330|  81.7k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  81.7k|    do { \
  |  |  925|  81.7k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  81.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 81.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  81.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 81.7k]
  |  |  ------------------
  ------------------
 1331|  81.7k|    max = *(v->stor_begin);
 1332|       |#if defined(BASE_IGRAPH_REAL)
 1333|       |    if (isnan(max)) { return max; }; /* Result is NaN */
 1334|       |#endif
 1335|  81.7k|    ptr = v->stor_begin + 1;
 1336|  3.18M|    while (ptr < v->end) {
  ------------------
  |  Branch (1336:12): [True: 3.09M, False: 81.7k]
  ------------------
 1337|  3.09M|        if ((*ptr) > max) {
  ------------------
  |  Branch (1337:13): [True: 1.91M, False: 1.18M]
  ------------------
 1338|  1.91M|            max = *ptr;
 1339|  1.91M|        }
 1340|       |#if defined(BASE_IGRAPH_REAL)
 1341|       |        else if (isnan(*ptr))
 1342|       |            return *ptr; /* Result is NaN */
 1343|       |#endif
 1344|  3.09M|        ptr++;
 1345|  3.09M|    }
 1346|  81.7k|    return max;
 1347|  81.7k|}
igraph_vector_int_init_copy:
 1538|   374k|) {
 1539|   374k|    igraph_int_t from_size;
 1540|       |
 1541|   374k|    IGRAPH_ASSERT(from != NULL);
  ------------------
  |  |  924|   374k|    do { \
  |  |  925|   374k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   374k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 374k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   374k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 374k]
  |  |  ------------------
  ------------------
 1542|   374k|    IGRAPH_ASSERT(from->stor_begin != NULL);
  ------------------
  |  |  924|   374k|    do { \
  |  |  925|   374k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   374k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 374k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   374k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 374k]
  |  |  ------------------
  ------------------
 1543|       |
 1544|   374k|    from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  178|   374k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   374k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   374k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1545|   374k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(to, from_size));
  ------------------
  |  |  656|   374k|    do { \
  |  |  657|   374k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   374k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   374k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 374k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   374k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 374k]
  |  |  ------------------
  ------------------
 1546|       |
 1547|   374k|    memcpy(to->stor_begin, from->stor_begin, from_size * sizeof(BASE));
 1548|       |
 1549|   374k|    return IGRAPH_SUCCESS;
 1550|   374k|}
igraph_vector_int_init_range:
 1686|  54.3k|igraph_error_t FUNCTION(igraph_vector, init_range)(TYPE(igraph_vector) *v, BASE start, BASE end) {
 1687|  54.3k|    BASE *p;
  ------------------
  |  |   66|  54.3k|    #define BASE igraph_int_t
  ------------------
 1688|  54.3k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(v, (end - start)));
  ------------------
  |  |  656|  54.3k|    do { \
  |  |  657|  54.3k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  54.3k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  54.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 54.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|  54.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 54.3k]
  |  |  ------------------
  ------------------
 1689|       |
 1690|  2.43M|    for (p = v->stor_begin; p < v->end; p++) {
  ------------------
  |  Branch (1690:29): [True: 2.37M, False: 54.3k]
  ------------------
 1691|  2.37M|        *p = start;
 1692|  2.37M|        start = start + ONE;
  ------------------
  |  |   72|  2.37M|    #define ONE 1
  ------------------
 1693|  2.37M|    }
 1694|       |
 1695|  54.3k|    return IGRAPH_SUCCESS;
 1696|  54.3k|}
igraph_vector_int_remove_section:
 1716|  5.84k|        TYPE(igraph_vector) *v, igraph_int_t from, igraph_int_t to) {
 1717|  5.84k|    igraph_int_t size = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|  5.84k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  5.84k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  5.84k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1718|       |
 1719|  5.84k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  5.84k|    do { \
  |  |  925|  5.84k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  5.84k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 5.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  5.84k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 5.84k]
  |  |  ------------------
  ------------------
 1720|  5.84k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  5.84k|    do { \
  |  |  925|  5.84k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  5.84k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 5.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  5.84k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 5.84k]
  |  |  ------------------
  ------------------
 1721|       |
 1722|  5.84k|    if (from < 0) {
  ------------------
  |  Branch (1722:9): [True: 0, False: 5.84k]
  ------------------
 1723|      0|        from = 0;
 1724|      0|    }
 1725|       |
 1726|  5.84k|    if (to > size) {
  ------------------
  |  Branch (1726:9): [True: 0, False: 5.84k]
  ------------------
 1727|      0|        to = size;
 1728|      0|    }
 1729|       |
 1730|  5.84k|    if (to > from) {
  ------------------
  |  Branch (1730:9): [True: 5.84k, False: 0]
  ------------------
 1731|  5.84k|        memmove(v->stor_begin + from, v->stor_begin + to,
 1732|  5.84k|                sizeof(BASE) * (v->end - v->stor_begin - to));
 1733|  5.84k|        v->end -= (to - from);
 1734|  5.84k|    }
 1735|  5.84k|}
igraph_vector_int_move_interval:
 1804|   196k|        igraph_int_t begin, igraph_int_t end, igraph_int_t to) {
 1805|   196k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   196k|    do { \
  |  |  925|   196k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   196k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 196k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   196k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 196k]
  |  |  ------------------
  ------------------
 1806|   196k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   196k|    do { \
  |  |  925|   196k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   196k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 196k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   196k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 196k]
  |  |  ------------------
  ------------------
 1807|   196k|    memmove(v->stor_begin + to, v->stor_begin + begin,
 1808|   196k|           sizeof(BASE) * (end - begin));
 1809|       |
 1810|   196k|    return IGRAPH_SUCCESS;
 1811|   196k|}
igraph_vector_int_isininterval:
 1832|  74.7k|        BASE high) {
 1833|  74.7k|    BASE *ptr;
  ------------------
  |  |   66|  74.7k|    #define BASE igraph_int_t
  ------------------
 1834|  74.7k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  74.7k|    do { \
  |  |  925|  74.7k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  74.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 74.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  74.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 74.7k]
  |  |  ------------------
  ------------------
 1835|  74.7k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  74.7k|    do { \
  |  |  925|  74.7k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  74.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 74.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  74.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 74.7k]
  |  |  ------------------
  ------------------
 1836|  2.41M|    for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (1836:31): [True: 2.34M, False: 74.7k]
  ------------------
 1837|       |        /* Note that the following is not equivalent to *ptr < low || *ptr > high
 1838|       |         * when *ptr is NaN! */
 1839|  2.34M|        if (!(*ptr >= low && *ptr <= high)) {
  ------------------
  |  Branch (1839:15): [True: 2.34M, False: 0]
  |  Branch (1839:30): [True: 2.34M, False: 0]
  ------------------
 1840|      0|            return 0;
 1841|      0|        }
 1842|  2.34M|    }
 1843|  74.7k|    return 1;
 1844|  74.7k|}
igraph_vector_int_search:
 2364|   183k|        igraph_int_t from, BASE what, igraph_int_t *pos) {
 2365|   183k|    igraph_int_t i, n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|   183k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   183k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   183k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2366|  2.07M|    for (i = from; i < n; i++) {
  ------------------
  |  Branch (2366:20): [True: 2.07M, False: 0]
  ------------------
 2367|       |#ifdef EQ
 2368|       |        if (EQ(VECTOR(*v)[i], what)) {
 2369|       |            break;
 2370|       |        }
 2371|       |#else
 2372|  2.07M|        if (VECTOR(*v)[i] == what) {
  ------------------
  |  |   60|  2.07M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2372:13): [True: 183k, False: 1.89M]
  ------------------
 2373|   183k|            break;
 2374|   183k|        }
 2375|  2.07M|#endif
 2376|  2.07M|    }
 2377|       |
 2378|   183k|    if (i < n) {
  ------------------
  |  Branch (2378:9): [True: 183k, False: 0]
  ------------------
 2379|   183k|        if (pos != 0) {
  ------------------
  |  Branch (2379:13): [True: 183k, False: 0]
  ------------------
 2380|   183k|            *pos = i;
 2381|   183k|        }
 2382|   183k|        return true;
 2383|   183k|    } else {
 2384|       |        return false;
 2385|      0|    }
 2386|   183k|}
igraph_vector_int_append:
 2427|   152k|                                               const TYPE(igraph_vector) *from) {
 2428|   152k|    IGRAPH_ASSERT(to != NULL);
  ------------------
  |  |  924|   152k|    do { \
  |  |  925|   152k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   152k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
 2429|   152k|    IGRAPH_ASSERT(to->stor_begin != NULL);
  ------------------
  |  |  924|   152k|    do { \
  |  |  925|   152k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   152k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
 2430|       |
 2431|   152k|    const igraph_int_t to_size = FUNCTION(igraph_vector, size)(to);
  ------------------
  |  |  178|   152k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   152k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   152k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2432|   152k|    const igraph_int_t from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  178|   152k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   152k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   152k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2433|   152k|    const igraph_int_t to_capacity = FUNCTION(igraph_vector, capacity)(to);
  ------------------
  |  |  178|   152k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   152k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   152k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2434|   152k|    igraph_int_t new_to_size;
 2435|       |
 2436|   152k|    IGRAPH_SAFE_ADD(to_size, from_size, &new_to_size);
  ------------------
  |  |   47|   152k|    do { \
  |  |   48|   152k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|   152k|        igraph_int_t _safe_sum; \
  |  |   50|   152k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 152k]
  |  |  ------------------
  |  |   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|   152k|        *(res) = _safe_sum; \
  |  |   54|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
 2437|       |
 2438|   152k|    if (to_capacity < new_to_size) {
  ------------------
  |  Branch (2438:9): [True: 0, False: 152k]
  ------------------
 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|   152k|    memcpy(to->stor_begin + to_size, from->stor_begin,
 2447|   152k|           sizeof(BASE) * from_size);
 2448|   152k|    to->end = to->stor_begin + new_to_size;
 2449|       |
 2450|   152k|    return IGRAPH_SUCCESS;
 2451|   152k|}
igraph_vector_int_update:
 2524|  68.8k|                                    const TYPE(igraph_vector) *from) {
 2525|  68.8k|    igraph_int_t n = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  178|  68.8k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  68.8k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  68.8k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|  68.8k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(to, n));
  ------------------
  |  |  656|  68.8k|    do { \
  |  |  657|  68.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  68.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  68.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 68.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|  68.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 68.8k]
  |  |  ------------------
  ------------------
 2527|  68.8k|    memcpy(to->stor_begin, from->stor_begin, sizeof(BASE)*n);
 2528|  68.8k|    return IGRAPH_SUCCESS;
 2529|  68.8k|}
igraph_vector_int_shuffle:
 2668|   293k|void FUNCTION(igraph_vector, shuffle)(TYPE(igraph_vector) *v) {
 2669|   293k|    igraph_int_t n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|   293k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   293k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   293k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2670|   293k|    igraph_int_t k;
 2671|   293k|    BASE dummy;
  ------------------
  |  |   66|   293k|    #define BASE igraph_int_t
  ------------------
 2672|       |
 2673|  2.08M|    while (n > 1) {
  ------------------
  |  Branch (2673:12): [True: 1.78M, False: 293k]
  ------------------
 2674|  1.78M|        k = RNG_INTEGER(0, n - 1);
  ------------------
  |  |  152|  1.78M|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
 2675|  1.78M|        n--;
 2676|  1.78M|        dummy = VECTOR(*v)[n];
  ------------------
  |  |   60|  1.78M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2677|  1.78M|        VECTOR(*v)[n] = VECTOR(*v)[k];
  ------------------
  |  |   60|  1.78M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*v)[n] = VECTOR(*v)[k];
  ------------------
  |  |   60|  1.78M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2678|  1.78M|        VECTOR(*v)[k] = dummy;
  ------------------
  |  |   60|  1.78M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2679|  1.78M|    }
 2680|   293k|}
igraph_vector_int_minmax:
 2861|  50.6k|                          BASE *min, BASE *max) {
 2862|  50.6k|    BASE* ptr;
  ------------------
  |  |   66|  50.6k|    #define BASE igraph_int_t
  ------------------
 2863|  50.6k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  50.6k|    do { \
  |  |  925|  50.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  50.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 50.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  50.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 50.6k]
  |  |  ------------------
  ------------------
 2864|  50.6k|    *min = *max = *(v->stor_begin);
 2865|       |    #if defined(BASE_IGRAPH_REAL)
 2866|       |        if (isnan(*min)) { return; }; /* Result is NaN */
 2867|       |    #endif
 2868|  50.6k|    ptr = v->stor_begin + 1;
 2869|  2.74M|    while (ptr < v->end) {
  ------------------
  |  Branch (2869:12): [True: 2.69M, False: 50.6k]
  ------------------
 2870|  2.69M|        if (*ptr > *max) {
  ------------------
  |  Branch (2870:13): [True: 434k, False: 2.25M]
  ------------------
 2871|   434k|            *max = *ptr;
 2872|  2.25M|        } else if (*ptr < *min) {
  ------------------
  |  Branch (2872:20): [True: 46.0k, False: 2.21M]
  ------------------
 2873|  46.0k|            *min = *ptr;
 2874|  46.0k|        }
 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.69M|        ptr++;
 2882|  2.69M|    }
 2883|  50.6k|}
igraph_vector_int_intersection_size_sorted:
 3172|  55.2k|        const TYPE(igraph_vector) *v2) {
 3173|       |
 3174|  55.2k|    igraph_int_t size1, size2, count;
 3175|  55.2k|    igraph_real_t r;
 3176|       |
 3177|  55.2k|    size1 = FUNCTION(igraph_vector, size)(v1);
  ------------------
  |  |  178|  55.2k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  55.2k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  55.2k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3178|  55.2k|    size2 = FUNCTION(igraph_vector, size)(v2);
  ------------------
  |  |  178|  55.2k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  55.2k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  55.2k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3179|       |
 3180|  55.2k|    count = 0;
 3181|       |
 3182|  55.2k|    if (size1 == 0 || size2 == 0) {
  ------------------
  |  Branch (3182:9): [True: 0, False: 55.2k]
  |  Branch (3182:23): [True: 0, False: 55.2k]
  ------------------
 3183|      0|        return count;
 3184|      0|    }
 3185|       |
 3186|  55.2k|    r = size1 > size2 ? (igraph_real_t) size1 / size2 : (igraph_real_t) size2 / size1;
  ------------------
  |  Branch (3186:9): [True: 23.7k, False: 31.5k]
  ------------------
 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|  55.2k|    if (r < 10) {
  ------------------
  |  Branch (3193:9): [True: 43.6k, False: 11.6k]
  ------------------
 3194|       |        /* This is a fast branchless implementation that uses arithmetic
 3195|       |         * instead of conditionals. */
 3196|  43.6k|        igraph_int_t i1 = 0, i2 = 0;
 3197|   334k|        while (i1 < size1 && i2 < size2) {
  ------------------
  |  Branch (3197:16): [True: 311k, False: 22.8k]
  |  Branch (3197:30): [True: 290k, False: 20.7k]
  ------------------
 3198|   290k|            BASE e1 = VECTOR(*v1)[i1], e2 = VECTOR(*v2)[i2];
  ------------------
  |  |   66|   290k|    #define BASE igraph_int_t
  ------------------
                          BASE e1 = VECTOR(*v1)[i1], e2 = VECTOR(*v2)[i2];
  ------------------
  |  |   60|   290k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          BASE e1 = VECTOR(*v1)[i1], e2 = VECTOR(*v2)[i2];
  ------------------
  |  |   60|   290k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3199|   290k|            igraph_int_t d1 = (e1 <= e2), d2 = (e1 >= e2);
 3200|   290k|            i1 += d1; i2 += d2;
 3201|   290k|            count += (d1 == d2);
 3202|   290k|        }
 3203|  43.6k|    } else {
 3204|  11.6k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  11.6k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  11.6k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  11.6k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3205|  11.6k|            v1, 0, size1, v2, 0, size2, &count);
 3206|  11.6k|    }
 3207|       |
 3208|  55.2k|    return count;
 3209|  55.2k|}
vector.c:igraph_vector_i_sort_ind_cmp_desc:
 1004|   349k|static int FUNCTION(igraph_vector, i_sort_ind_cmp_desc)(const void *p1, const void *p2) {
 1005|   349k|    BASE **pa = (BASE **) p1;
  ------------------
  |  |   29|   349k|    #define BASE igraph_real_t
  ------------------
 1006|   349k|    BASE **pb = (BASE **) p2;
  ------------------
  |  |   29|   349k|    #define BASE igraph_real_t
  ------------------
 1007|   349k|    if ( **pa < **pb ) {
  ------------------
  |  Branch (1007:10): [True: 119k, False: 230k]
  ------------------
 1008|   119k|        return 1;
 1009|   119k|    }
 1010|   230k|    if ( **pa > **pb) {
  ------------------
  |  Branch (1010:10): [True: 105k, False: 124k]
  ------------------
 1011|   105k|        return -1;
 1012|   105k|    }
 1013|   124k|    return 0;
 1014|   230k|}
vector.c:igraph_i_vector_binsearch_slice:
 2183|   254k|        BASE what, igraph_int_t *pos, igraph_int_t start, igraph_int_t end) {
 2184|   254k|    igraph_int_t left  = start;
 2185|   254k|    igraph_int_t right = end - 1;
 2186|       |
 2187|   520k|    while (left <= right) {
  ------------------
  |  Branch (2187:12): [True: 266k, False: 254k]
  ------------------
 2188|       |        /* (right + left) / 2 could theoretically overflow for long vectors */
 2189|   266k|        igraph_int_t middle = left + ((right - left) >> 1);
 2190|   266k|        if (VECTOR(*v)[middle] > what) {
  ------------------
  |  |   60|   266k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2190:13): [True: 254k, False: 11.8k]
  ------------------
 2191|   254k|            right = middle - 1;
 2192|   254k|        } else if (VECTOR(*v)[middle] < what) {
  ------------------
  |  |   60|  11.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2192:20): [True: 11.8k, False: 0]
  ------------------
 2193|  11.8k|            left = middle + 1;
 2194|  11.8k|        } 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|   266k|    }
 2201|       |
 2202|       |    /* if we are here, the element was not found */
 2203|   254k|    if (pos != 0) {
  ------------------
  |  Branch (2203:9): [True: 254k, False: 0]
  ------------------
 2204|   254k|        *pos = left;
 2205|   254k|    }
 2206|       |
 2207|       |    return false;
 2208|   254k|}
vector.c:igraph_vector_int_i_sort_ind_cmp_asc:
  989|  10.8M|static int FUNCTION(igraph_vector, i_sort_ind_cmp_asc)(const void *p1, const void *p2) {
  990|  10.8M|    BASE **pa = (BASE **) p1;
  ------------------
  |  |   66|  10.8M|    #define BASE igraph_int_t
  ------------------
  991|  10.8M|    BASE **pb = (BASE **) p2;
  ------------------
  |  |   66|  10.8M|    #define BASE igraph_int_t
  ------------------
  992|  10.8M|    if ( **pa < **pb ) {
  ------------------
  |  Branch (992:10): [True: 5.64M, False: 5.17M]
  ------------------
  993|  5.64M|        return -1;
  994|  5.64M|    }
  995|  5.17M|    if ( **pa > **pb) {
  ------------------
  |  Branch (995:10): [True: 4.48M, False: 685k]
  ------------------
  996|  4.48M|        return 1;
  997|  4.48M|    }
  998|   685k|    return 0;
  999|  5.17M|}
vector.c:igraph_i_vector_int_binsearch_slice:
 2183|  13.9k|        BASE what, igraph_int_t *pos, igraph_int_t start, igraph_int_t end) {
 2184|  13.9k|    igraph_int_t left  = start;
 2185|  13.9k|    igraph_int_t right = end - 1;
 2186|       |
 2187|  69.6k|    while (left <= right) {
  ------------------
  |  Branch (2187:12): [True: 57.3k, False: 12.3k]
  ------------------
 2188|       |        /* (right + left) / 2 could theoretically overflow for long vectors */
 2189|  57.3k|        igraph_int_t middle = left + ((right - left) >> 1);
 2190|  57.3k|        if (VECTOR(*v)[middle] > what) {
  ------------------
  |  |   60|  57.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2190:13): [True: 47.0k, False: 10.2k]
  ------------------
 2191|  47.0k|            right = middle - 1;
 2192|  47.0k|        } else if (VECTOR(*v)[middle] < what) {
  ------------------
  |  |   60|  10.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2192:20): [True: 8.71k, False: 1.57k]
  ------------------
 2193|  8.71k|            left = middle + 1;
 2194|  8.71k|        } else {
 2195|  1.57k|            if (pos != 0) {
  ------------------
  |  Branch (2195:17): [True: 1.57k, False: 0]
  ------------------
 2196|  1.57k|                *pos = middle;
 2197|  1.57k|            }
 2198|  1.57k|            return true;
 2199|  1.57k|        }
 2200|  57.3k|    }
 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|  13.9k|}
vector.c:igraph_i_vector_int_intersection_size_sorted:
 3095|  39.5k|    igraph_int_t *result) {
 3096|       |
 3097|  39.5k|    igraph_int_t size1, size2, probe1, probe2;
 3098|       |
 3099|  39.5k|    if (begin1 == end1 || begin2 == end2) {
  ------------------
  |  Branch (3099:9): [True: 18.2k, False: 21.2k]
  |  Branch (3099:27): [True: 7.34k, False: 13.9k]
  ------------------
 3100|  25.5k|        return;
 3101|  25.5k|    }
 3102|       |
 3103|  13.9k|    size1 = end1 - begin1;
 3104|  13.9k|    size2 = end2 - begin2;
 3105|       |
 3106|  13.9k|    if (size1 < size2) {
  ------------------
  |  Branch (3106:9): [True: 6.87k, False: 7.06k]
  ------------------
 3107|  6.87k|        probe1 = begin1 + (size1 >> 1);      /* pick the median element */
 3108|  6.87k|        FUNCTION(igraph_i_vector, binsearch_slice)(v2, VECTOR(*v1)[probe1], &probe2, begin2, end2);
  ------------------
  |  |  178|  6.87k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.87k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.87k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      FUNCTION(igraph_i_vector, binsearch_slice)(v2, VECTOR(*v1)[probe1], &probe2, begin2, end2);
  ------------------
  |  |   60|  6.87k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3109|  6.87k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  6.87k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.87k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.87k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3110|  6.87k|            v1, begin1, probe1, v2, begin2, probe2, result
 3111|  6.87k|        );
 3112|  6.87k|        if (!(probe2 == end2 || VECTOR(*v1)[probe1] < VECTOR(*v2)[probe2])) {
  ------------------
  |  |   60|  6.54k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (!(probe2 == end2 || VECTOR(*v1)[probe1] < VECTOR(*v2)[probe2])) {
  ------------------
  |  |   60|  6.54k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (3112:15): [True: 338, False: 6.54k]
  |  Branch (3112:33): [True: 5.83k, False: 710]
  ------------------
 3113|    710|            (*result)++;
 3114|    710|            probe2++;
 3115|    710|        }
 3116|  6.87k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  6.87k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.87k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.87k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3117|  6.87k|            v1, probe1 + 1, end1, v2, probe2, end2, result
 3118|  6.87k|        );
 3119|  7.06k|    } else {
 3120|  7.06k|        probe2 = begin2 + (size2 >> 1);      /* pick the median element */
 3121|  7.06k|        FUNCTION(igraph_i_vector, binsearch_slice)(v1, VECTOR(*v2)[probe2], &probe1, begin1, end1);
  ------------------
  |  |  178|  7.06k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  7.06k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  7.06k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      FUNCTION(igraph_i_vector, binsearch_slice)(v1, VECTOR(*v2)[probe2], &probe1, begin1, end1);
  ------------------
  |  |   60|  7.06k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3122|  7.06k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  7.06k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  7.06k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  7.06k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3123|  7.06k|            v1, begin1, probe1, v2, begin2, probe2, result
 3124|  7.06k|        );
 3125|  7.06k|        if (!(probe1 == end1 || VECTOR(*v2)[probe2] < VECTOR(*v1)[probe1])) {
  ------------------
  |  |   60|  6.81k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (!(probe1 == end1 || VECTOR(*v2)[probe2] < VECTOR(*v1)[probe1])) {
  ------------------
  |  |   60|  6.81k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (3125:15): [True: 245, False: 6.81k]
  |  Branch (3125:33): [True: 5.94k, False: 869]
  ------------------
 3126|    869|            (*result)++;
 3127|    869|            probe1++;
 3128|    869|        }
 3129|  7.06k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  7.06k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  7.06k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  7.06k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3130|  7.06k|            v1, probe1, end1, v2, probe2 + 1, end2, result
 3131|  7.06k|        );
 3132|  7.06k|    }
 3133|  13.9k|}

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

igraph_adjlist_init:
  155|  3.30k|                        igraph_bool_t multiple) {
  156|       |
  157|  3.30k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  158|  3.30k|    igraph_vector_int_t degrees;
  159|  3.30k|    int iter = 0;
  160|       |
  161|  3.30k|    multiple = !!multiple; /* normalize Boolean value to enable == comparisons below */
  162|       |
  163|  3.30k|    if (mode != IGRAPH_IN && mode != IGRAPH_OUT && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (163:9): [True: 3.30k, False: 0]
  |  Branch (163:30): [True: 3.30k, False: 0]
  |  Branch (163:52): [True: 0, False: 3.30k]
  ------------------
  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.30k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (167:9): [True: 0, False: 3.30k]
  ------------------
  168|      0|        mode = IGRAPH_ALL;
  169|      0|    }
  170|       |
  171|  3.30k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, no_of_nodes);
  ------------------
  |  |  119|  3.30k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.30k|    do { \
  |  |  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.30k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.30k|    do { \
  |  |  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  172|       |    /* igraph_degree() is fast when loops=true */
  173|  3.30k|    IGRAPH_CHECK(igraph_degree(graph, &degrees, igraph_vss_all(), mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  174|       |
  175|  3.30k|    al->length = no_of_nodes;
  176|  3.30k|    al->adjs = IGRAPH_CALLOC(al->length, igraph_vector_int_t);
  ------------------
  |  |   33|  3.30k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.60k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.30k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.30k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.30k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  3.30k|    IGRAPH_CHECK_OOM(al->adjs, "Insufficient memory for creating adjacency list view.");
  ------------------
  |  |  709|  3.30k|    do { \
  |  |  710|  3.30k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  178|  3.30k|    IGRAPH_FINALLY(igraph_adjlist_destroy, al);
  ------------------
  |  |  603|  3.30k|    do { \
  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  ------------------
  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  179|       |
  180|       |    /* if we already know there are no multi-edges, they don't need to be removed */
  181|  3.30k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI) &&
  ------------------
  |  Branch (181:9): [True: 3.30k, False: 0]
  ------------------
  182|  3.30k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MULTI)) {
  ------------------
  |  Branch (182:9): [True: 3.30k, False: 0]
  ------------------
  183|       |
  184|       |        /* special case: if the graph is directed, but we are ignoring edge directions,
  185|       |         * mutual edges also act as multi-edges */
  186|  3.30k|        if (igraph_is_directed(graph) && mode == IGRAPH_ALL) {
  ------------------
  |  Branch (186:13): [True: 3.30k, False: 0]
  |  Branch (186:42): [True: 3.30k, False: 0]
  ------------------
  187|  3.30k|            if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MUTUAL) &&
  ------------------
  |  Branch (187:17): [True: 0, False: 3.30k]
  ------------------
  188|      0|                !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MUTUAL)) {
  ------------------
  |  Branch (188:17): [True: 0, False: 0]
  ------------------
  189|      0|                multiple = IGRAPH_MULTIPLE;
  190|      0|            }
  191|  3.30k|        } else {
  192|      0|            multiple = IGRAPH_MULTIPLE;
  193|      0|        }
  194|  3.30k|    }
  195|       |
  196|       |    /* if we already know there are no loops, they don't need to be removed */
  197|  3.30k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (197:9): [True: 3.30k, False: 0]
  ------------------
  198|  3.30k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (198:9): [True: 3.30k, False: 0]
  ------------------
  199|  3.30k|        if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (199:13): [True: 3.30k, False: 0]
  ------------------
  200|  3.30k|            loops = IGRAPH_LOOPS_TWICE;
  201|  3.30k|        } else {
  202|      0|            loops = IGRAPH_LOOPS_ONCE;
  203|      0|        }
  204|  3.30k|    }
  205|       |
  206|  3.30k|    igraph_bool_t has_loops = false;
  207|  3.30k|    igraph_bool_t has_multiple = false;
  208|       |
  209|       |    /* In theory, we could just run igraph_neighbors() in a loop with 'loops'
  210|       |     * and 'multiple' set exactly how the caller wants it. However, we take the
  211|       |     * opportunity to also _cache_ whether the graph has multiple or loop edges
  212|       |     * if we are looping over all vertices anyway, and that requires us to query
  213|       |     * the neighbors in full */
  214|       |
  215|   152k|    for (igraph_int_t i = 0; i < al->length; i++) {
  ------------------
  |  Branch (215:30): [True: 149k, False: 3.30k]
  ------------------
  216|   149k|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1000);
  ------------------
  |  |   71|   149k|    do { \
  |  |   72|   149k|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 0, False: 149k]
  |  |  ------------------
  |  |   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|   149k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 149k]
  |  |  ------------------
  ------------------
  217|       |
  218|   149k|        IGRAPH_CHECK(igraph_vector_int_init(&al->adjs[i], VECTOR(degrees)[i]));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  219|   149k|        IGRAPH_CHECK(igraph_neighbors(graph, &al->adjs[i], i, mode, IGRAPH_LOOPS, IGRAPH_MULTIPLE));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  220|       |
  221|       |        /* Attention: This function will only set values for has_loops and has_multiple
  222|       |         * if it finds loops/multi-edges. Otherwise, they are left at their original value. */
  223|   149k|        IGRAPH_CHECK(igraph_i_simplify_sorted_int_adjacency_vector_in_place(
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  224|   149k|            &al->adjs[i], i, mode, loops, multiple, &has_loops, &has_multiple
  225|   149k|        ));
  226|   149k|    }
  227|  3.30k|    if (has_loops) {
  ------------------
  |  Branch (227:9): [True: 0, False: 3.30k]
  ------------------
  228|       |        /* If we have found at least one loop above, set the cache to true. */
  229|      0|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_LOOP, true);
  230|  3.30k|    } else if (loops == IGRAPH_NO_LOOPS) {
  ------------------
  |  Branch (230:16): [True: 0, False: 3.30k]
  ------------------
  231|       |        /* If we explicitly _checked_ for loops (to remove them) and haven't
  232|       |         * found one, set the cache to false. This is the only case when a
  233|       |         * definite "no" from has_loops really means that there are no loops at
  234|       |         * all. */
  235|      0|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_LOOP, false);
  236|      0|    }
  237|  3.30k|    if (has_multiple) {
  ------------------
  |  Branch (237:9): [True: 596, False: 2.70k]
  ------------------
  238|       |        /* If we have found at least one multiedge above, set the cache to true,
  239|       |         * except when treating a directed graph as undirected. In that case, mutual
  240|       |         * edges would also look like multi-edges in this check. */
  241|    596|        if (! igraph_is_directed(graph) || mode != IGRAPH_ALL) {
  ------------------
  |  Branch (241:13): [True: 0, False: 596]
  |  Branch (241:44): [True: 0, False: 596]
  ------------------
  242|      0|            igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, true);
  243|      0|        }
  244|  2.70k|    } else if (multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (244:16): [True: 2.70k, False: 0]
  ------------------
  245|       |        /* If we explicitly _checked_ for multi-edges (to remove them) and
  246|       |         * haven't found one, set the cache to false. This is the only case
  247|       |         * when a definite "no" from has_multiple really means that there are
  248|       |         * no multi-edges at all. */
  249|  2.70k|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, false);
  250|  2.70k|    }
  251|       |
  252|  3.30k|    igraph_vector_int_destroy(&degrees);
  253|  3.30k|    IGRAPH_FINALLY_CLEAN(2); /* + igraph_adjlist_destroy */
  254|       |
  255|  3.30k|    return IGRAPH_SUCCESS;
  256|  3.30k|}
igraph_adjlist_destroy:
  475|  3.30k|void igraph_adjlist_destroy(igraph_adjlist_t *al) {
  476|   152k|    for (igraph_int_t i = 0; i < al->length; i++) {
  ------------------
  |  Branch (476:30): [True: 149k, False: 3.30k]
  ------------------
  477|       |        /* This works if some igraph_vector_int_t's contain NULL,
  478|       |           because igraph_vector_int_destroy can handle this. */
  479|   149k|        igraph_vector_int_destroy(&al->adjs[i]);
  480|   149k|    }
  481|       |    IGRAPH_FREE(al->adjs);
  ------------------
  |  |   36|  3.30k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  482|  3.30k|}
igraph_inclist_init:
  746|  43.1k|                        igraph_loops_t loops) {
  747|  43.1k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  748|  43.1k|    igraph_vector_int_t degrees;
  749|  43.1k|    int iter = 0;
  750|       |
  751|  43.1k|    if (mode != IGRAPH_IN && mode != IGRAPH_OUT && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (751:9): [True: 39.7k, False: 3.40k]
  |  Branch (751:30): [True: 29.6k, False: 10.0k]
  |  Branch (751:52): [True: 0, False: 29.6k]
  ------------------
  752|      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]
  |  |  ------------------
  ------------------
  753|      0|    }
  754|       |
  755|  43.1k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (755:9): [True: 11.5k, False: 31.5k]
  ------------------
  756|  11.5k|        mode = IGRAPH_ALL;
  757|  11.5k|    }
  758|       |
  759|  43.1k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, no_of_nodes);
  ------------------
  |  |  119|  43.1k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  43.1k|    do { \
  |  |  |  |  657|  43.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  43.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  43.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 43.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|  43.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 43.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  43.1k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  43.1k|    do { \
  |  |  |  |  604|  43.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  43.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  43.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  43.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 43.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  43.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  43.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 43.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 43.1k]
  |  |  ------------------
  ------------------
  760|       |    /* igraph_degrees() is fast when loops=true */
  761|  43.1k|    IGRAPH_CHECK(igraph_degree(graph, &degrees, igraph_vss_all(), mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|  43.1k|    do { \
  |  |  657|  43.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  43.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  43.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 43.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|  43.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 43.1k]
  |  |  ------------------
  ------------------
  762|       |
  763|  43.1k|    il->length = no_of_nodes;
  764|  43.1k|    il->incs = IGRAPH_CALLOC(il->length, igraph_vector_int_t);
  ------------------
  |  |   33|  43.1k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  86.2k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 43.1k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 43.1k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 43.0k, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  765|  43.1k|    if (il->incs == 0) {
  ------------------
  |  Branch (765:9): [True: 0, False: 43.1k]
  ------------------
  766|      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]
  |  |  ------------------
  ------------------
  767|      0|    }
  768|       |
  769|  43.1k|    IGRAPH_FINALLY(igraph_inclist_destroy, il);
  ------------------
  |  |  603|  43.1k|    do { \
  |  |  604|  43.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  43.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  43.1k|         * incorrect destructor function with the pointer */ \
  |  |  607|  43.1k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 43.1k]
  |  |  ------------------
  |  |  608|  43.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  43.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 43.1k]
  |  |  ------------------
  ------------------
  770|  1.96M|    for (igraph_int_t i = 0; i < il->length; i++) {
  ------------------
  |  Branch (770:30): [True: 1.92M, False: 43.1k]
  ------------------
  771|  1.92M|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1000);
  ------------------
  |  |   71|  1.92M|    do { \
  |  |   72|  1.92M|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 0, False: 1.92M]
  |  |  ------------------
  |  |   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.92M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 1.92M]
  |  |  ------------------
  ------------------
  772|       |
  773|  1.92M|        IGRAPH_CHECK(igraph_vector_int_init(&il->incs[i], VECTOR(degrees)[i]));
  ------------------
  |  |  656|  1.92M|    do { \
  |  |  657|  1.92M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.92M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.92M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.92M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.92M]
  |  |  ------------------
  ------------------
  774|  1.92M|        IGRAPH_CHECK(igraph_incident(graph, &il->incs[i], i, mode, loops));
  ------------------
  |  |  656|  1.92M|    do { \
  |  |  657|  1.92M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.92M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.92M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.92M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.92M]
  |  |  ------------------
  ------------------
  775|  1.92M|    }
  776|       |
  777|  43.1k|    igraph_vector_int_destroy(&degrees);
  778|  43.1k|    IGRAPH_FINALLY_CLEAN(2); /* + igraph_inclist_destroy */
  779|       |
  780|  43.1k|    return IGRAPH_SUCCESS;
  781|  43.1k|}
igraph_inclist_destroy:
  825|  43.1k|void igraph_inclist_destroy(igraph_inclist_t *il) {
  826|  1.96M|    for (igraph_int_t i = 0; i < il->length; i++) {
  ------------------
  |  Branch (826:30): [True: 1.92M, False: 43.1k]
  ------------------
  827|       |        /* This works if some igraph_vector_int_t's contain NULL,
  828|       |           because igraph_vector_int_destroy can handle this. */
  829|  1.92M|        igraph_vector_int_destroy(&il->incs[i]);
  830|  1.92M|    }
  831|       |    IGRAPH_FREE(il->incs);
  ------------------
  |  |   36|  43.1k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  832|  43.1k|}
igraph_lazy_adjlist_init:
 1070|  3.30k|                             igraph_bool_t multiple) {
 1071|  3.30k|    if (mode != IGRAPH_IN && mode != IGRAPH_OUT && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1071:9): [True: 3.30k, False: 0]
  |  Branch (1071:30): [True: 3.30k, False: 0]
  |  Branch (1071:52): [True: 0, False: 3.30k]
  ------------------
 1072|      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]
  |  |  ------------------
  ------------------
 1073|      0|    }
 1074|       |
 1075|  3.30k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (1075:9): [True: 0, False: 3.30k]
  ------------------
 1076|      0|        mode = IGRAPH_ALL;
 1077|      0|    }
 1078|       |
 1079|       |    /* if we already know there are no multi-edges, they don't need to be removed */
 1080|  3.30k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI) &&
  ------------------
  |  Branch (1080:9): [True: 3.30k, False: 0]
  ------------------
 1081|  3.30k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MULTI)) {
  ------------------
  |  Branch (1081:9): [True: 3.30k, False: 0]
  ------------------
 1082|       |
 1083|       |        /* special case: if the graph is directed, but we are ignoring edge directions,
 1084|       |         * mutual edges also act as multi-edges */
 1085|  3.30k|        if (igraph_is_directed(graph) && mode == IGRAPH_ALL) {
  ------------------
  |  Branch (1085:13): [True: 3.30k, False: 0]
  |  Branch (1085:42): [True: 3.30k, False: 0]
  ------------------
 1086|  3.30k|            if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MUTUAL) &&
  ------------------
  |  Branch (1086:17): [True: 0, False: 3.30k]
  ------------------
 1087|      0|                !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MUTUAL)) {
  ------------------
  |  Branch (1087:17): [True: 0, False: 0]
  ------------------
 1088|      0|                multiple = IGRAPH_MULTIPLE;
 1089|      0|            }
 1090|  3.30k|        } else {
 1091|      0|            multiple = IGRAPH_MULTIPLE;
 1092|      0|        }
 1093|  3.30k|    }
 1094|       |
 1095|       |    /* if we already know there are no loops, they don't need to be removed */
 1096|  3.30k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (1096:9): [True: 3.30k, False: 0]
  ------------------
 1097|  3.30k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (1097:9): [True: 3.30k, False: 0]
  ------------------
 1098|  3.30k|        if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (1098:13): [True: 3.30k, False: 0]
  ------------------
 1099|  3.30k|            loops = IGRAPH_LOOPS_TWICE;
 1100|  3.30k|        } else {
 1101|      0|            loops = IGRAPH_LOOPS_ONCE;
 1102|      0|        }
 1103|  3.30k|    }
 1104|       |
 1105|  3.30k|    al->mode = mode;
 1106|  3.30k|    al->loops = loops;
 1107|  3.30k|    al->multiple = multiple;
 1108|  3.30k|    al->graph = graph;
 1109|       |
 1110|  3.30k|    al->length = igraph_vcount(graph);
 1111|  3.30k|    al->adjs = IGRAPH_CALLOC(al->length, igraph_vector_int_t*);
  ------------------
  |  |   33|  3.30k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.60k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.30k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.30k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.30k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1112|  3.30k|    IGRAPH_CHECK_OOM(al->adjs, "Insufficient memory for creating lazy adjacency list view.");
  ------------------
  |  |  709|  3.30k|    do { \
  |  |  710|  3.30k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
 1113|       |
 1114|  3.30k|    return IGRAPH_SUCCESS;
 1115|  3.30k|}
igraph_lazy_adjlist_destroy:
 1127|  3.30k|void igraph_lazy_adjlist_destroy(igraph_lazy_adjlist_t *al) {
 1128|  3.30k|    igraph_lazy_adjlist_clear(al);
 1129|       |    IGRAPH_FREE(al->adjs);
  ------------------
  |  |   36|  3.30k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1130|  3.30k|}
igraph_lazy_adjlist_clear:
 1140|  3.30k|void igraph_lazy_adjlist_clear(igraph_lazy_adjlist_t *al) {
 1141|  3.30k|    igraph_int_t i, n = al->length;
 1142|   152k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1142:17): [True: 149k, False: 3.30k]
  ------------------
 1143|   149k|        if (al->adjs[i] != 0) {
  ------------------
  |  Branch (1143:13): [True: 149k, False: 0]
  ------------------
 1144|   149k|            igraph_vector_int_destroy(al->adjs[i]);
 1145|       |            IGRAPH_FREE(al->adjs[i]);
  ------------------
  |  |   36|   149k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1146|   149k|        }
 1147|   149k|    }
 1148|  3.30k|}
igraph_i_lazy_adjlist_get_real:
 1163|   149k|igraph_vector_int_t *igraph_i_lazy_adjlist_get_real(igraph_lazy_adjlist_t *al, igraph_int_t no) {
 1164|   149k|    igraph_error_t ret;
 1165|       |
 1166|   149k|    if (al->adjs[no] == NULL) {
  ------------------
  |  Branch (1166:9): [True: 149k, False: 0]
  ------------------
 1167|   149k|        al->adjs[no] = IGRAPH_CALLOC(1, igraph_vector_int_t);
  ------------------
  |  |   33|   149k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|   299k|    (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: 149k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1168|   149k|        if (al->adjs[no] == NULL) {
  ------------------
  |  Branch (1168:13): [True: 0, False: 149k]
  ------------------
 1169|      0|            return NULL;
 1170|      0|        }
 1171|       |
 1172|   149k|        ret = igraph_vector_int_init(al->adjs[no], 0);
 1173|   149k|        if (ret != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (1173:13): [True: 0, False: 149k]
  ------------------
 1174|      0|            IGRAPH_FREE(al->adjs[no]);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1175|      0|            return NULL;
 1176|      0|        }
 1177|       |
 1178|   149k|        ret = igraph_neighbors(al->graph, al->adjs[no], no, al->mode, al->loops, al->multiple);
 1179|   149k|        if (ret != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (1179:13): [True: 0, False: 149k]
  ------------------
 1180|      0|            igraph_vector_int_destroy(al->adjs[no]);
 1181|      0|            IGRAPH_FREE(al->adjs[no]);
  ------------------
  |  |   36|      0|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1182|      0|            return NULL;
 1183|      0|        }
 1184|   149k|    }
 1185|       |
 1186|   149k|    return al->adjs[no];
 1187|   149k|}
adjlist.c:igraph_i_simplify_sorted_int_adjacency_vector_in_place:
  871|   149k|) {
  872|   149k|    igraph_bool_t dummy1 = true, dummy2 = true; /* set dummies to avoid uninitialized read */
  873|   149k|    if (has_loops == NULL) {
  ------------------
  |  Branch (873:9): [True: 0, False: 149k]
  ------------------
  874|      0|        has_loops = &dummy1;
  875|      0|    }
  876|   149k|    if (has_multiple == NULL) {
  ------------------
  |  Branch (876:9): [True: 0, False: 149k]
  ------------------
  877|      0|        has_multiple = &dummy2;
  878|      0|    }
  879|       |
  880|   149k|    igraph_int_t i, p = 0;
  881|   149k|    igraph_int_t n = igraph_vector_int_size(v);
  882|       |
  883|   149k|    multiple = !!multiple; /* normalize Boolean value to enable == comparisons below */
  884|       |
  885|   149k|    if (
  886|   149k|        multiple == IGRAPH_MULTIPLE &&
  ------------------
  |  Branch (886:9): [True: 0, False: 149k]
  ------------------
  887|      0|        (
  888|      0|            loops == IGRAPH_LOOPS_TWICE ||
  ------------------
  |  Branch (888:13): [True: 0, False: 0]
  ------------------
  889|      0|            (loops == IGRAPH_LOOPS_ONCE && (mode == IGRAPH_IN || mode == IGRAPH_OUT))
  ------------------
  |  Branch (889:14): [True: 0, False: 0]
  |  Branch (889:45): [True: 0, False: 0]
  |  Branch (889:66): [True: 0, False: 0]
  ------------------
  890|      0|        )
  891|   149k|    ) {
  892|       |        /* nothing to simplify */
  893|      0|        return IGRAPH_SUCCESS;
  894|      0|    }
  895|       |
  896|   149k|    if (loops == IGRAPH_NO_LOOPS) {
  ------------------
  |  Branch (896:9): [True: 0, False: 149k]
  ------------------
  897|      0|        if (multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (897:13): [True: 0, False: 0]
  ------------------
  898|       |            /* We need to get rid of loops and multiple edges completely */
  899|      0|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (899:25): [True: 0, False: 0]
  ------------------
  900|      0|                if (VECTOR(*v)[i] != index &&
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (900:21): [True: 0, False: 0]
  ------------------
  901|      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 (901:22): [True: 0, False: 0]
  |  Branch (901:36): [True: 0, False: 0]
  ------------------
  902|      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)
  ------------------
  903|      0|                    p++;
  904|      0|                } else {
  905|      0|                    if (VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (905:25): [True: 0, False: 0]
  ------------------
  906|      0|                        *has_loops = true;
  907|       |                        /* If we haven't found multi-edges yet, we also need to check
  908|       |                         * if this is a multi-loop, to set 'has_multiple' correctly. */
  909|      0|                        if (! *has_multiple) {
  ------------------
  |  Branch (909:29): [True: 0, False: 0]
  ------------------
  910|      0|                            if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (910:33): [True: 0, False: 0]
  ------------------
  911|       |                                /* Undirected loops appear twice in the neighbour list,
  912|       |                                 * so we check two following items instead of one. */
  913|      0|                                if (i < n - 2 &&
  ------------------
  |  Branch (913:37): [True: 0, False: 0]
  ------------------
  914|      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 (914:37): [True: 0, False: 0]
  ------------------
  915|      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 (915:37): [True: 0, False: 0]
  ------------------
  916|      0|                                    *has_multiple = true;
  917|      0|                                }
  918|      0|                            } else {
  919|      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 (919:37): [True: 0, False: 0]
  |  Branch (919:51): [True: 0, False: 0]
  ------------------
  920|      0|                                    *has_multiple = true;
  921|      0|                                }
  922|      0|                            }
  923|      0|                        }
  924|      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 (924:32): [True: 0, False: 0]
  |  Branch (924:46): [True: 0, False: 0]
  ------------------
  925|      0|                        *has_multiple = true;
  926|      0|                    }
  927|      0|                }
  928|      0|            }
  929|      0|        } else {
  930|       |            /* We need to get rid of loops but keep multiple edges */
  931|      0|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (931:25): [True: 0, False: 0]
  ------------------
  932|      0|                if (VECTOR(*v)[i] != index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (932:21): [True: 0, False: 0]
  ------------------
  933|      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)
  ------------------
  934|      0|                    p++;
  935|      0|                } else {
  936|      0|                    *has_loops = true;
  937|      0|                }
  938|      0|            }
  939|      0|        }
  940|   149k|    } else if (loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (940:16): [True: 0, False: 149k]
  ------------------
  941|      0|        if (multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (941:13): [True: 0, False: 0]
  ------------------
  942|       |            /* We need to get rid of multiple edges completely (including
  943|       |             * multiple loop edges), but keep one edge from each loop edge */
  944|      0|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (944:25): [True: 0, False: 0]
  ------------------
  945|      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 (945:21): [True: 0, False: 0]
  |  Branch (945:35): [True: 0, False: 0]
  ------------------
  946|      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)
  ------------------
  947|      0|                    p++;
  948|      0|                } else if (
  949|       |                        /* If this is not a loop then we have a multigraph.
  950|       |                           Else we have at least two loops.
  951|       |                           The v vector comes from a call to igraph_neighbors.
  952|       |                           This will count loops twice if mode == IGRAPH_ALL.
  953|       |                           So if mode != IGRAPH_ALL,
  954|       |                           then we have a multigraph.
  955|       |                           If mode == IGRAPH_ALL and we have three loops
  956|       |                           then we also have a multigraph
  957|       |                           */
  958|      0|                        (VECTOR(*v)[i] != index) ||
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (958:25): [True: 0, False: 0]
  ------------------
  959|      0|                       (mode != IGRAPH_ALL)  ||
  ------------------
  |  Branch (959:24): [True: 0, False: 0]
  ------------------
  960|      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 (960:25): [True: 0, False: 0]
  |  Branch (960:47): [True: 0, False: 0]
  |  Branch (960:60): [True: 0, False: 0]
  ------------------
  961|      0|                       ){
  962|      0|                    *has_multiple = true;
  963|      0|                }
  964|      0|            }
  965|      0|        } else {
  966|       |            /* We need to keep one edge from each loop edge and we don't need to
  967|       |             * touch multiple edges. Note that we can get here only if
  968|       |             * mode == IGRAPH_ALL; if mode was IGRAPH_IN or IGRAPH_OUT, we would
  969|       |             * have bailed out earlier */
  970|      0|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (970:25): [True: 0, False: 0]
  ------------------
  971|      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)
  ------------------
  972|      0|                if (VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (972:21): [True: 0, False: 0]
  ------------------
  973|      0|                    *has_loops = true;
  974|       |                    /* this was a loop edge so if the next element is the same, we
  975|       |                    * need to skip that */
  976|      0|                    if (i < n-1 && VECTOR(*v)[i + 1] == index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (976:25): [True: 0, False: 0]
  |  Branch (976:36): [True: 0, False: 0]
  ------------------
  977|      0|                        i++;
  978|      0|                    }
  979|      0|                }
  980|      0|                p++;
  981|      0|            }
  982|      0|        }
  983|   149k|    } else if (loops == IGRAPH_LOOPS_TWICE && multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (983:16): [True: 149k, False: 0]
  |  Branch (983:47): [True: 149k, False: 0]
  ------------------
  984|       |        /* We need to get rid of multiple edges completely (including
  985|       |         * multiple loop edges), but keep both edge from each loop edge */
  986|   260k|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (986:21): [True: 110k, False: 149k]
  ------------------
  987|   110k|            if (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i]) {
  ------------------
  |  |   60|  63.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          if (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i]) {
  ------------------
  |  |   60|  63.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (987:17): [True: 47.4k, False: 63.0k]
  |  Branch (987:31): [True: 60.1k, False: 2.91k]
  ------------------
  988|   107k|                VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|   107k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|   107k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  989|   107k|                p++;
  990|   107k|            } else {
  991|  2.91k|                *has_multiple = true;
  992|       |                /* Current item is the same as the next one, but if it is a
  993|       |                 * loop edge, then the first one or two items are okay. We need
  994|       |                 * to keep one if mode == IGRAPH_IN or mode == IGRAPH_OUT,
  995|       |                 * otherwise we need to keep two */
  996|  2.91k|                if (VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|  2.91k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (996:21): [True: 0, False: 2.91k]
  ------------------
  997|      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)
  ------------------
  998|      0|                    p++;
  999|      0|                    if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (999:25): [True: 0, False: 0]
  ------------------
 1000|      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)
  ------------------
 1001|      0|                        p++;
 1002|      0|                    }
 1003|       |                    /* skip over all the items corresponding to the loop edges */
 1004|      0|                    while (i < n && VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1004:28): [True: 0, False: 0]
  |  Branch (1004:37): [True: 0, False: 0]
  ------------------
 1005|      0|                        i++;
 1006|      0|                    }
 1007|      0|                    i--; /* because the for loop also increases i by 1 */
 1008|      0|                }
 1009|  2.91k|            }
 1010|   110k|        }
 1011|   149k|    } else {
 1012|       |        /* TODO; we don't use this combination yet */
 1013|      0|        return IGRAPH_UNIMPLEMENTED;
 1014|      0|    }
 1015|       |
 1016|       |    /* always succeeds since we are never growing the vector */
 1017|   149k|    igraph_vector_int_resize(v, p);
 1018|       |
 1019|   149k|    return IGRAPH_SUCCESS;
 1020|   149k|}

igraph_attribute_record_init:
  126|  40.8k|) {
  127|  40.8k|    attr->name = NULL;
  128|  40.8k|    attr->type = IGRAPH_ATTRIBUTE_UNSPECIFIED;
  129|  40.8k|    attr->value.as_raw = NULL;
  130|  40.8k|    attr->default_value.string = NULL;
  131|       |
  132|  40.8k|    IGRAPH_CHECK(igraph_attribute_record_set_name(attr, name));
  ------------------
  |  |  656|  40.8k|    do { \
  |  |  657|  40.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  40.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  40.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
  133|  40.8k|    IGRAPH_FINALLY(igraph_free, attr->name);
  ------------------
  |  |  603|  40.8k|    do { \
  |  |  604|  40.8k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  40.8k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  40.8k|         * incorrect destructor function with the pointer */ \
  |  |  607|  40.8k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 40.8k]
  |  |  ------------------
  |  |  608|  40.8k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  40.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
  134|  40.8k|    IGRAPH_CHECK(igraph_attribute_record_set_type(attr, type));
  ------------------
  |  |  656|  40.8k|    do { \
  |  |  657|  40.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  40.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  40.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
  135|  40.8k|    IGRAPH_FINALLY_CLEAN(1);
  136|       |
  137|  40.8k|    return IGRAPH_SUCCESS;
  138|  40.8k|}
igraph_attribute_record_init_copy:
  159|  23.8k|) {
  160|  23.8k|    IGRAPH_CHECK(igraph_attribute_record_init(to, from->name, from->type));
  ------------------
  |  |  656|  23.8k|    do { \
  |  |  657|  23.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  23.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  23.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 23.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|  23.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 23.8k]
  |  |  ------------------
  ------------------
  161|       |
  162|  23.8k|    switch (from->type) {
  163|  23.8k|        case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (163:9): [True: 23.8k, False: 0]
  ------------------
  164|  23.8k|            IGRAPH_CHECK(igraph_vector_update(to->value.as_vector, from->value.as_vector));
  ------------------
  |  |  656|  23.8k|    do { \
  |  |  657|  23.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  23.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  23.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 23.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|  23.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 23.8k]
  |  |  ------------------
  ------------------
  165|  23.8k|            break;
  166|       |
  167|  23.8k|        case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (167:9): [True: 0, False: 23.8k]
  ------------------
  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: 23.8k]
  ------------------
  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: 23.8k]
  ------------------
  176|      0|            break;
  177|       |
  178|      0|        default:
  ------------------
  |  Branch (178:9): [True: 0, False: 23.8k]
  ------------------
  179|      0|            break;
  180|  23.8k|    }
  181|       |
  182|  23.8k|    return IGRAPH_SUCCESS;
  183|  23.8k|}
igraph_attribute_record_destroy:
  241|  40.8k|void igraph_attribute_record_destroy(igraph_attribute_record_t *attr) {
  242|  40.8k|    igraph_i_attribute_record_destroy_values(attr);
  243|       |
  244|  40.8k|    if (attr->name) {
  ------------------
  |  Branch (244:9): [True: 40.8k, False: 0]
  ------------------
  245|  40.8k|        igraph_free(attr->name);
  246|       |        attr->name = NULL;
  247|  40.8k|    }
  248|  40.8k|}
igraph_attribute_record_check_type:
  264|  6.80k|) {
  265|  6.80k|    if (type != attr->type) {
  ------------------
  |  Branch (265:9): [True: 0, False: 6.80k]
  ------------------
  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|  6.80k|    return IGRAPH_SUCCESS;
  286|  6.80k|}
igraph_attribute_record_size:
  295|  6.75k|igraph_int_t igraph_attribute_record_size(const igraph_attribute_record_t *attr) {
  296|  6.75k|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|  6.75k|    do { \
  |  |  925|  6.75k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.75k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  6.75k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 6.75k]
  |  |  ------------------
  ------------------
  297|       |
  298|  6.75k|    switch (attr->type) {
  299|  6.75k|        case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (299:9): [True: 6.75k, False: 0]
  ------------------
  300|  6.75k|            return igraph_vector_size(attr->value.as_vector);
  301|       |
  302|      0|        case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (302:9): [True: 0, False: 6.75k]
  ------------------
  303|      0|            return igraph_strvector_size(attr->value.as_strvector);
  304|       |
  305|      0|        case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (305:9): [True: 0, False: 6.75k]
  ------------------
  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: 6.75k]
  ------------------
  309|      0|            return 0;
  310|       |
  311|      0|        default:
  ------------------
  |  Branch (311:9): [True: 0, False: 6.75k]
  ------------------
  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|  6.75k|    }
  314|  6.75k|}
igraph_attribute_record_resize:
  332|  16.9k|) {
  333|  16.9k|    igraph_int_t i;
  334|  16.9k|    igraph_vector_t *vec;
  335|  16.9k|    igraph_vector_bool_t *log;
  336|  16.9k|    igraph_strvector_t *str;
  337|       |
  338|  16.9k|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|  16.9k|    do { \
  |  |  925|  16.9k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  16.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  339|       |
  340|  16.9k|    switch (attr->type) {
  341|       |
  342|  16.9k|        case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (342:9): [True: 16.9k, False: 0]
  ------------------
  343|  16.9k|            vec = attr->value.as_vector;
  344|  16.9k|            i = igraph_vector_size(vec);
  345|  16.9k|            IGRAPH_CHECK(igraph_vector_resize(vec, new_size));
  ------------------
  |  |  656|  16.9k|    do { \
  |  |  657|  16.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  16.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  16.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 16.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|  16.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 16.9k]
  |  |  ------------------
  ------------------
  346|   520k|            while (i < new_size) {
  ------------------
  |  Branch (346:20): [True: 503k, False: 16.9k]
  ------------------
  347|   503k|                VECTOR(*vec)[i++] = attr->default_value.numeric;
  ------------------
  |  |   60|   503k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  348|   503k|            }
  349|  16.9k|            break;
  350|       |
  351|      0|        case IGRAPH_ATTRIBUTE_BOOLEAN:
  ------------------
  |  Branch (351:9): [True: 0, False: 16.9k]
  ------------------
  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: 16.9k]
  ------------------
  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: 16.9k]
  ------------------
  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: 16.9k]
  ------------------
  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|  16.9k|    }
  380|       |
  381|  16.9k|    return IGRAPH_SUCCESS;
  382|  16.9k|}
igraph_attribute_record_set_default_numeric:
  399|  40.8k|) {
  400|  40.8k|    if (attr->type != IGRAPH_ATTRIBUTE_NUMERIC) {
  ------------------
  |  Branch (400:9): [True: 0, False: 40.8k]
  ------------------
  401|      0|        return IGRAPH_EINVAL;
  402|      0|    }
  403|       |
  404|  40.8k|    attr->default_value.numeric = value;
  405|  40.8k|    return IGRAPH_SUCCESS;
  406|  40.8k|}
igraph_attribute_record_set_name:
  483|  47.6k|) {
  484|  47.6k|    char *new_name;
  485|       |
  486|  47.6k|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|  47.6k|    do { \
  |  |  925|  47.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  47.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 47.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  47.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 47.6k]
  |  |  ------------------
  ------------------
  487|       |
  488|  47.6k|    if (name != NULL) {
  ------------------
  |  Branch (488:9): [True: 40.8k, False: 6.80k]
  ------------------
  489|  40.8k|        new_name = strdup(name);
  490|  40.8k|        IGRAPH_CHECK_OOM(new_name, "Insufficient memory for allocating attribute name.");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  491|  40.8k|    } else {
  492|  6.80k|        new_name = NULL;
  493|  6.80k|    }
  494|       |
  495|  47.6k|    if (attr->name) {
  ------------------
  |  Branch (495:9): [True: 0, False: 47.6k]
  ------------------
  496|      0|        igraph_free(attr->name);
  497|      0|    }
  498|       |
  499|  47.6k|    attr->name = new_name;
  500|       |
  501|  47.6k|    return IGRAPH_SUCCESS;
  502|  47.6k|}
igraph_attribute_record_set_type:
  539|  47.6k|) {
  540|  47.6k|    void *ptr;
  541|       |
  542|  47.6k|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|  47.6k|    do { \
  |  |  925|  47.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  47.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 47.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  47.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 47.6k]
  |  |  ------------------
  ------------------
  543|       |
  544|  47.6k|    if (attr->type != type) {
  ------------------
  |  Branch (544:9): [True: 40.8k, False: 6.80k]
  ------------------
  545|  40.8k|        switch (type) {
  546|  40.8k|            case IGRAPH_ATTRIBUTE_NUMERIC: {
  ------------------
  |  Branch (546:13): [True: 40.8k, False: 0]
  ------------------
  547|  40.8k|                igraph_vector_t *vec = IGRAPH_CALLOC(1, igraph_vector_t);
  ------------------
  |  |   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.6k|    (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: 40.8k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|  40.8k|                IGRAPH_CHECK_OOM(vec, "Insufficient memory for attribute record.");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  549|  40.8k|                IGRAPH_FINALLY(igraph_free, vec);
  ------------------
  |  |  603|  40.8k|    do { \
  |  |  604|  40.8k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  40.8k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  40.8k|         * incorrect destructor function with the pointer */ \
  |  |  607|  40.8k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 40.8k]
  |  |  ------------------
  |  |  608|  40.8k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  40.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
  550|  40.8k|                IGRAPH_VECTOR_INIT_FINALLY(vec, 0);
  ------------------
  |  |  104|  40.8k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  40.8k|    do { \
  |  |  |  |  657|  40.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  40.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  40.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 40.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  40.8k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  40.8k|    do { \
  |  |  |  |  604|  40.8k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  40.8k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  40.8k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  40.8k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 40.8k]
  |  |  |  |  ------------------
  |  |  |  |  608|  40.8k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  40.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 40.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
  551|  40.8k|                ptr = vec;
  552|  40.8k|            }
  553|      0|            break;
  554|       |
  555|      0|            case IGRAPH_ATTRIBUTE_STRING: {
  ------------------
  |  Branch (555:13): [True: 0, False: 40.8k]
  ------------------
  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: 40.8k]
  ------------------
  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: 40.8k]
  ------------------
  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|  40.8k|        }
  576|       |
  577|  40.8k|        igraph_i_attribute_record_set_type(attr, type, ptr);
  578|  40.8k|        IGRAPH_FINALLY_CLEAN(2);
  579|  40.8k|    }
  580|       |
  581|  47.6k|    return IGRAPH_SUCCESS;
  582|  47.6k|}
igraph_i_attribute_init:
  617|  48.2k|) {
  618|  48.2k|    graph->attr = NULL;
  619|  48.2k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (619:9): [True: 48.2k, False: 0]
  ------------------
  620|  48.2k|        IGRAPH_CHECK(igraph_i_attribute_table->init(graph, attr));
  ------------------
  |  |  656|  48.2k|    do { \
  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  621|  48.2k|        if (graph->attr == NULL) {
  ------------------
  |  Branch (621:13): [True: 0, False: 48.2k]
  ------------------
  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|  48.2k|    }
  625|  48.2k|    return IGRAPH_SUCCESS;
  626|  48.2k|}
igraph_i_attribute_destroy:
  628|  72.0k|void igraph_i_attribute_destroy(igraph_t *graph) {
  629|  72.0k|    if (graph->attr && igraph_i_attribute_table) {
  ------------------
  |  Branch (629:9): [True: 65.2k, False: 6.80k]
  |  Branch (629:24): [True: 65.2k, False: 0]
  ------------------
  630|  65.2k|        igraph_i_attribute_table->destroy(graph);
  631|  65.2k|    }
  632|       |    graph->attr = NULL;
  633|  72.0k|}
igraph_i_attribute_copy:
  636|  17.0k|                            igraph_bool_t va, igraph_bool_t ea) {
  637|  17.0k|    igraph_i_attribute_destroy(to);
  638|  17.0k|    if (from->attr && igraph_i_attribute_table) {
  ------------------
  |  Branch (638:9): [True: 17.0k, False: 0]
  |  Branch (638:23): [True: 17.0k, False: 0]
  ------------------
  639|  17.0k|        IGRAPH_CHECK(igraph_i_attribute_table->copy(to, from, ga, va, ea));
  ------------------
  |  |  656|  17.0k|    do { \
  |  |  657|  17.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  17.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  17.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.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|  17.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 17.0k]
  |  |  ------------------
  ------------------
  640|  17.0k|        if (to->attr == NULL) {
  ------------------
  |  Branch (640:13): [True: 0, False: 17.0k]
  ------------------
  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|  17.0k|    }
  644|  17.0k|    return IGRAPH_SUCCESS;
  645|  17.0k|}
igraph_i_attribute_add_vertices:
  649|  51.1k|) {
  650|  51.1k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (650:9): [True: 51.1k, False: 0]
  ------------------
  651|  51.1k|        return igraph_i_attribute_table->add_vertices(graph, nv, attr);
  652|  51.1k|    } else {
  653|      0|        return IGRAPH_SUCCESS;
  654|      0|    }
  655|  51.1k|}
igraph_i_attribute_combine_vertices:
  673|  3.40k|                                        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.40k|    IGRAPH_ASSERT(graph != newgraph);
  ------------------
  |  |  924|  3.40k|    do { \
  |  |  925|  3.40k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  678|  3.40k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (678:9): [True: 3.40k, False: 0]
  ------------------
  679|  3.40k|        return igraph_i_attribute_table->combine_vertices(graph, newgraph,
  680|  3.40k|                merges,
  681|  3.40k|                comb);
  682|  3.40k|    } else {
  683|      0|        return IGRAPH_SUCCESS;
  684|      0|    }
  685|  3.40k|}
igraph_i_attribute_add_edges:
  690|  33.4k|) {
  691|  33.4k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (691:9): [True: 33.4k, False: 0]
  ------------------
  692|  33.4k|        return igraph_i_attribute_table->add_edges(graph, edges, attr);
  693|  33.4k|    } else {
  694|      0|        return IGRAPH_SUCCESS;
  695|      0|    }
  696|  33.4k|}
igraph_i_attribute_combine_edges:
  714|  6.80k|                                     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|  6.80k|    IGRAPH_ASSERT(graph != newgraph);
  ------------------
  |  |  924|  6.80k|    do { \
  |  |  925|  6.80k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  719|  6.80k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (719:9): [True: 6.80k, False: 0]
  ------------------
  720|  6.80k|        return igraph_i_attribute_table->combine_edges(graph, newgraph,
  721|  6.80k|                merges,
  722|  6.80k|                comb);
  723|  6.80k|    } else {
  724|      0|        return IGRAPH_SUCCESS;
  725|      0|    }
  726|  6.80k|}
igraph_set_attribute_table:
  895|  3.43k|igraph_set_attribute_table(const igraph_attribute_table_t * table) {
  896|  3.43k|    igraph_attribute_table_t *old = igraph_i_attribute_table;
  897|  3.43k|    igraph_i_attribute_table = (igraph_attribute_table_t*) table;
  898|  3.43k|    return old;
  899|  3.43k|}
igraph_has_attribute_table:
  901|  10.2k|igraph_bool_t igraph_has_attribute_table(void) {
  902|       |    return igraph_i_attribute_table != NULL;
  903|  10.2k|}
igraph_attribute_combination_init:
  915|  3.40k|igraph_error_t igraph_attribute_combination_init(igraph_attribute_combination_t *comb) {
  916|  3.40k|    IGRAPH_CHECK(igraph_vector_ptr_init(&comb->list, 0));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  917|  3.40k|    return IGRAPH_SUCCESS;
  918|  3.40k|}
igraph_attribute_combination_destroy:
  929|  3.40k|void igraph_attribute_combination_destroy(igraph_attribute_combination_t *comb) {
  930|  3.40k|    igraph_int_t i, n = igraph_vector_ptr_size(&comb->list);
  931|  10.2k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (931:17): [True: 6.80k, False: 3.40k]
  ------------------
  932|  6.80k|        igraph_attribute_combination_record_t *rec = VECTOR(comb->list)[i];
  ------------------
  |  |   60|  6.80k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  933|  6.80k|        if (rec->name) {
  ------------------
  |  Branch (933:13): [True: 6.80k, False: 0]
  ------------------
  934|  6.80k|            IGRAPH_FREE(rec->name);
  ------------------
  |  |   36|  6.80k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  935|  6.80k|        }
  936|       |        IGRAPH_FREE(rec);
  ------------------
  |  |   36|  6.80k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  937|  6.80k|    }
  938|  3.40k|    igraph_vector_ptr_destroy(&comb->list);
  939|  3.40k|}
igraph_attribute_combination_add:
  968|  6.80k|                                     igraph_function_pointer_t func) {
  969|  6.80k|    igraph_int_t i, n = igraph_vector_ptr_size(&comb->list);
  970|       |
  971|       |    /* Search, in case it is already there */
  972|  10.2k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (972:17): [True: 3.40k, False: 6.80k]
  ------------------
  973|  3.40k|        igraph_attribute_combination_record_t *r = VECTOR(comb->list)[i];
  ------------------
  |  |   60|  3.40k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  974|  3.40k|        const char *n = r->name;
  975|  3.40k|        if ( (!name && !n) ||
  ------------------
  |  Branch (975:15): [True: 0, False: 3.40k]
  |  Branch (975:24): [True: 0, False: 0]
  ------------------
  976|  3.40k|             (name && n && !strcmp(n, name)) ) {
  ------------------
  |  Branch (976:15): [True: 3.40k, False: 0]
  |  Branch (976:23): [True: 3.40k, False: 0]
  |  Branch (976:28): [True: 0, False: 3.40k]
  ------------------
  977|      0|            r->type = type;
  978|      0|            r->func = func;
  979|      0|            break;
  980|      0|        }
  981|  3.40k|    }
  982|       |
  983|  6.80k|    if (i == n) {
  ------------------
  |  Branch (983:9): [True: 6.80k, False: 0]
  ------------------
  984|       |        /* This is a new attribute name */
  985|  6.80k|        igraph_attribute_combination_record_t *rec =
  986|  6.80k|            IGRAPH_CALLOC(1, igraph_attribute_combination_record_t);
  ------------------
  |  |   33|  6.80k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  13.6k|    (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: 6.80k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  987|  6.80k|        if (! rec) {
  ------------------
  |  Branch (987:13): [True: 0, False: 6.80k]
  ------------------
  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|  6.80k|        IGRAPH_FINALLY(igraph_free, rec);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  992|  6.80k|        if (! name) {
  ------------------
  |  Branch (992:13): [True: 0, False: 6.80k]
  ------------------
  993|      0|            rec->name = NULL;
  994|  6.80k|        } else {
  995|  6.80k|            rec->name = strdup(name);
  996|  6.80k|            if (! rec->name) {
  ------------------
  |  Branch (996:17): [True: 0, False: 6.80k]
  ------------------
  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|  6.80k|        }
 1001|  6.80k|        IGRAPH_FINALLY(igraph_free, (char *) rec->name); /* free() is safe on NULL */
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
 1002|  6.80k|        rec->type = type;
 1003|  6.80k|        rec->func = func;
 1004|       |
 1005|  6.80k|        IGRAPH_CHECK(igraph_vector_ptr_push_back(&comb->list, rec));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
 1006|  6.80k|        IGRAPH_FINALLY_CLEAN(2); /* ownership of 'rec' transferred to 'comb->list' */
 1007|       |
 1008|  6.80k|    }
 1009|       |
 1010|  6.80k|    return IGRAPH_SUCCESS;
 1011|  6.80k|}
igraph_attribute_combination_query:
 1058|  10.2k|                                       igraph_function_pointer_t *func) {
 1059|  10.2k|    igraph_int_t i, def = -1, len = igraph_vector_ptr_size(&comb->list);
 1060|       |
 1061|  13.6k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (1061:17): [True: 13.6k, False: 0]
  ------------------
 1062|  13.6k|        igraph_attribute_combination_record_t *rec = VECTOR(comb->list)[i];
  ------------------
  |  |   60|  13.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1063|  13.6k|        const char *n = rec->name;
 1064|  13.6k|        if ( (!name && !n) ||
  ------------------
  |  Branch (1064:15): [True: 0, False: 13.6k]
  |  Branch (1064:24): [True: 0, False: 0]
  ------------------
 1065|  13.6k|             (name && n && !strcmp(n, name)) ) {
  ------------------
  |  Branch (1065:15): [True: 13.6k, False: 0]
  |  Branch (1065:23): [True: 13.6k, False: 0]
  |  Branch (1065:28): [True: 10.2k, False: 3.40k]
  ------------------
 1066|  10.2k|            *type = rec->type;
 1067|  10.2k|            *func = rec->func;
 1068|  10.2k|            return IGRAPH_SUCCESS;
 1069|  10.2k|        }
 1070|  3.40k|        if (!n) {
  ------------------
  |  Branch (1070:13): [True: 0, False: 3.40k]
  ------------------
 1071|      0|            def = i;
 1072|      0|        }
 1073|  3.40k|    }
 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.2k|}
igraph_attribute_combination:
 1111|  3.40k|        igraph_attribute_combination_t *comb, ...) {
 1112|       |
 1113|  3.40k|    va_list ap;
 1114|       |
 1115|  3.40k|    IGRAPH_CHECK(igraph_attribute_combination_init(comb));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1116|       |
 1117|  3.40k|    va_start(ap, comb);
 1118|  10.2k|    while (true) {
  ------------------
  |  Branch (1118:12): [True: 10.2k, Folded]
  ------------------
 1119|  10.2k|        igraph_function_pointer_t func = NULL;
 1120|  10.2k|        igraph_attribute_combination_type_t type;
 1121|  10.2k|        const char *name;
 1122|       |
 1123|  10.2k|        name = va_arg(ap, const char *);
 1124|       |
 1125|  10.2k|        if (name == IGRAPH_NO_MORE_ATTRIBUTES) {
  ------------------
  |  |  214|  10.2k|#define IGRAPH_NO_MORE_ATTRIBUTES ((const char*)0)
  ------------------
  |  Branch (1125:13): [True: 3.40k, False: 6.80k]
  ------------------
 1126|  3.40k|            break;
 1127|  3.40k|        }
 1128|       |
 1129|  6.80k|        type = (igraph_attribute_combination_type_t) va_arg(ap, int);
 1130|  6.80k|        if (type == IGRAPH_ATTRIBUTE_COMBINE_FUNCTION) {
  ------------------
  |  Branch (1130:13): [True: 0, False: 6.80k]
  ------------------
 1131|      0|            func = va_arg(ap, igraph_function_pointer_t);
 1132|      0|        }
 1133|       |
 1134|  6.80k|        if (strlen(name) == 0) {
  ------------------
  |  Branch (1134:13): [True: 0, False: 6.80k]
  ------------------
 1135|      0|            name = 0;
 1136|      0|        }
 1137|       |
 1138|  6.80k|        igraph_error_t ret = igraph_attribute_combination_add(comb, name, type, func);
 1139|  6.80k|        if (ret != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (1139:13): [True: 0, False: 6.80k]
  ------------------
 1140|      0|            va_end(ap);
 1141|      0|            return ret;
 1142|      0|        }
 1143|  6.80k|    }
 1144|       |
 1145|  3.40k|    va_end(ap);
 1146|       |
 1147|  3.40k|    return IGRAPH_SUCCESS;
 1148|  3.40k|}
attributes.c:igraph_i_attribute_record_destroy_values:
  185|  81.6k|static void igraph_i_attribute_record_destroy_values(igraph_attribute_record_t *attr) {
  186|  81.6k|    IGRAPH_ASSERT(attr != NULL);
  ------------------
  |  |  924|  81.6k|    do { \
  |  |  925|  81.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  81.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 81.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  81.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 81.6k]
  |  |  ------------------
  ------------------
  187|       |
  188|  81.6k|    if (attr->value.as_raw) {
  ------------------
  |  Branch (188:9): [True: 40.8k, False: 40.8k]
  ------------------
  189|  40.8k|        switch (attr->type) {
  190|  40.8k|            case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (190:13): [True: 40.8k, False: 0]
  ------------------
  191|  40.8k|                igraph_vector_destroy(attr->value.as_vector);
  192|  40.8k|                break;
  193|       |
  194|      0|            case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (194:13): [True: 0, False: 40.8k]
  ------------------
  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: 40.8k]
  ------------------
  199|      0|                igraph_vector_bool_destroy(attr->value.as_vector_bool);
  200|      0|                break;
  201|       |
  202|      0|            default:
  ------------------
  |  Branch (202:13): [True: 0, False: 40.8k]
  ------------------
  203|      0|                break;
  204|  40.8k|        }
  205|       |
  206|  40.8k|        igraph_free(attr->value.as_raw);
  207|  40.8k|        attr->value.as_raw = NULL;
  208|  40.8k|    }
  209|       |
  210|  81.6k|    switch (attr->type) {
  211|  40.8k|        case IGRAPH_ATTRIBUTE_NUMERIC:
  ------------------
  |  Branch (211:9): [True: 40.8k, False: 40.8k]
  ------------------
  212|  40.8k|            attr->default_value.numeric = 0;
  213|  40.8k|            break;
  214|       |
  215|      0|        case IGRAPH_ATTRIBUTE_STRING:
  ------------------
  |  Branch (215:9): [True: 0, False: 81.6k]
  ------------------
  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: 81.6k]
  ------------------
  223|      0|            attr->default_value.boolean = 0;
  224|      0|            break;
  225|       |
  226|  40.8k|        default:
  ------------------
  |  Branch (226:9): [True: 40.8k, False: 40.8k]
  ------------------
  227|  40.8k|            break;
  228|  81.6k|    }
  229|       |
  230|  81.6k|    attr->type = IGRAPH_ATTRIBUTE_UNSPECIFIED;
  231|  81.6k|}
attributes.c:igraph_i_attribute_record_set_type:
  506|  40.8k|) {
  507|  40.8k|    bool type_changed = attr->type != type;
  508|       |
  509|  40.8k|    if (type_changed || attr->value.as_raw != ptr) {
  ------------------
  |  Branch (509:9): [True: 40.8k, False: 0]
  |  Branch (509:25): [True: 0, False: 0]
  ------------------
  510|  40.8k|        igraph_i_attribute_record_destroy_values(attr);
  511|  40.8k|        attr->type = type;
  512|  40.8k|        attr->value.as_raw = ptr;
  513|  40.8k|    }
  514|       |
  515|  40.8k|    if (type_changed && type == IGRAPH_ATTRIBUTE_NUMERIC) {
  ------------------
  |  Branch (515:9): [True: 40.8k, False: 0]
  |  Branch (515:25): [True: 40.8k, False: 0]
  ------------------
  516|  40.8k|        IGRAPH_ASSERT(
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  517|  40.8k|            igraph_attribute_record_set_default_numeric(attr, IGRAPH_NAN) == IGRAPH_SUCCESS
  518|  40.8k|        );
  519|  40.8k|    }
  520|  40.8k|}
attributes.c:igraph_i_attribute_record_list_init_item:
  596|  6.80k|) {
  597|  6.80k|    IGRAPH_UNUSED(list);
  ------------------
  |  |   30|  6.80k|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
  598|       |    return igraph_attribute_record_init(item, NULL, IGRAPH_ATTRIBUTE_UNSPECIFIED);
  599|  6.80k|}
attributes.c:igraph_i_attribute_record_list_copy_item:
  603|  23.8k|) {
  604|  23.8k|    return igraph_attribute_record_init_copy(dest, source);
  605|  23.8k|}
attributes.c:igraph_i_attribute_record_list_destroy_item:
  607|  40.8k|static void igraph_i_attribute_record_list_destroy_item(igraph_attribute_record_t* item) {
  608|  40.8k|    igraph_attribute_record_destroy(item);
  609|  40.8k|}

igraph_i_property_cache_init:
   32|  48.2k|igraph_error_t igraph_i_property_cache_init(igraph_i_property_cache_t *cache) {
   33|  48.2k|    IGRAPH_STATIC_ASSERT(IGRAPH_PROP_I_SIZE <= 32);
  ------------------
  |  |   68|  48.2k|#define IGRAPH_STATIC_ASSERT(condition) ((void)sizeof(char[1 - 2*!(condition)]))
  ------------------
   34|       |
   35|  48.2k|    memset(cache->value, 0, sizeof(cache->value));
   36|  48.2k|    cache->known = 0;
   37|  48.2k|    return IGRAPH_SUCCESS;
   38|  48.2k|}
igraph_i_property_cache_copy:
   45|  6.80k|        const igraph_i_property_cache_t *other_cache) {
   46|  6.80k|    *cache = *other_cache;
   47|  6.80k|    return IGRAPH_SUCCESS;
   48|  6.80k|}
igraph_i_property_cache_destroy:
   53|  55.0k|void igraph_i_property_cache_destroy(igraph_i_property_cache_t *cache) {
   54|  55.0k|    IGRAPH_UNUSED(cache);
  ------------------
  |  |   30|  55.0k|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
   55|       |    /* Nothing to do */
   56|  55.0k|}
igraph_i_property_cache_get_bool:
   72|  30.6k|igraph_bool_t igraph_i_property_cache_get_bool(const igraph_t *graph, igraph_cached_property_t prop) {
   73|  30.6k|    IGRAPH_ASSERT(prop >= 0 && prop < IGRAPH_PROP_I_SIZE);
  ------------------
  |  |  924|  30.6k|    do { \
  |  |  925|  30.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  61.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 30.6k]
  |  |  |  |  |  Branch (612:52): [True: 30.6k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 30.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  30.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 30.6k]
  |  |  ------------------
  ------------------
   74|  30.6k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (74:5): [True: 0, False: 30.6k]
  |  Branch (74:5): [True: 30.6k, False: 0]
  ------------------
   75|  30.6k|    return graph->cache->value[prop];
   76|  30.6k|}
igraph_i_property_cache_has:
   84|  54.2k|igraph_bool_t igraph_i_property_cache_has(const igraph_t *graph, igraph_cached_property_t prop) {
   85|  54.2k|    IGRAPH_ASSERT(prop >= 0 && prop < IGRAPH_PROP_I_SIZE);
  ------------------
  |  |  924|  54.2k|    do { \
  |  |  925|  54.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   108k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 54.2k]
  |  |  |  |  |  Branch (612:52): [True: 54.2k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 54.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  54.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 54.2k]
  |  |  ------------------
  ------------------
   86|  54.2k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (86:5): [True: 0, False: 54.2k]
  |  Branch (86:5): [True: 54.2k, False: 0]
  ------------------
   87|  54.2k|    return graph->cache->known & (1 << prop);
   88|  54.2k|}
igraph_i_property_cache_set_bool:
   97|  17.0k|void igraph_i_property_cache_set_bool(const igraph_t *graph, igraph_cached_property_t prop, igraph_bool_t value) {
   98|  17.0k|    IGRAPH_ASSERT(prop >= 0 && prop < IGRAPH_PROP_I_SIZE);
  ------------------
  |  |  924|  17.0k|    do { \
  |  |  925|  17.0k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  34.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.0k]
  |  |  |  |  |  Branch (612:52): [True: 17.0k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 17.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  17.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 17.0k]
  |  |  ------------------
  ------------------
   99|  17.0k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (99:5): [True: 0, False: 17.0k]
  |  Branch (99:5): [True: 17.0k, 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|  17.0k|    graph->cache->value[prop] = value;
  104|  17.0k|    graph->cache->known |= (1 << prop);
  105|  17.0k|}
igraph_i_property_cache_set_bool_checked:
  123|  25.5k|void igraph_i_property_cache_set_bool_checked(const igraph_t *graph, igraph_cached_property_t prop, igraph_bool_t value) {
  124|  25.5k|    IGRAPH_ASSERT(prop >= 0 && prop < IGRAPH_PROP_I_SIZE);
  ------------------
  |  |  924|  25.5k|    do { \
  |  |  925|  25.5k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  51.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 25.5k]
  |  |  |  |  |  Branch (612:52): [True: 25.5k, False: 0]
  |  |  |  |  |  Branch (612:52): [True: 25.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  25.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 25.5k]
  |  |  ------------------
  ------------------
  125|  25.5k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (125:5): [True: 0, False: 25.5k]
  |  Branch (125:5): [True: 25.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|  25.5k|    if (graph->cache->known & (1 << prop)) {
  ------------------
  |  Branch (129:9): [True: 8.55k, False: 17.0k]
  ------------------
  130|  8.55k|        IGRAPH_ASSERT(graph->cache->value[prop] == value);
  ------------------
  |  |  924|  8.55k|    do { \
  |  |  925|  8.55k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  8.55k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 8.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  8.55k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 8.55k]
  |  |  ------------------
  ------------------
  131|  17.0k|    } else {
  132|  17.0k|        igraph_i_property_cache_set_bool(graph, prop, value);
  133|  17.0k|    }
  134|  25.5k|}
igraph_i_property_cache_invalidate_conditionally:
  182|  84.5k|) {
  183|  84.5k|    uint32_t invalidate = ~keep_always;
  184|  84.5k|    uint32_t mask;
  185|  84.5k|    uint32_t maybe_keep;
  186|  84.5k|    igraph_bool_t cached_value;
  187|       |
  188|  84.5k|    assert(graph->cache != NULL);
  ------------------
  |  Branch (188:5): [True: 0, False: 84.5k]
  |  Branch (188:5): [True: 84.5k, 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|  84.5k|    maybe_keep = graph->cache->known & invalidate & (keep_when_false | keep_when_true);
  197|       |
  198|  84.5k|    if (maybe_keep) {
  ------------------
  |  Branch (198:9): [True: 0, False: 84.5k]
  ------------------
  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|  84.5k|    graph->cache->known &= ~invalidate;
  216|  84.5k|}

igraph_cattribute_EANV:
 2226|  6.80k|                           igraph_es_t eids, igraph_vector_t *result) {
 2227|  6.80k|    igraph_vector_clear(result);
 2228|  6.80k|    return igraph_i_cattribute_get_numeric_edge_attr(graph, name, eids, result);
 2229|  6.80k|}
igraph_cattribute_VAN_setv:
 2636|  3.40k|                               const igraph_vector_t *v) {
 2637|  3.40k|    igraph_i_cattributes_t *attr = graph->attr;
 2638|  3.40k|    igraph_attribute_record_t *rec;
 2639|  3.40k|    igraph_int_t nv = igraph_vcount(graph);
 2640|       |
 2641|       |    /* Check length first */
 2642|  3.40k|    if (igraph_vector_size(v) != nv) {
  ------------------
  |  Branch (2642:9): [True: 0, False: 3.40k]
  ------------------
 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.40k|    IGRAPH_CHECK(igraph_i_cattribute_find_or_create(&attr->val, name, IGRAPH_ATTRIBUTE_NUMERIC, nv, &rec));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 2647|  3.40k|    IGRAPH_CHECK(igraph_vector_update(rec->value.as_vector, v));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 2648|       |
 2649|  3.40k|    return IGRAPH_SUCCESS;
 2650|  3.40k|}
igraph_cattribute_EAN_setv:
 2734|  3.40k|                               const igraph_vector_t *v) {
 2735|  3.40k|    igraph_i_cattributes_t *attr = graph->attr;
 2736|  3.40k|    igraph_attribute_record_t *rec;
 2737|  3.40k|    igraph_int_t ne = igraph_ecount(graph);
 2738|       |
 2739|       |    /* Check length first */
 2740|  3.40k|    if (igraph_vector_size(v) != ne) {
  ------------------
  |  Branch (2740:9): [True: 0, False: 3.40k]
  ------------------
 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.40k|    IGRAPH_CHECK(igraph_i_cattribute_find_or_create(&attr->eal, name, IGRAPH_ATTRIBUTE_NUMERIC, ne, &rec));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 2745|  3.40k|    IGRAPH_CHECK(igraph_vector_update(rec->value.as_vector, v));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 2746|       |
 2747|  3.40k|    return IGRAPH_SUCCESS;
 2748|  3.40k|}
igraph_cattribute_remove_all:
 2896|  3.40k|                                  igraph_bool_t v, igraph_bool_t e) {
 2897|       |
 2898|  3.40k|    igraph_i_cattributes_t *attr = graph->attr;
 2899|       |
 2900|  3.40k|    if (g) {
  ------------------
  |  Branch (2900:9): [True: 3.40k, False: 0]
  ------------------
 2901|  3.40k|        igraph_attribute_record_list_clear(&attr->gal);
 2902|  3.40k|    }
 2903|  3.40k|    if (v) {
  ------------------
  |  Branch (2903:9): [True: 3.40k, False: 0]
  ------------------
 2904|  3.40k|        igraph_attribute_record_list_clear(&attr->val);
 2905|  3.40k|    }
 2906|  3.40k|    if (e) {
  ------------------
  |  Branch (2906:9): [True: 3.40k, False: 0]
  ------------------
 2907|  3.40k|        igraph_attribute_record_list_clear(&attr->eal);
 2908|  3.40k|    }
 2909|  3.40k|}
cattributes.c:igraph_i_cattribute_init:
  195|  48.2k|) {
  196|  48.2k|    igraph_i_cattributes_t *nattr;
  197|       |
  198|  48.2k|    nattr = IGRAPH_CALLOC(1, igraph_i_cattributes_t);
  ------------------
  |  |   33|  48.2k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  96.4k|    (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: 48.2k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  199|  48.2k|    IGRAPH_CHECK_OOM(nattr, "Insufficient memory to allocate attribute storage.");
  ------------------
  |  |  709|  48.2k|    do { \
  |  |  710|  48.2k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  200|  48.2k|    IGRAPH_FINALLY(igraph_free, nattr);
  ------------------
  |  |  603|  48.2k|    do { \
  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  ------------------
  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  201|       |
  202|  48.2k|    if (attr) {
  ------------------
  |  Branch (202:9): [True: 0, False: 48.2k]
  ------------------
  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|  48.2k|    } else {
  205|  48.2k|        IGRAPH_CHECK(igraph_attribute_record_list_init(&nattr->gal, 0));
  ------------------
  |  |  656|  48.2k|    do { \
  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  206|  48.2k|    }
  207|  48.2k|    IGRAPH_FINALLY(igraph_attribute_record_list_destroy, &nattr->gal);
  ------------------
  |  |  603|  48.2k|    do { \
  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  ------------------
  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  208|       |
  209|  48.2k|    IGRAPH_CHECK(igraph_attribute_record_list_init(&nattr->val, 0));
  ------------------
  |  |  656|  48.2k|    do { \
  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  210|  48.2k|    IGRAPH_FINALLY(igraph_attribute_record_list_destroy, &nattr->val);
  ------------------
  |  |  603|  48.2k|    do { \
  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  ------------------
  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  211|       |
  212|  48.2k|    IGRAPH_CHECK(igraph_attribute_record_list_init(&nattr->eal, 0));
  ------------------
  |  |  656|  48.2k|    do { \
  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  213|  48.2k|    IGRAPH_FINALLY(igraph_attribute_record_list_destroy, &nattr->eal);
  ------------------
  |  |  603|  48.2k|    do { \
  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  ------------------
  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  214|       |
  215|  48.2k|    graph->attr = nattr;
  216|  48.2k|    IGRAPH_FINALLY_CLEAN(4);
  217|       |
  218|  48.2k|    return IGRAPH_SUCCESS;
  219|  48.2k|}
cattributes.c:igraph_i_cattribute_destroy:
  221|  65.2k|static void igraph_i_cattribute_destroy(igraph_t *graph) {
  222|  65.2k|    igraph_i_cattributes_t *attr = graph->attr;
  223|  65.2k|    igraph_attribute_record_list_destroy(&attr->eal);
  224|  65.2k|    igraph_attribute_record_list_destroy(&attr->val);
  225|  65.2k|    igraph_attribute_record_list_destroy(&attr->gal);
  226|       |    IGRAPH_FREE(graph->attr); /* sets to NULL */
  ------------------
  |  |   36|  65.2k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  227|  65.2k|}
cattributes.c:igraph_i_cattribute_copy:
  235|  17.0k|) {
  236|  17.0k|    igraph_i_cattributes_t *attrto, *attrfrom = from->attr;
  237|  17.0k|    igraph_attribute_record_list_t *alto[3], *alfrom[3] = {
  238|  17.0k|        &attrfrom->gal, &attrfrom->val, &attrfrom->eal
  239|  17.0k|    };
  240|  17.0k|    igraph_bool_t copy[3] = { ga, va, ea };
  241|       |
  242|  17.0k|    attrto = IGRAPH_CALLOC(1, igraph_i_cattributes_t);
  ------------------
  |  |   33|  17.0k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  34.0k|    (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: 17.0k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  243|  17.0k|    IGRAPH_CHECK_OOM(attrto, "Insufficient memory to copy attributes.");
  ------------------
  |  |  709|  17.0k|    do { \
  |  |  710|  17.0k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  17.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|  17.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 17.0k]
  |  |  ------------------
  ------------------
  244|  17.0k|    IGRAPH_FINALLY(igraph_free, attrto);
  ------------------
  |  |  603|  17.0k|    do { \
  |  |  604|  17.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  17.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  17.0k|         * incorrect destructor function with the pointer */ \
  |  |  607|  17.0k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 17.0k]
  |  |  ------------------
  |  |  608|  17.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  17.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 17.0k]
  |  |  ------------------
  ------------------
  245|       |
  246|  17.0k|    alto[0] = &attrto->gal;
  247|  17.0k|    alto[1] = &attrto->val;
  248|  17.0k|    alto[2] = &attrto->eal;
  249|       |
  250|  68.0k|    for (igraph_int_t i = 0; i < 3; i++) {
  ------------------
  |  Branch (250:30): [True: 51.0k, False: 17.0k]
  ------------------
  251|  51.0k|        if (copy[i]) {
  ------------------
  |  Branch (251:13): [True: 40.8k, False: 10.2k]
  ------------------
  252|  40.8k|            IGRAPH_CHECK(igraph_attribute_record_list_init_copy(alto[i], alfrom[i]));
  ------------------
  |  |  656|  40.8k|    do { \
  |  |  657|  40.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  40.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  40.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 40.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|  40.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 40.8k]
  |  |  ------------------
  ------------------
  253|  40.8k|        } else {
  254|  10.2k|            IGRAPH_CHECK(igraph_attribute_record_list_init(alto[i], 0));
  ------------------
  |  |  656|  10.2k|    do { \
  |  |  657|  10.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  255|  10.2k|        }
  256|  51.0k|        IGRAPH_FINALLY(igraph_attribute_record_list_destroy, alto[i]);
  ------------------
  |  |  603|  51.0k|    do { \
  |  |  604|  51.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  51.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  51.0k|         * incorrect destructor function with the pointer */ \
  |  |  607|  51.0k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 51.0k]
  |  |  ------------------
  |  |  608|  51.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  51.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 51.0k]
  |  |  ------------------
  ------------------
  257|  51.0k|    }
  258|       |
  259|  17.0k|    to->attr = attrto;
  260|  17.0k|    IGRAPH_FINALLY_CLEAN(4);
  261|       |
  262|  17.0k|    return IGRAPH_SUCCESS;
  263|  17.0k|}
cattributes.c:igraph_i_cattribute_add_vertices:
  373|  51.1k|) {
  374|  51.1k|    igraph_i_cattributes_t *attr = graph->attr;
  375|  51.1k|    return igraph_i_cattribute_add_vertices_or_edges(&attr->val, igraph_vcount(graph), nv, nattr);
  376|  51.1k|}
cattributes.c:igraph_i_cattribute_add_vertices_or_edges:
  344|  84.5k|) {
  345|  84.5k|    igraph_int_t origlen = newlen - nv;
  346|  84.5k|    igraph_error_t err = igraph_i_cattribute_add_vertices_or_edges_inner(
  347|  84.5k|        val, newlen, nv, nattr
  348|  84.5k|    );
  349|       |
  350|  84.5k|    if (err != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (350:9): [True: 0, False: 84.5k]
  ------------------
  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|  84.5k|    return err;
  368|  84.5k|}
cattributes.c:igraph_i_cattribute_add_vertices_or_edges_inner:
  269|  84.5k|) {
  270|  84.5k|    igraph_int_t length;
  271|  84.5k|    igraph_int_t nattrno = nattr == NULL ? 0 : igraph_attribute_record_list_size(nattr);
  ------------------
  |  Branch (271:28): [True: 84.5k, False: 0]
  ------------------
  272|  84.5k|    igraph_int_t origlen = newlen - nv;
  273|       |
  274|  84.5k|    IGRAPH_ASSERT(origlen >= 0);
  ------------------
  |  |  924|  84.5k|    do { \
  |  |  925|  84.5k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  84.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 84.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  84.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 84.5k]
  |  |  ------------------
  ------------------
  275|       |
  276|       |    /* Find all the attributes that are newly added, and create new value vectors
  277|       |     * for them in the original graph */
  278|  84.5k|    for (igraph_int_t i = 0; i < nattrno; i++) {
  ------------------
  |  Branch (278:30): [True: 0, False: 84.5k]
  ------------------
  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|  84.5k|    length = igraph_attribute_record_list_size(val);
  286|  84.5k|    for (igraph_int_t i = 0; i < length; i++) {
  ------------------
  |  Branch (286:30): [True: 0, False: 84.5k]
  ------------------
  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|  84.5k|    return IGRAPH_SUCCESS;
  338|  84.5k|}
cattributes.c:igraph_i_cattribute_combine_vertices:
 1452|  3.40k|) {
 1453|  3.40k|    igraph_i_cattributes_t *attr = graph->attr;
 1454|  3.40k|    igraph_i_cattributes_t *toattr = newgraph->attr;
 1455|  3.40k|    return igraph_i_cattribute_combine_attribute_record_lists(
 1456|  3.40k|        &attr->val, &toattr->val, merges, comb
 1457|  3.40k|    );
 1458|  3.40k|}
cattributes.c:igraph_i_cattribute_combine_attribute_record_lists:
 1270|  10.2k|) {
 1271|  10.2k|    igraph_int_t no_attrs = igraph_attribute_record_list_size(attrs);
 1272|  10.2k|    igraph_attribute_combination_todo_item_t *todo_items;
 1273|       |
 1274|  10.2k|    IGRAPH_ASSERT(attrs != new_attrs);
  ------------------
  |  |  924|  10.2k|    do { \
  |  |  925|  10.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1275|  10.2k|    IGRAPH_ASSERT(igraph_attribute_record_list_empty(new_attrs));
  ------------------
  |  |  924|  10.2k|    do { \
  |  |  925|  10.2k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1276|       |
 1277|  10.2k|    todo_items = IGRAPH_CALLOC(no_attrs, igraph_attribute_combination_todo_item_t);
  ------------------
  |  |   33|  10.2k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  20.4k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 10.2k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 10.2k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 10.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1278|  10.2k|    IGRAPH_CHECK_OOM(todo_items, "Cannot combine attributes.");
  ------------------
  |  |  709|  10.2k|    do { \
  |  |  710|  10.2k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1279|  10.2k|    IGRAPH_FINALLY(igraph_free, todo_items);
  ------------------
  |  |  603|  10.2k|    do { \
  |  |  604|  10.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  10.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  10.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  10.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 10.2k]
  |  |  ------------------
  |  |  608|  10.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1280|       |
 1281|  20.4k|    for (igraph_int_t i = 0; i < no_attrs; i++) {
  ------------------
  |  Branch (1281:30): [True: 10.2k, False: 10.2k]
  ------------------
 1282|  10.2k|        const igraph_attribute_record_t *oldrec = igraph_attribute_record_list_get_ptr(attrs, i);
 1283|  10.2k|        const char *name = oldrec->name;
 1284|  10.2k|        igraph_attribute_combination_type_t type;
 1285|  10.2k|        igraph_function_pointer_t voidfunc;
 1286|  10.2k|        IGRAPH_CHECK(igraph_attribute_combination_query(comb, name, &type, &voidfunc));
  ------------------
  |  |  656|  10.2k|    do { \
  |  |  657|  10.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1287|  10.2k|        todo_items[i].type = type;
 1288|  10.2k|        todo_items[i].func.as_void = voidfunc;
 1289|  10.2k|    }
 1290|       |
 1291|  10.2k|    IGRAPH_FINALLY(igraph_attribute_record_list_clear, new_attrs);
  ------------------
  |  |  603|  10.2k|    do { \
  |  |  604|  10.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  10.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  10.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  10.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 10.2k]
  |  |  ------------------
  |  |  608|  10.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1292|       |
 1293|  20.4k|    for (igraph_int_t i = 0; i < no_attrs; i++) {
  ------------------
  |  Branch (1293:30): [True: 10.2k, False: 10.2k]
  ------------------
 1294|  10.2k|        const igraph_attribute_record_t *oldrec = igraph_attribute_record_list_get_ptr(attrs, i);
 1295|  10.2k|        igraph_attribute_record_t newrec;
 1296|  10.2k|        const char *name = oldrec->name;
 1297|  10.2k|        igraph_attribute_combination_todo_item_t todo_item = todo_items[i];
 1298|  10.2k|        igraph_attribute_type_t attr_type = oldrec->type;
 1299|       |
 1300|  10.2k|        if (todo_item.type == IGRAPH_ATTRIBUTE_COMBINE_DEFAULT ||
  ------------------
  |  Branch (1300:13): [True: 0, False: 10.2k]
  ------------------
 1301|  10.2k|            todo_item.type == IGRAPH_ATTRIBUTE_COMBINE_IGNORE) {
  ------------------
  |  Branch (1301:13): [True: 0, False: 10.2k]
  ------------------
 1302|      0|            continue;
 1303|      0|        }
 1304|       |
 1305|  10.2k|        IGRAPH_CHECK(igraph_attribute_record_init(&newrec, name, attr_type));
  ------------------
  |  |  656|  10.2k|    do { \
  |  |  657|  10.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1306|  10.2k|        IGRAPH_FINALLY(igraph_attribute_record_destroy, &newrec);
  ------------------
  |  |  603|  10.2k|    do { \
  |  |  604|  10.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  10.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  10.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  10.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 10.2k]
  |  |  ------------------
  |  |  608|  10.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1307|       |
 1308|  10.2k|        IGRAPH_CHECK(igraph_attribute_record_resize(&newrec, igraph_vector_int_list_size(merges)));
  ------------------
  |  |  656|  10.2k|    do { \
  |  |  657|  10.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1309|       |
 1310|  10.2k|        if (attr_type == IGRAPH_ATTRIBUTE_NUMERIC) {
  ------------------
  |  Branch (1310:13): [True: 10.2k, False: 0]
  ------------------
 1311|  10.2k|            switch (todo_item.type) {
 1312|      0|            case IGRAPH_ATTRIBUTE_COMBINE_FUNCTION:
  ------------------
  |  Branch (1312:13): [True: 0, False: 10.2k]
  ------------------
 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|  6.80k|            case IGRAPH_ATTRIBUTE_COMBINE_SUM:
  ------------------
  |  Branch (1316:13): [True: 6.80k, False: 3.40k]
  ------------------
 1317|  6.80k|                IGRAPH_CHECK(igraph_i_cattributes_cn_sum(oldrec, &newrec, merges));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
 1318|  6.80k|                break;
 1319|  6.80k|            case IGRAPH_ATTRIBUTE_COMBINE_PROD:
  ------------------
  |  Branch (1319:13): [True: 0, False: 10.2k]
  ------------------
 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.2k]
  ------------------
 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.40k|            case IGRAPH_ATTRIBUTE_COMBINE_MAX:
  ------------------
  |  Branch (1325:13): [True: 3.40k, False: 6.80k]
  ------------------
 1326|  3.40k|                IGRAPH_CHECK(igraph_i_cattributes_cn_max(oldrec, &newrec, merges));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1327|  3.40k|                break;
 1328|  3.40k|            case IGRAPH_ATTRIBUTE_COMBINE_RANDOM:
  ------------------
  |  Branch (1328:13): [True: 0, False: 10.2k]
  ------------------
 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.2k]
  ------------------
 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.2k]
  ------------------
 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.2k]
  ------------------
 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.2k]
  ------------------
 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.2k]
  ------------------
 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.2k]
  ------------------
 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.2k|            }
 1353|  10.2k|        } 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.2k|        IGRAPH_CHECK(igraph_attribute_record_list_push_back(new_attrs, &newrec));
  ------------------
  |  |  656|  10.2k|    do { \
  |  |  657|  10.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
 1440|  10.2k|        IGRAPH_FINALLY_CLEAN(1);  /* ownership of newrec transferred */
 1441|  10.2k|    }
 1442|       |
 1443|  10.2k|    IGRAPH_FREE(todo_items);
  ------------------
  |  |   36|  10.2k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1444|  10.2k|    IGRAPH_FINALLY_CLEAN(2);
 1445|       |
 1446|  10.2k|    return IGRAPH_SUCCESS;
 1447|  10.2k|}
cattributes.c:igraph_i_cattributes_cn_sum:
  689|  6.80k|                                       const igraph_vector_int_list_t *merges) {
  690|  6.80k|    const igraph_vector_t *oldv = oldrec->value.as_vector;
  691|  6.80k|    igraph_vector_t *newv = newrec->value.as_vector;
  692|  6.80k|    igraph_int_t newlen = igraph_vector_int_list_size(merges);
  693|       |
  694|   115k|    for (igraph_int_t i = 0; i < newlen; i++) {
  ------------------
  |  Branch (694:30): [True: 109k, False: 6.80k]
  ------------------
  695|   109k|        igraph_real_t s = 0.0;
  696|   109k|        const igraph_vector_int_t *idx = igraph_vector_int_list_get_ptr(merges, i);
  697|   109k|        igraph_int_t n = igraph_vector_int_size(idx);
  698|   232k|        for (igraph_int_t j = 0; j < n; j++) {
  ------------------
  |  Branch (698:34): [True: 123k, False: 109k]
  ------------------
  699|   123k|            igraph_int_t x = VECTOR(*idx)[j];
  ------------------
  |  |   60|   123k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  700|   123k|            s += VECTOR(*oldv)[x];
  ------------------
  |  |   60|   123k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  701|   123k|        }
  702|   109k|        VECTOR(*newv)[i] = s;
  ------------------
  |  |   60|   109k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  703|   109k|    }
  704|       |
  705|  6.80k|    return IGRAPH_SUCCESS;
  706|  6.80k|}
cattributes.c:igraph_i_cattributes_cn_max:
  755|  3.40k|                                       const igraph_vector_int_list_t *merges) {
  756|  3.40k|    const igraph_vector_t *oldv = oldrec->value.as_vector;
  757|  3.40k|    igraph_vector_t *newv = newrec->value.as_vector;
  758|  3.40k|    igraph_int_t newlen = igraph_vector_int_list_size(merges);
  759|       |
  760|   154k|    for (igraph_int_t i = 0; i < newlen; i++) {
  ------------------
  |  Branch (760:30): [True: 150k, False: 3.40k]
  ------------------
  761|   150k|        const igraph_vector_int_t *idx = igraph_vector_int_list_get_ptr(merges, i);
  762|   150k|        igraph_int_t n = igraph_vector_int_size(idx);
  763|   150k|        igraph_real_t m = n > 0 ? VECTOR(*oldv)[ VECTOR(*idx)[0] ] : IGRAPH_NAN;
  ------------------
  |  |   60|   150k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      igraph_real_t m = n > 0 ? VECTOR(*oldv)[ VECTOR(*idx)[0] ] : IGRAPH_NAN;
  ------------------
  |  |   60|   150k|#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: 150k, False: 0]
  ------------------
  764|   152k|        for (igraph_int_t j = 1; j < n; j++) {
  ------------------
  |  Branch (764:34): [True: 1.25k, False: 150k]
  ------------------
  765|  1.25k|            igraph_int_t x = VECTOR(*idx)[j];
  ------------------
  |  |   60|  1.25k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  766|  1.25k|            igraph_real_t val = VECTOR(*oldv)[x];
  ------------------
  |  |   60|  1.25k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  767|  1.25k|            if (val > m) {
  ------------------
  |  Branch (767:17): [True: 538, False: 714]
  ------------------
  768|    538|                m = val;
  769|    538|            }
  770|  1.25k|        }
  771|   150k|        VECTOR(*newv)[i] = m;
  ------------------
  |  |   60|   150k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  772|   150k|    }
  773|       |
  774|  3.40k|    return IGRAPH_SUCCESS;
  775|  3.40k|}
cattributes.c:igraph_i_cattribute_add_edges:
 1463|  33.4k|) {
 1464|  33.4k|    igraph_int_t ne = igraph_vector_int_size(edges) / 2;
 1465|  33.4k|    igraph_i_cattributes_t *attr = graph->attr;
 1466|  33.4k|    return igraph_i_cattribute_add_vertices_or_edges(&attr->eal, igraph_ecount(graph), ne, nattr);
 1467|  33.4k|}
cattributes.c:igraph_i_cattribute_combine_edges:
 1484|  6.80k|) {
 1485|  6.80k|    igraph_i_cattributes_t *attr = graph->attr;
 1486|  6.80k|    igraph_i_cattributes_t *toattr = newgraph->attr;
 1487|  6.80k|    return igraph_i_cattribute_combine_attribute_record_lists(
 1488|  6.80k|        &attr->eal, &toattr->eal, merges, comb
 1489|  6.80k|    );
 1490|  6.80k|}
cattributes.c:igraph_i_cattribute_find_or_return:
  113|  6.80k|) {
  114|  6.80k|    igraph_attribute_record_t *rec;
  115|       |
  116|  6.80k|    rec = igraph_i_cattribute_find(attrs, name, IGRAPH_ATTRIBUTE_UNSPECIFIED);
  117|  6.80k|    if (!rec) {
  ------------------
  |  Branch (117:9): [True: 0, False: 6.80k]
  ------------------
  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|  6.80k|    if (type != IGRAPH_ATTRIBUTE_UNSPECIFIED) {
  ------------------
  |  Branch (121:9): [True: 6.80k, False: 0]
  ------------------
  122|  6.80k|        IGRAPH_CHECK(igraph_attribute_record_check_type(rec, type));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  123|  6.80k|    }
  124|       |
  125|  6.80k|    if (ptr) {
  ------------------
  |  Branch (125:9): [True: 6.80k, False: 0]
  ------------------
  126|  6.80k|        *ptr = rec;
  127|  6.80k|    }
  128|       |
  129|  6.80k|    return IGRAPH_SUCCESS;
  130|  6.80k|}
cattributes.c:igraph_i_cattribute_get_numeric_edge_attr:
 1717|  6.80k|) {
 1718|  6.80k|    igraph_i_cattributes_t *attr = graph->attr;
 1719|  6.80k|    igraph_attribute_record_list_t *eal = &attr->eal;
 1720|  6.80k|    igraph_attribute_record_t *rec;
 1721|  6.80k|    const igraph_vector_t *num;
 1722|       |
 1723|  6.80k|    IGRAPH_CHECK(igraph_i_cattribute_find_or_return(eal, name, IGRAPH_ATTRIBUTE_NUMERIC, &rec));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
 1724|       |
 1725|  6.80k|    num = rec->value.as_vector;
 1726|  6.80k|    if (igraph_es_is_all(&es)) {
  ------------------
  |  Branch (1726:9): [True: 6.80k, False: 0]
  ------------------
 1727|  6.80k|        IGRAPH_CHECK(igraph_vector_append(value, num));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
 1728|  6.80k|    } 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|  6.80k|    return IGRAPH_SUCCESS;
 1743|  6.80k|}
cattributes.c:igraph_i_cattribute_find:
   69|  13.6k|) {
   70|  13.6k|    igraph_int_t index = igraph_i_cattribute_find_index(attrs, name);
   71|  13.6k|    igraph_attribute_record_t *rec;
   72|       |
   73|  13.6k|    if (index >= 0) {
  ------------------
  |  Branch (73:9): [True: 6.80k, False: 6.80k]
  ------------------
   74|  6.80k|        rec = igraph_attribute_record_list_get_ptr(attrs, index);
   75|  6.80k|        if (type == IGRAPH_ATTRIBUTE_UNSPECIFIED || type == rec->type) {
  ------------------
  |  Branch (75:13): [True: 6.80k, False: 0]
  |  Branch (75:53): [True: 0, False: 0]
  ------------------
   76|  6.80k|            return rec;
   77|  6.80k|        }
   78|  6.80k|    }
   79|       |
   80|  6.80k|    return NULL;
   81|  13.6k|}
cattributes.c:igraph_i_cattribute_find_or_create:
  147|  6.80k|) {
  148|  6.80k|    igraph_attribute_record_t *rec;
  149|       |
  150|  6.80k|    rec = igraph_i_cattribute_find(attrs, name, IGRAPH_ATTRIBUTE_UNSPECIFIED);
  151|  6.80k|    if (rec) {
  ------------------
  |  Branch (151:9): [True: 0, False: 6.80k]
  ------------------
  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|  6.80k|    } else {
  156|  6.80k|        IGRAPH_CHECK(igraph_attribute_record_list_push_back_new(attrs, &rec));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  157|  6.80k|        IGRAPH_CHECK(igraph_attribute_record_set_name(rec, name));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  158|  6.80k|        IGRAPH_CHECK(igraph_attribute_record_set_type(rec, type));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  159|  6.80k|    }
  160|       |
  161|  6.80k|    if (length > 0 && igraph_attribute_record_size(rec) < length) {
  ------------------
  |  Branch (161:9): [True: 6.75k, False: 44]
  |  Branch (161:23): [True: 6.75k, False: 0]
  ------------------
  162|  6.75k|        IGRAPH_CHECK(igraph_attribute_record_resize(rec, length));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  163|  6.75k|    }
  164|       |
  165|  6.80k|    if (ptr) {
  ------------------
  |  Branch (165:9): [True: 6.80k, False: 0]
  ------------------
  166|  6.80k|        *ptr = rec;
  167|  6.80k|    }
  168|       |
  169|  6.80k|    return IGRAPH_SUCCESS;
  170|  6.80k|}
cattributes.c:igraph_i_cattribute_find_index:
   49|  13.6k|) {
   50|  13.6k|    igraph_int_t n = igraph_attribute_record_list_size(attrs);
   51|  13.6k|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (51:30): [True: 6.80k, False: 6.80k]
  ------------------
   52|  6.80k|        const igraph_attribute_record_t *rec = igraph_attribute_record_list_get_ptr(attrs, i);
   53|  6.80k|        if (!strcmp(rec->name, name)) {
  ------------------
  |  Branch (53:13): [True: 6.80k, False: 0]
  ------------------
   54|  6.80k|            return i;
   55|  6.80k|        }
   56|  6.80k|    }
   57|  6.80k|    return -1;
   58|  13.6k|}

igraph_vss_all:
  115|  66.5k|igraph_vs_t igraph_vss_all(void) {
  116|  66.5k|    igraph_vs_t allvs;
  117|  66.5k|    allvs.type = IGRAPH_VS_ALL;
  118|  66.5k|    return allvs;
  119|  66.5k|}
igraph_vs_is_all:
  544|  13.5k|igraph_bool_t igraph_vs_is_all(const igraph_vs_t *vs) {
  545|  13.5k|    return vs->type == IGRAPH_VS_ALL;
  546|  13.5k|}
igraph_vit_create:
  712|  53.0k|igraph_error_t igraph_vit_create(const igraph_t *graph, igraph_vs_t vs, igraph_vit_t *vit) {
  713|  53.0k|    igraph_vector_int_t vec;
  714|  53.0k|    igraph_vector_int_t *vec_int;
  715|  53.0k|    igraph_bool_t *seen;
  716|  53.0k|    igraph_int_t i, j, n;
  717|  53.0k|    igraph_int_t vec_len;
  718|       |
  719|  53.0k|    switch (vs.type) {
  720|  53.0k|    case IGRAPH_VS_ALL:
  ------------------
  |  Branch (720:5): [True: 53.0k, False: 0]
  ------------------
  721|  53.0k|        vit->type = IGRAPH_VIT_RANGE;
  722|  53.0k|        vit->pos = 0;
  723|  53.0k|        vit->start = 0;
  724|  53.0k|        vit->end = igraph_vcount(graph);
  725|  53.0k|        break;
  726|      0|    case IGRAPH_VS_ADJ:
  ------------------
  |  Branch (726:5): [True: 0, False: 53.0k]
  ------------------
  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: 53.0k]
  ------------------
  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: 53.0k]
  ------------------
  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: 53.0k]
  ------------------
  797|      0|        vit->type = IGRAPH_VIT_RANGE;
  798|      0|        vit->pos = vs.data.vid;
  799|      0|        vit->start = vs.data.vid;
  800|      0|        vit->end = vs.data.vid + 1;
  801|      0|        if (vit->pos >= igraph_vcount(graph)) {
  ------------------
  |  Branch (801:13): [True: 0, False: 0]
  ------------------
  802|      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]
  |  |  ------------------
  ------------------
  803|      0|        }
  804|      0|        break;
  805|      0|    case IGRAPH_VS_VECTORPTR:
  ------------------
  |  Branch (805:5): [True: 0, False: 53.0k]
  ------------------
  806|      0|    case IGRAPH_VS_VECTOR:
  ------------------
  |  Branch (806:5): [True: 0, False: 53.0k]
  ------------------
  807|      0|        vit->type = IGRAPH_VIT_VECTORPTR;
  808|      0|        vit->pos = 0;
  809|      0|        vit->start = 0;
  810|      0|        vit->vec = vs.data.vecptr;
  811|      0|        vit->end = igraph_vector_int_size(vit->vec);
  812|      0|        if (!igraph_vector_int_isininterval(vit->vec, 0, igraph_vcount(graph) - 1)) {
  ------------------
  |  Branch (812:13): [True: 0, False: 0]
  ------------------
  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|      0|        break;
  816|      0|    case IGRAPH_VS_RANGE:
  ------------------
  |  Branch (816:5): [True: 0, False: 53.0k]
  ------------------
  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: 53.0k]
  ------------------
  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|  53.0k|    }
  837|  53.0k|    return IGRAPH_SUCCESS;
  838|  53.0k|}
igraph_vit_destroy:
  853|  53.0k|void igraph_vit_destroy(const igraph_vit_t *vit) {
  854|  53.0k|    switch (vit->type) {
  855|  53.0k|    case IGRAPH_VIT_RANGE:
  ------------------
  |  Branch (855:5): [True: 53.0k, False: 0]
  ------------------
  856|  53.0k|    case IGRAPH_VIT_VECTORPTR:
  ------------------
  |  Branch (856:5): [True: 0, False: 53.0k]
  ------------------
  857|  53.0k|        break;
  858|      0|    case IGRAPH_VIT_VECTOR:
  ------------------
  |  Branch (858:5): [True: 0, False: 53.0k]
  ------------------
  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: 53.0k]
  ------------------
  863|       |        /*     IGRAPH_ERROR("Cannot destroy iterator, unknown type", IGRAPH_EINVAL); */
  864|      0|        break;
  865|  53.0k|    }
  866|  53.0k|}
igraph_es_all:
  921|  27.8k|                  igraph_edgeorder_type_t order) {
  922|  27.8k|    switch (order) {
  923|  24.4k|    case IGRAPH_EDGEORDER_ID:
  ------------------
  |  Branch (923:5): [True: 24.4k, False: 3.40k]
  ------------------
  924|  24.4k|        es->type = IGRAPH_ES_ALL;
  925|  24.4k|        break;
  926|  3.40k|    case IGRAPH_EDGEORDER_FROM:
  ------------------
  |  Branch (926:5): [True: 3.40k, False: 24.4k]
  ------------------
  927|  3.40k|        es->type = IGRAPH_ES_ALLFROM;
  928|  3.40k|        break;
  929|      0|    case IGRAPH_EDGEORDER_TO:
  ------------------
  |  Branch (929:5): [True: 0, False: 27.8k]
  ------------------
  930|      0|        es->type = IGRAPH_ES_ALLTO;
  931|      0|        break;
  932|      0|    default:
  ------------------
  |  Branch (932:5): [True: 0, False: 27.8k]
  ------------------
  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|  27.8k|    }
  936|  27.8k|    return IGRAPH_SUCCESS;
  937|  27.8k|}
igraph_ess_all:
  953|  24.4k|igraph_es_t igraph_ess_all(igraph_edgeorder_type_t order) {
  954|  24.4k|    igraph_es_t es;
  955|  24.4k|    igraph_es_all(&es, order); /* cannot fail */
  956|  24.4k|    return es;
  957|  24.4k|}
igraph_es_destroy:
 1408|  3.40k|void igraph_es_destroy(igraph_es_t *es) {
 1409|  3.40k|    switch (es->type) {
 1410|      0|    case IGRAPH_ES_ALL:
  ------------------
  |  Branch (1410:5): [True: 0, False: 3.40k]
  ------------------
 1411|  3.40k|    case IGRAPH_ES_ALLFROM:
  ------------------
  |  Branch (1411:5): [True: 3.40k, False: 0]
  ------------------
 1412|  3.40k|    case IGRAPH_ES_ALLTO:
  ------------------
  |  Branch (1412:5): [True: 0, False: 3.40k]
  ------------------
 1413|  3.40k|    case IGRAPH_ES_INCIDENT:
  ------------------
  |  Branch (1413:5): [True: 0, False: 3.40k]
  ------------------
 1414|  3.40k|    case IGRAPH_ES_NONE:
  ------------------
  |  Branch (1414:5): [True: 0, False: 3.40k]
  ------------------
 1415|  3.40k|    case IGRAPH_ES_1:
  ------------------
  |  Branch (1415:5): [True: 0, False: 3.40k]
  ------------------
 1416|  3.40k|    case IGRAPH_ES_VECTORPTR:
  ------------------
  |  Branch (1416:5): [True: 0, False: 3.40k]
  ------------------
 1417|  3.40k|    case IGRAPH_ES_RANGE:
  ------------------
  |  Branch (1417:5): [True: 0, False: 3.40k]
  ------------------
 1418|  3.40k|    case IGRAPH_ES_ALL_BETWEEN:
  ------------------
  |  Branch (1418:5): [True: 0, False: 3.40k]
  ------------------
 1419|  3.40k|        break;
 1420|      0|    case IGRAPH_ES_VECTOR:
  ------------------
  |  Branch (1420:5): [True: 0, False: 3.40k]
  ------------------
 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.40k]
  ------------------
 1425|      0|    case IGRAPH_ES_PATH:
  ------------------
  |  Branch (1425:5): [True: 0, False: 3.40k]
  ------------------
 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.40k]
  ------------------
 1430|      0|        break;
 1431|  3.40k|    }
 1432|  3.40k|}
igraph_es_is_all:
 1445|  10.1k|igraph_bool_t igraph_es_is_all(const igraph_es_t *es) {
 1446|  10.1k|    return es->type == IGRAPH_ES_ALL;
 1447|  10.1k|}
igraph_eit_create:
 1922|  21.0k|igraph_error_t igraph_eit_create(const igraph_t *graph, igraph_es_t es, igraph_eit_t *eit) {
 1923|  21.0k|    switch (es.type) {
 1924|  17.6k|    case IGRAPH_ES_ALL:
  ------------------
  |  Branch (1924:5): [True: 17.6k, False: 3.40k]
  ------------------
 1925|  17.6k|        eit->type = IGRAPH_EIT_RANGE;
 1926|  17.6k|        eit->pos = 0;
 1927|  17.6k|        eit->start = 0;
 1928|  17.6k|        eit->end = igraph_ecount(graph);
 1929|  17.6k|        break;
 1930|  3.40k|    case IGRAPH_ES_ALLFROM:
  ------------------
  |  Branch (1930:5): [True: 3.40k, False: 17.6k]
  ------------------
 1931|  3.40k|        IGRAPH_CHECK(igraph_i_eit_create_allfromto(graph, eit, IGRAPH_OUT));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1932|  3.40k|        break;
 1933|  3.40k|    case IGRAPH_ES_ALLTO:
  ------------------
  |  Branch (1933:5): [True: 0, False: 21.0k]
  ------------------
 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.0k]
  ------------------
 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.0k]
  ------------------
 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.0k]
  ------------------
 1946|      0|        eit->type = IGRAPH_EIT_RANGE;
 1947|      0|        eit->pos = es.data.eid;
 1948|      0|        eit->start = es.data.eid;
 1949|      0|        eit->end = es.data.eid + 1;
 1950|      0|        if (eit->pos >= igraph_ecount(graph)) {
  ------------------
  |  Branch (1950:13): [True: 0, False: 0]
  ------------------
 1951|      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]
  |  |  ------------------
  ------------------
 1952|      0|        }
 1953|      0|        break;
 1954|      0|    case IGRAPH_ES_VECTOR:
  ------------------
  |  Branch (1954:5): [True: 0, False: 21.0k]
  ------------------
 1955|      0|    case IGRAPH_ES_VECTORPTR:
  ------------------
  |  Branch (1955:5): [True: 0, False: 21.0k]
  ------------------
 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.0k]
  ------------------
 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.0k]
  ------------------
 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.0k]
  ------------------
 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.0k]
  ------------------
 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.0k]
  ------------------
 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.0k|    }
 1995|  21.0k|    return IGRAPH_SUCCESS;
 1996|  21.0k|}
igraph_eit_destroy:
 2008|  21.0k|void igraph_eit_destroy(const igraph_eit_t *eit) {
 2009|  21.0k|    switch (eit->type) {
 2010|  17.6k|    case IGRAPH_EIT_RANGE:
  ------------------
  |  Branch (2010:5): [True: 17.6k, False: 3.40k]
  ------------------
 2011|  17.6k|    case IGRAPH_EIT_VECTORPTR:
  ------------------
  |  Branch (2011:5): [True: 0, False: 21.0k]
  ------------------
 2012|  17.6k|        break;
 2013|  3.40k|    case IGRAPH_EIT_VECTOR:
  ------------------
  |  Branch (2013:5): [True: 3.40k, False: 17.6k]
  ------------------
 2014|  3.40k|        igraph_vector_int_destroy((igraph_vector_int_t*)eit->vec);
 2015|  3.40k|        igraph_free((igraph_vector_int_t*)eit->vec);
 2016|  3.40k|        break;
 2017|      0|    default:
  ------------------
  |  Branch (2017:5): [True: 0, False: 21.0k]
  ------------------
 2018|       |        /*     IGRAPH_ERROR("Cannot destroy iterator, unknown type", IGRAPH_EINVAL); */
 2019|      0|        break;
 2020|  21.0k|    }
 2021|  21.0k|}
iterators.c:igraph_i_eit_create_allfromto:
 1696|  3.40k|                                         igraph_neimode_t mode) {
 1697|  3.40k|    igraph_vector_int_t *vec;
 1698|  3.40k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
 1699|  3.40k|    igraph_int_t no_of_edges = igraph_ecount(graph);
 1700|       |
 1701|  3.40k|    vec = IGRAPH_CALLOC(1, igraph_vector_int_t);
  ------------------
  |  |   33|  3.40k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.80k|    (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.40k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1702|  3.40k|    IGRAPH_CHECK_OOM(vec, "Cannot create edge iterator.");
  ------------------
  |  |  709|  3.40k|    do { \
  |  |  710|  3.40k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1703|  3.40k|    IGRAPH_FINALLY(igraph_free, vec);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1704|       |
 1705|  3.40k|    IGRAPH_VECTOR_INT_INIT_FINALLY(vec, 0);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1706|  3.40k|    IGRAPH_CHECK(igraph_vector_int_reserve(vec, no_of_edges));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1707|       |
 1708|  3.40k|    if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (1708:9): [True: 3.40k, False: 0]
  ------------------
 1709|  3.40k|        igraph_vector_int_t adj;
 1710|  3.40k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&adj, 0);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
 1711|   155k|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (1711:34): [True: 152k, False: 3.40k]
  ------------------
 1712|   152k|            IGRAPH_CHECK(igraph_incident(graph, &adj, i, mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|   152k|    do { \
  |  |  657|   152k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   152k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   152k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
 1713|   152k|            igraph_vector_int_append(vec, &adj);  /* reserved */
 1714|   152k|        }
 1715|  3.40k|        igraph_vector_int_destroy(&adj);
 1716|  3.40k|        IGRAPH_FINALLY_CLEAN(1);
 1717|  3.40k|    } 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.40k|    eit->type = IGRAPH_EIT_VECTOR;
 1740|  3.40k|    eit->pos = 0;
 1741|  3.40k|    eit->start = 0;
 1742|  3.40k|    eit->vec = vec;
 1743|  3.40k|    eit->end = igraph_vector_int_size(eit->vec);
 1744|       |
 1745|  3.40k|    IGRAPH_FINALLY_CLEAN(2);
 1746|  3.40k|    return IGRAPH_SUCCESS;
 1747|  3.40k|}

igraph_empty:
   64|  48.2k|igraph_error_t igraph_empty(igraph_t *graph, igraph_int_t n, igraph_bool_t directed) {
   65|  48.2k|    return igraph_empty_attrs(graph, n, directed, 0);
   66|  48.2k|}
igraph_edge:
  132|  91.6k|) {
  133|       |
  134|  91.6k|    if (eid < 0 || eid >= igraph_ecount(graph)) {
  ------------------
  |  Branch (134:9): [True: 0, False: 91.6k]
  |  Branch (134:20): [True: 0, False: 91.6k]
  ------------------
  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|  91.6k|    if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (138:9): [True: 91.6k, False: 0]
  ------------------
  139|  91.6k|        *from = IGRAPH_FROM(graph, eid);
  ------------------
  |  |  115|  91.6k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  140|  91.6k|        *to   = IGRAPH_TO(graph, eid);
  ------------------
  |  |  128|  91.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  141|  91.6k|    } 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|  91.6k|    return IGRAPH_SUCCESS;
  147|  91.6k|}
igraph_edges:
  173|  7.53k|) {
  174|  7.53k|    igraph_eit_t eit;
  175|  7.53k|    igraph_int_t n, ptr = 0, ptr2;
  176|       |
  177|  7.53k|    IGRAPH_CHECK(igraph_eit_create(graph, eids, &eit));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  178|  7.53k|    IGRAPH_FINALLY(igraph_eit_destroy, &eit);
  ------------------
  |  |  603|  7.53k|    do { \
  |  |  604|  7.53k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  7.53k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  7.53k|         * incorrect destructor function with the pointer */ \
  |  |  607|  7.53k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 7.53k]
  |  |  ------------------
  |  |  608|  7.53k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  179|  7.53k|    n = IGRAPH_EIT_SIZE(eit);
  ------------------
  |  |  382|  7.53k|#define IGRAPH_EIT_SIZE(eit)  ((eit).end - (eit).start)
  ------------------
  180|  7.53k|    IGRAPH_CHECK(igraph_vector_int_resize(edges, n * 2));
  ------------------
  |  |  656|  7.53k|    do { \
  |  |  657|  7.53k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  7.53k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  7.53k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 7.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|  7.53k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 7.53k]
  |  |  ------------------
  ------------------
  181|       |
  182|  7.53k|    if (bycol) {
  ------------------
  |  Branch (182:9): [True: 0, False: 7.53k]
  ------------------
  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.53k|    } else {
  198|  7.53k|        if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (198:13): [True: 0, False: 7.53k]
  ------------------
  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.53k|        } else {
  205|  93.2k|            for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  371|  93.2k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                          for (; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  359|  85.6k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (205:20): [True: 85.6k, False: 7.53k]
  ------------------
  206|  85.6k|                igraph_int_t e = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|  85.6k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 85.6k, False: 0]
  |  |  ------------------
  |  |  406|  85.6k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  207|  85.6k|                VECTOR(*edges)[ptr++] = IGRAPH_TO(graph, e);
  ------------------
  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr++] = IGRAPH_TO(graph, e);
  ------------------
  |  |  128|  85.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  208|  85.6k|                VECTOR(*edges)[ptr++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*edges)[ptr++] = IGRAPH_FROM(graph, e);
  ------------------
  |  |  115|  85.6k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  85.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  209|  85.6k|            }
  210|  7.53k|        }
  211|  7.53k|    }
  212|       |
  213|  7.53k|    igraph_eit_destroy(&eit);
  214|  7.53k|    IGRAPH_FINALLY_CLEAN(1);
  215|       |
  216|  7.53k|    return IGRAPH_SUCCESS;
  217|  7.53k|}

igraph_empty_attrs:
  102|  48.2k|) {
  103|       |
  104|  48.2k|    if (n < 0) {
  ------------------
  |  Branch (104:9): [True: 0, False: 48.2k]
  ------------------
  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|  48.2k|    memset(graph, 0, sizeof(igraph_t));
  109|       |
  110|  48.2k|    graph->n = 0;
  111|  48.2k|    graph->directed = directed;
  112|  48.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->from, 0);
  ------------------
  |  |  119|  48.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  48.2k|    do { \
  |  |  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  48.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  48.2k|    do { \
  |  |  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  113|  48.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->to, 0);
  ------------------
  |  |  119|  48.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  48.2k|    do { \
  |  |  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  48.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  48.2k|    do { \
  |  |  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  114|  48.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->oi, 0);
  ------------------
  |  |  119|  48.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  48.2k|    do { \
  |  |  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  48.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  48.2k|    do { \
  |  |  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  115|  48.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->ii, 0);
  ------------------
  |  |  119|  48.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  48.2k|    do { \
  |  |  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  48.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  48.2k|    do { \
  |  |  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  116|  48.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->os, 1);
  ------------------
  |  |  119|  48.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  48.2k|    do { \
  |  |  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  48.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  48.2k|    do { \
  |  |  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  117|  48.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->is, 1);
  ------------------
  |  |  119|  48.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  48.2k|    do { \
  |  |  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  48.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  48.2k|    do { \
  |  |  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  48.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  118|       |
  119|       |    /* init cache */
  120|  48.2k|    graph->cache = IGRAPH_CALLOC(1, igraph_i_property_cache_t);
  ------------------
  |  |   33|  48.2k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  96.4k|    (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: 48.2k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  121|  48.2k|    IGRAPH_CHECK_OOM(graph->cache, "Cannot create graph.");
  ------------------
  |  |  709|  48.2k|    do { \
  |  |  710|  48.2k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  122|  48.2k|    IGRAPH_FINALLY(igraph_free, graph->cache);
  ------------------
  |  |  603|  48.2k|    do { \
  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  ------------------
  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  123|  48.2k|    IGRAPH_CHECK(igraph_i_property_cache_init(graph->cache));
  ------------------
  |  |  656|  48.2k|    do { \
  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  124|  48.2k|    IGRAPH_FINALLY(igraph_i_property_cache_destroy, graph->cache);
  ------------------
  |  |  603|  48.2k|    do { \
  |  |  604|  48.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  48.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  48.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  48.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 48.2k]
  |  |  ------------------
  |  |  608|  48.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  125|       |
  126|  48.2k|    VECTOR(graph->os)[0] = 0;
  ------------------
  |  |   60|  48.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  127|  48.2k|    VECTOR(graph->is)[0] = 0;
  ------------------
  |  |   60|  48.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  128|       |
  129|       |    /* init attributes */
  130|  48.2k|    IGRAPH_CHECK(igraph_i_attribute_init(graph, attr));
  ------------------
  |  |  656|  48.2k|    do { \
  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  131|       |
  132|       |    /* add the vertices */
  133|  48.2k|    IGRAPH_CHECK(igraph_add_vertices(graph, n, 0));
  ------------------
  |  |  656|  48.2k|    do { \
  |  |  657|  48.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  48.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  48.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 48.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|  48.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 48.2k]
  |  |  ------------------
  ------------------
  134|       |
  135|  48.2k|    IGRAPH_FINALLY_CLEAN(8);
  136|  48.2k|    return IGRAPH_SUCCESS;
  137|  48.2k|}
igraph_destroy:
  155|  55.0k|void igraph_destroy(igraph_t *graph) {
  156|  55.0k|    igraph_i_attribute_destroy(graph);
  157|       |
  158|  55.0k|    igraph_i_property_cache_destroy(graph->cache);
  159|  55.0k|    IGRAPH_FREE(graph->cache);
  ------------------
  |  |   36|  55.0k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  160|       |
  161|  55.0k|    igraph_vector_int_destroy(&graph->from);
  162|  55.0k|    igraph_vector_int_destroy(&graph->to);
  163|  55.0k|    igraph_vector_int_destroy(&graph->oi);
  164|  55.0k|    igraph_vector_int_destroy(&graph->ii);
  165|  55.0k|    igraph_vector_int_destroy(&graph->os);
  166|  55.0k|    igraph_vector_int_destroy(&graph->is);
  167|  55.0k|}
igraph_copy:
  195|  6.80k|igraph_error_t igraph_copy(igraph_t *to, const igraph_t *from) {
  196|  6.80k|    memset(to, 0, sizeof(igraph_t));
  197|       |
  198|  6.80k|    to->n = from->n;
  199|  6.80k|    to->directed = from->directed;
  200|  6.80k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->from, &from->from));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  201|  6.80k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->from);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  202|  6.80k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->to, &from->to));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  203|  6.80k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->to);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  204|  6.80k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->oi, &from->oi));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  205|  6.80k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->oi);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  206|  6.80k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->ii, &from->ii));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  207|  6.80k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->ii);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  208|  6.80k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->os, &from->os));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  209|  6.80k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->os);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  210|  6.80k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->is, &from->is));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  211|  6.80k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->is);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  212|       |
  213|  6.80k|    to->cache = IGRAPH_CALLOC(1, igraph_i_property_cache_t);
  ------------------
  |  |   33|  6.80k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  13.6k|    (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: 6.80k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|  6.80k|    IGRAPH_CHECK_OOM(to->cache, "Cannot copy graph.");
  ------------------
  |  |  709|  6.80k|    do { \
  |  |  710|  6.80k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  215|  6.80k|    IGRAPH_FINALLY(igraph_free, to->cache);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  216|  6.80k|    IGRAPH_CHECK(igraph_i_property_cache_copy(to->cache, from->cache));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  217|  6.80k|    IGRAPH_FINALLY(igraph_i_property_cache_destroy, to->cache);
  ------------------
  |  |  603|  6.80k|    do { \
  |  |  604|  6.80k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.80k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.80k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.80k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.80k]
  |  |  ------------------
  |  |  608|  6.80k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  218|       |
  219|  6.80k|    IGRAPH_CHECK(igraph_i_attribute_copy(to, from, true, true, true));
  ------------------
  |  |  656|  6.80k|    do { \
  |  |  657|  6.80k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.80k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.80k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
  220|       |
  221|  6.80k|    IGRAPH_FINALLY_CLEAN(8);
  222|  6.80k|    return IGRAPH_SUCCESS;
  223|  6.80k|}
igraph_add_edges:
  257|  33.4k|) {
  258|  33.4k|    igraph_int_t no_of_edges = igraph_vector_int_size(&graph->from);
  259|  33.4k|    igraph_int_t edges_to_add = igraph_vector_int_size(edges) / 2;
  260|  33.4k|    igraph_int_t new_no_of_edges;
  261|  33.4k|    igraph_int_t i = 0;
  262|  33.4k|    igraph_vector_int_t newoi, newii;
  263|  33.4k|    igraph_bool_t directed = igraph_is_directed(graph);
  264|       |
  265|  33.4k|    if (igraph_vector_int_size(edges) % 2 != 0) {
  ------------------
  |  Branch (265:9): [True: 0, False: 33.4k]
  ------------------
  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|  33.4k|    if (!igraph_vector_int_isininterval(edges, 0, igraph_vcount(graph) - 1)) {
  ------------------
  |  Branch (268:9): [True: 0, False: 33.4k]
  ------------------
  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|  33.4k|    IGRAPH_SAFE_ADD(no_of_edges, edges_to_add, &new_no_of_edges);
  ------------------
  |  |   47|  33.4k|    do { \
  |  |   48|  33.4k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|  33.4k|        igraph_int_t _safe_sum; \
  |  |   50|  33.4k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 33.4k]
  |  |  ------------------
  |  |   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|  33.4k|        *(res) = _safe_sum; \
  |  |   54|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  274|  33.4k|    if (new_no_of_edges > IGRAPH_ECOUNT_MAX) {
  ------------------
  |  |  118|  33.4k|#define IGRAPH_ECOUNT_MAX (IGRAPH_INTEGER_MAX/2)
  |  |  ------------------
  |  |  |  |   72|  33.4k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 33.4k]
  ------------------
  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|  33.4k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->from, no_of_edges + edges_to_add));
  ------------------
  |  |  656|  33.4k|    do { \
  |  |  657|  33.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  33.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  33.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 33.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|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  279|  33.4k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->to, no_of_edges + edges_to_add));
  ------------------
  |  |  656|  33.4k|    do { \
  |  |  657|  33.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  33.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  33.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 33.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|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  280|       |
  281|   564k|    while (i < edges_to_add * 2) {
  ------------------
  |  Branch (281:12): [True: 530k, False: 33.4k]
  ------------------
  282|   530k|        if (directed || VECTOR(*edges)[i] > VECTOR(*edges)[i + 1]) {
  ------------------
  |  |   60|   270k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (directed || VECTOR(*edges)[i] > VECTOR(*edges)[i + 1]) {
  ------------------
  |  |   60|   270k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (282:13): [True: 259k, False: 270k]
  |  Branch (282:25): [True: 79.2k, False: 191k]
  ------------------
  283|   338k|            igraph_vector_int_push_back(&graph->from, VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   338k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  284|   338k|            igraph_vector_int_push_back(&graph->to,   VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   338k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  285|   338k|        } else {
  286|   191k|            igraph_vector_int_push_back(&graph->to,   VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   191k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  287|   191k|            igraph_vector_int_push_back(&graph->from, VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   191k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  288|   191k|        }
  289|   530k|    }
  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|  33.4k|#define CHECK_ERR(expr) \
  299|  33.4k|    do { \
  300|  33.4k|        igraph_error_t err = (expr); \
  301|  33.4k|        if (err != IGRAPH_SUCCESS) { \
  302|  33.4k|            igraph_vector_int_resize(&graph->from, no_of_edges); /* gets smaller, error safe */ \
  303|  33.4k|            igraph_vector_int_resize(&graph->to, no_of_edges);   /* gets smaller, error safe */ \
  304|  33.4k|            IGRAPH_FINALLY_EXIT(); \
  305|  33.4k|            IGRAPH_ERROR("Cannot add edges.", err); \
  306|  33.4k|        } \
  307|  33.4k|    } while (0)
  308|       |
  309|       |    /* oi & ii */
  310|  33.4k|    IGRAPH_FINALLY_ENTER();
  311|  33.4k|    {
  312|  33.4k|        CHECK_ERR(igraph_vector_int_init(&newoi, no_of_edges));
  ------------------
  |  |  299|  33.4k|    do { \
  |  |  300|  33.4k|        igraph_error_t err = (expr); \
  |  |  301|  33.4k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 33.4k]
  |  |  ------------------
  |  |  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|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  313|  33.4k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &newoi);
  ------------------
  |  |  603|  33.4k|    do { \
  |  |  604|  33.4k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  33.4k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  33.4k|         * incorrect destructor function with the pointer */ \
  |  |  607|  33.4k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 33.4k]
  |  |  ------------------
  |  |  608|  33.4k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  314|  33.4k|        CHECK_ERR(igraph_vector_int_init(&newii, no_of_edges));
  ------------------
  |  |  299|  33.4k|    do { \
  |  |  300|  33.4k|        igraph_error_t err = (expr); \
  |  |  301|  33.4k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 33.4k]
  |  |  ------------------
  |  |  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|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  315|  33.4k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &newii);
  ------------------
  |  |  603|  33.4k|    do { \
  |  |  604|  33.4k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  33.4k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  33.4k|         * incorrect destructor function with the pointer */ \
  |  |  607|  33.4k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 33.4k]
  |  |  ------------------
  |  |  608|  33.4k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  316|  33.4k|        CHECK_ERR(igraph_vector_int_pair_order(&graph->from, &graph->to, &newoi, graph->n));
  ------------------
  |  |  299|  33.4k|    do { \
  |  |  300|  33.4k|        igraph_error_t err = (expr); \
  |  |  301|  33.4k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 33.4k]
  |  |  ------------------
  |  |  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|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  317|  33.4k|        CHECK_ERR(igraph_vector_int_pair_order(&graph->to, &graph->from, &newii, graph->n));
  ------------------
  |  |  299|  33.4k|    do { \
  |  |  300|  33.4k|        igraph_error_t err = (expr); \
  |  |  301|  33.4k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 33.4k]
  |  |  ------------------
  |  |  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|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  318|       |
  319|       |        /* Attributes */
  320|  33.4k|        if (graph->attr) {
  ------------------
  |  Branch (320:13): [True: 33.4k, False: 0]
  ------------------
  321|       |            /* TODO: Does this keep the attribute table in a consistent state upon failure? */
  322|  33.4k|            CHECK_ERR(igraph_i_attribute_add_edges(graph, edges, attr));
  ------------------
  |  |  299|  33.4k|    do { \
  |  |  300|  33.4k|        igraph_error_t err = (expr); \
  |  |  301|  33.4k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 33.4k]
  |  |  ------------------
  |  |  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|  33.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  323|  33.4k|        }
  324|       |
  325|       |        /* os & is, its length does not change, error safe */
  326|  33.4k|        igraph_i_create_start_vectors(&graph->os, &graph->from, &newoi, graph->n);
  327|  33.4k|        igraph_i_create_start_vectors(&graph->is, &graph->to, &newii, graph->n);
  328|       |
  329|       |        /* everything went fine */
  330|  33.4k|        igraph_vector_int_destroy(&graph->oi);
  331|  33.4k|        igraph_vector_int_destroy(&graph->ii);
  332|  33.4k|        IGRAPH_FINALLY_CLEAN(2);
  333|       |
  334|  33.4k|        graph->oi = newoi;
  335|  33.4k|        graph->ii = newii;
  336|  33.4k|    }
  337|      0|    IGRAPH_FINALLY_EXIT();
  338|       |
  339|  33.4k|#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|  33.4k|    igraph_i_property_cache_invalidate_conditionally(
  354|  33.4k|        graph,
  355|  33.4k|        /* keep_always = */ 0,
  356|       |        /* keep_when_false = */
  357|  33.4k|        (1 << IGRAPH_PROP_IS_DAG) | (1 << IGRAPH_PROP_IS_FOREST),
  358|       |        /* keep_when_true = */
  359|  33.4k|        (1 << IGRAPH_PROP_IS_WEAKLY_CONNECTED) |
  360|  33.4k|        (1 << IGRAPH_PROP_IS_STRONGLY_CONNECTED) |
  361|  33.4k|        (1 << IGRAPH_PROP_HAS_LOOP) |
  362|  33.4k|        (1 << IGRAPH_PROP_HAS_MULTI) |
  363|  33.4k|        (1 << IGRAPH_PROP_HAS_MUTUAL)
  364|  33.4k|    );
  365|       |
  366|  33.4k|    return IGRAPH_SUCCESS;
  367|  33.4k|}
igraph_add_vertices:
  391|  51.1k|) {
  392|  51.1k|    igraph_int_t ec = igraph_ecount(graph);
  393|  51.1k|    igraph_int_t vc = igraph_vcount(graph);
  394|  51.1k|    igraph_int_t new_vc;
  395|  51.1k|    igraph_int_t i;
  396|       |
  397|  51.1k|    if (nv < 0) {
  ------------------
  |  Branch (397:9): [True: 0, False: 51.1k]
  ------------------
  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|  51.1k|    IGRAPH_SAFE_ADD(graph->n, nv, &new_vc);
  ------------------
  |  |   47|  51.1k|    do { \
  |  |   48|  51.1k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|  51.1k|        igraph_int_t _safe_sum; \
  |  |   50|  51.1k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 51.1k]
  |  |  ------------------
  |  |   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|  51.1k|        *(res) = _safe_sum; \
  |  |   54|  51.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 51.1k]
  |  |  ------------------
  ------------------
  402|  51.1k|    if (new_vc > IGRAPH_VCOUNT_MAX) {
  ------------------
  |  |  100|  51.1k|#define IGRAPH_VCOUNT_MAX (IGRAPH_INTEGER_MAX-1)
  |  |  ------------------
  |  |  |  |   72|  51.1k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  |  |  ------------------
  ------------------
  |  Branch (402:9): [True: 0, False: 51.1k]
  ------------------
  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|  51.1k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->os, new_vc + 1));
  ------------------
  |  |  656|  51.1k|    do { \
  |  |  657|  51.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  51.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  51.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 51.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|  51.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 51.1k]
  |  |  ------------------
  ------------------
  407|  51.1k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->is, new_vc + 1));
  ------------------
  |  |  656|  51.1k|    do { \
  |  |  657|  51.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  51.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  51.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 51.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|  51.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 51.1k]
  |  |  ------------------
  ------------------
  408|       |
  409|  51.1k|    igraph_vector_int_resize(&graph->os, new_vc + 1); /* reserved */
  410|  51.1k|    igraph_vector_int_resize(&graph->is, new_vc + 1); /* reserved */
  411|  1.43M|    for (i = graph->n + 1; i < new_vc + 1; i++) {
  ------------------
  |  Branch (411:28): [True: 1.37M, False: 51.1k]
  ------------------
  412|  1.37M|        VECTOR(graph->os)[i] = ec;
  ------------------
  |  |   60|  1.37M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  413|  1.37M|        VECTOR(graph->is)[i] = ec;
  ------------------
  |  |   60|  1.37M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  414|  1.37M|    }
  415|       |
  416|  51.1k|    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|  51.1k|    if (graph->attr) {
  ------------------
  |  Branch (422:9): [True: 51.1k, False: 0]
  ------------------
  423|  51.1k|        igraph_error_t err;
  424|  51.1k|        IGRAPH_FINALLY_ENTER();
  425|  51.1k|        err = igraph_i_attribute_add_vertices(graph, nv, attr);
  426|  51.1k|        if (err != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (426:13): [True: 0, False: 51.1k]
  ------------------
  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|  51.1k|        IGRAPH_FINALLY_EXIT();
  433|  51.1k|        if (err != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (433:13): [True: 0, False: 51.1k]
  ------------------
  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|  51.1k|    }
  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|  51.1k|    igraph_i_property_cache_invalidate_conditionally(
  458|  51.1k|        graph,
  459|       |        /* keep_always = */
  460|  51.1k|        (1 << IGRAPH_PROP_HAS_LOOP) |
  461|  51.1k|        (1 << IGRAPH_PROP_HAS_MULTI) |
  462|  51.1k|        (1 << IGRAPH_PROP_HAS_MUTUAL) |
  463|  51.1k|        (1 << IGRAPH_PROP_IS_DAG) |
  464|  51.1k|        (1 << IGRAPH_PROP_IS_FOREST),
  465|       |        /* keep_when_false = */
  466|  51.1k|        igraph_vcount(graph) >= 2 ? (
  ------------------
  |  Branch (466:9): [True: 34.5k, False: 16.5k]
  ------------------
  467|  34.5k|            (1 << IGRAPH_PROP_IS_STRONGLY_CONNECTED) |
  468|  34.5k|            (1 << IGRAPH_PROP_IS_WEAKLY_CONNECTED)
  469|  34.5k|        ) : 0,
  470|       |        /* keep_when_true = */
  471|  51.1k|        0
  472|  51.1k|    );
  473|       |
  474|  51.1k|    return IGRAPH_SUCCESS;
  475|  51.1k|}
igraph_vcount:
  829|  5.00M|igraph_int_t igraph_vcount(const igraph_t *graph) {
  830|  5.00M|    return graph->n;
  831|  5.00M|}
igraph_ecount:
  843|   380k|igraph_int_t igraph_ecount(const igraph_t *graph) {
  844|   380k|    return igraph_vector_int_size(&graph->from);
  845|   380k|}
igraph_neighbors:
  894|  1.04M|) {
  895|       |
  896|  1.04M|#define DEDUPLICATE_IF_NEEDED(vertex, n)                                          \
  897|  1.04M|    if (should_filter_duplicates) {                                               \
  898|  1.04M|        if (vertex == pnode) {                                                    \
  899|       |            /* This is a loop edge */                                             \
  900|  1.04M|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  901|       |                /* Filtering loop edges unconditionally */                        \
  902|  1.04M|                length -= n;                                                      \
  903|  1.04M|                continue;                                                         \
  904|  1.04M|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  905|       |                /* Filtering every second endpoint of loop edges */               \
  906|  1.04M|                length -= n;                                                      \
  907|  1.04M|                last_added = -1;                                                  \
  908|  1.04M|                seen_loop = true;                                                 \
  909|  1.04M|                continue;                                                         \
  910|  1.04M|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  911|       |                /* Filtering multi-loop edges */                                  \
  912|  1.04M|                length -= n;                                                      \
  913|  1.04M|                continue;                                                         \
  914|  1.04M|            } else {                                                              \
  915|  1.04M|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  916|  1.04M|                last_added = vertex;                                              \
  917|  1.04M|            }                                                                     \
  918|  1.04M|        } else {                                                                  \
  919|       |            /* Not a loop edge */                                                 \
  920|  1.04M|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  921|       |                /* Filtering multi-edges */                                       \
  922|  1.04M|                length -= n;                                                      \
  923|  1.04M|                continue;                                                         \
  924|  1.04M|            } else {                                                              \
  925|  1.04M|                last_added = vertex;                                              \
  926|  1.04M|            }                                                                     \
  927|  1.04M|        }                                                                         \
  928|  1.04M|    }
  929|       |
  930|  1.04M|    igraph_int_t length = 0, idx = 0;
  931|  1.04M|    igraph_int_t i, j;
  932|       |
  933|  1.04M|    igraph_int_t node = pnode;
  934|  1.04M|    igraph_int_t last_added = -1;
  935|  1.04M|    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|  1.04M|    igraph_bool_t seen_loop = false;
  943|       |
  944|       |    /* normalize Boolean value to enable == comparisons below and in DEDUPLICATE_IF_NEEDED */
  945|  1.04M|    multiple = !!multiple;
  946|       |
  947|  1.04M|    if (node < 0 || node > igraph_vcount(graph) - 1) {
  ------------------
  |  Branch (947:9): [True: 0, False: 1.04M]
  |  Branch (947:21): [True: 0, False: 1.04M]
  ------------------
  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|  1.04M|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (950:9): [True: 897k, False: 149k]
  |  Branch (950:31): [True: 897k, False: 0]
  |  Branch (950:52): [True: 0, False: 897k]
  ------------------
  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|  1.04M|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (954:9): [True: 301k, False: 745k]
  ------------------
  955|   301k|        mode = IGRAPH_ALL;
  956|   301k|    }
  957|       |
  958|  1.04M|    if (mode != IGRAPH_ALL && loops == IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (958:9): [True: 0, False: 1.04M]
  |  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|  1.04M|    if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (969:9): [True: 1.04M, False: 0]
  ------------------
  970|  1.04M|        length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  1.04M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  1.04M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  971|  1.04M|    }
  972|  1.04M|    if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (972:9): [True: 1.04M, False: 0]
  ------------------
  973|  1.04M|        length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  1.04M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  1.04M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  974|  1.04M|    }
  975|       |
  976|  1.04M|    IGRAPH_CHECK(igraph_vector_int_resize(neis, length));
  ------------------
  |  |  656|  1.04M|    do { \
  |  |  657|  1.04M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.04M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.04M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.04M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.04M]
  |  |  ------------------
  ------------------
  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|  1.04M|    if (!igraph_is_directed(graph) || mode != IGRAPH_ALL) {
  ------------------
  |  Branch (987:9): [True: 301k, False: 745k]
  |  Branch (987:39): [True: 0, False: 745k]
  ------------------
  988|       |        /* graph is undirected or we did not ask for both directions in a
  989|       |         * directed graph; this is the easy case */
  990|       |
  991|   301k|        should_filter_duplicates = !(multiple == IGRAPH_MULTIPLE &&
  ------------------
  |  Branch (991:38): [True: 301k, False: 0]
  ------------------
  992|   301k|                ((!igraph_is_directed(graph) && loops == IGRAPH_LOOPS_TWICE) ||
  ------------------
  |  Branch (992:19): [True: 301k, False: 0]
  |  Branch (992:49): [True: 149k, False: 152k]
  ------------------
  993|   152k|                 (igraph_is_directed(graph) && loops != IGRAPH_NO_LOOPS)));
  ------------------
  |  Branch (993:19): [True: 0, False: 152k]
  |  Branch (993:48): [True: 0, False: 0]
  ------------------
  994|       |
  995|   301k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (995:13): [True: 301k, False: 0]
  ------------------
  996|   301k|            j = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|   301k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  997|   409k|            for (i = VECTOR(graph->os)[node]; i < j; i++) {
  ------------------
  |  |   60|   301k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (997:47): [True: 107k, False: 301k]
  ------------------
  998|   107k|                igraph_int_t to = VECTOR(graph->to)[ VECTOR(graph->oi)[i] ];
  ------------------
  |  |   60|   107k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              igraph_int_t to = VECTOR(graph->to)[ VECTOR(graph->oi)[i] ];
  ------------------
  |  |   60|   107k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  999|   107k|                DEDUPLICATE_IF_NEEDED(to, 1);
  ------------------
  |  |  897|   107k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 53.8k, False: 53.8k]
  |  |  ------------------
  |  |  898|  53.8k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 53.8k]
  |  |  ------------------
  |  |  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|  53.8k|        } else {                                                                  \
  |  |  919|  53.8k|            /* Not a loop edge */                                                 \
  |  |  920|  53.8k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 53.8k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  53.8k|            } else {                                                              \
  |  |  925|  53.8k|                last_added = vertex;                                              \
  |  |  926|  53.8k|            }                                                                     \
  |  |  927|  53.8k|        }                                                                         \
  |  |  928|  53.8k|    }
  ------------------
 1000|   107k|                VECTOR(*neis)[idx++] = to;
  ------------------
  |  |   60|   107k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1001|   107k|            }
 1002|   301k|        }
 1003|       |
 1004|   301k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1004:13): [True: 301k, False: 0]
  ------------------
 1005|   301k|            j = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|   301k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1006|   409k|            for (i = VECTOR(graph->is)[node]; i < j; i++) {
  ------------------
  |  |   60|   301k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1006:47): [True: 107k, False: 301k]
  ------------------
 1007|   107k|                igraph_int_t from = VECTOR(graph->from)[ VECTOR(graph->ii)[i] ];
  ------------------
  |  |   60|   107k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              igraph_int_t from = VECTOR(graph->from)[ VECTOR(graph->ii)[i] ];
  ------------------
  |  |   60|   107k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1008|   107k|                DEDUPLICATE_IF_NEEDED(from, 1);
  ------------------
  |  |  897|   107k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 53.8k, False: 53.8k]
  |  |  ------------------
  |  |  898|  53.8k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 53.8k]
  |  |  ------------------
  |  |  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|  53.8k|        } else {                                                                  \
  |  |  919|  53.8k|            /* Not a loop edge */                                                 \
  |  |  920|  53.8k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 53.8k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  53.8k|            } else {                                                              \
  |  |  925|  53.8k|                last_added = vertex;                                              \
  |  |  926|  53.8k|            }                                                                     \
  |  |  927|  53.8k|        }                                                                         \
  |  |  928|  53.8k|    }
  ------------------
 1009|   107k|                VECTOR(*neis)[idx++] = from;
  ------------------
  |  |   60|   107k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1010|   107k|            }
 1011|   301k|        }
 1012|   745k|    } 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|   745k|        igraph_int_t j1 = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|   745k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1017|   745k|        igraph_int_t j2 = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|   745k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1018|   745k|        igraph_int_t i1 = VECTOR(graph->os)[node];
  ------------------
  |  |   60|   745k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1019|   745k|        igraph_int_t i2 = VECTOR(graph->is)[node];
  ------------------
  |  |   60|   745k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1020|   745k|        igraph_int_t eid1, eid2;
 1021|   745k|        igraph_int_t n1, n2;
 1022|       |
 1023|   745k|        should_filter_duplicates = !(multiple == IGRAPH_MULTIPLE &&
  ------------------
  |  Branch (1023:38): [True: 745k, False: 0]
  ------------------
 1024|   745k|                loops == IGRAPH_LOOPS_TWICE);
  ------------------
  |  Branch (1024:17): [True: 299k, False: 445k]
  ------------------
 1025|       |
 1026|  1.07M|        while (i1 < j1 && i2 < j2) {
  ------------------
  |  Branch (1026:16): [True: 436k, False: 633k]
  |  Branch (1026:27): [True: 325k, False: 111k]
  ------------------
 1027|   325k|            eid1 = VECTOR(graph->oi)[i1];
  ------------------
  |  |   60|   325k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1028|   325k|            eid2 = VECTOR(graph->ii)[i2];
  ------------------
  |  |   60|   325k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1029|   325k|            n1 = VECTOR(graph->to)[eid1];
  ------------------
  |  |   60|   325k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1030|   325k|            n2 = VECTOR(graph->from)[eid2];
  ------------------
  |  |   60|   325k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1031|   325k|            if (n1 < n2) {
  ------------------
  |  Branch (1031:17): [True: 120k, False: 205k]
  ------------------
 1032|   120k|                i1++;
 1033|   120k|                DEDUPLICATE_IF_NEEDED(n1, 1);
  ------------------
  |  |  897|   120k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 76.1k, False: 43.9k]
  |  |  ------------------
  |  |  898|  76.1k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 76.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|  76.1k|        } else {                                                                  \
  |  |  919|  76.1k|            /* Not a loop edge */                                                 \
  |  |  920|  76.1k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 76.1k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  76.1k|            } else {                                                              \
  |  |  925|  76.1k|                last_added = vertex;                                              \
  |  |  926|  76.1k|            }                                                                     \
  |  |  927|  76.1k|        }                                                                         \
  |  |  928|  76.1k|    }
  ------------------
 1034|   120k|                VECTOR(*neis)[idx++] = n1;
  ------------------
  |  |   60|   120k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1035|   205k|            } else if (n1 > n2) {
  ------------------
  |  Branch (1035:24): [True: 119k, False: 85.8k]
  ------------------
 1036|   119k|                i2++;
 1037|   119k|                DEDUPLICATE_IF_NEEDED(n2, 1);
  ------------------
  |  |  897|   119k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 75.0k, False: 44.4k]
  |  |  ------------------
  |  |  898|  75.0k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 75.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|  75.0k|        } else {                                                                  \
  |  |  919|  75.0k|            /* Not a loop edge */                                                 \
  |  |  920|  75.0k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 75.0k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  75.0k|            } else {                                                              \
  |  |  925|  75.0k|                last_added = vertex;                                              \
  |  |  926|  75.0k|            }                                                                     \
  |  |  927|  75.0k|        }                                                                         \
  |  |  928|  75.0k|    }
  ------------------
 1038|   119k|                VECTOR(*neis)[idx++] = n2;
  ------------------
  |  |   60|   119k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1039|   119k|            } else {
 1040|  85.8k|                i1++;
 1041|  85.8k|                i2++;
 1042|  85.8k|                DEDUPLICATE_IF_NEEDED(n1, 2);
  ------------------
  |  |  897|  85.8k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 79.9k, False: 5.82k]
  |  |  ------------------
  |  |  898|  79.9k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 68.1k, False: 11.8k]
  |  |  ------------------
  |  |  899|  68.1k|            /* This is a loop edge */                                             \
  |  |  900|  68.1k|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 68.1k, False: 0]
  |  |  ------------------
  |  |  901|  68.1k|                /* Filtering loop edges unconditionally */                        \
  |  |  902|  68.1k|                length -= n;                                                      \
  |  |  903|  68.1k|                continue;                                                         \
  |  |  904|  68.1k|            } 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|  68.1k|        } else {                                                                  \
  |  |  919|  11.8k|            /* Not a loop edge */                                                 \
  |  |  920|  11.8k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 11.8k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  11.8k|            } else {                                                              \
  |  |  925|  11.8k|                last_added = vertex;                                              \
  |  |  926|  11.8k|            }                                                                     \
  |  |  927|  11.8k|        }                                                                         \
  |  |  928|  79.9k|    }
  ------------------
 1043|  17.6k|                VECTOR(*neis)[idx++] = n1;
  ------------------
  |  |   60|  17.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1044|  17.6k|                DEDUPLICATE_IF_NEEDED(n2, 1);
  ------------------
  |  |  897|  17.6k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 11.8k, False: 5.82k]
  |  |  ------------------
  |  |  898|  11.8k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 11.8k]
  |  |  ------------------
  |  |  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|  11.8k|        } else {                                                                  \
  |  |  919|  11.8k|            /* Not a loop edge */                                                 \
  |  |  920|  11.8k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 11.8k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  11.8k|            } else {                                                              \
  |  |  925|  11.8k|                last_added = vertex;                                              \
  |  |  926|  11.8k|            }                                                                     \
  |  |  927|  11.8k|        }                                                                         \
  |  |  928|  11.8k|    }
  ------------------
 1045|  17.6k|                VECTOR(*neis)[idx++] = n2;
  ------------------
  |  |   60|  17.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1046|  17.6k|            }
 1047|   325k|        }
 1048|       |
 1049|   904k|        while (i1 < j1) {
  ------------------
  |  Branch (1049:16): [True: 159k, False: 745k]
  ------------------
 1050|   159k|            eid1 = VECTOR(graph->oi)[i1++];
  ------------------
  |  |   60|   159k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1051|   159k|            igraph_int_t to = VECTOR(graph->to)[eid1];
  ------------------
  |  |   60|   159k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1052|   159k|            DEDUPLICATE_IF_NEEDED(to, 1);
  ------------------
  |  |  897|   159k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 99.0k, False: 60.7k]
  |  |  ------------------
  |  |  898|  99.0k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 99.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|  99.0k|        } else {                                                                  \
  |  |  919|  99.0k|            /* Not a loop edge */                                                 \
  |  |  920|  99.0k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 99.0k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  99.0k|            } else {                                                              \
  |  |  925|  99.0k|                last_added = vertex;                                              \
  |  |  926|  99.0k|            }                                                                     \
  |  |  927|  99.0k|        }                                                                         \
  |  |  928|  99.0k|    }
  ------------------
 1053|   159k|            VECTOR(*neis)[idx++] = to;
  ------------------
  |  |   60|   159k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1054|   159k|        }
 1055|       |
 1056|   905k|        while (i2 < j2) {
  ------------------
  |  Branch (1056:16): [True: 160k, False: 745k]
  ------------------
 1057|   160k|            eid2 = VECTOR(graph->ii)[i2++];
  ------------------
  |  |   60|   160k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1058|   160k|            igraph_int_t from = VECTOR(graph->from)[eid2];
  ------------------
  |  |   60|   160k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1059|   160k|            DEDUPLICATE_IF_NEEDED(from, 1);
  ------------------
  |  |  897|   160k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 100k, False: 60.2k]
  |  |  ------------------
  |  |  898|   100k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 100k]
  |  |  ------------------
  |  |  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|   100k|        } else {                                                                  \
  |  |  919|   100k|            /* Not a loop edge */                                                 \
  |  |  920|   100k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 100k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|   100k|            } else {                                                              \
  |  |  925|   100k|                last_added = vertex;                                              \
  |  |  926|   100k|            }                                                                     \
  |  |  927|   100k|        }                                                                         \
  |  |  928|   100k|    }
  ------------------
 1060|   160k|            VECTOR(*neis)[idx++] = from;
  ------------------
  |  |   60|   160k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1061|   160k|        }
 1062|       |
 1063|   745k|    }
 1064|  1.04M|    IGRAPH_CHECK(igraph_vector_int_resize(neis, length));
  ------------------
  |  |  656|  1.04M|    do { \
  |  |  657|  1.04M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.04M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.04M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.04M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.04M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.04M]
  |  |  ------------------
  ------------------
 1065|       |
 1066|  1.04M|    return IGRAPH_SUCCESS;
 1067|  1.04M|#undef DEDUPLICATE_IF_NEEDED
 1068|  1.04M|}
igraph_is_directed:
 1133|  6.21M|igraph_bool_t igraph_is_directed(const igraph_t *graph) {
 1134|  6.21M|    return graph->directed;
 1135|  6.21M|}
igraph_degree:
 1268|  49.7k|) {
 1269|       |
 1270|  49.7k|    igraph_int_t nodes_to_calc;
 1271|  49.7k|    igraph_int_t i, j;
 1272|  49.7k|    igraph_vit_t vit;
 1273|       |
 1274|  49.7k|    IGRAPH_CHECK(igraph_vit_create(graph, vids, &vit));
  ------------------
  |  |  656|  49.7k|    do { \
  |  |  657|  49.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  49.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  49.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 49.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|  49.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 49.7k]
  |  |  ------------------
  ------------------
 1275|  49.7k|    IGRAPH_FINALLY(igraph_vit_destroy, &vit);
  ------------------
  |  |  603|  49.7k|    do { \
  |  |  604|  49.7k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  49.7k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  49.7k|         * incorrect destructor function with the pointer */ \
  |  |  607|  49.7k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 49.7k]
  |  |  ------------------
  |  |  608|  49.7k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  49.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 49.7k]
  |  |  ------------------
  ------------------
 1276|       |
 1277|  49.7k|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1277:9): [True: 39.7k, False: 10.0k]
  |  Branch (1277:31): [True: 36.3k, False: 3.40k]
  |  Branch (1277:52): [True: 0, False: 36.3k]
  ------------------
 1278|      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]
  |  |  ------------------
  ------------------
 1279|      0|    }
 1280|       |
 1281|  49.7k|    if (loops == IGRAPH_NO_LOOPS || loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (1281:9): [True: 0, False: 49.7k]
  |  Branch (1281:37): [True: 0, False: 49.7k]
  ------------------
 1282|       |        /* If the graph is known not to have loops, we can use the faster
 1283|       |         * loops == IGRAPH_LOOPS_TWICE code path, which has O(1) complexity
 1284|       |         * instead of of O(d). */
 1285|      0|        if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (1285:13): [True: 0, False: 0]
  ------------------
 1286|      0|            !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (1286:13): [True: 0, False: 0]
  ------------------
 1287|      0|            loops = IGRAPH_LOOPS_TWICE;
 1288|      0|        }
 1289|      0|    }
 1290|       |
 1291|  49.7k|    if (loops == IGRAPH_LOOPS_ONCE && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1291:9): [True: 0, False: 49.7k]
  |  Branch (1291:39): [True: 0, False: 0]
  ------------------
 1292|       |        /* We can use the faster loops == IGRAPH_LOOPS_TWICE path again */
 1293|      0|        loops = IGRAPH_LOOPS_TWICE;
 1294|      0|    }
 1295|       |
 1296|  49.7k|    nodes_to_calc = IGRAPH_VIT_SIZE(vit);
  ------------------
  |  |  190|  49.7k|#define IGRAPH_VIT_SIZE(vit)  ((vit).end - (vit).start)
  ------------------
 1297|  49.7k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (1297:9): [True: 11.5k, False: 38.1k]
  ------------------
 1298|  11.5k|        mode = IGRAPH_ALL;
 1299|  11.5k|    }
 1300|       |
 1301|  49.7k|    IGRAPH_CHECK(igraph_vector_int_resize(res, nodes_to_calc));
  ------------------
  |  |  656|  49.7k|    do { \
  |  |  657|  49.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  49.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  49.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 49.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|  49.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 49.7k]
  |  |  ------------------
  ------------------
 1302|  49.7k|    igraph_vector_int_null(res);
 1303|       |
 1304|  49.7k|    if (loops == IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (1304:9): [True: 49.7k, False: 0]
  ------------------
 1305|  49.7k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1305:13): [True: 46.3k, False: 3.40k]
  ------------------
 1306|  46.3k|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|  46.3k|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1307|  2.11M|                 !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|  2.11M|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1307:18): [True: 2.06M, False: 46.3k]
  ------------------
 1308|  2.06M|                 IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|  2.06M|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1309|  2.06M|                igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|  2.06M|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 2.06M, False: 0]
  |  |  ------------------
  |  |  215|  2.06M|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1310|  2.06M|                VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|  2.06M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|  2.06M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|  2.06M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1311|  2.06M|            }
 1312|  46.3k|        }
 1313|  49.7k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1313:13): [True: 39.7k, False: 10.0k]
  ------------------
 1314|  39.7k|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|  39.7k|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1315|  1.81M|                 !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|  1.81M|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1315:18): [True: 1.77M, False: 39.7k]
  ------------------
 1316|  1.77M|                 IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|  1.77M|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1317|  1.77M|                igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|  1.77M|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 1.77M, False: 0]
  |  |  ------------------
  |  |  215|  1.77M|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1318|  1.77M|                VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|  1.77M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|  1.77M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|  1.77M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1319|  1.77M|            }
 1320|  39.7k|        }
 1321|  49.7k|    } else if (loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (1321:16): [True: 0, False: 0]
  ------------------
 1322|      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]
  |  |  ------------------
  ------------------
 1323|       |
 1324|       |        /* We arbitrarily count loop edges in the (mode & IGRAPH_OUT) branch but
 1325|       |         * not in the (mode & IGRAPH_IN) branch */
 1326|       |
 1327|      0|        if (igraph_vs_is_all(&vids)) {
  ------------------
  |  Branch (1327:13): [True: 0, False: 0]
  ------------------
 1328|       |            // When calculating degree for all vertices, iterating over edges is faster
 1329|      0|            igraph_int_t no_of_edges = igraph_ecount(graph);
 1330|       |
 1331|       |            /* mode & IGRAPH_OUT branch */
 1332|      0|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (1332:41): [True: 0, False: 0]
  ------------------
 1333|      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)
  |  |  ------------------
  ------------------
 1334|      0|                VECTOR(*res)[from]++;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1335|      0|            }
 1336|       |
 1337|       |            /* mode & IGRAPH_IN branch */
 1338|      0|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (1338:41): [True: 0, False: 0]
  ------------------
 1339|      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)
  |  |  ------------------
  ------------------
 1340|      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 (1340:21): [True: 0, False: 0]
  ------------------
 1341|      0|                    VECTOR(*res)[to]++;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1342|      0|                }
 1343|      0|            }
 1344|      0|        } else {
 1345|       |            /* mode & IGRAPH_OUT branch */
 1346|      0|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|      0|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1347|      0|                !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|      0|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1347:17): [True: 0, False: 0]
  ------------------
 1348|      0|                IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|      0|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1349|      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)
  |  |  ------------------
  ------------------
 1350|      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)
  ------------------
 1351|      0|            }
 1352|       |
 1353|       |            /* mode & IGRAPH_IN branch */
 1354|      0|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|      0|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1355|      0|                !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|      0|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1355:17): [True: 0, False: 0]
  ------------------
 1356|      0|                IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|      0|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1357|      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)
  |  |  ------------------
  ------------------
 1358|      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)
  ------------------
 1359|      0|                for (j = VECTOR(graph->is)[vid];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1360|      0|                    j < VECTOR(graph->is)[vid + 1]; j++) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1360:21): [True: 0, False: 0]
  ------------------
 1361|      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 (1361:25): [True: 0, False: 0]
  ------------------
 1362|      0|                        VECTOR(*res)[i] -= 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1363|      0|                    }
 1364|      0|                }
 1365|      0|            }
 1366|      0|        }
 1367|      0|    } else {
 1368|       |        /* no loops should be counted */
 1369|      0|        if (igraph_vs_is_all(&vids)) {
  ------------------
  |  Branch (1369:13): [True: 0, False: 0]
  ------------------
 1370|       |            // When calculating degree for all vertices, iterating over edges is faster
 1371|      0|            igraph_int_t no_of_edges = igraph_ecount(graph);
 1372|       |
 1373|      0|            if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1373:17): [True: 0, False: 0]
  ------------------
 1374|      0|                for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (1374:45): [True: 0, False: 0]
  ------------------
 1375|      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)
  |  |  ------------------
  ------------------
 1376|      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 (1376:25): [True: 0, False: 0]
  ------------------
 1377|      0|                        VECTOR(*res)[from]++;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1378|      0|                    }
 1379|      0|                }
 1380|      0|            }
 1381|      0|            if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1381:17): [True: 0, False: 0]
  ------------------
 1382|      0|                for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (1382:45): [True: 0, False: 0]
  ------------------
 1383|      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)
  |  |  ------------------
  ------------------
 1384|      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 (1384:25): [True: 0, False: 0]
  ------------------
 1385|      0|                        VECTOR(*res)[to]++;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1386|      0|                    }
 1387|      0|                }
 1388|      0|            }
 1389|      0|        } else {
 1390|      0|            if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1390:17): [True: 0, False: 0]
  ------------------
 1391|      0|                for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|      0|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1392|      0|                    !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|      0|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1392:21): [True: 0, False: 0]
  ------------------
 1393|      0|                    IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|      0|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1394|      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)
  |  |  ------------------
  ------------------
 1395|      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)
  ------------------
 1396|      0|                    for (j = VECTOR(graph->os)[vid];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1397|      0|                        j < VECTOR(graph->os)[vid + 1]; j++) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1397:25): [True: 0, False: 0]
  ------------------
 1398|      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 (1398:29): [True: 0, False: 0]
  ------------------
 1399|      0|                            VECTOR(*res)[i] -= 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1400|      0|                        }
 1401|      0|                    }
 1402|      0|                }
 1403|      0|            }
 1404|      0|            if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1404:17): [True: 0, False: 0]
  ------------------
 1405|      0|                for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|      0|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1406|      0|                    !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|      0|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1406:21): [True: 0, False: 0]
  ------------------
 1407|      0|                    IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|      0|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1408|      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)
  |  |  ------------------
  ------------------
 1409|      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)
  ------------------
 1410|      0|                    for (j = VECTOR(graph->is)[vid];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1411|      0|                        j < VECTOR(graph->is)[vid + 1]; j++) {
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1411:25): [True: 0, False: 0]
  ------------------
 1412|      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 (1412:29): [True: 0, False: 0]
  ------------------
 1413|      0|                            VECTOR(*res)[i] -= 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1414|      0|                        }
 1415|      0|                    }
 1416|      0|                }
 1417|      0|            }
 1418|      0|        }
 1419|      0|    }
 1420|       |
 1421|  49.7k|    igraph_vit_destroy(&vit);
 1422|  49.7k|    IGRAPH_FINALLY_CLEAN(1);
 1423|       |
 1424|  49.7k|    return IGRAPH_SUCCESS;
 1425|  49.7k|}
igraph_incident:
 1778|  3.29M|) {
 1779|  3.29M|    igraph_int_t length = 0, idx = 0;
 1780|  3.29M|    igraph_int_t i, j;
 1781|  3.29M|    igraph_int_t node = pnode;
 1782|  3.29M|    igraph_bool_t directed = igraph_is_directed(graph);
 1783|       |
 1784|  3.29M|    if (node < 0 || node > igraph_vcount(graph) - 1) {
  ------------------
  |  Branch (1784:9): [True: 0, False: 3.29M]
  |  Branch (1784:21): [True: 0, False: 3.29M]
  ------------------
 1785|      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]
  |  |  ------------------
  ------------------
 1786|      0|    }
 1787|  3.29M|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN &&
  ------------------
  |  Branch (1787:9): [True: 2.54M, False: 755k]
  |  Branch (1787:31): [True: 2.23M, False: 304k]
  ------------------
 1788|  2.23M|        mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1788:9): [True: 0, False: 2.23M]
  ------------------
 1789|      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]
  |  |  ------------------
  ------------------
 1790|      0|    }
 1791|       |
 1792|  3.29M|    if (!directed) {
  ------------------
  |  Branch (1792:9): [True: 1.42M, False: 1.87M]
  ------------------
 1793|  1.42M|        mode = IGRAPH_ALL;
 1794|  1.42M|    }
 1795|       |
 1796|  3.29M|    if (mode != IGRAPH_ALL && loops == IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (1796:9): [True: 1.06M, False: 2.23M]
  |  Branch (1796:31): [True: 755k, False: 304k]
  ------------------
 1797|       |        /*
 1798|       |        IGRAPH_ERROR("For a directed graph (with directions not ignored), "
 1799|       |                     "IGRAPH_LOOPS_TWICE does not make sense.", IGRAPH_EINVAL);
 1800|       |        */
 1801|   755k|        loops = IGRAPH_LOOPS_ONCE;
 1802|   755k|    }
 1803|       |
 1804|       |    /* Calculate needed space first & allocate it */
 1805|       |    /* Note that 'mode' is treated as a bit field here; it's okay because
 1806|       |     * IGRAPH_ALL = IGRAPH_IN | IGRAPH_OUT, bit-wise */
 1807|  3.29M|    if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1807:9): [True: 2.99M, False: 304k]
  ------------------
 1808|  2.99M|        length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  2.99M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  2.99M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1809|  2.99M|    }
 1810|  3.29M|    if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1810:9): [True: 2.54M, False: 755k]
  ------------------
 1811|  2.54M|        length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  2.54M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  2.54M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1812|  2.54M|    }
 1813|       |
 1814|  3.29M|    IGRAPH_CHECK(igraph_vector_int_resize(eids, length));
  ------------------
  |  |  656|  3.29M|    do { \
  |  |  657|  3.29M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.29M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.29M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.29M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.29M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.29M]
  |  |  ------------------
  ------------------
 1815|       |
 1816|       |    /* The loops below produce an ordering what is consistent with the
 1817|       |     * ordering returned by igraph_neighbors(), and this should be preserved.
 1818|       |     * We are dealing with two sorted lists; one for the successors and one
 1819|       |     * for the predecessors. If we have requested only one of them, we have
 1820|       |     * an easy job. If we have requested both, we need to merge the two lists
 1821|       |     * to ensure that the output is sorted by the vertex IDs of the "other"
 1822|       |     * endpoint of the affected edges */
 1823|  3.29M|    if (!directed || mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1823:9): [True: 1.42M, False: 1.87M]
  |  Branch (1823:22): [True: 1.06M, False: 810k]
  ------------------
 1824|       |        /* We did not ask for both directions; this is the easy case */
 1825|       |
 1826|  2.48M|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1826:13): [True: 2.18M, False: 304k]
  ------------------
 1827|  2.18M|            j = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|  2.18M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1828|  3.02M|            for (i = VECTOR(graph->os)[node]; i < j; i++) {
  ------------------
  |  |   60|  2.18M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1828:47): [True: 835k, False: 2.18M]
  ------------------
 1829|   835k|                igraph_int_t edge = VECTOR(graph->oi)[i];
  ------------------
  |  |   60|   835k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1830|   835k|                igraph_int_t other = VECTOR(graph->to)[edge];
  ------------------
  |  |   60|   835k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1831|   835k|                if (loops == IGRAPH_NO_LOOPS && other == pnode) {
  ------------------
  |  Branch (1831:21): [True: 0, False: 835k]
  |  Branch (1831:49): [True: 0, False: 0]
  ------------------
 1832|      0|                    length--;
 1833|   835k|                } else {
 1834|   835k|                    VECTOR(*eids)[idx++] = edge;
  ------------------
  |  |   60|   835k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1835|   835k|                }
 1836|   835k|            }
 1837|  2.18M|        }
 1838|       |
 1839|  2.48M|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1839:13): [True: 1.73M, False: 755k]
  ------------------
 1840|  1.73M|            j = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|  1.73M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1841|  2.36M|            for (i = VECTOR(graph->is)[node]; i < j; i++) {
  ------------------
  |  |   60|  1.73M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1841:47): [True: 633k, False: 1.73M]
  ------------------
 1842|   633k|                igraph_int_t edge = VECTOR(graph->ii)[i];
  ------------------
  |  |   60|   633k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1843|   633k|                igraph_int_t other = VECTOR(graph->from)[edge];
  ------------------
  |  |   60|   633k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1844|   633k|                if ((loops == IGRAPH_NO_LOOPS || (loops == IGRAPH_LOOPS_ONCE && !directed)) && other == pnode) {
  ------------------
  |  Branch (1844:22): [True: 0, False: 633k]
  |  Branch (1844:51): [True: 146k, False: 486k]
  |  Branch (1844:81): [True: 0, False: 146k]
  |  Branch (1844:96): [True: 0, False: 0]
  ------------------
 1845|      0|                    length--;
 1846|   633k|                } else {
 1847|   633k|                    VECTOR(*eids)[idx++] = edge;
  ------------------
  |  |   60|   633k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1848|   633k|                }
 1849|   633k|            }
 1850|  1.73M|        }
 1851|  2.48M|    } else {
 1852|       |        /* both in- and out- neighbors in a directed graph,
 1853|       |           we need to merge the two 'vectors' */
 1854|   810k|        igraph_int_t j1 = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|   810k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1855|   810k|        igraph_int_t j2 = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|   810k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1856|   810k|        igraph_int_t i1 = VECTOR(graph->os)[node];
  ------------------
  |  |   60|   810k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1857|   810k|        igraph_int_t i2 = VECTOR(graph->is)[node];
  ------------------
  |  |   60|   810k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1858|   810k|        igraph_int_t eid1, eid2;
 1859|   810k|        igraph_int_t n1, n2;
 1860|   810k|        igraph_bool_t seen_loop_edge = false;
 1861|       |
 1862|  1.23M|        while (i1 < j1 && i2 < j2) {
  ------------------
  |  Branch (1862:16): [True: 551k, False: 685k]
  |  Branch (1862:27): [True: 426k, False: 125k]
  ------------------
 1863|   426k|            eid1 = VECTOR(graph->oi)[i1];
  ------------------
  |  |   60|   426k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1864|   426k|            eid2 = VECTOR(graph->ii)[i2];
  ------------------
  |  |   60|   426k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1865|   426k|            n1 = VECTOR(graph->to)[eid1];
  ------------------
  |  |   60|   426k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1866|   426k|            n2 = VECTOR(graph->from)[eid2];
  ------------------
  |  |   60|   426k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1867|   426k|            if (n1 < n2) {
  ------------------
  |  Branch (1867:17): [True: 139k, False: 286k]
  ------------------
 1868|   139k|                i1++;
 1869|   139k|                VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|   139k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1870|   286k|            } else if (n1 > n2) {
  ------------------
  |  Branch (1870:24): [True: 146k, False: 139k]
  ------------------
 1871|   146k|                i2++;
 1872|   146k|                VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|   146k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1873|   146k|            } else if (n1 != pnode) {
  ------------------
  |  Branch (1873:24): [True: 21.0k, False: 118k]
  ------------------
 1874|       |                /* multiple edge */
 1875|  21.0k|                i1++;
 1876|  21.0k|                i2++;
 1877|  21.0k|                VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  21.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1878|  21.0k|                VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  21.0k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1879|   118k|            } else {
 1880|       |                /* loop edge */
 1881|   118k|                i1++;
 1882|   118k|                i2++;
 1883|   118k|                if (loops == IGRAPH_NO_LOOPS) {
  ------------------
  |  Branch (1883:21): [True: 0, False: 118k]
  ------------------
 1884|      0|                    length -= 2;
 1885|   118k|                } else if (loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (1885:28): [True: 71.2k, False: 47.4k]
  ------------------
 1886|  71.2k|                    length--;
 1887|  71.2k|                    if (!seen_loop_edge) {
  ------------------
  |  Branch (1887:25): [True: 36.8k, False: 34.4k]
  ------------------
 1888|  36.8k|                        VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  36.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1889|  36.8k|                    } else {
 1890|  34.4k|                        VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  34.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1891|  34.4k|                    }
 1892|  71.2k|                    seen_loop_edge = !seen_loop_edge;
 1893|  71.2k|                } else {
 1894|  47.4k|                    VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  47.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1895|  47.4k|                    VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  47.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1896|  47.4k|                }
 1897|   118k|            }
 1898|   426k|        }
 1899|       |
 1900|  1.01M|        while (i1 < j1) {
  ------------------
  |  Branch (1900:16): [True: 199k, False: 810k]
  ------------------
 1901|   199k|            eid1 = VECTOR(graph->oi)[i1++];
  ------------------
  |  |   60|   199k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1902|   199k|            VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|   199k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1903|   199k|        }
 1904|       |
 1905|  1.00M|        while (i2 < j2) {
  ------------------
  |  Branch (1905:16): [True: 193k, False: 810k]
  ------------------
 1906|   193k|            eid2 = VECTOR(graph->ii)[i2++];
  ------------------
  |  |   60|   193k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1907|   193k|            VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|   193k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1908|   193k|        }
 1909|   810k|    }
 1910|  3.29M|    IGRAPH_CHECK(igraph_vector_int_resize(eids, length));
  ------------------
  |  |  656|  3.29M|    do { \
  |  |  657|  3.29M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.29M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.29M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.29M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.29M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.29M]
  |  |  ------------------
  ------------------
 1911|  3.29M|    return IGRAPH_SUCCESS;
 1912|  3.29M|}
type_indexededgelist.c:igraph_i_create_start_vectors:
 1076|  66.9k|        igraph_vector_int_t *iindex, igraph_int_t nodes) {
 1077|       |
 1078|  66.9k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
 1079|       |
 1080|  66.9k|    igraph_int_t no_of_nodes;
 1081|  66.9k|    igraph_int_t no_of_edges;
 1082|  66.9k|    igraph_int_t i, j, idx;
 1083|       |
 1084|  66.9k|    no_of_nodes = nodes;
 1085|  66.9k|    no_of_edges = igraph_vector_int_size(el);
 1086|       |
 1087|       |    /* result */
 1088|       |
 1089|  66.9k|    IGRAPH_CHECK(igraph_vector_int_resize(res, nodes + 1));
  ------------------
  |  |  656|  66.9k|    do { \
  |  |  657|  66.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  66.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  66.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 66.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|  66.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 66.9k]
  |  |  ------------------
  ------------------
 1090|       |
 1091|       |    /* create the index */
 1092|       |
 1093|  66.9k|    if (no_of_edges == 0) {
  ------------------
  |  Branch (1093:9): [True: 0, False: 66.9k]
  ------------------
 1094|       |        /* empty graph */
 1095|      0|        igraph_vector_int_null(res);
 1096|  66.9k|    } else {
 1097|  66.9k|        idx = -1;
 1098|   402k|        for (i = 0; i <= EDGE(0); i++) {
  ------------------
  |  | 1078|   402k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   402k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   402k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (1098:21): [True: 335k, False: 66.9k]
  ------------------
 1099|   335k|            idx++; VECTOR(*res)[idx] = 0;
  ------------------
  |  |   60|   335k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1100|   335k|        }
 1101|  1.06M|        for (i = 1; i < no_of_edges; i++) {
  ------------------
  |  Branch (1101:21): [True: 994k, False: 66.9k]
  ------------------
 1102|   994k|            igraph_int_t n = EDGE(i) - EDGE(VECTOR(*res)[idx]);
  ------------------
  |  | 1078|   994k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   994k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   994k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                          igraph_int_t n = EDGE(i) - EDGE(VECTOR(*res)[idx]);
  ------------------
  |  | 1078|   994k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   994k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   994k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1103|  2.50M|            for (j = 0; j < n; j++) {
  ------------------
  |  Branch (1103:25): [True: 1.51M, False: 994k]
  ------------------
 1104|  1.51M|                idx++; VECTOR(*res)[idx] = i;
  ------------------
  |  |   60|  1.51M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1105|  1.51M|            }
 1106|   994k|        }
 1107|  66.9k|        j = EDGE(VECTOR(*res)[idx]);
  ------------------
  |  | 1078|  66.9k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  66.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  66.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1108|   976k|        for (i = 0; i < no_of_nodes - j; i++) {
  ------------------
  |  Branch (1108:21): [True: 909k, False: 66.9k]
  ------------------
 1109|   909k|            idx++; VECTOR(*res)[idx] = no_of_edges;
  ------------------
  |  |   60|   909k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1110|   909k|        }
 1111|  66.9k|    }
 1112|       |
 1113|       |    /* clean */
 1114|       |
 1115|  66.9k|# undef EDGE
 1116|  66.9k|    return IGRAPH_SUCCESS;
 1117|  66.9k|}

igraph_qsort:
  264|  1.12M|{
  265|       |	local_qsort(a, n, es, cmp, NULL);
  266|  1.12M|}
qsort.c:local_qsort:
  121|  1.41M|{
  122|  1.41M|	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
  123|  1.41M|	size_t d1, d2;
  124|  1.41M|	int cmp_result;
  125|  1.41M|	int swap_cnt;
  126|       |
  127|       |    /* if there are less than 2 elements, then sorting is not needed */
  128|  1.41M|    if (IGRAPH_UNLIKELY(n < 2))
  ------------------
  |  |  612|  1.41M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  ------------------
  |  |  |  Branch (612:32): [True: 943k, False: 474k]
  |  |  ------------------
  ------------------
  129|   943k|        return;
  130|   823k|loop:
  131|   823k|	swap_cnt = 0;
  132|   823k|	if (n < 7) {
  ------------------
  |  Branch (132:6): [True: 431k, False: 391k]
  ------------------
  133|  1.52M|		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
  ------------------
  |  Branch (133:29): [True: 1.09M, False: 431k]
  ------------------
  134|  1.09M|			for (pl = pm;
  135|  2.03M|			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
  ------------------
  |  |   95|  1.73M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (135:9): [True: 1.73M, False: 302k]
  |  Branch (135:27): [True: 940k, False: 792k]
  ------------------
  136|  1.09M|			     pl -= es)
  137|   940k|				swapfunc(pl, pl - es, es);
  138|   431k|		return;
  139|   431k|	}
  140|   391k|	pm = (char *)a + (n / 2) * es;
  141|   391k|	if (n > 7) {
  ------------------
  |  Branch (141:6): [True: 350k, False: 41.3k]
  ------------------
  142|   350k|		pl = a;
  143|   350k|		pn = (char *)a + (n - 1) * es;
  144|   350k|		if (n > 40) {
  ------------------
  |  Branch (144:7): [True: 46.8k, False: 303k]
  ------------------
  145|  46.8k|			size_t d = (n / 8) * es;
  146|       |
  147|  46.8k|			pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);
  148|  46.8k|			pm = med3(pm - d, pm, pm + d, cmp, thunk);
  149|  46.8k|			pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);
  150|  46.8k|		}
  151|   350k|		pm = med3(pl, pm, pn, cmp, thunk);
  152|   350k|	}
  153|   391k|	swapfunc(a, pm, es);
  154|   391k|	pa = pb = (char *)a + es;
  155|       |
  156|   391k|	pc = pd = (char *)a + (n - 1) * es;
  157|  1.39M|	for (;;) {
  158|  5.54M|		while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) {
  ------------------
  |  |   95|  5.29M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (158:10): [True: 5.29M, False: 254k]
  |  Branch (158:22): [True: 4.14M, False: 1.14M]
  ------------------
  159|  4.14M|			if (cmp_result == 0) {
  ------------------
  |  Branch (159:8): [True: 585k, False: 3.56M]
  ------------------
  160|   585k|				swap_cnt = 1;
  161|   585k|				swapfunc(pa, pb, es);
  162|   585k|				pa += es;
  163|   585k|			}
  164|  4.14M|			pb += es;
  165|  4.14M|		}
  166|  3.16M|		while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) {
  ------------------
  |  |   95|  2.77M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (166:10): [True: 2.77M, False: 391k]
  |  Branch (166:22): [True: 1.76M, False: 1.00M]
  ------------------
  167|  1.76M|			if (cmp_result == 0) {
  ------------------
  |  Branch (167:8): [True: 82.8k, False: 1.68M]
  ------------------
  168|  82.8k|				swap_cnt = 1;
  169|  82.8k|				swapfunc(pc, pd, es);
  170|  82.8k|				pd -= es;
  171|  82.8k|			}
  172|  1.76M|			pc -= es;
  173|  1.76M|		}
  174|  1.39M|		if (pb > pc)
  ------------------
  |  Branch (174:7): [True: 391k, False: 1.00M]
  ------------------
  175|   391k|			break;
  176|  1.00M|		swapfunc(pb, pc, es);
  177|  1.00M|		swap_cnt = 1;
  178|  1.00M|		pb += es;
  179|  1.00M|		pc -= es;
  180|  1.00M|	}
  181|   391k|	if (swap_cnt == 0) {  /* Switch to insertion sort */
  ------------------
  |  Branch (181:6): [True: 31.4k, False: 360k]
  ------------------
  182|   479k|		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
  ------------------
  |  Branch (182:29): [True: 448k, False: 31.4k]
  ------------------
  183|   448k|			for (pl = pm;
  184|  1.04M|			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
  ------------------
  |  |   95|   992k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (184:9): [True: 992k, False: 54.5k]
  |  Branch (184:27): [True: 598k, False: 393k]
  ------------------
  185|   598k|			     pl -= es)
  186|   598k|				swapfunc(pl, pl - es, es);
  187|  31.4k|		return;
  188|  31.4k|	}
  189|       |
  190|   360k|	pn = (char *)a + n * es;
  191|   360k|	d1 = MIN(pa - (char *)a, pb - pa);
  ------------------
  |  |   69|   360k|#define	MIN(a, b)	((a) < (b) ? a : b)
  |  |  ------------------
  |  |  |  Branch (69:20): [True: 308k, False: 51.2k]
  |  |  ------------------
  ------------------
  192|   360k|	vecswap(a, pb - d1, d1);
  ------------------
  |  |   88|   360k|	if ((n) > 0) swapfunc(a, b, n)
  |  |  ------------------
  |  |  |  Branch (88:6): [True: 341k, False: 18.3k]
  |  |  ------------------
  ------------------
  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|   360k|	d1 = MIN(pd - pc, pn - pd - (ptrdiff_t)es);
  ------------------
  |  |   69|   360k|#define	MIN(a, b)	((a) < (b) ? a : b)
  |  |  ------------------
  |  |  |  Branch (69:20): [True: 6.00k, False: 354k]
  |  |  ------------------
  ------------------
  199|   360k|	vecswap(pb, pn - d1, d1);
  ------------------
  |  |   88|   360k|	if ((n) > 0) swapfunc(a, b, n)
  |  |  ------------------
  |  |  |  Branch (88:6): [True: 35.1k, False: 324k]
  |  |  ------------------
  ------------------
  200|       |
  201|   360k|	d1 = pb - pa;
  202|   360k|	d2 = pd - pc;
  203|   360k|	if (d1 <= d2) {
  ------------------
  |  Branch (203:6): [True: 130k, False: 230k]
  ------------------
  204|       |		/* Recurse on left partition, then iterate on right partition */
  205|   130k|		if (d1 > es) {
  ------------------
  |  Branch (205:7): [True: 99.1k, False: 30.8k]
  ------------------
  206|  99.1k|			local_qsort(a, d1 / es, es, cmp, thunk);
  207|  99.1k|		}
  208|   130k|		if (d2 > es) {
  ------------------
  |  Branch (208:7): [True: 120k, False: 9.99k]
  ------------------
  209|       |			/* Iterate rather than recurse to save stack space */
  210|       |			/* qsort(pn - d2, d2 / es, es, cmp); */
  211|   120k|			a = pn - d2;
  212|   120k|			n = d2 / es;
  213|   120k|			goto loop;
  214|   120k|		}
  215|   230k|	} else {
  216|       |		/* Recurse on right partition, then iterate on left partition */
  217|   230k|		if (d2 > es) {
  ------------------
  |  Branch (217:7): [True: 195k, False: 34.7k]
  ------------------
  218|   195k|			local_qsort(pn - d2, d2 / es, es, cmp, thunk);
  219|   195k|		}
  220|   230k|		if (d1 > es) {
  ------------------
  |  Branch (220:7): [True: 228k, False: 1.25k]
  ------------------
  221|       |			/* Iterate rather than recurse to save stack space */
  222|       |			/* qsort(a, d1 / es, es, cmp); */
  223|   228k|			n = d1 / es;
  224|   228k|			goto loop;
  225|   228k|		}
  226|   230k|	}
  227|   360k|}
qsort.c:swapfunc:
   77|  3.98M|{
   78|  3.98M|	char t;
   79|       |
   80|  37.8M|	do {
   81|  37.8M|		t = *a;
   82|  37.8M|		*a++ = *b;
   83|  37.8M|		*b++ = t;
   84|  37.8M|	} while (--es > 0);
  ------------------
  |  Branch (84:11): [True: 33.8M, False: 3.98M]
  ------------------
   85|  3.98M|}
qsort.c:med3:
  104|   490k|{
  105|   490k|	return CMP(thunk, a, b) < 0 ?
  ------------------
  |  |   95|   490k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (105:9): [True: 192k, False: 297k]
  ------------------
  106|   192k|	       (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
  ------------------
  |  |   95|   192k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
              	       (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
  ------------------
  |  |   95|  93.2k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (106:10): [True: 99.3k, False: 93.2k]
  |  Branch (106:38): [True: 41.8k, False: 51.3k]
  ------------------
  107|   490k|	      :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
  ------------------
  |  |   95|   297k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
              	      :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
  ------------------
  |  |   95|   260k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (107:10): [True: 37.5k, False: 260k]
  |  Branch (107:38): [True: 40.9k, False: 219k]
  ------------------
  108|   490k|}

igraph_cmp_epsilon:
   97|   262k|int igraph_cmp_epsilon(double a, double b, double eps) {
   98|   262k|    double diff;
   99|   262k|    double abs_diff;
  100|   262k|    double sum;
  101|       |
  102|   262k|    if (a == b) {
  ------------------
  |  Branch (102:9): [True: 68.9k, False: 193k]
  ------------------
  103|       |        /* shortcut, handles infinities */
  104|  68.9k|        return 0;
  105|  68.9k|    }
  106|       |
  107|   193k|    diff = a - b;
  108|   193k|    abs_diff = fabs(diff);
  109|   193k|    sum = fabs(a) + fabs(b);
  110|       |
  111|   193k|    if (a == 0 || b == 0 || sum < DBL_MIN) {
  ------------------
  |  Branch (111:9): [True: 142k, False: 50.9k]
  |  Branch (111:19): [True: 18.5k, False: 32.4k]
  |  Branch (111:29): [True: 0, False: 32.4k]
  ------------------
  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|   160k|        return abs_diff < (eps * DBL_MIN) ? 0 : (diff < 0 ? -1 : 1);
  ------------------
  |  Branch (115:16): [True: 0, False: 160k]
  |  Branch (115:50): [True: 142k, False: 18.5k]
  ------------------
  116|   160k|    } else if (!isfinite(sum)) {
  ------------------
  |  Branch (116:16): [True: 14.2k, False: 18.2k]
  ------------------
  117|       |        /* addition overflow, so presumably |a| and |b| are both large; use a
  118|       |         * different formulation */
  119|  14.2k|        return (abs_diff < (eps * fabs(a) + eps * fabs(b))) ? 0 : (diff < 0 ? -1 : 1);
  ------------------
  |  Branch (119:16): [True: 0, False: 14.2k]
  |  Branch (119:68): [True: 14.2k, False: 0]
  ------------------
  120|  18.2k|    } else {
  121|  18.2k|        return (abs_diff / sum < eps) ? 0 : (diff < 0 ? -1 : 1);
  ------------------
  |  Branch (121:16): [True: 70, False: 18.1k]
  |  Branch (121:46): [True: 8.85k, False: 9.31k]
  ------------------
  122|  18.2k|    }
  123|   193k|}

igraph_get_edgelist:
  327|  7.53k|igraph_error_t igraph_get_edgelist(const igraph_t *graph, igraph_vector_int_t *res, igraph_bool_t bycol) {
  328|  7.53k|    return igraph_edges(graph, igraph_ess_all(IGRAPH_EDGEORDER_ID), res, bycol);
  329|  7.53k|}
igraph_to_undirected:
  498|  3.40k|                         const igraph_attribute_combination_t *edge_comb) {
  499|       |
  500|  3.40k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  501|  3.40k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  502|  3.40k|    igraph_vector_int_t edges;
  503|  3.40k|    igraph_t newgraph;
  504|  3.40k|    igraph_bool_t attr = edge_comb && igraph_has_attribute_table();
  ------------------
  |  Branch (504:26): [True: 3.40k, False: 0]
  |  Branch (504:39): [True: 3.40k, False: 0]
  ------------------
  505|       |
  506|  3.40k|    if (mode != IGRAPH_TO_UNDIRECTED_EACH &&
  ------------------
  |  Branch (506:9): [True: 3.40k, False: 0]
  ------------------
  507|  3.40k|        mode != IGRAPH_TO_UNDIRECTED_COLLAPSE &&
  ------------------
  |  Branch (507:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (512:9): [True: 0, False: 3.40k]
  ------------------
  513|      0|        return IGRAPH_SUCCESS;
  514|      0|    }
  515|       |
  516|  3.40k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  517|       |
  518|  3.40k|    if (mode == IGRAPH_TO_UNDIRECTED_EACH) {
  ------------------
  |  Branch (518:9): [True: 0, False: 3.40k]
  ------------------
  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.40k|    } else if (mode == IGRAPH_TO_UNDIRECTED_COLLAPSE) {
  ------------------
  |  Branch (549:16): [True: 3.40k, False: 0]
  ------------------
  550|  3.40k|        igraph_vector_int_t inadj, outadj;
  551|  3.40k|        igraph_vector_int_t mergeinto;
  552|  3.40k|        igraph_int_t actedge = 0;
  553|       |
  554|  3.40k|        if (attr) {
  ------------------
  |  Branch (554:13): [True: 3.40k, False: 0]
  ------------------
  555|  3.40k|            IGRAPH_VECTOR_INT_INIT_FINALLY(&mergeinto, no_of_edges);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  556|  3.40k|        }
  557|       |
  558|  3.40k|        IGRAPH_CHECK(igraph_vector_int_reserve(&edges, no_of_edges * 2));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  559|  3.40k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&inadj, 0);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  560|  3.40k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&outadj, 0);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  561|       |
  562|   155k|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (562:34): [True: 152k, False: 3.40k]
  ------------------
  563|   152k|            igraph_int_t n_out, n_in;
  564|   152k|            igraph_int_t p1 = -1, p2 = -1;
  565|   152k|            igraph_int_t e1 = 0, e2 = 0, n1 = 0, n2 = 0, last;
  566|   152k|            IGRAPH_CHECK(igraph_incident(graph, &outadj, i, IGRAPH_OUT, IGRAPH_LOOPS));
  ------------------
  |  |  656|   152k|    do { \
  |  |  657|   152k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   152k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   152k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
  567|   152k|            IGRAPH_CHECK(igraph_incident(graph, &inadj, i, IGRAPH_IN, IGRAPH_LOOPS));
  ------------------
  |  |  656|   152k|    do { \
  |  |  657|   152k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   152k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   152k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 152k]
  |  |  ------------------
  ------------------
  568|   152k|            n_out = igraph_vector_int_size(&outadj);
  569|   152k|            n_in = igraph_vector_int_size(&inadj);
  570|       |
  571|   152k|#define STEPOUT() if ( (++p1) < n_out) {    \
  572|   152k|        e1 = VECTOR(outadj)[p1]; \
  573|   152k|        n1 = IGRAPH_TO(graph, e1);      \
  574|   152k|    }
  575|   152k|#define STEPIN()  if ( (++p2) < n_in) {         \
  576|   152k|        e2 = VECTOR(inadj )[p2]; \
  577|   152k|        n2 = IGRAPH_FROM(graph, e2);        \
  578|   152k|    }
  579|   152k|#define ADD_NEW_EDGE() { \
  580|   152k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  581|   152k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  582|   152k|}
  583|   152k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  584|   152k|    if (attr) { \
  585|   152k|        VECTOR(mergeinto)[which] = actedge; \
  586|   152k|    } \
  587|   152k|}
  588|       |
  589|   152k|            STEPOUT();
  ------------------
  |  |  571|   152k|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (571:24): [True: 30.8k, False: 121k]
  |  |  ------------------
  |  |  572|  30.8k|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|  30.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  573|  30.8k|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|  30.8k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  30.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  574|  30.8k|    }
  ------------------
  590|   152k|            STEPIN();
  ------------------
  |  |  575|   152k|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (575:24): [True: 30.9k, False: 121k]
  |  |  ------------------
  |  |  576|  30.9k|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|  30.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  577|  30.9k|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|  30.9k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  30.9k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  578|  30.9k|    }
  ------------------
  591|       |
  592|   166k|            while (p1 < n_out && n1 <= i && p2 < n_in && n2 <= i) {
  ------------------
  |  Branch (592:20): [True: 42.9k, False: 123k]
  |  Branch (592:34): [True: 31.2k, False: 11.6k]
  |  Branch (592:45): [True: 17.8k, False: 13.3k]
  |  Branch (592:58): [True: 14.5k, False: 3.34k]
  ------------------
  593|  14.5k|                last = (n1 <= n2) ? n1 : n2;
  ------------------
  |  Branch (593:24): [True: 7.77k, False: 6.77k]
  ------------------
  594|  14.5k|                ADD_NEW_EDGE();
  ------------------
  |  |  579|  14.5k|#define ADD_NEW_EDGE() { \
  |  |  580|  14.5k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  |  |  ------------------
  |  |  |  |  656|  14.5k|    do { \
  |  |  |  |  657|  14.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.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|  14.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  581|  14.5k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  |  |  ------------------
  |  |  |  |  656|  14.5k|    do { \
  |  |  |  |  657|  14.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  14.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  14.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.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|  14.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 14.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  582|  14.5k|}
  ------------------
  595|  22.3k|                while (p1 < n_out && last == n1) {
  ------------------
  |  Branch (595:24): [True: 19.8k, False: 2.52k]
  |  Branch (595:38): [True: 7.77k, False: 12.0k]
  ------------------
  596|  7.77k|                    MERGE_INTO_CURRENT_EDGE(e1);
  ------------------
  |  |  583|  7.77k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  7.77k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 7.77k, False: 0]
  |  |  ------------------
  |  |  585|  7.77k|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|  7.77k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|  7.77k|    } \
  |  |  587|  7.77k|}
  ------------------
  597|  7.77k|                    STEPOUT();
  ------------------
  |  |  571|  7.77k|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (571:24): [True: 5.25k, False: 2.52k]
  |  |  ------------------
  |  |  572|  5.25k|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|  5.25k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  573|  5.25k|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|  5.25k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  5.25k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  574|  5.25k|    }
  ------------------
  598|  7.77k|                }
  599|  22.7k|                while (p2 < n_in && last == n2) {
  ------------------
  |  Branch (599:24): [True: 20.1k, False: 2.60k]
  |  Branch (599:37): [True: 8.23k, False: 11.9k]
  ------------------
  600|  8.23k|                    MERGE_INTO_CURRENT_EDGE(e2);
  ------------------
  |  |  583|  8.23k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  8.23k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 8.23k, False: 0]
  |  |  ------------------
  |  |  585|  8.23k|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|  8.23k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|  8.23k|    } \
  |  |  587|  8.23k|}
  ------------------
  601|  8.23k|                    STEPIN();
  ------------------
  |  |  575|  8.23k|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (575:24): [True: 5.62k, False: 2.60k]
  |  |  ------------------
  |  |  576|  5.62k|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|  5.62k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  577|  5.62k|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|  5.62k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  5.62k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  578|  5.62k|    }
  ------------------
  602|  8.23k|                }
  603|  14.5k|                actedge++;
  604|  14.5k|            }
  605|       |
  606|   172k|            while (p1 < n_out && n1 <= i) {
  ------------------
  |  Branch (606:20): [True: 34.6k, False: 137k]
  |  Branch (606:34): [True: 19.8k, False: 14.7k]
  ------------------
  607|  19.8k|                last = n1;
  608|  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|}
  ------------------
  609|  39.6k|                while (p1 < n_out && last == n1) {
  ------------------
  |  Branch (609:24): [True: 26.1k, False: 13.5k]
  |  Branch (609:38): [True: 19.8k, False: 6.27k]
  ------------------
  610|  19.8k|                    MERGE_INTO_CURRENT_EDGE(e1);
  ------------------
  |  |  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|}
  ------------------
  611|  19.8k|                    STEPOUT();
  ------------------
  |  |  571|  19.8k|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (571:24): [True: 6.27k, False: 13.5k]
  |  |  ------------------
  |  |  572|  6.27k|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|  6.27k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  573|  6.27k|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|  6.27k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.27k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  574|  6.27k|    }
  ------------------
  612|  19.8k|                }
  613|  19.8k|                actedge++;
  614|  19.8k|            }
  615|       |
  616|   171k|            while (p2 < n_in && n2 <= i) {
  ------------------
  |  Branch (616:20): [True: 34.3k, False: 137k]
  |  Branch (616:33): [True: 19.4k, False: 14.9k]
  ------------------
  617|  19.4k|                last = n2;
  618|  19.4k|                ADD_NEW_EDGE();
  ------------------
  |  |  579|  19.4k|#define ADD_NEW_EDGE() { \
  |  |  580|  19.4k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  |  |  ------------------
  |  |  |  |  656|  19.4k|    do { \
  |  |  |  |  657|  19.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  19.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  19.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 19.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|  19.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 19.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  581|  19.4k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  |  |  ------------------
  |  |  |  |  656|  19.4k|    do { \
  |  |  |  |  657|  19.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  19.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  19.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 19.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|  19.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 19.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  582|  19.4k|}
  ------------------
  619|  38.8k|                while (p2 < n_in && last == n2) {
  ------------------
  |  Branch (619:24): [True: 25.4k, False: 13.3k]
  |  Branch (619:37): [True: 19.4k, False: 6.05k]
  ------------------
  620|  19.4k|                    MERGE_INTO_CURRENT_EDGE(e2);
  ------------------
  |  |  583|  19.4k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  19.4k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 19.4k, False: 0]
  |  |  ------------------
  |  |  585|  19.4k|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|  19.4k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|  19.4k|    } \
  |  |  587|  19.4k|}
  ------------------
  621|  19.4k|                    STEPIN();
  ------------------
  |  |  575|  19.4k|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (575:24): [True: 6.05k, False: 13.3k]
  |  |  ------------------
  |  |  576|  6.05k|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|  6.05k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  577|  6.05k|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|  6.05k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.05k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  578|  6.05k|    }
  ------------------
  622|  19.4k|                }
  623|  19.4k|                actedge++;
  624|  19.4k|            }
  625|   152k|        }
  626|       |
  627|  3.40k|#undef MERGE_INTO_CURRENT_EDGE
  628|  3.40k|#undef ADD_NEW_EDGE
  629|  3.40k|#undef STEPOUT
  630|  3.40k|#undef STEPIN
  631|       |
  632|  3.40k|        igraph_vector_int_destroy(&outadj);
  633|  3.40k|        igraph_vector_int_destroy(&inadj);
  634|  3.40k|        IGRAPH_FINALLY_CLEAN(2);
  635|       |
  636|  3.40k|        IGRAPH_CHECK(igraph_create(&newgraph, &edges,
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  637|  3.40k|                                   no_of_nodes,
  638|  3.40k|                                   IGRAPH_UNDIRECTED));
  639|  3.40k|        IGRAPH_FINALLY(igraph_destroy, &newgraph);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  640|  3.40k|        igraph_vector_int_destroy(&edges);
  641|  3.40k|        IGRAPH_CHECK(igraph_i_attribute_copy(&newgraph, graph, true, true, /* edges= */ false));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  642|       |
  643|  3.40k|        if (attr) {
  ------------------
  |  Branch (643:13): [True: 3.40k, False: 0]
  ------------------
  644|  3.40k|            igraph_fixed_vectorlist_t vl;
  645|  3.40k|            IGRAPH_CHECK(igraph_fixed_vectorlist_convert(&vl, &mergeinto, actedge));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  646|  3.40k|            IGRAPH_FINALLY(igraph_fixed_vectorlist_destroy, &vl);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  647|       |
  648|  3.40k|            IGRAPH_CHECK(igraph_i_attribute_combine_edges(graph, &newgraph, &vl.vecs, edge_comb));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  649|       |
  650|  3.40k|            igraph_fixed_vectorlist_destroy(&vl);
  651|  3.40k|            IGRAPH_FINALLY_CLEAN(1);
  652|  3.40k|        }
  653|       |
  654|  3.40k|        IGRAPH_FINALLY_CLEAN(2);
  655|  3.40k|        igraph_destroy(graph);
  656|  3.40k|        *graph = newgraph;
  657|       |
  658|  3.40k|        if (attr) {
  ------------------
  |  Branch (658:13): [True: 3.40k, False: 0]
  ------------------
  659|  3.40k|            igraph_vector_int_destroy(&mergeinto);
  660|  3.40k|            IGRAPH_FINALLY_CLEAN(1);
  661|  3.40k|        }
  662|  3.40k|    } 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.40k|    return IGRAPH_SUCCESS;
  752|  3.40k|}

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

igraph_simplify:
   56|  3.40k|                               const igraph_attribute_combination_t *edge_comb) {
   57|       |
   58|  3.40k|    igraph_vector_int_t edges;
   59|  3.40k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
   60|  3.40k|    igraph_int_t no_of_edges = igraph_ecount(graph);
   61|  3.40k|    igraph_int_t edge;
   62|  3.40k|    igraph_bool_t attr = edge_comb && igraph_has_attribute_table();
  ------------------
  |  Branch (62:26): [True: 3.40k, False: 0]
  |  Branch (62:39): [True: 3.40k, False: 0]
  ------------------
   63|  3.40k|    igraph_int_t from, to, pfrom = -1, pto = -2;
   64|  3.40k|    igraph_t res;
   65|  3.40k|    igraph_es_t es;
   66|  3.40k|    igraph_eit_t eit;
   67|  3.40k|    igraph_vector_int_t mergeinto;
   68|  3.40k|    igraph_int_t actedge;
   69|       |
   70|       |    /* if we already know there are no multi-edges, they don't need to be removed */
   71|  3.40k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI) &&
  ------------------
  |  Branch (71:9): [True: 0, False: 3.40k]
  ------------------
   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.40k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (77:9): [True: 0, False: 3.40k]
  ------------------
   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.40k|    if (!remove_multiple && !remove_loops)
  ------------------
  |  Branch (82:9): [True: 0, False: 3.40k]
  |  Branch (82:29): [True: 0, False: 0]
  ------------------
   83|       |        /* nothing to do */
   84|      0|    {
   85|      0|        return IGRAPH_SUCCESS;
   86|      0|    }
   87|       |
   88|  3.40k|    if (!remove_multiple) {
  ------------------
  |  Branch (88:9): [True: 0, False: 3.40k]
  ------------------
   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.40k|    if (attr) {
  ------------------
  |  Branch (125:9): [True: 3.40k, False: 0]
  ------------------
  126|  3.40k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&mergeinto, no_of_edges);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  127|  3.40k|    }
  128|  3.40k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  3.40k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.40k|    do { \
  |  |  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.40k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.40k|    do { \
  |  |  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.40k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  129|  3.40k|    IGRAPH_CHECK(igraph_vector_int_reserve(&edges, no_of_edges * 2));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  130|       |
  131|  3.40k|    IGRAPH_CHECK(igraph_es_all(&es, IGRAPH_EDGEORDER_FROM));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  132|  3.40k|    IGRAPH_FINALLY(igraph_es_destroy, &es);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  133|  3.40k|    IGRAPH_CHECK(igraph_eit_create(graph, es, &eit));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  134|  3.40k|    IGRAPH_FINALLY(igraph_eit_destroy, &eit);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  135|       |
  136|  95.0k|    for (actedge = -1; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  371|  95.0k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                  for (actedge = -1; !IGRAPH_EIT_END(eit); IGRAPH_EIT_NEXT(eit)) {
  ------------------
  |  |  359|  91.6k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (136:24): [True: 91.6k, False: 3.40k]
  ------------------
  137|  91.6k|        edge = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|  91.6k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 0, False: 91.6k]
  |  |  ------------------
  |  |  406|  91.6k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  138|  91.6k|        from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|  91.6k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  139|  91.6k|        to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  91.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  140|       |
  141|  91.6k|        if (remove_loops && from == to) {
  ------------------
  |  Branch (141:13): [True: 91.6k, False: 0]
  |  Branch (141:29): [True: 23.7k, False: 67.9k]
  ------------------
  142|       |            /* Loop edge to be removed */
  143|  23.7k|            if (attr) {
  ------------------
  |  Branch (143:17): [True: 23.7k, False: 0]
  ------------------
  144|  23.7k|                VECTOR(mergeinto)[edge] = -1;
  ------------------
  |  |   60|  23.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  145|  23.7k|            }
  146|  67.9k|        } else if (remove_multiple && from == pfrom && to == pto) {
  ------------------
  |  Branch (146:20): [True: 67.9k, False: 0]
  |  Branch (146:39): [True: 37.6k, False: 30.3k]
  |  Branch (146:56): [True: 12.6k, False: 24.9k]
  ------------------
  147|       |            /* Multiple edge to be contracted */
  148|  12.6k|            if (attr) {
  ------------------
  |  Branch (148:17): [True: 12.6k, False: 0]
  ------------------
  149|  12.6k|                VECTOR(mergeinto)[edge] = actedge;
  ------------------
  |  |   60|  12.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  150|  12.6k|            }
  151|  55.2k|        } else {
  152|       |            /* Edge to be kept */
  153|  55.2k|            igraph_vector_int_push_back(&edges, from);  /* reserved */
  154|  55.2k|            igraph_vector_int_push_back(&edges, to);  /* reserved */
  155|  55.2k|            if (attr) {
  ------------------
  |  Branch (155:17): [True: 55.2k, False: 0]
  ------------------
  156|  55.2k|                actedge++;
  157|  55.2k|                VECTOR(mergeinto)[edge] = actedge;
  ------------------
  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  158|  55.2k|            }
  159|  55.2k|        }
  160|  91.6k|        pfrom = from; pto = to;
  161|  91.6k|    }
  162|       |
  163|  3.40k|    igraph_eit_destroy(&eit);
  164|  3.40k|    igraph_es_destroy(&es);
  165|  3.40k|    IGRAPH_FINALLY_CLEAN(2);
  166|       |
  167|  3.40k|    IGRAPH_CHECK(igraph_create(&res, &edges, no_of_nodes, igraph_is_directed(graph)));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  168|       |
  169|  3.40k|    igraph_vector_int_destroy(&edges);
  170|  3.40k|    IGRAPH_FINALLY_CLEAN(1);
  171|       |
  172|  3.40k|    IGRAPH_FINALLY(igraph_destroy, &res);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  173|       |
  174|  3.40k|    IGRAPH_CHECK(igraph_i_attribute_copy(&res, graph, true, true, /* edges= */ false));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  175|       |
  176|  3.40k|    if (attr) {
  ------------------
  |  Branch (176:9): [True: 3.40k, False: 0]
  ------------------
  177|  3.40k|        igraph_fixed_vectorlist_t vl;
  178|  3.40k|        IGRAPH_CHECK(igraph_fixed_vectorlist_convert(&vl, &mergeinto, actedge + 1));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  179|  3.40k|        IGRAPH_FINALLY(igraph_fixed_vectorlist_destroy, &vl);
  ------------------
  |  |  603|  3.40k|    do { \
  |  |  604|  3.40k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.40k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.40k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.40k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.40k]
  |  |  ------------------
  |  |  608|  3.40k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  180|       |
  181|  3.40k|        IGRAPH_CHECK(igraph_i_attribute_combine_edges(graph, &res, &vl.vecs, edge_comb));
  ------------------
  |  |  656|  3.40k|    do { \
  |  |  657|  3.40k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.40k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.40k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.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|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  182|       |
  183|  3.40k|        igraph_fixed_vectorlist_destroy(&vl);
  184|  3.40k|        igraph_vector_int_destroy(&mergeinto);
  185|  3.40k|        IGRAPH_FINALLY_CLEAN(2);
  186|  3.40k|    }
  187|       |
  188|  3.40k|    IGRAPH_FINALLY_CLEAN(1);
  189|  3.40k|    igraph_destroy(graph);
  190|  3.40k|    *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.40k|    if (remove_loops) {
  ------------------
  |  Branch (195:9): [True: 3.40k, False: 0]
  ------------------
  196|       |        /* Loop edges were removed so we know for sure that there aren't any
  197|       |         * loop edges now */
  198|  3.40k|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_LOOP, false);
  199|  3.40k|    }
  200|       |
  201|  3.40k|    if (remove_multiple) {
  ------------------
  |  Branch (201:9): [True: 3.40k, False: 0]
  ------------------
  202|       |        /* Multi-edges were removed so we know for sure that there aren't any
  203|       |         * multi-edges now */
  204|  3.40k|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, false);
  205|  3.40k|    }
  206|       |
  207|  3.40k|    return IGRAPH_SUCCESS;
  208|  3.40k|}

igraph_voronoi:
  366|  3.30k|        igraph_voronoi_tiebreaker_t tiebreaker) {
  367|       |
  368|  3.30k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  369|  3.30k|    igraph_vector_int_t *pmembership;
  370|  3.30k|    igraph_vector_int_t imembership;
  371|  3.30k|    igraph_vector_t *pdistances;
  372|  3.30k|    igraph_vector_t idistances;
  373|       |
  374|  3.30k|    if (! igraph_is_directed(graph)) {
  ------------------
  |  Branch (374:9): [True: 0, False: 3.30k]
  ------------------
  375|      0|        mode = IGRAPH_ALL;
  376|      0|    }
  377|       |
  378|  3.30k|    if (tiebreaker != IGRAPH_VORONOI_FIRST &&
  ------------------
  |  Branch (378:9): [True: 3.30k, False: 0]
  ------------------
  379|  3.30k|        tiebreaker != IGRAPH_VORONOI_LAST &&
  ------------------
  |  Branch (379:9): [True: 3.30k, False: 0]
  ------------------
  380|  3.30k|        tiebreaker != IGRAPH_VORONOI_RANDOM) {
  ------------------
  |  Branch (380:9): [True: 0, False: 3.30k]
  ------------------
  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.30k|    if (! igraph_vector_int_isininterval(generators, 0, igraph_vcount(graph)-1)) {
  ------------------
  |  Branch (384:9): [True: 0, False: 3.30k]
  ------------------
  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.30k|    if (membership) {
  ------------------
  |  Branch (388:9): [True: 3.30k, False: 0]
  ------------------
  389|  3.30k|        pmembership = membership;
  390|  3.30k|    } 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.30k|    if (distances) {
  ------------------
  |  Branch (395:9): [True: 0, False: 3.30k]
  ------------------
  396|      0|        pdistances = distances;
  397|  3.30k|    } else {
  398|  3.30k|        IGRAPH_VECTOR_INIT_FINALLY(&idistances, no_of_nodes);
  ------------------
  |  |  104|  3.30k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.30k|    do { \
  |  |  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.30k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.30k|    do { \
  |  |  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  399|  3.30k|        pdistances = &idistances;
  400|  3.30k|    }
  401|       |
  402|  3.30k|    if (weights) {
  ------------------
  |  Branch (402:9): [True: 3.30k, False: 0]
  ------------------
  403|  3.30k|        IGRAPH_CHECK(igraph_i_voronoi_dijkstra(graph, pmembership, pdistances, generators, weights, mode, tiebreaker));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  404|  3.30k|    } 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.30k|    if (! distances) {
  ------------------
  |  Branch (408:9): [True: 3.30k, False: 0]
  ------------------
  409|  3.30k|        igraph_vector_destroy(&idistances);
  410|  3.30k|        IGRAPH_FINALLY_CLEAN(1);
  411|  3.30k|    }
  412|       |
  413|  3.30k|    if (! membership) {
  ------------------
  |  Branch (413:9): [True: 0, False: 3.30k]
  ------------------
  414|      0|        igraph_vector_int_destroy(&imembership);
  415|      0|        IGRAPH_FINALLY_CLEAN(1);
  416|      0|    }
  417|       |
  418|  3.30k|    return IGRAPH_SUCCESS;
  419|  3.30k|}
voronoi.c:igraph_i_voronoi_dijkstra:
  165|  3.30k|        igraph_voronoi_tiebreaker_t tiebreaker) {
  166|       |
  167|  3.30k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  168|  3.30k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  169|  3.30k|    igraph_int_t no_of_generators = igraph_vector_int_size(generators);
  170|  3.30k|    igraph_inclist_t il;
  171|  3.30k|    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.30k|    igraph_vector_int_t tie_count;
  176|       |
  177|  3.30k|    if (igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (177:9): [True: 0, False: 3.30k]
  ------------------
  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.30k|    if (no_of_edges > 0) {
  ------------------
  |  Branch (183:9): [True: 3.30k, False: 0]
  ------------------
  184|  3.30k|        igraph_real_t min = igraph_vector_min(weights);
  185|  3.30k|        if (min < 0) {
  ------------------
  |  Branch (185:13): [True: 0, False: 3.30k]
  ------------------
  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.30k|        } else if (isnan(min)) {
  ------------------
  |  Branch (187:20): [True: 0, False: 3.30k]
  ------------------
  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.30k|    }
  191|       |
  192|  3.30k|    IGRAPH_CHECK(igraph_inclist_init(graph, &il, mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  193|  3.30k|    IGRAPH_FINALLY(igraph_inclist_destroy, &il);
  ------------------
  |  |  603|  3.30k|    do { \
  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  ------------------
  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  194|       |
  195|  3.30k|    IGRAPH_CHECK(igraph_2wheap_init(&q, no_of_nodes));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  196|  3.30k|    IGRAPH_FINALLY(igraph_2wheap_destroy, &q);
  ------------------
  |  |  603|  3.30k|    do { \
  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  ------------------
  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  197|       |
  198|  3.30k|    if (tiebreaker == IGRAPH_VORONOI_RANDOM) {
  ------------------
  |  Branch (198:9): [True: 3.30k, False: 0]
  ------------------
  199|  3.30k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&tie_count, no_of_nodes);
  ------------------
  |  |  119|  3.30k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.30k|    do { \
  |  |  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.30k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.30k|    do { \
  |  |  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  200|  3.30k|    }
  201|       |
  202|  3.30k|    IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  203|  3.30k|    igraph_vector_int_fill(membership, -1);
  204|       |
  205|  3.30k|    IGRAPH_CHECK(igraph_vector_resize(mindist, no_of_nodes));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  206|  3.30k|    igraph_vector_fill(mindist, IGRAPH_INFINITY);
  ------------------
  |  |  137|  3.30k|#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|   133k|    for (igraph_int_t i=0; i < no_of_generators; i++) {
  ------------------
  |  Branch (214:28): [True: 129k, False: 3.30k]
  ------------------
  215|   129k|        igraph_int_t g = VECTOR(*generators)[i];
  ------------------
  |  |   60|   129k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  216|       |
  217|       |        /* Weighted shortest path implementation using Dijkstra's algorithm */
  218|       |
  219|   129k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|   129k|    do { \
  |  |   47|   129k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 129k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|   129k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 129k]
  |  |  ------------------
  ------------------
  220|       |
  221|   129k|        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|   129k|        IGRAPH_CHECK(igraph_2wheap_push_with_index(&q, g, -0.0));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  227|       |
  228|   391k|        while (!igraph_2wheap_empty(&q)) {
  ------------------
  |  Branch (228:16): [True: 262k, False: 129k]
  ------------------
  229|   262k|            igraph_int_t vid = igraph_2wheap_max_index(&q);
  230|   262k|            igraph_real_t dist = -igraph_2wheap_deactivate_max(&q);
  231|       |
  232|   262k|            igraph_real_t md = VECTOR(*mindist)[vid];
  ------------------
  |  |   60|   262k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  233|       |
  234|   262k|            int cmp_result = igraph_cmp_epsilon(dist, md, IGRAPH_SHORTEST_PATH_EPSILON);
  ------------------
  |  |   35|   262k|#define IGRAPH_SHORTEST_PATH_EPSILON 1e-10
  ------------------
  235|   262k|            if (cmp_result > 0) { /* dist > md */
  ------------------
  |  Branch (235:17): [True: 27.8k, False: 234k]
  ------------------
  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|  27.8k|                continue;
  242|   234k|            } else if (cmp_result < 0) { /* dist < md */
  ------------------
  |  Branch (242:24): [True: 165k, False: 68.9k]
  ------------------
  243|       |                /* This vertex is closest to the current generator so far.
  244|       |                 * Assign it to the current partition. */
  245|   165k|                VECTOR(*mindist)[vid] = dist;
  ------------------
  |  |   60|   165k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  246|   165k|                VECTOR(*membership)[vid] = i;
  ------------------
  |  |   60|   165k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  247|   165k|                if (tiebreaker == IGRAPH_VORONOI_RANDOM) {
  ------------------
  |  Branch (247:21): [True: 165k, False: 0]
  ------------------
  248|   165k|                    VECTOR(tie_count)[vid] = 1;
  ------------------
  |  |   60|   165k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  249|   165k|                }
  250|   165k|            } else { /* md == dist, we have a tie */
  251|  68.9k|                switch (tiebreaker) {
  ------------------
  |  Branch (251:25): [True: 68.9k, False: 0]
  ------------------
  252|      0|                case IGRAPH_VORONOI_FIRST:
  ------------------
  |  Branch (252:17): [True: 0, False: 68.9k]
  ------------------
  253|       |                    /* Never replace existing generator assignment. */
  254|      0|                    break;
  255|      0|                case IGRAPH_VORONOI_LAST:
  ------------------
  |  Branch (255:17): [True: 0, False: 68.9k]
  ------------------
  256|       |                    /* Always replace existing generator assignment. */
  257|      0|                    VECTOR(*membership)[vid] = i;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  258|      0|                    break;
  259|  68.9k|                case IGRAPH_VORONOI_RANDOM:
  ------------------
  |  Branch (259:17): [True: 68.9k, 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|  68.9k|                    VECTOR(tie_count)[vid]++;
  ------------------
  |  |   60|  68.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  264|  68.9k|                    if (RNG_UNIF01() < 1.0 / VECTOR(tie_count)[vid]) {
  ------------------
  |  |  155|  68.9k|#define RNG_UNIF01()     (igraph_rng_get_unif01(igraph_rng_default()))
  ------------------
                                  if (RNG_UNIF01() < 1.0 / VECTOR(tie_count)[vid]) {
  ------------------
  |  |   60|  68.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (264:25): [True: 16.9k, False: 52.0k]
  ------------------
  265|  16.9k|                        VECTOR(*membership)[vid] = i;
  ------------------
  |  |   60|  16.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  266|  16.9k|                    }
  267|  68.9k|                    break;
  268|  68.9k|                }
  269|  68.9k|            }
  270|       |
  271|   234k|            igraph_vector_int_t *inc_edges = igraph_inclist_get(&il, vid);
  ------------------
  |  |  102|   234k|#define igraph_inclist_get(il,no) (&(il)->incs[(igraph_int_t)(no)])
  ------------------
  272|   234k|            igraph_int_t inc_count = igraph_vector_int_size(inc_edges);
  273|   391k|            for (igraph_int_t j=0; j < inc_count; j++) {
  ------------------
  |  Branch (273:36): [True: 157k, False: 234k]
  ------------------
  274|   157k|                igraph_int_t edge = VECTOR(*inc_edges)[j];
  ------------------
  |  |   60|   157k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  275|   157k|                igraph_real_t weight = VECTOR(*weights)[edge];
  ------------------
  |  |   60|   157k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  276|       |
  277|       |                /* Optimization: do not follow infinite-weight edges. */
  278|   157k|                if (weight == IGRAPH_INFINITY) {
  ------------------
  |  |  137|   157k|#define IGRAPH_INFINITY ((double)INFINITY)
  ------------------
  |  Branch (278:21): [True: 0, False: 157k]
  ------------------
  279|      0|                    continue;
  280|      0|                }
  281|       |
  282|   157k|                igraph_int_t to = IGRAPH_OTHER(graph, edge, vid);
  ------------------
  |  |  146|   157k|    ((igraph_int_t)(IGRAPH_TO(graph,(eid))==(vid) ? IGRAPH_FROM((graph),(eid)) : IGRAPH_TO((graph),(eid))))
  |  |  ------------------
  |  |  |  |  128|   157k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   157k|#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|   157k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|   157k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 0, False: 157k]
  |  |  ------------------
  ------------------
  283|   157k|                igraph_real_t altdist = dist + weight;
  284|       |
  285|   157k|                if (! igraph_2wheap_has_elem(&q, to)) {
  ------------------
  |  Branch (285:21): [True: 132k, False: 25.1k]
  ------------------
  286|       |                    /* This is the first non-infinite distance */
  287|   132k|                    IGRAPH_CHECK(igraph_2wheap_push_with_index(&q, to, -altdist));
  ------------------
  |  |  656|   132k|    do { \
  |  |  657|   132k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   132k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   132k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 132k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   132k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 132k]
  |  |  ------------------
  ------------------
  288|   132k|                } else if (igraph_2wheap_has_active(&q, to)) {
  ------------------
  |  Branch (288:28): [True: 7.75k, False: 17.3k]
  ------------------
  289|  7.75k|                    igraph_real_t curdist = -igraph_2wheap_get(&q, to);
  290|  7.75k|                    if (altdist < curdist) {
  ------------------
  |  Branch (290:25): [True: 1.82k, False: 5.92k]
  ------------------
  291|       |                        /* This is a shorter path */
  292|  1.82k|                        igraph_2wheap_modify(&q, to, -altdist);
  293|  1.82k|                    }
  294|  7.75k|                }
  295|   157k|            }
  296|   234k|        } /* !igraph_2wheap_empty(&q) */
  297|   129k|    }
  298|       |
  299|  3.30k|    if (tiebreaker == IGRAPH_VORONOI_RANDOM) {
  ------------------
  |  Branch (299:9): [True: 3.30k, False: 0]
  ------------------
  300|  3.30k|        igraph_vector_int_destroy(&tie_count);
  301|  3.30k|        IGRAPH_FINALLY_CLEAN(1);
  302|  3.30k|    }
  303|       |
  304|  3.30k|    igraph_2wheap_destroy(&q);
  305|  3.30k|    igraph_inclist_destroy(&il);
  306|  3.30k|    IGRAPH_FINALLY_CLEAN(2);
  307|       |
  308|  3.30k|    return IGRAPH_SUCCESS;
  309|  3.30k|}

igraph_strength:
  619|  13.5k|) {
  620|       |
  621|  13.5k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  622|  13.5k|    igraph_vit_t vit;
  623|  13.5k|    igraph_int_t no_vids;
  624|  13.5k|    igraph_vector_int_t degrees;
  625|  13.5k|    igraph_vector_int_t neis;
  626|       |
  627|  13.5k|    if (! weights) {
  ------------------
  |  Branch (627:9): [True: 0, False: 13.5k]
  ------------------
  628|      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]
  |  |  ------------------
  ------------------
  629|      0|        IGRAPH_CHECK(igraph_vector_resize(res, 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]
  |  |  ------------------
  ------------------
  630|      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]
  |  |  ------------------
  ------------------
  631|      0|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (631:34): [True: 0, False: 0]
  ------------------
  632|      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)
  ------------------
  633|      0|        }
  634|      0|        igraph_vector_int_destroy(&degrees);
  635|      0|        IGRAPH_FINALLY_CLEAN(1);
  636|      0|        return IGRAPH_SUCCESS;
  637|      0|    }
  638|       |
  639|  13.5k|    if (igraph_vector_size(weights) != igraph_ecount(graph)) {
  ------------------
  |  Branch (639:9): [True: 0, False: 13.5k]
  ------------------
  640|      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]
  |  |  ------------------
  ------------------
  641|      0|    }
  642|       |
  643|  13.5k|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (643:9): [True: 6.70k, False: 6.80k]
  |  Branch (643:31): [True: 3.30k, False: 3.40k]
  |  Branch (643:52): [True: 0, False: 3.30k]
  ------------------
  644|      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]
  |  |  ------------------
  ------------------
  645|      0|    }
  646|       |
  647|  13.5k|    if (igraph_vs_is_all(&vids)) {
  ------------------
  |  Branch (647:9): [True: 13.5k, False: 0]
  ------------------
  648|  13.5k|        return strength_all(graph, res, mode, loops, weights);
  649|  13.5k|    }
  650|       |
  651|      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]
  |  |  ------------------
  ------------------
  652|      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]
  |  |  ------------------
  ------------------
  653|      0|    no_vids = IGRAPH_VIT_SIZE(vit);
  ------------------
  |  |  190|      0|#define IGRAPH_VIT_SIZE(vit)  ((vit).end - (vit).start)
  ------------------
  654|       |
  655|      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]
  |  |  ------------------
  ------------------
  656|      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]
  |  |  ------------------
  ------------------
  657|      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]
  |  |  ------------------
  ------------------
  658|      0|    igraph_vector_null(res);
  659|       |
  660|      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 (660:30): [True: 0, False: 0]
  ------------------
  661|      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]
  |  |  ------------------
  ------------------
  662|      0|        const igraph_int_t n = igraph_vector_int_size(&neis);
  663|      0|        for (igraph_int_t j = 0; j < n; j++) {
  ------------------
  |  Branch (663:34): [True: 0, False: 0]
  ------------------
  664|      0|            igraph_int_t edge = VECTOR(neis)[j];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  665|      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)
  ------------------
  666|      0|        }
  667|      0|    }
  668|       |
  669|      0|    igraph_vit_destroy(&vit);
  670|      0|    igraph_vector_int_destroy(&neis);
  671|      0|    IGRAPH_FINALLY_CLEAN(2);
  672|       |
  673|      0|    return IGRAPH_SUCCESS;
  674|      0|}
degrees.c:strength_all:
  540|  13.5k|        const igraph_vector_t *weights) {
  541|       |
  542|       |    // When calculating strength for all vertices, iterating over edges is faster
  543|  13.5k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  544|  13.5k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  545|       |
  546|  13.5k|    IGRAPH_CHECK(igraph_vector_resize(res, no_of_nodes));
  ------------------
  |  |  656|  13.5k|    do { \
  |  |  657|  13.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  13.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  13.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 13.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|  13.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 13.5k]
  |  |  ------------------
  ------------------
  547|  13.5k|    igraph_vector_null(res);
  548|       |
  549|  13.5k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (549:9): [True: 0, False: 13.5k]
  ------------------
  550|      0|        mode = IGRAPH_ALL;
  551|      0|    }
  552|       |
  553|  13.5k|    if (loops) {
  ------------------
  |  Branch (553:9): [True: 10.2k, False: 3.30k]
  ------------------
  554|  10.2k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (554:13): [True: 6.80k, False: 3.40k]
  ------------------
  555|   190k|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (555:41): [True: 183k, False: 6.80k]
  ------------------
  556|   183k|                VECTOR(*res)[IGRAPH_FROM(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|   183k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[IGRAPH_FROM(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |  115|   183k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|   183k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                              VECTOR(*res)[IGRAPH_FROM(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|   183k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  557|   183k|            }
  558|  6.80k|        }
  559|  10.2k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (559:13): [True: 3.40k, False: 6.80k]
  ------------------
  560|  95.0k|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (560:41): [True: 91.6k, False: 3.40k]
  ------------------
  561|  91.6k|                VECTOR(*res)[IGRAPH_TO(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[IGRAPH_TO(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |  128|  91.6k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                              VECTOR(*res)[IGRAPH_TO(graph, edge)] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  91.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  562|  91.6k|            }
  563|  3.40k|        }
  564|  10.2k|    } else {
  565|  3.30k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (565:13): [True: 3.30k, False: 0]
  ------------------
  566|  58.5k|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (566:41): [True: 55.2k, False: 3.30k]
  ------------------
  567|  55.2k|                igraph_int_t from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|  55.2k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  568|  55.2k|                if (from != IGRAPH_TO(graph, edge)) {
  ------------------
  |  |  128|  55.2k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (568:21): [True: 55.2k, False: 0]
  ------------------
  569|  55.2k|                   VECTOR(*res)[from] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                 VECTOR(*res)[from] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  570|  55.2k|                }
  571|  55.2k|            }
  572|  3.30k|        }
  573|  3.30k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (573:13): [True: 3.30k, False: 0]
  ------------------
  574|  58.5k|            for (igraph_int_t edge = 0; edge < no_of_edges; ++edge) {
  ------------------
  |  Branch (574:41): [True: 55.2k, False: 3.30k]
  ------------------
  575|  55.2k|                igraph_int_t to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  55.2k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  576|  55.2k|                if (IGRAPH_FROM(graph, edge) != to) {
  ------------------
  |  |  115|  55.2k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (576:21): [True: 55.2k, False: 0]
  ------------------
  577|  55.2k|                    VECTOR(*res)[to] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(*res)[to] += VECTOR(*weights)[edge];
  ------------------
  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  578|  55.2k|                }
  579|  55.2k|            }
  580|  3.30k|        }
  581|  3.30k|    }
  582|       |
  583|  13.5k|    return IGRAPH_SUCCESS;
  584|  13.5k|}

igraph_ecc:
  361|  3.30k|                          igraph_bool_t offset, igraph_bool_t normalize) {
  362|       |
  363|  3.30k|    if (k < 3) {
  ------------------
  |  Branch (363:9): [True: 0, False: 3.30k]
  ------------------
  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.30k|    switch (k) {
  369|  3.30k|    case 3:
  ------------------
  |  Branch (369:5): [True: 3.30k, False: 0]
  ------------------
  370|  3.30k|        if (igraph_es_is_all(&eids)) {
  ------------------
  |  Branch (370:13): [True: 3.30k, False: 0]
  ------------------
  371|  3.30k|            return igraph_i_ecc3_1(graph, res, eids, offset, normalize);
  372|  3.30k|        } 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.30k]
  ------------------
  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.30k]
  ------------------
  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.30k|                     IGRAPH_UNIMPLEMENTED);
  384|  3.30k|    }
  385|  3.30k|}
ecc.c:igraph_i_ecc3_1:
   35|  3.30k|        igraph_bool_t offset, igraph_bool_t normalize) {
   36|       |
   37|  3.30k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
   38|  3.30k|    igraph_vector_int_t degree;
   39|  3.30k|    igraph_adjlist_t al;
   40|  3.30k|    igraph_eit_t eit;
   41|  3.30k|    const igraph_real_t c = offset ? 1.0 : 0.0;
  ------------------
  |  Branch (41:29): [True: 3.30k, False: 0]
  ------------------
   42|       |
   43|  3.30k|    IGRAPH_CHECK(igraph_adjlist_init(graph, &al, IGRAPH_ALL, IGRAPH_NO_LOOPS, IGRAPH_NO_MULTIPLE));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
   44|  3.30k|    IGRAPH_FINALLY(igraph_adjlist_destroy, &al);
  ------------------
  |  |  603|  3.30k|    do { \
  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  ------------------
  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
   45|       |
   46|  3.30k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&degree, no_of_nodes);
  ------------------
  |  |  119|  3.30k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.30k|    do { \
  |  |  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.30k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.30k|    do { \
  |  |  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
   47|  3.30k|    IGRAPH_CHECK(igraph_degree(graph, &degree, igraph_vss_all(), IGRAPH_ALL, IGRAPH_LOOPS));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
   48|       |
   49|  3.30k|    IGRAPH_CHECK(igraph_eit_create(graph, eids, &eit));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
   50|  3.30k|    IGRAPH_FINALLY(igraph_eit_destroy, &eit);
  ------------------
  |  |  603|  3.30k|    do { \
  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  ------------------
  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
   51|       |
   52|  3.30k|    IGRAPH_CHECK(igraph_vector_resize(res, IGRAPH_EIT_SIZE(eit)));
  ------------------
  |  |  656|  3.30k|    do { \
  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
   53|       |
   54|  3.30k|    for (igraph_int_t i=0;
   55|  58.5k|         ! IGRAPH_EIT_END(eit);
  ------------------
  |  |  371|  58.5k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
  |  Branch (55:10): [True: 55.2k, False: 3.30k]
  ------------------
   56|  55.2k|         IGRAPH_EIT_NEXT(eit), i++) {
  ------------------
  |  |  359|  55.2k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
   57|       |
   58|  55.2k|        igraph_int_t edge = IGRAPH_EIT_GET(eit);
  ------------------
  |  |  405|  55.2k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 55.2k, False: 0]
  |  |  ------------------
  |  |  406|  55.2k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
   59|  55.2k|        igraph_int_t v1 = IGRAPH_FROM(graph, edge), v2 = IGRAPH_TO(graph, edge);
  ------------------
  |  |  115|  55.2k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                      igraph_int_t v1 = IGRAPH_FROM(graph, edge), v2 = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|  55.2k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
   60|       |
   61|  55.2k|        igraph_real_t z; /* number of triangles the edge participates in */
   62|  55.2k|        igraph_real_t s; /* max number of triangles the edge could be part of */
   63|       |
   64|  55.2k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|  55.2k|    do { \
  |  |   47|  55.2k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 55.2k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|  55.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 55.2k]
  |  |  ------------------
  ------------------
   65|       |
   66|  55.2k|        if (v1 == v2) {
  ------------------
  |  Branch (66:13): [True: 0, False: 55.2k]
  ------------------
   67|       |            /* A self-loop isn't, and cannot be part of any triangles. */
   68|      0|            z = 0.0;
   69|      0|            s = 0.0;
   70|  55.2k|        } else {
   71|  55.2k|            const igraph_vector_int_t *a1 = igraph_adjlist_get(&al, v1), *a2 = igraph_adjlist_get(&al, v2);
  ------------------
  |  |   73|  55.2k|#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|  55.2k|#define igraph_adjlist_get(al,no) (&(al)->adjs[(igraph_int_t)(no)])
  ------------------
   72|  55.2k|            igraph_int_t d1 = VECTOR(degree)[v1], d2 = VECTOR(degree)[v2];
  ------------------
  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          igraph_int_t d1 = VECTOR(degree)[v1], d2 = VECTOR(degree)[v2];
  ------------------
  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   73|       |
   74|  55.2k|            z = igraph_vector_int_intersection_size_sorted(a1, a2);
   75|  55.2k|            s = (d1 < d2 ? d1 : d2) - 1.0;
  ------------------
  |  Branch (75:18): [True: 23.0k, False: 32.1k]
  ------------------
   76|  55.2k|        }
   77|       |
   78|  55.2k|        VECTOR(*res)[i] = z + c;
  ------------------
  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   79|  55.2k|        if (normalize) VECTOR(*res)[i] /= s;
  ------------------
  |  |   60|  55.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (79:13): [True: 55.2k, False: 0]
  ------------------
   80|  55.2k|    }
   81|       |
   82|  3.30k|    igraph_eit_destroy(&eit);
   83|  3.30k|    igraph_vector_int_destroy(&degree);
   84|  3.30k|    igraph_adjlist_destroy(&al);
   85|  3.30k|    IGRAPH_FINALLY_CLEAN(3);
   86|       |
   87|  3.30k|    return IGRAPH_SUCCESS;
   88|  3.30k|}

igraph_is_simple:
   52|  3.40k|igraph_error_t igraph_is_simple(const igraph_t *graph, igraph_bool_t *res, igraph_bool_t directed) {
   53|  3.40k|    igraph_int_t vc = igraph_vcount(graph);
   54|  3.40k|    igraph_int_t ec = igraph_ecount(graph);
   55|       |
   56|       |    /* Is it already known whether the graph has loops or multi-edges? */
   57|  3.40k|    igraph_bool_t known_loop, known_multi;
   58|       |
   59|       |    /* If it is known, does the graph have them? */
   60|  3.40k|    igraph_bool_t has_loop, has_multi;
   61|       |
   62|       |    /* Will we need to check mutual edges explicitly? */
   63|  3.40k|    igraph_bool_t need_to_check_mutual = (! directed) && igraph_is_directed(graph);
  ------------------
  |  Branch (63:42): [True: 0, False: 3.40k]
  |  Branch (63:58): [True: 0, False: 0]
  ------------------
   64|       |
   65|  3.40k|    known_loop  = igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP);
   66|  3.40k|    if (known_loop) {
  ------------------
  |  Branch (66:9): [True: 3.40k, False: 0]
  ------------------
   67|  3.40k|        has_loop = igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP);
   68|  3.40k|        if (has_loop) {
  ------------------
  |  Branch (68:13): [True: 0, False: 3.40k]
  ------------------
   69|      0|            *res = false;
   70|      0|            goto early_exit;
   71|      0|        }
   72|  3.40k|    }
   73|       |
   74|  3.40k|    known_multi = igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI);
   75|  3.40k|    if (known_multi) {
  ------------------
  |  Branch (75:9): [True: 3.40k, False: 0]
  ------------------
   76|  3.40k|        has_multi = igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MULTI);
   77|  3.40k|        if (has_multi) {
  ------------------
  |  Branch (77:13): [True: 0, False: 3.40k]
  ------------------
   78|      0|            *res = false;
   79|      0|            goto early_exit;
   80|      0|        }
   81|  3.40k|    }
   82|       |
   83|  3.40k|    if (known_loop && known_multi && !has_loop && !has_multi) {
  ------------------
  |  Branch (83:9): [True: 3.40k, False: 0]
  |  Branch (83:23): [True: 3.40k, False: 0]
  |  Branch (83:38): [True: 3.40k, False: 0]
  |  Branch (83:51): [True: 3.40k, False: 0]
  ------------------
   84|  3.40k|        *res = true;
   85|  3.40k|        goto early_exit;
   86|  3.40k|    }
   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.40k|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.40k|    if (*res && need_to_check_mutual) {
  ------------------
  |  Branch (139:9): [True: 3.40k, False: 0]
  |  Branch (139:17): [True: 0, False: 3.40k]
  ------------------
  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.40k|    return IGRAPH_SUCCESS;
  149|  3.40k|}
igraph_has_multiple:
  176|  3.40k|igraph_error_t igraph_has_multiple(const igraph_t *graph, igraph_bool_t *res) {
  177|  3.40k|    igraph_int_t vc = igraph_vcount(graph);
  178|  3.40k|    igraph_int_t ec = igraph_ecount(graph);
  179|  3.40k|    igraph_bool_t directed = igraph_is_directed(graph);
  180|       |
  181|  3.40k|    IGRAPH_RETURN_IF_CACHED_BOOL(graph, IGRAPH_PROP_HAS_MULTI, res);
  ------------------
  |  |   97|  3.40k|    do { \
  |  |   98|  3.40k|        if (igraph_i_property_cache_has((graphptr), (prop))) { \
  |  |  ------------------
  |  |  |  Branch (98:13): [True: 0, False: 3.40k]
  |  |  ------------------
  |  |   99|      0|            *(resptr) = igraph_i_property_cache_get_bool((graphptr), (prop)); \
  |  |  100|      0|            return IGRAPH_SUCCESS; \
  |  |  101|      0|        } \
  |  |  102|  3.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (102:14): [Folded, False: 3.40k]
  |  |  ------------------
  ------------------
  182|       |
  183|  3.40k|    if (vc == 0 || ec == 0) {
  ------------------
  |  Branch (183:9): [True: 1, False: 3.39k]
  |  Branch (183:20): [True: 96, False: 3.30k]
  ------------------
  184|     97|        *res = false;
  185|  3.30k|    } else {
  186|  3.30k|        igraph_vector_int_t neis;
  187|  3.30k|        igraph_int_t i, j, n;
  188|  3.30k|        igraph_bool_t found = false;
  189|  3.30k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&neis, 0);
  ------------------
  |  |  119|  3.30k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.30k|    do { \
  |  |  |  |  657|  3.30k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.30k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.30k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.30k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, 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.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.30k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.30k|    do { \
  |  |  |  |  604|  3.30k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.30k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.30k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.30k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.30k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.30k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
  190|   152k|        for (i = 0; i < vc && !found; i++) {
  ------------------
  |  Branch (190:21): [True: 149k, False: 3.30k]
  |  Branch (190:31): [True: 149k, False: 0]
  ------------------
  191|   149k|            IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  192|   149k|                graph, &neis, i, IGRAPH_OUT, IGRAPH_LOOPS, IGRAPH_MULTIPLE
  193|   149k|            ));
  194|   149k|            n = igraph_vector_int_size(&neis);
  195|   209k|            for (j = 1; j < n; j++) {
  ------------------
  |  Branch (195:25): [True: 60.1k, False: 149k]
  ------------------
  196|  60.1k|                if (VECTOR(neis)[j - 1] == VECTOR(neis)[j]) {
  ------------------
  |  |   60|  60.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              if (VECTOR(neis)[j - 1] == VECTOR(neis)[j]) {
  ------------------
  |  |   60|  60.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (196:21): [True: 0, False: 60.1k]
  ------------------
  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|  60.1k|            }
  211|   149k|        }
  212|  3.30k|        *res = found;
  213|  3.30k|        igraph_vector_int_destroy(&neis);
  214|  3.30k|        IGRAPH_FINALLY_CLEAN(1);
  215|  3.30k|    }
  216|       |
  217|  3.40k|    igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, *res);
  218|       |
  219|  3.40k|    return IGRAPH_SUCCESS;
  220|  3.40k|}

igraph_rng_default:
  188|   243M|igraph_rng_t *igraph_rng_default(void) {
  189|   243M|    return igraph_i_rng_default_ptr;
  190|   243M|}
igraph_rng_seed:
  260|  3.43k|igraph_error_t igraph_rng_seed(igraph_rng_t *rng, igraph_uint_t seed) {
  261|  3.43k|    const igraph_rng_type_t *type = rng->type;
  262|  3.43k|    IGRAPH_CHECK(type->seed(rng->state, seed));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  263|  3.43k|    rng->is_seeded = true;
  264|  3.43k|    return IGRAPH_SUCCESS;
  265|  3.43k|}
igraph_rng_bits:
  277|   243M|igraph_int_t igraph_rng_bits(const igraph_rng_t* rng) {
  278|   243M|    return rng->type->bits;
  279|   243M|}
igraph_rng_get_integer:
  593|   122M|) {
  594|   122M|    const igraph_rng_type_t *type = rng->type;
  595|   122M|    igraph_uint_t range;
  596|       |
  597|   122M|    assert(h >= l);
  ------------------
  |  Branch (597:5): [True: 0, False: 122M]
  |  Branch (597:5): [True: 122M, False: 0]
  ------------------
  598|       |
  599|   122M|    if (h == l) {
  ------------------
  |  Branch (599:9): [True: 200k, False: 122M]
  ------------------
  600|   200k|        return l;
  601|   200k|    }
  602|       |
  603|   122M|    if (type->get_int) {
  ------------------
  |  Branch (603:9): [True: 0, False: 122M]
  ------------------
  604|      0|        return type->get_int(rng->state, l, h);
  605|      0|    }
  606|       |
  607|   122M|    if (IGRAPH_UNLIKELY(l == IGRAPH_INTEGER_MIN && h == IGRAPH_INTEGER_MAX)) {
  ------------------
  |  |  612|   122M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  ------------------
  |  |  |  Branch (612:32): [True: 0, False: 122M]
  |  |  |  Branch (612:52): [True: 0, False: 122M]
  |  |  |  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|   122M|    } else if (l >= 0 || h < 0) {
  ------------------
  |  Branch (611:16): [True: 122M, False: 0]
  |  Branch (611:26): [True: 0, False: 0]
  ------------------
  612|       |        /* this is okay, (h - l) will not overflow an igraph_int_t */
  613|   122M|        range = (igraph_uint_t)(h - l) + 1;
  614|   122M|    } 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|   122M|    return l + igraph_i_rng_get_uint_bounded(rng, range);
  622|   122M|}
igraph_rng_get_unif:
  671|   121M|                                  igraph_real_t l, igraph_real_t h) {
  672|   121M|    assert(h >= l);
  ------------------
  |  Branch (672:5): [True: 0, False: 121M]
  |  Branch (672:5): [True: 121M, False: 0]
  ------------------
  673|       |
  674|   121M|    if (l == h) return h;
  ------------------
  |  Branch (674:9): [True: 0, False: 121M]
  ------------------
  675|       |
  676|       |    /* Ensure that 'h' is never produced due to numerical roundoff errors, except when l == h. */
  677|   121M|    igraph_real_t r;
  678|   121M|    do {
  679|   121M|        r = igraph_rng_get_unif01(rng) * (h - l) + l;
  680|   121M|    } while (IGRAPH_UNLIKELY(r == h));
  ------------------
  |  |  612|   121M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  ------------------
  |  |  |  Branch (612:32): [True: 0, False: 121M]
  |  |  ------------------
  ------------------
  681|   121M|    return r;
  682|   121M|}
igraph_rng_get_unif01:
  698|   121M|igraph_real_t igraph_rng_get_unif01(igraph_rng_t *rng) {
  699|   121M|    const igraph_rng_type_t *type = rng->type;
  700|   121M|    if (type->get_real) {
  ------------------
  |  Branch (700:9): [True: 0, False: 121M]
  ------------------
  701|      0|        return type->get_real(rng->state);
  702|   121M|    } 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|   121M|        union {
  711|   121M|            uint64_t as_uint64_t;
  712|   121M|            double as_double;
  713|   121M|        } value;
  714|   121M|        value.as_uint64_t =
  715|   121M|            (igraph_i_rng_get_random_bits_uint64(rng, 52) & 0xFFFFFFFFFFFFFull) | 0x3FF0000000000000ull;
  716|   121M|        return value.as_double - 1.0;
  717|   121M|    }
  718|   121M|}
random.c:igraph_i_rng_get_random_bits:
  336|   122M|static igraph_uint_t igraph_i_rng_get_random_bits(igraph_rng_t *rng, uint8_t bits) {
  337|   122M|    const igraph_rng_type_t *type = rng->type;
  338|   122M|    igraph_int_t rng_bitwidth = igraph_rng_bits(rng);
  339|   122M|    igraph_uint_t result;
  340|       |
  341|   122M|    if (rng_bitwidth >= bits) {
  ------------------
  |  Branch (341:9): [True: 122M, False: 0]
  ------------------
  342|       |        /* keep the high bits as RNGs sometimes tend to have lower entropy in
  343|       |         * low bits than in high bits */
  344|   122M|        result = type->get(rng->state) >> (rng_bitwidth - bits);
  345|   122M|    } 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|   122M|    return result;
  357|   122M|}
random.c:igraph_i_rng_get_uint_bounded:
  532|   122M|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|   122M|    if (range <= UINT32_MAX) {
  ------------------
  |  Branch (541:9): [True: 122M, False: 0]
  ------------------
  542|   122M|        return igraph_i_rng_get_uint32_bounded(rng, range);
  543|   122M|    } else {
  544|      0|        return igraph_i_rng_get_uint64_bounded(rng, range);
  545|      0|    }
  546|   122M|#endif
  547|   122M|}
random.c:igraph_i_rng_get_uint32_bounded:
  428|   122M|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|   122M|    uint32_t x, l, t = (-range) % range;
  432|   122M|    uint64_t m;
  433|   122M|    do {
  434|   122M|        x = igraph_i_rng_get_uint32(rng);
  435|   122M|        m = (uint64_t)(x) * (uint64_t)(range);
  436|   122M|        l = (uint32_t)m;
  437|   122M|    } while (l < t);
  ------------------
  |  Branch (437:14): [True: 0, False: 122M]
  ------------------
  438|   122M|    return m >> 32;
  439|   122M|}
random.c:igraph_i_rng_get_uint32:
  416|   122M|static uint32_t igraph_i_rng_get_uint32(igraph_rng_t *rng) {
  417|   122M|    return igraph_i_rng_get_random_bits(rng, 32);
  418|   122M|}
random.c:igraph_i_rng_get_random_bits_uint64:
  375|   121M|static uint64_t igraph_i_rng_get_random_bits_uint64(igraph_rng_t *rng, uint8_t bits) {
  376|   121M|    const igraph_rng_type_t *type = rng->type;
  377|   121M|    igraph_int_t rng_bitwidth = igraph_rng_bits(rng);
  378|   121M|    uint64_t result;
  379|       |
  380|   121M|    if (rng_bitwidth >= bits) {
  ------------------
  |  Branch (380:9): [True: 0, False: 121M]
  ------------------
  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|   121M|    } else {
  385|   121M|        result = 0;
  386|   121M|        do {
  387|   121M|            result = (result << rng_bitwidth) + type->get(rng->state);
  388|   121M|            bits -= rng_bitwidth;
  389|   121M|        } while (bits > rng_bitwidth);
  ------------------
  |  Branch (389:18): [True: 0, False: 121M]
  ------------------
  390|       |
  391|       |        /* and now the last piece */
  392|   121M|        result = (result << bits) + (type->get(rng->state) >> (rng_bitwidth - bits));
  393|   121M|    }
  394|       |
  395|   121M|    return result;
  396|   121M|}

rng_pcg32.c:igraph_rng_pcg32_seed:
   41|  3.43k|static igraph_error_t igraph_rng_pcg32_seed(void *vstate, igraph_uint_t seed) {
   42|  3.43k|    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.43k|    if (seed == 0) {
  ------------------
  |  Branch (49:9): [True: 0, False: 3.43k]
  ------------------
   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.43k|    } else {
   57|  3.43k|        pcg32_srandom_r(state, pcg32_initializer.state, seed);
  ------------------
  |  | 2398|  3.43k|#define pcg32_srandom_r                 pcg_setseq_64_srandom_r
  ------------------
   58|  3.43k|    }
   59|       |
   60|  3.43k|    return IGRAPH_SUCCESS;
   61|  3.43k|}
rng_pcg32.c:igraph_rng_pcg32_get:
   36|   365M|static igraph_uint_t igraph_rng_pcg32_get(void *vstate) {
   37|   365M|    pcg32_random_t *state = (pcg32_random_t*) vstate;
   38|   365M|    return pcg32_random_r(state);
  ------------------
  |  | 2388|   365M|#define pcg32_random_r                  pcg_setseq_64_xsh_rr_32_random_r
  ------------------
   39|   365M|}

