_Z31check_communities_are_connectedPK8igraph_tPK19igraph_vector_int_t:
   25|  6.76k|void check_communities_are_connected(const igraph_t *graph, const igraph_vector_int_t *membership) {
   26|  6.76k|    igraph_vector_int_t memb, comp, map;
   27|  6.76k|    igraph_int_t vcount = igraph_vcount(graph);
   28|  6.76k|    igraph_int_t no;
   29|       |
   30|  6.76k|    igraph_vector_int_init_copy(&memb, membership);
   31|  6.76k|    igraph_reindex_membership(&memb, NULL, &no);
   32|       |
   33|  6.76k|    igraph_vector_int_init(&map, no);
   34|  6.76k|    igraph_vector_int_fill(&map, -1);
   35|       |
   36|  6.76k|    igraph_vector_int_init(&comp, 0);
   37|       |
   38|  6.76k|    igraph_connected_components(graph, &comp, NULL, NULL, IGRAPH_WEAK);
   39|       |
   40|   327k|    for (igraph_int_t v=0; v < vcount; v++) {
  ------------------
  |  Branch (40:28): [True: 320k, False: 6.76k]
  ------------------
   41|   320k|        if (VECTOR(map)[ VECTOR(memb)[v] ] == -1) {
  ------------------
  |  |   60|   320k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (VECTOR(map)[ VECTOR(memb)[v] ] == -1) {
  ------------------
  |  |   60|   320k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (41:13): [True: 319k, False: 1.26k]
  ------------------
   42|   319k|            VECTOR(map)[ VECTOR(memb)[v] ] = VECTOR(comp)[v];
  ------------------
  |  |   60|   319k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(map)[ VECTOR(memb)[v] ] = VECTOR(comp)[v];
  ------------------
  |  |   60|   319k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(map)[ VECTOR(memb)[v] ] = VECTOR(comp)[v];
  ------------------
  |  |   60|   319k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   43|   319k|        } else {
   44|  1.26k|            IGRAPH_ASSERT(VECTOR(map)[ VECTOR(memb)[v] ] == VECTOR(comp)[v]);
  ------------------
  |  |  924|  1.26k|    do { \
  |  |  925|  1.26k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.26k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  ------------------
  |  |  |  |  401|       |#  define IGRAPH_FILE_BASENAME __FILE__
  |  |  ------------------
  |  |  927|      0|        } \
  |  |  928|  1.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.26k]
  |  |  ------------------
  ------------------
   45|  1.26k|        }
   46|   320k|    }
   47|       |
   48|  6.76k|    igraph_vector_int_destroy(&comp);
   49|  6.76k|    igraph_vector_int_destroy(&map);
   50|  6.76k|    igraph_vector_int_destroy(&memb);
   51|  6.76k|}
LLVMFuzzerTestOneInput:
   53|  3.42k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   54|  3.42k|    igraph_t graph;
   55|  3.42k|    igraph_vector_int_t edges;
   56|       |
   57|  3.42k|    igraph_set_warning_handler(igraph_warning_handler_ignore);
   58|       |
   59|  3.42k|    if (Size % 2 == 0 || Size > 512+1 || Size < 1) {
  ------------------
  |  Branch (59:9): [True: 3, False: 3.42k]
  |  Branch (59:26): [True: 11, False: 3.41k]
  |  Branch (59:42): [True: 0, False: 3.41k]
  ------------------
   60|     14|        return 0;
   61|     14|    }
   62|       |
   63|  3.41k|    igraph_vector_int_init(&edges, Size-1);
   64|   207k|    for (size_t i=0; i < Size-1; ++i) {
  ------------------
  |  Branch (64:22): [True: 204k, False: 3.41k]
  ------------------
   65|   204k|        VECTOR(edges)[i] = Data[i+1];
  ------------------
  |  |   60|   204k|#define VECTOR(v) ((v).stor_begin)
  ------------------
   66|   204k|    }
   67|       |
   68|  3.41k|    igraph_rng_seed(igraph_rng_default(), 42);
   69|       |
   70|  3.41k|    if (igraph_create(&graph, &edges, Data[0], IGRAPH_DIRECTED) == IGRAPH_SUCCESS) {
  ------------------
  |  Branch (70:9): [True: 3.41k, False: 0]
  ------------------
   71|  3.41k|        igraph_matrix_int_t merges, im;
   72|  3.41k|        igraph_matrix_t mat;
   73|  3.41k|        igraph_vector_int_t membership, membership2, iv, iv2;
   74|  3.41k|        igraph_vector_t mv, v;
   75|  3.41k|        igraph_real_t m, r;
   76|  3.41k|        igraph_int_t i;
   77|  3.41k|        igraph_bool_t b;
   78|       |
   79|       |        /* Limit graph size for the sake of performance. */
   80|  3.41k|        if (igraph_vcount(&graph) <= 64) {
  ------------------
  |  Branch (80:13): [True: 3.38k, False: 33]
  ------------------
   81|  3.38k|            igraph_matrix_int_init(&merges, 0, 0);
   82|  3.38k|            igraph_matrix_int_init(&im, 0, 0);
   83|  3.38k|            igraph_matrix_init(&mat, 0, 0);
   84|  3.38k|            igraph_vector_int_init(&membership, 0);
   85|  3.38k|            igraph_vector_int_init(&membership2, 0);
   86|  3.38k|            igraph_vector_int_init(&iv, 0);
   87|  3.38k|            igraph_vector_int_init(&iv2, 0);
   88|  3.38k|            igraph_vector_init(&mv, 0);
   89|  3.38k|            igraph_vector_init(&v, 0);
   90|       |
   91|       |            // The IGRAPH_LPA_FAST version is temporarily switched to undirected until
   92|       |            // the reason for the bad performance / infinite loop in the directed version
   93|       |            // is debugged. See https://github.com/igraph/igraph/issues/2608
   94|  3.38k|            igraph_community_label_propagation(&graph, &membership, IGRAPH_ALL, NULL, NULL, NULL, IGRAPH_LPA_FAST);
   95|  3.38k|            igraph_community_label_propagation(&graph, &membership, IGRAPH_OUT, NULL, NULL, NULL, IGRAPH_LPA_RETENTION);
   96|  3.38k|            igraph_community_label_propagation(&graph, &membership, IGRAPH_OUT, NULL, NULL, NULL, IGRAPH_LPA_DOMINANCE);
   97|       |
   98|  3.38k|            igraph_community_walktrap(&graph, NULL, 3, &merges, &mv, &membership);
   99|  3.38k|            igraph_community_edge_betweenness(&graph, &iv, &v, &merges, &iv2, &mv, &membership2, IGRAPH_DIRECTED, NULL, NULL);
  100|       |
  101|  3.38k|            igraph_community_leiden(&graph, NULL, NULL, NULL, 1.5, 0.01, false, 2, &membership, &i, &r);
  102|  3.38k|            check_communities_are_connected(&graph, &membership);
  103|       |
  104|       |            // Take the opportunity to run functions that can use the output of community detection.
  105|       |
  106|  3.38k|            {
  107|  3.38k|                igraph_community_comparison_t method[] = {
  108|  3.38k|                    IGRAPH_COMMCMP_VI,
  109|  3.38k|                    IGRAPH_COMMCMP_NMI,
  110|  3.38k|                    IGRAPH_COMMCMP_SPLIT_JOIN,
  111|  3.38k|                    IGRAPH_COMMCMP_RAND,
  112|  3.38k|                    IGRAPH_COMMCMP_ADJUSTED_RAND
  113|  3.38k|                };
  114|  20.2k|                for (size_t i=0; i < sizeof(method) / sizeof(method[0]); i++) {
  ------------------
  |  Branch (114:34): [True: 16.9k, False: 3.38k]
  ------------------
  115|  16.9k|                    if ((method[i] == IGRAPH_COMMCMP_RAND ||
  ------------------
  |  Branch (115:26): [True: 3.38k, False: 13.5k]
  ------------------
  116|  13.5k|                         method[i] == IGRAPH_COMMCMP_ADJUSTED_RAND) &&
  ------------------
  |  Branch (116:26): [True: 3.38k, False: 10.1k]
  ------------------
  117|  6.76k|                        igraph_vcount(&graph) < 2) {
  ------------------
  |  Branch (117:25): [True: 26, False: 6.73k]
  ------------------
  118|     26|                        continue;
  119|     26|                    }
  120|  16.8k|                    igraph_compare_communities(&membership, &membership2, &r, method[i]);
  121|  16.8k|                }
  122|  3.38k|            }
  123|       |
  124|  3.38k|            {
  125|  3.38k|                igraph_t graph2;
  126|  3.38k|                igraph_copy(&graph2, &graph);
  127|  3.38k|                igraph_contract_vertices(&graph2, &membership, NULL);
  128|  3.38k|                igraph_destroy(&graph2);
  129|  3.38k|            }
  130|       |
  131|  3.38k|            igraph_modularity(&graph, &membership, NULL, 1.5, IGRAPH_UNDIRECTED, &m);
  132|  3.38k|            igraph_modularity_matrix(&graph, NULL, 0.75, &mat, IGRAPH_DIRECTED);
  133|  3.38k|            igraph_assortativity_nominal(&graph, NULL, &membership, &r, IGRAPH_DIRECTED, true);
  134|       |
  135|  3.38k|            igraph_simplify(&graph, true, true, NULL);
  136|  3.38k|            igraph_community_voronoi(&graph, &membership, &iv, &m, NULL, NULL, IGRAPH_OUT, 1.0);
  137|       |
  138|  3.38k|            igraph_to_undirected(&graph, IGRAPH_TO_UNDIRECTED_COLLAPSE, NULL);
  139|  3.38k|            igraph_community_fastgreedy(&graph, NULL, &merges, &mv, &membership);
  140|       |
  141|  3.38k|            igraph_community_leiden(&graph, NULL, NULL, NULL, 1.5, 0.01, false, 2, &membership, &i, &r);
  142|  3.38k|            check_communities_are_connected(&graph, &membership);
  143|       |
  144|  3.38k|            igraph_community_multilevel(&graph, NULL, 0.8, &membership, &im, &mv);
  145|       |
  146|  3.38k|            igraph_is_connected(&graph, &b, IGRAPH_WEAK);
  147|  3.38k|            if (b) {
  ------------------
  |  Branch (147:17): [True: 230, False: 3.15k]
  ------------------
  148|    230|                igraph_int_t no_comm = 4;
  149|    230|                if (no_comm > igraph_vcount(&graph)) {
  ------------------
  |  Branch (149:21): [True: 59, False: 171]
  ------------------
  150|     59|                    no_comm = igraph_vcount(&graph);
  151|     59|                }
  152|    230|                igraph_community_fluid_communities(&graph, no_comm, &membership);
  153|    230|            }
  154|       |
  155|  3.38k|            igraph_vector_destroy(&v);
  156|  3.38k|            igraph_vector_destroy(&mv);
  157|  3.38k|            igraph_vector_int_destroy(&iv2);
  158|  3.38k|            igraph_vector_int_destroy(&iv);
  159|  3.38k|            igraph_vector_int_destroy(&membership2);
  160|  3.38k|            igraph_vector_int_destroy(&membership);
  161|  3.38k|            igraph_matrix_destroy(&mat);
  162|  3.38k|            igraph_matrix_int_destroy(&im);
  163|  3.38k|            igraph_matrix_int_destroy(&merges);
  164|  3.38k|        }
  165|       |
  166|  3.41k|        igraph_destroy(&graph);
  167|  3.41k|    }
  168|       |
  169|  3.41k|    igraph_vector_int_destroy(&edges);
  170|       |
  171|  3.41k|    IGRAPH_ASSERT(IGRAPH_FINALLY_STACK_EMPTY);
  ------------------
  |  |  924|  3.41k|    do { \
  |  |  925|  3.41k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.41k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  ------------------
  |  |  |  |  401|       |#  define IGRAPH_FILE_BASENAME __FILE__
  |  |  ------------------
  |  |  927|      0|        } \
  |  |  928|  3.41k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.41k]
  |  |  ------------------
  ------------------
  172|       |
  173|  3.41k|    return 0;  // Non-zero return values are reserved for future use.
  174|  3.41k|}

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

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

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

