let get_init_funcs cg =
  (* already checked that this entry point is ok *)
  let entry_point_name = Parameters.MainFunction.get () in
  let init_funcs = (* entry point is always a root *)
    Datatype.String.Set.add entry_point_name (InitFunc.get ())
  in
  (* Add the callees of entry point as roots *)
  Datatype.String.Set.union
    (try
       let callees = (Hashtbl.find cg entry_point_name).Callgraph.cnCallees in
       Inthash.fold
         (fun _ v acc -> match v.Callgraph.cnInfo with
         | Callgraph.NIVar ({vname=n},_) -> Datatype.String.Set.add n acc
         | _ -> acc)
         callees
         Datatype.String.Set.empty
     with Not_found ->
       Datatype.String.Set.empty)
    init_funcs