let compute_entry_point kf ~library =
  Kf_state.mark_as_called kf;
  Value_parameters.feedback "Computing for function %a"
    Kernel_function.pretty_name kf;
  Value_parameters.feedback "====== INITIAL STATE ======";
  let initial_state_globals =
    if library then initial_state_contextfree_only_globals ()
    else Db.Value.globals_state ()
  in
  Value_parameters.feedback "====== INITIAL STATE COMPUTED ======";

  Value_parameters.result "@[<hov 0>Values of globals at initialization@\n%a@]"
    Db.Value.pretty_state_without_null
    initial_state_globals;

  let with_formals = initial_state_formals kf initial_state_globals in
  Db.Value.Call_Value_Callbacks.apply (with_formals, [ kf, Kglobal ]);
  let result =
    compute_with_initial_state kf ~call_kinstr:Kglobal with_formals
  in
  Value_parameters.feedback "done for function %a"
    Kernel_function.pretty_name kf;
  result