let wp_call ((_, cfg, strategy, _, wenv)) v stmt res fct args p_post p_exit =
debug "[wp_call] %a@." !Ast_printer.d_exp fct;
let eb = match Cil2cfg.pred_e cfg v with e::_ -> e | _ -> assert false in
let en, ee = Cil2cfg.get_call_out_edges cfg v in
let eb_annot = WpStrategy.get_annots strategy eb in
let en_annot = WpStrategy.get_annots strategy en in
let ee_annot = WpStrategy.get_annots strategy ee in
let call_asgn = WpStrategy.get_call_asgn en_annot in
match WpStrategy.get_called_kf fct with
| None ->
let obj = W.merge p_post p_exit in
let lab, obj = add_assigns_hyp wenv obj call_asgn in
let obj = match lab with Some _ -> obj
| None -> assert false
in obj
| Some kf ->
let assigns = match call_asgn with
| WpPropId.AssignsLocations (_, asgn_body) ->
asgn_body.WpPropId.a_assigns
| WpPropId.AssignsAny _ -> WritesAny
| WpPropId.NoAssignsInfo -> assert false
in
let pre_hyp, pre_goals = WpStrategy.get_call_pre eb_annot in
let obj = W.call wenv stmt res kf args
~pre:(pre_hyp)
~post:((WpStrategy.get_call_hyp en_annot))
~pexit:((WpStrategy.get_call_hyp ee_annot))
~assigns ~p_post ~p_exit
in W.call_goal_precond wenv stmt kf args ~pre:(pre_goals) obj