     func getTag() throws -> FieldTag? {
         fieldStartP = p
         fieldStartAvailable = available
+        return try getTagWithoutUpdatingFieldStart()
+    }
+
+    // Parse index/type marker that starts each field.
+    // Used during skipping to avoid updating the field start offset.
+    private func getTagWithoutUpdatingFieldStart() throws -> FieldTag? {
         if let t = try getRawVarint() {
             if t < UInt64(UInt32.max) {
                 guard let tag = FieldTag(rawValue: UInt32(truncatingBitPattern: t)) else {

            }
            p += 1
            available -= 1
        case 1:
            if available < 8 {
                throw ProtobufDecodingError.truncatedInput
            }
            p += 8
            available -= 8
        case 2:
            if let n = try getRawVarint(), n <= UInt64(available) {
                p += Int(n)
                available -= Int(n)
            } else {
                throw ProtobufDecodingError.malformedProtobuf
            }
        case 3:
            while true {
                if let innerTagType = try getRawVarint() {
                    if innerTagType == tagType + 1 {
                        break
                    } else if innerTagType / 8 != tagType / 8 {
                        try skipOver(tagType: innerTagType)
                    }
                } else {
                    throw ProtobufDecodingError.truncatedInput
                }
            }
        case 4:
            throw ProtobufDecodingError.malformedProtobuf
        case 5:
            if available < 4 {
                throw ProtobufDecodingError.truncatedInput
            }
            p += 4
            available -= 4
        default:
            throw ProtobufDecodingError.malformedProtobuf
        }
    }



    // Returns tagType for the field being skipped
    // Recursively processes groups; returns the start group marker
    func skipOver(tag: FieldTag) throws {
        switch tag.wireFormat {
        case .varint:
            if available < 1 {
                throw ProtobufDecodingError.truncatedInput
            }