igraph_community_fluid_communities:
   61|    230|        igraph_vector_int_t *membership) {
   62|       |
   63|    230|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
   64|    230|    igraph_int_t i, j, k, kv1;
   65|    230|    igraph_adjlist_t al;
   66|    230|    igraph_real_t max_density;
   67|    230|    igraph_bool_t is_simple, is_connected, running;
   68|    230|    igraph_vector_t density, label_counters;
   69|    230|    igraph_vector_int_t dominant_labels, node_order, com_to_numvertices;
   70|       |
   71|       |    /* Checking input values */
   72|    230|    if (igraph_is_directed(graph)) {
  ------------------
  |  Branch (72:9): [True: 0, False: 230]
  ------------------
   73|      0|        IGRAPH_WARNING("Edge directions are ignored by fluid community detection.");
  ------------------
  |  |  797|      0|    do { \
  |  |  798|      0|        igraph_warning(reason, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  799|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (799:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   74|      0|    }
   75|    230|    IGRAPH_CHECK(igraph_is_simple(graph, &is_simple, IGRAPH_UNDIRECTED));
  ------------------
  |  |  656|    230|    do { \
  |  |  657|    230|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    230|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    230|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 230]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    230|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 230]
  |  |  ------------------
  ------------------
   76|    230|    if (!is_simple) {
  ------------------
  |  Branch (76:9): [True: 0, False: 230]
  ------------------
   77|      0|        IGRAPH_ERROR("Fluid community detection supports only simple 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]
  |  |  ------------------
  ------------------
   78|      0|    }
   79|       |
   80|       |    /* This must come before the connectedness check so we can support the null
   81|       |     * graph (considered disconnected) for purposes of convenience. */
   82|    230|    if (no_of_nodes < 2) {
  ------------------
  |  Branch (82:9): [True: 12, False: 218]
  ------------------
   83|     12|        if (membership) {
  ------------------
  |  Branch (83:13): [True: 12, False: 0]
  ------------------
   84|     12|            IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|     12|    do { \
  |  |  657|     12|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|     12|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|     12|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 12]
  |  |  ------------------
  ------------------
   85|     12|            igraph_vector_int_null(membership);
   86|     12|        }
   87|     12|        return IGRAPH_SUCCESS;
   88|     12|    }
   89|       |
   90|    218|    if (no_of_communities < 1) {
  ------------------
  |  Branch (90:9): [True: 0, False: 218]
  ------------------
   91|      0|        IGRAPH_ERROR("Number of requested communities 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]
  |  |  ------------------
  ------------------
   92|      0|    }
   93|       |
   94|    218|    if (no_of_communities > no_of_nodes) {
  ------------------
  |  Branch (94:9): [True: 0, False: 218]
  ------------------
   95|      0|        IGRAPH_ERROR("Number of requested communities must not be greater than the number of nodes.",
  ------------------
  |  |  426|      0|    do { \
  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  428|      0|        return igraph_errno ; \
  |  |  429|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
   96|      0|                     IGRAPH_EINVAL);
   97|      0|    }
   98|       |
   99|    218|    IGRAPH_CHECK(igraph_is_connected(graph, &is_connected, IGRAPH_WEAK));
  ------------------
  |  |  656|    218|    do { \
  |  |  657|    218|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    218|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    218|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  100|    218|    if (!is_connected) {
  ------------------
  |  Branch (100:9): [True: 0, False: 218]
  ------------------
  101|      0|        IGRAPH_ERROR("Fluid community detection supports only connected 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]
  |  |  ------------------
  ------------------
  102|      0|    }
  103|       |
  104|       |    /* Internal variables initialization */
  105|    218|    max_density = 1.0;
  106|       |
  107|       |    /* Resize membership vector (number of nodes) */
  108|    218|    IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|    218|    do { \
  |  |  657|    218|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    218|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    218|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  109|       |
  110|       |    /* Initialize density and com_to_numvertices vectors */
  111|    218|    IGRAPH_CHECK(igraph_vector_init(&density, no_of_communities));
  ------------------
  |  |  656|    218|    do { \
  |  |  657|    218|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    218|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    218|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  112|    218|    IGRAPH_FINALLY(igraph_vector_destroy, &density);
  ------------------
  |  |  603|    218|    do { \
  |  |  604|    218|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    218|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    218|         * incorrect destructor function with the pointer */ \
  |  |  607|    218|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 218]
  |  |  ------------------
  |  |  608|    218|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  113|    218|    IGRAPH_CHECK(igraph_vector_int_init(&com_to_numvertices, no_of_communities));
  ------------------
  |  |  656|    218|    do { \
  |  |  657|    218|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    218|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    218|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  114|    218|    IGRAPH_FINALLY(igraph_vector_int_destroy, &com_to_numvertices);
  ------------------
  |  |  603|    218|    do { \
  |  |  604|    218|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    218|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    218|         * incorrect destructor function with the pointer */ \
  |  |  607|    218|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 218]
  |  |  ------------------
  |  |  608|    218|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  115|       |
  116|       |    /* Initialize node ordering vector */
  117|    218|    IGRAPH_CHECK(igraph_vector_int_init_range(&node_order, 0, no_of_nodes));
  ------------------
  |  |  656|    218|    do { \
  |  |  657|    218|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    218|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    218|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  118|    218|    IGRAPH_FINALLY(igraph_vector_int_destroy, &node_order);
  ------------------
  |  |  603|    218|    do { \
  |  |  604|    218|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    218|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    218|         * incorrect destructor function with the pointer */ \
  |  |  607|    218|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 218]
  |  |  ------------------
  |  |  608|    218|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  119|       |
  120|       |    /* Initialize the membership vector with 0 values */
  121|    218|    igraph_vector_int_null(membership);
  122|       |    /* Initialize densities to max_density */
  123|    218|    igraph_vector_fill(&density, max_density);
  124|       |
  125|       |    /* Initialize com_to_numvertices and initialize communities into membership vector */
  126|    218|    igraph_vector_int_shuffle(&node_order);
  127|  1.01k|    for (i = 0; i < no_of_communities; i++) {
  ------------------
  |  Branch (127:17): [True: 801, False: 218]
  ------------------
  128|       |        /* Initialize membership at initial nodes for each community
  129|       |         * where 0 refers to have no label*/
  130|    801|        VECTOR(*membership)[VECTOR(node_order)[i]] = i + 1;
  ------------------
  |  |   60|    801|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*membership)[VECTOR(node_order)[i]] = i + 1;
  ------------------
  |  |   60|    801|#define VECTOR(v) ((v).stor_begin)
  ------------------
  131|       |        /* Initialize com_to_numvertices list: Number of vertices for each community */
  132|    801|        VECTOR(com_to_numvertices)[i] = 1;
  ------------------
  |  |   60|    801|#define VECTOR(v) ((v).stor_begin)
  ------------------
  133|    801|    }
  134|       |
  135|       |    /* Create an adjacency list representation for efficiency. */
  136|    218|    IGRAPH_CHECK(igraph_adjlist_init(graph, &al, IGRAPH_ALL, IGRAPH_LOOPS_TWICE, IGRAPH_MULTIPLE));
  ------------------
  |  |  656|    218|    do { \
  |  |  657|    218|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    218|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    218|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  137|    218|    IGRAPH_FINALLY(igraph_adjlist_destroy, &al);
  ------------------
  |  |  603|    218|    do { \
  |  |  604|    218|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    218|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    218|         * incorrect destructor function with the pointer */ \
  |  |  607|    218|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 218]
  |  |  ------------------
  |  |  608|    218|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  138|       |
  139|       |    /* Create storage space for counting distinct labels and dominant ones */
  140|    218|    IGRAPH_VECTOR_INT_INIT_FINALLY(&dominant_labels, no_of_communities);
  ------------------
  |  |  119|    218|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|    218|    do { \
  |  |  |  |  657|    218|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|    218|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|    218|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 218]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|    218|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|    218|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|    218|    do { \
  |  |  |  |  604|    218|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|    218|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|    218|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|    218|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 218]
  |  |  |  |  ------------------
  |  |  |  |  608|    218|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|    218|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 218]
  |  |  ------------------
  ------------------
  141|       |
  142|    218|    IGRAPH_CHECK(igraph_vector_init(&label_counters, no_of_communities));
  ------------------
  |  |  656|    218|    do { \
  |  |  657|    218|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|    218|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|    218|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 218]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  143|    218|    IGRAPH_FINALLY(igraph_vector_destroy, &label_counters);
  ------------------
  |  |  603|    218|    do { \
  |  |  604|    218|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|    218|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|    218|         * incorrect destructor function with the pointer */ \
  |  |  607|    218|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 218]
  |  |  ------------------
  |  |  608|    218|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|    218|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 218]
  |  |  ------------------
  ------------------
  144|       |
  145|       |    /* running is the convergence boolean variable */
  146|    218|    running = true;
  147|    904|    while (running) {
  ------------------
  |  Branch (147:12): [True: 686, False: 218]
  ------------------
  148|       |        /* Declarations of variables used inside main loop */
  149|    686|        igraph_int_t v1, size, rand_idx;
  150|    686|        igraph_real_t max_count, label_counter_diff;
  151|    686|        igraph_vector_int_t *neis;
  152|    686|        igraph_bool_t same_label_in_dominant;
  153|       |
  154|    686|        running = false;
  155|       |
  156|       |        /* Shuffle the node ordering vector */
  157|    686|        igraph_vector_int_shuffle(&node_order);
  158|       |        /* In the prescribed order, loop over the vertices and reassign labels */
  159|  20.9k|        for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (159:21): [True: 20.2k, False: 686]
  ------------------
  160|       |            /* Clear dominant_labels and nonzero_labels vectors */
  161|  20.2k|            igraph_vector_int_clear(&dominant_labels);
  162|  20.2k|            igraph_vector_null(&label_counters);
  163|       |
  164|       |            /* Obtain actual node index */
  165|  20.2k|            v1 = VECTOR(node_order)[i];
  ------------------
  |  |   60|  20.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  166|       |            /* Take into account same label in updating rule */
  167|  20.2k|            kv1 = VECTOR(*membership)[v1];
  ------------------
  |  |   60|  20.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  168|  20.2k|            max_count = 0.0;
  169|  20.2k|            if (kv1 != 0) {
  ------------------
  |  Branch (169:17): [True: 14.2k, False: 6.02k]
  ------------------
  170|  14.2k|                VECTOR(label_counters)[kv1 - 1] += VECTOR(density)[kv1 - 1];
  ------------------
  |  |   60|  14.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(label_counters)[kv1 - 1] += VECTOR(density)[kv1 - 1];
  ------------------
  |  |   60|  14.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  171|       |                /* Set up max_count */
  172|  14.2k|                max_count = VECTOR(density)[kv1 - 1];
  ------------------
  |  |   60|  14.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  173|       |                /* Initialize dominant_labels */
  174|  14.2k|                IGRAPH_CHECK(igraph_vector_int_resize(&dominant_labels, 1));
  ------------------
  |  |  656|  14.2k|    do { \
  |  |  657|  14.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  14.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  14.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.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|  14.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 14.2k]
  |  |  ------------------
  ------------------
  175|  14.2k|                VECTOR(dominant_labels)[0] = kv1;
  ------------------
  |  |   60|  14.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  176|  14.2k|            }
  177|       |
  178|       |            /* Count the weights corresponding to different labels */
  179|  20.2k|            neis = igraph_adjlist_get(&al, v1);
  ------------------
  |  |   73|  20.2k|#define igraph_adjlist_get(al,no) (&(al)->adjs[(igraph_int_t)(no)])
  ------------------
  180|  20.2k|            size = igraph_vector_int_size(neis);
  181|  72.4k|            for (j = 0; j < size; j++) {
  ------------------
  |  Branch (181:25): [True: 52.1k, False: 20.2k]
  ------------------
  182|  52.1k|                k = VECTOR(*membership)[VECTOR(*neis)[j]];
  ------------------
  |  |   60|  52.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              k = VECTOR(*membership)[VECTOR(*neis)[j]];
  ------------------
  |  |   60|  52.1k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  183|       |                /* skip if it has no label yet */
  184|  52.1k|                if (k == 0) {
  ------------------
  |  Branch (184:21): [True: 10.4k, False: 41.7k]
  ------------------
  185|  10.4k|                    continue;
  186|  10.4k|                }
  187|       |                /* Update label counter and evaluate diff against max_count*/
  188|  41.7k|                VECTOR(label_counters)[k - 1] += VECTOR(density)[k - 1];
  ------------------
  |  |   60|  41.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(label_counters)[k - 1] += VECTOR(density)[k - 1];
  ------------------
  |  |   60|  41.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  189|  41.7k|                label_counter_diff = VECTOR(label_counters)[k - 1] - max_count;
  ------------------
  |  |   60|  41.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  190|       |                /* Check if this label must be included in dominant_labels vector */
  191|  41.7k|                if (label_counter_diff > 0.0001) {
  ------------------
  |  Branch (191:21): [True: 28.9k, False: 12.7k]
  ------------------
  192|  28.9k|                    max_count = VECTOR(label_counters)[k - 1];
  ------------------
  |  |   60|  28.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  193|  28.9k|                    IGRAPH_CHECK(igraph_vector_int_resize(&dominant_labels, 1));
  ------------------
  |  |  656|  28.9k|    do { \
  |  |  657|  28.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  28.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  28.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 28.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|  28.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 28.9k]
  |  |  ------------------
  ------------------
  194|  28.9k|                    VECTOR(dominant_labels)[0] = k;
  ------------------
  |  |   60|  28.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  195|  28.9k|                } else if (-0.0001 < label_counter_diff && label_counter_diff < 0.0001) {
  ------------------
  |  Branch (195:28): [True: 2.62k, False: 10.1k]
  |  Branch (195:60): [True: 2.62k, False: 0]
  ------------------
  196|  2.62k|                    IGRAPH_CHECK(igraph_vector_int_push_back(&dominant_labels, k));
  ------------------
  |  |  656|  2.62k|    do { \
  |  |  657|  2.62k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  2.62k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  2.62k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.62k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 2.62k]
  |  |  ------------------
  ------------------
  197|  2.62k|                }
  198|  41.7k|            }
  199|       |
  200|  20.2k|            if (!igraph_vector_int_empty(&dominant_labels)) {
  ------------------
  |  Branch (200:17): [True: 17.3k, False: 2.91k]
  ------------------
  201|       |                /* Maintain same label if it exists in dominant_labels */
  202|  17.3k|                same_label_in_dominant = igraph_vector_int_contains(&dominant_labels, kv1);
  203|       |
  204|  17.3k|                if (!same_label_in_dominant) {
  ------------------
  |  Branch (204:21): [True: 3.97k, False: 13.3k]
  ------------------
  205|       |                    /* We need at least one more iteration */
  206|  3.97k|                    running = true;
  207|       |
  208|       |                    /* Select randomly from the dominant labels */
  209|  3.97k|                    rand_idx = RNG_INTEGER(0, igraph_vector_int_size(&dominant_labels) - 1);
  ------------------
  |  |  152|  3.97k|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
  210|  3.97k|                    k = VECTOR(dominant_labels)[rand_idx];
  ------------------
  |  |   60|  3.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  211|       |
  212|  3.97k|                    if (kv1 != 0) {
  ------------------
  |  Branch (212:25): [True: 860, False: 3.11k]
  ------------------
  213|       |                        /* Subtract 1 vertex from corresponding community in com_to_numvertices */
  214|    860|                        VECTOR(com_to_numvertices)[kv1 - 1] -= 1;
  ------------------
  |  |   60|    860|#define VECTOR(v) ((v).stor_begin)
  ------------------
  215|       |                        /* Re-calculate density for community kv1 */
  216|    860|                        VECTOR(density)[kv1 - 1] = max_density / VECTOR(com_to_numvertices)[kv1 - 1];
  ------------------
  |  |   60|    860|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                      VECTOR(density)[kv1 - 1] = max_density / VECTOR(com_to_numvertices)[kv1 - 1];
  ------------------
  |  |   60|    860|#define VECTOR(v) ((v).stor_begin)
  ------------------
  217|    860|                    }
  218|       |
  219|       |                    /* Update vertex new label */
  220|  3.97k|                    VECTOR(*membership)[v1] = k;
  ------------------
  |  |   60|  3.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  221|       |
  222|       |                    /* Add 1 vertex to corresponding new community in com_to_numvertices */
  223|  3.97k|                    VECTOR(com_to_numvertices)[k - 1] += 1;
  ------------------
  |  |   60|  3.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  224|       |                    /* Re-calculate density for new community k */
  225|  3.97k|                    VECTOR(density)[k - 1] = max_density / VECTOR(com_to_numvertices)[k - 1];
  ------------------
  |  |   60|  3.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                                  VECTOR(density)[k - 1] = max_density / VECTOR(com_to_numvertices)[k - 1];
  ------------------
  |  |   60|  3.97k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  226|  3.97k|                }
  227|  17.3k|            }
  228|  20.2k|        }
  229|    686|    }
  230|       |
  231|       |    /* Shift back the membership vector */
  232|       |    /* There must be no 0 labels in membership vector at this point */
  233|  4.13k|    for (i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (233:17): [True: 3.91k, False: 218]
  ------------------
  234|  3.91k|        VECTOR(*membership)[i] -= 1;
  ------------------
  |  |   60|  3.91k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  235|  3.91k|        IGRAPH_ASSERT(VECTOR(*membership)[i] >= 0); /* all vertices must have a community assigned */
  ------------------
  |  |  924|  3.91k|    do { \
  |  |  925|  3.91k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.91k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.91k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.91k]
  |  |  ------------------
  ------------------
  236|  3.91k|    }
  237|       |
  238|    218|    igraph_adjlist_destroy(&al);
  239|    218|    igraph_vector_int_destroy(&node_order);
  240|    218|    igraph_vector_destroy(&density);
  241|    218|    igraph_vector_int_destroy(&com_to_numvertices);
  242|    218|    igraph_vector_destroy(&label_counters);
  243|    218|    igraph_vector_int_destroy(&dominant_labels);
  244|    218|    IGRAPH_FINALLY_CLEAN(6);
  245|       |
  246|    218|    return IGRAPH_SUCCESS;
  247|    218|}

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

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

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

igraph_modularity:
  121|  54.9k|                      igraph_real_t *modularity) {
  122|       |
  123|  54.9k|    const igraph_int_t vcount = igraph_vcount(graph);
  124|  54.9k|    const igraph_int_t ecount = igraph_ecount(graph);
  125|  54.9k|    const igraph_vector_int_t *p_membership;
  126|  54.9k|    igraph_vector_int_t i_membership;
  127|  54.9k|    igraph_bool_t using_i_membership = false;
  128|  54.9k|    igraph_vector_t k_out, k_in;
  129|  54.9k|    igraph_int_t min_cluster_id, max_cluster_id, no_of_partitions;
  130|  54.9k|    igraph_real_t e; /* count/fraction of edges/weights within partitions */
  131|  54.9k|    igraph_real_t m; /* edge count / weight sum */
  132|  54.9k|    igraph_int_t c1, c2;
  133|       |    /* Only consider the graph as directed if it actually is directed */
  134|  54.9k|    igraph_bool_t use_directed = directed && igraph_is_directed(graph);
  ------------------
  |  Branch (134:34): [True: 51.4k, False: 3.46k]
  |  Branch (134:46): [True: 51.4k, False: 0]
  ------------------
  135|  54.9k|    igraph_real_t directed_multiplier = (use_directed ? 1 : 2);
  ------------------
  |  Branch (135:42): [True: 51.4k, False: 3.46k]
  ------------------
  136|       |
  137|  54.9k|    if (igraph_vector_int_size(membership) != vcount) {
  ------------------
  |  Branch (137:9): [True: 0, False: 54.9k]
  ------------------
  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|  54.9k|    if (resolution < 0.0) {
  ------------------
  |  Branch (141:9): [True: 0, False: 54.9k]
  ------------------
  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|  54.9k|    if (ecount == 0) {
  ------------------
  |  Branch (145:9): [True: 168, False: 54.7k]
  ------------------
  146|       |        /* Special case: the modularity of graphs with no edges is not
  147|       |         * well-defined */
  148|    168|        *modularity = IGRAPH_NAN;
  ------------------
  |  |  138|    168|#define IGRAPH_NAN ((double)NAN)
  ------------------
  149|    168|        return IGRAPH_SUCCESS;
  150|    168|    }
  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|  54.7k|    igraph_vector_int_minmax(membership, &min_cluster_id, &max_cluster_id);
  158|  54.7k|    if (min_cluster_id < 0 || max_cluster_id >= vcount) {
  ------------------
  |  Branch (158:9): [True: 0, False: 54.7k]
  |  Branch (158:31): [True: 44.8k, False: 9.97k]
  ------------------
  159|  44.8k|        IGRAPH_CHECK(igraph_vector_int_init_copy(&i_membership, membership));
  ------------------
  |  |  656|  44.8k|    do { \
  |  |  657|  44.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  44.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  44.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 44.8k]
  |  |  ------------------
  ------------------
  160|  44.8k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &i_membership);
  ------------------
  |  |  603|  44.8k|    do { \
  |  |  604|  44.8k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  44.8k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  44.8k|         * incorrect destructor function with the pointer */ \
  |  |  607|  44.8k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 44.8k]
  |  |  ------------------
  |  |  608|  44.8k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  44.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 44.8k]
  |  |  ------------------
  ------------------
  161|  44.8k|        IGRAPH_CHECK(igraph_i_reindex_membership_large(&i_membership, NULL, &no_of_partitions));
  ------------------
  |  |  656|  44.8k|    do { \
  |  |  657|  44.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  44.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  44.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 44.8k]
  |  |  ------------------
  ------------------
  162|  44.8k|        p_membership = &i_membership;
  163|  44.8k|        using_i_membership = true;
  164|  44.8k|    } else {
  165|  9.97k|        no_of_partitions = max_cluster_id + 1;
  166|  9.97k|        p_membership = membership;
  167|  9.97k|    }
  168|       |
  169|  54.7k|    IGRAPH_VECTOR_INIT_FINALLY(&k_out, no_of_partitions);
  ------------------
  |  |  104|  54.7k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  54.7k|    do { \
  |  |  |  |  657|  54.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  54.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  54.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 54.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|  54.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 54.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  54.7k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  54.7k|    do { \
  |  |  |  |  604|  54.7k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  54.7k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  54.7k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  54.7k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 54.7k]
  |  |  |  |  ------------------
  |  |  |  |  608|  54.7k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  54.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 54.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 54.7k]
  |  |  ------------------
  ------------------
  170|  54.7k|    IGRAPH_VECTOR_INIT_FINALLY(&k_in, no_of_partitions);
  ------------------
  |  |  104|  54.7k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  54.7k|    do { \
  |  |  |  |  657|  54.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  54.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  54.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 54.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|  54.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 54.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  54.7k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  54.7k|    do { \
  |  |  |  |  604|  54.7k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  54.7k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  54.7k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  54.7k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 54.7k]
  |  |  |  |  ------------------
  |  |  |  |  608|  54.7k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  54.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 54.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 54.7k]
  |  |  ------------------
  ------------------
  171|       |
  172|  54.7k|    e = 0.0;
  173|  54.7k|    if (weights) {
  ------------------
  |  Branch (173:9): [True: 0, False: 54.7k]
  ------------------
  174|      0|        if (igraph_vector_size(weights) != ecount)
  ------------------
  |  Branch (174:13): [True: 0, False: 0]
  ------------------
  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|      0|                         IGRAPH_EINVAL);
  177|      0|        m = 0.0;
  178|      0|        for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (178:34): [True: 0, False: 0]
  ------------------
  179|      0|            igraph_real_t w = VECTOR(*weights)[i];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  180|      0|            if (w < 0) {
  ------------------
  |  Branch (180:17): [True: 0, False: 0]
  ------------------
  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|      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)
  |  |  ------------------
  ------------------
  184|      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)
  |  |  ------------------
  ------------------
  185|      0|            if (c1 == c2) {
  ------------------
  |  Branch (185:17): [True: 0, False: 0]
  ------------------
  186|      0|                e += directed_multiplier * w;
  187|      0|            }
  188|      0|            VECTOR(k_out)[c1] += w;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  189|      0|            VECTOR(k_in)[c2]  += w;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  190|      0|            m += w;
  191|      0|        }
  192|  54.7k|    } else {
  193|  54.7k|        m = ecount;
  194|  2.83M|        for (igraph_int_t i = 0; i < ecount; i++) {
  ------------------
  |  Branch (194:34): [True: 2.78M, False: 54.7k]
  ------------------
  195|  2.78M|            c1 = VECTOR(*p_membership)[ IGRAPH_FROM(graph, i) ];
  ------------------
  |  |   60|  2.78M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          c1 = VECTOR(*p_membership)[ IGRAPH_FROM(graph, i) ];
  ------------------
  |  |  115|  2.78M|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  2.78M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  196|  2.78M|            c2 = VECTOR(*p_membership)[ IGRAPH_TO(graph, i) ];
  ------------------
  |  |   60|  2.78M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          c2 = VECTOR(*p_membership)[ IGRAPH_TO(graph, i) ];
  ------------------
  |  |  128|  2.78M|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|  2.78M|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  197|  2.78M|            if (c1 == c2) {
  ------------------
  |  Branch (197:17): [True: 1.40M, False: 1.37M]
  ------------------
  198|  1.40M|                e += directed_multiplier;
  199|  1.40M|            }
  200|  2.78M|            VECTOR(k_out)[c1] += 1;
  ------------------
  |  |   60|  2.78M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  201|  2.78M|            VECTOR(k_in)[c2]  += 1;
  ------------------
  |  |   60|  2.78M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  202|  2.78M|        }
  203|  54.7k|    }
  204|       |
  205|  54.7k|    if (!use_directed) {
  ------------------
  |  Branch (205:9): [True: 3.34k, False: 51.4k]
  ------------------
  206|       |        /* Graph is undirected, simply add vectors.
  207|       |         * Vectors are the same size, calls below can't fail. */
  208|  3.34k|        igraph_vector_add(&k_out, &k_in);
  209|  3.34k|        igraph_vector_update(&k_in, &k_out);
  210|  3.34k|    }
  211|       |
  212|       |    /* Divide all vectors by total weight. */
  213|  54.7k|    igraph_vector_scale(&k_out, 1.0/( directed_multiplier * m ) );
  214|  54.7k|    igraph_vector_scale(&k_in, 1.0/( directed_multiplier * m ) );
  215|  54.7k|    e /= directed_multiplier * m;
  216|       |
  217|  54.7k|    if (m > 0) {
  ------------------
  |  Branch (217:9): [True: 54.7k, False: 0]
  ------------------
  218|  54.7k|        *modularity = e;
  219|  2.39M|        for (igraph_int_t i = 0; i < no_of_partitions; i++) {
  ------------------
  |  Branch (219:34): [True: 2.33M, False: 54.7k]
  ------------------
  220|  2.33M|            *modularity -= resolution * VECTOR(k_out)[i] * VECTOR(k_in)[i];
  ------------------
  |  |   60|  2.33M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          *modularity -= resolution * VECTOR(k_out)[i] * VECTOR(k_in)[i];
  ------------------
  |  |   60|  2.33M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  221|  2.33M|        }
  222|  54.7k|    } else {
  223|      0|        *modularity = IGRAPH_NAN;
  ------------------
  |  |  138|      0|#define IGRAPH_NAN ((double)NAN)
  ------------------
  224|      0|    }
  225|       |
  226|  54.7k|    igraph_vector_destroy(&k_out);
  227|  54.7k|    igraph_vector_destroy(&k_in);
  228|  54.7k|    IGRAPH_FINALLY_CLEAN(2);
  229|       |
  230|  54.7k|    if (using_i_membership) {
  ------------------
  |  Branch (230:9): [True: 44.8k, False: 9.97k]
  ------------------
  231|  44.8k|        igraph_vector_int_destroy(&i_membership);
  232|  44.8k|        IGRAPH_FINALLY_CLEAN(1);
  233|  44.8k|    }
  234|       |
  235|  54.7k|    return IGRAPH_SUCCESS;
  236|  54.7k|}
igraph_modularity_matrix:
  327|  3.38k|                             igraph_bool_t directed) {
  328|       |
  329|  3.38k|    const igraph_int_t no_of_nodes = igraph_vcount(graph);
  330|  3.38k|    const igraph_int_t no_of_edges = igraph_ecount(graph);
  331|  3.38k|    const igraph_real_t sw = weights ? igraph_vector_sum(weights) : no_of_edges;
  ------------------
  |  Branch (331:30): [True: 0, False: 3.38k]
  ------------------
  332|  3.38k|    igraph_vector_t deg, in_deg, out_deg;
  333|  3.38k|    igraph_real_t scaling_factor;
  334|       |
  335|  3.38k|    if (weights && igraph_vector_size(weights) != no_of_edges) {
  ------------------
  |  Branch (335:9): [True: 0, False: 3.38k]
  |  Branch (335:20): [True: 0, False: 0]
  ------------------
  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.38k|    if (resolution < 0.0) {
  ------------------
  |  Branch (339:9): [True: 0, False: 3.38k]
  ------------------
  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.38k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (343:9): [True: 0, False: 3.38k]
  ------------------
  344|      0|        directed = false;
  345|      0|    }
  346|  3.38k|    IGRAPH_CHECK(igraph_i_modularity_matrix_get_adjacency(graph, modmat, weights, directed));
  ------------------
  |  |  656|  3.38k|    do { \
  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  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.38k|    if (directed) {
  ------------------
  |  Branch (357:9): [True: 3.38k, False: 0]
  ------------------
  358|  3.38k|        IGRAPH_VECTOR_INIT_FINALLY(&in_deg, no_of_nodes);
  ------------------
  |  |  104|  3.38k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.38k|    do { \
  |  |  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.38k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.38k|    do { \
  |  |  |  |  604|  3.38k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.38k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.38k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.38k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.38k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  359|  3.38k|        IGRAPH_VECTOR_INIT_FINALLY(&out_deg, no_of_nodes);
  ------------------
  |  |  104|  3.38k|    do { IGRAPH_CHECK(igraph_vector_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.38k|    do { \
  |  |  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  105|  3.38k|        IGRAPH_FINALLY(igraph_vector_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.38k|    do { \
  |  |  |  |  604|  3.38k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.38k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.38k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.38k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.38k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:60): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  360|       |
  361|  3.38k|        IGRAPH_CHECK(igraph_strength(graph, &in_deg, igraph_vss_all(), IGRAPH_IN,
  ------------------
  |  |  656|  3.38k|    do { \
  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  362|  3.38k|                                     IGRAPH_LOOPS, weights));
  363|  3.38k|        IGRAPH_CHECK(igraph_strength(graph, &out_deg, igraph_vss_all(), IGRAPH_OUT,
  ------------------
  |  |  656|  3.38k|    do { \
  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  364|  3.38k|                                     IGRAPH_LOOPS, weights));
  365|       |
  366|  3.38k|        scaling_factor = resolution / sw;
  367|       |
  368|   163k|        for (igraph_int_t j = 0; j < no_of_nodes; j++) {
  ------------------
  |  Branch (368:34): [True: 160k, False: 3.38k]
  ------------------
  369|  9.12M|            for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (369:38): [True: 8.96M, False: 160k]
  ------------------
  370|  8.96M|                MATRIX(*modmat, i, j) -= VECTOR(out_deg)[i] * VECTOR(in_deg)[j] * scaling_factor;
  ------------------
  |  |   83|  8.96M|#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.96M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              MATRIX(*modmat, i, j) -= VECTOR(out_deg)[i] * VECTOR(in_deg)[j] * scaling_factor;
  ------------------
  |  |   60|  8.96M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  371|  8.96M|            }
  372|   160k|        }
  373|  3.38k|        igraph_vector_destroy(&in_deg);
  374|  3.38k|        igraph_vector_destroy(&out_deg);
  375|  3.38k|        IGRAPH_FINALLY_CLEAN(2);
  376|  3.38k|    } 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.38k|    return IGRAPH_SUCCESS;
  394|  3.38k|}
modularity.c:igraph_i_modularity_matrix_get_adjacency:
  240|  3.38k|           const igraph_vector_t *weights, igraph_bool_t directed) {
  241|       |
  242|       |    /* Specifically used to handle weights and/or ignore direction */
  243|  3.38k|    igraph_eit_t edgeit;
  244|  3.38k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  245|  3.38k|    igraph_int_t from, to;
  246|       |
  247|  3.38k|    IGRAPH_CHECK(igraph_matrix_resize(res, no_of_nodes, no_of_nodes));
  ------------------
  |  |  656|  3.38k|    do { \
  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  248|  3.38k|    igraph_matrix_null(res);
  249|  3.38k|    IGRAPH_CHECK(igraph_eit_create(graph, igraph_ess_all(IGRAPH_EDGEORDER_ID), &edgeit));
  ------------------
  |  |  656|  3.38k|    do { \
  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  250|  3.38k|    IGRAPH_FINALLY(igraph_eit_destroy, &edgeit);
  ------------------
  |  |  603|  3.38k|    do { \
  |  |  604|  3.38k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.38k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.38k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.38k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.38k]
  |  |  ------------------
  |  |  608|  3.38k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  251|       |
  252|  3.38k|    if (weights) {
  ------------------
  |  Branch (252:9): [True: 0, False: 3.38k]
  ------------------
  253|      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 (253:16): [True: 0, False: 0]
  ------------------
  254|      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)
  |  |  ------------------
  ------------------
  255|      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)
  |  |  ------------------
  ------------------
  256|      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)
  |  |  ------------------
  ------------------
  257|      0|            MATRIX(*res, from, to) += VECTOR(*weights)[edge];
  ------------------
  |  |   83|      0|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
                          MATRIX(*res, from, to) += VECTOR(*weights)[edge];
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  258|      0|            if (!directed) {
  ------------------
  |  Branch (258:17): [True: 0, False: 0]
  ------------------
  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|      0|        }
  262|  3.38k|    } else {
  263|   105k|        for (; !IGRAPH_EIT_END(edgeit); IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  371|   105k|#define IGRAPH_EIT_END(eit)   ((eit).pos >= (eit).end)
  ------------------
                      for (; !IGRAPH_EIT_END(edgeit); IGRAPH_EIT_NEXT(edgeit)) {
  ------------------
  |  |  359|   101k|#define IGRAPH_EIT_NEXT(eit) (++((eit).pos))
  ------------------
  |  Branch (263:16): [True: 101k, False: 3.38k]
  ------------------
  264|   101k|            igraph_int_t edge = IGRAPH_EIT_GET(edgeit);
  ------------------
  |  |  405|   101k|    (igraph_int_t)((((eit).type == IGRAPH_EIT_RANGE) ? (eit).pos : \
  |  |  ------------------
  |  |  |  Branch (405:21): [True: 101k, False: 0]
  |  |  ------------------
  |  |  406|   101k|                        VECTOR(*(eit).vec)[(eit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  265|   101k|            from = IGRAPH_FROM(graph, edge);
  ------------------
  |  |  115|   101k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  266|   101k|            to = IGRAPH_TO(graph, edge);
  ------------------
  |  |  128|   101k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  267|   101k|            MATRIX(*res, from, to) += 1;
  ------------------
  |  |   83|   101k|#define MATRIX(m,i,j) ((m).data.stor_begin[(m).nrow*(j)+(i)])
  ------------------
  268|   101k|            if (!directed) {
  ------------------
  |  Branch (268:17): [True: 0, False: 101k]
  ------------------
  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|   101k|        }
  272|  3.38k|    }
  273|       |
  274|  3.38k|    igraph_eit_destroy(&edgeit);
  275|  3.38k|    IGRAPH_FINALLY_CLEAN(1);
  276|  3.38k|    return IGRAPH_SUCCESS;
  277|  3.38k|}

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

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

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

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

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

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.59k|                        igraph_connectedness_t mode) {
  434|       |
  435|  3.59k|    igraph_cached_property_t prop;
  436|  3.59k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  437|  3.59k|    igraph_int_t no;
  438|       |
  439|  3.59k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (439:9): [True: 3.59k, False: 0]
  ------------------
  440|  3.59k|        mode = IGRAPH_WEAK;
  441|  3.59k|    }
  442|       |
  443|  3.59k|    switch (mode) {
  444|  3.59k|        case IGRAPH_WEAK:
  ------------------
  |  Branch (444:9): [True: 3.59k, False: 0]
  ------------------
  445|  3.59k|            prop = IGRAPH_PROP_IS_WEAKLY_CONNECTED;
  446|  3.59k|            break;
  447|       |
  448|      0|        case IGRAPH_STRONG:
  ------------------
  |  Branch (448:9): [True: 0, False: 3.59k]
  ------------------
  449|      0|            prop = IGRAPH_PROP_IS_STRONGLY_CONNECTED;
  450|      0|            break;
  451|       |
  452|      0|        default:
  ------------------
  |  Branch (452:9): [True: 0, False: 3.59k]
  ------------------
  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.59k|    }
  455|       |
  456|  3.59k|    IGRAPH_RETURN_IF_CACHED_BOOL(graph, prop, res);
  ------------------
  |  |   97|  3.59k|    do { \
  |  |   98|  3.59k|        if (igraph_i_property_cache_has((graphptr), (prop))) { \
  |  |  ------------------
  |  |  |  Branch (98:13): [True: 3.59k, False: 0]
  |  |  ------------------
  |  |   99|  3.59k|            *(resptr) = igraph_i_property_cache_get_bool((graphptr), (prop)); \
  |  |  100|  3.59k|            return IGRAPH_SUCCESS; \
  |  |  101|  3.59k|        } \
  |  |  102|  3.59k|    } 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.76k, False: 6.75k]
  ------------------
  108|  6.76k|        IGRAPH_CHECK(igraph_vector_int_resize(membership, no_of_nodes));
  ------------------
  |  |  656|  6.76k|    do { \
  |  |  657|  6.76k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.76k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  109|  6.76k|    }
  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.75k, False: 6.76k]
  ------------------
  116|  6.75k|        igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_IS_WEAKLY_CONNECTED)) {
  ------------------
  |  Branch (116:9): [True: 460, False: 6.29k]
  ------------------
  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|    460|        if (membership) {
  ------------------
  |  Branch (121:13): [True: 230, False: 230]
  ------------------
  122|       |            /* All vertices are members of the same component,
  123|       |             * component number 0. */
  124|    230|            igraph_vector_int_null(membership);
  125|    230|        }
  126|    460|        if (csize) {
  ------------------
  |  Branch (126:13): [True: 0, False: 460]
  ------------------
  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|    460|        if (no) {
  ------------------
  |  Branch (130:13): [True: 230, False: 230]
  ------------------
  131|       |            /* There is one component. */
  132|    230|            *no = 1;
  133|    230|        }
  134|    460|        return IGRAPH_SUCCESS;
  135|    460|    }
  136|       |
  137|  13.0k|    IGRAPH_BITSET_INIT_FINALLY(&already_added, no_of_nodes);
  ------------------
  |  |  259|  13.0k|#define IGRAPH_BITSET_INIT_FINALLY(bitset, size) \
  |  |  260|  13.0k|do { IGRAPH_CHECK(igraph_bitset_init(bitset, size)); \
  |  |  ------------------
  |  |  |  |  656|  13.0k|    do { \
  |  |  |  |  657|  13.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  13.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  13.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 13.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  13.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  261|  13.0k|     IGRAPH_FINALLY(igraph_bitset_destroy, bitset); } while (0)
  |  |  ------------------
  |  |  |  |  603|  13.0k|    do { \
  |  |  |  |  604|  13.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  13.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  13.0k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  13.0k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 13.0k]
  |  |  |  |  ------------------
  |  |  |  |  608|  13.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  13.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (261:62): [Folded, False: 13.0k]
  |  |  ------------------
  ------------------
  138|  13.0k|    IGRAPH_DQUEUE_INT_INIT_FINALLY(&q, no_of_nodes > 100000 ? 10000 : no_of_nodes / 10);
  ------------------
  |  |   61|  13.0k|    do { IGRAPH_CHECK(igraph_dqueue_int_init(q, capacity)); \
  |  |  ------------------
  |  |  |  |  656|  13.0k|    do { \
  |  |  |  |  657|  26.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (657:40): [True: 0, False: 13.0k]
  |  |  |  |  ------------------
  |  |  |  |  658|  13.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  13.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 13.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  13.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   62|  13.0k|        IGRAPH_FINALLY(igraph_dqueue_int_destroy, q); } while (0)
  |  |  ------------------
  |  |  |  |  603|  13.0k|    do { \
  |  |  |  |  604|  13.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  13.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  13.0k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  13.0k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 13.0k]
  |  |  |  |  ------------------
  |  |  |  |  608|  13.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  13.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (62:64): [Folded, False: 13.0k]
  |  |  ------------------
  ------------------
  139|  13.0k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&neis, 0);
  ------------------
  |  |  119|  13.0k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  13.0k|    do { \
  |  |  |  |  657|  13.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  13.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  13.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 13.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  13.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  13.0k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  13.0k|    do { \
  |  |  |  |  604|  13.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  13.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  13.0k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  13.0k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 13.0k]
  |  |  |  |  ------------------
  |  |  |  |  608|  13.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  13.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 13.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 13.0k]
  |  |  ------------------
  ------------------
  140|       |
  141|       |    /* The algorithm */
  142|       |
  143|  13.0k|    no_of_components = 0;
  144|   646k|    for (igraph_int_t first_node = 0; first_node < no_of_nodes; ++first_node) {
  ------------------
  |  Branch (144:39): [True: 633k, False: 13.0k]
  ------------------
  145|   633k|        igraph_int_t act_component_size;
  146|       |
  147|   633k|        if (IGRAPH_BIT_TEST(already_added, first_node)) {
  ------------------
  |  |  142|   633k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   633k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   633k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   633k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   633k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   633k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (142:36): [True: 171k, False: 461k]
  |  |  ------------------
  ------------------
  148|   171k|            continue;
  149|   171k|        }
  150|   461k|        IGRAPH_ALLOW_INTERRUPTION();
  ------------------
  |  |   46|   461k|    do { \
  |  |   47|   461k|        if (igraph_i_interruption_handler) { \
  |  |  ------------------
  |  |  |  Branch (47:13): [True: 0, False: 461k]
  |  |  ------------------
  |  |   48|      0|            if (igraph_allow_interruption()) { \
  |  |  ------------------
  |  |  |  Branch (48:17): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|                return IGRAPH_INTERRUPTED; \
  |  |   50|      0|            } \
  |  |   51|      0|        } \
  |  |   52|   461k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (52:14): [Folded, False: 461k]
  |  |  ------------------
  ------------------
  151|       |
  152|   461k|        IGRAPH_BIT_SET(already_added, first_node);
  ------------------
  |  |  103|   461k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   461k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   461k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   461k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   461k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   461k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|   461k|        act_component_size = 1;
  154|   461k|        if (membership) {
  ------------------
  |  Branch (154:13): [True: 230k, False: 230k]
  ------------------
  155|   230k|            VECTOR(*membership)[first_node] = no_of_components;
  ------------------
  |  |   60|   230k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  156|   230k|        }
  157|   461k|        IGRAPH_CHECK(igraph_dqueue_int_push(&q, first_node));
  ------------------
  |  |  656|   461k|    do { \
  |  |  657|   461k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   461k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   461k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 461k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   461k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 461k]
  |  |  ------------------
  ------------------
  158|       |
  159|  1.09M|        while ( !igraph_dqueue_int_empty(&q) ) {
  ------------------
  |  Branch (159:17): [True: 633k, False: 461k]
  ------------------
  160|   633k|            igraph_int_t act_node = igraph_dqueue_int_pop(&q);
  161|   633k|            IGRAPH_CHECK(igraph_neighbors(
  ------------------
  |  |  656|   633k|    do { \
  |  |  657|   633k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   633k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   633k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 633k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   633k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 633k]
  |  |  ------------------
  ------------------
  162|   633k|                graph, &neis, act_node, IGRAPH_ALL, IGRAPH_NO_LOOPS, IGRAPH_MULTIPLE
  163|   633k|            ));
  164|   633k|            igraph_int_t nei_count = igraph_vector_int_size(&neis);
  165|  1.20M|            for (igraph_int_t i = 0; i < nei_count; i++) {
  ------------------
  |  Branch (165:38): [True: 567k, False: 633k]
  ------------------
  166|   567k|                igraph_int_t neighbor = VECTOR(neis)[i];
  ------------------
  |  |   60|   567k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  167|   567k|                if (IGRAPH_BIT_TEST(already_added, neighbor)) {
  ------------------
  |  |  142|   567k|#define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   567k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   567k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   567k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_TEST(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] & IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   567k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   567k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (142:36): [True: 395k, False: 171k]
  |  |  ------------------
  ------------------
  168|   395k|                    continue;
  169|   395k|                }
  170|   171k|                IGRAPH_CHECK(igraph_dqueue_int_push(&q, neighbor));
  ------------------
  |  |  656|   171k|    do { \
  |  |  657|   171k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   171k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   171k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 171k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   171k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 171k]
  |  |  ------------------
  ------------------
  171|   171k|                IGRAPH_BIT_SET(already_added, neighbor);
  ------------------
  |  |  103|   171k|#define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   60|   171k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   85|   171k|#define IGRAPH_BIT_SLOT(i) ((i) / IGRAPH_INTEGER_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   171k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IGRAPH_BIT_SET(bitset, i) (VECTOR((bitset))[IGRAPH_BIT_SLOT(i)] |= IGRAPH_BIT_MASK(i))
  |  |  ------------------
  |  |  |  |   66|   171k|#define IGRAPH_BIT_MASK(i) ((igraph_uint_t)(1) << ((i) % IGRAPH_INTEGER_SIZE))
  |  |  |  |  ------------------
  |  |  |  |  |  |   32|   171k|#define IGRAPH_INTEGER_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|   171k|                act_component_size++;
  173|   171k|                if (membership) {
  ------------------
  |  Branch (173:21): [True: 85.9k, False: 85.9k]
  ------------------
  174|  85.9k|                    VECTOR(*membership)[neighbor] = no_of_components;
  ------------------
  |  |   60|  85.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  175|  85.9k|                }
  176|   171k|            }
  177|   633k|        }
  178|       |
  179|   461k|        no_of_components++;
  180|   461k|        if (csize) {
  ------------------
  |  Branch (180:13): [True: 0, False: 461k]
  ------------------
  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|   461k|    }
  184|       |
  185|       |    /* Cleaning up */
  186|       |
  187|  13.0k|    if (no) {
  ------------------
  |  Branch (187:9): [True: 6.52k, False: 6.53k]
  ------------------
  188|  6.52k|        *no = no_of_components;
  189|  6.52k|    }
  190|       |
  191|       |    /* Clean up */
  192|  13.0k|    igraph_bitset_destroy(&already_added);
  193|  13.0k|    igraph_dqueue_int_destroy(&q);
  194|  13.0k|    igraph_vector_int_destroy(&neis);
  195|  13.0k|    IGRAPH_FINALLY_CLEAN(3);
  196|       |
  197|       |    /* Update cache */
  198|  13.0k|    igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_IS_WEAKLY_CONNECTED, no_of_components == 1);
  199|       |
  200|  13.0k|    return IGRAPH_SUCCESS;
  201|  13.0k|}

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

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

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

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

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

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

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

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

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

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

igraph_vector_int_list_init:
  109|  14.8k|igraph_error_t FUNCTION(init)(TYPE *v, igraph_int_t size) {
  110|  14.8k|    igraph_int_t alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (110:31): [True: 14.8k, False: 4]
  ------------------
  111|  14.8k|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|  14.8k|    do { \
  |  |  925|  14.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  14.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  14.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 14.8k]
  |  |  ------------------
  ------------------
  112|  14.8k|    v->stor_begin = IGRAPH_CALLOC(alloc_size, ITEM_TYPE);
  ------------------
  |  |   33|  14.8k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  29.6k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 14.8k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 14.8k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 14.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  14.8k|    if (v->stor_begin == 0) {
  ------------------
  |  Branch (113:9): [True: 0, False: 14.8k]
  ------------------
  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|  14.8k|    v->stor_end = v->stor_begin + alloc_size;
  117|  14.8k|    v->end = v->stor_begin + size;
  118|       |
  119|  14.8k|    IGRAPH_CHECK(INTERNAL_FUNCTION(init_slice)(v, v->stor_begin, v->end));
  ------------------
  |  |  656|  14.8k|    do { \
  |  |  657|  14.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  14.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  14.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.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|  14.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 14.8k]
  |  |  ------------------
  ------------------
  120|       |
  121|  14.8k|    return IGRAPH_SUCCESS;
  122|  14.8k|}
igraph_vector_int_list_destroy:
  176|  14.8k|void FUNCTION(destroy)(TYPE *v) {
  177|  14.8k|    IGRAPH_ASSERT(v != 0);
  ------------------
  |  |  924|  14.8k|    do { \
  |  |  925|  14.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  14.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  14.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 14.8k]
  |  |  ------------------
  ------------------
  178|       |
  179|  14.8k|    if (v->stor_begin != 0) {
  ------------------
  |  Branch (179:9): [True: 14.8k, False: 0]
  ------------------
  180|  14.8k|        FUNCTION(clear)(v);
  ------------------
  |  |  136|  14.8k|        #define FUNCTION(c) CONCAT4(igraph_vector,SHORT,list,c)
  |  |  ------------------
  |  |  |  |   24|  14.8k|#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  14.8k|#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  181|  14.8k|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  14.8k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  182|       |        v->stor_begin = NULL;
  183|  14.8k|    }
  184|  14.8k|}
igraph_vector_int_list_clear:
  357|  14.8k|void FUNCTION(clear)(TYPE *v) {
  358|  14.8k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  14.8k|    do { \
  |  |  925|  14.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  14.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  14.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 14.8k]
  |  |  ------------------
  ------------------
  359|  14.8k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  14.8k|    do { \
  |  |  925|  14.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  14.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  14.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 14.8k]
  |  |  ------------------
  ------------------
  360|  14.8k|    INTERNAL_FUNCTION(destroy_slice)(v, v->stor_begin, v->end);
  ------------------
  |  |  137|  14.8k|        #define INTERNAL_FUNCTION(c) CONCAT4(igraph_i_vector,SHORT,list,c)
  |  |  ------------------
  |  |  |  |   24|  14.8k|#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|  14.8k|#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|  14.8k|    v->end = v->stor_begin;
  362|  14.8k|}
igraph_vector_int_list_get_ptr:
  377|   239k|ITEM_TYPE *FUNCTION(get_ptr)(const TYPE *v, igraph_int_t pos) {
  378|   239k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   239k|    do { \
  |  |  925|   239k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   239k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 239k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   239k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 239k]
  |  |  ------------------
  ------------------
  379|   239k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   239k|    do { \
  |  |  925|   239k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   239k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 239k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   239k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 239k]
  |  |  ------------------
  ------------------
  380|   239k|    return v->stor_begin + pos;
  381|   239k|}
vector_list.c:igraph_i_vector_int_list_init_item:
 1051|   700k|static igraph_error_t INTERNAL_FUNCTION(init_item)(const TYPE *list, ITEM_TYPE *item) {
 1052|   700k|    IGRAPH_UNUSED(list);
  ------------------
  |  |   30|   700k|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
 1053|   700k|    return ITEM_FUNCTION(init)(item, 0);
  ------------------
  |  |   42|   700k|        #define ITEM_FUNCTION(f) CONCAT3(igraph_vector,SHORT,f)
  |  |  ------------------
  |  |  |  |   22|   700k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   700k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|   700k|}
vector_list.c:igraph_i_vector_int_list_destroy_item:
 1060|   700k|static void INTERNAL_FUNCTION(destroy_item)(ITEM_TYPE *item) {
 1061|   700k|    ITEM_FUNCTION(destroy)(item);
  ------------------
  |  |   42|   700k|        #define ITEM_FUNCTION(f) CONCAT3(igraph_vector,SHORT,f)
  |  |  ------------------
  |  |  |  |   22|   700k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   700k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1062|   700k|}
vector_list.c:igraph_i_vector_int_list_init_slice:
 1068|  14.8k|static igraph_error_t INTERNAL_FUNCTION(init_slice)(const TYPE *list, ITEM_TYPE *start, ITEM_TYPE *end) {
 1069|  14.8k|    ITEM_TYPE *current;
  ------------------
  |  |   31|  14.8k|    #define ITEM_TYPE BASE_VECTOR
  |  |  ------------------
  |  |  |  |   67|  14.8k|    #define BASE_VECTOR igraph_vector_int_t
  |  |  ------------------
  ------------------
 1070|  14.8k|    igraph_error_t retval;
 1071|       |
 1072|   715k|    for (current = start; current < end; current++) {
  ------------------
  |  Branch (1072:27): [True: 700k, False: 14.8k]
  ------------------
 1073|   700k|        retval = INTERNAL_FUNCTION(init_item)(list, current);
  ------------------
  |  |  137|   700k|        #define INTERNAL_FUNCTION(c) CONCAT4(igraph_i_vector,SHORT,list,c)
  |  |  ------------------
  |  |  |  |   24|   700k|#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|   700k|#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1074|   700k|        if (retval) {
  ------------------
  |  Branch (1074:13): [True: 0, False: 700k]
  ------------------
 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|   700k|    }
 1079|       |
 1080|  14.8k|    return IGRAPH_SUCCESS;
 1081|  14.8k|}
vector_list.c:igraph_i_vector_int_list_destroy_slice:
 1083|  14.8k|static void INTERNAL_FUNCTION(destroy_slice)(const TYPE *list, ITEM_TYPE *start, ITEM_TYPE *end) {
 1084|  14.8k|    IGRAPH_UNUSED(list);
  ------------------
  |  |   30|  14.8k|#define IGRAPH_UNUSED(x) (void)(x)
  ------------------
 1085|   715k|    for (; start < end; start++) {
  ------------------
  |  Branch (1085:12): [True: 700k, False: 14.8k]
  ------------------
 1086|   700k|        INTERNAL_FUNCTION(destroy_item)(start);
  ------------------
  |  |  137|   700k|        #define INTERNAL_FUNCTION(c) CONCAT4(igraph_i_vector,SHORT,list,c)
  |  |  ------------------
  |  |  |  |   24|   700k|#define CONCAT4(a,b,c,d) CONCAT4x(a,b,c,d)
  |  |  |  |  ------------------
  |  |  |  |  |  |   23|   700k|#define CONCAT4x(a,b,c,d) a ## _ ## b ## _ ## c ## _ ## d
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1087|   700k|    }
 1088|  14.8k|}

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

igraph_vector_init:
  134|   626k|igraph_error_t FUNCTION(igraph_vector, init)(TYPE(igraph_vector) *v, igraph_int_t size) {
  135|   626k|    igraph_int_t alloc_size;
  136|   626k|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|   626k|    do { \
  |  |  925|   626k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   626k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 626k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   626k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 626k]
  |  |  ------------------
  ------------------
  137|   626k|    alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (137:18): [True: 527k, False: 99.1k]
  ------------------
  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|   626k|    v->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|   626k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  1.25M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 626k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 626k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 626k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|   626k|    IGRAPH_CHECK_OOM(v->stor_begin, "Insufficient memory to initialize vector.");
  ------------------
  |  |  709|   626k|    do { \
  |  |  710|   626k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   626k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 626k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|   626k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 626k]
  |  |  ------------------
  ------------------
  145|   626k|    v->stor_end = v->stor_begin + alloc_size;
  146|   626k|    v->end = v->stor_begin + size;
  147|       |
  148|   626k|    return IGRAPH_SUCCESS;
  149|   626k|}
igraph_vector_destroy:
  408|   626k|void FUNCTION(igraph_vector, destroy)(TYPE(igraph_vector) *v) {
  409|   626k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   626k|    do { \
  |  |  925|   626k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   626k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 626k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   626k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 626k]
  |  |  ------------------
  ------------------
  410|       |    /* vector_init() will leave stor_begin set to NULL when it fails.
  411|       |     * We handle these cases gracefully. */
  412|   626k|    if (v->stor_begin != NULL) {
  ------------------
  |  Branch (412:9): [True: 626k, False: 0]
  ------------------
  413|   626k|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|   626k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  414|       |        v->stor_begin = NULL;
  415|   626k|    }
  416|   626k|}
igraph_vector_capacity:
  436|  97.7k|igraph_int_t FUNCTION(igraph_vector, capacity)(const TYPE(igraph_vector) *v) {
  437|  97.7k|    return v->stor_end - v->stor_begin;
  438|  97.7k|}
igraph_vector_reserve:
  468|  97.7k|igraph_error_t FUNCTION(igraph_vector, reserve)(TYPE(igraph_vector) *v, igraph_int_t capacity) {
  469|  97.7k|    igraph_int_t current_capacity;
  470|  97.7k|    BASE *tmp;
  ------------------
  |  |   29|  97.7k|    #define BASE igraph_real_t
  ------------------
  471|       |
  472|  97.7k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  97.7k|    do { \
  |  |  925|  97.7k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  97.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 97.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  97.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 97.7k]
  |  |  ------------------
  ------------------
  473|  97.7k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  97.7k|    do { \
  |  |  925|  97.7k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  97.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 97.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  97.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 97.7k]
  |  |  ------------------
  ------------------
  474|  97.7k|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|  97.7k|    do { \
  |  |  925|  97.7k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  97.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 97.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  97.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 97.7k]
  |  |  ------------------
  ------------------
  475|       |
  476|  97.7k|    current_capacity = FUNCTION(igraph_vector, capacity)(v);
  ------------------
  |  |  170|  97.7k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  97.7k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  97.7k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|       |
  478|  97.7k|    if (capacity <= current_capacity) {
  ------------------
  |  Branch (478:9): [True: 40.8k, False: 56.9k]
  ------------------
  479|  40.8k|        return IGRAPH_SUCCESS;
  480|  40.8k|    }
  481|       |
  482|  56.9k|    tmp = IGRAPH_REALLOC(v->stor_begin, capacity, BASE);
  ------------------
  |  |   35|  56.9k|#define IGRAPH_REALLOC(p,n,t) IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, realloc((void*)(p), sizeof(t) * ((n) > 0 ? (n) : 1)))
  |  |  ------------------
  |  |  |  |   31|   113k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 56.9k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 56.9k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 56.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|  56.9k|    IGRAPH_CHECK_OOM(tmp, "Cannot reserve space for vector.");
  ------------------
  |  |  709|  56.9k|    do { \
  |  |  710|  56.9k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  56.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 56.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|  56.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 56.9k]
  |  |  ------------------
  ------------------
  484|       |
  485|  56.9k|    v->end = tmp + (v->end - v->stor_begin);
  486|  56.9k|    v->stor_begin = tmp;
  487|  56.9k|    v->stor_end = v->stor_begin + capacity;
  488|       |
  489|  56.9k|    return IGRAPH_SUCCESS;
  490|  56.9k|}
igraph_vector_empty:
  503|   872k|igraph_bool_t FUNCTION(igraph_vector, empty)(const TYPE(igraph_vector) *v) {
  504|   872k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   872k|    do { \
  |  |  925|   872k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   872k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 872k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   872k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 872k]
  |  |  ------------------
  ------------------
  505|   872k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   872k|    do { \
  |  |  925|   872k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   872k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 872k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   872k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 872k]
  |  |  ------------------
  ------------------
  506|   872k|    return v->stor_begin == v->end;
  507|   872k|}
igraph_vector_size:
  522|  2.58M|igraph_int_t FUNCTION(igraph_vector, size)(const TYPE(igraph_vector) *v) {
  523|  2.58M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  2.58M|    do { \
  |  |  925|  2.58M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.58M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.58M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.58M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.58M]
  |  |  ------------------
  ------------------
  524|  2.58M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  2.58M|    do { \
  |  |  925|  2.58M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  2.58M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.58M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  2.58M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 2.58M]
  |  |  ------------------
  ------------------
  525|  2.58M|    return v->end - v->stor_begin;
  526|  2.58M|}
igraph_vector_clear:
  542|   908k|void FUNCTION(igraph_vector, clear)(TYPE(igraph_vector)* v) {
  543|   908k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   908k|    do { \
  |  |  925|   908k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   908k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 908k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   908k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 908k]
  |  |  ------------------
  ------------------
  544|   908k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   908k|    do { \
  |  |  925|   908k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   908k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 908k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   908k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 908k]
  |  |  ------------------
  ------------------
  545|   908k|    v->end = v->stor_begin;
  546|   908k|}
igraph_vector_push_back:
  573|  1.02M|igraph_error_t FUNCTION(igraph_vector, push_back)(TYPE(igraph_vector) *v, BASE e) {
  574|  1.02M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  1.02M|    do { \
  |  |  925|  1.02M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.02M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.02M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.02M]
  |  |  ------------------
  ------------------
  575|  1.02M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  1.02M|    do { \
  |  |  925|  1.02M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  1.02M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  1.02M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 1.02M]
  |  |  ------------------
  ------------------
  576|       |
  577|  1.02M|    if (v->stor_end == v->end) {
  ------------------
  |  Branch (577:9): [True: 26.1k, False: 997k]
  ------------------
  578|       |        /* full, allocate more storage */
  579|  26.1k|        igraph_int_t old_size = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  170|  26.1k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  26.1k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  26.1k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  580|  26.1k|        igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  26.1k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  26.1k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (580:33): [True: 26.1k, False: 0]
  ------------------
  581|  26.1k|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|  26.1k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (581:13): [True: 0, False: 26.1k]
  ------------------
  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|  26.1k|        if (new_size == 0) {
  ------------------
  |  Branch (584:13): [True: 0, False: 26.1k]
  ------------------
  585|      0|            new_size = 1;
  586|      0|        }
  587|  26.1k|        IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|  26.1k|    do { \
  |  |  657|  26.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  26.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  26.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 26.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|  26.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 26.1k]
  |  |  ------------------
  ------------------
  588|  26.1k|    }
  589|       |
  590|  1.02M|    *(v->end) = e;
  591|  1.02M|    v->end += 1;
  592|       |
  593|  1.02M|    return IGRAPH_SUCCESS;
  594|  1.02M|}
igraph_vector_null:
  725|   150k|void FUNCTION(igraph_vector, null)(TYPE(igraph_vector) *v) {
  726|   150k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   150k|    do { \
  |  |  925|   150k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   150k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   150k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 150k]
  |  |  ------------------
  ------------------
  727|   150k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   150k|    do { \
  |  |  925|   150k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   150k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   150k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 150k]
  |  |  ------------------
  ------------------
  728|   150k|    if (FUNCTION(igraph_vector, size)(v) > 0) {
  ------------------
  |  |  170|   150k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   150k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   150k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (728:9): [True: 150k, False: 90]
  ------------------
  729|   150k|        memset(v->stor_begin, 0, sizeof(BASE) * FUNCTION(igraph_vector, size)(v));
  ------------------
  |  |  170|   150k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   150k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   150k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|   150k|    }
  731|   150k|}
igraph_vector_fill:
  745|  20.4k|void FUNCTION(igraph_vector, fill)(TYPE(igraph_vector) *v, BASE e) {
  746|  20.4k|    BASE *ptr;
  ------------------
  |  |   29|  20.4k|    #define BASE igraph_real_t
  ------------------
  747|  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]
  |  |  ------------------
  ------------------
  748|  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]
  |  |  ------------------
  ------------------
  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|   724k|    for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (766:31): [True: 704k, False: 20.4k]
  ------------------
  767|   704k|        *ptr = e;
  768|   704k|    }
  769|  20.4k|}
igraph_vector_pop_back:
  838|   590k|BASE FUNCTION(igraph_vector, pop_back)(TYPE(igraph_vector) *v) {
  839|   590k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   590k|    do { \
  |  |  925|   590k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   590k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 590k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   590k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 590k]
  |  |  ------------------
  ------------------
  840|   590k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   590k|    do { \
  |  |  925|   590k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   590k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 590k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   590k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 590k]
  |  |  ------------------
  ------------------
  841|   590k|    IGRAPH_ASSERT(v->end != NULL);
  ------------------
  |  |  924|   590k|    do { \
  |  |  925|   590k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   590k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 590k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   590k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 590k]
  |  |  ------------------
  ------------------
  842|   590k|    IGRAPH_ASSERT(v->end != v->stor_begin);
  ------------------
  |  |  924|   590k|    do { \
  |  |  925|   590k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   590k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 590k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   590k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 590k]
  |  |  ------------------
  ------------------
  843|       |
  844|   590k|    (v->end)--;
  845|       |
  846|   590k|    return *(v->end);
  847|   590k|}
igraph_vector_sort_ind:
 1045|  3.29k|        igraph_order_t order) {
 1046|       |
 1047|  3.29k|    igraph_int_t i, n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  170|  3.29k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.29k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.29k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|  3.29k|    BASE **vind, *first;
  ------------------
  |  |   29|  3.29k|    #define BASE igraph_real_t
  ------------------
 1049|  3.29k|    IGRAPH_CHECK(igraph_vector_int_resize(inds, n));
  ------------------
  |  |  656|  3.29k|    do { \
  |  |  657|  3.29k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.29k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.29k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.29k]
  |  |  ------------------
  ------------------
 1050|  3.29k|    if (n == 0) {
  ------------------
  |  Branch (1050:9): [True: 0, False: 3.29k]
  ------------------
 1051|      0|        return IGRAPH_SUCCESS;
 1052|      0|    }
 1053|  3.29k|    vind = IGRAPH_CALLOC(n, BASE*);
  ------------------
  |  |   33|  3.29k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.58k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.29k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.29k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.29k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  3.29k|    IGRAPH_CHECK_OOM(vind, "Insufficient memory to sort vector.");
  ------------------
  |  |  709|  3.29k|    do { \
  |  |  710|  3.29k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.29k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.29k]
  |  |  ------------------
  ------------------
 1055|   161k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1055:17): [True: 157k, False: 3.29k]
  ------------------
 1056|   157k|        vind[i] = &VECTOR(*v)[i];
  ------------------
  |  |   60|   157k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1057|   157k|    }
 1058|  3.29k|    first = vind[0];
 1059|  3.29k|    if (order == IGRAPH_ASCENDING) {
  ------------------
  |  Branch (1059:9): [True: 0, False: 3.29k]
  ------------------
 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.29k|    } else {
 1062|  3.29k|        igraph_qsort(vind, n, sizeof(BASE*), FUNCTION(igraph_vector, i_sort_ind_cmp_desc));
  ------------------
  |  |  170|  3.29k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.29k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.29k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1063|  3.29k|    }
 1064|   161k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1064:17): [True: 157k, False: 3.29k]
  ------------------
 1065|   157k|        VECTOR(*inds)[i] = vind[i] - first;
  ------------------
  |  |   60|   157k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1066|   157k|    }
 1067|       |    IGRAPH_FREE(vind);
  ------------------
  |  |   36|  3.29k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1068|  3.29k|    return IGRAPH_SUCCESS;
 1069|  3.29k|}
igraph_vector_resize:
 1264|  71.5k|igraph_error_t FUNCTION(igraph_vector, resize)(TYPE(igraph_vector)* v, igraph_int_t new_size) {
 1265|  71.5k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  71.5k|    do { \
  |  |  925|  71.5k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  71.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 71.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  71.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 71.5k]
  |  |  ------------------
  ------------------
 1266|  71.5k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  71.5k|    do { \
  |  |  925|  71.5k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  71.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 71.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  71.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 71.5k]
  |  |  ------------------
  ------------------
 1267|  71.5k|    IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|  71.5k|    do { \
  |  |  657|  71.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  71.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  71.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 71.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|  71.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 71.5k]
  |  |  ------------------
  ------------------
 1268|  71.5k|    v->end = v->stor_begin + new_size;
 1269|  71.5k|    return IGRAPH_SUCCESS;
 1270|  71.5k|}
igraph_vector_which_max:
 1365|  3.37k|igraph_int_t FUNCTION(igraph_vector, which_max)(const TYPE(igraph_vector) *v) {
 1366|  3.37k|    BASE *max;
  ------------------
  |  |   29|  3.37k|    #define BASE igraph_real_t
  ------------------
 1367|  3.37k|    BASE *ptr;
  ------------------
  |  |   29|  3.37k|    #define BASE igraph_real_t
  ------------------
 1368|  3.37k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  3.37k|    do { \
  |  |  925|  3.37k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.37k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.37k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.37k]
  |  |  ------------------
  ------------------
 1369|  3.37k|    max = ptr = v->stor_begin;
 1370|  3.37k|#if defined(BASE_IGRAPH_REAL)
 1371|  3.37k|    if (isnan(*ptr)) { return ptr - v->stor_begin; } /* Result is NaN */
  ------------------
  |  Branch (1371:9): [True: 0, False: 3.37k]
  ------------------
 1372|  3.37k|#endif
 1373|  3.37k|    ptr++;
 1374|  48.2k|    while (ptr < v->end) {
  ------------------
  |  Branch (1374:12): [True: 44.8k, False: 3.37k]
  ------------------
 1375|  44.8k|        if (*ptr > *max) {
  ------------------
  |  Branch (1375:13): [True: 38.4k, False: 6.39k]
  ------------------
 1376|  38.4k|            max = ptr;
 1377|  38.4k|        }
 1378|  6.39k|#if defined(BASE_IGRAPH_REAL)
 1379|  6.39k|        else if (isnan(*ptr)) {
  ------------------
  |  Branch (1379:18): [True: 0, False: 6.39k]
  ------------------
 1380|      0|            return ptr - v->stor_begin; /* Result is NaN */
 1381|      0|        }
 1382|  44.8k|#endif
 1383|  44.8k|        ptr++;
 1384|  44.8k|    }
 1385|  3.37k|    return max - v->stor_begin;
 1386|  3.37k|}
igraph_vector_min:
 1401|  3.29k|BASE FUNCTION(igraph_vector, min)(const TYPE(igraph_vector) *v) {
 1402|  3.29k|    BASE min;
  ------------------
  |  |   29|  3.29k|    #define BASE igraph_real_t
  ------------------
 1403|  3.29k|    BASE *ptr;
  ------------------
  |  |   29|  3.29k|    #define BASE igraph_real_t
  ------------------
 1404|  3.29k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  3.29k|    do { \
  |  |  925|  3.29k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.29k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.29k]
  |  |  ------------------
  ------------------
 1405|  3.29k|    min = *(v->stor_begin);
 1406|  3.29k|#if defined(BASE_IGRAPH_REAL)
 1407|  3.29k|    if (isnan(min)) { return min; }; /* Result is NaN */
  ------------------
  |  Branch (1407:9): [True: 0, False: 3.29k]
  ------------------
 1408|  3.29k|#endif
 1409|  3.29k|    ptr = v->stor_begin + 1;
 1410|  64.0k|    while (ptr < v->end) {
  ------------------
  |  Branch (1410:12): [True: 60.7k, False: 3.29k]
  ------------------
 1411|  60.7k|        if ((*ptr) < min) {
  ------------------
  |  Branch (1411:13): [True: 1.80k, False: 58.9k]
  ------------------
 1412|  1.80k|            min = *ptr;
 1413|  1.80k|        }
 1414|  58.9k|#if defined(BASE_IGRAPH_REAL)
 1415|  58.9k|        else if (isnan(*ptr)) {
  ------------------
  |  Branch (1415:18): [True: 0, False: 58.9k]
  ------------------
 1416|      0|            return *ptr; /* Result is NaN */
 1417|      0|        }
 1418|  60.7k|#endif
 1419|  60.7k|        ptr++;
 1420|  60.7k|    }
 1421|  3.29k|    return min;
 1422|  3.29k|}
igraph_vector_sum:
 1566|  14.6k|BASE FUNCTION(igraph_vector, sum)(const TYPE(igraph_vector) *v) {
 1567|  14.6k|    BASE res = ZERO;
  ------------------
  |  |   29|  14.6k|    #define BASE igraph_real_t
  ------------------
                  BASE res = ZERO;
  ------------------
  |  |   38|  14.6k|    #define ZERO 0.0
  ------------------
 1568|  14.6k|    const BASE *p;
 1569|  14.6k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  14.6k|    do { \
  |  |  925|  14.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  14.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  14.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 14.6k]
  |  |  ------------------
  ------------------
 1570|  14.6k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  14.6k|    do { \
  |  |  925|  14.6k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  14.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 14.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  14.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 14.6k]
  |  |  ------------------
  ------------------
 1571|   475k|    for (p = v->stor_begin; p < v->end; p++) {
  ------------------
  |  Branch (1571:29): [True: 461k, False: 14.6k]
  ------------------
 1572|       |#ifdef SUM
 1573|       |        SUM(res, res, *p);
 1574|       |#else
 1575|   461k|        res += *p;
 1576|   461k|#endif
 1577|   461k|    }
 1578|  14.6k|    return res;
 1579|  14.6k|}
igraph_vector_binsearch_slice:
 2165|  58.4k|        BASE what, igraph_int_t *pos, igraph_int_t start, igraph_int_t end) {
 2166|  58.4k|    igraph_int_t left  = start;
 2167|  58.4k|    igraph_int_t right = end - 1;
 2168|       |
 2169|  58.4k|    if (left < 0)
  ------------------
  |  Branch (2169:9): [True: 0, False: 58.4k]
  ------------------
 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|  58.4k|    if (right >= FUNCTION(igraph_vector, size)(v))
  ------------------
  |  |  170|  58.4k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  58.4k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  58.4k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2172:9): [True: 0, False: 58.4k]
  ------------------
 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|  58.4k|    if (left > right)
  ------------------
  |  Branch (2175:9): [True: 0, False: 58.4k]
  ------------------
 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|  58.4k|                     IGRAPH_EINVAL);
 2178|       |
 2179|  58.4k|    return FUNCTION(igraph_i_vector, binsearch_slice)(v, what, pos, start, end);
  ------------------
  |  |  170|  58.4k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  58.4k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  58.4k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2180|  58.4k|}
igraph_vector_scale:
 2258|   112k|void FUNCTION(igraph_vector, scale)(TYPE(igraph_vector) *v, BASE by) {
 2259|   112k|    const igraph_int_t n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  170|   112k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|   112k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|   112k|#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|   112k|    if (by == ONE) {
  ------------------
  |  |   39|   112k|    #define ONE 1.0
  ------------------
  |  Branch (2266:9): [True: 756, False: 112k]
  ------------------
 2267|    756|        return;
 2268|    756|    }
 2269|   112k|#endif
 2270|  4.92M|    for (igraph_int_t i = 0; i < n; i++) {
  ------------------
  |  Branch (2270:30): [True: 4.80M, False: 112k]
  ------------------
 2271|       |#ifdef PROD
 2272|       |        PROD(VECTOR(*v)[i], VECTOR(*v)[i], by);
 2273|       |#else
 2274|  4.80M|        VECTOR(*v)[i] *= by;
  ------------------
  |  |   60|  4.80M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2275|  4.80M|#endif
 2276|  4.80M|    }
 2277|   112k|}
igraph_vector_update:
 2524|  15.1k|                                    const TYPE(igraph_vector) *from) {
 2525|  15.1k|    igraph_int_t n = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  170|  15.1k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  15.1k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  15.1k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|  15.1k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(to, n));
  ------------------
  |  |  656|  15.1k|    do { \
  |  |  657|  15.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  15.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  15.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 15.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|  15.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 15.1k]
  |  |  ------------------
  ------------------
 2527|  15.1k|    memcpy(to->stor_begin, from->stor_begin, sizeof(BASE)*n);
 2528|  15.1k|    return IGRAPH_SUCCESS;
 2529|  15.1k|}
