angr/analyses/decompiler/optimization_passes/eager_returns.py
def _single_entry_region(graph, end_node):
        """
        Back track on the graph from `end_node` and find the longest chain of nodes where each node has only one
        predecessor and one successor.

        :param end_node:    A node in the graph.
        :return:            A list of nodes where the first node either has no predecessors or at least two
                            predecessors.
        :rtype:             list
        """

        region = [ end_node ]
        traversed = { end_node }
        node = end_node
        while True:
            preds = list(graph.predecessors(node))
            if len(preds) != 1:
                break
            node = preds[0]
            if graph.out_degree[node] != 1:
                break
            if node in traversed:
                break
            region.insert(0, node)
            traversed.add(node)
        return region

        Back track on the graph from `end_node` and find the longest chain of nodes where each node has only one
        predecessor and one successor.

        :param end_node:    A node in the graph.
        :return:            A list of nodes where the first node either has no predecessors or at least two
                            predecessors.
        :rtype:             list
        
Back track on the graph from `end_node` and find the longest chain of nodes where each node has only one
predecessor and one successor.
Back track on the graph from ` end_node ` and find the longest chain of nodes where each node has only one predecessor and one successor .
def _single_entry_region(graph, end_node):
        region = [ end_node ]
        traversed = { end_node }
        node = end_node
        while True:
            preds = list(graph.predecessors(node))
            if len(preds) != 1:
                break
            node = preds[0]
            if graph.out_degree[node] != 1:
                break
            if node in traversed:
                break
            region.insert(0, node)
            traversed.add(node)
        return region
def _single_entry_region ( graph , end_node ) : region = [ end_node ] traversed = { end_node } node = end_node while True : preds = list ( graph . predecessors ( node ) ) if len ( preds ) != 1 : break node = preds [ 0 ] if graph . out_degree [ node ] != 1 : break if node in traversed : break region . insert ( 0 , node ) traversed . add ( node ) return region
Back track on the graph from `end_node` and find the longest chain of nodes where each node has only one
predecessor and one successor.
Back track on the graph from ` end_node ` and find the longest chain of nodes where each node has only one predecessor and one successor .
"""
        Back track on the graph from `end_node` and find the longest chain of nodes where each node has only one
        predecessor and one successor.

        :param end_node:    A node in the graph.
        :return:            A list of nodes where the first node either has no predecessors or at least two
                            predecessors.
        :rtype:             list
        """
A list of nodes where the first node either has no predecessors or at least two
predecessors.
A list of nodes where the first node either has no predecessors or at least two predecessors .
list
graph
end_node
A node in the graph.
A node in the graph .