@Nullable
	protected static KotlinMetadata extractMetadata(@Nonnull KotlinMetadataVisitor visitor) {
		try {
			// Skip if visitor does not have data populated.
			String[] data1 = visitor.getData1();
			if (data1 == null)
				return null;

			// Parse "d1"
			byte[] data1Decoded = BitEncoding.decodeBytes(data1);
			ByteArrayInputStream data1Stream = new ByteArrayInputStream(data1Decoded);
			JvmProtoBuf.StringTableTypes types = JvmProtoBuf.StringTableTypes.parseDelimitedFrom(data1Stream, EXTENSIONS);
			ProtoBuf.Class cls = ProtoBuf.Class.parseFrom(data1Stream, EXTENSIONS);

			// Wrap with "d2" so the human-readable names can be extracted
			String[] data2 = visitor.getData2();
			MetadataNameResolver resolver = new MetadataNameResolver(types, data2);
			return new KotlinMetadata(cls, resolver, visitor);
		} catch (Exception ex) {
			// If the protobuf parser doesn't like the data, there's not really much that can be done about it.
			if (parseFailCount++ < 5)
				logger.warn("Kotlin @Metadata 'd1' format failed to parse", ex);
			return null;
		}
	}
@param visitor
		Metadata visitor which has visited a class file.

@return Data extracted from visitor.
recaf-core/src/main/java/software/coley/recaf/util/kotlin/KotlinMetadata.java