anchor.diff:              parse_timeout_opts_abs(Opts, Abs_1);
           _ ->
               badarg
  -    end.
  -
  -%% Stop and start timers as well as create timeout zero events
  -%% and pending event timer
  -%%
  -%% Stop and start timers non-event timers
  -parse_timers(Timers, TimeoutsR) ->
  -    parse_timers(Timers, TimeoutsR, #{}, []).
  -%%
  -parse_timers(Timers, [], _Seen, TimeoutEvents) ->
  -    %%
  -    {Timers,TimeoutEvents};
  -parse_timers(Timers, [Timeout|TimeoutsR], Seen, TimeoutEvents) ->
  -    %%
  -    case Timeout of
  -	{TimeoutType,Time,TimeoutMsg,TimeoutOpts} ->
  -	    %% Absolute timer
  -	    parse_timers(
  -	      Timers, TimeoutsR, Seen, TimeoutEvents,
  -	      TimeoutType, Time, TimeoutMsg, listify(TimeoutOpts));
  -	%% Relative timers below
  -	{TimeoutType,0,TimeoutMsg} ->
  -	    parse_timers(
  -	      Timers, TimeoutsR, Seen, TimeoutEvents,
  -	      TimeoutType, zero, TimeoutMsg, []);
  -	{TimeoutType,Time,TimeoutMsg} ->
  -	    parse_timers(
  -	      Timers, TimeoutsR, Seen, TimeoutEvents,
  -	      TimeoutType, Time, TimeoutMsg, [])
  -    end.
  -
  -parse_timers(
  -  Timers, TimeoutsR, Seen, TimeoutEvents,
  -  TimeoutType, Time, TimeoutMsg, TimeoutOpts) ->
  -    case Seen of
  -	#{TimeoutType := _} ->
  -	    %% Type seen before - ignore
  -	    parse_timers(
  -              Timers, TimeoutsR, Seen, TimeoutEvents);
  -	#{} ->
  -	    %% Unseen type - handle
  -	    Seen_1 = Seen#{TimeoutType => true},
  -	    case Time of
  -		infinity ->
  -		    %% Cancel any running timer
  -		    parse_timers(
  -		      cancel_timer_by_type(TimeoutType, Timers),
  -                      TimeoutsR, Seen_1, TimeoutEvents);
  -		zero ->
  -		    %% Cancel any running timer
  -		    %% Handle zero time timeouts later
  -		    parse_timers(
  -		      cancel_timer_by_type(TimeoutType, Timers),
  -                      TimeoutsR, Seen_1,
  -                      [{TimeoutType,TimeoutMsg}|TimeoutEvents]);
  -		_ ->
  -		    %% (Re)start the timer
  -		    TimerRef =
  -			erlang:start_timer(
  -			  Time, self(), TimeoutMsg, TimeoutOpts),
  -                    {TimerRefs,TimeoutTypes} = Timers,
  -		    case TimeoutTypes of
  -                        #{TimeoutType := OldTimerRef} ->
  -                            %% Cancel the running timer,
  -                            %% update the timeout type,
  -                            %% insert the new timer ref,
  -                            %% and remove the old timer ref
  -                            cancel_timer(OldTimerRef),
  -                            Timers_1 =
  -                                {maps:remove(
  -                                   OldTimerRef,
  -                                   TimerRefs#{TimerRef => TimeoutType}),
  -                                 TimeoutTypes#{TimeoutType := TimerRef}},
  -                            parse_timers(
  -                              Timers_1, TimeoutsR, Seen_1, TimeoutEvents);
  -                        #{} ->
  -                            %% Insert the new timer type and ref
  -                            Timers_1 =
  -                                {TimerRefs#{TimerRef => TimeoutType},
  -                                 TimeoutTypes#{TimeoutType => TimerRef}},
  -                            parse_timers(
  -                              Timers_1, TimeoutsR, Seen_1, TimeoutEvents)
  -		    end
  -	    end
       end.
   
   %% Enqueue immediate timeout events (timeout 0 events)
  
positive.code:               ?STACKTRACE(), P, Debug,
                S#state{
                  state_data = State_Data,
                  hibernate = '#trans_opts.hibernate'(TransOpts)},
                Q)
      end.
  
  %% Ensure that Actions are a list
  loop_actions(
    P, Debug, S, Q, NextState_NewData, TransOpts,
    [], 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));
  	false ->
              loop_state_transition(
                P, Debug, S, Q, NextState_NewData, trans_opts(TransOpts))
      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) ->
      case Action of
  	%% Actual actions
  	{reply,From,Reply} ->
              parse_actions_reply(
                P, Debug, S, Actions, StateCall,
                Hibernate, Postpone, TimeoutsR, NextEventsR, 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);
  	hibernate ->
              parse_actions(
                P, Debug, S, Actions, StateCall,
                true, Postpone, TimeoutsR, NextEventsR);
  	%%
  	{postpone,Postpone_1} when not Postpone_1 orelse StateCall ->
              parse_actions(
                P, Debug, S, Actions, StateCall,
                Hibernate, Postpone_1, TimeoutsR, NextEventsR);
  	postpone when StateCall ->
              parse_actions(
                P, Debug, S, Actions, StateCall,
                Hibernate, true, TimeoutsR, NextEventsR);
  	postpone ->
              [error,
               {bad_state_enter_action_from_state_function,Action},
               ?STACKTRACE(),
               Debug];
  	%%
  	{next_event,Type,Content} ->
              parse_actions_next_event(
                P, Debug, S, Actions, StateCall,
                Hibernate, Postpone, TimeoutsR, NextEventsR, 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) ->
      %%
      case from(From) of
          true ->
  
negative.code:             %% will cause swap out of all live registers anyway
              reply(From, Reply),
              Debug_1 = ?sys_debug(Debug, P#params.name, {out,Reply,From}),
              loop_actions_list(
                P, Debug_1, S, Q, NextState_NewData,
                NextEventsR, Hibernate, TimeoutsR, Postpone,
                CallEnter, StateCall, Actions);
          false ->
              terminate(
                error,
                {bad_action_from_state_function,{reply,From,Reply}},
                ?STACKTRACE(), P, Debug,
                S#state{
                  state_data = NextState_NewData,
                  hibernate = Hibernate},
                Q)
      end.
  
  loop_actions_next_event(
    P, Debug, S, Q, NextState_NewData,
    NextEventsR, Hibernate, TimeoutsR, Postpone,
    CallEnter, StateCall, Actions, Type, Content) ->
      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,
                      {State,_Data} = S#state.state_data,
                      Debug_1 =
                          sys_debug(Debug, Name, {in,{Type,Content},State}),
                      loop_actions_list(
                        P, Debug_1, S, Q, NextState_NewData,
                        [NextEvent|NextEventsR],
                        Hibernate, TimeoutsR, Postpone,
                        CallEnter, StateCall, Actions)
                end;
          _ ->
              terminate(
                error,
                {bad_state_enter_action_from_state_function,
                 {next_event,Type,Content}},
                ?STACKTRACE(), P, Debug,
                S#state{
                  state_data = NextState_NewData,
                  hibernate = Hibernate},
                Q)
      end.
  
  loop_actions_timeout(
    P, Debug, S, Q, NextState_NewData,
    NextEventsR, Hibernate, TimeoutsR, Postpone,
    CallEnter, StateCall, Actions,
    {TimeoutType,Time,TimeoutMsg,TimeoutOpts} = Timeout) ->
      %%
      case timeout_event_type(TimeoutType) of
          true ->
  