igraph_vector_add:
 2696|  3.34k|                                 const TYPE(igraph_vector) *v2) {
 2697|       |
 2698|  3.34k|    igraph_int_t n1 = FUNCTION(igraph_vector, size)(v1);
  ------------------
  |  |  170|  3.34k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.34k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.34k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2699|  3.34k|    igraph_int_t n2 = FUNCTION(igraph_vector, size)(v2);
  ------------------
  |  |  170|  3.34k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.34k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.34k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2700|  3.34k|    igraph_int_t i;
 2701|  3.34k|    if (n1 != n2) {
  ------------------
  |  Branch (2701:9): [True: 0, False: 3.34k]
  ------------------
 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|   161k|    for (i = 0; i < n1; i++) {
  ------------------
  |  Branch (2706:17): [True: 157k, False: 3.34k]
  ------------------
 2707|       |#ifdef SUM
 2708|       |        SUM(VECTOR(*v1)[i], VECTOR(*v1)[i], VECTOR(*v2)[i]);
 2709|       |#else
 2710|   157k|        VECTOR(*v1)[i] += VECTOR(*v2)[i];
  ------------------
  |  |   60|   157k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*v1)[i] += VECTOR(*v2)[i];
  ------------------
  |  |   60|   157k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2711|   157k|#endif
 2712|   157k|    }
 2713|       |
 2714|  3.34k|    return IGRAPH_SUCCESS;
 2715|  3.34k|}
igraph_vector_mul:
 2767|  3.29k|                                 const TYPE(igraph_vector) *v2) {
 2768|       |
 2769|  3.29k|    igraph_int_t n1 = FUNCTION(igraph_vector, size)(v1);
  ------------------
  |  |  170|  3.29k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.29k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.29k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2770|  3.29k|    igraph_int_t n2 = FUNCTION(igraph_vector, size)(v2);
  ------------------
  |  |  170|  3.29k|        #define FUNCTION(a,c) CONCAT2(a,c)
  |  |  ------------------
  |  |  |  |   20|  3.29k|#define CONCAT2(a,b) CONCAT2x(a,b)
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|  3.29k|#define CONCAT2x(a,b) a ## _ ## b
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2771|  3.29k|    igraph_int_t i;
 2772|  3.29k|    if (n1 != n2) {
  ------------------
  |  Branch (2772:9): [True: 0, False: 3.29k]
  ------------------
 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|   161k|    for (i = 0; i < n1; i++) {
  ------------------
  |  Branch (2777:17): [True: 157k, False: 3.29k]
  ------------------
 2778|       |#ifdef PROD
 2779|       |        PROD(VECTOR(*v1)[i], VECTOR(*v1)[i], VECTOR(*v2)[i]);
 2780|       |#else
 2781|   157k|        VECTOR(*v1)[i] *= VECTOR(*v2)[i];
  ------------------
  |  |   60|   157k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*v1)[i] *= VECTOR(*v2)[i];
  ------------------
  |  |   60|   157k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2782|   157k|#endif
 2783|   157k|    }
 2784|       |
 2785|  3.29k|    return IGRAPH_SUCCESS;
 2786|  3.29k|}
igraph_vector_bool_init:
  134|  10.1k|igraph_error_t FUNCTION(igraph_vector, init)(TYPE(igraph_vector) *v, igraph_int_t size) {
  135|  10.1k|    igraph_int_t alloc_size;
  136|  10.1k|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  137|  10.1k|    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.1k|    v->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  10.1k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  20.2k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 10.1k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 10.1k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 10.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|  10.1k|    IGRAPH_CHECK_OOM(v->stor_begin, "Insufficient memory to initialize vector.");
  ------------------
  |  |  709|  10.1k|    do { \
  |  |  710|  10.1k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  10.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 10.1k]
  |  |  ------------------
  ------------------
  145|  10.1k|    v->stor_end = v->stor_begin + alloc_size;
  146|  10.1k|    v->end = v->stor_begin + size;
  147|       |
  148|  10.1k|    return IGRAPH_SUCCESS;
  149|  10.1k|}
igraph_vector_bool_destroy:
  408|  10.1k|void FUNCTION(igraph_vector, destroy)(TYPE(igraph_vector) *v) {
  409|  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]
  |  |  ------------------
  ------------------
  410|       |    /* vector_init() will leave stor_begin set to NULL when it fails.
  411|       |     * We handle these cases gracefully. */
  412|  10.1k|    if (v->stor_begin != NULL) {
  ------------------
  |  Branch (412:9): [True: 10.1k, False: 0]
  ------------------
  413|  10.1k|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  10.1k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  414|       |        v->stor_begin = NULL;
  415|  10.1k|    }
  416|  10.1k|}
igraph_vector_int_init:
  134|  4.15M|igraph_error_t FUNCTION(igraph_vector, init)(TYPE(igraph_vector) *v, igraph_int_t size) {
  135|  4.15M|    igraph_int_t alloc_size;
  136|  4.15M|    IGRAPH_ASSERT(size >= 0);
  ------------------
  |  |  924|  4.15M|    do { \
  |  |  925|  4.15M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.15M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.15M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.15M]
  |  |  ------------------
  ------------------
  137|  4.15M|    alloc_size = size > 0 ? size : 1;
  ------------------
  |  Branch (137:18): [True: 1.45M, False: 2.70M]
  ------------------
  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|  4.15M|    v->stor_begin = IGRAPH_CALLOC(alloc_size, BASE);
  ------------------
  |  |   33|  4.15M|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  8.30M|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 4.15M, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 4.15M, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 4.15M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  144|  4.15M|    IGRAPH_CHECK_OOM(v->stor_begin, "Insufficient memory to initialize vector.");
  ------------------
  |  |  709|  4.15M|    do { \
  |  |  710|  4.15M|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  4.15M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|  4.15M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 4.15M]
  |  |  ------------------
  ------------------
  145|  4.15M|    v->stor_end = v->stor_begin + alloc_size;
  146|  4.15M|    v->end = v->stor_begin + size;
  147|       |
  148|  4.15M|    return IGRAPH_SUCCESS;
  149|  4.15M|}
igraph_vector_int_destroy:
  408|  4.15M|void FUNCTION(igraph_vector, destroy)(TYPE(igraph_vector) *v) {
  409|  4.15M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  4.15M|    do { \
  |  |  925|  4.15M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  4.15M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 4.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  4.15M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 4.15M]
  |  |  ------------------
  ------------------
  410|       |    /* vector_init() will leave stor_begin set to NULL when it fails.
  411|       |     * We handle these cases gracefully. */
  412|  4.15M|    if (v->stor_begin != NULL) {
  ------------------
  |  Branch (412:9): [True: 4.15M, False: 0]
  ------------------
  413|  4.15M|        IGRAPH_FREE(v->stor_begin);
  ------------------
  |  |   36|  4.15M|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  414|       |        v->stor_begin = NULL;
  415|  4.15M|    }
  416|  4.15M|}
igraph_vector_int_capacity:
  436|  24.1M|igraph_int_t FUNCTION(igraph_vector, capacity)(const TYPE(igraph_vector) *v) {
  437|  24.1M|    return v->stor_end - v->stor_begin;
  438|  24.1M|}
igraph_vector_int_reserve:
  468|  23.9M|igraph_error_t FUNCTION(igraph_vector, reserve)(TYPE(igraph_vector) *v, igraph_int_t capacity) {
  469|  23.9M|    igraph_int_t current_capacity;
  470|  23.9M|    BASE *tmp;
  ------------------
  |  |   66|  23.9M|    #define BASE igraph_int_t
  ------------------
  471|       |
  472|  23.9M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  23.9M|    do { \
  |  |  925|  23.9M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  23.9M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 23.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  23.9M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 23.9M]
  |  |  ------------------
  ------------------
  473|  23.9M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  23.9M|    do { \
  |  |  925|  23.9M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  23.9M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 23.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  23.9M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 23.9M]
  |  |  ------------------
  ------------------
  474|  23.9M|    IGRAPH_ASSERT(capacity >= 0);
  ------------------
  |  |  924|  23.9M|    do { \
  |  |  925|  23.9M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  23.9M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 23.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  23.9M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 23.9M]
  |  |  ------------------
  ------------------
  475|       |
  476|  23.9M|    current_capacity = FUNCTION(igraph_vector, capacity)(v);
  ------------------
  |  |  178|  23.9M|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  23.9M|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  23.9M|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|       |
  478|  23.9M|    if (capacity <= current_capacity) {
  ------------------
  |  Branch (478:9): [True: 23.5M, False: 385k]
  ------------------
  479|  23.5M|        return IGRAPH_SUCCESS;
  480|  23.5M|    }
  481|       |
  482|   385k|    tmp = IGRAPH_REALLOC(v->stor_begin, capacity, BASE);
  ------------------
  |  |   35|   385k|#define IGRAPH_REALLOC(p,n,t) IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, realloc((void*)(p), sizeof(t) * ((n) > 0 ? (n) : 1)))
  |  |  ------------------
  |  |  |  |   31|   771k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 385k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 385k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 385k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   385k|    IGRAPH_CHECK_OOM(tmp, "Cannot reserve space for vector.");
  ------------------
  |  |  709|   385k|    do { \
  |  |  710|   385k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|   385k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 385k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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|   385k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 385k]
  |  |  ------------------
  ------------------
  484|       |
  485|   385k|    v->end = tmp + (v->end - v->stor_begin);
  486|   385k|    v->stor_begin = tmp;
  487|   385k|    v->stor_end = v->stor_begin + capacity;
  488|       |
  489|   385k|    return IGRAPH_SUCCESS;
  490|   385k|}
igraph_vector_int_empty:
  503|   160k|igraph_bool_t FUNCTION(igraph_vector, empty)(const TYPE(igraph_vector) *v) {
  504|   160k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   160k|    do { \
  |  |  925|   160k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   160k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   160k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 160k]
  |  |  ------------------
  ------------------
  505|   160k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   160k|    do { \
  |  |  925|   160k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   160k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   160k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 160k]
  |  |  ------------------
  ------------------
  506|   160k|    return v->stor_begin == v->end;
  507|   160k|}
igraph_vector_int_size:
  522|   114M|igraph_int_t FUNCTION(igraph_vector, size)(const TYPE(igraph_vector) *v) {
  523|   114M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   114M|    do { \
  |  |  925|   114M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   114M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 114M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   114M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 114M]
  |  |  ------------------
  ------------------
  524|   114M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   114M|    do { \
  |  |  925|   114M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   114M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 114M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   114M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 114M]
  |  |  ------------------
  ------------------
  525|   114M|    return v->end - v->stor_begin;
  526|   114M|}
igraph_vector_int_clear:
  542|  53.2M|void FUNCTION(igraph_vector, clear)(TYPE(igraph_vector)* v) {
  543|  53.2M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  53.2M|    do { \
  |  |  925|  53.2M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  53.2M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 53.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  53.2M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 53.2M]
  |  |  ------------------
  ------------------
  544|  53.2M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  53.2M|    do { \
  |  |  925|  53.2M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  53.2M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 53.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  53.2M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 53.2M]
  |  |  ------------------
  ------------------
  545|  53.2M|    v->end = v->stor_begin;
  546|  53.2M|}
