let add_pre_post_from_buch file treatloops  =
  let visitor =
    new visit_adding_pre_post_from_buch
      (Data_for_aorai.getAutomata())
      treatloops
  in
  Cil.visitCilFile (visitor :> Cil.cilVisitor) file;
  (* Transfer previous annotation on the new loop statement.
     Variant clause has to be preserved at the end of the annotation.*)

  Hashtbl.iter
    (fun old_stmt new_stmt ->
      let new_s = !new_stmt in
      let old_s = !old_stmt in
      let kf = Kernel_function.find_englobing_kf old_s in
      let old_annots = Annotations.get_all_annotations old_s in
      (* Erasing annotations from the old statement before attaching them with
         the new one *)

      Annotations.reset_stmt ?reset:true kf old_s;
      List.iter (Annotations.add kf new_s []) old_annots;
    )
    post_treatment_loops