anchor.diff:      State3 = inc_r_msg_count(State2, length(Msg)),
       setelement(20, State3, NewList).
   
  --spec save_n_msgs([msg_or_tag()], fun((state(), [msg_or_tag()]) -> state()), state()) -> state().
  +-spec save_n_msgs([msg_or_tag()] | msg_or_tag(), fun((state(), [msg_or_tag()]) -> state()), state()) -> state().
   save_n_msgs(Msg, SaveFun, State) when is_tuple(Msg) ->
       save_n_msgs([{single, Msg}], SaveFun, State);
   save_n_msgs(Msgs, SaveFun, State) when is_list(Msgs) ->
  
positive.code: 
  -spec s_msg_count(state()) -> non_neg_integer().
  s_msg_count(State)             -> element(7, State).
  -spec inc_s_msg_count(state()) -> state().
  inc_s_msg_count(State) -> inc_s_msg_count(State, 1).
  -spec inc_s_msg_count(state(), pos_integer()) -> state().
  inc_s_msg_count(State, N)      -> State2 = setelement(7, State, s_msg_count(State) + N),
                                    inc_s_msg_count_session(State2, N).
  
  -spec r_msg_count(state()) -> non_neg_integer().
  r_msg_count(State)             -> element(8, State).
  -spec inc_r_msg_count(state()) -> state().
  inc_r_msg_count(State)         -> inc_r_msg_count(State, 1).
  -spec inc_r_msg_count(state(), pos_integer()) -> state().
  inc_r_msg_count(State, N)      -> State2 = setelement(8, State, r_msg_count(State) + N),
                                    inc_r_msg_count_session(State2, N).
  
negative.code: -spec get_msg_tag(msg_or_tag()) -> comm:msg_tag() | comm:message().
  get_msg_tag(Msg) ->
      {_Pid, ActualMessage} = Msg,
      ?IIF(?KEEP_MSG_OR_TAG =/= tag,
           util:extint2atom(comm:get_msg_tag(ActualMessage)),
           setelement(1, ActualMessage, util:extint2atom(element(1, ActualMessage)))).
  
  