'Builds a CFG from the current function.
Saved in cfg_cache.
returns (CFGAccurate, networkx.DiGraph): Tuple of the CFG and networkx representation of it'

def _make_cfg(self):

    state = self._input_state
    ip_int = state.addr
    cfg_key = (ip_int, state.history.jumpkind)
    if (cfg_key in self.cfg_cache):
        (cfg, cfg_graph_with_loops) = self.cfg_cache[cfg_key]
    else:
        if self._enable_function_inlining:
            call_tracing_filter = CallTracingFilter(self.project, depth=0)
            filter = call_tracing_filter.filter
        else:
            filter = None
        cfg_initial_state = self.project.factory.blank_state(mode='fastpath')
        if (self.project.arch.name == 'X86'):
            if (not state.se.symbolic(state.regs.eax)):
                cfg_initial_state.regs.eax = state.regs.eax
        elif (self.project.arch.name == 'AMD64'):
            if (not state.se.symbolic(state.regs.rax)):
                cfg_initial_state.regs.rax = state.regs.rax
        cfg = self.project.analyses.CFGAccurate(starts=((ip_int, state.history.jumpkind),), context_sensitivity_level=0, call_depth=1, call_tracing_filter=filter, initial_state=cfg_initial_state, normalize=True, kb=KnowledgeBase(self.project, self.project.loader.main_object))
        cfg_graph_with_loops = networkx.DiGraph(cfg.graph)
        cfg.force_unroll_loops(self._loop_unrolling_limit)
        self.cfg_cache[cfg_key] = (cfg, cfg_graph_with_loops)
    return (cfg, cfg_graph_with_loops)
