anchor.diff:               Msg, MsgDefs) ->
       encode_repeated(element(RNum, Msg), FNum, Type, MsgDefs, <<>>).
   
  -encode_repeated([Elem | Rest], FNum, Type, MsgDefs, Acc)                       ->
  +encode_repeated([Elem | Rest], FNum, Type, MsgDefs, Acc) ->
       EncodedValue = encode_field_value(Elem, FNum, Type, MsgDefs),
       NewAcc = <<Acc/binary, EncodedValue/binary>>,
       encode_repeated(Rest, FNum, Type, MsgDefs, NewAcc);
  -encode_repeated([], _FNum, _Type, _MsgDefs, Acc)                               ->
  +encode_repeated([], _FNum, _Type, _MsgDefs, Acc) ->
       Acc.
   
  -encode_field_value(Value, FNum, Type, MsgDefs)                                 ->
  +encode_field_value(Value, FNum, Type, MsgDefs) ->
       <<(encode_fnum_type(FNum, Type))/binary,
         (encode_value(Value, Type, MsgDefs))/binary>>.
   
  -encode_fnum_type(FNum, Type)                                                   ->
  +encode_fnum_type(FNum, Type) ->
       encode_varint((FNum bsl 3) bor encode_wiretype(Type)).
   
  -encode_value(Value, Type, MsgDefs)                                             ->
  +encode_value(Value, Type, MsgDefs) ->
       case Type of
           sint32 ->
               encode_varint(encode_zigzag(Value));
  
positive.code:               PackedFields/binary>>
      end.
  
  encode_packed_2([Elem | Rest], Type, MsgDefs, Acc)                             ->
      NewAcc = <<Acc/binary, (encode_value(Elem, Type, MsgDefs))/binary>>,
      encode_packed_2(Rest, Type, MsgDefs, NewAcc);
  encode_packed_2([], _Type, _MsgDefs, Acc)                                      ->
      Acc.
  
  encode_field(#?gpb_field{rnum=RNum, fnum=FNum, type=Type, occurrence=required},
  
negative.code:         #?gpb_field{rnum = RNum, occurrence = repeated} ->
              append_to_element(RNum, Value, Record)
      end;
  add_field(Value, FieldDef, true=_IsOneof, MsgDefs, Record) ->
      #?gpb_field{rnum=RNum, name=Name} = FieldDef,
      case FieldDef of
          #?gpb_field{type={msg,_SubMsgType}} ->
  