let select_entry_point set ~spare kf ~outputs =
  if !Db.Value.is_called kf then
    let mark =
      !Db.Slicing.Mark.make ~data:(not spare) ~addr:(not spare) ~ctrl:(not spare)
    in
      assert (!Db.Value.is_called kf) ; (* otherwise [!Db.Outputs.get_external kf] gives weird results *)
      select_entry_point_and_some_inputs_outputs set ~mark kf
        ~return:outputs
        ~outputs:(if outputs then !Db.Outputs.get_external kf else Locations.Zone.bottom)
        ~inputs:Locations.Zone.bottom
  else set