let copy_paste_locations ~with_alarms ~exp_lv ~left ~right size_int old_state =
   (* directly copy the old value without trying to recompose it.
      Useful for structs assignment. *)

  let size = Int_Base.inject size_int in
  let right_loc = Locations.make_loc right size in
  let left_loc = Locations.make_loc left size in
  let offsetmap_relations =
    try
      copy_offsetmap_from_virtual
        ~with_alarms
        right_loc exp_lv left_loc old_state
    with Lmap.Cannot_copy ->
      Cvalue_type.V_Offsetmap.empty
  in
  let offsetmap_memory =
    match Relations_type.Model.copy_offsetmap ~with_alarms right_loc old_state
    with
    | Some v -> v
    | None -> raise Lmap.Cannot_copy
  in
  let offsetmap =
    Cvalue_type.V_Offsetmap.over_intersection
      offsetmap_relations
      offsetmap_memory
  in
  if not (Cvalue_type.V_Offsetmap.is_empty offsetmap)
  then begin
    try
      CilE.set_syntactic_context (CilE.SyMem exp_lv);
      Relations_type.Model.paste_offsetmap
        offsetmap left_loc.loc Int.zero size_int old_state
    with Lmap.Cannot_copy as e -> raise e
  end
  else raise Lmap.Cannot_copy