'Return all possible merge points in this CFG.
:param CFGAccurate cfg: The control flow graph, which must be acyclic.
:returns [(int, int)]:  A list of merge points (address and number of times looped).'

def _get_all_merge_points(self, cfg, graph_with_loops):

    graph = networkx.DiGraph(cfg.graph)
    reversed_cyclic_graph = networkx.reverse(graph_with_loops, copy=False)
    fakeret_edges = [(src, dst) for (src, dst, data) in graph.edges_iter(data=True) if (data['jumpkind'] in ('Ijk_FakeRet', 'Ijk_Exit'))]
    graph.remove_edges_from(fakeret_edges)
    fakeret_edges = [(src, dst) for (src, dst, data) in reversed_cyclic_graph.edges_iter(data=True) if (data['jumpkind'] in ('Ijk_FakeRet', 'Ijk_Exit'))]
    reversed_cyclic_graph.remove_edges_from(fakeret_edges)
    sorted_nodes = networkx.topological_sort(graph)
    nodes = [n for n in sorted_nodes if ((graph.in_degree(n) > 1) and (n.looping_times == 0))]
    nodes = sorted(nodes, cmp=(lambda n1, n2: (1 if self._post_dominate(reversed_cyclic_graph, n1, n2) else ((-1) if self._post_dominate(reversed_cyclic_graph, n2, n1) else 0))))
    return [(n.addr, n.looping_times) for n in nodes]