igraph_vector_int_push_back:
  573|  26.4M|igraph_error_t FUNCTION(igraph_vector, push_back)(TYPE(igraph_vector) *v, BASE e) {
  574|  26.4M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  26.4M|    do { \
  |  |  925|  26.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  26.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 26.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  26.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 26.4M]
  |  |  ------------------
  ------------------
  575|  26.4M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  26.4M|    do { \
  |  |  925|  26.4M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  26.4M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 26.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  26.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 26.4M]
  |  |  ------------------
  ------------------
  576|       |
  577|  26.4M|    if (v->stor_end == v->end) {
  ------------------
  |  Branch (577:9): [True: 90.7k, False: 26.3M]
  ------------------
  578|       |        /* full, allocate more storage */
  579|  90.7k|        igraph_int_t old_size = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|  90.7k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  90.7k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  90.7k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  580|  90.7k|        igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  90.7k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
                      igraph_int_t new_size = old_size < IGRAPH_INTEGER_MAX/2 ? old_size * 2 : IGRAPH_INTEGER_MAX;
  ------------------
  |  |   72|  90.7k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (580:33): [True: 90.7k, False: 0]
  ------------------
  581|  90.7k|        if (old_size == IGRAPH_INTEGER_MAX) {
  ------------------
  |  |   72|  90.7k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  ------------------
  |  Branch (581:13): [True: 0, False: 90.7k]
  ------------------
  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|  90.7k|        if (new_size == 0) {
  ------------------
  |  Branch (584:13): [True: 0, False: 90.7k]
  ------------------
  585|      0|            new_size = 1;
  586|      0|        }
  587|  90.7k|        IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|  90.7k|    do { \
  |  |  657|  90.7k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  90.7k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  90.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 90.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|  90.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 90.7k]
  |  |  ------------------
  ------------------
  588|  90.7k|    }
  589|       |
  590|  26.4M|    *(v->end) = e;
  591|  26.4M|    v->end += 1;
  592|       |
  593|  26.4M|    return IGRAPH_SUCCESS;
  594|  26.4M|}
igraph_vector_int_null:
  725|   464k|void FUNCTION(igraph_vector, null)(TYPE(igraph_vector) *v) {
  726|   464k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   464k|    do { \
  |  |  925|   464k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   464k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 464k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   464k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 464k]
  |  |  ------------------
  ------------------
  727|   464k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   464k|    do { \
  |  |  925|   464k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   464k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 464k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   464k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 464k]
  |  |  ------------------
  ------------------
  728|   464k|    if (FUNCTION(igraph_vector, size)(v) > 0) {
  ------------------
  |  |  178|   464k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   464k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   464k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (728:9): [True: 464k, False: 27]
  ------------------
  729|   464k|        memset(v->stor_begin, 0, sizeof(BASE) * FUNCTION(igraph_vector, size)(v));
  ------------------
  |  |  178|   464k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   464k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   464k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|   464k|    }
  731|   464k|}
igraph_vector_int_fill:
  745|  20.1k|void FUNCTION(igraph_vector, fill)(TYPE(igraph_vector) *v, BASE e) {
  746|  20.1k|    BASE *ptr;
  ------------------
  |  |   66|  20.1k|    #define BASE igraph_int_t
  ------------------
  747|  20.1k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  20.1k|    do { \
  |  |  925|  20.1k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  20.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  20.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
  748|  20.1k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  20.1k|    do { \
  |  |  925|  20.1k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  20.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 20.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  20.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 20.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|  20.1k|#if defined(BASE_INT)
  754|  20.1k|    if (e == 0) {
  ------------------
  |  Branch (754:9): [True: 0, False: 20.1k]
  ------------------
  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.1k|    if (e == -1) {
  ------------------
  |  Branch (758:9): [True: 20.1k, False: 0]
  ------------------
  759|   978k|        for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (759:35): [True: 958k, False: 20.1k]
  ------------------
  760|   958k|            *ptr = -1;
  761|   958k|        }
  762|  20.1k|        return;
  763|  20.1k|    }
  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.93k|igraph_error_t FUNCTION(igraph_vector, range)(TYPE(igraph_vector) *v, BASE start, BASE end) {
  792|  6.93k|    BASE *p;
  ------------------
  |  |   66|  6.93k|    #define BASE igraph_int_t
  ------------------
  793|  6.93k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(v, (end - start)));
  ------------------
  |  |  656|  6.93k|    do { \
  |  |  657|  6.93k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.93k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.93k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.93k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.93k]
  |  |  ------------------
  ------------------
  794|       |
  795|   332k|    for (p = v->stor_begin; p < v->end; p++) {
  ------------------
  |  Branch (795:29): [True: 325k, False: 6.93k]
  ------------------
  796|   325k|        *p = start;
  797|   325k|        start = start + ONE;
  ------------------
  |  |   72|   325k|    #define ONE 1
  ------------------
  798|   325k|    }
  799|       |
  800|  6.93k|    return IGRAPH_SUCCESS;
  801|  6.93k|}
igraph_vector_int_pop_back:
  838|   794k|BASE FUNCTION(igraph_vector, pop_back)(TYPE(igraph_vector) *v) {
  839|   794k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   794k|    do { \
  |  |  925|   794k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   794k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 794k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   794k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 794k]
  |  |  ------------------
  ------------------
  840|   794k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   794k|    do { \
  |  |  925|   794k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   794k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 794k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   794k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 794k]
  |  |  ------------------
  ------------------
  841|   794k|    IGRAPH_ASSERT(v->end != NULL);
  ------------------
  |  |  924|   794k|    do { \
  |  |  925|   794k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   794k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 794k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   794k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 794k]
  |  |  ------------------
  ------------------
  842|   794k|    IGRAPH_ASSERT(v->end != v->stor_begin);
  ------------------
  |  |  924|   794k|    do { \
  |  |  925|   794k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   794k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 794k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   794k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 794k]
  |  |  ------------------
  ------------------
  843|       |
  844|   794k|    (v->end)--;
  845|       |
  846|   794k|    return *(v->end);
  847|   794k|}
igraph_vector_int_sort_ind:
 1045|  44.8k|        igraph_order_t order) {
 1046|       |
 1047|  44.8k|    igraph_int_t i, n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|  44.8k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  44.8k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  44.8k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|  44.8k|    BASE **vind, *first;
  ------------------
  |  |   66|  44.8k|    #define BASE igraph_int_t
  ------------------
 1049|  44.8k|    IGRAPH_CHECK(igraph_vector_int_resize(inds, n));
  ------------------
  |  |  656|  44.8k|    do { \
  |  |  657|  44.8k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  44.8k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  44.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 44.8k]
  |  |  ------------------
  ------------------
 1050|  44.8k|    if (n == 0) {
  ------------------
  |  Branch (1050:9): [True: 0, False: 44.8k]
  ------------------
 1051|      0|        return IGRAPH_SUCCESS;
 1052|      0|    }
 1053|  44.8k|    vind = IGRAPH_CALLOC(n, BASE*);
  ------------------
  |  |   33|  44.8k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  89.6k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 44.8k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 44.8k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 44.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  44.8k|    IGRAPH_CHECK_OOM(vind, "Insufficient memory to sort vector.");
  ------------------
  |  |  709|  44.8k|    do { \
  |  |  710|  44.8k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  44.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 44.8k]
  |  |  ------------------
  ------------------
 1055|  2.60M|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1055:17): [True: 2.56M, False: 44.8k]
  ------------------
 1056|  2.56M|        vind[i] = &VECTOR(*v)[i];
  ------------------
  |  |   60|  2.56M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1057|  2.56M|    }
 1058|  44.8k|    first = vind[0];
 1059|  44.8k|    if (order == IGRAPH_ASCENDING) {
  ------------------
  |  Branch (1059:9): [True: 44.8k, False: 0]
  ------------------
 1060|  44.8k|        igraph_qsort(vind, n, sizeof(BASE*), FUNCTION(igraph_vector, i_sort_ind_cmp_asc));
  ------------------
  |  |  178|  44.8k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  44.8k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  44.8k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1061|  44.8k|    } 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.60M|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1064:17): [True: 2.56M, False: 44.8k]
  ------------------
 1065|  2.56M|        VECTOR(*inds)[i] = vind[i] - first;
  ------------------
  |  |   60|  2.56M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1066|  2.56M|    }
 1067|       |    IGRAPH_FREE(vind);
  ------------------
  |  |   36|  44.8k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1068|  44.8k|    return IGRAPH_SUCCESS;
 1069|  44.8k|}
igraph_vector_int_resize:
 1264|  23.7M|igraph_error_t FUNCTION(igraph_vector, resize)(TYPE(igraph_vector)* v, igraph_int_t new_size) {
 1265|  23.7M|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  23.7M|    do { \
  |  |  925|  23.7M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  23.7M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 23.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  23.7M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 23.7M]
  |  |  ------------------
  ------------------
 1266|  23.7M|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  23.7M|    do { \
  |  |  925|  23.7M|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  23.7M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 23.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  23.7M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 23.7M]
  |  |  ------------------
  ------------------
 1267|  23.7M|    IGRAPH_CHECK(FUNCTION(igraph_vector, reserve)(v, new_size));
  ------------------
  |  |  656|  23.7M|    do { \
  |  |  657|  23.7M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  23.7M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  23.7M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 23.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.7M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 23.7M]
  |  |  ------------------
  ------------------
 1268|  23.7M|    v->end = v->stor_begin + new_size;
 1269|  23.7M|    return IGRAPH_SUCCESS;
 1270|  23.7M|}
igraph_vector_int_max:
 1327|  81.8k|BASE FUNCTION(igraph_vector, max)(const TYPE(igraph_vector) *v) {
 1328|  81.8k|    BASE max;
  ------------------
  |  |   66|  81.8k|    #define BASE igraph_int_t
  ------------------
 1329|  81.8k|    BASE *ptr;
  ------------------
  |  |   66|  81.8k|    #define BASE igraph_int_t
  ------------------
 1330|  81.8k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  81.8k|    do { \
  |  |  925|  81.8k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  81.8k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 81.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  81.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 81.8k]
  |  |  ------------------
  ------------------
 1331|  81.8k|    max = *(v->stor_begin);
 1332|       |#if defined(BASE_IGRAPH_REAL)
 1333|       |    if (isnan(max)) { return max; }; /* Result is NaN */
 1334|       |#endif
 1335|  81.8k|    ptr = v->stor_begin + 1;
 1336|  3.40M|    while (ptr < v->end) {
  ------------------
  |  Branch (1336:12): [True: 3.32M, False: 81.8k]
  ------------------
 1337|  3.32M|        if ((*ptr) > max) {
  ------------------
  |  Branch (1337:13): [True: 2.11M, False: 1.20M]
  ------------------
 1338|  2.11M|            max = *ptr;
 1339|  2.11M|        }
 1340|       |#if defined(BASE_IGRAPH_REAL)
 1341|       |        else if (isnan(*ptr))
 1342|       |            return *ptr; /* Result is NaN */
 1343|       |#endif
 1344|  3.32M|        ptr++;
 1345|  3.32M|    }
 1346|  81.8k|    return max;
 1347|  81.8k|}
igraph_vector_int_min:
 1401|  3.37k|BASE FUNCTION(igraph_vector, min)(const TYPE(igraph_vector) *v) {
 1402|  3.37k|    BASE min;
  ------------------
  |  |   66|  3.37k|    #define BASE igraph_int_t
  ------------------
 1403|  3.37k|    BASE *ptr;
  ------------------
  |  |   66|  3.37k|    #define BASE igraph_int_t
  ------------------
 1404|  3.37k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  3.37k|    do { \
  |  |  925|  3.37k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  3.37k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  3.37k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 3.37k]
  |  |  ------------------
  ------------------
 1405|  3.37k|    min = *(v->stor_begin);
 1406|       |#if defined(BASE_IGRAPH_REAL)
 1407|       |    if (isnan(min)) { return min; }; /* Result is NaN */
 1408|       |#endif
 1409|  3.37k|    ptr = v->stor_begin + 1;
 1410|   160k|    while (ptr < v->end) {
  ------------------
  |  Branch (1410:12): [True: 157k, False: 3.37k]
  ------------------
 1411|   157k|        if ((*ptr) < min) {
  ------------------
  |  Branch (1411:13): [True: 0, False: 157k]
  ------------------
 1412|      0|            min = *ptr;
 1413|      0|        }
 1414|       |#if defined(BASE_IGRAPH_REAL)
 1415|       |        else if (isnan(*ptr)) {
 1416|       |            return *ptr; /* Result is NaN */
 1417|       |        }
 1418|       |#endif
 1419|   157k|        ptr++;
 1420|   157k|    }
 1421|  3.37k|    return min;
 1422|  3.37k|}
igraph_vector_int_init_copy:
 1538|   184k|) {
 1539|   184k|    igraph_int_t from_size;
 1540|       |
 1541|   184k|    IGRAPH_ASSERT(from != NULL);
  ------------------
  |  |  924|   184k|    do { \
  |  |  925|   184k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   184k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   184k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 184k]
  |  |  ------------------
  ------------------
 1542|   184k|    IGRAPH_ASSERT(from->stor_begin != NULL);
  ------------------
  |  |  924|   184k|    do { \
  |  |  925|   184k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   184k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   184k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 184k]
  |  |  ------------------
  ------------------
 1543|       |
 1544|   184k|    from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  178|   184k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   184k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   184k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1545|   184k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(to, from_size));
  ------------------
  |  |  656|   184k|    do { \
  |  |  657|   184k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   184k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   184k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   184k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 184k]
  |  |  ------------------
  ------------------
 1546|       |
 1547|   184k|    memcpy(to->stor_begin, from->stor_begin, from_size * sizeof(BASE));
 1548|       |
 1549|   184k|    return IGRAPH_SUCCESS;
 1550|   184k|}
igraph_vector_int_init_range:
 1686|  50.0k|igraph_error_t FUNCTION(igraph_vector, init_range)(TYPE(igraph_vector) *v, BASE start, BASE end) {
 1687|  50.0k|    BASE *p;
  ------------------
  |  |   66|  50.0k|    #define BASE igraph_int_t
  ------------------
 1688|  50.0k|    IGRAPH_CHECK(FUNCTION(igraph_vector, init)(v, (end - start)));
  ------------------
  |  |  656|  50.0k|    do { \
  |  |  657|  50.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  50.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  50.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 50.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|  50.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 50.0k]
  |  |  ------------------
  ------------------
 1689|       |
 1690|  2.35M|    for (p = v->stor_begin; p < v->end; p++) {
  ------------------
  |  Branch (1690:29): [True: 2.30M, False: 50.0k]
  ------------------
 1691|  2.30M|        *p = start;
 1692|  2.30M|        start = start + ONE;
  ------------------
  |  |   72|  2.30M|    #define ONE 1
  ------------------
 1693|  2.30M|    }
 1694|       |
 1695|  50.0k|    return IGRAPH_SUCCESS;
 1696|  50.0k|}
igraph_vector_int_remove_section:
 1716|  6.29k|        TYPE(igraph_vector) *v, igraph_int_t from, igraph_int_t to) {
 1717|  6.29k|    igraph_int_t size = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|  6.29k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  6.29k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  6.29k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1718|       |
 1719|  6.29k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  6.29k|    do { \
  |  |  925|  6.29k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.29k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  6.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 6.29k]
  |  |  ------------------
  ------------------
 1720|  6.29k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  6.29k|    do { \
  |  |  925|  6.29k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  6.29k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  6.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 6.29k]
  |  |  ------------------
  ------------------
 1721|       |
 1722|  6.29k|    if (from < 0) {
  ------------------
  |  Branch (1722:9): [True: 0, False: 6.29k]
  ------------------
 1723|      0|        from = 0;
 1724|      0|    }
 1725|       |
 1726|  6.29k|    if (to > size) {
  ------------------
  |  Branch (1726:9): [True: 0, False: 6.29k]
  ------------------
 1727|      0|        to = size;
 1728|      0|    }
 1729|       |
 1730|  6.29k|    if (to > from) {
  ------------------
  |  Branch (1730:9): [True: 6.29k, False: 0]
  ------------------
 1731|  6.29k|        memmove(v->stor_begin + from, v->stor_begin + to,
 1732|  6.29k|                sizeof(BASE) * (v->end - v->stor_begin - to));
 1733|  6.29k|        v->end -= (to - from);
 1734|  6.29k|    }
 1735|  6.29k|}
igraph_vector_int_move_interval:
 1804|   226k|        igraph_int_t begin, igraph_int_t end, igraph_int_t to) {
 1805|   226k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|   226k|    do { \
  |  |  925|   226k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   226k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 226k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   226k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 226k]
  |  |  ------------------
  ------------------
 1806|   226k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|   226k|    do { \
  |  |  925|   226k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   226k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 226k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   226k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 226k]
  |  |  ------------------
  ------------------
 1807|   226k|    memmove(v->stor_begin + to, v->stor_begin + begin,
 1808|   226k|           sizeof(BASE) * (end - begin));
 1809|       |
 1810|   226k|    return IGRAPH_SUCCESS;
 1811|   226k|}
igraph_vector_int_isininterval:
 1832|  67.4k|        BASE high) {
 1833|  67.4k|    BASE *ptr;
  ------------------
  |  |   66|  67.4k|    #define BASE igraph_int_t
  ------------------
 1834|  67.4k|    IGRAPH_ASSERT(v != NULL);
  ------------------
  |  |  924|  67.4k|    do { \
  |  |  925|  67.4k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  67.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 67.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  67.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 67.4k]
  |  |  ------------------
  ------------------
 1835|  67.4k|    IGRAPH_ASSERT(v->stor_begin != NULL);
  ------------------
  |  |  924|  67.4k|    do { \
  |  |  925|  67.4k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  67.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 67.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  67.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 67.4k]
  |  |  ------------------
  ------------------
 1836|  2.30M|    for (ptr = v->stor_begin; ptr < v->end; ptr++) {
  ------------------
  |  Branch (1836:31): [True: 2.23M, False: 67.4k]
  ------------------
 1837|       |        /* Note that the following is not equivalent to *ptr < low || *ptr > high
 1838|       |         * when *ptr is NaN! */
 1839|  2.23M|        if (!(*ptr >= low && *ptr <= high)) {
  ------------------
  |  Branch (1839:15): [True: 2.23M, False: 0]
  |  Branch (1839:30): [True: 2.23M, False: 0]
  ------------------
 1840|      0|            return 0;
 1841|      0|        }
 1842|  2.23M|    }
 1843|  67.4k|    return 1;
 1844|  67.4k|}
igraph_vector_int_contains:
 2327|  17.3k|        BASE what) {
 2328|  17.3k|    const BASE *p = v->stor_begin;
 2329|  22.0k|    while (p < v->end) {
  ------------------
  |  Branch (2329:12): [True: 18.0k, False: 3.97k]
  ------------------
 2330|       |#ifdef EQ
 2331|       |        if (EQ(*p, what)) {
 2332|       |#else
 2333|  18.0k|        if (*p == what) {
  ------------------
  |  Branch (2333:13): [True: 13.3k, False: 4.70k]
  ------------------
 2334|  13.3k|#endif
 2335|  13.3k|            return true;
 2336|  13.3k|        }
 2337|  4.70k|        p++;
 2338|  4.70k|    }
 2339|  3.97k|    return false;
 2340|  17.3k|}
igraph_vector_int_search:
 2364|   203k|        igraph_int_t from, BASE what, igraph_int_t *pos) {
 2365|   203k|    igraph_int_t i, n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|   203k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   203k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   203k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2366|  1.94M|    for (i = from; i < n; i++) {
  ------------------
  |  Branch (2366:20): [True: 1.94M, False: 0]
  ------------------
 2367|       |#ifdef EQ
 2368|       |        if (EQ(VECTOR(*v)[i], what)) {
 2369|       |            break;
 2370|       |        }
 2371|       |#else
 2372|  1.94M|        if (VECTOR(*v)[i] == what) {
  ------------------
  |  |   60|  1.94M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2372:13): [True: 203k, False: 1.73M]
  ------------------
 2373|   203k|            break;
 2374|   203k|        }
 2375|  1.94M|#endif
 2376|  1.94M|    }
 2377|       |
 2378|   203k|    if (i < n) {
  ------------------
  |  Branch (2378:9): [True: 203k, False: 0]
  ------------------
 2379|   203k|        if (pos != 0) {
  ------------------
  |  Branch (2379:13): [True: 203k, False: 0]
  ------------------
 2380|   203k|            *pos = i;
 2381|   203k|        }
 2382|   203k|        return true;
 2383|   203k|    } else {
 2384|       |        return false;
 2385|      0|    }
 2386|   203k|}
igraph_vector_int_append:
 2427|   160k|                                               const TYPE(igraph_vector) *from) {
 2428|   160k|    IGRAPH_ASSERT(to != NULL);
  ------------------
  |  |  924|   160k|    do { \
  |  |  925|   160k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   160k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   160k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 160k]
  |  |  ------------------
  ------------------
 2429|   160k|    IGRAPH_ASSERT(to->stor_begin != NULL);
  ------------------
  |  |  924|   160k|    do { \
  |  |  925|   160k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|   160k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|   160k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 160k]
  |  |  ------------------
  ------------------
 2430|       |
 2431|   160k|    const igraph_int_t to_size = FUNCTION(igraph_vector, size)(to);
  ------------------
  |  |  178|   160k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   160k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   160k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2432|   160k|    const igraph_int_t from_size = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  178|   160k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   160k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   160k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2433|   160k|    const igraph_int_t to_capacity = FUNCTION(igraph_vector, capacity)(to);
  ------------------
  |  |  178|   160k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   160k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   160k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2434|   160k|    igraph_int_t new_to_size;
 2435|       |
 2436|   160k|    IGRAPH_SAFE_ADD(to_size, from_size, &new_to_size);
  ------------------
  |  |   47|   160k|    do { \
  |  |   48|   160k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|   160k|        igraph_int_t _safe_sum; \
  |  |   50|   160k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 160k]
  |  |  ------------------
  |  |   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|   160k|        *(res) = _safe_sum; \
  |  |   54|   160k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 160k]
  |  |  ------------------
  ------------------
 2437|       |
 2438|   160k|    if (to_capacity < new_to_size) {
  ------------------
  |  Branch (2438:9): [True: 0, False: 160k]
  ------------------
 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|   160k|    memcpy(to->stor_begin + to_size, from->stor_begin,
 2447|   160k|           sizeof(BASE) * from_size);
 2448|   160k|    to->end = to->stor_begin + new_to_size;
 2449|       |
 2450|   160k|    return IGRAPH_SUCCESS;
 2451|   160k|}
igraph_vector_int_update:
 2524|  65.9k|                                    const TYPE(igraph_vector) *from) {
 2525|  65.9k|    igraph_int_t n = FUNCTION(igraph_vector, size)(from);
  ------------------
  |  |  178|  65.9k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  65.9k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  65.9k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|  65.9k|    IGRAPH_CHECK(FUNCTION(igraph_vector, resize)(to, n));
  ------------------
  |  |  656|  65.9k|    do { \
  |  |  657|  65.9k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  65.9k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  65.9k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 65.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|  65.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 65.9k]
  |  |  ------------------
  ------------------
 2527|  65.9k|    memcpy(to->stor_begin, from->stor_begin, sizeof(BASE)*n);
 2528|  65.9k|    return IGRAPH_SUCCESS;
 2529|  65.9k|}
igraph_vector_int_shuffle:
 2668|   295k|void FUNCTION(igraph_vector, shuffle)(TYPE(igraph_vector) *v) {
 2669|   295k|    igraph_int_t n = FUNCTION(igraph_vector, size)(v);
  ------------------
  |  |  178|   295k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|   295k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|   295k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2670|   295k|    igraph_int_t k;
 2671|   295k|    BASE dummy;
  ------------------
  |  |   66|   295k|    #define BASE igraph_int_t
  ------------------
 2672|       |
 2673|  14.3M|    while (n > 1) {
  ------------------
  |  Branch (2673:12): [True: 14.0M, False: 295k]
  ------------------
 2674|  14.0M|        k = RNG_INTEGER(0, n - 1);
  ------------------
  |  |  152|  14.0M|#define RNG_INTEGER(l,h) (igraph_rng_get_integer(igraph_rng_default(),(l),(h)))
  ------------------
 2675|  14.0M|        n--;
 2676|  14.0M|        dummy = VECTOR(*v)[n];
  ------------------
  |  |   60|  14.0M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2677|  14.0M|        VECTOR(*v)[n] = VECTOR(*v)[k];
  ------------------
  |  |   60|  14.0M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      VECTOR(*v)[n] = VECTOR(*v)[k];
  ------------------
  |  |   60|  14.0M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2678|  14.0M|        VECTOR(*v)[k] = dummy;
  ------------------
  |  |   60|  14.0M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 2679|  14.0M|    }
 2680|   295k|}
igraph_vector_int_minmax:
 2861|  54.7k|                          BASE *min, BASE *max) {
 2862|  54.7k|    BASE* ptr;
  ------------------
  |  |   66|  54.7k|    #define BASE igraph_int_t
  ------------------
 2863|  54.7k|    IGRAPH_ASSERT(!FUNCTION(igraph_vector, empty)(v));
  ------------------
  |  |  924|  54.7k|    do { \
  |  |  925|  54.7k|        if (IGRAPH_UNLIKELY(!(condition))) { \
  |  |  ------------------
  |  |  |  |  612|  54.7k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 54.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  926|      0|            igraph_fatal("Assertion failed: " #condition, IGRAPH_FILE_BASENAME, __LINE__); \
  |  |  927|      0|        } \
  |  |  928|  54.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (928:14): [Folded, False: 54.7k]
  |  |  ------------------
  ------------------
 2864|  54.7k|    *min = *max = *(v->stor_begin);
 2865|       |    #if defined(BASE_IGRAPH_REAL)
 2866|       |        if (isnan(*min)) { return; }; /* Result is NaN */
 2867|       |    #endif
 2868|  54.7k|    ptr = v->stor_begin + 1;
 2869|  3.03M|    while (ptr < v->end) {
  ------------------
  |  Branch (2869:12): [True: 2.98M, False: 54.7k]
  ------------------
 2870|  2.98M|        if (*ptr > *max) {
  ------------------
  |  Branch (2870:13): [True: 467k, False: 2.51M]
  ------------------
 2871|   467k|            *max = *ptr;
 2872|  2.51M|        } else if (*ptr < *min) {
  ------------------
  |  Branch (2872:20): [True: 52.0k, False: 2.46M]
  ------------------
 2873|  52.0k|            *min = *ptr;
 2874|  52.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.98M|        ptr++;
 2882|  2.98M|    }
 2883|  54.7k|}
igraph_vector_int_intersection_size_sorted:
 3172|  64.0k|        const TYPE(igraph_vector) *v2) {
 3173|       |
 3174|  64.0k|    igraph_int_t size1, size2, count;
 3175|  64.0k|    igraph_real_t r;
 3176|       |
 3177|  64.0k|    size1 = FUNCTION(igraph_vector, size)(v1);
  ------------------
  |  |  178|  64.0k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  64.0k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  64.0k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3178|  64.0k|    size2 = FUNCTION(igraph_vector, size)(v2);
  ------------------
  |  |  178|  64.0k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  64.0k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  64.0k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3179|       |
 3180|  64.0k|    count = 0;
 3181|       |
 3182|  64.0k|    if (size1 == 0 || size2 == 0) {
  ------------------
  |  Branch (3182:9): [True: 0, False: 64.0k]
  |  Branch (3182:23): [True: 0, False: 64.0k]
  ------------------
 3183|      0|        return count;
 3184|      0|    }
 3185|       |
 3186|  64.0k|    r = size1 > size2 ? (igraph_real_t) size1 / size2 : (igraph_real_t) size2 / size1;
  ------------------
  |  Branch (3186:9): [True: 26.2k, False: 37.7k]
  ------------------
 3187|       |
 3188|       |    /* When the set size ratio is small, use a simple linear scan. The ideal ratio
 3189|       |     * seems to be affected by processor cache effects. It depends on the machine,
 3190|       |     * as well as on the input sizes. The threshold of 10 was determined empirically
 3191|       |     * by using the intersection.c (direct) and igraph_ecc.c (indirect) benchmarks.
 3192|       |     * See https://github.com/igraph/igraph/pull/2618 */
 3193|  64.0k|    if (r < 10) {
  ------------------
  |  Branch (3193:9): [True: 48.9k, False: 15.0k]
  ------------------
 3194|       |        /* This is a fast branchless implementation that uses arithmetic
 3195|       |         * instead of conditionals. */
 3196|  48.9k|        igraph_int_t i1 = 0, i2 = 0;
 3197|   369k|        while (i1 < size1 && i2 < size2) {
  ------------------
  |  Branch (3197:16): [True: 343k, False: 25.9k]
  |  Branch (3197:30): [True: 320k, False: 23.0k]
  ------------------
 3198|   320k|            BASE e1 = VECTOR(*v1)[i1], e2 = VECTOR(*v2)[i2];
  ------------------
  |  |   66|   320k|    #define BASE igraph_int_t
  ------------------
                          BASE e1 = VECTOR(*v1)[i1], e2 = VECTOR(*v2)[i2];
  ------------------
  |  |   60|   320k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          BASE e1 = VECTOR(*v1)[i1], e2 = VECTOR(*v2)[i2];
  ------------------
  |  |   60|   320k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3199|   320k|            igraph_int_t d1 = (e1 <= e2), d2 = (e1 >= e2);
 3200|   320k|            i1 += d1; i2 += d2;
 3201|   320k|            count += (d1 == d2);
 3202|   320k|        }
 3203|  48.9k|    } else {
 3204|  15.0k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  15.0k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  15.0k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  15.0k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3205|  15.0k|            v1, 0, size1, v2, 0, size2, &count);
 3206|  15.0k|    }
 3207|       |
 3208|  64.0k|    return count;
 3209|  64.0k|}
vector.c:igraph_vector_i_sort_ind_cmp_desc:
 1004|   312k|static int FUNCTION(igraph_vector, i_sort_ind_cmp_desc)(const void *p1, const void *p2) {
 1005|   312k|    BASE **pa = (BASE **) p1;
  ------------------
  |  |   29|   312k|    #define BASE igraph_real_t
  ------------------
 1006|   312k|    BASE **pb = (BASE **) p2;
  ------------------
  |  |   29|   312k|    #define BASE igraph_real_t
  ------------------
 1007|   312k|    if ( **pa < **pb ) {
  ------------------
  |  Branch (1007:10): [True: 83.8k, False: 228k]
  ------------------
 1008|  83.8k|        return 1;
 1009|  83.8k|    }
 1010|   228k|    if ( **pa > **pb) {
  ------------------
  |  Branch (1010:10): [True: 74.8k, False: 153k]
  ------------------
 1011|  74.8k|        return -1;
 1012|  74.8k|    }
 1013|   153k|    return 0;
 1014|   228k|}
vector.c:igraph_i_vector_binsearch_slice:
 2183|  58.4k|        BASE what, igraph_int_t *pos, igraph_int_t start, igraph_int_t end) {
 2184|  58.4k|    igraph_int_t left  = start;
 2185|  58.4k|    igraph_int_t right = end - 1;
 2186|       |
 2187|   119k|    while (left <= right) {
  ------------------
  |  Branch (2187:12): [True: 60.5k, False: 58.4k]
  ------------------
 2188|       |        /* (right + left) / 2 could theoretically overflow for long vectors */
 2189|  60.5k|        igraph_int_t middle = left + ((right - left) >> 1);
 2190|  60.5k|        if (VECTOR(*v)[middle] > what) {
  ------------------
  |  |   60|  60.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2190:13): [True: 58.5k, False: 2.04k]
  ------------------
 2191|  58.5k|            right = middle - 1;
 2192|  58.5k|        } else if (VECTOR(*v)[middle] < what) {
  ------------------
  |  |   60|  2.04k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2192:20): [True: 2.04k, False: 0]
  ------------------
 2193|  2.04k|            left = middle + 1;
 2194|  2.04k|        } 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|  60.5k|    }
 2201|       |
 2202|       |    /* if we are here, the element was not found */
 2203|  58.4k|    if (pos != 0) {
  ------------------
  |  Branch (2203:9): [True: 58.4k, False: 0]
  ------------------
 2204|  58.4k|        *pos = left;
 2205|  58.4k|    }
 2206|       |
 2207|       |    return false;
 2208|  58.4k|}
vector.c:igraph_vector_int_i_sort_ind_cmp_asc:
  989|  12.1M|static int FUNCTION(igraph_vector, i_sort_ind_cmp_asc)(const void *p1, const void *p2) {
  990|  12.1M|    BASE **pa = (BASE **) p1;
  ------------------
  |  |   66|  12.1M|    #define BASE igraph_int_t
  ------------------
  991|  12.1M|    BASE **pb = (BASE **) p2;
  ------------------
  |  |   66|  12.1M|    #define BASE igraph_int_t
  ------------------
  992|  12.1M|    if ( **pa < **pb ) {
  ------------------
  |  Branch (992:10): [True: 6.24M, False: 5.90M]
  ------------------
  993|  6.24M|        return -1;
  994|  6.24M|    }
  995|  5.90M|    if ( **pa > **pb) {
  ------------------
  |  Branch (995:10): [True: 5.11M, False: 787k]
  ------------------
  996|  5.11M|        return 1;
  997|  5.11M|    }
  998|   787k|    return 0;
  999|  5.90M|}
vector.c:igraph_i_vector_int_binsearch_slice:
 2183|  18.7k|        BASE what, igraph_int_t *pos, igraph_int_t start, igraph_int_t end) {
 2184|  18.7k|    igraph_int_t left  = start;
 2185|  18.7k|    igraph_int_t right = end - 1;
 2186|       |
 2187|  93.0k|    while (left <= right) {
  ------------------
  |  Branch (2187:12): [True: 76.4k, False: 16.5k]
  ------------------
 2188|       |        /* (right + left) / 2 could theoretically overflow for long vectors */
 2189|  76.4k|        igraph_int_t middle = left + ((right - left) >> 1);
 2190|  76.4k|        if (VECTOR(*v)[middle] > what) {
  ------------------
  |  |   60|  76.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2190:13): [True: 59.2k, False: 17.2k]
  ------------------
 2191|  59.2k|            right = middle - 1;
 2192|  59.2k|        } else if (VECTOR(*v)[middle] < what) {
  ------------------
  |  |   60|  17.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (2192:20): [True: 15.0k, False: 2.19k]
  ------------------
 2193|  15.0k|            left = middle + 1;
 2194|  15.0k|        } else {
 2195|  2.19k|            if (pos != 0) {
  ------------------
  |  Branch (2195:17): [True: 2.19k, False: 0]
  ------------------
 2196|  2.19k|                *pos = middle;
 2197|  2.19k|            }
 2198|  2.19k|            return true;
 2199|  2.19k|        }
 2200|  76.4k|    }
 2201|       |
 2202|       |    /* if we are here, the element was not found */
 2203|  16.5k|    if (pos != 0) {
  ------------------
  |  Branch (2203:9): [True: 16.5k, False: 0]
  ------------------
 2204|  16.5k|        *pos = left;
 2205|  16.5k|    }
 2206|       |
 2207|       |    return false;
 2208|  18.7k|}
