anchor.diff:  
   -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).
  
positive.code:                              State2 = setelement(17, State1, 0),
                               inc_session_count(State2).
  
  -spec session_count(state()) -> state().
  session_count(State) -> element(18, State).
  -spec inc_session_count(state()) -> state().
  inc_session_count(State) -> setelement(18, State, session_count(State) + 1).
  
negative.code:     State3 = inc_r_msg_count(State2, length(Msg)),
      setelement(20, State3, NewList).
  
  -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) ->
  