anchor.diff:  
   %% Make a state call (not state enter call) to the state function
   %%
  +-compile({inline, [loop_state_callback/6]}).
   loop_state_callback(P, Debug, S, Q, State_Data, CallbackEvent) ->
       NextEventsR = [],
       Hibernate = false,
  
positive.code:     case event_type(Type) of
          true when StateCall ->
              NextEvent = {Type,Content},
              case Debug of
                  ?not_sys_debug ->
                      loop_actions_list(
                        P, Debug, S, Q, NextState_NewData,
                        [NextEvent|NextEventsR],
                        Hibernate, TimeoutsR, Postpone,
                        CallEnter, StateCall, Actions);
                  _ ->
                      Name = P#params.name,
                      {NextState,_NewData} = NextState_NewData,
                      Debug_1 =
                          sys_debug(
                            Debug, Name, {in,{Type,Content},NextState}),
                      loop_actions_list(
                        P, Debug_1, S, Q, NextState_NewData,
                        [NextEvent|NextEventsR],
                        Hibernate, TimeoutsR, Postpone,
                        CallEnter, StateCall, Actions)
                end;
          _ ->
              terminate(
                error,
                {if
                     StateCall ->
                         bad_action_from_state_function;
                     true ->
                         bad_state_enter_action_from_state_function
                 end,
                 {next_event,Type,Content}},
                ?STACKTRACE(), P, Debug,
                S#state{
                  state_data = NextState_NewData,
                  hibernate = Hibernate},
                Q)
      end.
  
  %% Do the state transition
  %%
  
negative.code:     %% and immediately was awakened.
      %%
      _ = garbage_collect(),
      %%
      %% The field 'hibernate' in S is now invalid and will be
      %% restored when looping back to loop/3 or loop_event/5.
      %%
      Q = [Event|Events],
      loop_state_callback(P, Debug, S, Q, S#state.state_data, Event);
  loop_event(P, Debug, S, Event, Events) ->
      %%
      %% The field 'hibernate' in S is now invalid and will be
      %% restored when looping back to loop/3 or loop_event/5.
      %%
      Q = [Event|Events],
      loop_state_callback(P, Debug, S, Q, S#state.state_data, Event).
  
  %% Make a state enter call to the state function, we loop back here
  %% from further down if state enter calls are enabled
  %%
  -compile({inline, [loop_state_enter/9]}).
  loop_state_enter(
    P, Debug, #state{state_data = {PrevState,_PrevData}} = S,
    Q, NextState_NewData,
  