vector.c:igraph_i_vector_int_intersection_size_sorted:
 3095|  52.5k|    igraph_int_t *result) {
 3096|       |
 3097|  52.5k|    igraph_int_t size1, size2, probe1, probe2;
 3098|       |
 3099|  52.5k|    if (begin1 == end1 || begin2 == end2) {
  ------------------
  |  Branch (3099:9): [True: 23.4k, False: 29.1k]
  |  Branch (3099:27): [True: 10.3k, False: 18.7k]
  ------------------
 3100|  33.8k|        return;
 3101|  33.8k|    }
 3102|       |
 3103|  18.7k|    size1 = end1 - begin1;
 3104|  18.7k|    size2 = end2 - begin2;
 3105|       |
 3106|  18.7k|    if (size1 < size2) {
  ------------------
  |  Branch (3106:9): [True: 9.19k, False: 9.55k]
  ------------------
 3107|  9.19k|        probe1 = begin1 + (size1 >> 1);      /* pick the median element */
 3108|  9.19k|        FUNCTION(igraph_i_vector, binsearch_slice)(v2, VECTOR(*v1)[probe1], &probe2, begin2, end2);
  ------------------
  |  |  178|  9.19k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  9.19k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  9.19k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      FUNCTION(igraph_i_vector, binsearch_slice)(v2, VECTOR(*v1)[probe1], &probe2, begin2, end2);
  ------------------
  |  |   60|  9.19k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3109|  9.19k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  9.19k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  9.19k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  9.19k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3110|  9.19k|            v1, begin1, probe1, v2, begin2, probe2, result
 3111|  9.19k|        );
 3112|  9.19k|        if (!(probe2 == end2 || VECTOR(*v1)[probe1] < VECTOR(*v2)[probe2])) {
  ------------------
  |  |   60|  8.76k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (!(probe2 == end2 || VECTOR(*v1)[probe1] < VECTOR(*v2)[probe2])) {
  ------------------
  |  |   60|  8.76k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (3112:15): [True: 428, False: 8.76k]
  |  Branch (3112:33): [True: 7.74k, False: 1.01k]
  ------------------
 3113|  1.01k|            (*result)++;
 3114|  1.01k|            probe2++;
 3115|  1.01k|        }
 3116|  9.19k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  9.19k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  9.19k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  9.19k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3117|  9.19k|            v1, probe1 + 1, end1, v2, probe2, end2, result
 3118|  9.19k|        );
 3119|  9.55k|    } else {
 3120|  9.55k|        probe2 = begin2 + (size2 >> 1);      /* pick the median element */
 3121|  9.55k|        FUNCTION(igraph_i_vector, binsearch_slice)(v1, VECTOR(*v2)[probe2], &probe1, begin1, end1);
  ------------------
  |  |  178|  9.55k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  9.55k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  9.55k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      FUNCTION(igraph_i_vector, binsearch_slice)(v1, VECTOR(*v2)[probe2], &probe1, begin1, end1);
  ------------------
  |  |   60|  9.55k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 3122|  9.55k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  9.55k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  9.55k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  9.55k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3123|  9.55k|            v1, begin1, probe1, v2, begin2, probe2, result
 3124|  9.55k|        );
 3125|  9.55k|        if (!(probe1 == end1 || VECTOR(*v2)[probe2] < VECTOR(*v1)[probe1])) {
  ------------------
  |  |   60|  8.90k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (!(probe1 == end1 || VECTOR(*v2)[probe2] < VECTOR(*v1)[probe1])) {
  ------------------
  |  |   60|  8.90k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (3125:15): [True: 646, False: 8.90k]
  |  Branch (3125:33): [True: 7.73k, False: 1.17k]
  ------------------
 3126|  1.17k|            (*result)++;
 3127|  1.17k|            probe1++;
 3128|  1.17k|        }
 3129|  9.55k|        FUNCTION(igraph_i_vector, intersection_size_sorted)(
  ------------------
  |  |  178|  9.55k|        #define FUNCTION(a,c) CONCAT3(a,SHORT,c)
  |  |  ------------------
  |  |  |  |   22|  9.55k|#define CONCAT3(a,b,c) CONCAT3x(a,b,c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  9.55k|#define CONCAT3x(a,b,c) a ## _ ## b ## _ ## c
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3130|  9.55k|            v1, probe1, end1, v2, probe2 + 1, end2, result
 3131|  9.55k|        );
 3132|  9.55k|    }
 3133|  18.7k|}

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

igraph_adjlist_init:
  155|  13.6k|                        igraph_bool_t multiple) {
  156|       |
  157|  13.6k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  158|  13.6k|    igraph_vector_int_t degrees;
  159|  13.6k|    int iter = 0;
  160|       |
  161|  13.6k|    multiple = !!multiple; /* normalize Boolean value to enable == comparisons below */
  162|       |
  163|  13.6k|    if (mode != IGRAPH_IN && mode != IGRAPH_OUT && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (163:9): [True: 6.88k, False: 6.76k]
  |  Branch (163:30): [True: 6.88k, False: 0]
  |  Branch (163:52): [True: 0, False: 6.88k]
  ------------------
  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|  13.6k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (167:9): [True: 218, False: 13.4k]
  ------------------
  168|    218|        mode = IGRAPH_ALL;
  169|    218|    }
  170|       |
  171|  13.6k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, no_of_nodes);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  172|       |    /* igraph_degree() is fast when loops=true */
  173|  13.6k|    IGRAPH_CHECK(igraph_degree(graph, &degrees, igraph_vss_all(), mode, IGRAPH_LOOPS));
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  174|       |
  175|  13.6k|    al->length = no_of_nodes;
  176|  13.6k|    al->adjs = IGRAPH_CALLOC(al->length, igraph_vector_int_t);
  ------------------
  |  |   33|  13.6k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  27.2k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 13.6k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 13.6k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 13.6k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  13.6k|    IGRAPH_CHECK_OOM(al->adjs, "Insufficient memory for creating adjacency list view.");
  ------------------
  |  |  709|  13.6k|    do { \
  |  |  710|  13.6k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  13.6k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 13.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|  13.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 13.6k]
  |  |  ------------------
  ------------------
  178|  13.6k|    IGRAPH_FINALLY(igraph_adjlist_destroy, al);
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  179|       |
  180|       |    /* if we already know there are no multi-edges, they don't need to be removed */
  181|  13.6k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI) &&
  ------------------
  |  Branch (181:9): [True: 3.50k, False: 10.1k]
  ------------------
  182|  3.50k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MULTI)) {
  ------------------
  |  Branch (182:9): [True: 3.50k, 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.50k|        if (igraph_is_directed(graph) && mode == IGRAPH_ALL) {
  ------------------
  |  Branch (186:13): [True: 3.29k, False: 218]
  |  Branch (186:42): [True: 3.29k, False: 0]
  ------------------
  187|  3.29k|            if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MUTUAL) &&
  ------------------
  |  Branch (187:17): [True: 0, False: 3.29k]
  ------------------
  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.29k|        } else {
  192|    218|            multiple = IGRAPH_MULTIPLE;
  193|    218|        }
  194|  3.50k|    }
  195|       |
  196|       |    /* if we already know there are no loops, they don't need to be removed */
  197|  13.6k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (197:9): [True: 5.60k, False: 8.04k]
  ------------------
  198|  5.60k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (198:9): [True: 3.50k, False: 2.09k]
  ------------------
  199|  3.50k|        if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (199:13): [True: 3.50k, False: 0]
  ------------------
  200|  3.50k|            loops = IGRAPH_LOOPS_TWICE;
  201|  3.50k|        } else {
  202|      0|            loops = IGRAPH_LOOPS_ONCE;
  203|      0|        }
  204|  3.50k|    }
  205|       |
  206|  13.6k|    igraph_bool_t has_loops = false;
  207|  13.6k|    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|   656k|    for (igraph_int_t i = 0; i < al->length; i++) {
  ------------------
  |  Branch (215:30): [True: 643k, False: 13.6k]
  ------------------
  216|   643k|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1000);
  ------------------
  |  |   71|   643k|    do { \
  |  |   72|   643k|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 0, False: 643k]
  |  |  ------------------
  |  |   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|   643k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 643k]
  |  |  ------------------
  ------------------
  217|       |
  218|   643k|        IGRAPH_CHECK(igraph_vector_int_init(&al->adjs[i], VECTOR(degrees)[i]));
  ------------------
  |  |  656|   643k|    do { \
  |  |  657|   643k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   643k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   643k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 643k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   643k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 643k]
  |  |  ------------------
  ------------------
  219|   643k|        IGRAPH_CHECK(igraph_neighbors(graph, &al->adjs[i], i, mode, IGRAPH_LOOPS, IGRAPH_MULTIPLE));
  ------------------
  |  |  656|   643k|    do { \
  |  |  657|   643k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   643k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   643k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 643k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   643k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 643k]
  |  |  ------------------
  ------------------
  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|   643k|        IGRAPH_CHECK(igraph_i_simplify_sorted_int_adjacency_vector_in_place(
  ------------------
  |  |  656|   643k|    do { \
  |  |  657|   643k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   643k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   643k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 643k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   643k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 643k]
  |  |  ------------------
  ------------------
  224|   643k|            &al->adjs[i], i, mode, loops, multiple, &has_loops, &has_multiple
  225|   643k|        ));
  226|   643k|    }
  227|  13.6k|    if (has_loops) {
  ------------------
  |  Branch (227:9): [True: 1.04k, False: 12.6k]
  ------------------
  228|       |        /* If we have found at least one loop above, set the cache to true. */
  229|  1.04k|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_LOOP, true);
  230|  12.6k|    } else if (loops == IGRAPH_NO_LOOPS) {
  ------------------
  |  Branch (230:16): [True: 0, False: 12.6k]
  ------------------
  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|  13.6k|    if (has_multiple) {
  ------------------
  |  Branch (237:9): [True: 789, False: 12.8k]
  ------------------
  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|    789|        if (! igraph_is_directed(graph) || mode != IGRAPH_ALL) {
  ------------------
  |  Branch (241:13): [True: 0, False: 789]
  |  Branch (241:44): [True: 0, False: 789]
  ------------------
  242|      0|            igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, true);
  243|      0|        }
  244|  12.8k|    } else if (multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (244:16): [True: 2.50k, False: 10.3k]
  ------------------
  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.50k|        igraph_i_property_cache_set_bool_checked(graph, IGRAPH_PROP_HAS_MULTI, false);
  250|  2.50k|    }
  251|       |
  252|  13.6k|    igraph_vector_int_destroy(&degrees);
  253|  13.6k|    IGRAPH_FINALLY_CLEAN(2); /* + igraph_adjlist_destroy */
  254|       |
  255|  13.6k|    return IGRAPH_SUCCESS;
  256|  13.6k|}
igraph_adjlist_destroy:
  475|  13.6k|void igraph_adjlist_destroy(igraph_adjlist_t *al) {
  476|   656k|    for (igraph_int_t i = 0; i < al->length; i++) {
  ------------------
  |  Branch (476:30): [True: 643k, False: 13.6k]
  ------------------
  477|       |        /* This works if some igraph_vector_int_t's contain NULL,
  478|       |           because igraph_vector_int_destroy can handle this. */
  479|   643k|        igraph_vector_int_destroy(&al->adjs[i]);
  480|   643k|    }
  481|       |    IGRAPH_FREE(al->adjs);
  ------------------
  |  |   36|  13.6k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  482|  13.6k|}
igraph_inclist_init:
  746|  28.1k|                        igraph_loops_t loops) {
  747|  28.1k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  748|  28.1k|    igraph_vector_int_t degrees;
  749|  28.1k|    int iter = 0;
  750|       |
  751|  28.1k|    if (mode != IGRAPH_IN && mode != IGRAPH_OUT && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (751:9): [True: 24.7k, False: 3.38k]
  |  Branch (751:30): [True: 14.8k, False: 9.96k]
  |  Branch (751:52): [True: 0, False: 14.8k]
  ------------------
  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|  28.1k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (755:9): [True: 6.76k, False: 21.4k]
  ------------------
  756|  6.76k|        mode = IGRAPH_ALL;
  757|  6.76k|    }
  758|       |
  759|  28.1k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, no_of_nodes);
  ------------------
  |  |  119|  28.1k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  28.1k|    do { \
  |  |  |  |  657|  28.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  28.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  28.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 28.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|  28.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 28.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  28.1k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  28.1k|    do { \
  |  |  |  |  604|  28.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  28.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  28.1k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  28.1k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 28.1k]
  |  |  |  |  ------------------
  |  |  |  |  608|  28.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  28.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 28.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 28.1k]
  |  |  ------------------
  ------------------
  760|       |    /* igraph_degrees() is fast when loops=true */
  761|  28.1k|    IGRAPH_CHECK(igraph_degree(graph, &degrees, igraph_vss_all(), mode, IGRAPH_LOOPS));
  ------------------
  |  |  656|  28.1k|    do { \
  |  |  657|  28.1k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  28.1k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  28.1k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 28.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|  28.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 28.1k]
  |  |  ------------------
  ------------------
  762|       |
  763|  28.1k|    il->length = no_of_nodes;
  764|  28.1k|    il->incs = IGRAPH_CALLOC(il->length, igraph_vector_int_t);
  ------------------
  |  |   33|  28.1k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  56.3k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 28.1k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 28.1k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 28.1k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  765|  28.1k|    if (il->incs == 0) {
  ------------------
  |  Branch (765:9): [True: 0, False: 28.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|  28.1k|    IGRAPH_FINALLY(igraph_inclist_destroy, il);
  ------------------
  |  |  603|  28.1k|    do { \
  |  |  604|  28.1k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  28.1k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  28.1k|         * incorrect destructor function with the pointer */ \
  |  |  607|  28.1k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 28.1k]
  |  |  ------------------
  |  |  608|  28.1k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  28.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 28.1k]
  |  |  ------------------
  ------------------
  770|  1.36M|    for (igraph_int_t i = 0; i < il->length; i++) {
  ------------------
  |  Branch (770:30): [True: 1.33M, False: 28.1k]
  ------------------
  771|  1.33M|        IGRAPH_ALLOW_INTERRUPTION_LIMITED(iter, 1000);
  ------------------
  |  |   71|  1.33M|    do { \
  |  |   72|  1.33M|        if (++iter >= skips) { \
  |  |  ------------------
  |  |  |  Branch (72:13): [True: 0, False: 1.33M]
  |  |  ------------------
  |  |   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.33M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (76:14): [Folded, False: 1.33M]
  |  |  ------------------
  ------------------
  772|       |
  773|  1.33M|        IGRAPH_CHECK(igraph_vector_int_init(&il->incs[i], VECTOR(degrees)[i]));
  ------------------
  |  |  656|  1.33M|    do { \
  |  |  657|  1.33M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.33M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.33M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.33M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.33M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.33M]
  |  |  ------------------
  ------------------
  774|  1.33M|        IGRAPH_CHECK(igraph_incident(graph, &il->incs[i], i, mode, loops));
  ------------------
  |  |  656|  1.33M|    do { \
  |  |  657|  1.33M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.33M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.33M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.33M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.33M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.33M]
  |  |  ------------------
  ------------------
  775|  1.33M|    }
  776|       |
  777|  28.1k|    igraph_vector_int_destroy(&degrees);
  778|  28.1k|    IGRAPH_FINALLY_CLEAN(2); /* + igraph_inclist_destroy */
  779|       |
  780|  28.1k|    return IGRAPH_SUCCESS;
  781|  28.1k|}
igraph_inclist_destroy:
  825|  28.1k|void igraph_inclist_destroy(igraph_inclist_t *il) {
  826|  1.36M|    for (igraph_int_t i = 0; i < il->length; i++) {
  ------------------
  |  Branch (826:30): [True: 1.33M, False: 28.1k]
  ------------------
  827|       |        /* This works if some igraph_vector_int_t's contain NULL,
  828|       |           because igraph_vector_int_destroy can handle this. */
  829|  1.33M|        igraph_vector_int_destroy(&il->incs[i]);
  830|  1.33M|    }
  831|       |    IGRAPH_FREE(il->incs);
  ------------------
  |  |   36|  28.1k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  832|  28.1k|}
igraph_lazy_adjlist_init:
 1070|  3.29k|                             igraph_bool_t multiple) {
 1071|  3.29k|    if (mode != IGRAPH_IN && mode != IGRAPH_OUT && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1071:9): [True: 3.29k, False: 0]
  |  Branch (1071:30): [True: 3.29k, False: 0]
  |  Branch (1071:52): [True: 0, False: 3.29k]
  ------------------
 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.29k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (1075:9): [True: 0, False: 3.29k]
  ------------------
 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.29k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MULTI) &&
  ------------------
  |  Branch (1080:9): [True: 3.29k, False: 0]
  ------------------
 1081|  3.29k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_MULTI)) {
  ------------------
  |  Branch (1081:9): [True: 3.29k, 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.29k|        if (igraph_is_directed(graph) && mode == IGRAPH_ALL) {
  ------------------
  |  Branch (1085:13): [True: 3.29k, False: 0]
  |  Branch (1085:42): [True: 3.29k, False: 0]
  ------------------
 1086|  3.29k|            if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_MUTUAL) &&
  ------------------
  |  Branch (1086:17): [True: 0, False: 3.29k]
  ------------------
 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.29k|        } else {
 1091|      0|            multiple = IGRAPH_MULTIPLE;
 1092|      0|        }
 1093|  3.29k|    }
 1094|       |
 1095|       |    /* if we already know there are no loops, they don't need to be removed */
 1096|  3.29k|    if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (1096:9): [True: 3.29k, False: 0]
  ------------------
 1097|  3.29k|        !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (1097:9): [True: 3.29k, False: 0]
  ------------------
 1098|  3.29k|        if (mode == IGRAPH_ALL) {
  ------------------
  |  Branch (1098:13): [True: 3.29k, False: 0]
  ------------------
 1099|  3.29k|            loops = IGRAPH_LOOPS_TWICE;
 1100|  3.29k|        } else {
 1101|      0|            loops = IGRAPH_LOOPS_ONCE;
 1102|      0|        }
 1103|  3.29k|    }
 1104|       |
 1105|  3.29k|    al->mode = mode;
 1106|  3.29k|    al->loops = loops;
 1107|  3.29k|    al->multiple = multiple;
 1108|  3.29k|    al->graph = graph;
 1109|       |
 1110|  3.29k|    al->length = igraph_vcount(graph);
 1111|  3.29k|    al->adjs = IGRAPH_CALLOC(al->length, igraph_vector_int_t*);
  ------------------
  |  |   33|  3.29k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  6.58k|    (t*) ((0 <= (n) && ((size_t)(n)) <= SIZE_MAX / sizeof(t)) ? (expr) : NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (31:12): [True: 3.29k, False: 0]
  |  |  |  |  |  Branch (31:24): [True: 3.29k, False: 0]
  |  |  |  |  |  Branch (31:66): [True: 3.29k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1112|  3.29k|    IGRAPH_CHECK_OOM(al->adjs, "Insufficient memory for creating lazy adjacency list view.");
  ------------------
  |  |  709|  3.29k|    do { \
  |  |  710|  3.29k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  3.29k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 3.29k]
  |  |  ------------------
  ------------------
 1113|       |
 1114|  3.29k|    return IGRAPH_SUCCESS;
 1115|  3.29k|}
igraph_lazy_adjlist_destroy:
 1127|  3.29k|void igraph_lazy_adjlist_destroy(igraph_lazy_adjlist_t *al) {
 1128|  3.29k|    igraph_lazy_adjlist_clear(al);
 1129|       |    IGRAPH_FREE(al->adjs);
  ------------------
  |  |   36|  3.29k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1130|  3.29k|}
igraph_lazy_adjlist_clear:
 1140|  3.29k|void igraph_lazy_adjlist_clear(igraph_lazy_adjlist_t *al) {
 1141|  3.29k|    igraph_int_t i, n = al->length;
 1142|   161k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1142:17): [True: 157k, False: 3.29k]
  ------------------
 1143|   157k|        if (al->adjs[i] != 0) {
  ------------------
  |  Branch (1143:13): [True: 157k, False: 0]
  ------------------
 1144|   157k|            igraph_vector_int_destroy(al->adjs[i]);
 1145|       |            IGRAPH_FREE(al->adjs[i]);
  ------------------
  |  |   36|   157k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
 1146|   157k|        }
 1147|   157k|    }
 1148|  3.29k|}
