'Given a local transition graph of a function, find all merge points inside, and then perform a
quasi-topological sort of those merge points.
A merge point might be one of the following cases:
- two or more paths come together, and ends at the same address.
- end of the current function
:param int function_addr: Address of the function.
:param list function_endpoints: Endpoints of the function. They typically come from Function.endpoints.
:param networkx.DiGraph graph: A local transition graph of a function. Normally it comes from Function.graph.
:return: A list of ordered addresses of merge points.
:rtype: list'

@staticmethod
def find_merge_points(function_addr, function_endpoints, graph):

    merge_points = set()
    in_degree_to_nodes = defaultdict(set)
    for node in graph.nodes_iter():
        in_degree = graph.in_degree(node)
        in_degree_to_nodes[in_degree].add(node)
        if (in_degree > 1):
            merge_points.add(node)
    ordered_merge_points = CFGUtils.quasi_topological_sort_nodes(graph, merge_points)
    addrs = [n.addr for n in ordered_merge_points]
    return addrs
