anchor.diff:                ?STACKTRACE(), P, Debug,
                 S#state{
                   state_data = State_Data,
  -                hibernate = '#trans_opts.hibernate'(TransOpts)},
  +                hibernate = Hibernate},
                 Q)
       end.
   
   %% Ensure that Actions are a list
   loop_actions(
  -  P, Debug, S, Q, NextState_NewData, TransOpts,
  -  [], CallEnter) ->
  +  P, Debug, S, Q, NextState_NewData,
  +  NextEventsR, Hibernate, TimeoutsR, Postpone,
  +  CallEnter, _StateCall, []) ->
  +    loop_actions(
  +      P, Debug, S, Q, NextState_NewData,
  +      NextEventsR, Hibernate, TimeoutsR, Postpone,
  +      CallEnter);
  +loop_actions(
  +  P, Debug, S, Q, NextState_NewData,
  +  NextEventsR, Hibernate, TimeoutsR, Postpone,
  +  CallEnter, StateCall, Actions) ->
  +    %%
  +    loop_actions_list(
  +      P, Debug, S, Q, NextState_NewData,
  +      NextEventsR, Hibernate, TimeoutsR, Postpone,
  +      CallEnter, StateCall, listify(Actions)).
  +%%
  +%% Shortcut for no actions
  +-compile({inline, [loop_actions/10]}).
  +loop_actions(
  +  P, Debug, S, Q, NextState_NewData,
  +  NextEventsR, Hibernate, TimeoutsR, Postpone,
  +  CallEnter) ->
       %%
       %% Shortcut for no actions
       case CallEnter andalso P#params.state_enter of
   	true ->
               loop_state_enter(
  -              P, Debug, S, Q, NextState_NewData, trans_opts(TransOpts));
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate, TimeoutsR, Postpone);
   	false ->
               loop_state_transition(
  -              P, Debug, S, Q, NextState_NewData, trans_opts(TransOpts))
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate, TimeoutsR, Postpone)
  +    end.
  +
  +loop_actions_list(
  +  P, Debug, S, Q, NextState_NewData,
  +  NextEventsR, Hibernate, TimeoutsR, Postpone,
  +  CallEnter, _StateCall, []) ->
  +    %%
  +    case P#params.state_enter of
  +        true when CallEnter ->
  +            loop_state_enter(
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate, TimeoutsR, Postpone);
  +        _ ->
  +            loop_state_transition(
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate, TimeoutsR, Postpone)
       end;
  -loop_actions(
  -  P, Debug, S, Q, NextState_NewData, TransOpts,
  -  Actions, CallEnter) ->
  -    %%
  -    loop_actions_list(
  -      P, Debug, S, Q, NextState_NewData, TransOpts,
  -      listify(Actions), CallEnter).
  -
  --compile({inline, loop_actions_list/8}).
  -%% Process actions from the state function
   loop_actions_list(
  -  #params{state_enter = StateEnter} = P, Debug, S,
  -  Q, NextState_NewData, TransOpts,
  -  Actions, CallEnter) ->
  -    %%
  -    case parse_actions(P, Debug, S, Actions, TransOpts) of
  -        {Debug_1,TransOpts_1}
  -          when StateEnter, CallEnter ->
  -            loop_state_enter(
  -              P, Debug_1, S, Q, NextState_NewData, TransOpts_1);
  -        {Debug_1,TransOpts_1} ->
  -            loop_state_transition(
  -              P, Debug_1, S, Q, NextState_NewData, TransOpts_1);
  -        [Class,Reason,Stacktrace,Debug_1] ->
  -            terminate(
  -              Class, Reason, Stacktrace, P, Debug_1,
  -              S#state{
  -                state_data = NextState_NewData,
  -                hibernate = '#trans_opts.hibernate'(TransOpts)},
  -              Q)
  -    end.
  -
  -%%---------------------------------------------------------------------------
  -%% The server loop continues after parse_actions
  -
  -parse_actions(P, Debug, S, Actions, TransOpts) ->
  -    if
  -        ?state_call(TransOpts) ->
  -            %% Inlining of trans_opts/1 for when
  -            %% ?state_call(TransOpts) is 'true'
  -            %%
  -            Hibernate = (#trans_opts{})#trans_opts.hibernate,
  -            Postpone = (#trans_opts{})#trans_opts.postpone,
  -            TimeoutsR = (#trans_opts{})#trans_opts.timeouts_r,
  -            NextEventsR = (#trans_opts{})#trans_opts.next_events_r,
  -            parse_actions(
  -              P, Debug, S, Actions, true,
  -              Hibernate, Postpone, TimeoutsR, NextEventsR);
  -        true ->
  -            #trans_opts{
  -               hibernate = Hibernate,
  -               postpone = Postpone,
  -               timeouts_r = TimeoutsR,
  -               next_events_r = NextEventsR} = TransOpts,
  -            parse_actions(
  -              P, Debug, S, Actions, false,
  -              Hibernate, Postpone, TimeoutsR, NextEventsR)
  -    end.
  -%%
  -parse_actions(
  -  _P, Debug, _S, [], _StateCall,
  -  Hibernate, Postpone, TimeoutsR, NextEventsR) ->
  -    {Debug,
  -     #trans_opts{
  -        hibernate = Hibernate,
  -        postpone = Postpone,
  -        timeouts_r = TimeoutsR,
  -        next_events_r = NextEventsR}};
  -parse_actions(
  -  P, Debug, S, [Action|Actions], StateCall,
  -  Hibernate, Postpone, TimeoutsR, NextEventsR) ->
  +  P, Debug, S, Q, NextState_NewData,
  +  NextEventsR, Hibernate, TimeoutsR, Postpone,
  +  CallEnter, StateCall, [Action|Actions]) ->
  +    %%
       case Action of
   	%% Actual actions
   	{reply,From,Reply} ->
  -            parse_actions_reply(
  -              P, Debug, S, Actions, StateCall,
  -              Hibernate, Postpone, TimeoutsR, NextEventsR, From, Reply);
  +            loop_actions_reply(
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate, TimeoutsR, Postpone,
  +              CallEnter, StateCall, Actions,
  +              From, Reply);
   	%%
   	%% Actions that set options
   	{hibernate,Hibernate_1} when is_boolean(Hibernate_1) ->
  -            parse_actions(
  -              P, Debug, S, Actions, StateCall,
  -              Hibernate_1, Postpone, TimeoutsR, NextEventsR);
  +            loop_actions_list(
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate_1, TimeoutsR, Postpone,
  +              CallEnter, StateCall, Actions);
   	hibernate ->
  -            parse_actions(
  -              P, Debug, S, Actions, StateCall,
  -              true, Postpone, TimeoutsR, NextEventsR);
  +            loop_actions_list(
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, true, TimeoutsR, Postpone,
  +              CallEnter, StateCall, Actions);
   	%%
   	{postpone,Postpone_1} when not Postpone_1 orelse StateCall ->
  -            parse_actions(
  -              P, Debug, S, Actions, StateCall,
  -              Hibernate, Postpone_1, TimeoutsR, NextEventsR);
  +            loop_actions_list(
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate, TimeoutsR, Postpone_1,
  +              CallEnter, StateCall, Actions);
   	postpone when StateCall ->
  -            parse_actions(
  -              P, Debug, S, Actions, StateCall,
  -              Hibernate, true, TimeoutsR, NextEventsR);
  +            loop_actions_list(
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate, TimeoutsR, true,
  +              CallEnter, StateCall, Actions);
   	postpone ->
  -            [error,
  -             {bad_state_enter_action_from_state_function,Action},
  -             ?STACKTRACE(),
  -             Debug];
  +            terminate(
  +              error,
  +              {bad_state_enter_action_from_state_function,Action},
  +              ?STACKTRACE(), P, Debug,
  +              S#state{
  +                state_data = NextState_NewData,
  +                hibernate = Hibernate},
  +              Q);
   	%%
   	{next_event,Type,Content} ->
  -            parse_actions_next_event(
  -              P, Debug, S, Actions, StateCall,
  -              Hibernate, Postpone, TimeoutsR, NextEventsR, Type, Content);
  +            loop_actions_next_event(
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate, TimeoutsR, Postpone,
  +              CallEnter, StateCall, Actions, Type, Content);
   	%%
           Timeout ->
  -            parse_actions_timeout(
  -              P, Debug, S, Actions, StateCall,
  -              Hibernate, Postpone, TimeoutsR, NextEventsR, Timeout)
  -    end.
  -
  -parse_actions_reply(
  -  P, Debug, S, Actions, StateCall,
  -  Hibernate, Postpone, TimeoutsR, NextEventsR, From, Reply) ->
  +            loop_actions_timeout(
  +              P, Debug, S, Q, NextState_NewData,
  +              NextEventsR, Hibernate, TimeoutsR, Postpone,
  +              CallEnter, StateCall, Actions, Timeout)
  +    end.
  +
  +loop_actions_reply(
  +  P, Debug, S, Q, NextState_NewData,
  +  NextEventsR, Hibernate, TimeoutsR, Postpone,
  +  CallEnter, StateCall, Actions,
  +  From, Reply) ->
       %%
       case from(From) of
           true ->
  
positive.code:               ?STACKTRACE(), P, Debug,
                S#state{
                  state_data = State_Data,
                  hibernate = '#trans_opts.hibernate'(TransOpts)},
                Q);
  	{next_state,State,NewData,Actions} ->
              loop_actions(
                P, Debug, S, Q, {State,NewData}, TransOpts,
                Actions, false);
  	{next_state,NextState,NewData,Actions}
            when ?state_call(TransOpts) ->
              loop_actions(
                P, Debug, S, Q, {NextState,NewData}, TransOpts,
                Actions, true);
  	{next_state,_NextState,_NewData,_Actions} ->
              terminate(
                error,
  
negative.code:               exit, Reason, ?STACKTRACE(), P, Debug,
                S#state{
                  state_data = State_Data,
                  hibernate = Hibernate},
                Q, Replies);
  	{stop_and_reply,Reason,Replies,NewData} ->
              reply_then_terminate(
                exit, Reason, ?STACKTRACE(), P, Debug,
                S#state{
                  state_data = {State,NewData},
                  hibernate = Hibernate},
                Q, Replies);
  	%%
  	_ ->
  