igraph_i_lazy_adjlist_get_real:
 1163|   157k|igraph_vector_int_t *igraph_i_lazy_adjlist_get_real(igraph_lazy_adjlist_t *al, igraph_int_t no) {
 1164|   157k|    igraph_error_t ret;
 1165|       |
 1166|   157k|    if (al->adjs[no] == NULL) {
  ------------------
  |  Branch (1166:9): [True: 157k, False: 0]
  ------------------
 1167|   157k|        al->adjs[no] = IGRAPH_CALLOC(1, igraph_vector_int_t);
  ------------------
  |  |   33|   157k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|   315k|    (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: 157k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1168|   157k|        if (al->adjs[no] == NULL) {
  ------------------
  |  Branch (1168:13): [True: 0, False: 157k]
  ------------------
 1169|      0|            return NULL;
 1170|      0|        }
 1171|       |
 1172|   157k|        ret = igraph_vector_int_init(al->adjs[no], 0);
 1173|   157k|        if (ret != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (1173:13): [True: 0, False: 157k]
  ------------------
 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|   157k|        ret = igraph_neighbors(al->graph, al->adjs[no], no, al->mode, al->loops, al->multiple);
 1179|   157k|        if (ret != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (1179:13): [True: 0, False: 157k]
  ------------------
 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|   157k|    }
 1185|       |
 1186|   157k|    return al->adjs[no];
 1187|   157k|}
adjlist.c:igraph_i_simplify_sorted_int_adjacency_vector_in_place:
  871|   643k|) {
  872|   643k|    igraph_bool_t dummy1 = true, dummy2 = true; /* set dummies to avoid uninitialized read */
  873|   643k|    if (has_loops == NULL) {
  ------------------
  |  Branch (873:9): [True: 0, False: 643k]
  ------------------
  874|      0|        has_loops = &dummy1;
  875|      0|    }
  876|   643k|    if (has_multiple == NULL) {
  ------------------
  |  Branch (876:9): [True: 0, False: 643k]
  ------------------
  877|      0|        has_multiple = &dummy2;
  878|      0|    }
  879|       |
  880|   643k|    igraph_int_t i, p = 0;
  881|   643k|    igraph_int_t n = igraph_vector_int_size(v);
  882|       |
  883|   643k|    multiple = !!multiple; /* normalize Boolean value to enable == comparisons below */
  884|       |
  885|   643k|    if (
  886|   643k|        multiple == IGRAPH_MULTIPLE &&
  ------------------
  |  Branch (886:9): [True: 485k, False: 157k]
  ------------------
  887|   485k|        (
  888|   485k|            loops == IGRAPH_LOOPS_TWICE ||
  ------------------
  |  Branch (888:13): [True: 3.91k, False: 481k]
  ------------------
  889|   481k|            (loops == IGRAPH_LOOPS_ONCE && (mode == IGRAPH_IN || mode == IGRAPH_OUT))
  ------------------
  |  Branch (889:14): [True: 481k, False: 0]
  |  Branch (889:45): [True: 320k, False: 160k]
  |  Branch (889:66): [True: 0, False: 160k]
  ------------------
  890|   485k|        )
  891|   643k|    ) {
  892|       |        /* nothing to simplify */
  893|   324k|        return IGRAPH_SUCCESS;
  894|   324k|    }
  895|       |
  896|   318k|    if (loops == IGRAPH_NO_LOOPS) {
  ------------------
  |  Branch (896:9): [True: 0, False: 318k]
  ------------------
  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|   318k|    } else if (loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (940:16): [True: 160k, False: 157k]
  ------------------
  941|   160k|        if (multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (941:13): [True: 0, False: 160k]
  ------------------
  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|   160k|        } 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|   340k|            for (i = 0; i < n; i++) {
  ------------------
  |  Branch (970:25): [True: 180k, False: 160k]
  ------------------
  971|   180k|                VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|   180k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|   180k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  972|   180k|                if (VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|   180k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (972:21): [True: 23.7k, False: 156k]
  ------------------
  973|  23.7k|                    *has_loops = true;
  974|       |                    /* this was a loop edge so if the next element is the same, we
  975|       |                    * need to skip that */
  976|  23.7k|                    if (i < n-1 && VECTOR(*v)[i + 1] == index) {
  ------------------
  |  |   60|  23.7k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (976:25): [True: 23.7k, False: 0]
  |  Branch (976:36): [True: 23.7k, False: 0]
  ------------------
  977|  23.7k|                        i++;
  978|  23.7k|                    }
  979|  23.7k|                }
  980|   180k|                p++;
  981|   180k|            }
  982|   160k|        }
  983|   160k|    } else if (loops == IGRAPH_LOOPS_TWICE && multiple == IGRAPH_NO_MULTIPLE) {
  ------------------
  |  Branch (983:16): [True: 157k, False: 0]
  |  Branch (983:47): [True: 157k, 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|   285k|        for (i = 0; i < n; i++) {
  ------------------
  |  Branch (986:21): [True: 128k, False: 157k]
  ------------------
  987|   128k|            if (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i]) {
  ------------------
  |  |   60|  76.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          if (i == n - 1 || VECTOR(*v)[i + 1] != VECTOR(*v)[i]) {
  ------------------
  |  |   60|  76.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (987:17): [True: 51.1k, False: 76.8k]
  |  Branch (987:31): [True: 71.6k, False: 5.20k]
  ------------------
  988|   122k|                VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|   122k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*v)[p] = VECTOR(*v)[i];
  ------------------
  |  |   60|   122k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  989|   122k|                p++;
  990|   122k|            } else {
  991|  5.20k|                *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|  5.20k|                if (VECTOR(*v)[i] == index) {
  ------------------
  |  |   60|  5.20k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (996:21): [True: 0, False: 5.20k]
  ------------------
  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|  5.20k|            }
 1010|   128k|        }
 1011|   157k|    } 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|   318k|    igraph_vector_int_resize(v, p);
 1018|       |
 1019|   318k|    return IGRAPH_SUCCESS;
 1020|   318k|}

igraph_i_attribute_init:
  617|  44.2k|) {
  618|  44.2k|    graph->attr = NULL;
  619|  44.2k|    if (igraph_i_attribute_table) {
  ------------------
  |  Branch (619:9): [True: 0, False: 44.2k]
  ------------------
  620|      0|        IGRAPH_CHECK(igraph_i_attribute_table->init(graph, 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]
  |  |  ------------------
  ------------------
  621|      0|        if (graph->attr == NULL) {
  ------------------
  |  Branch (621:13): [True: 0, False: 0]
  ------------------
  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|      0|    }
  625|  44.2k|    return IGRAPH_SUCCESS;
  626|  44.2k|}
igraph_i_attribute_destroy:
  628|  67.8k|void igraph_i_attribute_destroy(igraph_t *graph) {
  629|  67.8k|    if (graph->attr && igraph_i_attribute_table) {
  ------------------
  |  Branch (629:9): [True: 0, False: 67.8k]
  |  Branch (629:24): [True: 0, False: 0]
  ------------------
  630|      0|        igraph_i_attribute_table->destroy(graph);
  631|      0|    }
  632|       |    graph->attr = NULL;
  633|  67.8k|}
igraph_i_attribute_copy:
  636|  16.9k|                            igraph_bool_t va, igraph_bool_t ea) {
  637|  16.9k|    igraph_i_attribute_destroy(to);
  638|  16.9k|    if (from->attr && igraph_i_attribute_table) {
  ------------------
  |  Branch (638:9): [True: 0, False: 16.9k]
  |  Branch (638:23): [True: 0, False: 0]
  ------------------
  639|      0|        IGRAPH_CHECK(igraph_i_attribute_table->copy(to, from, ga, va, ea));
  ------------------
  |  |  656|      0|    do { \
  |  |  657|      0|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|      0|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|      0|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  640|      0|        if (to->attr == NULL) {
  ------------------
  |  Branch (640:13): [True: 0, False: 0]
  ------------------
  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|      0|    }
  644|  16.9k|    return IGRAPH_SUCCESS;
  645|  16.9k|}

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

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

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

igraph_empty_attrs:
  102|  44.2k|) {
  103|       |
  104|  44.2k|    if (n < 0) {
  ------------------
  |  Branch (104:9): [True: 0, False: 44.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|  44.2k|    memset(graph, 0, sizeof(igraph_t));
  109|       |
  110|  44.2k|    graph->n = 0;
  111|  44.2k|    graph->directed = directed;
  112|  44.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->from, 0);
  ------------------
  |  |  119|  44.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  44.2k|    do { \
  |  |  |  |  657|  44.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  44.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  44.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  44.2k|    do { \
  |  |  |  |  604|  44.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  44.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  44.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  44.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  44.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  113|  44.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->to, 0);
  ------------------
  |  |  119|  44.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  44.2k|    do { \
  |  |  |  |  657|  44.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  44.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  44.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  44.2k|    do { \
  |  |  |  |  604|  44.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  44.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  44.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  44.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  44.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  114|  44.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->oi, 0);
  ------------------
  |  |  119|  44.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  44.2k|    do { \
  |  |  |  |  657|  44.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  44.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  44.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  44.2k|    do { \
  |  |  |  |  604|  44.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  44.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  44.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  44.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  44.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  115|  44.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->ii, 0);
  ------------------
  |  |  119|  44.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  44.2k|    do { \
  |  |  |  |  657|  44.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  44.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  44.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  44.2k|    do { \
  |  |  |  |  604|  44.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  44.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  44.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  44.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  44.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  116|  44.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->os, 1);
  ------------------
  |  |  119|  44.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  44.2k|    do { \
  |  |  |  |  657|  44.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  44.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  44.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  44.2k|    do { \
  |  |  |  |  604|  44.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  44.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  44.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  44.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  44.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  117|  44.2k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&graph->is, 1);
  ------------------
  |  |  119|  44.2k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  44.2k|    do { \
  |  |  |  |  657|  44.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  44.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  44.2k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  44.2k|    do { \
  |  |  |  |  604|  44.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  44.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  44.2k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  44.2k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  |  |  608|  44.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  44.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  118|       |
  119|       |    /* init cache */
  120|  44.2k|    graph->cache = IGRAPH_CALLOC(1, igraph_i_property_cache_t);
  ------------------
  |  |   33|  44.2k|#define IGRAPH_CALLOC(n,t)    IGRAPH_I_ALLOC_CHECK_OVERFLOW(n, t, calloc(sizeof(t) * ((n) > 0 ? (n) : 1), 1))
  |  |  ------------------
  |  |  |  |   31|  88.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: 44.2k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  121|  44.2k|    IGRAPH_CHECK_OOM(graph->cache, "Cannot create graph.");
  ------------------
  |  |  709|  44.2k|    do { \
  |  |  710|  44.2k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  122|  44.2k|    IGRAPH_FINALLY(igraph_free, graph->cache);
  ------------------
  |  |  603|  44.2k|    do { \
  |  |  604|  44.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  44.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  44.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  44.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 44.2k]
  |  |  ------------------
  |  |  608|  44.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  44.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  123|  44.2k|    IGRAPH_CHECK(igraph_i_property_cache_init(graph->cache));
  ------------------
  |  |  656|  44.2k|    do { \
  |  |  657|  44.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  44.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  124|  44.2k|    IGRAPH_FINALLY(igraph_i_property_cache_destroy, graph->cache);
  ------------------
  |  |  603|  44.2k|    do { \
  |  |  604|  44.2k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  44.2k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  44.2k|         * incorrect destructor function with the pointer */ \
  |  |  607|  44.2k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 44.2k]
  |  |  ------------------
  |  |  608|  44.2k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  44.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  125|       |
  126|  44.2k|    VECTOR(graph->os)[0] = 0;
  ------------------
  |  |   60|  44.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  127|  44.2k|    VECTOR(graph->is)[0] = 0;
  ------------------
  |  |   60|  44.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  128|       |
  129|       |    /* init attributes */
  130|  44.2k|    IGRAPH_CHECK(igraph_i_attribute_init(graph, attr));
  ------------------
  |  |  656|  44.2k|    do { \
  |  |  657|  44.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  44.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  131|       |
  132|       |    /* add the vertices */
  133|  44.2k|    IGRAPH_CHECK(igraph_add_vertices(graph, n, 0));
  ------------------
  |  |  656|  44.2k|    do { \
  |  |  657|  44.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  44.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  44.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 44.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|  44.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  134|       |
  135|  44.2k|    IGRAPH_FINALLY_CLEAN(8);
  136|  44.2k|    return IGRAPH_SUCCESS;
  137|  44.2k|}
igraph_destroy:
  155|  50.9k|void igraph_destroy(igraph_t *graph) {
  156|  50.9k|    igraph_i_attribute_destroy(graph);
  157|       |
  158|  50.9k|    igraph_i_property_cache_destroy(graph->cache);
  159|  50.9k|    IGRAPH_FREE(graph->cache);
  ------------------
  |  |   36|  50.9k|#define IGRAPH_FREE(p)        (free( (void *)(p) ), (p) = NULL)
  ------------------
  160|       |
  161|  50.9k|    igraph_vector_int_destroy(&graph->from);
  162|  50.9k|    igraph_vector_int_destroy(&graph->to);
  163|  50.9k|    igraph_vector_int_destroy(&graph->oi);
  164|  50.9k|    igraph_vector_int_destroy(&graph->ii);
  165|  50.9k|    igraph_vector_int_destroy(&graph->os);
  166|  50.9k|    igraph_vector_int_destroy(&graph->is);
  167|  50.9k|}
igraph_copy:
  195|  6.76k|igraph_error_t igraph_copy(igraph_t *to, const igraph_t *from) {
  196|  6.76k|    memset(to, 0, sizeof(igraph_t));
  197|       |
  198|  6.76k|    to->n = from->n;
  199|  6.76k|    to->directed = from->directed;
  200|  6.76k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->from, &from->from));
  ------------------
  |  |  656|  6.76k|    do { \
  |  |  657|  6.76k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.76k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  201|  6.76k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->from);
  ------------------
  |  |  603|  6.76k|    do { \
  |  |  604|  6.76k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.76k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.76k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.76k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.76k]
  |  |  ------------------
  |  |  608|  6.76k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  202|  6.76k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->to, &from->to));
  ------------------
  |  |  656|  6.76k|    do { \
  |  |  657|  6.76k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.76k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  203|  6.76k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->to);
  ------------------
  |  |  603|  6.76k|    do { \
  |  |  604|  6.76k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.76k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.76k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.76k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.76k]
  |  |  ------------------
  |  |  608|  6.76k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  204|  6.76k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->oi, &from->oi));
  ------------------
  |  |  656|  6.76k|    do { \
  |  |  657|  6.76k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.76k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  205|  6.76k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->oi);
  ------------------
  |  |  603|  6.76k|    do { \
  |  |  604|  6.76k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.76k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.76k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.76k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.76k]
  |  |  ------------------
  |  |  608|  6.76k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  206|  6.76k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->ii, &from->ii));
  ------------------
  |  |  656|  6.76k|    do { \
  |  |  657|  6.76k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.76k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  207|  6.76k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->ii);
  ------------------
  |  |  603|  6.76k|    do { \
  |  |  604|  6.76k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.76k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.76k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.76k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.76k]
  |  |  ------------------
  |  |  608|  6.76k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  208|  6.76k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->os, &from->os));
  ------------------
  |  |  656|  6.76k|    do { \
  |  |  657|  6.76k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.76k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  209|  6.76k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->os);
  ------------------
  |  |  603|  6.76k|    do { \
  |  |  604|  6.76k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.76k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.76k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.76k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.76k]
  |  |  ------------------
  |  |  608|  6.76k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  210|  6.76k|    IGRAPH_CHECK(igraph_vector_int_init_copy(&to->is, &from->is));
  ------------------
  |  |  656|  6.76k|    do { \
  |  |  657|  6.76k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.76k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  211|  6.76k|    IGRAPH_FINALLY(igraph_vector_int_destroy, &to->is);
  ------------------
  |  |  603|  6.76k|    do { \
  |  |  604|  6.76k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.76k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.76k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.76k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.76k]
  |  |  ------------------
  |  |  608|  6.76k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  212|       |
  213|  6.76k|    to->cache = IGRAPH_CALLOC(1, igraph_i_property_cache_t);
  ------------------
  |  |   33|  6.76k|#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: 0, Folded]
  |  |  |  |  |  Branch (31:24): [True: 0, Folded]
  |  |  |  |  |  Branch (31:66): [True: 6.76k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|  6.76k|    IGRAPH_CHECK_OOM(to->cache, "Cannot copy graph.");
  ------------------
  |  |  709|  6.76k|    do { \
  |  |  710|  6.76k|        if (IGRAPH_UNLIKELY(!ptr)) { \
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (713:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  215|  6.76k|    IGRAPH_FINALLY(igraph_free, to->cache);
  ------------------
  |  |  603|  6.76k|    do { \
  |  |  604|  6.76k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.76k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.76k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.76k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.76k]
  |  |  ------------------
  |  |  608|  6.76k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  216|  6.76k|    IGRAPH_CHECK(igraph_i_property_cache_copy(to->cache, from->cache));
  ------------------
  |  |  656|  6.76k|    do { \
  |  |  657|  6.76k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.76k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  217|  6.76k|    IGRAPH_FINALLY(igraph_i_property_cache_destroy, to->cache);
  ------------------
  |  |  603|  6.76k|    do { \
  |  |  604|  6.76k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  6.76k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  6.76k|         * incorrect destructor function with the pointer */ \
  |  |  607|  6.76k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 6.76k]
  |  |  ------------------
  |  |  608|  6.76k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  6.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  218|       |
  219|  6.76k|    IGRAPH_CHECK(igraph_i_attribute_copy(to, from, true, true, true));
  ------------------
  |  |  656|  6.76k|    do { \
  |  |  657|  6.76k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  6.76k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  6.76k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 6.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.76k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 6.76k]
  |  |  ------------------
  ------------------
  220|       |
  221|  6.76k|    IGRAPH_FINALLY_CLEAN(8);
  222|  6.76k|    return IGRAPH_SUCCESS;
  223|  6.76k|}
igraph_add_edges:
  257|  30.0k|) {
  258|  30.0k|    igraph_int_t no_of_edges = igraph_vector_int_size(&graph->from);
  259|  30.0k|    igraph_int_t edges_to_add = igraph_vector_int_size(edges) / 2;
  260|  30.0k|    igraph_int_t new_no_of_edges;
  261|  30.0k|    igraph_int_t i = 0;
  262|  30.0k|    igraph_vector_int_t newoi, newii;
  263|  30.0k|    igraph_bool_t directed = igraph_is_directed(graph);
  264|       |
  265|  30.0k|    if (igraph_vector_int_size(edges) % 2 != 0) {
  ------------------
  |  Branch (265:9): [True: 0, False: 30.0k]
  ------------------
  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|  30.0k|    if (!igraph_vector_int_isininterval(edges, 0, igraph_vcount(graph) - 1)) {
  ------------------
  |  Branch (268:9): [True: 0, False: 30.0k]
  ------------------
  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|  30.0k|    IGRAPH_SAFE_ADD(no_of_edges, edges_to_add, &new_no_of_edges);
  ------------------
  |  |   47|  30.0k|    do { \
  |  |   48|  30.0k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|  30.0k|        igraph_int_t _safe_sum; \
  |  |   50|  30.0k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 30.0k]
  |  |  ------------------
  |  |   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|  30.0k|        *(res) = _safe_sum; \
  |  |   54|  30.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 30.0k]
  |  |  ------------------
  ------------------
  274|  30.0k|    if (new_no_of_edges > IGRAPH_ECOUNT_MAX) {
  ------------------
  |  |  118|  30.0k|#define IGRAPH_ECOUNT_MAX (IGRAPH_INTEGER_MAX/2)
  |  |  ------------------
  |  |  |  |   72|  30.0k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  |  |  ------------------
  ------------------
  |  Branch (274:9): [True: 0, False: 30.0k]
  ------------------
  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|  30.0k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->from, no_of_edges + edges_to_add));
  ------------------
  |  |  656|  30.0k|    do { \
  |  |  657|  30.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  30.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  30.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 30.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|  30.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 30.0k]
  |  |  ------------------
  ------------------
  279|  30.0k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->to, no_of_edges + edges_to_add));
  ------------------
  |  |  656|  30.0k|    do { \
  |  |  657|  30.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  30.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  30.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 30.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|  30.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 30.0k]
  |  |  ------------------
  ------------------
  280|       |
  281|   529k|    while (i < edges_to_add * 2) {
  ------------------
  |  Branch (281:12): [True: 499k, False: 30.0k]
  ------------------
  282|   499k|        if (directed || VECTOR(*edges)[i] > VECTOR(*edges)[i + 1]) {
  ------------------
  |  |   60|   214k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      if (directed || VECTOR(*edges)[i] > VECTOR(*edges)[i + 1]) {
  ------------------
  |  |   60|   214k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (282:13): [True: 285k, False: 214k]
  |  Branch (282:25): [True: 89.7k, False: 124k]
  ------------------
  283|   374k|            igraph_vector_int_push_back(&graph->from, VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   374k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  284|   374k|            igraph_vector_int_push_back(&graph->to,   VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   374k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  285|   374k|        } else {
  286|   124k|            igraph_vector_int_push_back(&graph->to,   VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   124k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  287|   124k|            igraph_vector_int_push_back(&graph->from, VECTOR(*edges)[i++]); /* reserved */
  ------------------
  |  |   60|   124k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  288|   124k|        }
  289|   499k|    }
  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|  30.0k|#define CHECK_ERR(expr) \
  299|  30.0k|    do { \
  300|  30.0k|        igraph_error_t err = (expr); \
  301|  30.0k|        if (err != IGRAPH_SUCCESS) { \
  302|  30.0k|            igraph_vector_int_resize(&graph->from, no_of_edges); /* gets smaller, error safe */ \
  303|  30.0k|            igraph_vector_int_resize(&graph->to, no_of_edges);   /* gets smaller, error safe */ \
  304|  30.0k|            IGRAPH_FINALLY_EXIT(); \
  305|  30.0k|            IGRAPH_ERROR("Cannot add edges.", err); \
  306|  30.0k|        } \
  307|  30.0k|    } while (0)
  308|       |
  309|       |    /* oi & ii */
  310|  30.0k|    IGRAPH_FINALLY_ENTER();
  311|  30.0k|    {
  312|  30.0k|        CHECK_ERR(igraph_vector_int_init(&newoi, no_of_edges));
  ------------------
  |  |  299|  30.0k|    do { \
  |  |  300|  30.0k|        igraph_error_t err = (expr); \
  |  |  301|  30.0k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 30.0k]
  |  |  ------------------
  |  |  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|  30.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 30.0k]
  |  |  ------------------
  ------------------
  313|  30.0k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &newoi);
  ------------------
  |  |  603|  30.0k|    do { \
  |  |  604|  30.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  30.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  30.0k|         * incorrect destructor function with the pointer */ \
  |  |  607|  30.0k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 30.0k]
  |  |  ------------------
  |  |  608|  30.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  30.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 30.0k]
  |  |  ------------------
  ------------------
  314|  30.0k|        CHECK_ERR(igraph_vector_int_init(&newii, no_of_edges));
  ------------------
  |  |  299|  30.0k|    do { \
  |  |  300|  30.0k|        igraph_error_t err = (expr); \
  |  |  301|  30.0k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 30.0k]
  |  |  ------------------
  |  |  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|  30.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 30.0k]
  |  |  ------------------
  ------------------
  315|  30.0k|        IGRAPH_FINALLY(igraph_vector_int_destroy, &newii);
  ------------------
  |  |  603|  30.0k|    do { \
  |  |  604|  30.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  30.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  30.0k|         * incorrect destructor function with the pointer */ \
  |  |  607|  30.0k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 30.0k]
  |  |  ------------------
  |  |  608|  30.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  30.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 30.0k]
  |  |  ------------------
  ------------------
  316|  30.0k|        CHECK_ERR(igraph_vector_int_pair_order(&graph->from, &graph->to, &newoi, graph->n));
  ------------------
  |  |  299|  30.0k|    do { \
  |  |  300|  30.0k|        igraph_error_t err = (expr); \
  |  |  301|  30.0k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 30.0k]
  |  |  ------------------
  |  |  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|  30.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 30.0k]
  |  |  ------------------
  ------------------
  317|  30.0k|        CHECK_ERR(igraph_vector_int_pair_order(&graph->to, &graph->from, &newii, graph->n));
  ------------------
  |  |  299|  30.0k|    do { \
  |  |  300|  30.0k|        igraph_error_t err = (expr); \
  |  |  301|  30.0k|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 30.0k]
  |  |  ------------------
  |  |  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|  30.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 30.0k]
  |  |  ------------------
  ------------------
  318|       |
  319|       |        /* Attributes */
  320|  30.0k|        if (graph->attr) {
  ------------------
  |  Branch (320:13): [True: 0, False: 30.0k]
  ------------------
  321|       |            /* TODO: Does this keep the attribute table in a consistent state upon failure? */
  322|      0|            CHECK_ERR(igraph_i_attribute_add_edges(graph, edges, attr));
  ------------------
  |  |  299|      0|    do { \
  |  |  300|      0|        igraph_error_t err = (expr); \
  |  |  301|      0|        if (err != IGRAPH_SUCCESS) { \
  |  |  ------------------
  |  |  |  Branch (301:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  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|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (307:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  323|      0|        }
  324|       |
  325|       |        /* os & is, its length does not change, error safe */
  326|  30.0k|        igraph_i_create_start_vectors(&graph->os, &graph->from, &newoi, graph->n);
  327|  30.0k|        igraph_i_create_start_vectors(&graph->is, &graph->to, &newii, graph->n);
  328|       |
  329|       |        /* everything went fine */
  330|  30.0k|        igraph_vector_int_destroy(&graph->oi);
  331|  30.0k|        igraph_vector_int_destroy(&graph->ii);
  332|  30.0k|        IGRAPH_FINALLY_CLEAN(2);
  333|       |
  334|  30.0k|        graph->oi = newoi;
  335|  30.0k|        graph->ii = newii;
  336|  30.0k|    }
  337|      0|    IGRAPH_FINALLY_EXIT();
  338|       |
  339|  30.0k|#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|  30.0k|    igraph_i_property_cache_invalidate_conditionally(
  354|  30.0k|        graph,
  355|  30.0k|        /* keep_always = */ 0,
  356|       |        /* keep_when_false = */
  357|  30.0k|        (1 << IGRAPH_PROP_IS_DAG) | (1 << IGRAPH_PROP_IS_FOREST),
  358|       |        /* keep_when_true = */
  359|  30.0k|        (1 << IGRAPH_PROP_IS_WEAKLY_CONNECTED) |
  360|  30.0k|        (1 << IGRAPH_PROP_IS_STRONGLY_CONNECTED) |
  361|  30.0k|        (1 << IGRAPH_PROP_HAS_LOOP) |
  362|  30.0k|        (1 << IGRAPH_PROP_HAS_MULTI) |
  363|  30.0k|        (1 << IGRAPH_PROP_HAS_MUTUAL)
  364|  30.0k|    );
  365|       |
  366|  30.0k|    return IGRAPH_SUCCESS;
  367|  30.0k|}
igraph_add_vertices:
  391|  47.2k|) {
  392|  47.2k|    igraph_int_t ec = igraph_ecount(graph);
  393|  47.2k|    igraph_int_t vc = igraph_vcount(graph);
  394|  47.2k|    igraph_int_t new_vc;
  395|  47.2k|    igraph_int_t i;
  396|       |
  397|  47.2k|    if (nv < 0) {
  ------------------
  |  Branch (397:9): [True: 0, False: 47.2k]
  ------------------
  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|  47.2k|    IGRAPH_SAFE_ADD(graph->n, nv, &new_vc);
  ------------------
  |  |   47|  47.2k|    do { \
  |  |   48|  47.2k|        igraph_int_t _safe_a = (a), _safe_b = (b); \
  |  |   49|  47.2k|        igraph_int_t _safe_sum; \
  |  |   50|  47.2k|        if (__builtin_add_overflow(_safe_a, _safe_b, &_safe_sum)) { \
  |  |  ------------------
  |  |  |  Branch (50:13): [True: 0, False: 47.2k]
  |  |  ------------------
  |  |   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|  47.2k|        *(res) = _safe_sum; \
  |  |   54|  47.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (54:14): [Folded, False: 47.2k]
  |  |  ------------------
  ------------------
  402|  47.2k|    if (new_vc > IGRAPH_VCOUNT_MAX) {
  ------------------
  |  |  100|  47.2k|#define IGRAPH_VCOUNT_MAX (IGRAPH_INTEGER_MAX-1)
  |  |  ------------------
  |  |  |  |   72|  47.2k|#  define IGRAPH_INTEGER_MAX INT64_MAX
  |  |  ------------------
  ------------------
  |  Branch (402:9): [True: 0, False: 47.2k]
  ------------------
  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|  47.2k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->os, new_vc + 1));
  ------------------
  |  |  656|  47.2k|    do { \
  |  |  657|  47.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  47.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  47.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 47.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|  47.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 47.2k]
  |  |  ------------------
  ------------------
  407|  47.2k|    IGRAPH_CHECK(igraph_vector_int_reserve(&graph->is, new_vc + 1));
  ------------------
  |  |  656|  47.2k|    do { \
  |  |  657|  47.2k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  47.2k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  47.2k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 47.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|  47.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 47.2k]
  |  |  ------------------
  ------------------
  408|       |
  409|  47.2k|    igraph_vector_int_resize(&graph->os, new_vc + 1); /* reserved */
  410|  47.2k|    igraph_vector_int_resize(&graph->is, new_vc + 1); /* reserved */
  411|  1.30M|    for (i = graph->n + 1; i < new_vc + 1; i++) {
  ------------------
  |  Branch (411:28): [True: 1.26M, False: 47.2k]
  ------------------
  412|  1.26M|        VECTOR(graph->os)[i] = ec;
  ------------------
  |  |   60|  1.26M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  413|  1.26M|        VECTOR(graph->is)[i] = ec;
  ------------------
  |  |   60|  1.26M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  414|  1.26M|    }
  415|       |
  416|  47.2k|    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|  47.2k|    if (graph->attr) {
  ------------------
  |  Branch (422:9): [True: 0, False: 47.2k]
  ------------------
  423|      0|        igraph_error_t err;
  424|      0|        IGRAPH_FINALLY_ENTER();
  425|      0|        err = igraph_i_attribute_add_vertices(graph, nv, attr);
  426|      0|        if (err != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (426:13): [True: 0, False: 0]
  ------------------
  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|      0|        IGRAPH_FINALLY_EXIT();
  433|      0|        if (err != IGRAPH_SUCCESS) {
  ------------------
  |  Branch (433:13): [True: 0, False: 0]
  ------------------
  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|      0|    }
  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|  47.2k|    igraph_i_property_cache_invalidate_conditionally(
  458|  47.2k|        graph,
  459|       |        /* keep_always = */
  460|  47.2k|        (1 << IGRAPH_PROP_HAS_LOOP) |
  461|  47.2k|        (1 << IGRAPH_PROP_HAS_MULTI) |
  462|  47.2k|        (1 << IGRAPH_PROP_HAS_MUTUAL) |
  463|  47.2k|        (1 << IGRAPH_PROP_IS_DAG) |
  464|  47.2k|        (1 << IGRAPH_PROP_IS_FOREST),
  465|       |        /* keep_when_false = */
  466|  47.2k|        igraph_vcount(graph) >= 2 ? (
  ------------------
  |  Branch (466:9): [True: 31.9k, False: 15.3k]
  ------------------
  467|  31.9k|            (1 << IGRAPH_PROP_IS_STRONGLY_CONNECTED) |
  468|  31.9k|            (1 << IGRAPH_PROP_IS_WEAKLY_CONNECTED)
  469|  31.9k|        ) : 0,
  470|       |        /* keep_when_true = */
  471|  47.2k|        0
  472|  47.2k|    );
  473|       |
  474|  47.2k|    return IGRAPH_SUCCESS;
  475|  47.2k|}
igraph_vcount:
  829|  4.61M|igraph_int_t igraph_vcount(const igraph_t *graph) {
  830|  4.61M|    return graph->n;
  831|  4.61M|}
igraph_ecount:
  843|   340k|igraph_int_t igraph_ecount(const igraph_t *graph) {
  844|   340k|    return igraph_vector_int_size(&graph->from);
  845|   340k|}
igraph_neighbors:
  894|  1.59M|) {
  895|       |
  896|  1.59M|#define DEDUPLICATE_IF_NEEDED(vertex, n)                                          \
  897|  1.59M|    if (should_filter_duplicates) {                                               \
  898|  1.59M|        if (vertex == pnode) {                                                    \
  899|       |            /* This is a loop edge */                                             \
  900|  1.59M|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  901|       |                /* Filtering loop edges unconditionally */                        \
  902|  1.59M|                length -= n;                                                      \
  903|  1.59M|                continue;                                                         \
  904|  1.59M|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  905|       |                /* Filtering every second endpoint of loop edges */               \
  906|  1.59M|                length -= n;                                                      \
  907|  1.59M|                last_added = -1;                                                  \
  908|  1.59M|                seen_loop = true;                                                 \
  909|  1.59M|                continue;                                                         \
  910|  1.59M|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  911|       |                /* Filtering multi-loop edges */                                  \
  912|  1.59M|                length -= n;                                                      \
  913|  1.59M|                continue;                                                         \
  914|  1.59M|            } else {                                                              \
  915|  1.59M|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  916|  1.59M|                last_added = vertex;                                              \
  917|  1.59M|            }                                                                     \
  918|  1.59M|        } else {                                                                  \
  919|       |            /* Not a loop edge */                                                 \
  920|  1.59M|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  921|       |                /* Filtering multi-edges */                                       \
  922|  1.59M|                length -= n;                                                      \
  923|  1.59M|                continue;                                                         \
  924|  1.59M|            } else {                                                              \
  925|  1.59M|                last_added = vertex;                                              \
  926|  1.59M|            }                                                                     \
  927|  1.59M|        }                                                                         \
  928|  1.59M|    }
  929|       |
  930|  1.59M|    igraph_int_t length = 0, idx = 0;
  931|  1.59M|    igraph_int_t i, j;
  932|       |
  933|  1.59M|    igraph_int_t node = pnode;
  934|  1.59M|    igraph_int_t last_added = -1;
  935|  1.59M|    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.59M|    igraph_bool_t seen_loop = false;
  943|       |
  944|       |    /* normalize Boolean value to enable == comparisons below and in DEDUPLICATE_IF_NEEDED */
  945|  1.59M|    multiple = !!multiple;
  946|       |
  947|  1.59M|    if (node < 0 || node > igraph_vcount(graph) - 1) {
  ------------------
  |  Branch (947:9): [True: 0, False: 1.59M]
  |  Branch (947:21): [True: 0, False: 1.59M]
  ------------------
  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.59M|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (950:9): [True: 1.43M, False: 161k]
  |  Branch (950:31): [True: 1.11M, False: 320k]
  |  Branch (950:52): [True: 0, False: 1.11M]
  ------------------
  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.59M|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (954:9): [True: 326k, False: 1.27M]
  ------------------
  955|   326k|        mode = IGRAPH_ALL;
  956|   326k|    }
  957|       |
  958|  1.59M|    if (mode != IGRAPH_ALL && loops == IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (958:9): [True: 320k, False: 1.27M]
  |  Branch (958:31): [True: 320k, 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|   320k|        loops = IGRAPH_LOOPS_ONCE;
  964|   320k|    }
  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.59M|    if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (969:9): [True: 1.27M, False: 320k]
  ------------------
  970|  1.27M|        length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  1.27M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  1.27M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  971|  1.27M|    }
  972|  1.59M|    if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (972:9): [True: 1.59M, False: 0]
  ------------------
  973|  1.59M|        length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  1.59M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  1.59M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  974|  1.59M|    }
  975|       |
  976|  1.59M|    IGRAPH_CHECK(igraph_vector_int_resize(neis, length));
  ------------------
  |  |  656|  1.59M|    do { \
  |  |  657|  1.59M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.59M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.59M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.59M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.59M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.59M]
  |  |  ------------------
  ------------------
  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.59M|    if (!igraph_is_directed(graph) || mode != IGRAPH_ALL) {
  ------------------
  |  Branch (987:9): [True: 326k, False: 1.27M]
  |  Branch (987:39): [True: 320k, False: 949k]
  ------------------
  988|       |        /* graph is undirected or we did not ask for both directions in a
  989|       |         * directed graph; this is the easy case */
  990|       |
  991|   647k|        should_filter_duplicates = !(multiple == IGRAPH_MULTIPLE &&
  ------------------
  |  Branch (991:38): [True: 647k, False: 0]
  ------------------
  992|   647k|                ((!igraph_is_directed(graph) && loops == IGRAPH_LOOPS_TWICE) ||
  ------------------
  |  Branch (992:19): [True: 326k, False: 320k]
  |  Branch (992:49): [True: 165k, False: 160k]
  ------------------
  993|   481k|                 (igraph_is_directed(graph) && loops != IGRAPH_NO_LOOPS)));
  ------------------
  |  Branch (993:19): [True: 320k, False: 160k]
  |  Branch (993:48): [True: 320k, False: 0]
  ------------------
  994|       |
  995|   647k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (995:13): [True: 326k, False: 320k]
  ------------------
  996|   326k|            j = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|   326k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  997|   459k|            for (i = VECTOR(graph->os)[node]; i < j; i++) {
  ------------------
  |  |   60|   326k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (997:47): [True: 133k, False: 326k]
  ------------------
  998|   133k|                igraph_int_t to = VECTOR(graph->to)[ VECTOR(graph->oi)[i] ];
  ------------------
  |  |   60|   133k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              igraph_int_t to = VECTOR(graph->to)[ VECTOR(graph->oi)[i] ];
  ------------------
  |  |   60|   133k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  999|   133k|                DEDUPLICATE_IF_NEEDED(to, 1);
  ------------------
  |  |  897|   133k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 61.4k, False: 71.6k]
  |  |  ------------------
  |  |  898|  61.4k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 61.4k]
  |  |  ------------------
  |  |  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|  61.4k|        } else {                                                                  \
  |  |  919|  61.4k|            /* Not a loop edge */                                                 \
  |  |  920|  61.4k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 61.4k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  61.4k|            } else {                                                              \
  |  |  925|  61.4k|                last_added = vertex;                                              \
  |  |  926|  61.4k|            }                                                                     \
  |  |  927|  61.4k|        }                                                                         \
  |  |  928|  61.4k|    }
  ------------------
 1000|   133k|                VECTOR(*neis)[idx++] = to;
  ------------------
  |  |   60|   133k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1001|   133k|            }
 1002|   326k|        }
 1003|       |
 1004|   647k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1004:13): [True: 647k, False: 0]
  ------------------
 1005|   647k|            j = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|   647k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1006|   984k|            for (i = VECTOR(graph->is)[node]; i < j; i++) {
  ------------------
  |  |   60|   647k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1006:47): [True: 337k, False: 647k]
  ------------------
 1007|   337k|                igraph_int_t from = VECTOR(graph->from)[ VECTOR(graph->ii)[i] ];
  ------------------
  |  |   60|   337k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              igraph_int_t from = VECTOR(graph->from)[ VECTOR(graph->ii)[i] ];
  ------------------
  |  |   60|   337k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1008|   337k|                DEDUPLICATE_IF_NEEDED(from, 1);
  ------------------
  |  |  897|   337k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 61.4k, False: 275k]
  |  |  ------------------
  |  |  898|  61.4k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 61.4k]
  |  |  ------------------
  |  |  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|  61.4k|        } else {                                                                  \
  |  |  919|  61.4k|            /* Not a loop edge */                                                 \
  |  |  920|  61.4k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 61.4k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  61.4k|            } else {                                                              \
  |  |  925|  61.4k|                last_added = vertex;                                              \
  |  |  926|  61.4k|            }                                                                     \
  |  |  927|  61.4k|        }                                                                         \
  |  |  928|  61.4k|    }
  ------------------
 1009|   337k|                VECTOR(*neis)[idx++] = from;
  ------------------
  |  |   60|   337k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1010|   337k|            }
 1011|   647k|        }
 1012|   949k|    } 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|   949k|        igraph_int_t j1 = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|   949k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1017|   949k|        igraph_int_t j2 = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|   949k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1018|   949k|        igraph_int_t i1 = VECTOR(graph->os)[node];
  ------------------
  |  |   60|   949k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1019|   949k|        igraph_int_t i2 = VECTOR(graph->is)[node];
  ------------------
  |  |   60|   949k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1020|   949k|        igraph_int_t eid1, eid2;
 1021|   949k|        igraph_int_t n1, n2;
 1022|       |
 1023|   949k|        should_filter_duplicates = !(multiple == IGRAPH_MULTIPLE &&
  ------------------
  |  Branch (1023:38): [True: 949k, False: 0]
  ------------------
 1024|   949k|                loops == IGRAPH_LOOPS_TWICE);
  ------------------
  |  Branch (1024:17): [True: 476k, False: 473k]
  ------------------
 1025|       |
 1026|  1.43M|        while (i1 < j1 && i2 < j2) {
  ------------------
  |  Branch (1026:16): [True: 634k, False: 802k]
  |  Branch (1026:27): [True: 486k, False: 147k]
  ------------------
 1027|   486k|            eid1 = VECTOR(graph->oi)[i1];
  ------------------
  |  |   60|   486k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1028|   486k|            eid2 = VECTOR(graph->ii)[i2];
  ------------------
  |  |   60|   486k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1029|   486k|            n1 = VECTOR(graph->to)[eid1];
  ------------------
  |  |   60|   486k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1030|   486k|            n2 = VECTOR(graph->from)[eid2];
  ------------------
  |  |   60|   486k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1031|   486k|            if (n1 < n2) {
  ------------------
  |  Branch (1031:17): [True: 172k, False: 313k]
  ------------------
 1032|   172k|                i1++;
 1033|   172k|                DEDUPLICATE_IF_NEEDED(n1, 1);
  ------------------
  |  |  897|   172k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 89.5k, False: 83.4k]
  |  |  ------------------
  |  |  898|  89.5k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 89.5k]
  |  |  ------------------
  |  |  899|      0|            /* This is a loop edge */                                             \
  |  |  900|      0|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  901|      0|                /* Filtering loop edges unconditionally */                        \
  |  |  902|      0|                length -= n;                                                      \
  |  |  903|      0|                continue;                                                         \
  |  |  904|      0|            } else if (loops == IGRAPH_LOOPS_ONCE && vertex == last_added) {      \
  |  |  ------------------
  |  |  |  Branch (904:24): [True: 0, False: 0]
  |  |  |  Branch (904:54): [True: 0, False: 0]
  |  |  ------------------
  |  |  905|      0|                /* Filtering every second endpoint of loop edges */               \
  |  |  906|      0|                length -= n;                                                      \
  |  |  907|      0|                last_added = -1;                                                  \
  |  |  908|      0|                seen_loop = true;                                                 \
  |  |  909|      0|                continue;                                                         \
  |  |  910|      0|            } else if (multiple == IGRAPH_NO_MULTIPLE && seen_loop) {             \
  |  |  ------------------
  |  |  |  Branch (910:24): [True: 0, False: 0]
  |  |  |  Branch (910:58): [True: 0, False: 0]
  |  |  ------------------
  |  |  911|      0|                /* Filtering multi-loop edges */                                  \
  |  |  912|      0|                length -= n;                                                      \
  |  |  913|      0|                continue;                                                         \
  |  |  914|      0|            } else {                                                              \
  |  |  915|      0|                seen_loop = (loops != IGRAPH_LOOPS_TWICE || last_added == vertex);\
  |  |  ------------------
  |  |  |  Branch (915:30): [True: 0, False: 0]
  |  |  |  Branch (915:61): [True: 0, False: 0]
  |  |  ------------------
  |  |  916|      0|                last_added = vertex;                                              \
  |  |  917|      0|            }                                                                     \
  |  |  918|  89.5k|        } else {                                                                  \
  |  |  919|  89.5k|            /* Not a loop edge */                                                 \
  |  |  920|  89.5k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 89.5k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  89.5k|            } else {                                                              \
  |  |  925|  89.5k|                last_added = vertex;                                              \
  |  |  926|  89.5k|            }                                                                     \
  |  |  927|  89.5k|        }                                                                         \
  |  |  928|  89.5k|    }
  ------------------
 1034|   172k|                VECTOR(*neis)[idx++] = n1;
  ------------------
  |  |   60|   172k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1035|   313k|            } else if (n1 > n2) {
  ------------------
  |  Branch (1035:24): [True: 177k, False: 135k]
  ------------------
 1036|   177k|                i2++;
 1037|   177k|                DEDUPLICATE_IF_NEEDED(n2, 1);
  ------------------
  |  |  897|   177k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 91.9k, False: 86.0k]
  |  |  ------------------
  |  |  898|  91.9k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 91.9k]
  |  |  ------------------
  |  |  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|  91.9k|        } else {                                                                  \
  |  |  919|  91.9k|            /* Not a loop edge */                                                 \
  |  |  920|  91.9k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 91.9k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  91.9k|            } else {                                                              \
  |  |  925|  91.9k|                last_added = vertex;                                              \
  |  |  926|  91.9k|            }                                                                     \
  |  |  927|  91.9k|        }                                                                         \
  |  |  928|  91.9k|    }
  ------------------
 1038|   177k|                VECTOR(*neis)[idx++] = n2;
  ------------------
  |  |   60|   177k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1039|   177k|            } else {
 1040|   135k|                i1++;
 1041|   135k|                i2++;
 1042|   135k|                DEDUPLICATE_IF_NEEDED(n1, 2);
  ------------------
  |  |  897|   135k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 93.2k, False: 42.4k]
  |  |  ------------------
  |  |  898|  93.2k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 69.4k, False: 23.7k]
  |  |  ------------------
  |  |  899|  69.4k|            /* This is a loop edge */                                             \
  |  |  900|  69.4k|            if (loops == IGRAPH_NO_LOOPS) {                                       \
  |  |  ------------------
  |  |  |  Branch (900:17): [True: 69.4k, False: 0]
  |  |  ------------------
  |  |  901|  69.4k|                /* Filtering loop edges unconditionally */                        \
  |  |  902|  69.4k|                length -= n;                                                      \
  |  |  903|  69.4k|                continue;                                                         \
  |  |  904|  69.4k|            } 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|  69.4k|        } else {                                                                  \
  |  |  919|  23.7k|            /* Not a loop edge */                                                 \
  |  |  920|  23.7k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 23.7k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  23.7k|            } else {                                                              \
  |  |  925|  23.7k|                last_added = vertex;                                              \
  |  |  926|  23.7k|            }                                                                     \
  |  |  927|  23.7k|        }                                                                         \
  |  |  928|  93.2k|    }
  ------------------
 1043|  66.2k|                VECTOR(*neis)[idx++] = n1;
  ------------------
  |  |   60|  66.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1044|  66.2k|                DEDUPLICATE_IF_NEEDED(n2, 1);
  ------------------
  |  |  897|  66.2k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 23.7k, False: 42.4k]
  |  |  ------------------
  |  |  898|  23.7k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 23.7k]
  |  |  ------------------
  |  |  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|  23.7k|        } else {                                                                  \
  |  |  919|  23.7k|            /* Not a loop edge */                                                 \
  |  |  920|  23.7k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 23.7k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|  23.7k|            } else {                                                              \
  |  |  925|  23.7k|                last_added = vertex;                                              \
  |  |  926|  23.7k|            }                                                                     \
  |  |  927|  23.7k|        }                                                                         \
  |  |  928|  23.7k|    }
  ------------------
 1045|  66.2k|                VECTOR(*neis)[idx++] = n2;
  ------------------
  |  |   60|  66.2k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1046|  66.2k|            }
 1047|   486k|        }
 1048|       |
 1049|  1.16M|        while (i1 < j1) {
  ------------------
  |  Branch (1049:16): [True: 212k, False: 949k]
  ------------------
 1050|   212k|            eid1 = VECTOR(graph->oi)[i1++];
  ------------------
  |  |   60|   212k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1051|   212k|            igraph_int_t to = VECTOR(graph->to)[eid1];
  ------------------
  |  |   60|   212k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1052|   212k|            DEDUPLICATE_IF_NEEDED(to, 1);
  ------------------
  |  |  897|   212k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 108k, False: 104k]
  |  |  ------------------
  |  |  898|   108k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 108k]
  |  |  ------------------
  |  |  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|   108k|        } else {                                                                  \
  |  |  919|   108k|            /* Not a loop edge */                                                 \
  |  |  920|   108k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 108k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|   108k|            } else {                                                              \
  |  |  925|   108k|                last_added = vertex;                                              \
  |  |  926|   108k|            }                                                                     \
  |  |  927|   108k|        }                                                                         \
  |  |  928|   108k|    }
  ------------------
 1053|   212k|            VECTOR(*neis)[idx++] = to;
  ------------------
  |  |   60|   212k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1054|   212k|        }
 1055|       |
 1056|  1.15M|        while (i2 < j2) {
  ------------------
  |  Branch (1056:16): [True: 207k, False: 949k]
  ------------------
 1057|   207k|            eid2 = VECTOR(graph->ii)[i2++];
  ------------------
  |  |   60|   207k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1058|   207k|            igraph_int_t from = VECTOR(graph->from)[eid2];
  ------------------
  |  |   60|   207k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1059|   207k|            DEDUPLICATE_IF_NEEDED(from, 1);
  ------------------
  |  |  897|   207k|    if (should_filter_duplicates) {                                               \
  |  |  ------------------
  |  |  |  Branch (897:9): [True: 106k, False: 101k]
  |  |  ------------------
  |  |  898|   106k|        if (vertex == pnode) {                                                    \
  |  |  ------------------
  |  |  |  Branch (898:13): [True: 0, False: 106k]
  |  |  ------------------
  |  |  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|   106k|        } else {                                                                  \
  |  |  919|   106k|            /* Not a loop edge */                                                 \
  |  |  920|   106k|            if (multiple == IGRAPH_NO_MULTIPLE && vertex == last_added) {         \
  |  |  ------------------
  |  |  |  Branch (920:17): [True: 0, False: 106k]
  |  |  |  Branch (920:51): [True: 0, False: 0]
  |  |  ------------------
  |  |  921|      0|                /* Filtering multi-edges */                                       \
  |  |  922|      0|                length -= n;                                                      \
  |  |  923|      0|                continue;                                                         \
  |  |  924|   106k|            } else {                                                              \
  |  |  925|   106k|                last_added = vertex;                                              \
  |  |  926|   106k|            }                                                                     \
  |  |  927|   106k|        }                                                                         \
  |  |  928|   106k|    }
  ------------------
 1060|   207k|            VECTOR(*neis)[idx++] = from;
  ------------------
  |  |   60|   207k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1061|   207k|        }
 1062|       |
 1063|   949k|    }
 1064|  1.59M|    IGRAPH_CHECK(igraph_vector_int_resize(neis, length));
  ------------------
  |  |  656|  1.59M|    do { \
  |  |  657|  1.59M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  1.59M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  1.59M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 1.59M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.59M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 1.59M]
  |  |  ------------------
  ------------------
 1065|       |
 1066|  1.59M|    return IGRAPH_SUCCESS;
 1067|  1.59M|#undef DEDUPLICATE_IF_NEEDED
 1068|  1.59M|}
