let compute_call_to_builtin kf initial_state actuals =
  let name = Kernel_function.get_name kf in
  try
    let name, override =
      (* Advanced builtins which override a Cil function with a Caml one, but
         use the Cil one as backup if the Caml one fails. (None by default) *)

      try
        let name = Value_parameters.BuiltinsOverrides.find name in
        Kf_state.mark_as_called kf;
        name, true
      with Not_found -> name, false
    in
    (* Standard builtins with constant names, e.g. Frama_C_cos *)
    let abstract_function = Builtins.find_builtin name in
    (try
       Some (abstract_function initial_state actuals)
     with Db.Value.Outside_builtin_possibilities ->
       if override then None
       else (
         do_degenerate None;
         raise Db.Value.Aborted
       )
    )
  with Not_found ->
    (* Special builtins, such as Frama_C_show_each_foo *)
    if Ast_info.can_be_cea_function name then
      (* A few special functions that are not registered in the builtin table *)
      if Ast_info.is_cea_dump_function name then
        Some (Builtins.dump_state initial_state)
      else if Ast_info.is_cea_alloc_with_validity name then
        Some (Builtins.alloc_with_validity initial_state actuals)
      else if Ast_info.is_cea_function name then
        Some (Builtins.dump_args name initial_state actuals)
      else if Ast_info.is_cea_dump_file_function name then
        Some (Builtins.dump_state_file name initial_state actuals)
      else
        None
    else None