anchor.diff:  	{
   	  entry :: beam_asm:label(), %Entry label (must not be moved).
   	  mlbl :: #{beam_asm:label() := [beam_asm:label()]}, %Moved labels.
  -	  labels :: cerl_sets:set()         %Set of referenced labels.
  +	  labels :: cerl_sets:set(),         %Set of referenced labels.
  +          index :: beam_utils:code_index() | {lazy,[beam_utils:instruction()]} %Index build lazily only if needed
   	}).
   
   opt(Is0, CLabel) ->
       find_fixpoint(fun(Is) ->
   			  Lbls = initial_labels(Is),
  -			  St = #st{entry=CLabel,mlbl=#{},labels=Lbls},
  +			  St = #st{entry=CLabel,mlbl=#{},labels=Lbls,index={lazy,Is}},
   			  opt(Is, [], St)
   		  end, Is0).
   
  
positive.code: 	Is -> find_fixpoint(OptFun, Is)
      end.
  
  opt([{test,_,{f,L}=Lbl,_}=I|[{jump,{f,L}}|_]=Is], Acc, St) ->
      %% We have
      %%    Test Label Ops
      %%    jump Label
  
negative.code:     case beam_utils:is_pure_test(I) of
  	false ->
  	    %% Test is not pure; we must keep it.
  	    opt(Is, [I|Acc0], label_used(Lbl, St0));
  	true ->
  	    %% The test is pure and its failure label is the same
  	    %% as in the jump that follows -- thus it is not needed.
              %% Check if any of the previous instructions could also be eliminated.
              {Acc,St} = opt_useless_loads(Acc0, L, St0),
  	    opt(Is, Acc, St)
      end;
  opt([{test,_,{f,L}=Lbl,_}=I|[{label,L}|_]=Is], Acc0, St0) ->
      %% Similar to the above, except we have a fall-through rather than jump
      %%    Test Label Ops
      %%    label Label
      case beam_utils:is_pure_test(I) of
  	false ->
  	    opt(Is, [I|Acc0], label_used(Lbl, St0));
  	true ->
              {Acc,St} = opt_useless_loads(Acc0, L, St0),
  	    opt(Is, Acc, St)
      end;
  opt([{test,Test0,{f,L}=Lbl,Ops}=I|[{jump,To}|Is]=Is0], Acc, St) ->
  