igraph_is_directed:
 1133|  7.14M|igraph_bool_t igraph_is_directed(const igraph_t *graph) {
 1134|  7.14M|    return graph->directed;
 1135|  7.14M|}
igraph_degree:
 1268|  58.5k|) {
 1269|       |
 1270|  58.5k|    igraph_int_t nodes_to_calc;
 1271|  58.5k|    igraph_int_t i, j;
 1272|  58.5k|    igraph_vit_t vit;
 1273|       |
 1274|  58.5k|    IGRAPH_CHECK(igraph_vit_create(graph, vids, &vit));
  ------------------
  |  |  656|  58.5k|    do { \
  |  |  657|  58.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  58.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  58.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 58.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|  58.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 58.5k]
  |  |  ------------------
  ------------------
 1275|  58.5k|    IGRAPH_FINALLY(igraph_vit_destroy, &vit);
  ------------------
  |  |  603|  58.5k|    do { \
  |  |  604|  58.5k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  58.5k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  58.5k|         * incorrect destructor function with the pointer */ \
  |  |  607|  58.5k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 58.5k]
  |  |  ------------------
  |  |  608|  58.5k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  58.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 58.5k]
  |  |  ------------------
  ------------------
 1276|       |
 1277|  58.5k|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1277:9): [True: 45.2k, False: 13.3k]
  |  Branch (1277:31): [True: 31.6k, False: 13.5k]
  |  Branch (1277:52): [True: 0, False: 31.6k]
  ------------------
 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|  58.5k|    if (loops == IGRAPH_NO_LOOPS || loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (1281:9): [True: 3.29k, False: 55.2k]
  |  Branch (1281:37): [True: 0, False: 55.2k]
  ------------------
 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|  3.29k|        if (igraph_i_property_cache_has(graph, IGRAPH_PROP_HAS_LOOP) &&
  ------------------
  |  Branch (1285:13): [True: 3.29k, False: 0]
  ------------------
 1286|  3.29k|            !igraph_i_property_cache_get_bool(graph, IGRAPH_PROP_HAS_LOOP)) {
  ------------------
  |  Branch (1286:13): [True: 3.29k, False: 0]
  ------------------
 1287|  3.29k|            loops = IGRAPH_LOOPS_TWICE;
 1288|  3.29k|        }
 1289|  3.29k|    }
 1290|       |
 1291|  58.5k|    if (loops == IGRAPH_LOOPS_ONCE && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1291:9): [True: 0, False: 58.5k]
  |  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|  58.5k|    nodes_to_calc = IGRAPH_VIT_SIZE(vit);
  ------------------
  |  |  190|  58.5k|#define IGRAPH_VIT_SIZE(vit)  ((vit).end - (vit).start)
  ------------------
 1297|  58.5k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (1297:9): [True: 10.3k, False: 48.1k]
  ------------------
 1298|  10.3k|        mode = IGRAPH_ALL;
 1299|  10.3k|    }
 1300|       |
 1301|  58.5k|    IGRAPH_CHECK(igraph_vector_int_resize(res, nodes_to_calc));
  ------------------
  |  |  656|  58.5k|    do { \
  |  |  657|  58.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  58.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  58.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 58.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|  58.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 58.5k]
  |  |  ------------------
  ------------------
 1302|  58.5k|    igraph_vector_int_null(res);
 1303|       |
 1304|  58.5k|    if (loops == IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (1304:9): [True: 58.5k, False: 0]
  ------------------
 1305|  58.5k|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1305:13): [True: 45.0k, False: 13.5k]
  ------------------
 1306|  45.0k|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|  45.0k|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1307|  2.18M|                 !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|  2.18M|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1307:18): [True: 2.13M, False: 45.0k]
  ------------------
 1308|  2.13M|                 IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|  2.13M|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1309|  2.13M|                igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|  2.13M|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 2.13M, False: 0]
  |  |  ------------------
  |  |  215|  2.13M|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1310|  2.13M|                VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|  2.13M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|  2.13M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->os)[vid + 1] - VECTOR(graph->os)[vid]);
  ------------------
  |  |   60|  2.13M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1311|  2.13M|            }
 1312|  45.0k|        }
 1313|  58.5k|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1313:13): [True: 45.2k, False: 13.3k]
  ------------------
 1314|  45.2k|            for (IGRAPH_VIT_RESET(vit), i = 0;
  ------------------
  |  |  201|  45.2k|#define IGRAPH_VIT_RESET(vit) ((vit).pos = (vit).start)
  ------------------
 1315|  2.18M|                 !IGRAPH_VIT_END(vit);
  ------------------
  |  |  179|  2.18M|#define IGRAPH_VIT_END(vit)   ((vit).pos >= (vit).end)
  ------------------
  |  Branch (1315:18): [True: 2.14M, False: 45.2k]
  ------------------
 1316|  2.14M|                 IGRAPH_VIT_NEXT(vit), i++) {
  ------------------
  |  |  167|  2.14M|#define IGRAPH_VIT_NEXT(vit)  (++((vit).pos))
  ------------------
 1317|  2.14M|                igraph_int_t vid = IGRAPH_VIT_GET(vit);
  ------------------
  |  |  214|  2.14M|    ((igraph_int_t)(((vit).type == IGRAPH_VIT_RANGE) ? (vit).pos : \
  |  |  ------------------
  |  |  |  Branch (214:21): [True: 2.14M, False: 0]
  |  |  ------------------
  |  |  215|  2.14M|                        VECTOR(*(vit).vec)[(vit).pos]))
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1318|  2.14M|                VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|  2.14M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|  2.14M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                              VECTOR(*res)[i] += (VECTOR(graph->is)[vid + 1] - VECTOR(graph->is)[vid]);
  ------------------
  |  |   60|  2.14M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1319|  2.14M|            }
 1320|  45.2k|        }
 1321|  58.5k|    } 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|  58.5k|    igraph_vit_destroy(&vit);
 1422|  58.5k|    IGRAPH_FINALLY_CLEAN(1);
 1423|       |
 1424|  58.5k|    return IGRAPH_SUCCESS;
 1425|  58.5k|}
igraph_incident:
 1778|  2.44M|) {
 1779|  2.44M|    igraph_int_t length = 0, idx = 0;
 1780|  2.44M|    igraph_int_t i, j;
 1781|  2.44M|    igraph_int_t node = pnode;
 1782|  2.44M|    igraph_bool_t directed = igraph_is_directed(graph);
 1783|       |
 1784|  2.44M|    if (node < 0 || node > igraph_vcount(graph) - 1) {
  ------------------
  |  Branch (1784:9): [True: 0, False: 2.44M]
  |  Branch (1784:21): [True: 0, False: 2.44M]
  ------------------
 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|  2.44M|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN &&
  ------------------
  |  Branch (1787:9): [True: 1.64M, False: 797k]
  |  Branch (1787:31): [True: 1.32M, False: 320k]
  ------------------
 1788|  1.32M|        mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1788:9): [True: 0, False: 1.32M]
  ------------------
 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|  2.44M|    if (!directed) {
  ------------------
  |  Branch (1792:9): [True: 949k, False: 1.49M]
  ------------------
 1793|   949k|        mode = IGRAPH_ALL;
 1794|   949k|    }
 1795|       |
 1796|  2.44M|    if (mode != IGRAPH_ALL && loops == IGRAPH_LOOPS_TWICE) {
  ------------------
  |  Branch (1796:9): [True: 1.11M, False: 1.32M]
  |  Branch (1796:31): [True: 797k, False: 320k]
  ------------------
 1797|       |        /*
 1798|       |        IGRAPH_ERROR("For a directed graph (with directions not ignored), "
 1799|       |                     "IGRAPH_LOOPS_TWICE does not make sense.", IGRAPH_EINVAL);
 1800|       |        */
 1801|   797k|        loops = IGRAPH_LOOPS_ONCE;
 1802|   797k|    }
 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|  2.44M|    if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1807:9): [True: 2.12M, False: 320k]
  ------------------
 1808|  2.12M|        length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  2.12M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->os)[node + 1] - VECTOR(graph->os)[node]);
  ------------------
  |  |   60|  2.12M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1809|  2.12M|    }
 1810|  2.44M|    if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1810:9): [True: 1.64M, False: 797k]
  ------------------
 1811|  1.64M|        length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  1.64M|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      length += (VECTOR(graph->is)[node + 1] - VECTOR(graph->is)[node]);
  ------------------
  |  |   60|  1.64M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1812|  1.64M|    }
 1813|       |
 1814|  2.44M|    IGRAPH_CHECK(igraph_vector_int_resize(eids, length));
  ------------------
  |  |  656|  2.44M|    do { \
  |  |  657|  2.44M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  2.44M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  2.44M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.44M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 2.44M]
  |  |  ------------------
  ------------------
 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|  2.44M|    if (!directed || mode != IGRAPH_ALL) {
  ------------------
  |  Branch (1823:9): [True: 949k, False: 1.49M]
  |  Branch (1823:22): [True: 1.11M, False: 379k]
  ------------------
 1824|       |        /* We did not ask for both directions; this is the easy case */
 1825|       |
 1826|  2.06M|        if (mode & IGRAPH_OUT) {
  ------------------
  |  Branch (1826:13): [True: 1.74M, False: 320k]
  ------------------
 1827|  1.74M|            j = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|  1.74M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1828|  2.55M|            for (i = VECTOR(graph->os)[node]; i < j; i++) {
  ------------------
  |  |   60|  1.74M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1828:47): [True: 807k, False: 1.74M]
  ------------------
 1829|   807k|                igraph_int_t edge = VECTOR(graph->oi)[i];
  ------------------
  |  |   60|   807k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1830|   807k|                igraph_int_t other = VECTOR(graph->to)[edge];
  ------------------
  |  |   60|   807k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1831|   807k|                if (loops == IGRAPH_NO_LOOPS && other == pnode) {
  ------------------
  |  Branch (1831:21): [True: 0, False: 807k]
  |  Branch (1831:49): [True: 0, False: 0]
  ------------------
 1832|      0|                    length--;
 1833|   807k|                } else {
 1834|   807k|                    VECTOR(*eids)[idx++] = edge;
  ------------------
  |  |   60|   807k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1835|   807k|                }
 1836|   807k|            }
 1837|  1.74M|        }
 1838|       |
 1839|  2.06M|        if (mode & IGRAPH_IN) {
  ------------------
  |  Branch (1839:13): [True: 1.27M, False: 797k]
  ------------------
 1840|  1.27M|            j = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|  1.27M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1841|  1.84M|            for (i = VECTOR(graph->is)[node]; i < j; i++) {
  ------------------
  |  |   60|  1.27M|#define VECTOR(v) ((v).stor_begin)
  ------------------
  |  Branch (1841:47): [True: 577k, False: 1.27M]
  ------------------
 1842|   577k|                igraph_int_t edge = VECTOR(graph->ii)[i];
  ------------------
  |  |   60|   577k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1843|   577k|                igraph_int_t other = VECTOR(graph->from)[edge];
  ------------------
  |  |   60|   577k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1844|   577k|                if ((loops == IGRAPH_NO_LOOPS || (loops == IGRAPH_LOOPS_ONCE && !directed)) && other == pnode) {
  ------------------
  |  Branch (1844:22): [True: 0, False: 577k]
  |  Branch (1844:51): [True: 165k, False: 411k]
  |  Branch (1844:81): [True: 0, False: 165k]
  |  Branch (1844:96): [True: 0, False: 0]
  ------------------
 1845|      0|                    length--;
 1846|   577k|                } else {
 1847|   577k|                    VECTOR(*eids)[idx++] = edge;
  ------------------
  |  |   60|   577k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1848|   577k|                }
 1849|   577k|            }
 1850|  1.27M|        }
 1851|  2.06M|    } else {
 1852|       |        /* both in- and out- neighbors in a directed graph,
 1853|       |           we need to merge the two 'vectors' */
 1854|   379k|        igraph_int_t j1 = VECTOR(graph->os)[node + 1];
  ------------------
  |  |   60|   379k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1855|   379k|        igraph_int_t j2 = VECTOR(graph->is)[node + 1];
  ------------------
  |  |   60|   379k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1856|   379k|        igraph_int_t i1 = VECTOR(graph->os)[node];
  ------------------
  |  |   60|   379k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1857|   379k|        igraph_int_t i2 = VECTOR(graph->is)[node];
  ------------------
  |  |   60|   379k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1858|   379k|        igraph_int_t eid1, eid2;
 1859|   379k|        igraph_int_t n1, n2;
 1860|   379k|        igraph_bool_t seen_loop_edge = false;
 1861|       |
 1862|   577k|        while (i1 < j1 && i2 < j2) {
  ------------------
  |  Branch (1862:16): [True: 255k, False: 322k]
  |  Branch (1862:27): [True: 198k, False: 57.3k]
  ------------------
 1863|   198k|            eid1 = VECTOR(graph->oi)[i1];
  ------------------
  |  |   60|   198k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1864|   198k|            eid2 = VECTOR(graph->ii)[i2];
  ------------------
  |  |   60|   198k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1865|   198k|            n1 = VECTOR(graph->to)[eid1];
  ------------------
  |  |   60|   198k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1866|   198k|            n2 = VECTOR(graph->from)[eid2];
  ------------------
  |  |   60|   198k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1867|   198k|            if (n1 < n2) {
  ------------------
  |  Branch (1867:17): [True: 63.4k, False: 135k]
  ------------------
 1868|  63.4k|                i1++;
 1869|  63.4k|                VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  63.4k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1870|   135k|            } else if (n1 > n2) {
  ------------------
  |  Branch (1870:24): [True: 70.8k, False: 64.1k]
  ------------------
 1871|  70.8k|                i2++;
 1872|  70.8k|                VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  70.8k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1873|  70.8k|            } else if (n1 != pnode) {
  ------------------
  |  Branch (1873:24): [True: 16.6k, False: 47.5k]
  ------------------
 1874|       |                /* multiple edge */
 1875|  16.6k|                i1++;
 1876|  16.6k|                i2++;
 1877|  16.6k|                VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  16.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1878|  16.6k|                VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  16.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1879|  47.5k|            } else {
 1880|       |                /* loop edge */
 1881|  47.5k|                i1++;
 1882|  47.5k|                i2++;
 1883|  47.5k|                if (loops == IGRAPH_NO_LOOPS) {
  ------------------
  |  Branch (1883:21): [True: 0, False: 47.5k]
  ------------------
 1884|      0|                    length -= 2;
 1885|  47.5k|                } else if (loops == IGRAPH_LOOPS_ONCE) {
  ------------------
  |  Branch (1885:28): [True: 0, False: 47.5k]
  ------------------
 1886|      0|                    length--;
 1887|      0|                    if (!seen_loop_edge) {
  ------------------
  |  Branch (1887:25): [True: 0, False: 0]
  ------------------
 1888|      0|                        VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1889|      0|                    } else {
 1890|      0|                        VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1891|      0|                    }
 1892|      0|                    seen_loop_edge = !seen_loop_edge;
 1893|  47.5k|                } else {
 1894|  47.5k|                    VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  47.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1895|  47.5k|                    VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  47.5k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1896|  47.5k|                }
 1897|  47.5k|            }
 1898|   198k|        }
 1899|       |
 1900|   472k|        while (i1 < j1) {
  ------------------
  |  Branch (1900:16): [True: 93.3k, False: 379k]
  ------------------
 1901|  93.3k|            eid1 = VECTOR(graph->oi)[i1++];
  ------------------
  |  |   60|  93.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1902|  93.3k|            VECTOR(*eids)[idx++] = eid1;
  ------------------
  |  |   60|  93.3k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1903|  93.3k|        }
 1904|       |
 1905|   465k|        while (i2 < j2) {
  ------------------
  |  Branch (1905:16): [True: 85.9k, False: 379k]
  ------------------
 1906|  85.9k|            eid2 = VECTOR(graph->ii)[i2++];
  ------------------
  |  |   60|  85.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1907|  85.9k|            VECTOR(*eids)[idx++] = eid2;
  ------------------
  |  |   60|  85.9k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1908|  85.9k|        }
 1909|   379k|    }
 1910|  2.44M|    IGRAPH_CHECK(igraph_vector_int_resize(eids, length));
  ------------------
  |  |  656|  2.44M|    do { \
  |  |  657|  2.44M|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  2.44M|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  2.44M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 2.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, 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.44M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 2.44M]
  |  |  ------------------
  ------------------
 1911|  2.44M|    return IGRAPH_SUCCESS;
 1912|  2.44M|}
type_indexededgelist.c:igraph_i_create_start_vectors:
 1076|  60.0k|        igraph_vector_int_t *iindex, igraph_int_t nodes) {
 1077|       |
 1078|  60.0k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
 1079|       |
 1080|  60.0k|    igraph_int_t no_of_nodes;
 1081|  60.0k|    igraph_int_t no_of_edges;
 1082|  60.0k|    igraph_int_t i, j, idx;
 1083|       |
 1084|  60.0k|    no_of_nodes = nodes;
 1085|  60.0k|    no_of_edges = igraph_vector_int_size(el);
 1086|       |
 1087|       |    /* result */
 1088|       |
 1089|  60.0k|    IGRAPH_CHECK(igraph_vector_int_resize(res, nodes + 1));
  ------------------
  |  |  656|  60.0k|    do { \
  |  |  657|  60.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  60.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  60.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 60.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|  60.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 60.0k]
  |  |  ------------------
  ------------------
 1090|       |
 1091|       |    /* create the index */
 1092|       |
 1093|  60.0k|    if (no_of_edges == 0) {
  ------------------
  |  Branch (1093:9): [True: 0, False: 60.0k]
  ------------------
 1094|       |        /* empty graph */
 1095|      0|        igraph_vector_int_null(res);
 1096|  60.0k|    } else {
 1097|  60.0k|        idx = -1;
 1098|   356k|        for (i = 0; i <= EDGE(0); i++) {
  ------------------
  |  | 1078|   356k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   356k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   356k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  |  Branch (1098:21): [True: 296k, False: 60.0k]
  ------------------
 1099|   296k|            idx++; VECTOR(*res)[idx] = 0;
  ------------------
  |  |   60|   296k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1100|   296k|        }
 1101|   998k|        for (i = 1; i < no_of_edges; i++) {
  ------------------
  |  Branch (1101:21): [True: 938k, False: 60.0k]
  ------------------
 1102|   938k|            igraph_int_t n = EDGE(i) - EDGE(VECTOR(*res)[idx]);
  ------------------
  |  | 1078|   938k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   938k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   938k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
                          igraph_int_t n = EDGE(i) - EDGE(VECTOR(*res)[idx]);
  ------------------
  |  | 1078|   938k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   938k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|   938k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1103|  2.25M|            for (j = 0; j < n; j++) {
  ------------------
  |  Branch (1103:25): [True: 1.31M, False: 938k]
  ------------------
 1104|  1.31M|                idx++; VECTOR(*res)[idx] = i;
  ------------------
  |  |   60|  1.31M|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1105|  1.31M|            }
 1106|   938k|        }
 1107|  60.0k|        j = EDGE(VECTOR(*res)[idx]);
  ------------------
  |  | 1078|  60.0k|# define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  60.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |               # define EDGE(i) (VECTOR(*el)[ VECTOR(*iindex)[(i)] ])
  |  |  ------------------
  |  |  |  |   60|  60.0k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
 1108|   992k|        for (i = 0; i < no_of_nodes - j; i++) {
  ------------------
  |  Branch (1108:21): [True: 932k, False: 60.0k]
  ------------------
 1109|   932k|            idx++; VECTOR(*res)[idx] = no_of_edges;
  ------------------
  |  |   60|   932k|#define VECTOR(v) ((v).stor_begin)
  ------------------
 1110|   932k|        }
 1111|  60.0k|    }
 1112|       |
 1113|       |    /* clean */
 1114|       |
 1115|  60.0k|# undef EDGE
 1116|  60.0k|    return IGRAPH_SUCCESS;
 1117|  60.0k|}

igraph_qsort:
  264|   845k|{
  265|       |	local_qsort(a, n, es, cmp, NULL);
  266|   845k|}
qsort.c:local_qsort:
  121|  1.17M|{
  122|  1.17M|	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
  123|  1.17M|	size_t d1, d2;
  124|  1.17M|	int cmp_result;
  125|  1.17M|	int swap_cnt;
  126|       |
  127|       |    /* if there are less than 2 elements, then sorting is not needed */
  128|  1.17M|    if (IGRAPH_UNLIKELY(n < 2))
  ------------------
  |  |  612|  1.17M|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  ------------------
  |  |  |  Branch (612:32): [True: 644k, False: 530k]
  |  |  ------------------
  ------------------
  129|   644k|        return;
  130|   926k|loop:
  131|   926k|	swap_cnt = 0;
  132|   926k|	if (n < 7) {
  ------------------
  |  Branch (132:6): [True: 486k, False: 440k]
  ------------------
  133|  1.73M|		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
  ------------------
  |  Branch (133:29): [True: 1.25M, False: 486k]
  ------------------
  134|  1.25M|			for (pl = pm;
  135|  2.32M|			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
  ------------------
  |  |   95|  1.98M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (135:9): [True: 1.98M, False: 340k]
  |  Branch (135:27): [True: 1.07M, False: 912k]
  ------------------
  136|  1.25M|			     pl -= es)
  137|  1.07M|				swapfunc(pl, pl - es, es);
  138|   486k|		return;
  139|   486k|	}
  140|   440k|	pm = (char *)a + (n / 2) * es;
  141|   440k|	if (n > 7) {
  ------------------
  |  Branch (141:6): [True: 395k, False: 44.8k]
  ------------------
  142|   395k|		pl = a;
  143|   395k|		pn = (char *)a + (n - 1) * es;
  144|   395k|		if (n > 40) {
  ------------------
  |  Branch (144:7): [True: 53.1k, False: 342k]
  ------------------
  145|  53.1k|			size_t d = (n / 8) * es;
  146|       |
  147|  53.1k|			pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);
  148|  53.1k|			pm = med3(pm - d, pm, pm + d, cmp, thunk);
  149|  53.1k|			pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);
  150|  53.1k|		}
  151|   395k|		pm = med3(pl, pm, pn, cmp, thunk);
  152|   395k|	}
  153|   440k|	swapfunc(a, pm, es);
  154|   440k|	pa = pb = (char *)a + es;
  155|       |
  156|   440k|	pc = pd = (char *)a + (n - 1) * es;
  157|  1.64M|	for (;;) {
  158|  6.13M|		while (pb <= pc && (cmp_result = CMP(thunk, pb, a)) <= 0) {
  ------------------
  |  |   95|  5.85M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (158:10): [True: 5.85M, False: 280k]
  |  Branch (158:22): [True: 4.49M, False: 1.36M]
  ------------------
  159|  4.49M|			if (cmp_result == 0) {
  ------------------
  |  Branch (159:8): [True: 654k, False: 3.83M]
  ------------------
  160|   654k|				swap_cnt = 1;
  161|   654k|				swapfunc(pa, pb, es);
  162|   654k|				pa += es;
  163|   654k|			}
  164|  4.49M|			pb += es;
  165|  4.49M|		}
  166|  3.64M|		while (pb <= pc && (cmp_result = CMP(thunk, pc, a)) >= 0) {
  ------------------
  |  |   95|  3.20M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (166:10): [True: 3.20M, False: 440k]
  |  Branch (166:22): [True: 1.99M, False: 1.20M]
  ------------------
  167|  1.99M|			if (cmp_result == 0) {
  ------------------
  |  Branch (167:8): [True: 101k, False: 1.89M]
  ------------------
  168|   101k|				swap_cnt = 1;
  169|   101k|				swapfunc(pc, pd, es);
  170|   101k|				pd -= es;
  171|   101k|			}
  172|  1.99M|			pc -= es;
  173|  1.99M|		}
  174|  1.64M|		if (pb > pc)
  ------------------
  |  Branch (174:7): [True: 440k, False: 1.20M]
  ------------------
  175|   440k|			break;
  176|  1.20M|		swapfunc(pb, pc, es);
  177|  1.20M|		swap_cnt = 1;
  178|  1.20M|		pb += es;
  179|  1.20M|		pc -= es;
  180|  1.20M|	}
  181|   440k|	if (swap_cnt == 0) {  /* Switch to insertion sort */
  ------------------
  |  Branch (181:6): [True: 34.4k, False: 405k]
  ------------------
  182|   492k|		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
  ------------------
  |  Branch (182:29): [True: 458k, False: 34.4k]
  ------------------
  183|   458k|			for (pl = pm;
  184|  1.09M|			     pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
  ------------------
  |  |   95|  1.02M|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (184:9): [True: 1.02M, False: 65.5k]
  |  Branch (184:27): [True: 631k, False: 392k]
  ------------------
  185|   631k|			     pl -= es)
  186|   631k|				swapfunc(pl, pl - es, es);
  187|  34.4k|		return;
  188|  34.4k|	}
  189|       |
  190|   405k|	pn = (char *)a + n * es;
  191|   405k|	d1 = MIN(pa - (char *)a, pb - pa);
  ------------------
  |  |   69|   405k|#define	MIN(a, b)	((a) < (b) ? a : b)
  |  |  ------------------
  |  |  |  Branch (69:20): [True: 347k, False: 57.7k]
  |  |  ------------------
  ------------------
  192|   405k|	vecswap(a, pb - d1, d1);
  ------------------
  |  |   88|   405k|	if ((n) > 0) swapfunc(a, b, n)
  |  |  ------------------
  |  |  |  Branch (88:6): [True: 388k, False: 17.5k]
  |  |  ------------------
  ------------------
  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|   405k|	d1 = MIN(pd - pc, pn - pd - (ptrdiff_t)es);
  ------------------
  |  |   69|   405k|#define	MIN(a, b)	((a) < (b) ? a : b)
  |  |  ------------------
  |  |  |  Branch (69:20): [True: 3.81k, False: 401k]
  |  |  ------------------
  ------------------
  199|   405k|	vecswap(pb, pn - d1, d1);
  ------------------
  |  |   88|   405k|	if ((n) > 0) swapfunc(a, b, n)
  |  |  ------------------
  |  |  |  Branch (88:6): [True: 40.9k, False: 364k]
  |  |  ------------------
  ------------------
  200|       |
  201|   405k|	d1 = pb - pa;
  202|   405k|	d2 = pd - pc;
  203|   405k|	if (d1 <= d2) {
  ------------------
  |  Branch (203:6): [True: 153k, False: 252k]
  ------------------
  204|       |		/* Recurse on left partition, then iterate on right partition */
  205|   153k|		if (d1 > es) {
  ------------------
  |  Branch (205:7): [True: 118k, False: 34.2k]
  ------------------
  206|   118k|			local_qsort(a, d1 / es, es, cmp, thunk);
  207|   118k|		}
  208|   153k|		if (d2 > es) {
  ------------------
  |  Branch (208:7): [True: 144k, False: 8.37k]
  ------------------
  209|       |			/* Iterate rather than recurse to save stack space */
  210|       |			/* qsort(pn - d2, d2 / es, es, cmp); */
  211|   144k|			a = pn - d2;
  212|   144k|			n = d2 / es;
  213|   144k|			goto loop;
  214|   144k|		}
  215|   252k|	} else {
  216|       |		/* Recurse on right partition, then iterate on left partition */
  217|   252k|		if (d2 > es) {
  ------------------
  |  Branch (217:7): [True: 211k, False: 40.9k]
  ------------------
  218|   211k|			local_qsort(pn - d2, d2 / es, es, cmp, thunk);
  219|   211k|		}
  220|   252k|		if (d1 > es) {
  ------------------
  |  Branch (220:7): [True: 251k, False: 1.02k]
  ------------------
  221|       |			/* Iterate rather than recurse to save stack space */
  222|       |			/* qsort(a, d1 / es, es, cmp); */
  223|   251k|			n = d1 / es;
  224|   251k|			goto loop;
  225|   251k|		}
  226|   252k|	}
  227|   405k|}
