anchor.diff:  	      S#{
   		state := NextState,
   		data := NewData,
  -		timer_refs := TimerRefs,
  -		timer_types := TimerTypes,
  -		cancel_timers := CancelTimers,
   		hibernate := Hibernate},
   	      [Event|Events])
       end.
   
   loop_event_enter_actions(
     Parent, Debug, #{state_enter := StateEnter} = S,
  -  TimerRefs, TimerTypes, CancelTimers,
     Events, Event, NextState, NewData,
     Hibernate, TimeoutsR, Postpone, NextEventsR,
     Actions, EnterCall) ->
  
positive.code: 		StateEnter, EnterCall ->
  		    loop_event_enter(
  		      Parent, NewDebug, S,
  		      TimerRefs, TimerTypes, CancelTimers,
  		      Events, Event, NextState, NewData,
  		      NewHibernate, NewTimeoutsR, Postpone, NextEventsR);
  		true ->
  		    loop_event_result(
  		      Parent, NewDebug, S,
  		      TimerRefs, TimerTypes, CancelTimers,
  		      Events, Event, NextState, NewData,
  		      NewHibernate, NewTimeoutsR, Postpone, NextEventsR)
  	    end;
  
negative.code:        {wakeup_from_hibernate,3}}).
  
  %% Entry point for wakeup_from_hibernate/3
  loop_receive(Parent, Debug, S) ->
      receive
  	Msg ->
  	    case Msg of
  		{system,Pid,Req} ->
  		    #{hibernate := Hibernate} = S,
  		    %% Does not return but tail recursively calls
  		    %% system_continue/3 that jumps to loop/3
  		    sys:handle_system_msg(
  		      Req, Pid, Parent, ?MODULE, Debug, S,
  		      Hibernate);
  		{'EXIT',Parent,Reason} = EXIT ->
  		    %% EXIT is not a 2-tuple therefore
  		    %% not an event but this will stand out
  		    %% in the crash report...
  		    Q = [EXIT],
  		    terminate(exit, Reason, ?STACKTRACE(), Debug, S, Q);
  		{timeout,TimerRef,TimerMsg} ->
  		    #{timer_refs := TimerRefs,
  		      timer_types := TimerTypes,
  		      hibernate := Hibernate} = S,
  		    case TimerRefs of
  			#{TimerRef := TimerType} ->
  			    %% We know of this timer; is it a running
  			    %% timer or a timer being cancelled that
  			    %% managed to send a late timeout message?
  			    case TimerTypes of
  				#{TimerType := TimerRef} ->
  				    %% The timer type maps back to this
  				    %% timer ref, so it was a running timer
  				    Event = {TimerType,TimerMsg},
  				    %% Unregister the triggered timeout
  				    NewTimerRefs =
  					maps:remove(TimerRef, TimerRefs),
  				    NewTimerTypes =
  					maps:remove(TimerType, TimerTypes),
  				    loop_receive_result(
  				      Parent, Debug,
  				      S#{
  					timer_refs := NewTimerRefs,
  					timer_types := NewTimerTypes},
  				      Hibernate,
  				      Event);
  				_ ->
  				    %% This was a late timeout message
  				    %% from timer being cancelled, so
  				    %% ignore it and expect a cancel_timer
  				    %% msg shortly
  				    loop_receive(Parent, Debug, S)
  			    end;
  			_ ->
  			    %% Not our timer; present it as an event
  			    Event = {info,Msg},
  			    loop_receive_result(
  			      Parent, Debug, S, Hibernate, Event)
  		    end;
  		{cancel_timer,TimerRef,_} ->
  		    #{timer_refs := TimerRefs,
  		      cancel_timers := CancelTimers,
  		      hibernate := Hibernate} = S,
  		    case TimerRefs of
  			#{TimerRef := _} ->
  			    %% We must have requested a cancel
  