anchor.diff:              Rest
       end.
   
  -decode_type(FieldType, Bin, MsgDefs, true = _IsPacked) ->
  +decode_packed(FieldType, Bin, MsgDefs, Seq0) ->
       {Len, Rest} = decode_varint(Bin),
       <<Bytes:Len/binary, Rest2/binary>> = Rest,
  -    {decode_packed_type(FieldType, Bytes, MsgDefs), Rest2};
  -decode_type(FieldType, Bin, MsgDefs, false = _IsPacked) ->
  -    decode_type_aux(FieldType, Bin, MsgDefs).
  -
  -decode_packed_type(FieldType, Bytes, MsgDefs) when size(Bytes) > 0 ->
  -    {NewValue, Rest} = decode_type_aux(FieldType, Bytes, MsgDefs),
  -    [NewValue | decode_packed_type(FieldType, Rest, MsgDefs)];
  -decode_packed_type(_FieldType, <<>>, _MsgDefs) ->
  -    [].
  -
  -decode_type_aux(FieldType, Bin, MsgDefs) ->
  +    {decode_packed_aux(Bytes, FieldType, MsgDefs, Seq0), Rest2}.
  +
  +decode_packed_aux(Bytes, FieldType, MsgDefs, Acc) when size(Bytes) > 0 ->
  +    {NewValue, Rest} = decode_type(FieldType, Bytes, MsgDefs),
  +    decode_packed_aux(Rest, FieldType, MsgDefs, [NewValue | Acc]);
  +decode_packed_aux(<<>>, _FieldType, _MsgDefs, Acc) ->
  +    Acc.
  +
  +decode_type(FieldType, Bin, MsgDefs) ->
       case FieldType of
           sint32 ->
               {NV, T} = decode_varint(Bin),
  
positive.code: append_to_element(RNum, NewElem, Record) ->
      PrevElems = element(RNum, Record),
      setelement(RNum, Record, [NewElem | PrevElems]).
  
  append_packed_to_element(RNum, NewElems, Record) ->
      PrevElems = element(RNum, Record),
      setelement(RNum, Record, lists:reverse(NewElems, PrevElems)).
  
  merge_msgs(PrevMsg, NewMsg, MsgDefs)
    when element(1,PrevMsg) == element(1,NewMsg) ->
  
negative.code:             %%
              %% 10 bytes is what it takes to varint-encode a -1 as a 64
              %% bit signed int. -1 as a 32 bit signed int is only 5 bytes.
              decode_type(int64, Bin, MsgDefs);
          int64 ->
              {NV, T} = decode_varint(Bin),
              <<N:64/signed>> = <<NV:64>>,
  