anchor.diff:  		'!' -> instrument_send(instrument_subtrees(Tree));
   		_Other -> instrument_subtrees(Tree)
   	    end;
  -	receive_expr ->
  -	    instrument_receive(instrument_subtrees(Tree));
  -	%% Replace every underscore with a new (underscore-prefixed) variable.
  +	receive_expr -> instrument_receive(instrument_subtrees(Tree));
   	underscore -> new_underscore_variable();
   	_Other -> instrument_subtrees(Tree)
       end.
   
  -%% Instrument a demonitor/{1,2} call.
  -%% demonitor(Args) is transformed into sched:rep_demonitor(Args).
  -instrument_demonitor(Tree) ->
  -    Module = erl_syntax:atom(sched),
  -    Function = erl_syntax:atom(rep_demonitor),
  -    Arguments = erl_syntax:application_arguments(Tree),
  -    erl_syntax:application(Module, Function, Arguments).
  -
  -%% Instrument a halt/{0,1} call.
  -%% halt(Args) is transformed into sched:rep_halt().
  -instrument_halt(Tree) ->
  -    Module = erl_syntax:atom(sched),
  -    Function = erl_syntax:atom(rep_halt),
  -    Arguments = erl_syntax:application_arguments(Tree),
  -    erl_syntax:application(Module, Function, Arguments).
  -
  -%% Instrument a link/1 call.
  -%% link(Pid) is transformed into sched:rep_link(Pid).
  -instrument_link(Tree) ->
  -    Module = erl_syntax:atom(sched),
  -    Function = erl_syntax:atom(rep_link),
  -    Arguments = erl_syntax:application_arguments(Tree),
  -    erl_syntax:application(Module, Function, Arguments).
  -
  -%% Instrument a monitor/1 call.
  -%% monitor(Ref) is transformed into sched:rep_monitor(Ref).
  -instrument_monitor(Tree) ->
  -    Module = erl_syntax:atom(sched),
  -    Function = erl_syntax:atom(rep_monitor),
  -    Arguments = erl_syntax:application_arguments(Tree),
  -    erl_syntax:application(Module, Function, Arguments).
  +%% Return {ModuleAtom, FunctionAtom, ArgTree} for a function that is going
  +%% to be instrumented or 'no_instr' otherwise.
  +get_mfa(Tree) ->
  +    Qualifier = erl_syntax:application_operator(Tree),
  +    case erl_syntax:type(Qualifier) of
  +	atom ->
  +	    Function = erl_syntax:atom_value(Qualifier),
  +	    ArgTree = erl_syntax:application_arguments(Tree),
  +	    case lists:member(Function, ?INSTR_ERLANG_NO_MOD) of
  +		true -> {erlang, Function, ArgTree};
  +		false -> no_instr
  +	    end;
  +	module_qualifier ->
  +	    ModTree = erl_syntax:module_qualifier_argument(Qualifier),
  +	    FunTree = erl_syntax:module_qualifier_body(Qualifier),
  +	    case erl_syntax:type(ModTree) =:= atom andalso
  +		erl_syntax:type(FunTree) =:= atom of
  +		true ->
  +		    Module = erl_syntax:atom_value(ModTree),
  +		    Function = erl_syntax:atom_value(FunTree),
  +		    case Module of
  +			erlang ->
  +			    case lists:member(Function, ?INSTR_ERLANG) of
  +				true ->
  +				    ArgTree =
  +					erl_syntax:application_arguments(Tree),
  +				    {Module, Function, ArgTree};
  +				false -> no_instr
  +			    end;
  +			_Other -> no_instr
  +		    end;
  +		false -> no_instr
  +	    end;
  +	_Other -> no_instr
  +    end.
  +
  +%% Instrument an application (function call).
  +instrument_application({erlang, Fun, ArgTree}) ->
  +    ModTree = erl_syntax:atom(sched),
  +    FunTree = erl_syntax:atom(list_to_atom("rep_" ++ atom_to_list(Fun))),
  +    erl_syntax:application(ModTree, FunTree, ArgTree).
   
   %% Instrument a receive expression.
   %% -----------------------------------------------------------------------------
  
positive.code: -include("gen.hrl").
  
  -define(INCLUDE_DIR, filename:absname("include")).
  
  %% Delete and purge all modules in Files.
  -spec delete_and_purge([file()]) -> 'ok'.
  
negative.code:     Arguments = [Dest, Msg],
      erl_syntax:application(Module, Function, Arguments).
  
  %%%----------------------------------------------------------------------
  %%% Utilities
  %%%----------------------------------------------------------------------
  