anchor.diff:  merge_warns({ok, M, B}, Warns, binary)           -> {ok, M, B, Warns};
   merge_warns({ok, M, B, Warns1}, Warns2, binary)  -> {ok, M, B, Warns2++Warns1};
   merge_warns({error, R}, Warns, _OutFmt)          -> {error, R, Warns};
  -merge_warns({error, R, Warns1}, Warns2, _OutFmt) -> {error, R, Warns2++Warns1}.
  +merge_warns({error, R, Warns1}, Warns2, _OutFmt) -> {error, R, Warns2++Warns1};
  +merge_warns(error, Warns, binary) ->
  +    erlang:error({internal_error, generated_code_failed_to_compile, Warns}).
   
   possibly_report_warnings(Result, Opts) ->
       Warns = case Result of
  
positive.code:     end.
  
  format_packed_field_decoder(MsgName, FieldDef, AnRes, Opts) ->
      case get_field_pass(MsgName, AnRes) of
          pass_as_params ->
              format_packed_field_decoder_pap(MsgName, FieldDef, AnRes, Opts);
          pass_as_record ->
              format_packed_field_decoder_par(MsgName, FieldDef, Opts)
      end.
  
  format_packed_field_decoder_pap(MsgName, FieldDef, AnRes, Opts) ->
      NF = get_num_fields(MsgName, AnRes),
      #field{name=FName, rnum=RNum, opts=FOpts}=FieldDef,
      DecodePackWrapFn = mk_fn(d_field_, MsgName, FName),
      FieldDefAsNonpacked = FieldDef#field{opts = FOpts -- [packed]},
      FieldVars = [[", ", f("F~w", [I])] || I <- lists:seq(1, NF)],
      InFieldVars = [[", ", if I == RNum-1 -> "AccSeq";
                               I /= RNum-1 -> f("F~w", [I])
                            end]
                     || I <- lists:seq(1, NF)],
      OutFieldVars = [[", ", if I == RNum-1 -> "NewSeq";
                                I /= RNum-1 -> f("F~w", [I])
                             end]
                      || I <- lists:seq(1, NF)],
      [f("~p(<<1:1, X:7, Rest/binary>>, N, Acc~s) ->~n",
         [DecodePackWrapFn, FieldVars]),
       f("    ~p(Rest, N+7, X bsl N + Acc~s);~n", [DecodePackWrapFn, FieldVars]),
       f("~p(<<0:1, X:7, Rest/binary>>, N, Acc~s) ->~n",
         [DecodePackWrapFn, InFieldVars]),
       f("    Len = X bsl N + Acc,~n"),
       f("    <<PackedBytes:Len/binary, Rest2/binary>> = Rest,~n"),
       f("    NewSeq = ~p(PackedBytes~sAccSeq),~n",
         [mk_fn(d_packed_field_, MsgName, FName),
          case mk_field_decoder_vi_params(FieldDefAsNonpacked, no_fill) of
              ""     -> [", "];
              Params -> [", ", Params, ", "]
          end]),
       f("    ~p(Rest2, 0, 0~s).~n~n",
         [mk_fn(d_read_field_def_, MsgName), OutFieldVars]),
       format_packed_field_seq_decoder(MsgName, FieldDef, Opts)].
  
  format_packed_field_decoder_par(MsgName, FieldDef, Opts) ->
      #field{name=FName, opts=FOpts}=FieldDef,
      DecodePackWrapFn = mk_fn(d_field_, MsgName, FName),
      FieldDefAsNonpacked = FieldDef#field{opts = FOpts -- [packed]},
      [f("~p(<<1:1, X:7, Rest/binary>>, N, Acc, Msg) ->~n", [DecodePackWrapFn]),
       f("    ~p(Rest, N+7, X bsl N + Acc, Msg);~n", [DecodePackWrapFn]),
       f("~p(<<0:1, X:7, Rest/binary>>, N, Acc, #~p{~p=AccSeq}=Msg) ->~n",
         [DecodePackWrapFn, MsgName, FName]),
       f("    Len = X bsl N + Acc,~n"),
       f("    <<PackedBytes:Len/binary, Rest2/binary>> = Rest,~n"),
       f("    NewSeq = ~p(PackedBytes~sAccSeq),~n",
         [mk_fn(d_packed_field_, MsgName, FName),
          case mk_field_decoder_vi_params(FieldDefAsNonpacked, no_fill) of
              ""     -> [", "];
              Params -> [", ", Params, ", "]
          end]),
       f("    NewMsg = Msg#~p{~p=NewSeq},~n", [MsgName, FName]),
       f("    ~p(Rest2, 0, 0, NewMsg).~n~n", [mk_fn(d_read_field_def_, MsgName)]),
       format_packed_field_seq_decoder(MsgName, FieldDef, Opts)].
  
  format_vi_based_field_decoder(MsgName, FieldDef, AnRes, Opts) ->
      #field{name=FName}=FieldDef,
  
negative.code:      f("    NewMsg = ~p(Value, Msg),~n", [mk_fn(add_field_, MsgName, FName)]),
       f("    ~p(Rest, 0, 0, NewMsg).~n",
         [mk_fn(d_read_field_def_, MsgName)])].
  
  format_msg_decoder_reverse_toplevel(MsgName, MsgDef, AnRes) ->
      case get_field_pass(MsgName, AnRes) of
  