qsort.c:swapfunc:
   77|  4.53M|{
   78|  4.53M|	char t;
   79|       |
   80|  43.4M|	do {
   81|  43.4M|		t = *a;
   82|  43.4M|		*a++ = *b;
   83|  43.4M|		*b++ = t;
   84|  43.4M|	} while (--es > 0);
  ------------------
  |  Branch (84:11): [True: 38.8M, False: 4.53M]
  ------------------
   85|  4.53M|}
qsort.c:med3:
  104|   554k|{
  105|   554k|	return CMP(thunk, a, b) < 0 ?
  ------------------
  |  |   95|   554k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (105:9): [True: 230k, False: 324k]
  ------------------
  106|   230k|	       (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
  ------------------
  |  |   95|   230k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
              	       (CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
  ------------------
  |  |   95|   119k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (106:10): [True: 110k, False: 119k]
  |  Branch (106:38): [True: 54.5k, False: 65.3k]
  ------------------
  107|   554k|	      :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
  ------------------
  |  |   95|   324k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
              	      :(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
  ------------------
  |  |   95|   279k|#define	CMP(t, x, y) (cmp((x), (y)))
  ------------------
  |  Branch (107:10): [True: 45.0k, False: 279k]
  |  Branch (107:38): [True: 45.1k, False: 234k]
  ------------------
  108|   554k|}

igraph_cmp_epsilon:
   97|   295k|int igraph_cmp_epsilon(double a, double b, double eps) {
   98|   295k|    double diff;
   99|   295k|    double abs_diff;
  100|   295k|    double sum;
  101|       |
  102|   295k|    if (a == b) {
  ------------------
  |  Branch (102:9): [True: 81.8k, False: 214k]
  ------------------
  103|       |        /* shortcut, handles infinities */
  104|  81.8k|        return 0;
  105|  81.8k|    }
  106|       |
  107|   214k|    diff = a - b;
  108|   214k|    abs_diff = fabs(diff);
  109|   214k|    sum = fabs(a) + fabs(b);
  110|       |
  111|   214k|    if (a == 0 || b == 0 || sum < DBL_MIN) {
  ------------------
  |  Branch (111:9): [True: 149k, False: 64.6k]
  |  Branch (111:19): [True: 25.3k, False: 39.2k]
  |  Branch (111:29): [True: 0, False: 39.2k]
  ------------------
  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|   174k|        return abs_diff < (eps * DBL_MIN) ? 0 : (diff < 0 ? -1 : 1);
  ------------------
  |  Branch (115:16): [True: 0, False: 174k]
  |  Branch (115:50): [True: 149k, False: 25.3k]
  ------------------
  116|   174k|    } else if (!isfinite(sum)) {
  ------------------
  |  Branch (116:16): [True: 18.4k, False: 20.8k]
  ------------------
  117|       |        /* addition overflow, so presumably |a| and |b| are both large; use a
  118|       |         * different formulation */
  119|  18.4k|        return (abs_diff < (eps * fabs(a) + eps * fabs(b))) ? 0 : (diff < 0 ? -1 : 1);
  ------------------
  |  Branch (119:16): [True: 0, False: 18.4k]
  |  Branch (119:68): [True: 18.4k, False: 0]
  ------------------
  120|  20.8k|    } else {
  121|  20.8k|        return (abs_diff / sum < eps) ? 0 : (diff < 0 ? -1 : 1);
  ------------------
  |  Branch (121:16): [True: 71, False: 20.7k]
  |  Branch (121:46): [True: 11.5k, False: 9.22k]
  ------------------
  122|  20.8k|    }
  123|   214k|}

igraph_get_edgelist:
  327|  7.91k|igraph_error_t igraph_get_edgelist(const igraph_t *graph, igraph_vector_int_t *res, igraph_bool_t bycol) {
  328|  7.91k|    return igraph_edges(graph, igraph_ess_all(IGRAPH_EDGEORDER_ID), res, bycol);
  329|  7.91k|}
igraph_to_undirected:
  498|  3.38k|                         const igraph_attribute_combination_t *edge_comb) {
  499|       |
  500|  3.38k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  501|  3.38k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  502|  3.38k|    igraph_vector_int_t edges;
  503|  3.38k|    igraph_t newgraph;
  504|  3.38k|    igraph_bool_t attr = edge_comb && igraph_has_attribute_table();
  ------------------
  |  Branch (504:26): [True: 0, False: 3.38k]
  |  Branch (504:39): [True: 0, False: 0]
  ------------------
  505|       |
  506|  3.38k|    if (mode != IGRAPH_TO_UNDIRECTED_EACH &&
  ------------------
  |  Branch (506:9): [True: 3.38k, False: 0]
  ------------------
  507|  3.38k|        mode != IGRAPH_TO_UNDIRECTED_COLLAPSE &&
  ------------------
  |  Branch (507:9): [True: 0, False: 3.38k]
  ------------------
  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.38k|    if (!igraph_is_directed(graph)) {
  ------------------
  |  Branch (512:9): [True: 0, False: 3.38k]
  ------------------
  513|      0|        return IGRAPH_SUCCESS;
  514|      0|    }
  515|       |
  516|  3.38k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&edges, 0);
  ------------------
  |  |  119|  3.38k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.38k|    do { \
  |  |  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.38k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.38k|    do { \
  |  |  |  |  604|  3.38k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.38k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.38k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.38k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.38k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  517|       |
  518|  3.38k|    if (mode == IGRAPH_TO_UNDIRECTED_EACH) {
  ------------------
  |  Branch (518:9): [True: 0, False: 3.38k]
  ------------------
  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.38k|    } else if (mode == IGRAPH_TO_UNDIRECTED_COLLAPSE) {
  ------------------
  |  Branch (549:16): [True: 3.38k, False: 0]
  ------------------
  550|  3.38k|        igraph_vector_int_t inadj, outadj;
  551|  3.38k|        igraph_vector_int_t mergeinto;
  552|  3.38k|        igraph_int_t actedge = 0;
  553|       |
  554|  3.38k|        if (attr) {
  ------------------
  |  Branch (554:13): [True: 0, False: 3.38k]
  ------------------
  555|      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]
  |  |  ------------------
  ------------------
  556|      0|        }
  557|       |
  558|  3.38k|        IGRAPH_CHECK(igraph_vector_int_reserve(&edges, no_of_edges * 2));
  ------------------
  |  |  656|  3.38k|    do { \
  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  559|  3.38k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&inadj, 0);
  ------------------
  |  |  119|  3.38k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.38k|    do { \
  |  |  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.38k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.38k|    do { \
  |  |  |  |  604|  3.38k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.38k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.38k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.38k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.38k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  560|  3.38k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&outadj, 0);
  ------------------
  |  |  119|  3.38k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.38k|    do { \
  |  |  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.38k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.38k|    do { \
  |  |  |  |  604|  3.38k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.38k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.38k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.38k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.38k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.38k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  561|       |
  562|   163k|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (562:34): [True: 160k, False: 3.38k]
  ------------------
  563|   160k|            igraph_int_t n_out, n_in;
  564|   160k|            igraph_int_t p1 = -1, p2 = -1;
  565|   160k|            igraph_int_t e1 = 0, e2 = 0, n1 = 0, n2 = 0, last;
  566|   160k|            IGRAPH_CHECK(igraph_incident(graph, &outadj, i, IGRAPH_OUT, IGRAPH_LOOPS));
  ------------------
  |  |  656|   160k|    do { \
  |  |  657|   160k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   160k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   160k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   160k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 160k]
  |  |  ------------------
  ------------------
  567|   160k|            IGRAPH_CHECK(igraph_incident(graph, &inadj, i, IGRAPH_IN, IGRAPH_LOOPS));
  ------------------
  |  |  656|   160k|    do { \
  |  |  657|   160k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|   160k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|   160k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|   160k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 160k]
  |  |  ------------------
  ------------------
  568|   160k|            n_out = igraph_vector_int_size(&outadj);
  569|   160k|            n_in = igraph_vector_int_size(&inadj);
  570|       |
  571|   160k|#define STEPOUT() if ( (++p1) < n_out) {    \
  572|   160k|        e1 = VECTOR(outadj)[p1]; \
  573|   160k|        n1 = IGRAPH_TO(graph, e1);      \
  574|   160k|    }
  575|   160k|#define STEPIN()  if ( (++p2) < n_in) {         \
  576|   160k|        e2 = VECTOR(inadj )[p2]; \
  577|   160k|        n2 = IGRAPH_FROM(graph, e2);        \
  578|   160k|    }
  579|   160k|#define ADD_NEW_EDGE() { \
  580|   160k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  581|   160k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  582|   160k|}
  583|   160k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  584|   160k|    if (attr) { \
  585|   160k|        VECTOR(mergeinto)[which] = actedge; \
  586|   160k|    } \
  587|   160k|}
  588|       |
  589|   160k|            STEPOUT();
  ------------------
  |  |  571|   160k|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (571:24): [True: 35.1k, False: 125k]
  |  |  ------------------
  |  |  572|  35.1k|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|  35.1k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  573|  35.1k|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|  35.1k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  35.1k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  574|  35.1k|    }
  ------------------
  590|   160k|            STEPIN();
  ------------------
  |  |  575|   160k|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (575:24): [True: 34.8k, False: 125k]
  |  |  ------------------
  |  |  576|  34.8k|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|  34.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  577|  34.8k|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|  34.8k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  34.8k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  578|  34.8k|    }
  ------------------
  591|       |
  592|   177k|            while (p1 < n_out && n1 <= i && p2 < n_in && n2 <= i) {
  ------------------
  |  Branch (592:20): [True: 48.8k, False: 128k]
  |  Branch (592:34): [True: 35.6k, False: 13.2k]
  |  Branch (592:45): [True: 21.4k, False: 14.2k]
  |  Branch (592:58): [True: 17.3k, False: 4.07k]
  ------------------
  593|  17.3k|                last = (n1 <= n2) ? n1 : n2;
  ------------------
  |  Branch (593:24): [True: 9.92k, False: 7.40k]
  ------------------
  594|  17.3k|                ADD_NEW_EDGE();
  ------------------
  |  |  579|  17.3k|#define ADD_NEW_EDGE() { \
  |  |  580|  17.3k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  |  |  ------------------
  |  |  |  |  656|  17.3k|    do { \
  |  |  |  |  657|  17.3k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  17.3k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  17.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.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|  17.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 17.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  581|  17.3k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  |  |  ------------------
  |  |  |  |  656|  17.3k|    do { \
  |  |  |  |  657|  17.3k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  17.3k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  17.3k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 17.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|  17.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 17.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  582|  17.3k|}
  ------------------
  595|  27.2k|                while (p1 < n_out && last == n1) {
  ------------------
  |  Branch (595:24): [True: 23.6k, False: 3.62k]
  |  Branch (595:38): [True: 9.92k, False: 13.6k]
  ------------------
  596|  9.92k|                    MERGE_INTO_CURRENT_EDGE(e1);
  ------------------
  |  |  583|  9.92k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  9.92k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 0, False: 9.92k]
  |  |  ------------------
  |  |  585|      0|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|      0|    } \
  |  |  587|  9.92k|}
  ------------------
  597|  9.92k|                    STEPOUT();
  ------------------
  |  |  571|  9.92k|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (571:24): [True: 6.29k, False: 3.62k]
  |  |  ------------------
  |  |  572|  6.29k|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|  6.29k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  573|  6.29k|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|  6.29k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.29k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  574|  6.29k|    }
  ------------------
  598|  9.92k|                }
  599|  27.3k|                while (p2 < n_in && last == n2) {
  ------------------
  |  Branch (599:24): [True: 23.6k, False: 3.63k]
  |  Branch (599:37): [True: 10.0k, False: 13.6k]
  ------------------
  600|  10.0k|                    MERGE_INTO_CURRENT_EDGE(e2);
  ------------------
  |  |  583|  10.0k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  10.0k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 0, False: 10.0k]
  |  |  ------------------
  |  |  585|      0|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|      0|    } \
  |  |  587|  10.0k|}
  ------------------
  601|  10.0k|                    STEPIN();
  ------------------
  |  |  575|  10.0k|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (575:24): [True: 6.36k, False: 3.63k]
  |  |  ------------------
  |  |  576|  6.36k|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|  6.36k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  577|  6.36k|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|  6.36k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.36k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  578|  6.36k|    }
  ------------------
  602|  10.0k|                }
  603|  17.3k|                actedge++;
  604|  17.3k|            }
  605|       |
  606|   181k|            while (p1 < n_out && n1 <= i) {
  ------------------
  |  Branch (606:20): [True: 38.0k, False: 143k]
  |  Branch (606:34): [True: 21.5k, False: 16.4k]
  ------------------
  607|  21.5k|                last = n1;
  608|  21.5k|                ADD_NEW_EDGE();
  ------------------
  |  |  579|  21.5k|#define ADD_NEW_EDGE() { \
  |  |  580|  21.5k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  |  |  ------------------
  |  |  |  |  656|  21.5k|    do { \
  |  |  |  |  657|  21.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  21.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  21.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 21.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|  21.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 21.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  581|  21.5k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  |  |  ------------------
  |  |  |  |  656|  21.5k|    do { \
  |  |  |  |  657|  21.5k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  21.5k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  21.5k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 21.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|  21.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 21.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  582|  21.5k|}
  ------------------
  609|  43.1k|                while (p1 < n_out && last == n1) {
  ------------------
  |  Branch (609:24): [True: 28.0k, False: 15.0k]
  |  Branch (609:38): [True: 21.5k, False: 6.49k]
  ------------------
  610|  21.5k|                    MERGE_INTO_CURRENT_EDGE(e1);
  ------------------
  |  |  583|  21.5k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  21.5k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 0, False: 21.5k]
  |  |  ------------------
  |  |  585|      0|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|      0|    } \
  |  |  587|  21.5k|}
  ------------------
  611|  21.5k|                    STEPOUT();
  ------------------
  |  |  571|  21.5k|#define STEPOUT() if ( (++p1) < n_out) {    \
  |  |  ------------------
  |  |  |  Branch (571:24): [True: 6.49k, False: 15.0k]
  |  |  ------------------
  |  |  572|  6.49k|        e1 = VECTOR(outadj)[p1]; \
  |  |  ------------------
  |  |  |  |   60|  6.49k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  573|  6.49k|        n1 = IGRAPH_TO(graph, e1);      \
  |  |  ------------------
  |  |  |  |  128|  6.49k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  6.49k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  574|  6.49k|    }
  ------------------
  612|  21.5k|                }
  613|  21.5k|                actedge++;
  614|  21.5k|            }
  615|       |
  616|   182k|            while (p2 < n_in && n2 <= i) {
  ------------------
  |  Branch (616:20): [True: 38.7k, False: 144k]
  |  Branch (616:33): [True: 22.4k, False: 16.2k]
  ------------------
  617|  22.4k|                last = n2;
  618|  22.4k|                ADD_NEW_EDGE();
  ------------------
  |  |  579|  22.4k|#define ADD_NEW_EDGE() { \
  |  |  580|  22.4k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, i)); \
  |  |  ------------------
  |  |  |  |  656|  22.4k|    do { \
  |  |  |  |  657|  22.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  22.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  22.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 22.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|  22.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 22.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  581|  22.4k|    IGRAPH_CHECK(igraph_vector_int_push_back(&edges, last)); \
  |  |  ------------------
  |  |  |  |  656|  22.4k|    do { \
  |  |  |  |  657|  22.4k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  22.4k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  22.4k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 22.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|  22.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 22.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  582|  22.4k|}
  ------------------
  619|  44.9k|                while (p2 < n_in && last == n2) {
  ------------------
  |  Branch (619:24): [True: 29.9k, False: 15.0k]
  |  Branch (619:37): [True: 22.4k, False: 7.48k]
  ------------------
  620|  22.4k|                    MERGE_INTO_CURRENT_EDGE(e2);
  ------------------
  |  |  583|  22.4k|#define MERGE_INTO_CURRENT_EDGE(which) { \
  |  |  584|  22.4k|    if (attr) { \
  |  |  ------------------
  |  |  |  Branch (584:9): [True: 0, False: 22.4k]
  |  |  ------------------
  |  |  585|      0|        VECTOR(mergeinto)[which] = actedge; \
  |  |  ------------------
  |  |  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  586|      0|    } \
  |  |  587|  22.4k|}
  ------------------
  621|  22.4k|                    STEPIN();
  ------------------
  |  |  575|  22.4k|#define STEPIN()  if ( (++p2) < n_in) {         \
  |  |  ------------------
  |  |  |  Branch (575:24): [True: 7.48k, False: 15.0k]
  |  |  ------------------
  |  |  576|  7.48k|        e2 = VECTOR(inadj )[p2]; \
  |  |  ------------------
  |  |  |  |   60|  7.48k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  |  |  577|  7.48k|        n2 = IGRAPH_FROM(graph, e2);        \
  |  |  ------------------
  |  |  |  |  115|  7.48k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  |  |  ------------------
  |  |  |  |  |  |   60|  7.48k|#define VECTOR(v) ((v).stor_begin)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  578|  7.48k|    }
  ------------------
  622|  22.4k|                }
  623|  22.4k|                actedge++;
  624|  22.4k|            }
  625|   160k|        }
  626|       |
  627|  3.38k|#undef MERGE_INTO_CURRENT_EDGE
  628|  3.38k|#undef ADD_NEW_EDGE
  629|  3.38k|#undef STEPOUT
  630|  3.38k|#undef STEPIN
  631|       |
  632|  3.38k|        igraph_vector_int_destroy(&outadj);
  633|  3.38k|        igraph_vector_int_destroy(&inadj);
  634|  3.38k|        IGRAPH_FINALLY_CLEAN(2);
  635|       |
  636|  3.38k|        IGRAPH_CHECK(igraph_create(&newgraph, &edges,
  ------------------
  |  |  656|  3.38k|    do { \
  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  637|  3.38k|                                   no_of_nodes,
  638|  3.38k|                                   IGRAPH_UNDIRECTED));
  639|  3.38k|        IGRAPH_FINALLY(igraph_destroy, &newgraph);
  ------------------
  |  |  603|  3.38k|    do { \
  |  |  604|  3.38k|        /* the following branch makes the compiler check the compatibility of \
  |  |  605|  3.38k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  606|  3.38k|         * incorrect destructor function with the pointer */ \
  |  |  607|  3.38k|        if (0) { func(ptr); } \
  |  |  ------------------
  |  |  |  Branch (607:13): [Folded, False: 3.38k]
  |  |  ------------------
  |  |  608|  3.38k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  609|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (609:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  640|  3.38k|        igraph_vector_int_destroy(&edges);
  641|  3.38k|        IGRAPH_CHECK(igraph_i_attribute_copy(&newgraph, graph, true, true, /* edges= */ false));
  ------------------
  |  |  656|  3.38k|    do { \
  |  |  657|  3.38k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  3.38k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  3.38k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  ------------------
  |  |  |  |  426|      0|    do { \
  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  660|      0|        } \
  |  |  661|  3.38k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 3.38k]
  |  |  ------------------
  ------------------
  642|       |
  643|  3.38k|        if (attr) {
  ------------------
  |  Branch (643:13): [True: 0, False: 3.38k]
  ------------------
  644|      0|            igraph_fixed_vectorlist_t vl;
  645|      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]
  |  |  ------------------
  ------------------
  646|      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]
  |  |  ------------------
  ------------------
  647|       |
  648|      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]
  |  |  ------------------
  ------------------
  649|       |
  650|      0|            igraph_fixed_vectorlist_destroy(&vl);
  651|      0|            IGRAPH_FINALLY_CLEAN(1);
  652|      0|        }
  653|       |
  654|  3.38k|        IGRAPH_FINALLY_CLEAN(2);
  655|  3.38k|        igraph_destroy(graph);
  656|  3.38k|        *graph = newgraph;
  657|       |
  658|  3.38k|        if (attr) {
  ------------------
  |  Branch (658:13): [True: 0, False: 3.38k]
  ------------------
  659|      0|            igraph_vector_int_destroy(&mergeinto);
  660|      0|            IGRAPH_FINALLY_CLEAN(1);
  661|      0|        }
  662|  3.38k|    } 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.38k|    return IGRAPH_SUCCESS;
  752|  3.38k|}

igraph_assortativity_nominal:
  103|  3.38k|        igraph_bool_t directed, igraph_bool_t normalized) {
  104|       |
  105|  3.38k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  106|  3.38k|    igraph_int_t no_of_edges = igraph_ecount(graph);
  107|  3.38k|    igraph_real_t no_of_edges_real = (igraph_real_t) no_of_edges;   /* for divisions */
  108|  3.38k|    igraph_int_t no_of_types;
  109|  3.38k|    igraph_vector_int_t ai, bi, eii;
  110|  3.38k|    igraph_real_t sumaibi = 0.0, sumeii = 0.0;
  111|       |
  112|  3.38k|    if (weights) {
  ------------------
  |  Branch (112:9): [True: 0, False: 3.38k]
  ------------------
  113|      0|        IGRAPH_ERROR("Weighted nominal assortativity is not yet 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]
  |  |  ------------------
  ------------------
  114|      0|                     IGRAPH_UNIMPLEMENTED);
  115|      0|    }
  116|       |
  117|  3.38k|    if (igraph_vector_int_size(types) != no_of_nodes) {
  ------------------
  |  Branch (117:9): [True: 0, False: 3.38k]
  ------------------
  118|      0|        IGRAPH_ERROR("Invalid types 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]
  |  |  ------------------
  ------------------
  119|      0|    }
  120|       |
  121|  3.38k|    if (no_of_nodes == 0) {
  ------------------
  |  Branch (121:9): [True: 1, False: 3.37k]
  ------------------
  122|      1|        *res = IGRAPH_NAN;
  ------------------
  |  |  138|      1|#define IGRAPH_NAN ((double)NAN)
  ------------------
  123|      1|        return IGRAPH_SUCCESS;
  124|      1|    }
  125|       |
  126|       |    /* 'types' length > 0 here, safe to call vector_min() */
  127|  3.37k|    if (igraph_vector_int_min(types) < 0) {
  ------------------
  |  Branch (127:9): [True: 0, False: 3.37k]
  ------------------
  128|      0|        IGRAPH_ERROR("Vertex types 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]
  |  |  ------------------
  ------------------
  129|      0|    }
  130|       |
  131|  3.37k|    directed = directed && igraph_is_directed(graph);
  ------------------
  |  Branch (131:16): [True: 3.37k, False: 0]
  |  Branch (131:28): [True: 3.37k, False: 0]
  ------------------
  132|       |
  133|  3.37k|    no_of_types = igraph_vector_int_max(types) + 1;
  134|  3.37k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&ai, no_of_types);
  ------------------
  |  |  119|  3.37k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.37k|    do { \
  |  |  |  |  657|  3.37k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.37k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.37k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.37k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.37k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.37k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.37k|    do { \
  |  |  |  |  604|  3.37k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.37k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.37k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.37k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.37k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.37k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.37k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.37k]
  |  |  ------------------
  ------------------
  135|  3.37k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&bi, no_of_types);
  ------------------
  |  |  119|  3.37k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.37k|    do { \
  |  |  |  |  657|  3.37k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.37k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.37k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.37k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.37k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.37k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.37k|    do { \
  |  |  |  |  604|  3.37k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.37k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.37k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.37k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.37k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.37k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.37k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.37k]
  |  |  ------------------
  ------------------
  136|  3.37k|    IGRAPH_VECTOR_INT_INIT_FINALLY(&eii, no_of_types);
  ------------------
  |  |  119|  3.37k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  3.37k|    do { \
  |  |  |  |  657|  3.37k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  3.37k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  3.37k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 3.37k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            IGRAPH_ERROR("", igraph_i_ret); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  426|      0|    do { \
  |  |  |  |  |  |  427|      0|        igraph_error (reason, IGRAPH_FILE_BASENAME, __LINE__, igraph_errno) ; \
  |  |  |  |  |  |  428|      0|        return igraph_errno ; \
  |  |  |  |  |  |  429|      0|    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (429:14): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  660|      0|        } \
  |  |  |  |  661|  3.37k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  3.37k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  3.37k|    do { \
  |  |  |  |  604|  3.37k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  3.37k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  3.37k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  3.37k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 3.37k]
  |  |  |  |  ------------------
  |  |  |  |  608|  3.37k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  3.37k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 3.37k]
  |  |  ------------------
  ------------------
  137|       |
  138|   105k|    for (igraph_int_t e = 0; e < no_of_edges; e++) {
  ------------------
  |  Branch (138:30): [True: 101k, False: 3.37k]
  ------------------
  139|   101k|        igraph_int_t from = IGRAPH_FROM(graph, e);
  ------------------
  |  |  115|   101k|#define IGRAPH_FROM(graph,eid) ((igraph_int_t)(VECTOR((graph)->from)[(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  140|   101k|        igraph_int_t to = IGRAPH_TO(graph, e);
  ------------------
  |  |  128|   101k|#define IGRAPH_TO(graph,eid)   ((igraph_int_t)(VECTOR((graph)->to)  [(igraph_int_t)(eid)]))
  |  |  ------------------
  |  |  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  |  |  ------------------
  ------------------
  141|   101k|        igraph_int_t from_type = VECTOR(*types)[from];
  ------------------
  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  142|   101k|        igraph_int_t to_type = VECTOR(*types)[to];
  ------------------
  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  143|       |
  144|   101k|        VECTOR(ai)[from_type] += 1;
  ------------------
  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  145|   101k|        VECTOR(bi)[to_type] += 1;
  ------------------
  |  |   60|   101k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  146|   101k|        if (from_type == to_type) {
  ------------------
  |  Branch (146:13): [True: 36.6k, False: 65.3k]
  ------------------
  147|  36.6k|            VECTOR(eii)[from_type] += 1;
  ------------------
  |  |   60|  36.6k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  148|  36.6k|        }
  149|   101k|        if (!directed) {
  ------------------
  |  Branch (149:13): [True: 0, False: 101k]
  ------------------
  150|      0|            if (from_type == to_type) {
  ------------------
  |  Branch (150:17): [True: 0, False: 0]
  ------------------
  151|      0|                VECTOR(eii)[from_type] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  152|      0|            }
  153|      0|            VECTOR(ai)[to_type] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  154|      0|            VECTOR(bi)[from_type] += 1;
  ------------------
  |  |   60|      0|#define VECTOR(v) ((v).stor_begin)
  ------------------
  155|      0|        }
  156|   101k|    }
  157|       |
  158|   162k|    for (igraph_int_t i = 0; i < no_of_types; i++) {
  ------------------
  |  Branch (158:30): [True: 159k, False: 3.37k]
  ------------------
  159|   159k|        sumaibi += (VECTOR(ai)[i] / no_of_edges_real) * (VECTOR(bi)[i] / no_of_edges_real);
  ------------------
  |  |   60|   159k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                      sumaibi += (VECTOR(ai)[i] / no_of_edges_real) * (VECTOR(bi)[i] / no_of_edges_real);
  ------------------
  |  |   60|   159k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  160|   159k|        sumeii  += (VECTOR(eii)[i] / no_of_edges_real);
  ------------------
  |  |   60|   159k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  161|   159k|    }
  162|       |
  163|  3.37k|    if (!directed) {
  ------------------
  |  Branch (163:9): [True: 0, False: 3.37k]
  ------------------
  164|      0|        sumaibi /= 4.0;
  165|      0|        sumeii  /= 2.0;
  166|      0|    }
  167|       |
  168|  3.37k|    if (normalized) {
  ------------------
  |  Branch (168:9): [True: 3.37k, False: 0]
  ------------------
  169|  3.37k|        *res = (sumeii - sumaibi) / (1.0 - sumaibi);
  170|  3.37k|    } else {
  171|      0|        *res = (sumeii - sumaibi);
  172|      0|    }
  173|       |
  174|  3.37k|    igraph_vector_int_destroy(&eii);
  175|  3.37k|    igraph_vector_int_destroy(&bi);
  176|  3.37k|    igraph_vector_int_destroy(&ai);
  177|  3.37k|    IGRAPH_FINALLY_CLEAN(3);
  178|       |
  179|  3.37k|    return IGRAPH_SUCCESS;
  180|  3.37k|}

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

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

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

igraph_strength:
  619|  10.0k|) {
  620|       |
  621|  10.0k|    igraph_int_t no_of_nodes = igraph_vcount(graph);
  622|  10.0k|    igraph_vit_t vit;
  623|  10.0k|    igraph_int_t no_vids;
  624|  10.0k|    igraph_vector_int_t degrees;
  625|  10.0k|    igraph_vector_int_t neis;
  626|       |
  627|  10.0k|    if (! weights) {
  ------------------
  |  Branch (627:9): [True: 10.0k, False: 0]
  ------------------
  628|  10.0k|        IGRAPH_VECTOR_INT_INIT_FINALLY(&degrees, no_of_nodes);
  ------------------
  |  |  119|  10.0k|    do { IGRAPH_CHECK(igraph_vector_int_init(v, size)); \
  |  |  ------------------
  |  |  |  |  656|  10.0k|    do { \
  |  |  |  |  657|  10.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  |  |  658|  10.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  612|  10.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (661:14): [Folded, False: 10.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  120|  10.0k|        IGRAPH_FINALLY(igraph_vector_int_destroy, v); } while (0)
  |  |  ------------------
  |  |  |  |  603|  10.0k|    do { \
  |  |  |  |  604|  10.0k|        /* the following branch makes the compiler check the compatibility of \
  |  |  |  |  605|  10.0k|         * func and ptr to detect cases when we are accidentally invoking an \
  |  |  |  |  606|  10.0k|         * incorrect destructor function with the pointer */ \
  |  |  |  |  607|  10.0k|        if (0) { func(ptr); } \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (607:13): [Folded, False: 10.0k]
  |  |  |  |  ------------------
  |  |  |  |  608|  10.0k|        IGRAPH_FINALLY_REAL((igraph_finally_func_t*)(func), (ptr)); \
  |  |  |  |  609|  10.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (609:14): [Folded, False: 10.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (120:64): [Folded, False: 10.0k]
  |  |  ------------------
  ------------------
  629|  10.0k|        IGRAPH_CHECK(igraph_vector_resize(res, no_of_nodes));
  ------------------
  |  |  656|  10.0k|    do { \
  |  |  657|  10.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.0k]
  |  |  ------------------
  ------------------
  630|  10.0k|        IGRAPH_CHECK(igraph_degree(graph, &degrees, vids, mode, loops));
  ------------------
  |  |  656|  10.0k|    do { \
  |  |  657|  10.0k|        igraph_error_t igraph_i_ret = (expr); \
  |  |  658|  10.0k|        if (IGRAPH_UNLIKELY(igraph_i_ret != IGRAPH_SUCCESS)) {\
  |  |  ------------------
  |  |  |  |  612|  10.0k|    #define IGRAPH_UNLIKELY(a) __builtin_expect(!!(a), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (612:32): [True: 0, False: 10.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|  10.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (661:14): [Folded, False: 10.0k]
  |  |  ------------------
  ------------------
  631|   488k|        for (igraph_int_t i = 0; i < no_of_nodes; i++) {
  ------------------
  |  Branch (631:34): [True: 478k, False: 10.0k]
  ------------------
  632|   478k|            VECTOR(*res)[i] = VECTOR(degrees)[i];
  ------------------
  |  |   60|   478k|#define VECTOR(v) ((v).stor_begin)
  ------------------
                          VECTOR(*res)[i] = VECTOR(degrees)[i];
  ------------------
  |  |   60|   478k|#define VECTOR(v) ((v).stor_begin)
  ------------------
  633|   478k|        }
  634|  10.0k|        igraph_vector_int_destroy(&degrees);
  635|  10.0k|        IGRAPH_FINALLY_CLEAN(1);
  636|  10.0k|        return IGRAPH_SUCCESS;
  637|  10.0k|    }
  638|       |
  639|      0|    if (igraph_vector_size(weights) != igraph_ecount(graph)) {
  ------------------
  |  Branch (639:9): [True: 0, False: 0]
  ------------------
  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|      0|    if (mode != IGRAPH_OUT && mode != IGRAPH_IN && mode != IGRAPH_ALL) {
  ------------------
  |  Branch (643:9): [True: 0, False: 0]
  |  Branch (643:31): [True: 0, False: 0]
  |  Branch (643:52): [True: 0, False: 0]
  ------------------
  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|      0|    if (igraph_vs_is_all(&vids)) {
  ------------------
  |  Branch (647:9): [True: 0, False: 0]
  ------------------
  648|      0|        return strength_all(graph, res, mode, loops, weights);
  649|      0|    }
  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|}

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

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

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

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

