let cfg_from_definition kf f =
  let kf_name = Kernel_function.get_name kf in
  let cfg, fct_in, fct_out = init_cfg false kf in
  let in_b = cfg_block cfg Bfct f.sbody fct_out in
  let _ = add_edge cfg fct_in Enone in_b in
  let graph = cfg_graph cfg in
    debug "for function '%s': %d vertex - %d edges@."
      kf_name (CFG.nb_edges graph) (CFG.nb_vertex graph);
    debug
      "start removing unreachable in %s@." kf_name;
  !Db.progress ();
  let cfg = clean_graph cfg in
    debug "for function '%s': %d vertex - %d edges@."
      kf_name (CFG.nb_edges graph) (CFG.nb_vertex graph);
  !Db.progress ();
    debug
      "start loop analysis for %s@." kf_name;
  let cfg = mark_loops cfg in
    cfg