':param angr.knowledge.Function function:
:return:'

def _optimize_function(self, function):

    func_kb = KnowledgeBase(self.project, self.project.loader.main_object)
    cfg = self.project.analyses.CFGAccurate(kb=func_kb, call_depth=1, base_graph=function.graph, keep_state=True, starts=(function.addr,), iropt_level=0)
    ddg = self.project.analyses.DDG(kb=func_kb, cfg=cfg)
    if ('constant_propagation' in self._techniques):
        self._constant_propagation(function, ddg.simplified_data_graph)
    if ('redundant_stack_variable_removal' in self._techniques):
        self._redundant_stack_variable_removal(function, ddg.simplified_data_graph)
    if ('register_reallocation' in self._techniques):
        self._register_reallocation(function, ddg.simplified_data_graph)
    if ('dead_assignment_elimination' in self._techniques):
        self._dead_assignment_elimination(function, ddg.simplified_data_graph)
