Decompiled source of Cyberhead v1.0.2

BepInEx\patchers\Cyberhead\AssetsTools.NET.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using AssetsTools.NET.Extra;
using AssetsTools.NET.Extra.Decompressors.LZ4;
using LZ4ps;
using SevenZip;
using SevenZip.Compression.LZ;
using SevenZip.Compression.LZMA;
using SevenZip.Compression.RangeCoder;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("AssetsTools.NET")]
[assembly: AssemblyDescription("A remake and port of SeriousCache's AssetTools")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("nesrak1")]
[assembly: AssemblyProduct("AssetsTools.NET")]
[assembly: AssemblyCopyright("Written by nes")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e09d5ac2-1a2e-4ec1-94ad-3f5e22f17658")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
[assembly: AssemblyVersion("3.0.0.0")]
namespace SevenZip
{
	internal class CRC
	{
		public static readonly uint[] Table;

		private uint _value = uint.MaxValue;

		static CRC()
		{
			Table = new uint[256];
			for (uint num = 0u; num < 256; num++)
			{
				uint num2 = num;
				for (int i = 0; i < 8; i++)
				{
					num2 = (((num2 & 1) == 0) ? (num2 >> 1) : ((num2 >> 1) ^ 0xEDB88320u));
				}
				Table[num] = num2;
			}
		}

		public void Init()
		{
			_value = uint.MaxValue;
		}

		public void UpdateByte(byte b)
		{
			_value = Table[(byte)_value ^ b] ^ (_value >> 8);
		}

		public void Update(byte[] data, uint offset, uint size)
		{
			for (uint num = 0u; num < size; num++)
			{
				_value = Table[(byte)_value ^ data[offset + num]] ^ (_value >> 8);
			}
		}

		public uint GetDigest()
		{
			return _value ^ 0xFFFFFFFFu;
		}

		private static uint CalculateDigest(byte[] data, uint offset, uint size)
		{
			CRC cRC = new CRC();
			cRC.Update(data, offset, size);
			return cRC.GetDigest();
		}

		private static bool VerifyDigest(uint digest, byte[] data, uint offset, uint size)
		{
			return CalculateDigest(data, offset, size) == digest;
		}
	}
	internal class DataErrorException : ApplicationException
	{
		public DataErrorException()
			: base("Data Error")
		{
		}
	}
	internal class InvalidParamException : ApplicationException
	{
		public InvalidParamException()
			: base("Invalid Parameter")
		{
		}
	}
	public interface ICodeProgress
	{
		void SetProgress(long inSize, long outSize);
	}
	public interface ICoder
	{
		void Code(Stream inStream, Stream outStream, long inSize, long outSize, ICodeProgress progress);
	}
	public enum CoderPropID
	{
		DefaultProp,
		DictionarySize,
		UsedMemorySize,
		Order,
		BlockSize,
		PosStateBits,
		LitContextBits,
		LitPosBits,
		NumFastBytes,
		MatchFinder,
		MatchFinderCycles,
		NumPasses,
		Algorithm,
		NumThreads,
		EndMarker
	}
	public interface ISetCoderProperties
	{
		void SetCoderProperties(CoderPropID[] propIDs, object[] properties);
	}
	public interface IWriteCoderProperties
	{
		void WriteCoderProperties(Stream outStream);
	}
	public interface ISetDecoderProperties
	{
		void SetDecoderProperties(byte[] properties);
	}
}
namespace SevenZip.Compression.RangeCoder
{
	internal class Encoder
	{
		public const uint kTopValue = 16777216u;

		private Stream Stream;

		public ulong Low;

		public uint Range;

		private uint _cacheSize;

		private byte _cache;

		private long StartPosition;

		public void SetStream(Stream stream)
		{
			Stream = stream;
		}

		public void ReleaseStream()
		{
			Stream = null;
		}

		public void Init()
		{
			StartPosition = Stream.Position;
			Low = 0uL;
			Range = uint.MaxValue;
			_cacheSize = 1u;
			_cache = 0;
		}

		public void FlushData()
		{
			for (int i = 0; i < 5; i++)
			{
				ShiftLow();
			}
		}

		public void FlushStream()
		{
			Stream.Flush();
		}

		public void CloseStream()
		{
			Stream.Close();
		}

		public void Encode(uint start, uint size, uint total)
		{
			Low += start * (Range /= total);
			Range *= size;
			while (Range < 16777216)
			{
				Range <<= 8;
				ShiftLow();
			}
		}

		public void ShiftLow()
		{
			if ((uint)Low < 4278190080u || (int)(Low >> 32) == 1)
			{
				byte b = _cache;
				do
				{
					Stream.WriteByte((byte)(b + (Low >> 32)));
					b = byte.MaxValue;
				}
				while (--_cacheSize != 0);
				_cache = (byte)((uint)Low >> 24);
			}
			_cacheSize++;
			Low = (uint)((int)Low << 8);
		}

		public void EncodeDirectBits(uint v, int numTotalBits)
		{
			for (int num = numTotalBits - 1; num >= 0; num--)
			{
				Range >>= 1;
				if (((v >> num) & 1) == 1)
				{
					Low += Range;
				}
				if (Range < 16777216)
				{
					Range <<= 8;
					ShiftLow();
				}
			}
		}

		public void EncodeBit(uint size0, int numTotalBits, uint symbol)
		{
			uint num = (Range >> numTotalBits) * size0;
			if (symbol == 0)
			{
				Range = num;
			}
			else
			{
				Low += num;
				Range -= num;
			}
			while (Range < 16777216)
			{
				Range <<= 8;
				ShiftLow();
			}
		}

		public long GetProcessedSizeAdd()
		{
			return _cacheSize + Stream.Position - StartPosition + 4;
		}
	}
	internal class Decoder
	{
		public const uint kTopValue = 16777216u;

		public uint Range;

		public uint Code;

		public Stream Stream;

		public void Init(Stream stream)
		{
			Stream = stream;
			Code = 0u;
			Range = uint.MaxValue;
			for (int i = 0; i < 5; i++)
			{
				Code = (Code << 8) | (byte)Stream.ReadByte();
			}
		}

		public void ReleaseStream()
		{
			Stream = null;
		}

		public void CloseStream()
		{
			Stream.Close();
		}

		public void Normalize()
		{
			while (Range < 16777216)
			{
				Code = (Code << 8) | (byte)Stream.ReadByte();
				Range <<= 8;
			}
		}

		public void Normalize2()
		{
			if (Range < 16777216)
			{
				Code = (Code << 8) | (byte)Stream.ReadByte();
				Range <<= 8;
			}
		}

		public uint GetThreshold(uint total)
		{
			return Code / (Range /= total);
		}

		public void Decode(uint start, uint size, uint total)
		{
			Code -= start * Range;
			Range *= size;
			Normalize();
		}

		public uint DecodeDirectBits(int numTotalBits)
		{
			uint num = Range;
			uint num2 = Code;
			uint num3 = 0u;
			for (int num4 = numTotalBits; num4 > 0; num4--)
			{
				num >>= 1;
				uint num5 = num2 - num >> 31;
				num2 -= num & (num5 - 1);
				num3 = (num3 << 1) | (1 - num5);
				if (num < 16777216)
				{
					num2 = (num2 << 8) | (byte)Stream.ReadByte();
					num <<= 8;
				}
			}
			Range = num;
			Code = num2;
			return num3;
		}

		public uint DecodeBit(uint size0, int numTotalBits)
		{
			uint num = (Range >> numTotalBits) * size0;
			uint result;
			if (Code < num)
			{
				result = 0u;
				Range = num;
			}
			else
			{
				result = 1u;
				Code -= num;
				Range -= num;
			}
			Normalize();
			return result;
		}
	}
	internal struct BitEncoder
	{
		public const int kNumBitModelTotalBits = 11;

		public const uint kBitModelTotal = 2048u;

		private const int kNumMoveBits = 5;

		private const int kNumMoveReducingBits = 2;

		public const int kNumBitPriceShiftBits = 6;

		private uint Prob;

		private static uint[] ProbPrices;

		public void Init()
		{
			Prob = 1024u;
		}

		public void UpdateModel(uint symbol)
		{
			if (symbol == 0)
			{
				Prob += 2048 - Prob >> 5;
			}
			else
			{
				Prob -= Prob >> 5;
			}
		}

		public void Encode(Encoder encoder, uint symbol)
		{
			uint num = (encoder.Range >> 11) * Prob;
			if (symbol == 0)
			{
				encoder.Range = num;
				Prob += 2048 - Prob >> 5;
			}
			else
			{
				encoder.Low += num;
				encoder.Range -= num;
				Prob -= Prob >> 5;
			}
			if (encoder.Range < 16777216)
			{
				encoder.Range <<= 8;
				encoder.ShiftLow();
			}
		}

		static BitEncoder()
		{
			ProbPrices = new uint[512];
			for (int num = 8; num >= 0; num--)
			{
				int num2 = 1 << 9 - num - 1;
				uint num3 = (uint)(1 << 9 - num);
				for (uint num4 = (uint)num2; num4 < num3; num4++)
				{
					ProbPrices[num4] = (uint)(num << 6) + (num3 - num4 << 6 >> 9 - num - 1);
				}
			}
		}

		public uint GetPrice(uint symbol)
		{
			return ProbPrices[(((Prob - symbol) ^ (int)(0 - symbol)) & 0x7FF) >> 2];
		}

		public uint GetPrice0()
		{
			return ProbPrices[Prob >> 2];
		}

		public uint GetPrice1()
		{
			return ProbPrices[2048 - Prob >> 2];
		}
	}
	internal struct BitDecoder
	{
		public const int kNumBitModelTotalBits = 11;

		public const uint kBitModelTotal = 2048u;

		private const int kNumMoveBits = 5;

		private uint Prob;

		public void UpdateModel(int numMoveBits, uint symbol)
		{
			if (symbol == 0)
			{
				Prob += 2048 - Prob >> numMoveBits;
			}
			else
			{
				Prob -= Prob >> numMoveBits;
			}
		}

		public void Init()
		{
			Prob = 1024u;
		}

		public uint Decode(Decoder rangeDecoder)
		{
			uint num = (rangeDecoder.Range >> 11) * Prob;
			if (rangeDecoder.Code < num)
			{
				rangeDecoder.Range = num;
				Prob += 2048 - Prob >> 5;
				if (rangeDecoder.Range < 16777216)
				{
					rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
					rangeDecoder.Range <<= 8;
				}
				return 0u;
			}
			rangeDecoder.Range -= num;
			rangeDecoder.Code -= num;
			Prob -= Prob >> 5;
			if (rangeDecoder.Range < 16777216)
			{
				rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
				rangeDecoder.Range <<= 8;
			}
			return 1u;
		}
	}
	internal struct BitTreeEncoder
	{
		private BitEncoder[] Models;

		private int NumBitLevels;

		public BitTreeEncoder(int numBitLevels)
		{
			NumBitLevels = numBitLevels;
			Models = new BitEncoder[1 << numBitLevels];
		}

		public void Init()
		{
			for (uint num = 1u; num < 1 << NumBitLevels; num++)
			{
				Models[num].Init();
			}
		}

		public void Encode(Encoder rangeEncoder, uint symbol)
		{
			uint num = 1u;
			int num2 = NumBitLevels;
			while (num2 > 0)
			{
				num2--;
				uint num3 = (symbol >> num2) & 1u;
				Models[num].Encode(rangeEncoder, num3);
				num = (num << 1) | num3;
			}
		}

		public void ReverseEncode(Encoder rangeEncoder, uint symbol)
		{
			uint num = 1u;
			for (uint num2 = 0u; num2 < NumBitLevels; num2++)
			{
				uint num3 = symbol & 1u;
				Models[num].Encode(rangeEncoder, num3);
				num = (num << 1) | num3;
				symbol >>= 1;
			}
		}

		public uint GetPrice(uint symbol)
		{
			uint num = 0u;
			uint num2 = 1u;
			int num3 = NumBitLevels;
			while (num3 > 0)
			{
				num3--;
				uint num4 = (symbol >> num3) & 1u;
				num += Models[num2].GetPrice(num4);
				num2 = (num2 << 1) + num4;
			}
			return num;
		}

		public uint ReverseGetPrice(uint symbol)
		{
			uint num = 0u;
			uint num2 = 1u;
			for (int num3 = NumBitLevels; num3 > 0; num3--)
			{
				uint num4 = symbol & 1u;
				symbol >>= 1;
				num += Models[num2].GetPrice(num4);
				num2 = (num2 << 1) | num4;
			}
			return num;
		}

		public static uint ReverseGetPrice(BitEncoder[] Models, uint startIndex, int NumBitLevels, uint symbol)
		{
			uint num = 0u;
			uint num2 = 1u;
			for (int num3 = NumBitLevels; num3 > 0; num3--)
			{
				uint num4 = symbol & 1u;
				symbol >>= 1;
				num += Models[startIndex + num2].GetPrice(num4);
				num2 = (num2 << 1) | num4;
			}
			return num;
		}

		public static void ReverseEncode(BitEncoder[] Models, uint startIndex, Encoder rangeEncoder, int NumBitLevels, uint symbol)
		{
			uint num = 1u;
			for (int i = 0; i < NumBitLevels; i++)
			{
				uint num2 = symbol & 1u;
				Models[startIndex + num].Encode(rangeEncoder, num2);
				num = (num << 1) | num2;
				symbol >>= 1;
			}
		}
	}
	internal struct BitTreeDecoder
	{
		private BitDecoder[] Models;

		private int NumBitLevels;

		public BitTreeDecoder(int numBitLevels)
		{
			NumBitLevels = numBitLevels;
			Models = new BitDecoder[1 << numBitLevels];
		}

		public void Init()
		{
			for (uint num = 1u; num < 1 << NumBitLevels; num++)
			{
				Models[num].Init();
			}
		}

		public uint Decode(Decoder rangeDecoder)
		{
			uint num = 1u;
			for (int num2 = NumBitLevels; num2 > 0; num2--)
			{
				num = (num << 1) + Models[num].Decode(rangeDecoder);
			}
			return num - (uint)(1 << NumBitLevels);
		}

		public uint ReverseDecode(Decoder rangeDecoder)
		{
			uint num = 1u;
			uint num2 = 0u;
			for (int i = 0; i < NumBitLevels; i++)
			{
				uint num3 = Models[num].Decode(rangeDecoder);
				num <<= 1;
				num += num3;
				num2 |= num3 << i;
			}
			return num2;
		}

		public static uint ReverseDecode(BitDecoder[] Models, uint startIndex, Decoder rangeDecoder, int NumBitLevels)
		{
			uint num = 1u;
			uint num2 = 0u;
			for (int i = 0; i < NumBitLevels; i++)
			{
				uint num3 = Models[startIndex + num].Decode(rangeDecoder);
				num <<= 1;
				num += num3;
				num2 |= num3 << i;
			}
			return num2;
		}
	}
}
namespace SevenZip.Compression.LZ
{
	internal interface IInWindowStream
	{
		void SetStream(Stream inStream);

		void Init();

		void ReleaseStream();

		byte GetIndexByte(int index);

		uint GetMatchLen(int index, uint distance, uint limit);

		uint GetNumAvailableBytes();
	}
	internal interface IMatchFinder : IInWindowStream
	{
		void Create(uint historySize, uint keepAddBufferBefore, uint matchMaxLen, uint keepAddBufferAfter);

		uint GetMatches(uint[] distances);

		void Skip(uint num);
	}
	public class BinTree : InWindow, IMatchFinder, IInWindowStream
	{
		private uint _cyclicBufferPos;

		private uint _cyclicBufferSize;

		private uint _matchMaxLen;

		private uint[] _son;

		private uint[] _hash;

		private uint _cutValue = 255u;

		private uint _hashMask;

		private uint _hashSizeSum;

		private bool HASH_ARRAY = true;

		private const uint kHash2Size = 1024u;

		private const uint kHash3Size = 65536u;

		private const uint kBT2HashSize = 65536u;

		private const uint kStartMaxLen = 1u;

		private const uint kHash3Offset = 1024u;

		private const uint kEmptyHashValue = 0u;

		private const uint kMaxValForNormalize = 2147483647u;

		private uint kNumHashDirectBytes;

		private uint kMinMatchCheck = 4u;

		private uint kFixHashSize = 66560u;

		public void SetType(int numHashBytes)
		{
			HASH_ARRAY = numHashBytes > 2;
			if (HASH_ARRAY)
			{
				kNumHashDirectBytes = 0u;
				kMinMatchCheck = 4u;
				kFixHashSize = 66560u;
			}
			else
			{
				kNumHashDirectBytes = 2u;
				kMinMatchCheck = 3u;
				kFixHashSize = 0u;
			}
		}

		public new void SetStream(Stream stream)
		{
			base.SetStream(stream);
		}

		public new void ReleaseStream()
		{
			base.ReleaseStream();
		}

		public new void Init()
		{
			base.Init();
			for (uint num = 0u; num < _hashSizeSum; num++)
			{
				_hash[num] = 0u;
			}
			_cyclicBufferPos = 0u;
			ReduceOffsets(-1);
		}

		public new void MovePos()
		{
			if (++_cyclicBufferPos >= _cyclicBufferSize)
			{
				_cyclicBufferPos = 0u;
			}
			base.MovePos();
			if (_pos == int.MaxValue)
			{
				Normalize();
			}
		}

		public new byte GetIndexByte(int index)
		{
			return base.GetIndexByte(index);
		}

		public new uint GetMatchLen(int index, uint distance, uint limit)
		{
			return base.GetMatchLen(index, distance, limit);
		}

		public new uint GetNumAvailableBytes()
		{
			return base.GetNumAvailableBytes();
		}

		public void Create(uint historySize, uint keepAddBufferBefore, uint matchMaxLen, uint keepAddBufferAfter)
		{
			if (historySize > 2147483391)
			{
				throw new Exception();
			}
			_cutValue = 16 + (matchMaxLen >> 1);
			uint keepSizeReserv = (historySize + keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + 256;
			Create(historySize + keepAddBufferBefore, matchMaxLen + keepAddBufferAfter, keepSizeReserv);
			_matchMaxLen = matchMaxLen;
			uint num = historySize + 1;
			if (_cyclicBufferSize != num)
			{
				_son = new uint[(_cyclicBufferSize = num) * 2];
			}
			uint num2 = 65536u;
			if (HASH_ARRAY)
			{
				num2 = historySize - 1;
				num2 |= num2 >> 1;
				num2 |= num2 >> 2;
				num2 |= num2 >> 4;
				num2 |= num2 >> 8;
				num2 >>= 1;
				num2 |= 0xFFFFu;
				if (num2 > 16777216)
				{
					num2 >>= 1;
				}
				_hashMask = num2;
				num2++;
				num2 += kFixHashSize;
			}
			if (num2 != _hashSizeSum)
			{
				_hash = new uint[_hashSizeSum = num2];
			}
		}

		public uint GetMatches(uint[] distances)
		{
			uint num;
			if (_pos + _matchMaxLen <= _streamPos)
			{
				num = _matchMaxLen;
			}
			else
			{
				num = _streamPos - _pos;
				if (num < kMinMatchCheck)
				{
					MovePos();
					return 0u;
				}
			}
			uint num2 = 0u;
			uint num3 = ((_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0u);
			uint num4 = _bufferOffset + _pos;
			uint num5 = 1u;
			uint num6 = 0u;
			uint num7 = 0u;
			uint num10;
			if (HASH_ARRAY)
			{
				uint num8 = CRC.Table[_bufferBase[num4]] ^ _bufferBase[num4 + 1];
				num6 = num8 & 0x3FFu;
				int num9 = (int)num8 ^ (_bufferBase[num4 + 2] << 8);
				num7 = (uint)num9 & 0xFFFFu;
				num10 = ((uint)num9 ^ (CRC.Table[_bufferBase[num4 + 3]] << 5)) & _hashMask;
			}
			else
			{
				num10 = (uint)(_bufferBase[num4] ^ (_bufferBase[num4 + 1] << 8));
			}
			uint num11 = _hash[kFixHashSize + num10];
			if (HASH_ARRAY)
			{
				uint num12 = _hash[num6];
				uint num13 = _hash[1024 + num7];
				_hash[num6] = _pos;
				_hash[1024 + num7] = _pos;
				if (num12 > num3 && _bufferBase[_bufferOffset + num12] == _bufferBase[num4])
				{
					num5 = (distances[num2++] = 2u);
					distances[num2++] = _pos - num12 - 1;
				}
				if (num13 > num3 && _bufferBase[_bufferOffset + num13] == _bufferBase[num4])
				{
					if (num13 == num12)
					{
						num2 -= 2;
					}
					num5 = (distances[num2++] = 3u);
					distances[num2++] = _pos - num13 - 1;
					num12 = num13;
				}
				if (num2 != 0 && num12 == num11)
				{
					num2 -= 2;
					num5 = 1u;
				}
			}
			_hash[kFixHashSize + num10] = _pos;
			uint num14 = (_cyclicBufferPos << 1) + 1;
			uint num15 = _cyclicBufferPos << 1;
			uint val;
			uint val2 = (val = kNumHashDirectBytes);
			if (kNumHashDirectBytes != 0 && num11 > num3 && _bufferBase[_bufferOffset + num11 + kNumHashDirectBytes] != _bufferBase[num4 + kNumHashDirectBytes])
			{
				num5 = (distances[num2++] = kNumHashDirectBytes);
				distances[num2++] = _pos - num11 - 1;
			}
			uint cutValue = _cutValue;
			while (true)
			{
				if (num11 <= num3 || cutValue-- == 0)
				{
					_son[num14] = (_son[num15] = 0u);
					break;
				}
				uint num16 = _pos - num11;
				uint num17 = ((num16 <= _cyclicBufferPos) ? (_cyclicBufferPos - num16) : (_cyclicBufferPos - num16 + _cyclicBufferSize)) << 1;
				uint num18 = _bufferOffset + num11;
				uint num19 = Math.Min(val2, val);
				if (_bufferBase[num18 + num19] == _bufferBase[num4 + num19])
				{
					while (++num19 != num && _bufferBase[num18 + num19] == _bufferBase[num4 + num19])
					{
					}
					if (num5 < num19)
					{
						num5 = (distances[num2++] = num19);
						distances[num2++] = num16 - 1;
						if (num19 == num)
						{
							_son[num15] = _son[num17];
							_son[num14] = _son[num17 + 1];
							break;
						}
					}
				}
				if (_bufferBase[num18 + num19] < _bufferBase[num4 + num19])
				{
					_son[num15] = num11;
					num15 = num17 + 1;
					num11 = _son[num15];
					val = num19;
				}
				else
				{
					_son[num14] = num11;
					num14 = num17;
					num11 = _son[num14];
					val2 = num19;
				}
			}
			MovePos();
			return num2;
		}

		public void Skip(uint num)
		{
			do
			{
				uint num2;
				if (_pos + _matchMaxLen <= _streamPos)
				{
					num2 = _matchMaxLen;
				}
				else
				{
					num2 = _streamPos - _pos;
					if (num2 < kMinMatchCheck)
					{
						MovePos();
						continue;
					}
				}
				uint num3 = ((_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0u);
				uint num4 = _bufferOffset + _pos;
				uint num9;
				if (HASH_ARRAY)
				{
					uint num5 = CRC.Table[_bufferBase[num4]] ^ _bufferBase[num4 + 1];
					uint num6 = num5 & 0x3FFu;
					_hash[num6] = _pos;
					int num7 = (int)num5 ^ (_bufferBase[num4 + 2] << 8);
					uint num8 = (uint)num7 & 0xFFFFu;
					_hash[1024 + num8] = _pos;
					num9 = ((uint)num7 ^ (CRC.Table[_bufferBase[num4 + 3]] << 5)) & _hashMask;
				}
				else
				{
					num9 = (uint)(_bufferBase[num4] ^ (_bufferBase[num4 + 1] << 8));
				}
				uint num10 = _hash[kFixHashSize + num9];
				_hash[kFixHashSize + num9] = _pos;
				uint num11 = (_cyclicBufferPos << 1) + 1;
				uint num12 = _cyclicBufferPos << 1;
				uint val;
				uint val2 = (val = kNumHashDirectBytes);
				uint cutValue = _cutValue;
				while (true)
				{
					if (num10 <= num3 || cutValue-- == 0)
					{
						_son[num11] = (_son[num12] = 0u);
						break;
					}
					uint num13 = _pos - num10;
					uint num14 = ((num13 <= _cyclicBufferPos) ? (_cyclicBufferPos - num13) : (_cyclicBufferPos - num13 + _cyclicBufferSize)) << 1;
					uint num15 = _bufferOffset + num10;
					uint num16 = Math.Min(val2, val);
					if (_bufferBase[num15 + num16] == _bufferBase[num4 + num16])
					{
						while (++num16 != num2 && _bufferBase[num15 + num16] == _bufferBase[num4 + num16])
						{
						}
						if (num16 == num2)
						{
							_son[num12] = _son[num14];
							_son[num11] = _son[num14 + 1];
							break;
						}
					}
					if (_bufferBase[num15 + num16] < _bufferBase[num4 + num16])
					{
						_son[num12] = num10;
						num12 = num14 + 1;
						num10 = _son[num12];
						val = num16;
					}
					else
					{
						_son[num11] = num10;
						num11 = num14;
						num10 = _son[num11];
						val2 = num16;
					}
				}
				MovePos();
			}
			while (--num != 0);
		}

		private void NormalizeLinks(uint[] items, uint numItems, uint subValue)
		{
			for (uint num = 0u; num < numItems; num++)
			{
				uint num2 = items[num];
				num2 = ((num2 > subValue) ? (num2 - subValue) : 0u);
				items[num] = num2;
			}
		}

		private void Normalize()
		{
			uint subValue = _pos - _cyclicBufferSize;
			NormalizeLinks(_son, _cyclicBufferSize * 2, subValue);
			NormalizeLinks(_hash, _hashSizeSum, subValue);
			ReduceOffsets((int)subValue);
		}

		public void SetCutValue(uint cutValue)
		{
			_cutValue = cutValue;
		}
	}
	public class InWindow
	{
		public byte[] _bufferBase;

		private Stream _stream;

		private uint _posLimit;

		private bool _streamEndWasReached;

		private uint _pointerToLastSafePosition;

		public uint _bufferOffset;

		public uint _blockSize;

		public uint _pos;

		private uint _keepSizeBefore;

		private uint _keepSizeAfter;

		public uint _streamPos;

		public void MoveBlock()
		{
			uint num = _bufferOffset + _pos - _keepSizeBefore;
			if (num != 0)
			{
				num--;
			}
			uint num2 = _bufferOffset + _streamPos - num;
			for (uint num3 = 0u; num3 < num2; num3++)
			{
				_bufferBase[num3] = _bufferBase[num + num3];
			}
			_bufferOffset -= num;
		}

		public virtual void ReadBlock()
		{
			if (_streamEndWasReached)
			{
				return;
			}
			while (true)
			{
				int num = (int)(0 - _bufferOffset + _blockSize - _streamPos);
				if (num == 0)
				{
					return;
				}
				int num2 = _stream.Read(_bufferBase, (int)(_bufferOffset + _streamPos), num);
				if (num2 == 0)
				{
					break;
				}
				_streamPos += (uint)num2;
				if (_streamPos >= _pos + _keepSizeAfter)
				{
					_posLimit = _streamPos - _keepSizeAfter;
				}
			}
			_posLimit = _streamPos;
			if (_bufferOffset + _posLimit > _pointerToLastSafePosition)
			{
				_posLimit = _pointerToLastSafePosition - _bufferOffset;
			}
			_streamEndWasReached = true;
		}

		private void Free()
		{
			_bufferBase = null;
		}

		public void Create(uint keepSizeBefore, uint keepSizeAfter, uint keepSizeReserv)
		{
			_keepSizeBefore = keepSizeBefore;
			_keepSizeAfter = keepSizeAfter;
			uint num = keepSizeBefore + keepSizeAfter + keepSizeReserv;
			if (_bufferBase == null || _blockSize != num)
			{
				Free();
				_blockSize = num;
				_bufferBase = new byte[_blockSize];
			}
			_pointerToLastSafePosition = _blockSize - keepSizeAfter;
		}

		public void SetStream(Stream stream)
		{
			_stream = stream;
		}

		public void ReleaseStream()
		{
			_stream = null;
		}

		public void Init()
		{
			_bufferOffset = 0u;
			_pos = 0u;
			_streamPos = 0u;
			_streamEndWasReached = false;
			ReadBlock();
		}

		public void MovePos()
		{
			_pos++;
			if (_pos > _posLimit)
			{
				if (_bufferOffset + _pos > _pointerToLastSafePosition)
				{
					MoveBlock();
				}
				ReadBlock();
			}
		}

		public byte GetIndexByte(int index)
		{
			return _bufferBase[_bufferOffset + _pos + index];
		}

		public uint GetMatchLen(int index, uint distance, uint limit)
		{
			if (_streamEndWasReached && _pos + index + limit > _streamPos)
			{
				limit = _streamPos - (uint)(int)(_pos + index);
			}
			distance++;
			uint num = _bufferOffset + _pos + (uint)index;
			uint num2;
			for (num2 = 0u; num2 < limit && _bufferBase[num + num2] == _bufferBase[num + num2 - distance]; num2++)
			{
			}
			return num2;
		}

		public uint GetNumAvailableBytes()
		{
			return _streamPos - _pos;
		}

		public void ReduceOffsets(int subValue)
		{
			_bufferOffset += (uint)subValue;
			_posLimit -= (uint)subValue;
			_pos -= (uint)subValue;
			_streamPos -= (uint)subValue;
		}
	}
	public class OutWindow
	{
		private byte[] _buffer;

		private uint _pos;

		private uint _windowSize;

		private uint _streamPos;

		private Stream _stream;

		public uint TrainSize;

		public void Create(uint windowSize)
		{
			if (_windowSize != windowSize)
			{
				_buffer = new byte[windowSize];
			}
			_windowSize = windowSize;
			_pos = 0u;
			_streamPos = 0u;
		}

		public void Init(Stream stream, bool solid)
		{
			ReleaseStream();
			_stream = stream;
			if (!solid)
			{
				_streamPos = 0u;
				_pos = 0u;
				TrainSize = 0u;
			}
		}

		public bool Train(Stream stream)
		{
			long length = stream.Length;
			uint num = (TrainSize = (uint)((length < _windowSize) ? length : _windowSize));
			stream.Position = length - num;
			_streamPos = (_pos = 0u);
			while (num != 0)
			{
				uint num2 = _windowSize - _pos;
				if (num < num2)
				{
					num2 = num;
				}
				int num3 = stream.Read(_buffer, (int)_pos, (int)num2);
				if (num3 == 0)
				{
					return false;
				}
				num -= (uint)num3;
				_pos += (uint)num3;
				_streamPos += (uint)num3;
				if (_pos == _windowSize)
				{
					_streamPos = (_pos = 0u);
				}
			}
			return true;
		}

		public void ReleaseStream()
		{
			Flush();
			_stream = null;
		}

		public void Flush()
		{
			uint num = _pos - _streamPos;
			if (num != 0)
			{
				_stream.Write(_buffer, (int)_streamPos, (int)num);
				if (_pos >= _windowSize)
				{
					_pos = 0u;
				}
				_streamPos = _pos;
			}
		}

		public void CopyBlock(uint distance, uint len)
		{
			uint num = _pos - distance - 1;
			if (num >= _windowSize)
			{
				num += _windowSize;
			}
			while (len != 0)
			{
				if (num >= _windowSize)
				{
					num = 0u;
				}
				_buffer[_pos++] = _buffer[num++];
				if (_pos >= _windowSize)
				{
					Flush();
				}
				len--;
			}
		}

		public void PutByte(byte b)
		{
			_buffer[_pos++] = b;
			if (_pos >= _windowSize)
			{
				Flush();
			}
		}

		public byte GetByte(uint distance)
		{
			uint num = _pos - distance - 1;
			if (num >= _windowSize)
			{
				num += _windowSize;
			}
			return _buffer[num];
		}
	}
}
namespace SevenZip.Compression.LZMA
{
	internal abstract class Base
	{
		public struct State
		{
			public uint Index;

			public void Init()
			{
				Index = 0u;
			}

			public void UpdateChar()
			{
				if (Index < 4)
				{
					Index = 0u;
				}
				else if (Index < 10)
				{
					Index -= 3u;
				}
				else
				{
					Index -= 6u;
				}
			}

			public void UpdateMatch()
			{
				Index = ((Index < 7) ? 7u : 10u);
			}

			public void UpdateRep()
			{
				Index = ((Index < 7) ? 8u : 11u);
			}

			public void UpdateShortRep()
			{
				Index = ((Index < 7) ? 9u : 11u);
			}

			public bool IsCharState()
			{
				return Index < 7;
			}
		}

		public const uint kNumRepDistances = 4u;

		public const uint kNumStates = 12u;

		public const int kNumPosSlotBits = 6;

		public const int kDicLogSizeMin = 0;

		public const int kNumLenToPosStatesBits = 2;

		public const uint kNumLenToPosStates = 4u;

		public const uint kMatchMinLen = 2u;

		public const int kNumAlignBits = 4;

		public const uint kAlignTableSize = 16u;

		public const uint kAlignMask = 15u;

		public const uint kStartPosModelIndex = 4u;

		public const uint kEndPosModelIndex = 14u;

		public const uint kNumPosModels = 10u;

		public const uint kNumFullDistances = 128u;

		public const uint kNumLitPosStatesBitsEncodingMax = 4u;

		public const uint kNumLitContextBitsMax = 8u;

		public const int kNumPosStatesBitsMax = 4;

		public const uint kNumPosStatesMax = 16u;

		public const int kNumPosStatesBitsEncodingMax = 4;

		public const uint kNumPosStatesEncodingMax = 16u;

		public const int kNumLowLenBits = 3;

		public const int kNumMidLenBits = 3;

		public const int kNumHighLenBits = 8;

		public const uint kNumLowLenSymbols = 8u;

		public const uint kNumMidLenSymbols = 8u;

		public const uint kNumLenSymbols = 272u;

		public const uint kMatchMaxLen = 273u;

		public static uint GetLenToPosState(uint len)
		{
			len -= 2;
			if (len < 4)
			{
				return len;
			}
			return 3u;
		}
	}
	public class Decoder : ICoder, ISetDecoderProperties
	{
		private class LenDecoder
		{
			private BitDecoder m_Choice;

			private BitDecoder m_Choice2;

			private BitTreeDecoder[] m_LowCoder = new BitTreeDecoder[16];

			private BitTreeDecoder[] m_MidCoder = new BitTreeDecoder[16];

			private BitTreeDecoder m_HighCoder = new BitTreeDecoder(8);

			private uint m_NumPosStates;

			public void Create(uint numPosStates)
			{
				for (uint num = m_NumPosStates; num < numPosStates; num++)
				{
					m_LowCoder[num] = new BitTreeDecoder(3);
					m_MidCoder[num] = new BitTreeDecoder(3);
				}
				m_NumPosStates = numPosStates;
			}

			public void Init()
			{
				m_Choice.Init();
				for (uint num = 0u; num < m_NumPosStates; num++)
				{
					m_LowCoder[num].Init();
					m_MidCoder[num].Init();
				}
				m_Choice2.Init();
				m_HighCoder.Init();
			}

			public uint Decode(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, uint posState)
			{
				if (m_Choice.Decode(rangeDecoder) == 0)
				{
					return m_LowCoder[posState].Decode(rangeDecoder);
				}
				uint num = 8u;
				if (m_Choice2.Decode(rangeDecoder) == 0)
				{
					return num + m_MidCoder[posState].Decode(rangeDecoder);
				}
				num += 8;
				return num + m_HighCoder.Decode(rangeDecoder);
			}
		}

		private class LiteralDecoder
		{
			private struct Decoder2
			{
				private BitDecoder[] m_Decoders;

				public void Create()
				{
					m_Decoders = new BitDecoder[768];
				}

				public void Init()
				{
					for (int i = 0; i < 768; i++)
					{
						m_Decoders[i].Init();
					}
				}

				public byte DecodeNormal(SevenZip.Compression.RangeCoder.Decoder rangeDecoder)
				{
					uint num = 1u;
					do
					{
						num = (num << 1) | m_Decoders[num].Decode(rangeDecoder);
					}
					while (num < 256);
					return (byte)num;
				}

				public byte DecodeWithMatchByte(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, byte matchByte)
				{
					uint num = 1u;
					do
					{
						uint num2 = (uint)(matchByte >> 7) & 1u;
						matchByte <<= 1;
						uint num3 = m_Decoders[(1 + num2 << 8) + num].Decode(rangeDecoder);
						num = (num << 1) | num3;
						if (num2 != num3)
						{
							while (num < 256)
							{
								num = (num << 1) | m_Decoders[num].Decode(rangeDecoder);
							}
							break;
						}
					}
					while (num < 256);
					return (byte)num;
				}
			}

			private Decoder2[] m_Coders;

			private int m_NumPrevBits;

			private int m_NumPosBits;

			private uint m_PosMask;

			public void Create(int numPosBits, int numPrevBits)
			{
				if (m_Coders == null || m_NumPrevBits != numPrevBits || m_NumPosBits != numPosBits)
				{
					m_NumPosBits = numPosBits;
					m_PosMask = (uint)((1 << numPosBits) - 1);
					m_NumPrevBits = numPrevBits;
					uint num = (uint)(1 << m_NumPrevBits + m_NumPosBits);
					m_Coders = new Decoder2[num];
					for (uint num2 = 0u; num2 < num; num2++)
					{
						m_Coders[num2].Create();
					}
				}
			}

			public void Init()
			{
				uint num = (uint)(1 << m_NumPrevBits + m_NumPosBits);
				for (uint num2 = 0u; num2 < num; num2++)
				{
					m_Coders[num2].Init();
				}
			}

			private uint GetState(uint pos, byte prevByte)
			{
				return ((pos & m_PosMask) << m_NumPrevBits) + (uint)(prevByte >> 8 - m_NumPrevBits);
			}

			public byte DecodeNormal(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte)
			{
				return m_Coders[GetState(pos, prevByte)].DecodeNormal(rangeDecoder);
			}

			public byte DecodeWithMatchByte(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte, byte matchByte)
			{
				return m_Coders[GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte);
			}
		}

		private OutWindow m_OutWindow = new OutWindow();

		private SevenZip.Compression.RangeCoder.Decoder m_RangeDecoder = new SevenZip.Compression.RangeCoder.Decoder();

		private BitDecoder[] m_IsMatchDecoders = new BitDecoder[192];

		private BitDecoder[] m_IsRepDecoders = new BitDecoder[12];

		private BitDecoder[] m_IsRepG0Decoders = new BitDecoder[12];

		private BitDecoder[] m_IsRepG1Decoders = new BitDecoder[12];

		private BitDecoder[] m_IsRepG2Decoders = new BitDecoder[12];

		private BitDecoder[] m_IsRep0LongDecoders = new BitDecoder[192];

		private BitTreeDecoder[] m_PosSlotDecoder = new BitTreeDecoder[4];

		private BitDecoder[] m_PosDecoders = new BitDecoder[114];

		private BitTreeDecoder m_PosAlignDecoder = new BitTreeDecoder(4);

		private LenDecoder m_LenDecoder = new LenDecoder();

		private LenDecoder m_RepLenDecoder = new LenDecoder();

		private LiteralDecoder m_LiteralDecoder = new LiteralDecoder();

		private uint m_DictionarySize;

		private uint m_DictionarySizeCheck;

		private uint m_PosStateMask;

		private bool _solid;

		public Decoder()
		{
			m_DictionarySize = uint.MaxValue;
			for (int i = 0; (long)i < 4L; i++)
			{
				m_PosSlotDecoder[i] = new BitTreeDecoder(6);
			}
		}

		private void SetDictionarySize(uint dictionarySize)
		{
			if (m_DictionarySize != dictionarySize)
			{
				m_DictionarySize = dictionarySize;
				m_DictionarySizeCheck = Math.Max(m_DictionarySize, 1u);
				uint windowSize = Math.Max(m_DictionarySizeCheck, 4096u);
				m_OutWindow.Create(windowSize);
			}
		}

		private void SetLiteralProperties(int lp, int lc)
		{
			if (lp > 8)
			{
				throw new InvalidParamException();
			}
			if (lc > 8)
			{
				throw new InvalidParamException();
			}
			m_LiteralDecoder.Create(lp, lc);
		}

		private void SetPosBitsProperties(int pb)
		{
			if (pb > 4)
			{
				throw new InvalidParamException();
			}
			uint num = (uint)(1 << pb);
			m_LenDecoder.Create(num);
			m_RepLenDecoder.Create(num);
			m_PosStateMask = num - 1;
		}

		private void Init(Stream inStream, Stream outStream)
		{
			m_RangeDecoder.Init(inStream);
			m_OutWindow.Init(outStream, _solid);
			for (uint num = 0u; num < 12; num++)
			{
				for (uint num2 = 0u; num2 <= m_PosStateMask; num2++)
				{
					uint num3 = (num << 4) + num2;
					m_IsMatchDecoders[num3].Init();
					m_IsRep0LongDecoders[num3].Init();
				}
				m_IsRepDecoders[num].Init();
				m_IsRepG0Decoders[num].Init();
				m_IsRepG1Decoders[num].Init();
				m_IsRepG2Decoders[num].Init();
			}
			m_LiteralDecoder.Init();
			for (uint num = 0u; num < 4; num++)
			{
				m_PosSlotDecoder[num].Init();
			}
			for (uint num = 0u; num < 114; num++)
			{
				m_PosDecoders[num].Init();
			}
			m_LenDecoder.Init();
			m_RepLenDecoder.Init();
			m_PosAlignDecoder.Init();
		}

		public void Code(Stream inStream, Stream outStream, long inSize, long outSize, ICodeProgress progress)
		{
			Init(inStream, outStream);
			Base.State state = default(Base.State);
			state.Init();
			uint num = 0u;
			uint num2 = 0u;
			uint num3 = 0u;
			uint num4 = 0u;
			ulong num5 = 0uL;
			if (num5 < (ulong)outSize)
			{
				if (m_IsMatchDecoders[state.Index << 4].Decode(m_RangeDecoder) != 0)
				{
					throw new DataErrorException();
				}
				state.UpdateChar();
				byte b = m_LiteralDecoder.DecodeNormal(m_RangeDecoder, 0u, 0);
				m_OutWindow.PutByte(b);
				num5++;
			}
			while (num5 < (ulong)outSize)
			{
				uint num6 = (uint)(int)num5 & m_PosStateMask;
				if (m_IsMatchDecoders[(state.Index << 4) + num6].Decode(m_RangeDecoder) == 0)
				{
					byte @byte = m_OutWindow.GetByte(0u);
					byte b2 = (state.IsCharState() ? m_LiteralDecoder.DecodeNormal(m_RangeDecoder, (uint)num5, @byte) : m_LiteralDecoder.DecodeWithMatchByte(m_RangeDecoder, (uint)num5, @byte, m_OutWindow.GetByte(num)));
					m_OutWindow.PutByte(b2);
					state.UpdateChar();
					num5++;
					continue;
				}
				uint num8;
				if (m_IsRepDecoders[state.Index].Decode(m_RangeDecoder) == 1)
				{
					if (m_IsRepG0Decoders[state.Index].Decode(m_RangeDecoder) == 0)
					{
						if (m_IsRep0LongDecoders[(state.Index << 4) + num6].Decode(m_RangeDecoder) == 0)
						{
							state.UpdateShortRep();
							m_OutWindow.PutByte(m_OutWindow.GetByte(num));
							num5++;
							continue;
						}
					}
					else
					{
						uint num7;
						if (m_IsRepG1Decoders[state.Index].Decode(m_RangeDecoder) == 0)
						{
							num7 = num2;
						}
						else
						{
							if (m_IsRepG2Decoders[state.Index].Decode(m_RangeDecoder) == 0)
							{
								num7 = num3;
							}
							else
							{
								num7 = num4;
								num4 = num3;
							}
							num3 = num2;
						}
						num2 = num;
						num = num7;
					}
					num8 = m_RepLenDecoder.Decode(m_RangeDecoder, num6) + 2;
					state.UpdateRep();
				}
				else
				{
					num4 = num3;
					num3 = num2;
					num2 = num;
					num8 = 2 + m_LenDecoder.Decode(m_RangeDecoder, num6);
					state.UpdateMatch();
					uint num9 = m_PosSlotDecoder[Base.GetLenToPosState(num8)].Decode(m_RangeDecoder);
					if (num9 >= 4)
					{
						int num10 = (int)((num9 >> 1) - 1);
						num = (2 | (num9 & 1)) << num10;
						if (num9 < 14)
						{
							num += BitTreeDecoder.ReverseDecode(m_PosDecoders, num - num9 - 1, m_RangeDecoder, num10);
						}
						else
						{
							num += m_RangeDecoder.DecodeDirectBits(num10 - 4) << 4;
							num += m_PosAlignDecoder.ReverseDecode(m_RangeDecoder);
						}
					}
					else
					{
						num = num9;
					}
				}
				if (num >= m_OutWindow.TrainSize + num5 || num >= m_DictionarySizeCheck)
				{
					if (num == uint.MaxValue)
					{
						break;
					}
					throw new DataErrorException();
				}
				m_OutWindow.CopyBlock(num, num8);
				num5 += num8;
			}
			m_OutWindow.Flush();
			m_OutWindow.ReleaseStream();
			m_RangeDecoder.ReleaseStream();
		}

		public void SetDecoderProperties(byte[] properties)
		{
			if (properties.Length < 5)
			{
				throw new InvalidParamException();
			}
			int lc = properties[0] % 9;
			int num = properties[0] / 9;
			int lp = num % 5;
			int num2 = num / 5;
			if (num2 > 4)
			{
				throw new InvalidParamException();
			}
			uint num3 = 0u;
			for (int i = 0; i < 4; i++)
			{
				num3 += (uint)(properties[1 + i] << i * 8);
			}
			SetDictionarySize(num3);
			SetLiteralProperties(lp, lc);
			SetPosBitsProperties(num2);
		}

		public bool Train(Stream stream)
		{
			_solid = true;
			return m_OutWindow.Train(stream);
		}
	}
	public class Encoder : ICoder, ISetCoderProperties, IWriteCoderProperties
	{
		private enum EMatchFinderType
		{
			BT2,
			BT4
		}

		private class LiteralEncoder
		{
			public struct Encoder2
			{
				private BitEncoder[] m_Encoders;

				public void Create()
				{
					m_Encoders = new BitEncoder[768];
				}

				public void Init()
				{
					for (int i = 0; i < 768; i++)
					{
						m_Encoders[i].Init();
					}
				}

				public void Encode(SevenZip.Compression.RangeCoder.Encoder rangeEncoder, byte symbol)
				{
					uint num = 1u;
					for (int num2 = 7; num2 >= 0; num2--)
					{
						uint num3 = (uint)(symbol >> num2) & 1u;
						m_Encoders[num].Encode(rangeEncoder, num3);
						num = (num << 1) | num3;
					}
				}

				public void EncodeMatched(SevenZip.Compression.RangeCoder.Encoder rangeEncoder, byte matchByte, byte symbol)
				{
					uint num = 1u;
					bool flag = true;
					for (int num2 = 7; num2 >= 0; num2--)
					{
						uint num3 = (uint)(symbol >> num2) & 1u;
						uint num4 = num;
						if (flag)
						{
							uint num5 = (uint)(matchByte >> num2) & 1u;
							num4 += 1 + num5 << 8;
							flag = num5 == num3;
						}
						m_Encoders[num4].Encode(rangeEncoder, num3);
						num = (num << 1) | num3;
					}
				}

				public uint GetPrice(bool matchMode, byte matchByte, byte symbol)
				{
					uint num = 0u;
					uint num2 = 1u;
					int num3 = 7;
					if (matchMode)
					{
						while (num3 >= 0)
						{
							uint num4 = (uint)(matchByte >> num3) & 1u;
							uint num5 = (uint)(symbol >> num3) & 1u;
							num += m_Encoders[(1 + num4 << 8) + num2].GetPrice(num5);
							num2 = (num2 << 1) | num5;
							if (num4 != num5)
							{
								num3--;
								break;
							}
							num3--;
						}
					}
					while (num3 >= 0)
					{
						uint num6 = (uint)(symbol >> num3) & 1u;
						num += m_Encoders[num2].GetPrice(num6);
						num2 = (num2 << 1) | num6;
						num3--;
					}
					return num;
				}
			}

			private Encoder2[] m_Coders;

			private int m_NumPrevBits;

			private int m_NumPosBits;

			private uint m_PosMask;

			public void Create(int numPosBits, int numPrevBits)
			{
				if (m_Coders == null || m_NumPrevBits != numPrevBits || m_NumPosBits != numPosBits)
				{
					m_NumPosBits = numPosBits;
					m_PosMask = (uint)((1 << numPosBits) - 1);
					m_NumPrevBits = numPrevBits;
					uint num = (uint)(1 << m_NumPrevBits + m_NumPosBits);
					m_Coders = new Encoder2[num];
					for (uint num2 = 0u; num2 < num; num2++)
					{
						m_Coders[num2].Create();
					}
				}
			}

			public void Init()
			{
				uint num = (uint)(1 << m_NumPrevBits + m_NumPosBits);
				for (uint num2 = 0u; num2 < num; num2++)
				{
					m_Coders[num2].Init();
				}
			}

			public Encoder2 GetSubCoder(uint pos, byte prevByte)
			{
				return m_Coders[(int)((pos & m_PosMask) << m_NumPrevBits) + (prevByte >> 8 - m_NumPrevBits)];
			}
		}

		private class LenEncoder
		{
			private BitEncoder _choice;

			private BitEncoder _choice2;

			private BitTreeEncoder[] _lowCoder = new BitTreeEncoder[16];

			private BitTreeEncoder[] _midCoder = new BitTreeEncoder[16];

			private BitTreeEncoder _highCoder = new BitTreeEncoder(8);

			public LenEncoder()
			{
				for (uint num = 0u; num < 16; num++)
				{
					_lowCoder[num] = new BitTreeEncoder(3);
					_midCoder[num] = new BitTreeEncoder(3);
				}
			}

			public void Init(uint numPosStates)
			{
				_choice.Init();
				_choice2.Init();
				for (uint num = 0u; num < numPosStates; num++)
				{
					_lowCoder[num].Init();
					_midCoder[num].Init();
				}
				_highCoder.Init();
			}

			public void Encode(SevenZip.Compression.RangeCoder.Encoder rangeEncoder, uint symbol, uint posState)
			{
				if (symbol < 8)
				{
					_choice.Encode(rangeEncoder, 0u);
					_lowCoder[posState].Encode(rangeEncoder, symbol);
					return;
				}
				symbol -= 8;
				_choice.Encode(rangeEncoder, 1u);
				if (symbol < 8)
				{
					_choice2.Encode(rangeEncoder, 0u);
					_midCoder[posState].Encode(rangeEncoder, symbol);
				}
				else
				{
					_choice2.Encode(rangeEncoder, 1u);
					_highCoder.Encode(rangeEncoder, symbol - 8);
				}
			}

			public void SetPrices(uint posState, uint numSymbols, uint[] prices, uint st)
			{
				uint price = _choice.GetPrice0();
				uint price2 = _choice.GetPrice1();
				uint num = price2 + _choice2.GetPrice0();
				uint num2 = price2 + _choice2.GetPrice1();
				uint num3 = 0u;
				for (num3 = 0u; num3 < 8; num3++)
				{
					if (num3 >= numSymbols)
					{
						return;
					}
					prices[st + num3] = price + _lowCoder[posState].GetPrice(num3);
				}
				for (; num3 < 16; num3++)
				{
					if (num3 >= numSymbols)
					{
						return;
					}
					prices[st + num3] = num + _midCoder[posState].GetPrice(num3 - 8);
				}
				for (; num3 < numSymbols; num3++)
				{
					prices[st + num3] = num2 + _highCoder.GetPrice(num3 - 8 - 8);
				}
			}
		}

		private class LenPriceTableEncoder : LenEncoder
		{
			private uint[] _prices = new uint[4352];

			private uint _tableSize;

			private uint[] _counters = new uint[16];

			public void SetTableSize(uint tableSize)
			{
				_tableSize = tableSize;
			}

			public uint GetPrice(uint symbol, uint posState)
			{
				return _prices[posState * 272 + symbol];
			}

			private void UpdateTable(uint posState)
			{
				SetPrices(posState, _tableSize, _prices, posState * 272);
				_counters[posState] = _tableSize;
			}

			public void UpdateTables(uint numPosStates)
			{
				for (uint num = 0u; num < numPosStates; num++)
				{
					UpdateTable(num);
				}
			}

			public new void Encode(SevenZip.Compression.RangeCoder.Encoder rangeEncoder, uint symbol, uint posState)
			{
				base.Encode(rangeEncoder, symbol, posState);
				if (--_counters[posState] == 0)
				{
					UpdateTable(posState);
				}
			}
		}

		private class Optimal
		{
			public Base.State State;

			public bool Prev1IsChar;

			public bool Prev2;

			public uint PosPrev2;

			public uint BackPrev2;

			public uint Price;

			public uint PosPrev;

			public uint BackPrev;

			public uint Backs0;

			public uint Backs1;

			public uint Backs2;

			public uint Backs3;

			public void MakeAsChar()
			{
				BackPrev = uint.MaxValue;
				Prev1IsChar = false;
			}

			public void MakeAsShortRep()
			{
				BackPrev = 0u;
				Prev1IsChar = false;
			}

			public bool IsShortRep()
			{
				return BackPrev == 0;
			}
		}

		private const uint kIfinityPrice = 268435455u;

		private static byte[] g_FastPos;

		private Base.State _state;

		private byte _previousByte;

		private uint[] _repDistances = new uint[4];

		private const int kDefaultDictionaryLogSize = 22;

		private const uint kNumFastBytesDefault = 32u;

		private const uint kNumLenSpecSymbols = 16u;

		private const uint kNumOpts = 4096u;

		private Optimal[] _optimum = new Optimal[4096];

		private IMatchFinder _matchFinder;

		private SevenZip.Compression.RangeCoder.Encoder _rangeEncoder = new SevenZip.Compression.RangeCoder.Encoder();

		private BitEncoder[] _isMatch = new BitEncoder[192];

		private BitEncoder[] _isRep = new BitEncoder[12];

		private BitEncoder[] _isRepG0 = new BitEncoder[12];

		private BitEncoder[] _isRepG1 = new BitEncoder[12];

		private BitEncoder[] _isRepG2 = new BitEncoder[12];

		private BitEncoder[] _isRep0Long = new BitEncoder[192];

		private BitTreeEncoder[] _posSlotEncoder = new BitTreeEncoder[4];

		private BitEncoder[] _posEncoders = new BitEncoder[114];

		private BitTreeEncoder _posAlignEncoder = new BitTreeEncoder(4);

		private LenPriceTableEncoder _lenEncoder = new LenPriceTableEncoder();

		private LenPriceTableEncoder _repMatchLenEncoder = new LenPriceTableEncoder();

		private LiteralEncoder _literalEncoder = new LiteralEncoder();

		private uint[] _matchDistances = new uint[548];

		private uint _numFastBytes = 32u;

		private uint _longestMatchLength;

		private uint _numDistancePairs;

		private uint _additionalOffset;

		private uint _optimumEndIndex;

		private uint _optimumCurrentIndex;

		private bool _longestMatchWasFound;

		private uint[] _posSlotPrices = new uint[256];

		private uint[] _distancesPrices = new uint[512];

		private uint[] _alignPrices = new uint[16];

		private uint _alignPriceCount;

		private uint _distTableSize = 44u;

		private int _posStateBits = 2;

		private uint _posStateMask = 3u;

		private int _numLiteralPosStateBits;

		private int _numLiteralContextBits = 3;

		private uint _dictionarySize = 4194304u;

		private uint _dictionarySizePrev = uint.MaxValue;

		private uint _numFastBytesPrev = uint.MaxValue;

		private long nowPos64;

		private bool _finished;

		private Stream _inStream;

		private EMatchFinderType _matchFinderType = EMatchFinderType.BT4;

		private bool _writeEndMark;

		private bool _needReleaseMFStream;

		private uint[] reps = new uint[4];

		private uint[] repLens = new uint[4];

		private const int kPropSize = 5;

		private byte[] properties = new byte[5];

		private uint[] tempPrices = new uint[128];

		private uint _matchPriceCount;

		private static string[] kMatchFinderIDs;

		private uint _trainSize;

		static Encoder()
		{
			g_FastPos = new byte[2048];
			kMatchFinderIDs = new string[2] { "BT2", "BT4" };
			int num = 2;
			g_FastPos[0] = 0;
			g_FastPos[1] = 1;
			for (byte b = 2; b < 22; b++)
			{
				uint num2 = (uint)(1 << (b >> 1) - 1);
				uint num3 = 0u;
				while (num3 < num2)
				{
					g_FastPos[num] = b;
					num3++;
					num++;
				}
			}
		}

		private static uint GetPosSlot(uint pos)
		{
			if (pos < 2048)
			{
				return g_FastPos[pos];
			}
			if (pos < 2097152)
			{
				return (uint)(g_FastPos[pos >> 10] + 20);
			}
			return (uint)(g_FastPos[pos >> 20] + 40);
		}

		private static uint GetPosSlot2(uint pos)
		{
			if (pos < 131072)
			{
				return (uint)(g_FastPos[pos >> 6] + 12);
			}
			if (pos < 134217728)
			{
				return (uint)(g_FastPos[pos >> 16] + 32);
			}
			return (uint)(g_FastPos[pos >> 26] + 52);
		}

		private void BaseInit()
		{
			_state.Init();
			_previousByte = 0;
			for (uint num = 0u; num < 4; num++)
			{
				_repDistances[num] = 0u;
			}
		}

		private void Create()
		{
			if (_matchFinder == null)
			{
				BinTree binTree = new BinTree();
				int type = 4;
				if (_matchFinderType == EMatchFinderType.BT2)
				{
					type = 2;
				}
				binTree.SetType(type);
				_matchFinder = binTree;
			}
			_literalEncoder.Create(_numLiteralPosStateBits, _numLiteralContextBits);
			if (_dictionarySize != _dictionarySizePrev || _numFastBytesPrev != _numFastBytes)
			{
				_matchFinder.Create(_dictionarySize, 4096u, _numFastBytes, 274u);
				_dictionarySizePrev = _dictionarySize;
				_numFastBytesPrev = _numFastBytes;
			}
		}

		public Encoder()
		{
			for (int i = 0; (long)i < 4096L; i++)
			{
				_optimum[i] = new Optimal();
			}
			for (int j = 0; (long)j < 4L; j++)
			{
				_posSlotEncoder[j] = new BitTreeEncoder(6);
			}
		}

		private void SetWriteEndMarkerMode(bool writeEndMarker)
		{
			_writeEndMark = writeEndMarker;
		}

		private void Init()
		{
			BaseInit();
			_rangeEncoder.Init();
			for (uint num = 0u; num < 12; num++)
			{
				for (uint num2 = 0u; num2 <= _posStateMask; num2++)
				{
					uint num3 = (num << 4) + num2;
					_isMatch[num3].Init();
					_isRep0Long[num3].Init();
				}
				_isRep[num].Init();
				_isRepG0[num].Init();
				_isRepG1[num].Init();
				_isRepG2[num].Init();
			}
			_literalEncoder.Init();
			for (uint num = 0u; num < 4; num++)
			{
				_posSlotEncoder[num].Init();
			}
			for (uint num = 0u; num < 114; num++)
			{
				_posEncoders[num].Init();
			}
			_lenEncoder.Init((uint)(1 << _posStateBits));
			_repMatchLenEncoder.Init((uint)(1 << _posStateBits));
			_posAlignEncoder.Init();
			_longestMatchWasFound = false;
			_optimumEndIndex = 0u;
			_optimumCurrentIndex = 0u;
			_additionalOffset = 0u;
		}

		private void ReadMatchDistances(out uint lenRes, out uint numDistancePairs)
		{
			lenRes = 0u;
			numDistancePairs = _matchFinder.GetMatches(_matchDistances);
			if (numDistancePairs != 0)
			{
				lenRes = _matchDistances[numDistancePairs - 2];
				if (lenRes == _numFastBytes)
				{
					lenRes += _matchFinder.GetMatchLen((int)(lenRes - 1), _matchDistances[numDistancePairs - 1], 273 - lenRes);
				}
			}
			_additionalOffset++;
		}

		private void MovePos(uint num)
		{
			if (num != 0)
			{
				_matchFinder.Skip(num);
				_additionalOffset += num;
			}
		}

		private uint GetRepLen1Price(Base.State state, uint posState)
		{
			return _isRepG0[state.Index].GetPrice0() + _isRep0Long[(state.Index << 4) + posState].GetPrice0();
		}

		private uint GetPureRepPrice(uint repIndex, Base.State state, uint posState)
		{
			uint price;
			if (repIndex == 0)
			{
				price = _isRepG0[state.Index].GetPrice0();
				return price + _isRep0Long[(state.Index << 4) + posState].GetPrice1();
			}
			price = _isRepG0[state.Index].GetPrice1();
			if (repIndex == 1)
			{
				return price + _isRepG1[state.Index].GetPrice0();
			}
			price += _isRepG1[state.Index].GetPrice1();
			return price + _isRepG2[state.Index].GetPrice(repIndex - 2);
		}

		private uint GetRepPrice(uint repIndex, uint len, Base.State state, uint posState)
		{
			return _repMatchLenEncoder.GetPrice(len - 2, posState) + GetPureRepPrice(repIndex, state, posState);
		}

		private uint GetPosLenPrice(uint pos, uint len, uint posState)
		{
			uint lenToPosState = Base.GetLenToPosState(len);
			uint num = ((pos >= 128) ? (_posSlotPrices[(lenToPosState << 6) + GetPosSlot2(pos)] + _alignPrices[pos & 0xF]) : _distancesPrices[lenToPosState * 128 + pos]);
			return num + _lenEncoder.GetPrice(len - 2, posState);
		}

		private uint Backward(out uint backRes, uint cur)
		{
			_optimumEndIndex = cur;
			uint posPrev = _optimum[cur].PosPrev;
			uint backPrev = _optimum[cur].BackPrev;
			do
			{
				if (_optimum[cur].Prev1IsChar)
				{
					_optimum[posPrev].MakeAsChar();
					_optimum[posPrev].PosPrev = posPrev - 1;
					if (_optimum[cur].Prev2)
					{
						_optimum[posPrev - 1].Prev1IsChar = false;
						_optimum[posPrev - 1].PosPrev = _optimum[cur].PosPrev2;
						_optimum[posPrev - 1].BackPrev = _optimum[cur].BackPrev2;
					}
				}
				uint num = posPrev;
				uint backPrev2 = backPrev;
				backPrev = _optimum[num].BackPrev;
				posPrev = _optimum[num].PosPrev;
				_optimum[num].BackPrev = backPrev2;
				_optimum[num].PosPrev = cur;
				cur = num;
			}
			while (cur != 0);
			backRes = _optimum[0].BackPrev;
			_optimumCurrentIndex = _optimum[0].PosPrev;
			return _optimumCurrentIndex;
		}

		private uint GetOptimum(uint position, out uint backRes)
		{
			if (_optimumEndIndex != _optimumCurrentIndex)
			{
				uint result = _optimum[_optimumCurrentIndex].PosPrev - _optimumCurrentIndex;
				backRes = _optimum[_optimumCurrentIndex].BackPrev;
				_optimumCurrentIndex = _optimum[_optimumCurrentIndex].PosPrev;
				return result;
			}
			_optimumCurrentIndex = (_optimumEndIndex = 0u);
			uint lenRes;
			uint numDistancePairs;
			if (!_longestMatchWasFound)
			{
				ReadMatchDistances(out lenRes, out numDistancePairs);
			}
			else
			{
				lenRes = _longestMatchLength;
				numDistancePairs = _numDistancePairs;
				_longestMatchWasFound = false;
			}
			uint num = _matchFinder.GetNumAvailableBytes() + 1;
			if (num < 2)
			{
				backRes = uint.MaxValue;
				return 1u;
			}
			if (num > 273)
			{
				num = 273u;
			}
			uint num2 = 0u;
			for (uint num3 = 0u; num3 < 4; num3++)
			{
				reps[num3] = _repDistances[num3];
				repLens[num3] = _matchFinder.GetMatchLen(-1, reps[num3], 273u);
				if (repLens[num3] > repLens[num2])
				{
					num2 = num3;
				}
			}
			if (repLens[num2] >= _numFastBytes)
			{
				backRes = num2;
				uint num4 = repLens[num2];
				MovePos(num4 - 1);
				return num4;
			}
			if (lenRes >= _numFastBytes)
			{
				backRes = _matchDistances[numDistancePairs - 1] + 4;
				MovePos(lenRes - 1);
				return lenRes;
			}
			byte indexByte = _matchFinder.GetIndexByte(-1);
			byte indexByte2 = _matchFinder.GetIndexByte((int)(0 - _repDistances[0] - 1 - 1));
			if (lenRes < 2 && indexByte != indexByte2 && repLens[num2] < 2)
			{
				backRes = uint.MaxValue;
				return 1u;
			}
			_optimum[0].State = _state;
			uint num5 = position & _posStateMask;
			_optimum[1].Price = _isMatch[(_state.Index << 4) + num5].GetPrice0() + _literalEncoder.GetSubCoder(position, _previousByte).GetPrice(!_state.IsCharState(), indexByte2, indexByte);
			_optimum[1].MakeAsChar();
			uint price = _isMatch[(_state.Index << 4) + num5].GetPrice1();
			uint num6 = price + _isRep[_state.Index].GetPrice1();
			if (indexByte2 == indexByte)
			{
				uint num7 = num6 + GetRepLen1Price(_state, num5);
				if (num7 < _optimum[1].Price)
				{
					_optimum[1].Price = num7;
					_optimum[1].MakeAsShortRep();
				}
			}
			uint num8 = ((lenRes >= repLens[num2]) ? lenRes : repLens[num2]);
			if (num8 < 2)
			{
				backRes = _optimum[1].BackPrev;
				return 1u;
			}
			_optimum[1].PosPrev = 0u;
			_optimum[0].Backs0 = reps[0];
			_optimum[0].Backs1 = reps[1];
			_optimum[0].Backs2 = reps[2];
			_optimum[0].Backs3 = reps[3];
			uint num9 = num8;
			do
			{
				_optimum[num9--].Price = 268435455u;
			}
			while (num9 >= 2);
			for (uint num3 = 0u; num3 < 4; num3++)
			{
				uint num10 = repLens[num3];
				if (num10 < 2)
				{
					continue;
				}
				uint num11 = num6 + GetPureRepPrice(num3, _state, num5);
				do
				{
					uint num12 = num11 + _repMatchLenEncoder.GetPrice(num10 - 2, num5);
					Optimal optimal = _optimum[num10];
					if (num12 < optimal.Price)
					{
						optimal.Price = num12;
						optimal.PosPrev = 0u;
						optimal.BackPrev = num3;
						optimal.Prev1IsChar = false;
					}
				}
				while (--num10 >= 2);
			}
			uint num13 = price + _isRep[_state.Index].GetPrice0();
			num9 = ((repLens[0] >= 2) ? (repLens[0] + 1) : 2u);
			if (num9 <= lenRes)
			{
				uint num14;
				for (num14 = 0u; num9 > _matchDistances[num14]; num14 += 2)
				{
				}
				while (true)
				{
					uint num15 = _matchDistances[num14 + 1];
					uint num16 = num13 + GetPosLenPrice(num15, num9, num5);
					Optimal optimal2 = _optimum[num9];
					if (num16 < optimal2.Price)
					{
						optimal2.Price = num16;
						optimal2.PosPrev = 0u;
						optimal2.BackPrev = num15 + 4;
						optimal2.Prev1IsChar = false;
					}
					if (num9 == _matchDistances[num14])
					{
						num14 += 2;
						if (num14 == numDistancePairs)
						{
							break;
						}
					}
					num9++;
				}
			}
			uint num17 = 0u;
			uint lenRes2;
			while (true)
			{
				num17++;
				if (num17 == num8)
				{
					return Backward(out backRes, num17);
				}
				ReadMatchDistances(out lenRes2, out numDistancePairs);
				if (lenRes2 >= _numFastBytes)
				{
					break;
				}
				position++;
				uint num18 = _optimum[num17].PosPrev;
				Base.State state;
				if (_optimum[num17].Prev1IsChar)
				{
					num18--;
					if (_optimum[num17].Prev2)
					{
						state = _optimum[_optimum[num17].PosPrev2].State;
						if (_optimum[num17].BackPrev2 < 4)
						{
							state.UpdateRep();
						}
						else
						{
							state.UpdateMatch();
						}
					}
					else
					{
						state = _optimum[num18].State;
					}
					state.UpdateChar();
				}
				else
				{
					state = _optimum[num18].State;
				}
				if (num18 == num17 - 1)
				{
					if (_optimum[num17].IsShortRep())
					{
						state.UpdateShortRep();
					}
					else
					{
						state.UpdateChar();
					}
				}
				else
				{
					uint num19;
					if (_optimum[num17].Prev1IsChar && _optimum[num17].Prev2)
					{
						num18 = _optimum[num17].PosPrev2;
						num19 = _optimum[num17].BackPrev2;
						state.UpdateRep();
					}
					else
					{
						num19 = _optimum[num17].BackPrev;
						if (num19 < 4)
						{
							state.UpdateRep();
						}
						else
						{
							state.UpdateMatch();
						}
					}
					Optimal optimal3 = _optimum[num18];
					switch (num19)
					{
					case 0u:
						reps[0] = optimal3.Backs0;
						reps[1] = optimal3.Backs1;
						reps[2] = optimal3.Backs2;
						reps[3] = optimal3.Backs3;
						break;
					case 1u:
						reps[0] = optimal3.Backs1;
						reps[1] = optimal3.Backs0;
						reps[2] = optimal3.Backs2;
						reps[3] = optimal3.Backs3;
						break;
					case 2u:
						reps[0] = optimal3.Backs2;
						reps[1] = optimal3.Backs0;
						reps[2] = optimal3.Backs1;
						reps[3] = optimal3.Backs3;
						break;
					case 3u:
						reps[0] = optimal3.Backs3;
						reps[1] = optimal3.Backs0;
						reps[2] = optimal3.Backs1;
						reps[3] = optimal3.Backs2;
						break;
					default:
						reps[0] = num19 - 4;
						reps[1] = optimal3.Backs0;
						reps[2] = optimal3.Backs1;
						reps[3] = optimal3.Backs2;
						break;
					}
				}
				_optimum[num17].State = state;
				_optimum[num17].Backs0 = reps[0];
				_optimum[num17].Backs1 = reps[1];
				_optimum[num17].Backs2 = reps[2];
				_optimum[num17].Backs3 = reps[3];
				uint price2 = _optimum[num17].Price;
				indexByte = _matchFinder.GetIndexByte(-1);
				indexByte2 = _matchFinder.GetIndexByte((int)(0 - reps[0] - 1 - 1));
				num5 = position & _posStateMask;
				uint num20 = price2 + _isMatch[(state.Index << 4) + num5].GetPrice0() + _literalEncoder.GetSubCoder(position, _matchFinder.GetIndexByte(-2)).GetPrice(!state.IsCharState(), indexByte2, indexByte);
				Optimal optimal4 = _optimum[num17 + 1];
				bool flag = false;
				if (num20 < optimal4.Price)
				{
					optimal4.Price = num20;
					optimal4.PosPrev = num17;
					optimal4.MakeAsChar();
					flag = true;
				}
				price = price2 + _isMatch[(state.Index << 4) + num5].GetPrice1();
				num6 = price + _isRep[state.Index].GetPrice1();
				if (indexByte2 == indexByte && (optimal4.PosPrev >= num17 || optimal4.BackPrev != 0))
				{
					uint num21 = num6 + GetRepLen1Price(state, num5);
					if (num21 <= optimal4.Price)
					{
						optimal4.Price = num21;
						optimal4.PosPrev = num17;
						optimal4.MakeAsShortRep();
						flag = true;
					}
				}
				uint val = _matchFinder.GetNumAvailableBytes() + 1;
				val = Math.Min(4095 - num17, val);
				num = val;
				if (num < 2)
				{
					continue;
				}
				if (num > _numFastBytes)
				{
					num = _numFastBytes;
				}
				if (!flag && indexByte2 != indexByte)
				{
					uint limit = Math.Min(val - 1, _numFastBytes);
					uint matchLen = _matchFinder.GetMatchLen(0, reps[0], limit);
					if (matchLen >= 2)
					{
						Base.State state2 = state;
						state2.UpdateChar();
						uint num22 = (position + 1) & _posStateMask;
						uint num23 = num20 + _isMatch[(state2.Index << 4) + num22].GetPrice1() + _isRep[state2.Index].GetPrice1();
						uint num24 = num17 + 1 + matchLen;
						while (num8 < num24)
						{
							_optimum[++num8].Price = 268435455u;
						}
						uint num25 = num23 + GetRepPrice(0u, matchLen, state2, num22);
						Optimal optimal5 = _optimum[num24];
						if (num25 < optimal5.Price)
						{
							optimal5.Price = num25;
							optimal5.PosPrev = num17 + 1;
							optimal5.BackPrev = 0u;
							optimal5.Prev1IsChar = true;
							optimal5.Prev2 = false;
						}
					}
				}
				uint num26 = 2u;
				for (uint num27 = 0u; num27 < 4; num27++)
				{
					uint num28 = _matchFinder.GetMatchLen(-1, reps[num27], num);
					if (num28 < 2)
					{
						continue;
					}
					uint num29 = num28;
					while (true)
					{
						if (num8 < num17 + num28)
						{
							_optimum[++num8].Price = 268435455u;
							continue;
						}
						uint num30 = num6 + GetRepPrice(num27, num28, state, num5);
						Optimal optimal6 = _optimum[num17 + num28];
						if (num30 < optimal6.Price)
						{
							optimal6.Price = num30;
							optimal6.PosPrev = num17;
							optimal6.BackPrev = num27;
							optimal6.Prev1IsChar = false;
						}
						if (--num28 < 2)
						{
							break;
						}
					}
					num28 = num29;
					if (num27 == 0)
					{
						num26 = num28 + 1;
					}
					if (num28 >= val)
					{
						continue;
					}
					uint limit2 = Math.Min(val - 1 - num28, _numFastBytes);
					uint matchLen2 = _matchFinder.GetMatchLen((int)num28, reps[num27], limit2);
					if (matchLen2 >= 2)
					{
						Base.State state3 = state;
						state3.UpdateRep();
						uint num31 = (position + num28) & _posStateMask;
						uint num32 = num6 + GetRepPrice(num27, num28, state, num5) + _isMatch[(state3.Index << 4) + num31].GetPrice0() + _literalEncoder.GetSubCoder(position + num28, _matchFinder.GetIndexByte((int)(num28 - 1 - 1))).GetPrice(matchMode: true, _matchFinder.GetIndexByte((int)(num28 - 1 - (reps[num27] + 1))), _matchFinder.GetIndexByte((int)(num28 - 1)));
						state3.UpdateChar();
						num31 = (position + num28 + 1) & _posStateMask;
						uint num33 = num32 + _isMatch[(state3.Index << 4) + num31].GetPrice1() + _isRep[state3.Index].GetPrice1();
						uint num34 = num28 + 1 + matchLen2;
						while (num8 < num17 + num34)
						{
							_optimum[++num8].Price = 268435455u;
						}
						uint num35 = num33 + GetRepPrice(0u, matchLen2, state3, num31);
						Optimal optimal7 = _optimum[num17 + num34];
						if (num35 < optimal7.Price)
						{
							optimal7.Price = num35;
							optimal7.PosPrev = num17 + num28 + 1;
							optimal7.BackPrev = 0u;
							optimal7.Prev1IsChar = true;
							optimal7.Prev2 = true;
							optimal7.PosPrev2 = num17;
							optimal7.BackPrev2 = num27;
						}
					}
				}
				if (lenRes2 > num)
				{
					lenRes2 = num;
					for (numDistancePairs = 0u; lenRes2 > _matchDistances[numDistancePairs]; numDistancePairs += 2)
					{
					}
					_matchDistances[numDistancePairs] = lenRes2;
					numDistancePairs += 2;
				}
				if (lenRes2 < num26)
				{
					continue;
				}
				num13 = price + _isRep[state.Index].GetPrice0();
				while (num8 < num17 + lenRes2)
				{
					_optimum[++num8].Price = 268435455u;
				}
				uint num36;
				for (num36 = 0u; num26 > _matchDistances[num36]; num36 += 2)
				{
				}
				uint num37 = num26;
				while (true)
				{
					uint num38 = _matchDistances[num36 + 1];
					uint num39 = num13 + GetPosLenPrice(num38, num37, num5);
					Optimal optimal8 = _optimum[num17 + num37];
					if (num39 < optimal8.Price)
					{
						optimal8.Price = num39;
						optimal8.PosPrev = num17;
						optimal8.BackPrev = num38 + 4;
						optimal8.Prev1IsChar = false;
					}
					if (num37 == _matchDistances[num36])
					{
						if (num37 < val)
						{
							uint limit3 = Math.Min(val - 1 - num37, _numFastBytes);
							uint matchLen3 = _matchFinder.GetMatchLen((int)num37, num38, limit3);
							if (matchLen3 >= 2)
							{
								Base.State state4 = state;
								state4.UpdateMatch();
								uint num40 = (position + num37) & _posStateMask;
								uint num41 = num39 + _isMatch[(state4.Index << 4) + num40].GetPrice0() + _literalEncoder.GetSubCoder(position + num37, _matchFinder.GetIndexByte((int)(num37 - 1 - 1))).GetPrice(matchMode: true, _matchFinder.GetIndexByte((int)(num37 - (num38 + 1) - 1)), _matchFinder.GetIndexByte((int)(num37 - 1)));
								state4.UpdateChar();
								num40 = (position + num37 + 1) & _posStateMask;
								uint num42 = num41 + _isMatch[(state4.Index << 4) + num40].GetPrice1() + _isRep[state4.Index].GetPrice1();
								uint num43 = num37 + 1 + matchLen3;
								while (num8 < num17 + num43)
								{
									_optimum[++num8].Price = 268435455u;
								}
								num39 = num42 + GetRepPrice(0u, matchLen3, state4, num40);
								optimal8 = _optimum[num17 + num43];
								if (num39 < optimal8.Price)
								{
									optimal8.Price = num39;
									optimal8.PosPrev = num17 + num37 + 1;
									optimal8.BackPrev = 0u;
									optimal8.Prev1IsChar = true;
									optimal8.Prev2 = true;
									optimal8.PosPrev2 = num17;
									optimal8.BackPrev2 = num38 + 4;
								}
							}
						}
						num36 += 2;
						if (num36 == numDistancePairs)
						{
							break;
						}
					}
					num37++;
				}
			}
			_numDistancePairs = numDistancePairs;
			_longestMatchLength = lenRes2;
			_longestMatchWasFound = true;
			return Backward(out backRes, num17);
		}

		private bool ChangePair(uint smallDist, uint bigDist)
		{
			if (smallDist < 33554432)
			{
				return bigDist >= smallDist << 7;
			}
			return false;
		}

		private void WriteEndMarker(uint posState)
		{
			if (_writeEndMark)
			{
				_isMatch[(_state.Index << 4) + posState].Encode(_rangeEncoder, 1u);
				_isRep[_state.Index].Encode(_rangeEncoder, 0u);
				_state.UpdateMatch();
				uint num = 2u;
				_lenEncoder.Encode(_rangeEncoder, num - 2, posState);
				uint symbol = 63u;
				uint lenToPosState = Base.GetLenToPosState(num);
				_posSlotEncoder[lenToPosState].Encode(_rangeEncoder, symbol);
				int num2 = 30;
				uint num3 = (uint)((1 << num2) - 1);
				_rangeEncoder.EncodeDirectBits(num3 >> 4, num2 - 4);
				_posAlignEncoder.ReverseEncode(_rangeEncoder, num3 & 0xFu);
			}
		}

		private void Flush(uint nowPos)
		{
			ReleaseMFStream();
			WriteEndMarker(nowPos & _posStateMask);
			_rangeEncoder.FlushData();
			_rangeEncoder.FlushStream();
		}

		public void CodeOneBlock(out long inSize, out long outSize, out bool finished)
		{
			inSize = 0L;
			outSize = 0L;
			finished = true;
			if (_inStream != null)
			{
				_matchFinder.SetStream(_inStream);
				_matchFinder.Init();
				_needReleaseMFStream = true;
				_inStream = null;
				if (_trainSize != 0)
				{
					_matchFinder.Skip(_trainSize);
				}
			}
			if (_finished)
			{
				return;
			}
			_finished = true;
			long num = nowPos64;
			if (nowPos64 == 0L)
			{
				if (_matchFinder.GetNumAvailableBytes() == 0)
				{
					Flush((uint)nowPos64);
					return;
				}
				ReadMatchDistances(out var _, out var _);
				uint num2 = (uint)(int)nowPos64 & _posStateMask;
				_isMatch[(_state.Index << 4) + num2].Encode(_rangeEncoder, 0u);
				_state.UpdateChar();
				byte indexByte = _matchFinder.GetIndexByte((int)(0 - _additionalOffset));
				_literalEncoder.GetSubCoder((uint)nowPos64, _previousByte).Encode(_rangeEncoder, indexByte);
				_previousByte = indexByte;
				_additionalOffset--;
				nowPos64++;
			}
			if (_matchFinder.GetNumAvailableBytes() == 0)
			{
				Flush((uint)nowPos64);
				return;
			}
			while (true)
			{
				uint backRes;
				uint optimum = GetOptimum((uint)nowPos64, out backRes);
				uint num3 = (uint)(int)nowPos64 & _posStateMask;
				uint num4 = (_state.Index << 4) + num3;
				if (optimum == 1 && backRes == uint.MaxValue)
				{
					_isMatch[num4].Encode(_rangeEncoder, 0u);
					byte indexByte2 = _matchFinder.GetIndexByte((int)(0 - _additionalOffset));
					LiteralEncoder.Encoder2 subCoder = _literalEncoder.GetSubCoder((uint)nowPos64, _previousByte);
					if (!_state.IsCharState())
					{
						byte indexByte3 = _matchFinder.GetIndexByte((int)(0 - _repDistances[0] - 1 - _additionalOffset));
						subCoder.EncodeMatched(_rangeEncoder, indexByte3, indexByte2);
					}
					else
					{
						subCoder.Encode(_rangeEncoder, indexByte2);
					}
					_previousByte = indexByte2;
					_state.UpdateChar();
				}
				else
				{
					_isMatch[num4].Encode(_rangeEncoder, 1u);
					if (backRes < 4)
					{
						_isRep[_state.Index].Encode(_rangeEncoder, 1u);
						if (backRes == 0)
						{
							_isRepG0[_state.Index].Encode(_rangeEncoder, 0u);
							if (optimum == 1)
							{
								_isRep0Long[num4].Encode(_rangeEncoder, 0u);
							}
							else
							{
								_isRep0Long[num4].Encode(_rangeEncoder, 1u);
							}
						}
						else
						{
							_isRepG0[_state.Index].Encode(_rangeEncoder, 1u);
							if (backRes == 1)
							{
								_isRepG1[_state.Index].Encode(_rangeEncoder, 0u);
							}
							else
							{
								_isRepG1[_state.Index].Encode(_rangeEncoder, 1u);
								_isRepG2[_state.Index].Encode(_rangeEncoder, backRes - 2);
							}
						}
						if (optimum == 1)
						{
							_state.UpdateShortRep();
						}
						else
						{
							_repMatchLenEncoder.Encode(_rangeEncoder, optimum - 2, num3);
							_state.UpdateRep();
						}
						uint num5 = _repDistances[backRes];
						if (backRes != 0)
						{
							for (uint num6 = backRes; num6 >= 1; num6--)
							{
								_repDistances[num6] = _repDistances[num6 - 1];
							}
							_repDistances[0] = num5;
						}
					}
					else
					{
						_isRep[_state.Index].Encode(_rangeEncoder, 0u);
						_state.UpdateMatch();
						_lenEncoder.Encode(_rangeEncoder, optimum - 2, num3);
						backRes -= 4;
						uint posSlot = GetPosSlot(backRes);
						uint lenToPosState = Base.GetLenToPosState(optimum);
						_posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot);
						if (posSlot >= 4)
						{
							int num7 = (int)((posSlot >> 1) - 1);
							uint num8 = (2 | (posSlot & 1)) << num7;
							uint num9 = backRes - num8;
							if (posSlot < 14)
							{
								BitTreeEncoder.ReverseEncode(_posEncoders, num8 - posSlot - 1, _rangeEncoder, num7, num9);
							}
							else
							{
								_rangeEncoder.EncodeDirectBits(num9 >> 4, num7 - 4);
								_posAlignEncoder.ReverseEncode(_rangeEncoder, num9 & 0xFu);
								_alignPriceCount++;
							}
						}
						uint num10 = backRes;
						for (uint num11 = 3u; num11 >= 1; num11--)
						{
							_repDistances[num11] = _repDistances[num11 - 1];
						}
						_repDistances[0] = num10;
						_matchPriceCount++;
					}
					_previousByte = _matchFinder.GetIndexByte((int)(optimum - 1 - _additionalOffset));
				}
				_additionalOffset -= optimum;
				nowPos64 += optimum;
				if (_additionalOffset == 0)
				{
					if (_matchPriceCount >= 128)
					{
						FillDistancesPrices();
					}
					if (_alignPriceCount >= 16)
					{
						FillAlignPrices();
					}
					inSize = nowPos64;
					outSize = _rangeEncoder.GetProcessedSizeAdd();
					if (_matchFinder.GetNumAvailableBytes() == 0)
					{
						Flush((uint)nowPos64);
						return;
					}
					if (nowPos64 - num >= 4096)
					{
						break;
					}
				}
			}
			_finished = false;
			finished = false;
		}

		private void ReleaseMFStream()
		{
			if (_matchFinder != null && _needReleaseMFStream)
			{
				_matchFinder.ReleaseStream();
				_needReleaseMFStream = false;
			}
		}

		private void SetOutStream(Stream outStream)
		{
			_rangeEncoder.SetStream(outStream);
		}

		private void ReleaseOutStream()
		{
			_rangeEncoder.ReleaseStream();
		}

		private void ReleaseStreams()
		{
			ReleaseMFStream();
			ReleaseOutStream();
		}

		private void SetStreams(Stream inStream, Stream outStream, long inSize, long outSize)
		{
			_inStream = inStream;
			_finished = false;
			Create();
			SetOutStream(outStream);
			Init();
			FillDistancesPrices();
			FillAlignPrices();
			_lenEncoder.SetTableSize(_numFastBytes + 1 - 2);
			_lenEncoder.UpdateTables((uint)(1 << _posStateBits));
			_repMatchLenEncoder.SetTableSize(_numFastBytes + 1 - 2);
			_repMatchLenEncoder.UpdateTables((uint)(1 << _posStateBits));
			nowPos64 = 0L;
		}

		public void Code(Stream inStream, Stream outStream, long inSize, long outSize, ICodeProgress progress)
		{
			_needReleaseMFStream = false;
			try
			{
				SetStreams(inStream, outStream, inSize, outSize);
				while (true)
				{
					CodeOneBlock(out var inSize2, out var outSize2, out var finished);
					if (finished)
					{
						break;
					}
					progress?.SetProgress(inSize2, outSize2);
				}
			}
			finally
			{
				ReleaseStreams();
			}
		}

		public void WriteCoderProperties(Stream outStream)
		{
			properties[0] = (byte)((_posStateBits * 5 + _numLiteralPosStateBits) * 9 + _numLiteralContextBits);
			for (int i = 0; i < 4; i++)
			{
				properties[1 + i] = (byte)((_dictionarySize >> 8 * i) & 0xFFu);
			}
			outStream.Write(properties, 0, 5);
		}

		private void FillDistancesPrices()
		{
			for (uint num = 4u; num < 128; num++)
			{
				uint posSlot = GetPosSlot(num);
				int num2 = (int)((posSlot >> 1) - 1);
				uint num3 = (2 | (posSlot & 1)) << num2;
				tempPrices[num] = BitTreeEncoder.ReverseGetPrice(_posEncoders, num3 - posSlot - 1, num2, num - num3);
			}
			for (uint num4 = 0u; num4 < 4; num4++)
			{
				BitTreeEncoder bitTreeEncoder = _posSlotEncoder[num4];
				uint num5 = num4 << 6;
				for (uint num6 = 0u; num6 < _distTableSize; num6++)
				{
					_posSlotPrices[num5 + num6] = bitTreeEncoder.GetPrice(num6);
				}
				for (uint num6 = 14u; num6 < _distTableSize; num6++)
				{
					_posSlotPrices[num5 + num6] += (num6 >> 1) - 1 - 4 << 6;
				}
				uint num7 = num4 * 128;
				uint num8;
				for (num8 = 0u; num8 < 4; num8++)
				{
					_distancesPrices[num7 + num8] = _posSlotPrices[num5 + num8];
				}
				for (; num8 < 128; num8++)
				{
					_distancesPrices[num7 + num8] = _posSlotPrices[num5 + GetPosSlot(num8)] + tempPrices[num8];
				}
			}
			_matchPriceCount = 0u;
		}

		private void FillAlignPrices()
		{
			for (uint num = 0u; num < 16; num++)
			{
				_alignPrices[num] = _posAlignEncoder.ReverseGetPrice(num);
			}
			_alignPriceCount = 0u;
		}

		private static int FindMatchFinder(string s)
		{
			for (int i = 0; i < kMatchFinderIDs.Length; i++)
			{
				if (s == kMatchFinderIDs[i])
				{
					return i;
				}
			}
			return -1;
		}

		public void SetCoderProperties(CoderPropID[] propIDs, object[] properties)
		{
			for (uint num = 0u; num < properties.Length; num++)
			{
				object obj = properties[num];
				switch (propIDs[num])
				{
				case CoderPropID.NumFastBytes:
					if (!(obj is int num2))
					{
						throw new InvalidParamException();
					}
					if (num2 < 5 || (long)num2 > 273L)
					{
						throw new InvalidParamException();
					}
					_numFastBytes = (uint)num2;
					break;
				case CoderPropID.MatchFinder:
				{
					if (!(obj is string))
					{
						throw new InvalidParamException();
					}
					EMatchFinderType matchFinderType = _matchFinderType;
					int num6 = FindMatchFinder(((string)obj).ToUpper());
					if (num6 < 0)
					{
						throw new InvalidParamException();
					}
					_matchFinderType = (EMatchFinderType)num6;
					if (_matchFinder != null && matchFinderType != _matchFinderType)
					{
						_dictionarySizePrev = uint.MaxValue;
						_matchFinder = null;
					}
					break;
				}
				case CoderPropID.DictionarySize:
				{
					if (!(obj is int num7))
					{
						throw new InvalidParamException();
					}
					if ((long)num7 < 1L || (long)num7 > 1073741824L)
					{
						throw new InvalidParamException();
					}
					_dictionarySize = (uint)num7;
					int i;
					for (i = 0; (long)i < 30L && num7 > (uint)(1 << i); i++)
					{
					}
					_distTableSize = (uint)(i * 2);
					break;
				}
				case CoderPropID.PosStateBits:
					if (!(obj is int num3))
					{
						throw new InvalidParamException();
					}
					if (num3 < 0 || (long)num3 > 4L)
					{
						throw new InvalidParamException();
					}
					_posStateBits = num3;
					_posStateMask = (uint)((1 << _posStateBits) - 1);
					break;
				case CoderPropID.LitPosBits:
					if (!(obj is int num5))
					{
						throw new InvalidParamException();
					}
					if (num5 < 0 || (long)num5 > 4L)
					{
						throw new InvalidParamException();
					}
					_numLiteralPosStateBits = num5;
					break;
				case CoderPropID.LitContextBits:
					if (!(obj is int num4))
					{
						throw new InvalidParamException();
					}
					if (num4 < 0 || (long)num4 > 8L)
					{
						throw new InvalidParamException();
					}
					_numLiteralContextBits = num4;
					break;
				case CoderPropID.EndMarker:
					if (!(obj is bool))
					{
						throw new InvalidParamException();
					}
					SetWriteEndMarkerMode((bool)obj);
					break;
				default:
					throw new InvalidParamException();
				case CoderPropID.Algorithm:
					break;
				}
			}
		}

		public void SetTrainSize(uint trainSize)
		{
			_trainSize = trainSize;
		}
	}
	public static class SevenZipHelper
	{
		private static CoderPropID[] propIDs = new CoderPropID[8]
		{
			CoderPropID.DictionarySize,
			CoderPropID.PosStateBits,
			CoderPropID.LitContextBits,
			CoderPropID.LitPosBits,
			CoderPropID.Algorithm,
			CoderPropID.NumFastBytes,
			CoderPropID.MatchFinder,
			CoderPropID.EndMarker
		};

		private static object[] properties = new object[8] { 2097152, 2, 3, 0, 2, 32, "bt4", false };

		public static byte[] Compress(byte[] inputBytes, ICodeProgress progress = null)
		{
			MemoryStream inStream = new MemoryStream(inputBytes);
			MemoryStream memoryStream = new MemoryStream();
			Compress(inStream, memoryStream, progress);
			return memoryStream.ToArray();
		}

		public static void Compress(Stream inStream, Stream outStream, ICodeProgress progress = null)
		{
			Encoder encoder = new Encoder();
			encoder.SetCoderProperties(propIDs, properties);
			encoder.WriteCoderProperties(outStream);
			encoder.Code(inStream, outStream, -1L, -1L, progress);
		}

		public static byte[] Decompress(byte[] inputBytes)
		{
			MemoryStream memoryStream = new MemoryStream(inputBytes);
			Decoder decoder = new Decoder();
			memoryStream.Seek(0L, SeekOrigin.Begin);
			MemoryStream memoryStream2 = new MemoryStream();
			byte[] array = new byte[5];
			if (memoryStream.Read(array, 0, 5) != 5)
			{
				throw new Exception("input .lzma is too short");
			}
			long num = 0L;
			for (int i = 0; i < 8; i++)
			{
				int num2 = memoryStream.ReadByte();
				if (num2 < 0)
				{
					throw new Exception("Can't Read 1");
				}
				num |= (long)((ulong)(byte)num2 << 8 * i);
			}
			decoder.SetDecoderProperties(array);
			long inSize = memoryStream.Length - memoryStream.Position;
			decoder.Code(memoryStream, memoryStream2, inSize, num, null);
			return memoryStream2.ToArray();
		}

		public static MemoryStream StreamDecompress(MemoryStream newInStream)
		{
			Decoder decoder = new Decoder();
			newInStream.Seek(0L, SeekOrigin.Begin);
			MemoryStream memoryStream = new MemoryStream();
			byte[] array = new byte[5];
			if (newInStream.Read(array, 0, 5) != 5)
			{
				throw new Exception("input .lzma is too short");
			}
			long num = 0L;
			for (int i = 0; i < 8; i++)
			{
				int num2 = newInStream.ReadByte();
				if (num2 < 0)
				{
					throw new Exception("Can't Read 1");
				}
				num |= (long)((ulong)(byte)num2 << 8 * i);
			}
			decoder.SetDecoderProperties(array);
			long inSize = newInStream.Length - newInStream.Position;
			decoder.Code(newInStream, memoryStream, inSize, num, null);
			memoryStream.Position = 0L;
			return memoryStream;
		}

		public static MemoryStream StreamDecompress(MemoryStream newInStream, long outSize)
		{
			Decoder decoder = new Decoder();
			newInStream.Seek(0L, SeekOrigin.Begin);
			MemoryStream memoryStream = new MemoryStream();
			byte[] array = new byte[5];
			if (newInStream.Read(array, 0, 5) != 5)
			{
				throw new Exception("input .lzma is too short");
			}
			decoder.SetDecoderProperties(array);
			long inSize = newInStream.Length - newInStream.Position;
			decoder.Code(newInStream, memoryStream, inSize, outSize, null);
			memoryStream.Position = 0L;
			return memoryStream;
		}

		public static void StreamDecompress(Stream compressedStream, Stream decompressedStream, long compressedSize, long decompressedSize)
		{
			long position = compressedStream.Position;
			Decoder decoder = new Decoder();
			byte[] array = new byte[5];
			if (compressedStream.Read(array, 0, 5) != 5)
			{
				throw new Exception("input .lzma is too short");
			}
			decoder.SetDecoderProperties(array);
			decoder.Code(compressedStream, decompressedStream, compressedSize - 5, decompressedSize, null);
			compressedStream.Position = position + compressedSize;
		}
	}
}
namespace SevenZip.Buffer
{
	public class InBuffer
	{
		private byte[] m_Buffer;

		private uint m_Pos;

		private uint m_Limit;

		private uint m_BufferSize;

		private Stream m_Stream;

		private bool m_StreamWasExhausted;

		private ulong m_ProcessedSize;

		public InBuffer(uint bufferSize)
		{
			m_Buffer = new byte[bufferSize];
			m_BufferSize = bufferSize;
		}

		public void Init(Stream stream)
		{
			m_Stream = stream;
			m_ProcessedSize = 0uL;
			m_Limit = 0u;
			m_Pos = 0u;
			m_StreamWasExhausted = false;
		}

		public bool ReadBlock()
		{
			if (m_StreamWasExhausted)
			{
				return false;
			}
			m_ProcessedSize += m_Pos;
			int num = m_Stream.Read(m_Buffer, 0, (int)m_BufferSize);
			m_Pos = 0u;
			m_Limit = (uint)num;
			m_StreamWasExhausted = num == 0;
			return !m_StreamWasExhausted;
		}

		public void ReleaseStream()
		{
			m_Stream = null;
		}

		public bool ReadByte(byte b)
		{
			if (m_Pos >= m_Limit && !ReadBlock())
			{
				return false;
			}
			b = m_Buffer[m_Pos++];
			return true;
		}

		public byte ReadByte()
		{
			if (m_Pos >= m_Limit && !ReadBlock())
			{
				return byte.MaxValue;
			}
			return m_Buffer[m_Pos++];
		}

		public ulong GetProcessedSize()
		{
			return m_ProcessedSize + m_Pos;
		}
	}
	public class OutBuffer
	{
		private byte[] m_Buffer;

		private uint m_Pos;

		private uint m_BufferSize;

		private Stream m_Stream;

		private ulong m_ProcessedSize;

		public OutBuffer(uint bufferSize)
		{
			m_Buffer = new byte[bufferSize];
			m_BufferSize = bufferSize;
		}

		public void SetStream(Stream stream)
		{
			m_Stream = stream;
		}

		public void FlushStream()
		{
			m_Stream.Flush();
		}

		public void CloseStream()
		{
			m_Stream.Close();
		}

		public void ReleaseStream()
		{
			m_Stream = null;
		}

		public void Init()
		{
			m_ProcessedSize = 0uL;
			m_Pos = 0u;
		}

		public void WriteByte(byte b)
		{
			m_Buffer[m_Pos++] = b;
			if (m_Pos >= m_BufferSize)
			{
				FlushData();
			}
		}

		public void FlushData()
		{
			if (m_Pos != 0)
			{
				m_Stream.Write(m_Buffer, 0, (int)m_Pos);
				m_Pos = 0u;
			}
		}

		public ulong GetProcessedSize()
		{
			return m_ProcessedSize + m_Pos;
		}
	}
}
namespace SevenZip.CommandLineParser
{
	public enum SwitchType
	{
		Simple,
		PostMinus,
		LimitedPostString,
		UnLimitedPostString,
		PostChar
	}
	public class SwitchForm
	{
		public string IDString;

		public SwitchType Type;

		public bool Multi;

		public int MinLen;

		public int MaxLen;

		public string PostCharSet;

		public SwitchForm(string idString, SwitchType type, bool multi, int minLen, int maxLen, string postCharSet)
		{
			IDString = idString;
			Type = type;
			Multi = multi;
			MinLen = minLen;
			MaxLen = maxLen;
			PostCharSet = postCharSet;
		}

		public SwitchForm(string idString, SwitchType type, bool multi, int minLen)
			: this(idString, type, multi, minLen, 0, "")
		{
		}

		public SwitchForm(string idString, SwitchType type, bool multi)
			: this(idString, type, multi, 0)
		{
		}
	}
	public class SwitchResult
	{
		public bool ThereIs;

		public bool WithMinus;

		public ArrayList PostStrings = new ArrayList();

		public int PostCharIndex;

		public SwitchResult()
		{
			ThereIs = false;
		}
	}
	public class Parser
	{
		public ArrayList NonSwitchStrings = new ArrayList();

		private SwitchResult[] _switches;

		private const char kSwitchID1 = '-';

		private const char kSwitchID2 = '/';

		private const char kSwitchMinus = '-';

		private const string kStopSwitchParsing = "--";

		public SwitchResult this[int index] => _switches[index];

		public Parser(int numSwitches)
		{
			_switches = new SwitchResult[numSwitches];
			for (int i = 0; i < numSwitches; i++)
			{
				_switches[i] = new SwitchResult();
			}
		}

		private bool ParseString(string srcString, SwitchForm[] switchForms)
		{
			int length = srcString.Length;
			if (length == 0)
			{
				return false;
			}
			int num = 0;
			if (!IsItSwitchChar(srcString[num]))
			{
				return false;
			}
			while (num < length)
			{
				if (IsItSwitchChar(srcString[num]))
				{
					num++;
				}
				int num2 = 0;
				int num3 = -1;
				for (int i = 0; i < _switches.Length; i++)
				{
					int length2 = switchForms[i].IDString.Length;
					if (length2 > num3 && num + length2 <= length && string.Compare(switchForms[i].IDString, 0, srcString, num, length2, ignoreCase: true) == 0)
					{
						num2 = i;
						num3 = length2;
					}
				}
				if (num3 == -1)
				{
					throw new Exception("maxLen == kNoLen");
				}
				SwitchResult switchResult = _switches[num2];
				SwitchForm switchForm = switchForms[num2];
				if (!switchForm.Multi && switchResult.ThereIs)
				{
					throw new Exception("switch must be single");
				}
				switchResult.ThereIs = true;
				num += num3;
				int num4 = length - num;
				SwitchType type = switchForm.Type;
				switch (type)
				{
				case SwitchType.PostMinus:
					if (num4 == 0)
					{
						switchResult.WithMinus = false;
						break;
					}
					switchResult.WithMinus = srcString[num] == '-';
					if (switchResult.WithMinus)
					{
						num++;
					}
					break;
				case SwitchType.PostChar:
				{
					if (num4 < switchForm.MinLen)
					{
						throw new Exception("switch is not full");
					}
					string postCharSet = switchForm.PostCharSet;
					if (num4 == 0)
					{
						switchResult.PostCharIndex = -1;
						break;
					}
					int num6 = postCharSet.IndexOf(srcString[num]);
					if (num6 < 0)
					{
						switchResult.PostCharIndex = -1;
						break;
					}
					switchResult.PostCharIndex = num6;
					num++;
					break;
				}
				case SwitchType.LimitedPostString:
				case SwitchType.UnLimitedPostString:
				{
					int minLen = switchForm.MinLen;
					if (num4 < minLen)
					{
						throw new Exception("switch is not full");
					}
					if (type == SwitchType.UnLimitedPostString)
					{
						switchResult.PostStrings.Add(srcString.Substring(num));
						return true;
					}
					string text = srcString.Substring(num, minLen);
					num += minLen;
					int num5 = minLen;
					while (num5 < switchForm.MaxLen && num < length)
					{
						char c = srcString[num];
						if (IsItSwitchChar(c))
						{
							break;
						}
						text += c;
						num5++;
						num++;
					}
					switchResult.PostStrings.Add(text);
					break;
				}
				}
			}
			return true;
		}

		public void ParseStrings(SwitchForm[] switchForms, string[] commandStrings)
		{
			int num = commandStrings.Length;
			bool flag = false;
			for (int i = 0; i < num; i++)
			{
				string text = commandStrings[i];
				if (flag)
				{
					NonSwitchStrings.Add(text);
				}
				else if (text == "--")
				{
					flag = true;
				}
				else if (!ParseString(text, switchForms))
				{
					NonSwitchStrings.Add(text);
				}
			}
		}

		public static int ParseCommand(CommandForm[] commandForms, string commandString, out string postString)
		{
			for (int i = 0; i < commandForms.Length; i++)
			{
				string iDString = commandForms[i].IDString;
				if (commandForms[i].PostStringMode)
				{
					if (commandString.IndexOf(iDString) == 0)
					{
						postString = commandString.Substring(iDString.Length);
						return i;
					}
				}
				else if (commandString == iDString)
				{
					postString = "";
					return i;
				}
			}
			postString = "";
			return -1;
		}

		private static bool ParseSubCharsCommand(int numForms, CommandSubCharsSet[] forms, string commandString, ArrayList indices)
		{
			indices.Clear();
			int num = 0;
			for (int i = 0; i < numForms; i++)
			{
				CommandSubCharsSet commandSubCharsSet = forms[i];
				int num2 = -1;
				int length = commandSubCharsSet.Chars.Length;
				for (int j = 0; j < length; j++)
				{
					char value = commandSubCharsSet.Chars[j];
					int num3 = commandString.IndexOf(value);
					if (num3 >= 0)
					{
						if (num2 >= 0)
						{
							return false;
						}
						if (commandString.IndexOf(value, num3 + 1) >= 0)
						{
							return false;
						}
						num2 = j;
						num++;
					}
				}
				if (num2 == -1 && !commandSubCharsSet.EmptyAllowed)
				{
					return false;
				}
				indices.Add(num2);
			}
			return num == commandString.Length;
		}

		private static bool IsItSwitchChar(char c)
		{
			if (c != '-')
			{
				return c == '/';
			}
			return true;
		}
	}
	public class CommandForm
	{
		public string IDString = "";

		public bool PostStringMode;

		public CommandForm(string idString, bool postStringMode)
		{
			IDString = idString;
			PostStringMode = postStringMode;
		}
	}
	internal class CommandSubCharsSet
	{
		public string Chars = "";

		public bool EmptyAllowed;
	}
}
namespace LZ4ps
{
	public static class LZ4Codec
	{
		private class LZ4HC_Data_Structure
		{
			public byte[] src;

			public int src_base;

			public int src_end;

			public int src_LASTLITERALS;

			public byte[] dst;

			public int dst_base;

			public int dst_len;

			public int dst_end;

			public int[] hashTable;

			public ushort[] chainTable;

			public int nextToUpdate;
		}

		private const int MEMORY_USAGE = 14;

		private const int NOTCOMPRESSIBLE_DETECTIONLEVEL = 6;

		private const int BLOCK_COPY_LIMIT = 16;

		private const int MINMATCH = 4;

		private const int SKIPSTRENGTH = 6;

		private const int COPYLENGTH = 8;

		private const int LASTLITERALS = 5;

		private const int MFLIMIT = 12;

		private const int MINLENGTH = 13;

		private const int MAXD_LOG = 16;

		private const int MAXD = 65536;

		private const int MAXD_MASK = 65535;

		private const int MAX_DISTANCE = 65535;

		private const int ML_BITS = 4;

		private const int ML_MASK = 15;

		private const int RUN_BITS = 4;

		private const int RUN_MASK = 15;

		private const int STEPSIZE_64 = 8;

		private const int STEPSIZE_32 = 4;

		private const int LZ4_64KLIMIT = 65547;

		private const int HASH_LOG = 12;

		private const int HASH_TABLESIZE = 4096;

		private const int HASH_ADJUST = 20;

		private const int HASH64K_LOG = 13;

		private const int HASH64K_TABLESIZE = 8192;

		private const int HASH64K_ADJUST = 19;

		private const int HASHHC_LOG = 15;

		private const int HASHHC_TABLESIZE = 32768;

		private const int HASHHC_ADJUST = 17;

		private static readonly int[] DECODER_TABLE_32 = new int[8] { 0, 3, 2, 3, 0, 0, 0, 0 };

		private static readonly int[] DECODER_TABLE_64 = new int[8] { 0, 0, 0, -1, 0, 1, 2, 3 };

		private static readonly int[] DEBRUIJN_TABLE_32 = new int[32]
		{
			0, 0, 3, 0, 3, 1, 3, 0, 3, 2,
			2, 1, 3, 2, 0, 1, 3, 3, 1, 2,
			2, 2, 2, 0, 3, 1, 2, 0, 1, 0,
			1, 1
		};

		private static readonly int[] DEBRUIJN_TABLE_64 = new int[64]
		{
			0, 0, 0, 0, 0, 1, 1, 2, 0, 3,
			1, 3, 1, 4, 2, 7, 0, 2, 3, 6,
			1, 5, 3, 5, 1, 3, 4, 4, 2, 5,
			6, 7, 7, 0, 1, 2, 3, 3, 4, 6,
			2, 6, 5, 5, 3, 4, 5, 6, 7, 1,
			2, 4, 6, 4, 4, 5, 7, 2, 6, 5,
			7, 6, 7, 7
		};

		private const int MAX_NB_ATTEMPTS = 256;

		private const int OPTIMAL_ML = 18;

		public static int MaximumOutputLength(int inputLength)
		{
			return inputLength + inputLength / 255 + 16;
		}

		internal static void CheckArguments(byte[] input, int inputOffset, ref int inputLength, byte[] output, int outputOffset, ref int outputLength)
		{
			if (inputLength < 0)
			{
				inputLength = input.Length - inputOffset;
			}
			if (inputLength == 0)
			{
				outputLength = 0;
				return;
			}
			if (input == null)
			{
				throw new ArgumentNullException("input");
			}
			if (inputOffset < 0 || inputOffset + inputLength > input.Length)
			{
				throw new ArgumentException("inputOffset and inputLength are invalid for given input");
			}
			if (outputLength < 0)
			{
				outputLength = output.Length - outputOffset;
			}
			if (output == null)
			{
				throw new ArgumentNullException("output");
			}
			if (outputOffset >= 0 && outputOffset + outputLength <= output.Length)
			{
				return;
			}
			throw new ArgumentException("outputOffset and outputLength are invalid for given output");
		}

		[Conditional("DEBUG")]
		private static void Assert(bool condition, string errorMessage)
		{
			if (!condition)
			{
				throw new ArgumentException(errorMessage);
			}
		}

		internal static void Poke2(byte[] buffer, int offset, ushort value)
		{
			buffer[offset] = (byte)value;
			buffer[offset + 1] = (byte)(value >> 8);
		}

		internal static ushort Peek2(byte[] buffer, int offset)
		{
			return (ushort)(buffer[offset] | (buffer[offset + 1] << 8));
		}

		internal static uint Peek4(byte[] buffer, int offset)
		{
			return (uint)(buffer[offset] | (buffer[offset + 1] << 8) | (buffer[offset + 2] << 16) | (buffer[offset + 3] << 24));
		}

		private static uint Xor4(byte[] buffer, int offset1, int offset2)
		{
			int num = buffer[offset1] | (buffer[offset1 + 1] << 8) | (buffer[offset1 + 2] << 16) | (buffer[offset1 + 3] << 24);
			uint num2 = (uint)(buffer[offset2] | (buffer[offset2 + 1] << 8) | (buffer[offset2 + 2] << 16) | (buffer[offset2 + 3] << 24));
			return (uint)num ^ num2;
		}

		private static ulong Xor8(byte[] buffer, int offset1, int offset2)
		{
			ulong num = buffer[offset1] | ((ulong)buffer[offset1 + 1] << 8) | ((ulong)buffer[offset1 + 2] << 16) | ((ulong)buffer[offset1 + 3] << 24) | ((ulong)buffer[offset1 + 4] << 32) | ((ulong)buffer[offset1 + 5] << 40) | ((ulong)buffer[offset1 + 6] << 48) | ((ulong)buffer[offset1 + 7] << 56);
			ulong num2 = buffer[offset2] | ((ulong)buffer[offset2 + 1] << 8) | ((ulong)buffer[offset2 + 2] << 16) | ((ulong)buffer[offset2 + 3] << 24) | ((ulong)buffer[offset2 + 4] << 32) | ((ulong)buffer[offset2 + 5] << 40) | ((ulong)buffer[offset2 + 6] << 48) | ((ulong)buffer[offset2 + 7] << 56);
			return num ^ num2;
		}

		private static bool Equal2(byte[] buffer, int offset1, int offset2)
		{
			if (buffer[offset1] != buffer[offset2])
			{
				return false;
			}
			return buffer[offset1 + 1] == buffer[offset2 + 1];
		}

		private static bool Equal4(byte[] buffer, int offset1, int offset2)
		{
			if (buffer[offset1] != buffer[offset2])
			{
				return false;
			}
			if (buffer[offset1 + 1] != buffer[offset2 + 1])
			{
				return false;
			}
			if (buffer[offset1 + 2] != buffer[offset2 + 2])
			{
				return false;
			}
			return buffer[offset1 + 3] == buffer[offset2 + 3];
		}

		private static void Copy4(byte[] buf, int src, int dst)
		{
			buf[dst + 3] = buf[src + 3];
			buf[dst + 2] = buf[src + 2];
			buf[dst + 1] = buf[src + 1];
			buf[dst] = buf[src];
		}

		private static void Copy8(byte[] buf, int src, int dst)
		{
			buf[dst + 7] = buf[src + 7];
			buf[dst + 6] = buf[src + 6];
			buf[dst + 5] = buf[src + 5];
			buf[dst + 4] = buf[src + 4];
			buf[dst + 3] = buf[src + 3];
			buf[dst + 2] = buf[src + 2];
			buf[dst + 1] = buf[src + 1];
			buf[dst] = buf[src];
		}

		private static void BlockCopy(byte[] src, int src_0, byte[] dst, int dst_0, int len)
		{
			if (len >= 16)
			{
				Buffer.BlockCopy(src, src_0, dst, dst_0, len);
				return;
			}
			while (len >= 8)
			{
				dst[dst_0] = src[src_0];
				dst[dst_0 + 1] = src[src_0 + 1];
				dst[dst_0 + 2] = src[src_0 + 2];
				dst[dst_0 + 3] = src[src_0 + 3];
				dst[dst_0 + 4] = src[src_0 + 4];
				dst[dst_0 + 5] = src[src_0 + 5];
				dst[dst_0 + 6] = src[src_0 + 6];
				dst[dst_0 + 7] = src[src_0 + 7];
				len -= 8;
				src_0 += 8;
				dst_0 += 8;
			}
			while (len >= 4)
			{
				dst[dst_0] = src[src_0];
				dst[dst_0 + 1] = src[src_0 + 1];
				dst[dst_0 + 2] = src[src_0 + 2];
				dst[dst_0 + 3] = src[src_0 + 3];
				len -= 4;
				src_0 += 4;
				dst_0 += 4;
			}
			while (len-- > 0)
			{
				dst[dst_0++] = src[src_0++];
			}
		}

		private static int WildCopy(byte[] src, int src_0, byte[] dst, int dst_0, int dst_end)
		{
			int num = dst_end - dst_0;
			if (num >= 16)
			{
				Buffer.BlockCopy(src, src_0, dst, dst_0, num);
			}
			else
			{
				while (num >= 4)
				{
					dst[dst_0] = src[src_0];
					dst[dst_0 + 1] = src[src_0 + 1];
					dst[dst_0 + 2] = src[src_0 + 2];
					dst[dst_0 + 3] = src[src_0 + 3];
					num -= 4;
					src_0 += 4;
					dst_0 += 4;
				}
				while (num-- > 0)
				{
					dst[dst_0++] = src[src_0++];
				}
			}
			return num;
		}

		private static int SecureCopy(byte[] buffer, int src, int dst, int dst_end)
		{
			int num = dst - src;
			int num2 = dst_end - dst;
			int num3 = num2;
			if (num >= 16)
			{
				if (num >= num2)
				{
					Buffer.BlockCopy(buffer, src, buffer, dst, num2);
					return num2;
				}
				do
				{
					Buffer.BlockCopy(buffer, src, buffer, dst, num);
					src += num;
					dst += num;
					num3 -= num;
				}
				while (num3 >= num);
			}
			while (num3 >= 4)
			{
				buffer[dst] = buffer[src];
				buffer[dst + 1] = buffer[src + 1];
				buffer[dst + 2] = buffer[src + 2];
				buffer[dst + 3] = buffer[src + 3];
				dst += 4;
				src += 4;
				num3 -= 4;
			}
			while (num3-- > 0)
			{
				buffer[dst++] = buffer[src++];
			}
			return num2;
		}

		public static int Encode32(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength)
		{
			CheckArguments(input, inputOffset, ref inputLength, output, outputOffset, ref outputLength);
			if (outputLength == 0)
			{
				return 0;
			}
			if (inputLength < 65547)
			{
				return LZ4_compress64kCtx_safe32(new ushort[8192], input, output, inputOffset, outputOffset, inputLength, outputLength);
			}
			return LZ4_compressCtx_safe32(new int[4096], input, output, inputOffset, outputOffset, inputLength, outputLength);
		}

		public static byte[] Encode32(byte[] input, int inputOffset, int inputLength)
		{
			if (inputLength < 0)
			{
				inputLength = input.Length - inputOffset;
			}
			if (input == null)
			{
				throw new ArgumentNullException("input");
			}
			if (inputOffset < 0 || inputOffset + inputLength > input.Length)
			{
				throw new ArgumentException("inputOffset and inputLength are invalid for given input");
			}
			byte[] array = new byte[MaximumOutputLength(inputLength)];
			int num = Encode32(input, inputOffset, inputLength, array, 0, array.Length);
			if (num != array.Length)
			{
				if (num < 0)
				{
					throw new InvalidOperationException("Compression has been corrupted");
				}
				byte[] array2 = new byte[num];
				Buffer.BlockCopy(array, 0, array2, 0, num);
				return array2;
			}
			return array;
		}

		public static int Encode64(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength)
		{
			CheckArguments(input, inputOffset, ref inputLength, output, outputOffset, ref outputLength);
			if (outputLength == 0)
			{
				return 0;
			}
			if (inputLength < 65547)
			{
				return LZ4_compress64kCtx_safe64(new ushort[8192], input, output, inputOffset, outputOffset, inputLength, outputLength);
			}
			return LZ4_compressCtx_safe64(new int[4096], input, output, inputOffset, outputOffset, inputLength, outputLength);
		}

		public static byte[] Encode64(byte[] input, int inputOffset, int inputLength)
		{
			if (inputLength < 0)
			{
				inputLength = input.Length - inputOffset;
			}
			if (input == null)
			{
				throw new ArgumentNullException("input");
			}
			if (inputOffset < 0 || inputOffset + inputLength > input.Length)
			{
				throw new ArgumentException("inputOffset and inputLength are invalid for given input");
			}
			byte[] array = new byte[MaximumOutputLength(inputLength)];
			int num = Encode64(input, inputOffset, inputLength, array, 0, array.Length);
			if (num != array.Length)
			{
				if (num < 0)
				{
					throw new InvalidOperationException("Compression has been corrupted");
				}
				byte[] array2 = new byte[num];
				Buffer.BlockCopy(array, 0, array2, 0, num);
				return array2;
			}
			return array;
		}

		public static int Decode32(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength, bool knownOutputLength)
		{
			CheckArguments(input, inputOffset, ref inputLength, output, outputOffset, ref outputLength);
			if (outputLength == 0)
			{
				return 0;
			

BepInEx\patchers\Cyberhead\Cyberhead.Patcher.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AssetsTools.NET;
using AssetsTools.NET.Extra;
using BepInEx;
using Microsoft.CodeAnalysis;
using Mono.Cecil;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyCompany("NotNite")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d89eb7fef17146dfd91c20d35eebf2ded4c4e92d")]
[assembly: AssemblyProduct("Cyberhead.Patcher")]
[assembly: AssemblyTitle("Cyberhead.Patcher")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Cyberhead.Patcher
{
	public static class Patcher
	{
		public static IEnumerable<string> TargetDLLs { get; } = Array.Empty<string>();


		public static void Patch(AssemblyDefinition assembly)
		{
		}

		public static void Initialize()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			string managedPath = Paths.ManagedPath;
			string path = Path.Combine(managedPath, "..", "Plugins", "x86_64");
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			string text = Path.Combine(managedPath, "..", "globalgamemanagers");
			string text2 = text + ".bak";
			if (!File.Exists(text2))
			{
				File.Copy(text, text2);
			}
			AssetsManager val = new AssetsManager();
			val.LoadClassPackage(Path.Combine(directoryName, "classdata.tpk"));
			AssetsFileInstance val2 = val.LoadAssetsFile(text2, false);
			val.LoadClassDatabaseFromPackage("2021.3.20");
			AssetFileInfo assetInfo = val2.file.GetAssetInfo(1L);
			AssetTypeValueField baseField = val.GetBaseField(val2, assetInfo, (AssetReadFlags)0);
			baseField.Get("activeInputHandler").AsInt = 2;
			assetInfo.SetNewData(baseField);
			AssetsFileWriter val3 = new AssetsFileWriter(File.OpenWrite(text));
			try
			{
				val2.file.Write(val3, 0L);
				string[] array = new string[2] { "openxr_loader.dll", "UnityOpenXR.dll" };
				foreach (string path2 in array)
				{
					string sourceFileName = Path.Combine(directoryName, path2);
					string text3 = Path.Combine(path, path2);
					if (!File.Exists(text3))
					{
						File.Copy(sourceFileName, text3);
					}
				}
				string path3 = Path.Combine(Paths.ManagedPath, "..", "UnitySubsystems");
				WriteFile(Path.Combine(path3, "UnityOpenXR", "UnitySubsystemsManifest.json"), "{\"name\":\"OpenXR XR Plugin\",\"version\":\"1.8.2\",\"libraryName\":\"UnityOpenXR\",\"displays\":[{\"id\":\"OpenXR Display\"}],\"inputs\":[{\"id\":\"OpenXR Input\"}]}");
				WriteFile(Path.Combine(path3, "OculusXRPlugin", "UnitySubsystemsManifest.json"), "{\"name\":\"OculusXRPlugin\",\"version\":\"1.0.0-preview\",\"libraryName\":\"OculusXRPlugin\",\"displays\":[{\"id\":\"oculus display\",\"disablesLegacyVr\":true,\"supportedMirrorBlitReservedModes\":[\"leftEye\",\"rightEye\",\"sideBySide\",\"occlusionMesh\"]}],\"inputs\":[{\"id\":\"oculus input\"}]}");
			}
			finally
			{
				((IDisposable)val3)?.Dispose();
			}
		}

		private static void WriteFile(string path, string content)
		{
			string directoryName = Path.GetDirectoryName(path);
			if (!Directory.Exists(directoryName))
			{
				Directory.CreateDirectory(directoryName);
			}
			File.WriteAllText(path, content);
		}
	}
}

BepInEx\plugins\Cyberhead\Cyberhead.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.Json;
using System.Timers;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Reptile;
using Rewired;
using Rewired.Data;
using Rewired.Data.Mapping;
using SlopCrew.API;
using Unity.XR.CoreUtils;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.XR;
using UnityEngine.XR.Interaction.Toolkit;
using UnityEngine.XR.Management;
using UnityEngine.XR.OpenXR;
using UnityEngine.XR.OpenXR.Features;
using UnityEngine.XR.OpenXR.Features.Interactions;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Rewired_Core")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")]
[assembly: IgnoresAccessChecksTo("Unity.XR.Management")]
[assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")]
[assembly: AssemblyCompany("NotNite")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2+d89eb7fef17146dfd91c20d35eebf2ded4c4e92d")]
[assembly: AssemblyProduct("Cyberhead")]
[assembly: AssemblyTitle("Cyberhead")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Cyberhead
{
	public class SlopCrewSynced : MonoBehaviour
	{
		public Vector3 SyncedPosition;

		public Quaternion SyncedRotation;

		private void LateUpdate()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.position = SyncedPosition;
			((Component)this).transform.rotation = SyncedRotation;
		}
	}
	public class XRCamera : MonoBehaviour
	{
		public Vector3? LockedPos;

		private TrackedPoseDriver trackedPoseDriver;

		private XROrigin origin;

		private Camera theaterCamera;

		private void Awake()
		{
			trackedPoseDriver = ((Component)this).gameObject.AddComponent<TrackedPoseDriver>();
			trackedPoseDriver.rotationAction = Inputs.HMDLook;
			trackedPoseDriver.positionAction = Inputs.HMDMove;
			trackedPoseDriver.trackingType = (TrackingType)0;
			Transform parent = ((Component)this).gameObject.transform.parent;
			origin = ((Component)parent.parent).gameObject.GetComponent<XROrigin>();
			theaterCamera = ((Component)this).gameObject.AddComponent<Camera>();
			((Behaviour)theaterCamera).enabled = false;
			theaterCamera.depth = 0f;
		}

		private void LateUpdate()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			Player currentPlayer = GetCurrentPlayer();
			if (LockedPos.HasValue)
			{
				((Component)origin).transform.position = LockedPos.Value;
				((Component)origin).transform.rotation = Quaternion.identity;
				((Behaviour)theaterCamera).enabled = true;
				Camera[] allCameras = Camera.allCameras;
				foreach (Camera val in allCameras)
				{
					if (!((Object)(object)val == (Object)(object)theaterCamera) && !((Object)(object)((Component)val).GetComponent<GameplayCamera>() != (Object)null))
					{
						val.targetTexture = Plugin.CutsceneRenderTexture;
						break;
					}
				}
				return;
			}
			if (((Behaviour)theaterCamera).enabled)
			{
				((Behaviour)theaterCamera).enabled = false;
				Camera[] allCameras = Camera.allCameras;
				foreach (Camera val2 in allCameras)
				{
					if ((Object)(object)val2.targetTexture == (Object)(object)Plugin.CutsceneRenderTexture)
					{
						val2.targetTexture = null;
					}
				}
				if ((Object)(object)currentPlayer != (Object)null)
				{
					MoveWithPlayer(((Component)currentPlayer).transform.position);
				}
			}
			if (!((Object)(object)currentPlayer != (Object)null))
			{
				return;
			}
			Transform transform = ((Component)this).transform;
			Vector3 position = transform.position;
			Quaternion rotation = transform.rotation;
			Vector3 val3 = currentPlayer.GetVelocity();
			if (((Vector3)(ref val3)).magnitude > 0f || !currentPlayer.userInputEnabled)
			{
				MoveWithPlayer(((Component)currentPlayer).transform.position);
			}
			else
			{
				val3 = position;
				val3.y = ((Component)currentPlayer).transform.position.y;
				Vector3 val4 = val3;
				Vector3 val5 = ((Component)currentPlayer).transform.position - val4;
				if (((Vector3)(ref val5)).magnitude >= 0f)
				{
					currentPlayer.motor.RigidbodyMove(val4);
				}
				Quaternion val6 = rotation;
				val6 = Quaternion.Euler(0f, ((Quaternion)(ref val6)).eulerAngles.y, 0f);
				Quaternion rotation2 = ((Component)currentPlayer).transform.rotation;
				if (((Quaternion)(ref rotation2)).eulerAngles.y - ((Quaternion)(ref val6)).eulerAngles.y >= 0f)
				{
					currentPlayer.motor.RigidbodyMoveRotation(val6);
				}
			}
			GameplayCamera cam = currentPlayer.cam;
			if ((Object)(object)cam != (Object)null)
			{
				origin.Camera = cam.cam;
				cam.cam.nearClipPlane = 0.01f;
				Transform transform2 = ((Component)cam).transform;
				transform2.position = position;
				transform2.rotation = rotation;
			}
		}

		private Player? GetCurrentPlayer()
		{
			WorldHandler instance = WorldHandler.instance;
			if ((Object)(object)instance == (Object)null)
			{
				return null;
			}
			return instance.GetCurrentPlayer();
		}

		public void MoveWithPlayer(Vector3 playerPos)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = ((Component)this).transform.position - ((Component)origin).transform.position;
			val.y = 0f;
			((Component)origin).transform.position = playerPos - val;
		}
	}
	public class XRHand : MonoBehaviour
	{
		public void Init(bool isLeft)
		{
			TrackedPoseDriver obj = ((Component)this).gameObject.AddComponent<TrackedPoseDriver>();
			obj.trackingType = (TrackingType)0;
			obj.positionAction = (isLeft ? Inputs.LeftControllerMove : Inputs.RightControllerMove);
			obj.rotationAction = (isLeft ? Inputs.LeftControllerRotate : Inputs.RightControllerRotate);
		}
	}
	public class XRHud : MonoBehaviour
	{
		private Canvas canvas;

		private GameObject? cutsceneView;

		private void Awake()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			canvas = ((Component)this).GetComponent<Canvas>();
			canvas.renderMode = (RenderMode)2;
			((Component)this).transform.localScale = Vector3.one * 0.001f;
			((Component)this).gameObject.layer = 0;
		}

		private void Update()
		{
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Plugin.XRRig == (Object)null)
			{
				return;
			}
			XRCamera component = ((Component)Plugin.XRRig.transform.Find("CameraOffset/XR Camera")).GetComponent<XRCamera>();
			Transform val = Plugin.XRRig.transform.Find("CameraOffset/XR Camera/XR HUD");
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			WorldHandler instance = WorldHandler.instance;
			if ((Object)(object)instance == (Object)null)
			{
				return;
			}
			Player currentPlayer = instance.GetCurrentPlayer();
			if ((Object)(object)currentPlayer == (Object)null)
			{
				DoTheater(component);
				return;
			}
			GameplayCamera cam = currentPlayer.cam;
			if ((Object)(object)cam == (Object)null || !((Behaviour)cam).enabled || !((Behaviour)cam.cam).enabled)
			{
				DoTheater(component);
				return;
			}
			component.LockedPos = null;
			if ((Object)(object)cutsceneView != (Object)null)
			{
				Object.Destroy((Object)(object)cutsceneView);
				((Component)this).transform.localScale = Vector3.one * 0.001f;
			}
			((Component)this).transform.position = val.position;
			((Component)this).transform.rotation = val.rotation;
			((Component)Core.Instance.UIManager.effects).gameObject.SetActive(false);
		}

		private void DoTheater(XRCamera cam)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Expected O, but got Unknown
			Vector3 zero = Vector3.zero;
			cam.LockedPos = zero;
			if ((Object)(object)cutsceneView == (Object)null)
			{
				((Component)this).transform.localScale = Vector3.one;
				GameObject val = GameObject.CreatePrimitive((PrimitiveType)5);
				float cameraYOffset = ((Component)((Component)cam).transform.parent.parent).gameObject.GetComponent<XROrigin>().CameraYOffset;
				val.transform.position = zero + new Vector3(0f, cameraYOffset, 2f);
				RenderTexture cutsceneRenderTexture = Plugin.CutsceneRenderTexture;
				float num = 2f;
				float num2 = num * (float)((Texture)cutsceneRenderTexture).width / (float)((Texture)cutsceneRenderTexture).height;
				val.transform.localScale = new Vector3(num2, num, 1f);
				Material val2 = new Material(Shader.Find("Unlit/Texture"));
				val2.mainTexture = (Texture)(object)cutsceneRenderTexture;
				((Renderer)val.GetComponent<MeshRenderer>()).material = val2;
				cutsceneView = val;
			}
			((Component)this).transform.position = cutsceneView.transform.position - new Vector3(0f, 0f, 0.1f);
			((Component)this).transform.rotation = Quaternion.identity;
			Vector3 localScale = cutsceneView.transform.localScale;
			float num3 = Screen.width;
			float num4 = Screen.height;
			((Component)this).transform.localScale = new Vector3(localScale.x / num3, localScale.y / num4, 1f);
		}
	}
	public class Config
	{
		public class ConfigGeneral
		{
			public ConfigEntry<bool> VrEnabled = config.Bind<bool>("General", "VrEnabled", true, "Whether to set up VR mode, or just function as a compatibility addon for PC gameplay.");

			public ConfigGeneral(ConfigFile config)
			{
			}
		}

		public ConfigGeneral General = new ConfigGeneral(config);

		public Config(ConfigFile config)
		{
		}
	}
	public class Inputs
	{
		public class ButtonIDs
		{
			public const int MoveX = 0;

			public const int MoveY = 1;

			public const int Jump = 2;

			public const int SwitchStyle = 3;

			public const int Manual = 4;

			public const int Boost = 5;

			public const int TrickOne = 6;

			public const int TrickTwo = 7;

			public const int TrickThree = 8;

			public const int Pause = 13;

			public const int Interact = 14;

			public const int Dance = 15;
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static OnCoreInitializedHandler <0>__InitializeRewired;

			public static Action <1>__UpdateRewiredInput;
		}

		public static InputAction HMDLook = null;

		public static InputAction HMDMove = null;

		public static InputAction LeftControllerRotate = null;

		public static InputAction LeftControllerMove = null;

		public static InputAction RightControllerRotate = null;

		public static InputAction RightControllerMove = null;

		public static InputAction LeftStickMove = null;

		public static InputAction RightContollerJump = null;

		public static InputAction RightControllerSwitchStyle = null;

		public static InputAction RightStickTurn = null;

		public static InputAction RightStickClickPause = null;

		public static InputAction RightTriggerManual = null;

		public static InputAction RightGripBoost = null;

		public static InputAction LeftControllerTrickOne = null;

		public static InputAction LeftControllerTrickTwo = null;

		public static InputAction LeftControllerTrickThree = null;

		public static InputAction LeftTriggerInteract = null;

		public static InputAction LeftGripDance = null;

		private static List<string> BufferedInputs = new List<string>();

		private static CustomController? Controller;

		private static CustomControllerMap? GameplayMap;

		private static CustomControllerMap? UiMap;

		public static void Init()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Expected O, but got Unknown
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Expected O, but got Unknown
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Expected O, but got Unknown
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Expected O, but got Unknown
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Expected O, but got Unknown
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Expected O, but got Unknown
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Expected O, but got Unknown
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Expected O, but got Unknown
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Expected O, but got Unknown
			HMDLook = new InputAction("HMDLook", (InputActionType)0, "<XRHMD>/centerEyeRotation", (string)null, (string)null, "Quaternion");
			HMDMove = new InputAction("HMDMove", (InputActionType)0, "<XRHMD>/centerEyePosition", (string)null, (string)null, "Vector3");
			LeftControllerRotate = new InputAction("LeftControllerRotate", (InputActionType)0, "<XRController>{LeftHand}/deviceRotation", (string)null, (string)null, "Quaternion");
			LeftControllerMove = new InputAction("LeftControllerMove", (InputActionType)0, "<XRController>{LeftHand}/devicePosition", (string)null, (string)null, "Vector3");
			RightControllerRotate = new InputAction("RightControllerRotate", (InputActionType)0, "<XRController>{RightHand}/deviceRotation", (string)null, (string)null, "Quaternion");
			RightControllerMove = new InputAction("RightControllerMove", (InputActionType)0, "<XRController>{RightHand}/devicePosition", (string)null, (string)null, "Vector3");
			LeftStickMove = new InputAction("LeftStickMove", (InputActionType)0, "<XRController>{LeftHand}/primary2DAxis", (string)null, (string)null, "Vector2");
			RightContollerJump = new InputAction("RightContollerJump", (InputActionType)1, "<XRController>{RightHand}/primaryButton", (string)null, (string)null, (string)null);
			RightControllerSwitchStyle = new InputAction("RightControllerSwitchStyle", (InputActionType)1, "<XRController>{RightHand}/secondaryButton", (string)null, (string)null, (string)null);
			RightStickTurn = new InputAction("RightStickTurn", (InputActionType)0, "<XRController>{RightHand}/primary2DAxis", (string)null, (string)null, "Vector2");
			RightStickClickPause = new InputAction("RightStickClickPause", (InputActionType)1, "<XRController>{RightHand}/primary2DAxisClick", (string)null, (string)null, (string)null);
			RightTriggerManual = new InputAction("RightTriggerManual", (InputActionType)1, "<XRController>{RightHand}/triggerButton", (string)null, (string)null, (string)null);
			RightGripBoost = new InputAction("RightGripBoost", (InputActionType)1, "<XRController>{RightHand}/gripButton", (string)null, (string)null, (string)null);
			LeftControllerTrickOne = new InputAction("LeftControllerTrickOne", (InputActionType)1, "<XRController>{LeftHand}/primaryButton", (string)null, (string)null, (string)null);
			LeftControllerTrickTwo = new InputAction("LeftControllerTrickTwo", (InputActionType)1, "<XRController>{LeftHand}/secondaryButton", (string)null, (string)null, (string)null);
			LeftControllerTrickThree = new InputAction("LeftControllerTrickThree", (InputActionType)1, "<XRController>{LeftHand}/{Primary2DAxisClick}", (string)null, (string)null, (string)null);
			LeftTriggerInteract = new InputAction("LeftTriggerInteract", (InputActionType)1, "<XRController>{LeftHand}/triggerButton", (string)null, (string)null, (string)null);
			LeftGripDance = new InputAction("LeftGripDance", (InputActionType)1, "<XRController>{LeftHand}/gripButton", (string)null, (string)null, (string)null);
			HMDLook.Enable();
			HMDMove.Enable();
			LeftControllerRotate.Enable();
			LeftControllerMove.Enable();
			RightControllerRotate.Enable();
			RightControllerMove.Enable();
			LeftStickMove.Enable();
			RightContollerJump.Enable();
			RightControllerSwitchStyle.Enable();
			RightStickTurn.Enable();
			RightStickClickPause.Enable();
			RightTriggerManual.Enable();
			RightGripBoost.Enable();
			LeftControllerTrickOne.Enable();
			LeftControllerTrickTwo.Enable();
			LeftControllerTrickThree.Enable();
			LeftTriggerInteract.Enable();
			LeftGripDance.Enable();
			object obj = <>O.<0>__InitializeRewired;
			if (obj == null)
			{
				OnCoreInitializedHandler val = InitializeRewired;
				<>O.<0>__InitializeRewired = val;
				obj = (object)val;
			}
			Core.OnCoreInitialized += (OnCoreInitializedHandler)obj;
		}

		private static void InitializeRewired()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Expected O, but got Unknown
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Expected O, but got Unknown
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Expected O, but got Unknown
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Expected O, but got Unknown
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Expected O, but got Unknown
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Expected O, but got Unknown
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Expected O, but got Unknown
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Expected O, but got Unknown
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Expected O, but got Unknown
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Expected O, but got Unknown
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Expected O, but got Unknown
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Expected O, but got Unknown
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Expected O, but got Unknown
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Expected O, but got Unknown
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Expected O, but got Unknown
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Expected O, but got Unknown
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: Expected O, but got Unknown
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Expected O, but got Unknown
			//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Expected O, but got Unknown
			//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Expected O, but got Unknown
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Expected O, but got Unknown
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			ControllerElementIdentifier[] obj = new ControllerElementIdentifier[12]
			{
				new ControllerElementIdentifier(0, "MoveX", "MoveX +", "MoveX -", (ControllerElementType)0, false),
				new ControllerElementIdentifier(1, "MoveY", "MoveY +", "MoveY -", (ControllerElementType)0, false),
				new ControllerElementIdentifier(2, "Jump", "", "", (ControllerElementType)1, false),
				new ControllerElementIdentifier(3, "SwitchStyle", "", "", (ControllerElementType)1, false),
				new ControllerElementIdentifier(4, "Manual", "", "", (ControllerElementType)1, false),
				new ControllerElementIdentifier(5, "Boost", "", "", (ControllerElementType)1, false),
				new ControllerElementIdentifier(6, "TrickOne", "", "", (ControllerElementType)1, false),
				new ControllerElementIdentifier(7, "TrickTwo", "", "", (ControllerElementType)1, false),
				new ControllerElementIdentifier(8, "TrickThree", "", "", (ControllerElementType)1, false),
				new ControllerElementIdentifier(13, "Pause", "", "", (ControllerElementType)1, false),
				new ControllerElementIdentifier(14, "Interact", "", "", (ControllerElementType)1, false),
				new ControllerElementIdentifier(15, "Dance", "", "", (ControllerElementType)1, false)
			};
			ReInput.UserData.AddCustomController();
			CustomController_Editor val = ReInput.UserData.customControllers.Last();
			ControllerElementIdentifier[] array = (ControllerElementIdentifier[])(object)obj;
			foreach (ControllerElementIdentifier val2 in array)
			{
				if ((int)val2._elementType == 0)
				{
					val.AddAxis();
					val.elementIdentifiers.RemoveAt(val.elementIdentifiers.Count - 1);
					val.elementIdentifiers.Add(val2);
					Axis val3 = val.axes.Last();
					((Element)val3).name = val2.name;
					((Element)val3).elementIdentifierId = val2.id;
					val3.deadZone = 0.1f;
					val3.zero = 0f;
					val3.min = -1f;
					val3.max = 1f;
					val3.invert = false;
					val3.axisInfo = new HardwareAxisInfo((AxisCoordinateMode)0, false, 0f, (SpecialAxisType)0);
					val3.range = (AxisRange)0;
					Plugin.Log.LogDebug((object)$"Setting axis {((Element)val3).name} to {((Element)val3).elementIdentifierId}");
				}
				else
				{
					val.AddButton();
					val.elementIdentifiers.RemoveAt(val.elementIdentifiers.Count - 1);
					val.elementIdentifiers.Add(val2);
					Button val4 = val.buttons.Last();
					((Element)val4).name = val2.name;
					((Element)val4).elementIdentifierId = val2.id;
					Plugin.Log.LogDebug((object)$"Setting button {((Element)val4).name} to {((Element)val4).elementIdentifierId}");
				}
			}
			Controller = ReInput.controllers.CreateCustomController(val.id);
			((Controller)Controller).wGgzJPAruijyWwzjSeYanYjpSomv("Sega PlayStation");
			GameplayMap = BuildMap("Gameplay", 0, (ActionElementMap[])(object)new ActionElementMap[12]
			{
				new ActionElementMap(5, (ControllerElementType)0, 0, (Pole)0, (AxisRange)0),
				new ActionElementMap(6, (ControllerElementType)0, 1, (Pole)0, (AxisRange)0),
				new ActionElementMap(7, (ControllerElementType)1, 2),
				new ActionElementMap(11, (ControllerElementType)1, 3),
				new ActionElementMap(8, (ControllerElementType)1, 4),
				new ActionElementMap(18, (ControllerElementType)1, 5),
				new ActionElementMap(15, (ControllerElementType)1, 6),
				new ActionElementMap(12, (ControllerElementType)1, 7),
				new ActionElementMap(65, (ControllerElementType)1, 8),
				new ActionElementMap(4, (ControllerElementType)1, 13),
				new ActionElementMap(10, (ControllerElementType)1, 14),
				new ActionElementMap(17, (ControllerElementType)1, 15)
			});
			UiMap = BuildMap("UI", 1, (ActionElementMap[])(object)new ActionElementMap[4]
			{
				new ActionElementMap(0, (ControllerElementType)0, 0, (Pole)0, (AxisRange)0),
				new ActionElementMap(1, (ControllerElementType)0, 1, (Pole)0, (AxisRange)0),
				new ActionElementMap(2, (ControllerElementType)1, 2),
				new ActionElementMap(3, (ControllerElementType)1, 3)
			});
			ReInput.InputSourceUpdateEvent += UpdateRewiredInput;
		}

		private static void UpdateRewiredInput()
		{
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			Controller.SetButtonValueById(2, FetchBuffer(RightContollerJump));
			Controller.SetButtonValueById(3, FetchBuffer(RightControllerSwitchStyle));
			Controller.SetButtonValueById(4, FetchBuffer(RightTriggerManual));
			Controller.SetButtonValueById(5, FetchBuffer(RightGripBoost));
			Controller.SetButtonValueById(6, FetchBuffer(LeftControllerTrickOne));
			Controller.SetButtonValueById(7, FetchBuffer(LeftControllerTrickTwo));
			Controller.SetButtonValueById(8, FetchBuffer(LeftControllerTrickThree));
			Controller.SetButtonValueById(14, FetchBuffer(LeftTriggerInteract));
			Controller.SetButtonValueById(15, FetchBuffer(LeftGripDance));
			Vector2 val = LeftStickMove.ReadValue<Vector2>();
			Controller.SetAxisValueById(0, val.x);
			Controller.SetAxisValueById(1, val.y);
			Controller.SetButtonValueById(13, RightStickClickPause.triggered);
		}

		private static CustomControllerMap BuildMap(string name, int category, ActionElementMap[] maps)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			ReInput.UserData.CreateCustomControllerMap(category, ((Controller)Controller).id, 0);
			ControllerMap_Editor val = ReInput.UserData.customControllerMaps.Last();
			val.name = name;
			foreach (ActionElementMap val2 in maps)
			{
				val.AddActionElementMap();
				ActionElementMap actionElementMap = val.GetActionElementMap(val.actionElementMaps.Count - 1);
				actionElementMap.actionId = val2.actionId;
				actionElementMap.wMLuAtALYahUqbpkWgPVSPwPblZL(val2.elementType);
				actionElementMap.elementIdentifierId = val2.elementIdentifierId;
				actionElementMap.axisContribution = val2.axisContribution;
				if ((int)actionElementMap.elementType == 0)
				{
					actionElementMap.axisRange = val2.axisRange;
				}
				actionElementMap.invert = val2.invert;
				Plugin.Log.LogDebug((object)$"Setting action {actionElementMap.actionId} to {actionElementMap.elementIdentifierId}");
			}
			return ReInput.UserData.NZnDxVQLTylWuKontBsWrRhUJsyL(category, ((Controller)Controller).id, 0);
		}

		public static void Update()
		{
			if (!Plugin.CyberheadConfig.General.VrEnabled.Value)
			{
				return;
			}
			InputAction[] array = (InputAction[])(object)new InputAction[7] { RightContollerJump, RightControllerSwitchStyle, RightTriggerManual, RightGripBoost, LeftControllerTrickOne, LeftControllerTrickTwo, LeftControllerTrickThree };
			foreach (InputAction val in array)
			{
				if (val.triggered && !BufferedInputs.Contains(val.name))
				{
					BufferedInputs.Add(val.name);
				}
			}
			Core instance = Core.Instance;
			if (Controller == null || GameplayMap == null || UiMap == null || !((Object)(object)instance != (Object)null))
			{
				return;
			}
			Player firstRewiredPlayer = instance.GameInput.FirstRewiredPlayer;
			if (!firstRewiredPlayer.controllers.ContainsController((Controller)(object)Controller))
			{
				firstRewiredPlayer.controllers.AddController((Controller)(object)Controller, true);
				((Controller)Controller).enabled = true;
			}
			if (firstRewiredPlayer.controllers.maps.GetAllMaps((ControllerType)20).ToList().Count >= 2)
			{
				return;
			}
			CustomControllerMap[] array2 = (CustomControllerMap[])(object)new CustomControllerMap[2] { GameplayMap, UiMap };
			foreach (CustomControllerMap val2 in array2)
			{
				if (firstRewiredPlayer.controllers.maps.GetMap((ControllerType)20, ((Controller)Controller).id, ((ControllerMap)val2).categoryId, ((ControllerMap)val2).layoutId) == null)
				{
					firstRewiredPlayer.controllers.maps.AddMap((Controller)(object)Controller, (ControllerMap)(object)val2);
				}
				if (!((ControllerMap)val2).enabled)
				{
					((ControllerMap)val2).enabled = true;
				}
			}
		}

		public static bool FetchBuffer(InputAction action)
		{
			if (BufferedInputs.Contains(action.name))
			{
				BufferedInputs.Remove(action.name);
				return true;
			}
			return action.triggered;
		}
	}
	[BepInPlugin("Cyberhead", "Cyberhead", "1.0.2")]
	[BepInProcess("Bomb Rush Cyberfunk.exe")]
	public class Plugin : BaseUnityPlugin
	{
		public static ManualLogSource Log;

		public static Harmony Harmony;

		public static Config CyberheadConfig;

		public static GameObject? XRRig;

		public static SlopCrewSupport? SlopCrewSupport;

		public static RenderTexture CutsceneRenderTexture;

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony = new Harmony("Cyberhead");
			CyberheadConfig = new Config(((BaseUnityPlugin)this).Config);
			SlopCrewSupport = new SlopCrewSupport();
			Harmony.PatchAll();
			if (CyberheadConfig.General.VrEnabled.Value)
			{
				InputSystem.PerformDefaultPluginInitialization();
				ValveIndexControllerProfile val = ScriptableObject.CreateInstance<ValveIndexControllerProfile>();
				HPReverbG2ControllerProfile val2 = ScriptableObject.CreateInstance<HPReverbG2ControllerProfile>();
				HTCViveControllerProfile val3 = ScriptableObject.CreateInstance<HTCViveControllerProfile>();
				MicrosoftMotionControllerProfile val4 = ScriptableObject.CreateInstance<MicrosoftMotionControllerProfile>();
				KHRSimpleControllerProfile val5 = ScriptableObject.CreateInstance<KHRSimpleControllerProfile>();
				MetaQuestTouchProControllerProfile val6 = ScriptableObject.CreateInstance<MetaQuestTouchProControllerProfile>();
				OculusTouchControllerProfile val7 = ScriptableObject.CreateInstance<OculusTouchControllerProfile>();
				((OpenXRFeature)val).enabled = true;
				((OpenXRFeature)val2).enabled = true;
				((OpenXRFeature)val3).enabled = true;
				((OpenXRFeature)val4).enabled = true;
				((OpenXRFeature)val5).enabled = true;
				((OpenXRFeature)val6).enabled = true;
				((OpenXRFeature)val7).enabled = true;
				OpenXRSettings.Instance.features = (OpenXRFeature[])(object)new OpenXRFeature[7]
				{
					(OpenXRFeature)val,
					(OpenXRFeature)val2,
					(OpenXRFeature)val3,
					(OpenXRFeature)val4,
					(OpenXRFeature)val5,
					(OpenXRFeature)val6,
					(OpenXRFeature)val7
				};
				XRGeneralSettings obj = ScriptableObject.CreateInstance<XRGeneralSettings>();
				XRManagerSettings val8 = ScriptableObject.CreateInstance<XRManagerSettings>();
				OpenXRLoader item = ScriptableObject.CreateInstance<OpenXRLoader>();
				obj.Manager = val8;
				((List<XRLoader>)val8.activeLoaders).Clear();
				((List<XRLoader>)val8.activeLoaders).Add((XRLoader)(object)item);
				OpenXRSettings.Instance.renderMode = (RenderMode)0;
				OpenXRSettings.Instance.depthSubmissionMode = (DepthSubmissionMode)0;
				obj.InitXRSDK();
				obj.Start();
				Inputs.Init();
				CutsceneRenderTexture = new RenderTexture(Screen.width, Screen.height, 24);
			}
		}

		private void LateUpdate()
		{
			Inputs.Update();
		}

		private void OnDestroy()
		{
			Harmony.UnpatchSelf();
			SlopCrewSupport?.Dispose();
		}
	}
	public class SlopCrewSupport : IDisposable
	{
		public class VrIkPacket
		{
			public Vector3 LeftHandPos = Vector3.zero;

			public Quaternion LeftHandRot = Quaternion.identity;

			public Vector3 RightHandPos = Vector3.zero;

			public Quaternion RightHandRot = Quaternion.identity;

			public void Read(BinaryReader reader)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				LeftHandPos = ReadVector3(reader);
				LeftHandRot = ReadQuaternion(reader);
				RightHandPos = ReadVector3(reader);
				RightHandRot = ReadQuaternion(reader);
			}

			public void Write(BinaryWriter writer)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				WriteVector3(writer, LeftHandPos);
				WriteQuaternion(writer, LeftHandRot);
				WriteVector3(writer, RightHandPos);
				WriteQuaternion(writer, RightHandRot);
			}

			private static Vector3 ReadVector3(BinaryReader reader)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				float num = reader.ReadSingle();
				float num2 = reader.ReadSingle();
				float num3 = reader.ReadSingle();
				return new Vector3(num, num2, num3);
			}

			private static void WriteVector3(BinaryWriter writer, Vector3 vec)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(vec.x);
				writer.Write(vec.y);
				writer.Write(vec.z);
			}

			private static Quaternion ReadQuaternion(BinaryReader reader)
			{
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				float num = reader.ReadSingle();
				float num2 = reader.ReadSingle();
				float num3 = reader.ReadSingle();
				float num4 = reader.ReadSingle();
				return new Quaternion(num, num2, num3, num4);
			}

			private static void WriteQuaternion(BinaryWriter writer, Quaternion quat)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(quat.x);
				writer.Write(quat.y);
				writer.Write(quat.z);
				writer.Write(quat.w);
			}
		}

		private ISlopCrewAPI? api;

		private Timer? timer;

		public SlopCrewSupport()
		{
			ISlopCrewAPI aPI = APIManager.API;
			if (aPI != null)
			{
				InitApi(aPI);
			}
			else
			{
				APIManager.OnAPIRegistered += InitApi;
			}
		}

		private void InitApi(ISlopCrewAPI api)
		{
			this.api = api;
			this.api.OnCustomPacketReceived += OnCustomPacketReceived;
			timer = new Timer(100.0);
			timer.Elapsed += SendVrIkPacket;
			timer.Start();
		}

		public void Dispose()
		{
			if (api != null)
			{
				api.OnCustomPacketReceived -= OnCustomPacketReceived;
			}
			timer?.Stop();
			timer?.Dispose();
		}

		private void SendVrIkPacket(object? sender, ElapsedEventArgs e)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.XRRig == null)
			{
				return;
			}
			Transform val = Plugin.XRRig.transform.Find("CameraOffset/XR Hand L/IK");
			Transform val2 = Plugin.XRRig.transform.Find("CameraOffset/XR Hand R/IK");
			VrIkPacket vrIkPacket = new VrIkPacket
			{
				LeftHandPos = val.position,
				LeftHandRot = val.rotation,
				RightHandPos = val2.position,
				RightHandRot = val2.rotation
			};
			using MemoryStream memoryStream = new MemoryStream();
			using BinaryWriter writer = new BinaryWriter(memoryStream);
			vrIkPacket.Write(writer);
			ISlopCrewAPI? obj = api;
			if (obj != null)
			{
				obj.SendCustomPacket("Cyberhead.VrIK", memoryStream.ToArray());
			}
		}

		private void OnCustomPacketReceived(uint player, string id, byte[] data)
		{
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			if (id != "Cyberhead.VrIK")
			{
				return;
			}
			using MemoryStream input = new MemoryStream(data);
			using BinaryReader reader = new BinaryReader(input);
			VrIkPacket vrIkPacket = new VrIkPacket();
			try
			{
				vrIkPacket.Read(reader);
			}
			catch
			{
				return;
			}
			ISlopCrewAPI? obj2 = api;
			string text = ((obj2 != null) ? obj2.GetGameObjectPathForPlayerID(player) : null);
			if (text == null)
			{
				return;
			}
			GameObject val = GameObject.Find(text);
			if (val != null)
			{
				Player component = val.GetComponent<Player>();
				_ = component.characterVisual.handL;
				_ = component.characterVisual.handR;
				Transform val2 = val.transform.Find("IKL");
				if ((Object)(object)val2 == (Object)null)
				{
					val2 = new GameObject("IKL").transform;
					val2.SetParent(val.transform, false);
					((Component)val2).gameObject.AddComponent<SlopCrewSynced>();
				}
				Transform val3 = val.transform.Find("IKR");
				if ((Object)(object)val3 == (Object)null)
				{
					val3 = new GameObject("IKR").transform;
					val3.SetParent(val.transform, false);
					((Component)val3).gameObject.AddComponent<SlopCrewSynced>();
				}
				if ((Object)(object)((Component)component.characterVisual.anim).gameObject.GetComponent<InverseKinematicsRelay>() == (Object)null)
				{
					((Component)component.characterVisual.anim).gameObject.AddComponent<InverseKinematicsRelay>();
				}
				component.characterVisual.handIKActiveL = true;
				component.characterVisual.handIKActiveR = true;
				component.characterVisual.handIKTargetL = val2;
				component.characterVisual.handIKTargetR = val3;
				SlopCrewSynced component2 = ((Component)val2).GetComponent<SlopCrewSynced>();
				component2.SyncedPosition = vrIkPacket.LeftHandPos;
				component2.SyncedRotation = vrIkPacket.LeftHandRot;
				SlopCrewSynced component3 = ((Component)val3).GetComponent<SlopCrewSynced>();
				component3.SyncedPosition = vrIkPacket.RightHandPos;
				component3.SyncedRotation = vrIkPacket.RightHandRot;
			}
		}
	}
	public class Utils
	{
		public const float HeadHeight = 1.6f;

		public static void CreateRig(Vector3 position, Quaternion rotation, Player? player)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Expected O, but got Unknown
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Expected O, but got Unknown
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Expected O, but got Unknown
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Plugin.XRRig != (Object)null)
			{
				Object.Destroy((Object)(object)Plugin.XRRig);
			}
			Plugin.XRRig = new GameObject("XROrigin");
			Plugin.XRRig.transform.position = position;
			Plugin.XRRig.transform.rotation = rotation;
			XROrigin val = Plugin.XRRig.AddComponent<XROrigin>();
			val.m_OriginBaseGameObject = Plugin.XRRig;
			GameObject val2 = new GameObject("CameraOffset");
			val2.transform.SetParent(Plugin.XRRig.transform, false);
			val.CameraFloorOffsetObject = val2;
			AlignHead(position, ((Object)(object)player != (Object)null) ? player.headTf.position : position);
			if ((Object)(object)player != (Object)null)
			{
				DeleteCharacterHead(player);
			}
			GameObject val3 = new GameObject("XR Camera");
			val3.transform.SetParent(val2.transform, false);
			val3.AddComponent<XRCamera>();
			((Behaviour)((Component)((Component)Core.Instance.UIManager).transform.Find("UICamera")).GetComponent<Camera>()).enabled = false;
			GameObject val4 = new GameObject("XR Hand L");
			val4.transform.SetParent(val2.transform, false);
			GameObject val5 = new GameObject("XR Hand R");
			val5.transform.SetParent(val2.transform, false);
			GameObject val6 = new GameObject("IK");
			val6.transform.SetParent(val4.transform, false);
			val6.transform.localRotation = Quaternion.Euler(0f, 0f, 90f);
			GameObject val7 = new GameObject("IK");
			val7.transform.SetParent(val5.transform, false);
			val7.transform.localRotation = Quaternion.Euler(0f, 0f, -90f);
			val4.AddComponent<XRHand>().Init(isLeft: true);
			val5.AddComponent<XRHand>().Init(isLeft: false);
			if ((Object)(object)player != (Object)null)
			{
				player.characterVisual.handIKActiveL = true;
				player.characterVisual.handIKActiveR = true;
				player.characterVisual.handIKTargetL = val6.transform;
				player.characterVisual.handIKTargetR = val7.transform;
			}
			LocomotionSystem val8 = Plugin.XRRig.AddComponent<LocomotionSystem>();
			val8.xrOrigin = val;
			ActionBasedSnapTurnProvider obj = Plugin.XRRig.AddComponent<ActionBasedSnapTurnProvider>();
			((LocomotionProvider)obj).system = val8;
			((SnapTurnProviderBase)obj).turnAmount = 45f;
			((SnapTurnProviderBase)obj).debounceTime = 0.25f;
			((SnapTurnProviderBase)obj).enableTurnLeftRight = true;
			((SnapTurnProviderBase)obj).enableTurnAround = false;
			obj.rightHandSnapTurnAction = new InputActionProperty(Inputs.RightStickTurn);
			GameObject val9 = new GameObject("XR HUD");
			val9.transform.SetParent(val3.transform, false);
			val9.transform.localPosition = new Vector3(0f, 0f, 2f);
			Plugin.XRRig.transform.SetAsFirstSibling();
			((Component)((Component)Core.Instance.UIManager.gameplay).transform.parent).gameObject.AddComponent<XRHud>();
		}

		public static void DeleteCharacterHead(Player player)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			player.headTf.localScale = Vector3.zero;
		}

		public static void AlignHead(Vector3 position, Vector3 headPosition)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)Plugin.XRRig == (Object)null))
			{
				XROrigin component = Plugin.XRRig.GetComponent<XROrigin>();
				component.CameraYOffset = headPosition.y - position.y;
				component.CameraFloorOffsetObject.transform.localPosition = new Vector3(0f, 0f - component.CameraYOffset, 0f);
			}
		}

		public static void ApplyIk(CharacterVisual characterVisual)
		{
			Transform parent = ((Component)characterVisual).gameObject.transform.parent;
			if ((Object)(object)parent == (Object)null)
			{
				return;
			}
			parent = parent.parent;
			if (!((Object)(object)parent == (Object)null))
			{
				if ((Object)(object)Plugin.XRRig != (Object)null && !((Component)parent).GetComponent<Player>().isAI)
				{
					characterVisual.handIKTargetL = Plugin.XRRig.transform.Find("CameraOffset/XR Hand L/IK");
					characterVisual.handIKTargetR = Plugin.XRRig.transform.Find("CameraOffset/XR Hand R/IK");
					characterVisual.handIKActiveL = true;
					characterVisual.handIKActiveR = true;
				}
				else if ((Object)(object)parent.Find("IKL") != (Object)null)
				{
					characterVisual.handIKTargetL = parent.Find("IKL");
					characterVisual.handIKTargetR = parent.Find("IKR");
					characterVisual.handIKActiveL = true;
					characterVisual.handIKActiveR = true;
				}
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Cyberhead";

		public const string PLUGIN_NAME = "Cyberhead";

		public const string PLUGIN_VERSION = "1.0.2";
	}
}
namespace Cyberhead.Patches
{
	[HarmonyPatch(typeof(CharacterVisual))]
	public static class CharacterVisualPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("SetBoostpackEffect")]
		public static bool SetBoostpackEffect(CharacterVisual __instance, BoostpackEffectMode set, float overrideScale = -1f)
		{
			if (!Plugin.CyberheadConfig.General.VrEnabled.Value)
			{
				return true;
			}
			Transform parent = ((Component)__instance).transform.parent;
			if ((Object)(object)parent == (Object)null)
			{
				return true;
			}
			parent = parent.parent;
			if ((Object)(object)parent == (Object)null)
			{
				return true;
			}
			WorldHandler instance = WorldHandler.instance;
			if ((Object)(object)instance == (Object)null)
			{
				return true;
			}
			Player currentPlayer = instance.GetCurrentPlayer();
			if ((Object)(object)currentPlayer == (Object)null)
			{
				return true;
			}
			if ((Object)(object)((Component)parent).gameObject == (Object)(object)((Component)currentPlayer).gameObject)
			{
				__instance.VFX.boostpackEffect.SetActive(false);
				__instance.VFX.boostpackBlueEffect.SetActive(false);
				__instance.VFX.boostpackTrail.SetActive(false);
				return false;
			}
			return true;
		}

		[HarmonyPostfix]
		[HarmonyPatch("SetMoveStyleVisualAnim")]
		public static void SetMoveStyleVisualAnim(CharacterVisual __instance, Player player, MoveStyle setMoveStyle, GameObject specialSkateboard = null)
		{
			Utils.ApplyIk(__instance);
		}

		[HarmonyPostfix]
		[HarmonyPatch("SetPhone")]
		public static void SetPhone(CharacterVisual __instance, bool set)
		{
			Utils.ApplyIk(__instance);
		}

		[HarmonyPostfix]
		[HarmonyPatch("SetSpraycan")]
		public static void SetSpraycan(CharacterVisual __instance, bool set, Characters c = -1)
		{
			Utils.ApplyIk(__instance);
		}
	}
	[HarmonyPatch(typeof(GameInput))]
	public class GameInputPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("IsPlayerControllerJoystick")]
		public static void IsPlayerControllerJoystick(ref bool __result, int playerId = 0)
		{
			if (Plugin.CyberheadConfig.General.VrEnabled.Value)
			{
				__result = true;
			}
		}
	}
	[HarmonyPatch(typeof(GameplayCamera))]
	public class GameplayCameraPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("UpdateCamera")]
		public static bool UpdateCamera(GameplayCamera __instance)
		{
			if (!Plugin.CyberheadConfig.General.VrEnabled.Value)
			{
				return true;
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(Player))]
	public class PlayerPatch
	{
		[HarmonyPatch("Init")]
		[HarmonyPostfix]
		public static void Init(Player __instance, CharacterConstructor characterConstructor, Characters setCharacter = -1, int setOutfit = 0, PlayerType setPlayerType = 0, MoveStyle setMoveStyleEquipped = 0, Crew setCrew = 1)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.CyberheadConfig.General.VrEnabled.Value && !__instance.isAI)
			{
				Utils.CreateRig(((Component)__instance).transform.position, ((Component)__instance).transform.rotation, __instance);
				Utils.DeleteCharacterHead(__instance);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("SetCharacter")]
		public static void SetCharacter(Player __instance, Characters setChar, int setOutfit = 0)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.CyberheadConfig.General.VrEnabled.Value)
			{
				Utils.ApplyIk(__instance.characterVisual);
				if (!__instance.isAI)
				{
					Utils.AlignHead(((Component)__instance).transform.position, __instance.headTf.position);
					Utils.DeleteCharacterHead(__instance);
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("SetPosAndRotHard")]
		public static void SetPosAndRotHard(Player __instance, Vector3 pos, Quaternion rot)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (__instance.characterConstructor != null && !__instance.isAI && (Object)(object)Plugin.XRRig != (Object)null)
			{
				((Component)Plugin.XRRig.transform.Find("CameraOffset/XR Camera")).GetComponent<XRCamera>().MoveWithPlayer(pos);
			}
		}
	}
	[HarmonyPatch(typeof(PlayerPhoneCameras))]
	public class PlayerPhoneCamerasPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("Awake")]
		[HarmonyBefore(new string[] { "SlopCrew.Plugin.Harmony" })]
		public static bool Awake(PlayerPhoneCameras __instance)
		{
			if (!Plugin.CyberheadConfig.General.VrEnabled.Value)
			{
				return true;
			}
			Transform val = ((Component)__instance).transform.Find("rearCamera");
			if ((Object)(object)val != (Object)null)
			{
				Camera component = ((Component)val).GetComponent<Camera>();
				if ((Object)(object)component != (Object)null)
				{
					((Behaviour)component).enabled = false;
				}
			}
			Transform val2 = ((Component)__instance).transform.Find("frontCamera");
			if ((Object)(object)val2 != (Object)null)
			{
				Camera component2 = ((Component)val2).GetComponent<Camera>();
				if ((Object)(object)component2 != (Object)null)
				{
					((Behaviour)component2).enabled = false;
				}
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(RewiredMappingHandler))]
	public class RewiredMappingHandlerPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch("GetCurrentControllerActionElementId", new Type[]
		{
			typeof(int),
			typeof(ControllerType),
			typeof(int)
		})]
		public static bool GetCurrentControllerActionElementId(ref int __result, int actionId, ControllerType controllerType, int playerId = 0)
		{
			if (!Plugin.CyberheadConfig.General.VrEnabled.Value)
			{
				return true;
			}
			__result = 3;
			return false;
		}
	}
	[HarmonyPatch(typeof(XRDeviceDescriptor))]
	public class XRDeviceDescriptorPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("FromJson")]
		public static void FromJson(ref XRDeviceDescriptor __result, string json)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			if (!Plugin.CyberheadConfig.General.VrEnabled.Value)
			{
				return;
			}
			try
			{
				XRDeviceDescriptor val = JsonSerializer.Deserialize<XRDeviceDescriptor>(json, new JsonSerializerOptions
				{
					IncludeFields = true,
					PropertyNameCaseInsensitive = true
				});
				if (val != null)
				{
					__result.inputFeatures = val.inputFeatures;
				}
			}
			catch
			{
			}
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}

BepInEx\plugins\Cyberhead\Microsoft.Bcl.AsyncInterfaces.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("Microsoft.Bcl.AsyncInterfaces")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Provides the IAsyncEnumerable<T> and IAsyncDisposable interfaces and helper types for .NET Standard 2.0. This package is not required starting with .NET Standard 2.1 and .NET Core 3.0.\r\n\r\nCommonly Used Types:\r\nSystem.IAsyncDisposable\r\nSystem.Collections.Generic.IAsyncEnumerable\r\nSystem.Collections.Generic.IAsyncEnumerator")]
[assembly: AssemblyFileVersion("8.0.23.53103")]
[assembly: AssemblyInformationalVersion("8.0.0+5535e31a712343a63f5d7d796cd874e563e5ac14")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("Microsoft.Bcl.AsyncInterfaces")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: AssemblyVersion("8.0.0.0")]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace System
{
	public interface IAsyncDisposable
	{
		ValueTask DisposeAsync();
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Collections.Generic
{
	public interface IAsyncEnumerable<out T>
	{
		IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default(CancellationToken));
	}
	public interface IAsyncEnumerator<out T> : IAsyncDisposable
	{
		T Current { get; }

		ValueTask<bool> MoveNextAsync();
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.CompilerServices
{
	[StructLayout(LayoutKind.Auto)]
	public struct AsyncIteratorMethodBuilder
	{
		private AsyncTaskMethodBuilder _methodBuilder;

		private object _id;

		internal object ObjectIdForDebugger => _id ?? Interlocked.CompareExchange(ref _id, new object(), null) ?? _id;

		public static AsyncIteratorMethodBuilder Create()
		{
			AsyncIteratorMethodBuilder result = default(AsyncIteratorMethodBuilder);
			result._methodBuilder = AsyncTaskMethodBuilder.Create();
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void MoveNext<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine
		{
			_methodBuilder.Start(ref stateMachine);
		}

		public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine
		{
			_methodBuilder.AwaitOnCompleted(ref awaiter, ref stateMachine);
		}

		public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine
		{
			_methodBuilder.AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine);
		}

		public void Complete()
		{
			_methodBuilder.SetResult();
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)]
	public sealed class AsyncIteratorStateMachineAttribute : StateMachineAttribute
	{
		public AsyncIteratorStateMachineAttribute(Type stateMachineType)
			: base(stateMachineType)
		{
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public readonly struct ConfiguredAsyncDisposable
	{
		private readonly IAsyncDisposable _source;

		private readonly bool _continueOnCapturedContext;

		internal ConfiguredAsyncDisposable(IAsyncDisposable source, bool continueOnCapturedContext)
		{
			_source = source;
			_continueOnCapturedContext = continueOnCapturedContext;
		}

		public ConfiguredValueTaskAwaitable DisposeAsync()
		{
			return _source.DisposeAsync().ConfigureAwait(_continueOnCapturedContext);
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public readonly struct ConfiguredCancelableAsyncEnumerable<T>
	{
		[StructLayout(LayoutKind.Auto)]
		public readonly struct Enumerator
		{
			private readonly IAsyncEnumerator<T> _enumerator;

			private readonly bool _continueOnCapturedContext;

			public T Current => _enumerator.Current;

			internal Enumerator(IAsyncEnumerator<T> enumerator, bool continueOnCapturedContext)
			{
				_enumerator = enumerator;
				_continueOnCapturedContext = continueOnCapturedContext;
			}

			public ConfiguredValueTaskAwaitable<bool> MoveNextAsync()
			{
				return _enumerator.MoveNextAsync().ConfigureAwait(_continueOnCapturedContext);
			}

			public ConfiguredValueTaskAwaitable DisposeAsync()
			{
				return _enumerator.DisposeAsync().ConfigureAwait(_continueOnCapturedContext);
			}
		}

		private readonly IAsyncEnumerable<T> _enumerable;

		private readonly CancellationToken _cancellationToken;

		private readonly bool _continueOnCapturedContext;

		internal ConfiguredCancelableAsyncEnumerable(IAsyncEnumerable<T> enumerable, bool continueOnCapturedContext, CancellationToken cancellationToken)
		{
			_enumerable = enumerable;
			_continueOnCapturedContext = continueOnCapturedContext;
			_cancellationToken = cancellationToken;
		}

		public ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait(bool continueOnCapturedContext)
		{
			return new ConfiguredCancelableAsyncEnumerable<T>(_enumerable, continueOnCapturedContext, _cancellationToken);
		}

		public ConfiguredCancelableAsyncEnumerable<T> WithCancellation(CancellationToken cancellationToken)
		{
			return new ConfiguredCancelableAsyncEnumerable<T>(_enumerable, _continueOnCapturedContext, cancellationToken);
		}

		public Enumerator GetAsyncEnumerator()
		{
			return new Enumerator(_enumerable.GetAsyncEnumerator(_cancellationToken), _continueOnCapturedContext);
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	public sealed class EnumeratorCancellationAttribute : Attribute
	{
	}
}
namespace System.Threading.Tasks
{
	public static class TaskAsyncEnumerableExtensions
	{
		public static ConfiguredAsyncDisposable ConfigureAwait(this IAsyncDisposable source, bool continueOnCapturedContext)
		{
			return new ConfiguredAsyncDisposable(source, continueOnCapturedContext);
		}

		public static ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait<T>(this IAsyncEnumerable<T> source, bool continueOnCapturedContext)
		{
			return new ConfiguredCancelableAsyncEnumerable<T>(source, continueOnCapturedContext, default(CancellationToken));
		}

		public static ConfiguredCancelableAsyncEnumerable<T> WithCancellation<T>(this IAsyncEnumerable<T> source, CancellationToken cancellationToken)
		{
			return new ConfiguredCancelableAsyncEnumerable<T>(source, continueOnCapturedContext: true, cancellationToken);
		}
	}
}
namespace System.Threading.Tasks.Sources
{
	[StructLayout(LayoutKind.Auto)]
	public struct ManualResetValueTaskSourceCore<TResult>
	{
		private Action<object> _continuation;

		private object _continuationState;

		private ExecutionContext _executionContext;

		private object _capturedContext;

		private bool _completed;

		private TResult _result;

		private ExceptionDispatchInfo _error;

		private short _version;

		public bool RunContinuationsAsynchronously { get; set; }

		public short Version => _version;

		public void Reset()
		{
			_version++;
			_completed = false;
			_result = default(TResult);
			_error = null;
			_executionContext = null;
			_capturedContext = null;
			_continuation = null;
			_continuationState = null;
		}

		public void SetResult(TResult result)
		{
			_result = result;
			SignalCompletion();
		}

		public void SetException(Exception error)
		{
			_error = ExceptionDispatchInfo.Capture(error);
			SignalCompletion();
		}

		public ValueTaskSourceStatus GetStatus(short token)
		{
			ValidateToken(token);
			if (_continuation != null && _completed)
			{
				if (_error != null)
				{
					if (!(_error.SourceException is OperationCanceledException))
					{
						return ValueTaskSourceStatus.Faulted;
					}
					return ValueTaskSourceStatus.Canceled;
				}
				return ValueTaskSourceStatus.Succeeded;
			}
			return ValueTaskSourceStatus.Pending;
		}

		public TResult GetResult(short token)
		{
			ValidateToken(token);
			if (!_completed)
			{
				throw new InvalidOperationException();
			}
			_error?.Throw();
			return _result;
		}

		public void OnCompleted(Action<object?> continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags)
		{
			if (continuation == null)
			{
				throw new ArgumentNullException("continuation");
			}
			ValidateToken(token);
			if ((flags & ValueTaskSourceOnCompletedFlags.FlowExecutionContext) != 0)
			{
				_executionContext = ExecutionContext.Capture();
			}
			if ((flags & ValueTaskSourceOnCompletedFlags.UseSchedulingContext) != 0)
			{
				SynchronizationContext current = SynchronizationContext.Current;
				if (current != null && current.GetType() != typeof(SynchronizationContext))
				{
					_capturedContext = current;
				}
				else
				{
					TaskScheduler current2 = TaskScheduler.Current;
					if (current2 != TaskScheduler.Default)
					{
						_capturedContext = current2;
					}
				}
			}
			object obj = _continuation;
			if (obj == null)
			{
				_continuationState = state;
				obj = Interlocked.CompareExchange(ref _continuation, continuation, null);
			}
			if (obj == null)
			{
				return;
			}
			if (obj != System.Threading.Tasks.Sources.ManualResetValueTaskSourceCoreShared.s_sentinel)
			{
				throw new InvalidOperationException();
			}
			object capturedContext = _capturedContext;
			if (capturedContext != null)
			{
				if (!(capturedContext is SynchronizationContext synchronizationContext))
				{
					if (capturedContext is TaskScheduler scheduler)
					{
						Task.Factory.StartNew(continuation, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, scheduler);
					}
				}
				else
				{
					synchronizationContext.Post(delegate(object s)
					{
						Tuple<Action<object>, object> tuple = (Tuple<Action<object>, object>)s;
						tuple.Item1(tuple.Item2);
					}, Tuple.Create(continuation, state));
				}
			}
			else
			{
				Task.Factory.StartNew(continuation, state, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
			}
		}

		private void ValidateToken(short token)
		{
			if (token != _version)
			{
				throw new InvalidOperationException();
			}
		}

		private void SignalCompletion()
		{
			if (_completed)
			{
				throw new InvalidOperationException();
			}
			_completed = true;
			if (_continuation == null && Interlocked.CompareExchange(ref _continuation, System.Threading.Tasks.Sources.ManualResetValueTaskSourceCoreShared.s_sentinel, null) == null)
			{
				return;
			}
			if (_executionContext != null)
			{
				ExecutionContext.Run(_executionContext, delegate(object s)
				{
					((ManualResetValueTaskSourceCore<TResult>)s).InvokeContinuation();
				}, this);
			}
			else
			{
				InvokeContinuation();
			}
		}

		private void InvokeContinuation()
		{
			object capturedContext = _capturedContext;
			if (capturedContext != null)
			{
				if (!(capturedContext is SynchronizationContext synchronizationContext))
				{
					if (capturedContext is TaskScheduler scheduler)
					{
						Task.Factory.StartNew(_continuation, _continuationState, CancellationToken.None, TaskCreationOptions.DenyChildAttach, scheduler);
					}
				}
				else
				{
					synchronizationContext.Post(delegate(object s)
					{
						Tuple<Action<object>, object> tuple = (Tuple<Action<object>, object>)s;
						tuple.Item1(tuple.Item2);
					}, Tuple.Create(_continuation, _continuationState));
				}
			}
			else if (RunContinuationsAsynchronously)
			{
				Task.Factory.StartNew(_continuation, _continuationState, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
			}
			else
			{
				_continuation(_continuationState);
			}
		}
	}
	internal static class ManualResetValueTaskSourceCoreShared
	{
		internal static readonly Action<object> s_sentinel = CompletionSentinel;

		private static void CompletionSentinel(object _)
		{
			throw new InvalidOperationException();
		}
	}
}

BepInEx\plugins\Cyberhead\SlopCrew.API.dll

Decompiled a year ago
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyCompany("SlopCrew.API")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.1.2.0")]
[assembly: AssemblyInformationalVersion("1.1.2+859891351b66c14542ecce0e999c11091faf689b")]
[assembly: AssemblyProduct("SlopCrew")]
[assembly: AssemblyTitle("SlopCrew.API")]
[assembly: AssemblyVersion("1.1.2.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace SlopCrew.API
{
	public class APIManager
	{
		public static ISlopCrewAPI? API;

		public static event Action<ISlopCrewAPI>? OnAPIRegistered;

		public static void RegisterAPI(ISlopCrewAPI api)
		{
			API = api;
			APIManager.OnAPIRegistered?.Invoke(api);
		}
	}
	public interface ISlopCrewAPI
	{
		string ServerAddress { get; }

		int PlayerCount { get; }

		bool Connected { get; }

		int? StageOverride { get; set; }

		string? PlayerName { get; }

		ReadOnlyCollection<uint>? Players { get; }

		event Action<int> OnPlayerCountChanged;

		event Action OnConnected;

		event Action OnDisconnected;

		event Action<uint, string, byte[]> OnCustomPacketReceived;

		event Action<uint, string, byte[]> OnCustomCharacterInfoReceived;

		string? GetGameObjectPathForPlayerID(uint playerId);

		uint? GetPlayerIDForGameObjectPath(string gameObjectPath);

		bool? PlayerIDExists(uint playerId);

		string? GetPlayerName(uint playerId);

		void SendCustomPacket(string id, byte[] data);

		void SetCustomCharacterInfo(string id, byte[]? data);
	}
}

BepInEx\plugins\Cyberhead\System.Buffers.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Diagnostics.Tracing;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using System.Threading;
using FxResources.System.Buffers;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyTitle("System.Buffers")]
[assembly: AssemblyDescription("System.Buffers")]
[assembly: AssemblyDefaultAlias("System.Buffers")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.6.28619.01")]
[assembly: AssemblyInformationalVersion("4.6.28619.01 @BuiltBy: dlab14-DDVSOWINAGE069 @Branch: release/2.1 @SrcCode: https://github.com/dotnet/corefx/tree/7601f4f6225089ffb291dc7d58293c7bbf5c5d4f")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("4.0.3.0")]
[module: UnverifiableCode]
namespace FxResources.System.Buffers
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class SR
	{
		private static ResourceManager s_resourceManager;

		private static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(ResourceType));

		internal static Type ResourceType { get; } = typeof(SR);


		internal static string ArgumentException_BufferNotFromPool => GetResourceString("ArgumentException_BufferNotFromPool", null);

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static bool UsingResourceKeys()
		{
			return false;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string text = null;
			try
			{
				text = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			if (defaultString != null && resourceKey.Equals(text, StringComparison.Ordinal))
			{
				return defaultString;
			}
			return text;
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}
	}
}
namespace System.Buffers
{
	public abstract class ArrayPool<T>
	{
		private static ArrayPool<T> s_sharedInstance;

		public static ArrayPool<T> Shared
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				return Volatile.Read(ref s_sharedInstance) ?? EnsureSharedCreated();
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static ArrayPool<T> EnsureSharedCreated()
		{
			Interlocked.CompareExchange(ref s_sharedInstance, Create(), null);
			return s_sharedInstance;
		}

		public static ArrayPool<T> Create()
		{
			return new DefaultArrayPool<T>();
		}

		public static ArrayPool<T> Create(int maxArrayLength, int maxArraysPerBucket)
		{
			return new DefaultArrayPool<T>(maxArrayLength, maxArraysPerBucket);
		}

		public abstract T[] Rent(int minimumLength);

		public abstract void Return(T[] array, bool clearArray = false);
	}
	[EventSource(Name = "System.Buffers.ArrayPoolEventSource")]
	internal sealed class ArrayPoolEventSource : EventSource
	{
		internal enum BufferAllocatedReason
		{
			Pooled,
			OverMaximumSize,
			PoolExhausted
		}

		internal static readonly System.Buffers.ArrayPoolEventSource Log = new System.Buffers.ArrayPoolEventSource();

		[Event(1, Level = EventLevel.Verbose)]
		internal unsafe void BufferRented(int bufferId, int bufferSize, int poolId, int bucketId)
		{
			EventData* ptr = stackalloc EventData[4];
			*ptr = new EventData
			{
				Size = 4,
				DataPointer = (IntPtr)(&bufferId)
			};
			ptr[1] = new EventData
			{
				Size = 4,
				DataPointer = (IntPtr)(&bufferSize)
			};
			ptr[2] = new EventData
			{
				Size = 4,
				DataPointer = (IntPtr)(&poolId)
			};
			ptr[3] = new EventData
			{
				Size = 4,
				DataPointer = (IntPtr)(&bucketId)
			};
			WriteEventCore(1, 4, ptr);
		}

		[Event(2, Level = EventLevel.Informational)]
		internal unsafe void BufferAllocated(int bufferId, int bufferSize, int poolId, int bucketId, BufferAllocatedReason reason)
		{
			EventData* ptr = stackalloc EventData[5];
			*ptr = new EventData
			{
				Size = 4,
				DataPointer = (IntPtr)(&bufferId)
			};
			ptr[1] = new EventData
			{
				Size = 4,
				DataPointer = (IntPtr)(&bufferSize)
			};
			ptr[2] = new EventData
			{
				Size = 4,
				DataPointer = (IntPtr)(&poolId)
			};
			ptr[3] = new EventData
			{
				Size = 4,
				DataPointer = (IntPtr)(&bucketId)
			};
			ptr[4] = new EventData
			{
				Size = 4,
				DataPointer = (IntPtr)(&reason)
			};
			WriteEventCore(2, 5, ptr);
		}

		[Event(3, Level = EventLevel.Verbose)]
		internal void BufferReturned(int bufferId, int bufferSize, int poolId)
		{
			WriteEvent(3, bufferId, bufferSize, poolId);
		}
	}
	internal sealed class DefaultArrayPool<T> : ArrayPool<T>
	{
		private sealed class Bucket
		{
			internal readonly int _bufferLength;

			private readonly T[][] _buffers;

			private readonly int _poolId;

			private SpinLock _lock;

			private int _index;

			internal int Id => GetHashCode();

			internal Bucket(int bufferLength, int numberOfBuffers, int poolId)
			{
				_lock = new SpinLock(Debugger.IsAttached);
				_buffers = new T[numberOfBuffers][];
				_bufferLength = bufferLength;
				_poolId = poolId;
			}

			internal T[] Rent()
			{
				T[][] buffers = _buffers;
				T[] array = null;
				bool lockTaken = false;
				bool flag = false;
				try
				{
					_lock.Enter(ref lockTaken);
					if (_index < buffers.Length)
					{
						array = buffers[_index];
						buffers[_index++] = null;
						flag = array == null;
					}
				}
				finally
				{
					if (lockTaken)
					{
						_lock.Exit(useMemoryBarrier: false);
					}
				}
				if (flag)
				{
					array = new T[_bufferLength];
					System.Buffers.ArrayPoolEventSource log = System.Buffers.ArrayPoolEventSource.Log;
					if (log.IsEnabled())
					{
						log.BufferAllocated(array.GetHashCode(), _bufferLength, _poolId, Id, System.Buffers.ArrayPoolEventSource.BufferAllocatedReason.Pooled);
					}
				}
				return array;
			}

			internal void Return(T[] array)
			{
				if (array.Length != _bufferLength)
				{
					throw new ArgumentException(System.SR.ArgumentException_BufferNotFromPool, "array");
				}
				bool lockTaken = false;
				try
				{
					_lock.Enter(ref lockTaken);
					if (_index != 0)
					{
						_buffers[--_index] = array;
					}
				}
				finally
				{
					if (lockTaken)
					{
						_lock.Exit(useMemoryBarrier: false);
					}
				}
			}
		}

		private const int DefaultMaxArrayLength = 1048576;

		private const int DefaultMaxNumberOfArraysPerBucket = 50;

		private static T[] s_emptyArray;

		private readonly Bucket[] _buckets;

		private int Id => GetHashCode();

		internal DefaultArrayPool()
			: this(1048576, 50)
		{
		}

		internal DefaultArrayPool(int maxArrayLength, int maxArraysPerBucket)
		{
			if (maxArrayLength <= 0)
			{
				throw new ArgumentOutOfRangeException("maxArrayLength");
			}
			if (maxArraysPerBucket <= 0)
			{
				throw new ArgumentOutOfRangeException("maxArraysPerBucket");
			}
			if (maxArrayLength > 1073741824)
			{
				maxArrayLength = 1073741824;
			}
			else if (maxArrayLength < 16)
			{
				maxArrayLength = 16;
			}
			int id = Id;
			int num = System.Buffers.Utilities.SelectBucketIndex(maxArrayLength);
			Bucket[] array = new Bucket[num + 1];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = new Bucket(System.Buffers.Utilities.GetMaxSizeForBucket(i), maxArraysPerBucket, id);
			}
			_buckets = array;
		}

		public override T[] Rent(int minimumLength)
		{
			if (minimumLength < 0)
			{
				throw new ArgumentOutOfRangeException("minimumLength");
			}
			if (minimumLength == 0)
			{
				return s_emptyArray ?? (s_emptyArray = new T[0]);
			}
			System.Buffers.ArrayPoolEventSource log = System.Buffers.ArrayPoolEventSource.Log;
			T[] array = null;
			int num = System.Buffers.Utilities.SelectBucketIndex(minimumLength);
			if (num < _buckets.Length)
			{
				int num2 = num;
				do
				{
					array = _buckets[num2].Rent();
					if (array != null)
					{
						if (log.IsEnabled())
						{
							log.BufferRented(array.GetHashCode(), array.Length, Id, _buckets[num2].Id);
						}
						return array;
					}
				}
				while (++num2 < _buckets.Length && num2 != num + 2);
				array = new T[_buckets[num]._bufferLength];
			}
			else
			{
				array = new T[minimumLength];
			}
			if (log.IsEnabled())
			{
				int hashCode = array.GetHashCode();
				int bucketId = -1;
				log.BufferRented(hashCode, array.Length, Id, bucketId);
				log.BufferAllocated(hashCode, array.Length, Id, bucketId, (num >= _buckets.Length) ? System.Buffers.ArrayPoolEventSource.BufferAllocatedReason.OverMaximumSize : System.Buffers.ArrayPoolEventSource.BufferAllocatedReason.PoolExhausted);
			}
			return array;
		}

		public override void Return(T[] array, bool clearArray = false)
		{
			if (array == null)
			{
				throw new ArgumentNullException("array");
			}
			if (array.Length == 0)
			{
				return;
			}
			int num = System.Buffers.Utilities.SelectBucketIndex(array.Length);
			if (num < _buckets.Length)
			{
				if (clearArray)
				{
					Array.Clear(array, 0, array.Length);
				}
				_buckets[num].Return(array);
			}
			System.Buffers.ArrayPoolEventSource log = System.Buffers.ArrayPoolEventSource.Log;
			if (log.IsEnabled())
			{
				log.BufferReturned(array.GetHashCode(), array.Length, Id);
			}
		}
	}
	internal static class Utilities
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static int SelectBucketIndex(int bufferSize)
		{
			uint num = (uint)(bufferSize - 1) >> 4;
			int num2 = 0;
			if (num > 65535)
			{
				num >>= 16;
				num2 = 16;
			}
			if (num > 255)
			{
				num >>= 8;
				num2 += 8;
			}
			if (num > 15)
			{
				num >>= 4;
				num2 += 4;
			}
			if (num > 3)
			{
				num >>= 2;
				num2 += 2;
			}
			if (num > 1)
			{
				num >>= 1;
				num2++;
			}
			return num2 + (int)num;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static int GetMaxSizeForBucket(int binIndex)
		{
			return 16 << binIndex;
		}
	}
}

BepInEx\plugins\Cyberhead\System.Memory.dll

Decompiled a year ago
using System;
using System.Buffers;
using System.Buffers.Binary;
using System.Buffers.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Numerics;
using System.Numerics.Hashing;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using FxResources.System.Memory;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyTitle("System.Memory")]
[assembly: AssemblyDescription("System.Memory")]
[assembly: AssemblyDefaultAlias("System.Memory")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.6.31308.01")]
[assembly: AssemblyInformationalVersion("4.6.31308.01 @BuiltBy: cloudtest-841353dfc000000 @Branch: release/2.1-MSRC @SrcCode: https://github.com/dotnet/corefx/tree/32b491939fbd125f304031c35038b1e14b4e3958")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("4.0.1.2")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsByRefLikeAttribute : Attribute
	{
	}
}
namespace FxResources.System.Memory
{
	internal static class SR
	{
	}
}
namespace System
{
	public readonly struct SequencePosition : IEquatable<SequencePosition>
	{
		private readonly object _object;

		private readonly int _integer;

		public SequencePosition(object @object, int integer)
		{
			_object = @object;
			_integer = integer;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public object GetObject()
		{
			return _object;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public int GetInteger()
		{
			return _integer;
		}

		public bool Equals(SequencePosition other)
		{
			if (_integer == other._integer)
			{
				return object.Equals(_object, other._object);
			}
			return false;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public override bool Equals(object obj)
		{
			if (obj is SequencePosition other)
			{
				return Equals(other);
			}
			return false;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public override int GetHashCode()
		{
			return HashHelpers.Combine(_object?.GetHashCode() ?? 0, _integer);
		}
	}
	internal static class ThrowHelper
	{
		internal static void ThrowArgumentNullException(System.ExceptionArgument argument)
		{
			throw CreateArgumentNullException(argument);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentNullException(System.ExceptionArgument argument)
		{
			return new ArgumentNullException(argument.ToString());
		}

		internal static void ThrowArrayTypeMismatchException()
		{
			throw CreateArrayTypeMismatchException();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArrayTypeMismatchException()
		{
			return new ArrayTypeMismatchException();
		}

		internal static void ThrowArgumentException_InvalidTypeWithPointersNotSupported(Type type)
		{
			throw CreateArgumentException_InvalidTypeWithPointersNotSupported(type);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentException_InvalidTypeWithPointersNotSupported(Type type)
		{
			return new ArgumentException(System.SR.Format(System.SR.Argument_InvalidTypeWithPointersNotSupported, type));
		}

		internal static void ThrowArgumentException_DestinationTooShort()
		{
			throw CreateArgumentException_DestinationTooShort();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentException_DestinationTooShort()
		{
			return new ArgumentException(System.SR.Argument_DestinationTooShort);
		}

		internal static void ThrowIndexOutOfRangeException()
		{
			throw CreateIndexOutOfRangeException();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateIndexOutOfRangeException()
		{
			return new IndexOutOfRangeException();
		}

		internal static void ThrowArgumentOutOfRangeException()
		{
			throw CreateArgumentOutOfRangeException();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentOutOfRangeException()
		{
			return new ArgumentOutOfRangeException();
		}

		internal static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument)
		{
			throw CreateArgumentOutOfRangeException(argument);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentOutOfRangeException(System.ExceptionArgument argument)
		{
			return new ArgumentOutOfRangeException(argument.ToString());
		}

		internal static void ThrowArgumentOutOfRangeException_PrecisionTooLarge()
		{
			throw CreateArgumentOutOfRangeException_PrecisionTooLarge();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentOutOfRangeException_PrecisionTooLarge()
		{
			return new ArgumentOutOfRangeException("precision", System.SR.Format(System.SR.Argument_PrecisionTooLarge, (byte)99));
		}

		internal static void ThrowArgumentOutOfRangeException_SymbolDoesNotFit()
		{
			throw CreateArgumentOutOfRangeException_SymbolDoesNotFit();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentOutOfRangeException_SymbolDoesNotFit()
		{
			return new ArgumentOutOfRangeException("symbol", System.SR.Argument_BadFormatSpecifier);
		}

		internal static void ThrowInvalidOperationException()
		{
			throw CreateInvalidOperationException();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateInvalidOperationException()
		{
			return new InvalidOperationException();
		}

		internal static void ThrowInvalidOperationException_OutstandingReferences()
		{
			throw CreateInvalidOperationException_OutstandingReferences();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateInvalidOperationException_OutstandingReferences()
		{
			return new InvalidOperationException(System.SR.OutstandingReferences);
		}

		internal static void ThrowInvalidOperationException_UnexpectedSegmentType()
		{
			throw CreateInvalidOperationException_UnexpectedSegmentType();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateInvalidOperationException_UnexpectedSegmentType()
		{
			return new InvalidOperationException(System.SR.UnexpectedSegmentType);
		}

		internal static void ThrowInvalidOperationException_EndPositionNotReached()
		{
			throw CreateInvalidOperationException_EndPositionNotReached();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateInvalidOperationException_EndPositionNotReached()
		{
			return new InvalidOperationException(System.SR.EndPositionNotReached);
		}

		internal static void ThrowArgumentOutOfRangeException_PositionOutOfRange()
		{
			throw CreateArgumentOutOfRangeException_PositionOutOfRange();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentOutOfRangeException_PositionOutOfRange()
		{
			return new ArgumentOutOfRangeException("position");
		}

		internal static void ThrowArgumentOutOfRangeException_OffsetOutOfRange()
		{
			throw CreateArgumentOutOfRangeException_OffsetOutOfRange();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentOutOfRangeException_OffsetOutOfRange()
		{
			return new ArgumentOutOfRangeException("offset");
		}

		internal static void ThrowObjectDisposedException_ArrayMemoryPoolBuffer()
		{
			throw CreateObjectDisposedException_ArrayMemoryPoolBuffer();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateObjectDisposedException_ArrayMemoryPoolBuffer()
		{
			return new ObjectDisposedException("ArrayMemoryPoolBuffer");
		}

		internal static void ThrowFormatException_BadFormatSpecifier()
		{
			throw CreateFormatException_BadFormatSpecifier();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateFormatException_BadFormatSpecifier()
		{
			return new FormatException(System.SR.Argument_BadFormatSpecifier);
		}

		internal static void ThrowArgumentException_OverlapAlignmentMismatch()
		{
			throw CreateArgumentException_OverlapAlignmentMismatch();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateArgumentException_OverlapAlignmentMismatch()
		{
			return new ArgumentException(System.SR.Argument_OverlapAlignmentMismatch);
		}

		internal static void ThrowNotSupportedException()
		{
			throw CreateThrowNotSupportedException();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static Exception CreateThrowNotSupportedException()
		{
			return new NotSupportedException();
		}

		public static bool TryFormatThrowFormatException(out int bytesWritten)
		{
			bytesWritten = 0;
			ThrowFormatException_BadFormatSpecifier();
			return false;
		}

		public static bool TryParseThrowFormatException<T>(out T value, out int bytesConsumed)
		{
			value = default(T);
			bytesConsumed = 0;
			ThrowFormatException_BadFormatSpecifier();
			return false;
		}

		public static void ThrowArgumentValidationException<T>(ReadOnlySequenceSegment<T> startSegment, int startIndex, ReadOnlySequenceSegment<T> endSegment)
		{
			throw CreateArgumentValidationException(startSegment, startIndex, endSegment);
		}

		private static Exception CreateArgumentValidationException<T>(ReadOnlySequenceSegment<T> startSegment, int startIndex, ReadOnlySequenceSegment<T> endSegment)
		{
			if (startSegment == null)
			{
				return CreateArgumentNullException(System.ExceptionArgument.startSegment);
			}
			if (endSegment == null)
			{
				return CreateArgumentNullException(System.ExceptionArgument.endSegment);
			}
			if (startSegment != endSegment && startSegment.RunningIndex > endSegment.RunningIndex)
			{
				return CreateArgumentOutOfRangeException(System.ExceptionArgument.endSegment);
			}
			if ((uint)startSegment.Memory.Length < (uint)startIndex)
			{
				return CreateArgumentOutOfRangeException(System.ExceptionArgument.startIndex);
			}
			return CreateArgumentOutOfRangeException(System.ExceptionArgument.endIndex);
		}

		public static void ThrowArgumentValidationException(Array array, int start)
		{
			throw CreateArgumentValidationException(array, start);
		}

		private static Exception CreateArgumentValidationException(Array array, int start)
		{
			if (array == null)
			{
				return CreateArgumentNullException(System.ExceptionArgument.array);
			}
			if ((uint)start > (uint)array.Length)
			{
				return CreateArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return CreateArgumentOutOfRangeException(System.ExceptionArgument.length);
		}

		public static void ThrowStartOrEndArgumentValidationException(long start)
		{
			throw CreateStartOrEndArgumentValidationException(start);
		}

		private static Exception CreateStartOrEndArgumentValidationException(long start)
		{
			if (start < 0)
			{
				return CreateArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return CreateArgumentOutOfRangeException(System.ExceptionArgument.length);
		}
	}
	internal enum ExceptionArgument
	{
		length,
		start,
		minimumBufferSize,
		elementIndex,
		comparable,
		comparer,
		destination,
		offset,
		startSegment,
		endSegment,
		startIndex,
		endIndex,
		array,
		culture,
		manager
	}
	internal static class DecimalDecCalc
	{
		private static uint D32DivMod1E9(uint hi32, ref uint lo32)
		{
			ulong num = ((ulong)hi32 << 32) | lo32;
			lo32 = (uint)(num / 1000000000);
			return (uint)(num % 1000000000);
		}

		internal static uint DecDivMod1E9(ref MutableDecimal value)
		{
			return D32DivMod1E9(D32DivMod1E9(D32DivMod1E9(0u, ref value.High), ref value.Mid), ref value.Low);
		}

		internal static void DecAddInt32(ref MutableDecimal value, uint i)
		{
			if (D32AddCarry(ref value.Low, i) && D32AddCarry(ref value.Mid, 1u))
			{
				D32AddCarry(ref value.High, 1u);
			}
		}

		private static bool D32AddCarry(ref uint value, uint i)
		{
			uint num = value;
			uint num2 = (value = num + i);
			if (num2 >= num)
			{
				return num2 < i;
			}
			return true;
		}

		internal static void DecMul10(ref MutableDecimal value)
		{
			MutableDecimal d = value;
			DecShiftLeft(ref value);
			DecShiftLeft(ref value);
			DecAdd(ref value, d);
			DecShiftLeft(ref value);
		}

		private static void DecShiftLeft(ref MutableDecimal value)
		{
			uint num = (((value.Low & 0x80000000u) != 0) ? 1u : 0u);
			uint num2 = (((value.Mid & 0x80000000u) != 0) ? 1u : 0u);
			value.Low <<= 1;
			value.Mid = (value.Mid << 1) | num;
			value.High = (value.High << 1) | num2;
		}

		private static void DecAdd(ref MutableDecimal value, MutableDecimal d)
		{
			if (D32AddCarry(ref value.Low, d.Low) && D32AddCarry(ref value.Mid, 1u))
			{
				D32AddCarry(ref value.High, 1u);
			}
			if (D32AddCarry(ref value.Mid, d.Mid))
			{
				D32AddCarry(ref value.High, 1u);
			}
			D32AddCarry(ref value.High, d.High);
		}
	}
	internal static class Number
	{
		private static class DoubleHelper
		{
			public unsafe static uint Exponent(double d)
			{
				return (*(uint*)((byte*)(&d) + 4) >> 20) & 0x7FFu;
			}

			public unsafe static ulong Mantissa(double d)
			{
				return *(uint*)(&d) | ((ulong)(uint)(*(int*)((byte*)(&d) + 4) & 0xFFFFF) << 32);
			}

			public unsafe static bool Sign(double d)
			{
				return *(uint*)((byte*)(&d) + 4) >> 31 != 0;
			}
		}

		internal const int DECIMAL_PRECISION = 29;

		private static readonly ulong[] s_rgval64Power10 = new ulong[30]
		{
			11529215046068469760uL, 14411518807585587200uL, 18014398509481984000uL, 11258999068426240000uL, 14073748835532800000uL, 17592186044416000000uL, 10995116277760000000uL, 13743895347200000000uL, 17179869184000000000uL, 10737418240000000000uL,
			13421772800000000000uL, 16777216000000000000uL, 10485760000000000000uL, 13107200000000000000uL, 16384000000000000000uL, 14757395258967641293uL, 11805916207174113035uL, 9444732965739290428uL, 15111572745182864686uL, 12089258196146291749uL,
			9671406556917033399uL, 15474250491067253438uL, 12379400392853802751uL, 9903520314283042201uL, 15845632502852867522uL, 12676506002282294018uL, 10141204801825835215uL, 16225927682921336344uL, 12980742146337069075uL, 10384593717069655260uL
		};

		private static readonly sbyte[] s_rgexp64Power10 = new sbyte[15]
		{
			4, 7, 10, 14, 17, 20, 24, 27, 30, 34,
			37, 40, 44, 47, 50
		};

		private static readonly ulong[] s_rgval64Power10By16 = new ulong[42]
		{
			10240000000000000000uL, 11368683772161602974uL, 12621774483536188886uL, 14012984643248170708uL, 15557538194652854266uL, 17272337110188889248uL, 9588073174409622172uL, 10644899600020376798uL, 11818212630765741798uL, 13120851772591970216uL,
			14567071740625403792uL, 16172698447808779622uL, 17955302187076837696uL, 9967194951097567532uL, 11065809325636130658uL, 12285516299433008778uL, 13639663065038175358uL, 15143067982934716296uL, 16812182738118149112uL, 9332636185032188787uL,
			10361307573072618722uL, 16615349947311448416uL, 14965776766268445891uL, 13479973333575319909uL, 12141680576410806707uL, 10936253623915059637uL, 9850501549098619819uL, 17745086042373215136uL, 15983352577617880260uL, 14396524142538228461uL,
			12967236152753103031uL, 11679847981112819795uL, 10520271803096747049uL, 9475818434452569218uL, 17070116948172427008uL, 15375394465392026135uL, 13848924157002783096uL, 12474001934591998882uL, 11235582092889474480uL, 10120112665365530972uL,
			18230774251475056952uL, 16420821625123739930uL
		};

		private static readonly short[] s_rgexp64Power10By16 = new short[21]
		{
			54, 107, 160, 213, 266, 319, 373, 426, 479, 532,
			585, 638, 691, 745, 798, 851, 904, 957, 1010, 1064,
			1117
		};

		public static void RoundNumber(ref NumberBuffer number, int pos)
		{
			Span<byte> digits = number.Digits;
			int i;
			for (i = 0; i < pos && digits[i] != 0; i++)
			{
			}
			if (i == pos && digits[i] >= 53)
			{
				while (i > 0 && digits[i - 1] == 57)
				{
					i--;
				}
				if (i > 0)
				{
					digits[i - 1]++;
				}
				else
				{
					number.Scale++;
					digits[0] = 49;
					i = 1;
				}
			}
			else
			{
				while (i > 0 && digits[i - 1] == 48)
				{
					i--;
				}
			}
			if (i == 0)
			{
				number.Scale = 0;
				number.IsNegative = false;
			}
			digits[i] = 0;
		}

		internal static bool NumberBufferToDouble(ref NumberBuffer number, out double value)
		{
			double num = NumberToDouble(ref number);
			uint num2 = DoubleHelper.Exponent(num);
			ulong num3 = DoubleHelper.Mantissa(num);
			switch (num2)
			{
			case 2047u:
				value = 0.0;
				return false;
			case 0u:
				if (num3 == 0L)
				{
					num = 0.0;
				}
				break;
			}
			value = num;
			return true;
		}

		public unsafe static bool NumberBufferToDecimal(ref NumberBuffer number, ref decimal value)
		{
			MutableDecimal value2 = default(MutableDecimal);
			byte* ptr = number.UnsafeDigits;
			int num = number.Scale;
			if (*ptr == 0)
			{
				if (num > 0)
				{
					num = 0;
				}
			}
			else
			{
				if (num > 29)
				{
					return false;
				}
				while ((num > 0 || (*ptr != 0 && num > -28)) && (value2.High < 429496729 || (value2.High == 429496729 && (value2.Mid < 2576980377u || (value2.Mid == 2576980377u && (value2.Low < 2576980377u || (value2.Low == 2576980377u && *ptr <= 53)))))))
				{
					DecimalDecCalc.DecMul10(ref value2);
					if (*ptr != 0)
					{
						DecimalDecCalc.DecAddInt32(ref value2, (uint)(*(ptr++) - 48));
					}
					num--;
				}
				if (*(ptr++) >= 53)
				{
					bool flag = true;
					if (*(ptr - 1) == 53 && *(ptr - 2) % 2 == 0)
					{
						int num2 = 20;
						while (*ptr == 48 && num2 != 0)
						{
							ptr++;
							num2--;
						}
						if (*ptr == 0 || num2 == 0)
						{
							flag = false;
						}
					}
					if (flag)
					{
						DecimalDecCalc.DecAddInt32(ref value2, 1u);
						if ((value2.High | value2.Mid | value2.Low) == 0)
						{
							value2.High = 429496729u;
							value2.Mid = 2576980377u;
							value2.Low = 2576980378u;
							num++;
						}
					}
				}
			}
			if (num > 0)
			{
				return false;
			}
			if (num <= -29)
			{
				value2.High = 0u;
				value2.Low = 0u;
				value2.Mid = 0u;
				value2.Scale = 28;
			}
			else
			{
				value2.Scale = -num;
			}
			value2.IsNegative = number.IsNegative;
			value = System.Runtime.CompilerServices.Unsafe.As<MutableDecimal, decimal>(ref value2);
			return true;
		}

		public static void DecimalToNumber(decimal value, ref NumberBuffer number)
		{
			ref MutableDecimal reference = ref System.Runtime.CompilerServices.Unsafe.As<decimal, MutableDecimal>(ref value);
			Span<byte> digits = number.Digits;
			number.IsNegative = reference.IsNegative;
			int num = 29;
			while ((reference.Mid != 0) | (reference.High != 0))
			{
				uint num2 = DecimalDecCalc.DecDivMod1E9(ref reference);
				for (int i = 0; i < 9; i++)
				{
					digits[--num] = (byte)(num2 % 10 + 48);
					num2 /= 10;
				}
			}
			for (uint num3 = reference.Low; num3 != 0; num3 /= 10)
			{
				digits[--num] = (byte)(num3 % 10 + 48);
			}
			int num4 = 29 - num;
			number.Scale = num4 - reference.Scale;
			Span<byte> digits2 = number.Digits;
			int index = 0;
			while (--num4 >= 0)
			{
				digits2[index++] = digits[num++];
			}
			digits2[index] = 0;
		}

		private static uint DigitsToInt(ReadOnlySpan<byte> digits, int count)
		{
			uint value;
			int bytesConsumed;
			bool flag = Utf8Parser.TryParse(digits.Slice(0, count), out value, out bytesConsumed, 'D');
			return value;
		}

		private static ulong Mul32x32To64(uint a, uint b)
		{
			return (ulong)a * (ulong)b;
		}

		private static ulong Mul64Lossy(ulong a, ulong b, ref int pexp)
		{
			ulong num = Mul32x32To64((uint)(a >> 32), (uint)(b >> 32)) + (Mul32x32To64((uint)(a >> 32), (uint)b) >> 32) + (Mul32x32To64((uint)a, (uint)(b >> 32)) >> 32);
			if ((num & 0x8000000000000000uL) == 0L)
			{
				num <<= 1;
				pexp--;
			}
			return num;
		}

		private static int abs(int value)
		{
			if (value < 0)
			{
				return -value;
			}
			return value;
		}

		private unsafe static double NumberToDouble(ref NumberBuffer number)
		{
			ReadOnlySpan<byte> digits = number.Digits;
			int i = 0;
			int numDigits = number.NumDigits;
			int num = numDigits;
			for (; digits[i] == 48; i++)
			{
				num--;
			}
			if (num == 0)
			{
				return 0.0;
			}
			int num2 = Math.Min(num, 9);
			num -= num2;
			ulong num3 = DigitsToInt(digits, num2);
			if (num > 0)
			{
				num2 = Math.Min(num, 9);
				num -= num2;
				uint b = (uint)(s_rgval64Power10[num2 - 1] >> 64 - s_rgexp64Power10[num2 - 1]);
				num3 = Mul32x32To64((uint)num3, b) + DigitsToInt(digits.Slice(9), num2);
			}
			int num4 = number.Scale - (numDigits - num);
			int num5 = abs(num4);
			if (num5 >= 352)
			{
				ulong num6 = ((num4 > 0) ? 9218868437227405312uL : 0);
				if (number.IsNegative)
				{
					num6 |= 0x8000000000000000uL;
				}
				return *(double*)(&num6);
			}
			int pexp = 64;
			if ((num3 & 0xFFFFFFFF00000000uL) == 0L)
			{
				num3 <<= 32;
				pexp -= 32;
			}
			if ((num3 & 0xFFFF000000000000uL) == 0L)
			{
				num3 <<= 16;
				pexp -= 16;
			}
			if ((num3 & 0xFF00000000000000uL) == 0L)
			{
				num3 <<= 8;
				pexp -= 8;
			}
			if ((num3 & 0xF000000000000000uL) == 0L)
			{
				num3 <<= 4;
				pexp -= 4;
			}
			if ((num3 & 0xC000000000000000uL) == 0L)
			{
				num3 <<= 2;
				pexp -= 2;
			}
			if ((num3 & 0x8000000000000000uL) == 0L)
			{
				num3 <<= 1;
				pexp--;
			}
			int num7 = num5 & 0xF;
			if (num7 != 0)
			{
				int num8 = s_rgexp64Power10[num7 - 1];
				pexp += ((num4 < 0) ? (-num8 + 1) : num8);
				ulong b2 = s_rgval64Power10[num7 + ((num4 < 0) ? 15 : 0) - 1];
				num3 = Mul64Lossy(num3, b2, ref pexp);
			}
			num7 = num5 >> 4;
			if (num7 != 0)
			{
				int num9 = s_rgexp64Power10By16[num7 - 1];
				pexp += ((num4 < 0) ? (-num9 + 1) : num9);
				ulong b3 = s_rgval64Power10By16[num7 + ((num4 < 0) ? 21 : 0) - 1];
				num3 = Mul64Lossy(num3, b3, ref pexp);
			}
			if (((uint)(int)num3 & 0x400u) != 0)
			{
				ulong num10 = num3 + 1023 + (ulong)(((int)num3 >> 11) & 1);
				if (num10 < num3)
				{
					num10 = (num10 >> 1) | 0x8000000000000000uL;
					pexp++;
				}
				num3 = num10;
			}
			pexp += 1022;
			num3 = ((pexp <= 0) ? ((pexp == -52 && num3 >= 9223372036854775896uL) ? 1 : ((pexp > -52) ? (num3 >> -pexp + 11 + 1) : 0)) : ((pexp < 2047) ? ((ulong)((long)pexp << 52) + ((num3 >> 11) & 0xFFFFFFFFFFFFFL)) : 9218868437227405312uL));
			if (number.IsNegative)
			{
				num3 |= 0x8000000000000000uL;
			}
			return *(double*)(&num3);
		}
	}
	internal ref struct NumberBuffer
	{
		public int Scale;

		public bool IsNegative;

		public const int BufferSize = 51;

		private byte _b0;

		private byte _b1;

		private byte _b2;

		private byte _b3;

		private byte _b4;

		private byte _b5;

		private byte _b6;

		private byte _b7;

		private byte _b8;

		private byte _b9;

		private byte _b10;

		private byte _b11;

		private byte _b12;

		private byte _b13;

		private byte _b14;

		private byte _b15;

		private byte _b16;

		private byte _b17;

		private byte _b18;

		private byte _b19;

		private byte _b20;

		private byte _b21;

		private byte _b22;

		private byte _b23;

		private byte _b24;

		private byte _b25;

		private byte _b26;

		private byte _b27;

		private byte _b28;

		private byte _b29;

		private byte _b30;

		private byte _b31;

		private byte _b32;

		private byte _b33;

		private byte _b34;

		private byte _b35;

		private byte _b36;

		private byte _b37;

		private byte _b38;

		private byte _b39;

		private byte _b40;

		private byte _b41;

		private byte _b42;

		private byte _b43;

		private byte _b44;

		private byte _b45;

		private byte _b46;

		private byte _b47;

		private byte _b48;

		private byte _b49;

		private byte _b50;

		public unsafe Span<byte> Digits => new Span<byte>(System.Runtime.CompilerServices.Unsafe.AsPointer<byte>(ref _b0), 51);

		public unsafe byte* UnsafeDigits => (byte*)System.Runtime.CompilerServices.Unsafe.AsPointer<byte>(ref _b0);

		public int NumDigits => Digits.IndexOf<byte>(0);

		[Conditional("DEBUG")]
		public void CheckConsistency()
		{
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append('[');
			stringBuilder.Append('"');
			Span<byte> digits = Digits;
			for (int i = 0; i < 51; i++)
			{
				byte b = digits[i];
				if (b == 0)
				{
					break;
				}
				stringBuilder.Append((char)b);
			}
			stringBuilder.Append('"');
			stringBuilder.Append(", Scale = " + Scale);
			stringBuilder.Append(", IsNegative   = " + IsNegative);
			stringBuilder.Append(']');
			return stringBuilder.ToString();
		}
	}
	[DebuggerTypeProxy(typeof(System.MemoryDebugView<>))]
	[DebuggerDisplay("{ToString(),raw}")]
	public readonly struct Memory<T>
	{
		private readonly object _object;

		private readonly int _index;

		private readonly int _length;

		private const int RemoveFlagsBitMask = int.MaxValue;

		public static Memory<T> Empty => default(Memory<T>);

		public int Length => _length & 0x7FFFFFFF;

		public bool IsEmpty => (_length & 0x7FFFFFFF) == 0;

		public Span<T> Span
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				Span<T> result;
				if (_index < 0)
				{
					result = ((MemoryManager<T>)_object).GetSpan();
					return result.Slice(_index & 0x7FFFFFFF, _length);
				}
				if (typeof(T) == typeof(char) && _object is string text)
				{
					result = new Span<T>(System.Runtime.CompilerServices.Unsafe.As<Pinnable<T>>((object)text), MemoryExtensions.StringAdjustment, text.Length);
					return result.Slice(_index, _length);
				}
				if (_object != null)
				{
					return new Span<T>((T[])_object, _index, _length & 0x7FFFFFFF);
				}
				result = default(Span<T>);
				return result;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Memory(T[] array)
		{
			if (array == null)
			{
				this = default(Memory<T>);
				return;
			}
			if (default(T) == null && array.GetType() != typeof(T[]))
			{
				System.ThrowHelper.ThrowArrayTypeMismatchException();
			}
			_object = array;
			_index = 0;
			_length = array.Length;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal Memory(T[] array, int start)
		{
			if (array == null)
			{
				if (start != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException();
				}
				this = default(Memory<T>);
				return;
			}
			if (default(T) == null && array.GetType() != typeof(T[]))
			{
				System.ThrowHelper.ThrowArrayTypeMismatchException();
			}
			if ((uint)start > (uint)array.Length)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException();
			}
			_object = array;
			_index = start;
			_length = array.Length - start;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Memory(T[] array, int start, int length)
		{
			if (array == null)
			{
				if (start != 0 || length != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException();
				}
				this = default(Memory<T>);
				return;
			}
			if (default(T) == null && array.GetType() != typeof(T[]))
			{
				System.ThrowHelper.ThrowArrayTypeMismatchException();
			}
			if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException();
			}
			_object = array;
			_index = start;
			_length = length;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal Memory(MemoryManager<T> manager, int length)
		{
			if (length < 0)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException();
			}
			_object = manager;
			_index = int.MinValue;
			_length = length;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal Memory(MemoryManager<T> manager, int start, int length)
		{
			if (length < 0 || start < 0)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException();
			}
			_object = manager;
			_index = start | int.MinValue;
			_length = length;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal Memory(object obj, int start, int length)
		{
			_object = obj;
			_index = start;
			_length = length;
		}

		public static implicit operator Memory<T>(T[] array)
		{
			return new Memory<T>(array);
		}

		public static implicit operator Memory<T>(ArraySegment<T> segment)
		{
			return new Memory<T>(segment.Array, segment.Offset, segment.Count);
		}

		public static implicit operator ReadOnlyMemory<T>(Memory<T> memory)
		{
			return System.Runtime.CompilerServices.Unsafe.As<Memory<T>, ReadOnlyMemory<T>>(ref memory);
		}

		public override string ToString()
		{
			if (typeof(T) == typeof(char))
			{
				if (!(_object is string text))
				{
					return Span.ToString();
				}
				return text.Substring(_index, _length & 0x7FFFFFFF);
			}
			return $"System.Memory<{typeof(T).Name}>[{_length & 0x7FFFFFFF}]";
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Memory<T> Slice(int start)
		{
			int length = _length;
			int num = length & 0x7FFFFFFF;
			if ((uint)start > (uint)num)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return new Memory<T>(_object, _index + start, length - start);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Memory<T> Slice(int start, int length)
		{
			int length2 = _length;
			int num = length2 & 0x7FFFFFFF;
			if ((uint)start > (uint)num || (uint)length > (uint)(num - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException();
			}
			return new Memory<T>(_object, _index + start, length | (length2 & int.MinValue));
		}

		public void CopyTo(Memory<T> destination)
		{
			Span.CopyTo(destination.Span);
		}

		public bool TryCopyTo(Memory<T> destination)
		{
			return Span.TryCopyTo(destination.Span);
		}

		public unsafe MemoryHandle Pin()
		{
			if (_index < 0)
			{
				return ((MemoryManager<T>)_object).Pin(_index & 0x7FFFFFFF);
			}
			if (typeof(T) == typeof(char) && _object is string value)
			{
				GCHandle handle = GCHandle.Alloc(value, GCHandleType.Pinned);
				void* pointer = System.Runtime.CompilerServices.Unsafe.Add<T>((void*)handle.AddrOfPinnedObject(), _index);
				return new MemoryHandle(pointer, handle);
			}
			if (_object is T[] array)
			{
				if (_length < 0)
				{
					void* pointer2 = System.Runtime.CompilerServices.Unsafe.Add<T>(System.Runtime.CompilerServices.Unsafe.AsPointer<T>(ref MemoryMarshal.GetReference<T>(array)), _index);
					return new MemoryHandle(pointer2);
				}
				GCHandle handle2 = GCHandle.Alloc(array, GCHandleType.Pinned);
				void* pointer3 = System.Runtime.CompilerServices.Unsafe.Add<T>((void*)handle2.AddrOfPinnedObject(), _index);
				return new MemoryHandle(pointer3, handle2);
			}
			return default(MemoryHandle);
		}

		public T[] ToArray()
		{
			return Span.ToArray();
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public override bool Equals(object obj)
		{
			if (obj is ReadOnlyMemory<T> readOnlyMemory)
			{
				return readOnlyMemory.Equals(this);
			}
			if (obj is Memory<T> other)
			{
				return Equals(other);
			}
			return false;
		}

		public bool Equals(Memory<T> other)
		{
			if (_object == other._object && _index == other._index)
			{
				return _length == other._length;
			}
			return false;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public override int GetHashCode()
		{
			if (_object == null)
			{
				return 0;
			}
			int hashCode = _object.GetHashCode();
			int index = _index;
			int hashCode2 = index.GetHashCode();
			index = _length;
			return CombineHashCodes(hashCode, hashCode2, index.GetHashCode());
		}

		private static int CombineHashCodes(int left, int right)
		{
			return ((left << 5) + left) ^ right;
		}

		private static int CombineHashCodes(int h1, int h2, int h3)
		{
			return CombineHashCodes(CombineHashCodes(h1, h2), h3);
		}
	}
	internal sealed class MemoryDebugView<T>
	{
		private readonly ReadOnlyMemory<T> _memory;

		[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
		public T[] Items => _memory.ToArray();

		public MemoryDebugView(Memory<T> memory)
		{
			_memory = memory;
		}

		public MemoryDebugView(ReadOnlyMemory<T> memory)
		{
			_memory = memory;
		}
	}
	public static class MemoryExtensions
	{
		internal static readonly IntPtr StringAdjustment = MeasureStringAdjustment();

		public static ReadOnlySpan<char> Trim(this ReadOnlySpan<char> span)
		{
			return span.TrimStart().TrimEnd();
		}

		public static ReadOnlySpan<char> TrimStart(this ReadOnlySpan<char> span)
		{
			int i;
			for (i = 0; i < span.Length && char.IsWhiteSpace(span[i]); i++)
			{
			}
			return span.Slice(i);
		}

		public static ReadOnlySpan<char> TrimEnd(this ReadOnlySpan<char> span)
		{
			int num = span.Length - 1;
			while (num >= 0 && char.IsWhiteSpace(span[num]))
			{
				num--;
			}
			return span.Slice(0, num + 1);
		}

		public static ReadOnlySpan<char> Trim(this ReadOnlySpan<char> span, char trimChar)
		{
			return span.TrimStart(trimChar).TrimEnd(trimChar);
		}

		public static ReadOnlySpan<char> TrimStart(this ReadOnlySpan<char> span, char trimChar)
		{
			int i;
			for (i = 0; i < span.Length && span[i] == trimChar; i++)
			{
			}
			return span.Slice(i);
		}

		public static ReadOnlySpan<char> TrimEnd(this ReadOnlySpan<char> span, char trimChar)
		{
			int num = span.Length - 1;
			while (num >= 0 && span[num] == trimChar)
			{
				num--;
			}
			return span.Slice(0, num + 1);
		}

		public static ReadOnlySpan<char> Trim(this ReadOnlySpan<char> span, ReadOnlySpan<char> trimChars)
		{
			return span.TrimStart(trimChars).TrimEnd(trimChars);
		}

		public static ReadOnlySpan<char> TrimStart(this ReadOnlySpan<char> span, ReadOnlySpan<char> trimChars)
		{
			if (trimChars.IsEmpty)
			{
				return span.TrimStart();
			}
			int i;
			for (i = 0; i < span.Length; i++)
			{
				int num = 0;
				while (num < trimChars.Length)
				{
					if (span[i] != trimChars[num])
					{
						num++;
						continue;
					}
					goto IL_003c;
				}
				break;
				IL_003c:;
			}
			return span.Slice(i);
		}

		public static ReadOnlySpan<char> TrimEnd(this ReadOnlySpan<char> span, ReadOnlySpan<char> trimChars)
		{
			if (trimChars.IsEmpty)
			{
				return span.TrimEnd();
			}
			int num;
			for (num = span.Length - 1; num >= 0; num--)
			{
				int num2 = 0;
				while (num2 < trimChars.Length)
				{
					if (span[num] != trimChars[num2])
					{
						num2++;
						continue;
					}
					goto IL_0044;
				}
				break;
				IL_0044:;
			}
			return span.Slice(0, num + 1);
		}

		public static bool IsWhiteSpace(this ReadOnlySpan<char> span)
		{
			for (int i = 0; i < span.Length; i++)
			{
				if (!char.IsWhiteSpace(span[i]))
				{
					return false;
				}
			}
			return true;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value), span.Length);
			}
			if (typeof(T) == typeof(char))
			{
				return System.SpanHelpers.IndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, char>(ref value), span.Length);
			}
			return System.SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), value.Length);
			}
			return System.SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value), span.Length);
			}
			if (typeof(T) == typeof(char))
			{
				return System.SpanHelpers.LastIndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, char>(ref value), span.Length);
			}
			return System.SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), value.Length);
			}
			return System.SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool SequenceEqual<T>(this Span<T> span, ReadOnlySpan<T> other) where T : IEquatable<T>
		{
			int length = span.Length;
			if (default(T) != null && IsTypeComparableAsBytes<T>(out var size))
			{
				if (length == other.Length)
				{
					return System.SpanHelpers.SequenceEqual(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), (NUInt)length * size);
				}
				return false;
			}
			if (length == other.Length)
			{
				return System.SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other), length);
			}
			return false;
		}

		public static int SequenceCompareTo<T>(this Span<T> span, ReadOnlySpan<T> other) where T : IComparable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.SequenceCompareTo(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), other.Length);
			}
			if (typeof(T) == typeof(char))
			{
				return System.SpanHelpers.SequenceCompareTo(ref System.Runtime.CompilerServices.Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, char>(ref MemoryMarshal.GetReference(other)), other.Length);
			}
			return System.SpanHelpers.SequenceCompareTo(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(other), other.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOf<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value), span.Length);
			}
			if (typeof(T) == typeof(char))
			{
				return System.SpanHelpers.IndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, char>(ref value), span.Length);
			}
			return System.SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOf<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), value.Length);
			}
			return System.SpanHelpers.IndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOf<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value), span.Length);
			}
			if (typeof(T) == typeof(char))
			{
				return System.SpanHelpers.LastIndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, char>(ref value), span.Length);
			}
			return System.SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), value, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOf<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOf(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), value.Length);
			}
			return System.SpanHelpers.LastIndexOf(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(value), value.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value0), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value1), span.Length);
			}
			return System.SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value0), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value1), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value2), span.Length);
			}
			return System.SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values)), values.Length);
			}
			return System.SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value0), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value1), span.Length);
			}
			return System.SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1, T value2) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value0), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value1), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value2), span.Length);
			}
			return System.SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int IndexOfAny<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.IndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values)), values.Length);
			}
			return System.SpanHelpers.IndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value0), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value1), span.Length);
			}
			return System.SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value0), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value1), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value2), span.Length);
			}
			return System.SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values)), values.Length);
			}
			return System.SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value0), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value1), span.Length);
			}
			return System.SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1, T value2) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value0), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value1), System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value2), span.Length);
			}
			return System.SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), value0, value1, value2, span.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int LastIndexOfAny<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.LastIndexOfAny(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(values)), values.Length);
			}
			return System.SpanHelpers.LastIndexOfAny(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(values), values.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool SequenceEqual<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other) where T : IEquatable<T>
		{
			int length = span.Length;
			if (default(T) != null && IsTypeComparableAsBytes<T>(out var size))
			{
				if (length == other.Length)
				{
					return System.SpanHelpers.SequenceEqual(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), (NUInt)length * size);
				}
				return false;
			}
			if (length == other.Length)
			{
				return System.SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other), length);
			}
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int SequenceCompareTo<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other) where T : IComparable<T>
		{
			if (typeof(T) == typeof(byte))
			{
				return System.SpanHelpers.SequenceCompareTo(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), other.Length);
			}
			if (typeof(T) == typeof(char))
			{
				return System.SpanHelpers.SequenceCompareTo(ref System.Runtime.CompilerServices.Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), span.Length, ref System.Runtime.CompilerServices.Unsafe.As<T, char>(ref MemoryMarshal.GetReference(other)), other.Length);
			}
			return System.SpanHelpers.SequenceCompareTo(ref MemoryMarshal.GetReference(span), span.Length, ref MemoryMarshal.GetReference(other), other.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool StartsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>
		{
			int length = value.Length;
			if (default(T) != null && IsTypeComparableAsBytes<T>(out var size))
			{
				if (length <= span.Length)
				{
					return System.SpanHelpers.SequenceEqual(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), (NUInt)length * size);
				}
				return false;
			}
			if (length <= span.Length)
			{
				return System.SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), length);
			}
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool StartsWith<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>
		{
			int length = value.Length;
			if (default(T) != null && IsTypeComparableAsBytes<T>(out var size))
			{
				if (length <= span.Length)
				{
					return System.SpanHelpers.SequenceEqual(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), (NUInt)length * size);
				}
				return false;
			}
			if (length <= span.Length)
			{
				return System.SpanHelpers.SequenceEqual(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(value), length);
			}
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool EndsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>
		{
			int length = span.Length;
			int length2 = value.Length;
			if (default(T) != null && IsTypeComparableAsBytes<T>(out var size))
			{
				if (length2 <= length)
				{
					return System.SpanHelpers.SequenceEqual(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref System.Runtime.CompilerServices.Unsafe.Add<T>(ref MemoryMarshal.GetReference(span), length - length2)), ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), (NUInt)length2 * size);
				}
				return false;
			}
			if (length2 <= length)
			{
				return System.SpanHelpers.SequenceEqual(ref System.Runtime.CompilerServices.Unsafe.Add<T>(ref MemoryMarshal.GetReference(span), length - length2), ref MemoryMarshal.GetReference(value), length2);
			}
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool EndsWith<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>
		{
			int length = span.Length;
			int length2 = value.Length;
			if (default(T) != null && IsTypeComparableAsBytes<T>(out var size))
			{
				if (length2 <= length)
				{
					return System.SpanHelpers.SequenceEqual(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref System.Runtime.CompilerServices.Unsafe.Add<T>(ref MemoryMarshal.GetReference(span), length - length2)), ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), (NUInt)length2 * size);
				}
				return false;
			}
			if (length2 <= length)
			{
				return System.SpanHelpers.SequenceEqual(ref System.Runtime.CompilerServices.Unsafe.Add<T>(ref MemoryMarshal.GetReference(span), length - length2), ref MemoryMarshal.GetReference(value), length2);
			}
			return false;
		}

		public static void Reverse<T>(this Span<T> span)
		{
			ref T reference = ref MemoryMarshal.GetReference(span);
			int num = 0;
			int num2 = span.Length - 1;
			while (num < num2)
			{
				T val = System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, num);
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, num) = System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, num2);
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, num2) = val;
				num++;
				num2--;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Span<T> AsSpan<T>(this T[] array)
		{
			return new Span<T>(array);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Span<T> AsSpan<T>(this T[] array, int start, int length)
		{
			return new Span<T>(array, start, length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Span<T> AsSpan<T>(this ArraySegment<T> segment)
		{
			return new Span<T>(segment.Array, segment.Offset, segment.Count);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start)
		{
			if ((uint)start > segment.Count)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return new Span<T>(segment.Array, segment.Offset + start, segment.Count - start);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start, int length)
		{
			if ((uint)start > segment.Count)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			if ((uint)length > segment.Count - start)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.length);
			}
			return new Span<T>(segment.Array, segment.Offset + start, length);
		}

		public static Memory<T> AsMemory<T>(this T[] array)
		{
			return new Memory<T>(array);
		}

		public static Memory<T> AsMemory<T>(this T[] array, int start)
		{
			return new Memory<T>(array, start);
		}

		public static Memory<T> AsMemory<T>(this T[] array, int start, int length)
		{
			return new Memory<T>(array, start, length);
		}

		public static Memory<T> AsMemory<T>(this ArraySegment<T> segment)
		{
			return new Memory<T>(segment.Array, segment.Offset, segment.Count);
		}

		public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start)
		{
			if ((uint)start > segment.Count)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return new Memory<T>(segment.Array, segment.Offset + start, segment.Count - start);
		}

		public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start, int length)
		{
			if ((uint)start > segment.Count)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			if ((uint)length > segment.Count - start)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.length);
			}
			return new Memory<T>(segment.Array, segment.Offset + start, length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static void CopyTo<T>(this T[] source, Span<T> destination)
		{
			new ReadOnlySpan<T>(source).CopyTo(destination);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static void CopyTo<T>(this T[] source, Memory<T> destination)
		{
			source.CopyTo(destination.Span);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other)
		{
			return ((ReadOnlySpan<T>)span).Overlaps(other);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other, out int elementOffset)
		{
			return ((ReadOnlySpan<T>)span).Overlaps(other, out elementOffset);
		}

		public static bool Overlaps<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other)
		{
			if (span.IsEmpty || other.IsEmpty)
			{
				return false;
			}
			IntPtr intPtr = System.Runtime.CompilerServices.Unsafe.ByteOffset<T>(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other));
			if (System.Runtime.CompilerServices.Unsafe.SizeOf<IntPtr>() == 4)
			{
				if ((uint)(int)intPtr >= (uint)(span.Length * System.Runtime.CompilerServices.Unsafe.SizeOf<T>()))
				{
					return (uint)(int)intPtr > (uint)(-(other.Length * System.Runtime.CompilerServices.Unsafe.SizeOf<T>()));
				}
				return true;
			}
			if ((ulong)(long)intPtr >= (ulong)((long)span.Length * (long)System.Runtime.CompilerServices.Unsafe.SizeOf<T>()))
			{
				return (ulong)(long)intPtr > (ulong)(-((long)other.Length * (long)System.Runtime.CompilerServices.Unsafe.SizeOf<T>()));
			}
			return true;
		}

		public static bool Overlaps<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other, out int elementOffset)
		{
			if (span.IsEmpty || other.IsEmpty)
			{
				elementOffset = 0;
				return false;
			}
			IntPtr intPtr = System.Runtime.CompilerServices.Unsafe.ByteOffset<T>(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other));
			if (System.Runtime.CompilerServices.Unsafe.SizeOf<IntPtr>() == 4)
			{
				if ((uint)(int)intPtr < (uint)(span.Length * System.Runtime.CompilerServices.Unsafe.SizeOf<T>()) || (uint)(int)intPtr > (uint)(-(other.Length * System.Runtime.CompilerServices.Unsafe.SizeOf<T>())))
				{
					if ((int)intPtr % System.Runtime.CompilerServices.Unsafe.SizeOf<T>() != 0)
					{
						System.ThrowHelper.ThrowArgumentException_OverlapAlignmentMismatch();
					}
					elementOffset = (int)intPtr / System.Runtime.CompilerServices.Unsafe.SizeOf<T>();
					return true;
				}
				elementOffset = 0;
				return false;
			}
			if ((ulong)(long)intPtr < (ulong)((long)span.Length * (long)System.Runtime.CompilerServices.Unsafe.SizeOf<T>()) || (ulong)(long)intPtr > (ulong)(-((long)other.Length * (long)System.Runtime.CompilerServices.Unsafe.SizeOf<T>())))
			{
				if ((long)intPtr % System.Runtime.CompilerServices.Unsafe.SizeOf<T>() != 0L)
				{
					System.ThrowHelper.ThrowArgumentException_OverlapAlignmentMismatch();
				}
				elementOffset = (int)((long)intPtr / System.Runtime.CompilerServices.Unsafe.SizeOf<T>());
				return true;
			}
			elementOffset = 0;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int BinarySearch<T>(this Span<T> span, IComparable<T> comparable)
		{
			return span.BinarySearch<T, IComparable<T>>(comparable);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int BinarySearch<T, TComparable>(this Span<T> span, TComparable comparable) where TComparable : IComparable<T>
		{
			return BinarySearch((ReadOnlySpan<T>)span, comparable);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int BinarySearch<T, TComparer>(this Span<T> span, T value, TComparer comparer) where TComparer : IComparer<T>
		{
			return ((ReadOnlySpan<T>)span).BinarySearch(value, comparer);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int BinarySearch<T>(this ReadOnlySpan<T> span, IComparable<T> comparable)
		{
			return MemoryExtensions.BinarySearch<T, IComparable<T>>(span, comparable);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int BinarySearch<T, TComparable>(this ReadOnlySpan<T> span, TComparable comparable) where TComparable : IComparable<T>
		{
			return System.SpanHelpers.BinarySearch(span, comparable);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int BinarySearch<T, TComparer>(this ReadOnlySpan<T> span, T value, TComparer comparer) where TComparer : IComparer<T>
		{
			if (comparer == null)
			{
				System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.comparer);
			}
			System.SpanHelpers.ComparerComparable<T, TComparer> comparable = new System.SpanHelpers.ComparerComparable<T, TComparer>(value, comparer);
			return BinarySearch(span, comparable);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static bool IsTypeComparableAsBytes<T>(out NUInt size)
		{
			if (typeof(T) == typeof(byte) || typeof(T) == typeof(sbyte))
			{
				size = (NUInt)1;
				return true;
			}
			if (typeof(T) == typeof(char) || typeof(T) == typeof(short) || typeof(T) == typeof(ushort))
			{
				size = (NUInt)2;
				return true;
			}
			if (typeof(T) == typeof(int) || typeof(T) == typeof(uint))
			{
				size = (NUInt)4;
				return true;
			}
			if (typeof(T) == typeof(long) || typeof(T) == typeof(ulong))
			{
				size = (NUInt)8;
				return true;
			}
			size = default(NUInt);
			return false;
		}

		public static Span<T> AsSpan<T>(this T[] array, int start)
		{
			return Span<T>.Create(array, start);
		}

		public static bool Contains(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType)
		{
			return span.IndexOf(value, comparisonType) >= 0;
		}

		public static bool Equals(this ReadOnlySpan<char> span, ReadOnlySpan<char> other, StringComparison comparisonType)
		{
			switch (comparisonType)
			{
			case StringComparison.Ordinal:
				return span.SequenceEqual(other);
			case StringComparison.OrdinalIgnoreCase:
				if (span.Length != other.Length)
				{
					return false;
				}
				return EqualsOrdinalIgnoreCase(span, other);
			default:
				return span.ToString().Equals(other.ToString(), comparisonType);
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private static bool EqualsOrdinalIgnoreCase(ReadOnlySpan<char> span, ReadOnlySpan<char> other)
		{
			if (other.Length == 0)
			{
				return true;
			}
			return CompareToOrdinalIgnoreCase(span, other) == 0;
		}

		public static int CompareTo(this ReadOnlySpan<char> span, ReadOnlySpan<char> other, StringComparison comparisonType)
		{
			return comparisonType switch
			{
				StringComparison.Ordinal => span.SequenceCompareTo(other), 
				StringComparison.OrdinalIgnoreCase => CompareToOrdinalIgnoreCase(span, other), 
				_ => string.Compare(span.ToString(), other.ToString(), comparisonType), 
			};
		}

		private unsafe static int CompareToOrdinalIgnoreCase(ReadOnlySpan<char> strA, ReadOnlySpan<char> strB)
		{
			int num = Math.Min(strA.Length, strB.Length);
			int num2 = num;
			fixed (char* ptr = &MemoryMarshal.GetReference(strA))
			{
				fixed (char* ptr3 = &MemoryMarshal.GetReference(strB))
				{
					char* ptr2 = ptr;
					char* ptr4 = ptr3;
					while (num != 0 && *ptr2 <= '\u007f' && *ptr4 <= '\u007f')
					{
						int num3 = *ptr2;
						int num4 = *ptr4;
						if (num3 == num4)
						{
							ptr2++;
							ptr4++;
							num--;
							continue;
						}
						if ((uint)(num3 - 97) <= 25u)
						{
							num3 -= 32;
						}
						if ((uint)(num4 - 97) <= 25u)
						{
							num4 -= 32;
						}
						if (num3 != num4)
						{
							return num3 - num4;
						}
						ptr2++;
						ptr4++;
						num--;
					}
					if (num == 0)
					{
						return strA.Length - strB.Length;
					}
					num2 -= num;
					return string.Compare(strA.Slice(num2).ToString(), strB.Slice(num2).ToString(), StringComparison.OrdinalIgnoreCase);
				}
			}
		}

		public static int IndexOf(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType)
		{
			if (comparisonType == StringComparison.Ordinal)
			{
				return span.IndexOf(value);
			}
			return span.ToString().IndexOf(value.ToString(), comparisonType);
		}

		public static int ToLower(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo culture)
		{
			if (culture == null)
			{
				System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.culture);
			}
			if (destination.Length < source.Length)
			{
				return -1;
			}
			string text = source.ToString();
			string text2 = text.ToLower(culture);
			AsSpan(text2).CopyTo(destination);
			return source.Length;
		}

		public static int ToLowerInvariant(this ReadOnlySpan<char> source, Span<char> destination)
		{
			return source.ToLower(destination, CultureInfo.InvariantCulture);
		}

		public static int ToUpper(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo culture)
		{
			if (culture == null)
			{
				System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.culture);
			}
			if (destination.Length < source.Length)
			{
				return -1;
			}
			string text = source.ToString();
			string text2 = text.ToUpper(culture);
			AsSpan(text2).CopyTo(destination);
			return source.Length;
		}

		public static int ToUpperInvariant(this ReadOnlySpan<char> source, Span<char> destination)
		{
			return source.ToUpper(destination, CultureInfo.InvariantCulture);
		}

		public static bool EndsWith(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType)
		{
			switch (comparisonType)
			{
			case StringComparison.Ordinal:
				return span.EndsWith(value);
			case StringComparison.OrdinalIgnoreCase:
				if (value.Length <= span.Length)
				{
					return EqualsOrdinalIgnoreCase(span.Slice(span.Length - value.Length), value);
				}
				return false;
			default:
			{
				string text = span.ToString();
				string value2 = value.ToString();
				return text.EndsWith(value2, comparisonType);
			}
			}
		}

		public static bool StartsWith(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType)
		{
			switch (comparisonType)
			{
			case StringComparison.Ordinal:
				return span.StartsWith(value);
			case StringComparison.OrdinalIgnoreCase:
				if (value.Length <= span.Length)
				{
					return EqualsOrdinalIgnoreCase(span.Slice(0, value.Length), value);
				}
				return false;
			default:
			{
				string text = span.ToString();
				string value2 = value.ToString();
				return text.StartsWith(value2, comparisonType);
			}
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static ReadOnlySpan<char> AsSpan(this string text)
		{
			if (text == null)
			{
				return default(ReadOnlySpan<char>);
			}
			return new ReadOnlySpan<char>(System.Runtime.CompilerServices.Unsafe.As<Pinnable<char>>((object)text), StringAdjustment, text.Length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static ReadOnlySpan<char> AsSpan(this string text, int start)
		{
			if (text == null)
			{
				if (start != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
				}
				return default(ReadOnlySpan<char>);
			}
			if ((uint)start > (uint)text.Length)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return new ReadOnlySpan<char>(System.Runtime.CompilerServices.Unsafe.As<Pinnable<char>>((object)text), StringAdjustment + start * 2, text.Length - start);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static ReadOnlySpan<char> AsSpan(this string text, int start, int length)
		{
			if (text == null)
			{
				if (start != 0 || length != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
				}
				return default(ReadOnlySpan<char>);
			}
			if ((uint)start > (uint)text.Length || (uint)length > (uint)(text.Length - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return new ReadOnlySpan<char>(System.Runtime.CompilerServices.Unsafe.As<Pinnable<char>>((object)text), StringAdjustment + start * 2, length);
		}

		public static ReadOnlyMemory<char> AsMemory(this string text)
		{
			if (text == null)
			{
				return default(ReadOnlyMemory<char>);
			}
			return new ReadOnlyMemory<char>(text, 0, text.Length);
		}

		public static ReadOnlyMemory<char> AsMemory(this string text, int start)
		{
			if (text == null)
			{
				if (start != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
				}
				return default(ReadOnlyMemory<char>);
			}
			if ((uint)start > (uint)text.Length)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return new ReadOnlyMemory<char>(text, start, text.Length - start);
		}

		public static ReadOnlyMemory<char> AsMemory(this string text, int start, int length)
		{
			if (text == null)
			{
				if (start != 0 || length != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
				}
				return default(ReadOnlyMemory<char>);
			}
			if ((uint)start > (uint)text.Length || (uint)length > (uint)(text.Length - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return new ReadOnlyMemory<char>(text, start, length);
		}

		private unsafe static IntPtr MeasureStringAdjustment()
		{
			string text = "a";
			fixed (char* ptr = text)
			{
				return System.Runtime.CompilerServices.Unsafe.ByteOffset<char>(ref System.Runtime.CompilerServices.Unsafe.As<Pinnable<char>>((object)text).Data, ref System.Runtime.CompilerServices.Unsafe.AsRef<char>((void*)ptr));
			}
		}
	}
	[DebuggerTypeProxy(typeof(System.MemoryDebugView<>))]
	[DebuggerDisplay("{ToString(),raw}")]
	public readonly struct ReadOnlyMemory<T>
	{
		private readonly object _object;

		private readonly int _index;

		private readonly int _length;

		internal const int RemoveFlagsBitMask = int.MaxValue;

		public static ReadOnlyMemory<T> Empty => default(ReadOnlyMemory<T>);

		public int Length => _length & 0x7FFFFFFF;

		public bool IsEmpty => (_length & 0x7FFFFFFF) == 0;

		public ReadOnlySpan<T> Span
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				if (_index < 0)
				{
					return ((MemoryManager<T>)_object).GetSpan().Slice(_index & 0x7FFFFFFF, _length);
				}
				ReadOnlySpan<T> result;
				if (typeof(T) == typeof(char) && _object is string text)
				{
					result = new ReadOnlySpan<T>(System.Runtime.CompilerServices.Unsafe.As<Pinnable<T>>((object)text), MemoryExtensions.StringAdjustment, text.Length);
					return result.Slice(_index, _length);
				}
				if (_object != null)
				{
					return new ReadOnlySpan<T>((T[])_object, _index, _length & 0x7FFFFFFF);
				}
				result = default(ReadOnlySpan<T>);
				return result;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ReadOnlyMemory(T[] array)
		{
			if (array == null)
			{
				this = default(ReadOnlyMemory<T>);
				return;
			}
			_object = array;
			_index = 0;
			_length = array.Length;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ReadOnlyMemory(T[] array, int start, int length)
		{
			if (array == null)
			{
				if (start != 0 || length != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException();
				}
				this = default(ReadOnlyMemory<T>);
				return;
			}
			if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException();
			}
			_object = array;
			_index = start;
			_length = length;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal ReadOnlyMemory(object obj, int start, int length)
		{
			_object = obj;
			_index = start;
			_length = length;
		}

		public static implicit operator ReadOnlyMemory<T>(T[] array)
		{
			return new ReadOnlyMemory<T>(array);
		}

		public static implicit operator ReadOnlyMemory<T>(ArraySegment<T> segment)
		{
			return new ReadOnlyMemory<T>(segment.Array, segment.Offset, segment.Count);
		}

		public override string ToString()
		{
			if (typeof(T) == typeof(char))
			{
				if (!(_object is string text))
				{
					return Span.ToString();
				}
				return text.Substring(_index, _length & 0x7FFFFFFF);
			}
			return $"System.ReadOnlyMemory<{typeof(T).Name}>[{_length & 0x7FFFFFFF}]";
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ReadOnlyMemory<T> Slice(int start)
		{
			int length = _length;
			int num = length & 0x7FFFFFFF;
			if ((uint)start > (uint)num)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return new ReadOnlyMemory<T>(_object, _index + start, length - start);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ReadOnlyMemory<T> Slice(int start, int length)
		{
			int length2 = _length;
			int num = _length & 0x7FFFFFFF;
			if ((uint)start > (uint)num || (uint)length > (uint)(num - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			return new ReadOnlyMemory<T>(_object, _index + start, length | (length2 & int.MinValue));
		}

		public void CopyTo(Memory<T> destination)
		{
			Span.CopyTo(destination.Span);
		}

		public bool TryCopyTo(Memory<T> destination)
		{
			return Span.TryCopyTo(destination.Span);
		}

		public unsafe MemoryHandle Pin()
		{
			if (_index < 0)
			{
				return ((MemoryManager<T>)_object).Pin(_index & 0x7FFFFFFF);
			}
			if (typeof(T) == typeof(char) && _object is string value)
			{
				GCHandle handle = GCHandle.Alloc(value, GCHandleType.Pinned);
				void* pointer = System.Runtime.CompilerServices.Unsafe.Add<T>((void*)handle.AddrOfPinnedObject(), _index);
				return new MemoryHandle(pointer, handle);
			}
			if (_object is T[] array)
			{
				if (_length < 0)
				{
					void* pointer2 = System.Runtime.CompilerServices.Unsafe.Add<T>(System.Runtime.CompilerServices.Unsafe.AsPointer<T>(ref MemoryMarshal.GetReference<T>(array)), _index);
					return new MemoryHandle(pointer2);
				}
				GCHandle handle2 = GCHandle.Alloc(array, GCHandleType.Pinned);
				void* pointer3 = System.Runtime.CompilerServices.Unsafe.Add<T>((void*)handle2.AddrOfPinnedObject(), _index);
				return new MemoryHandle(pointer3, handle2);
			}
			return default(MemoryHandle);
		}

		public T[] ToArray()
		{
			return Span.ToArray();
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public override bool Equals(object obj)
		{
			if (obj is ReadOnlyMemory<T> other)
			{
				return Equals(other);
			}
			if (obj is Memory<T> memory)
			{
				return Equals(memory);
			}
			return false;
		}

		public bool Equals(ReadOnlyMemory<T> other)
		{
			if (_object == other._object && _index == other._index)
			{
				return _length == other._length;
			}
			return false;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public override int GetHashCode()
		{
			if (_object == null)
			{
				return 0;
			}
			int hashCode = _object.GetHashCode();
			int index = _index;
			int hashCode2 = index.GetHashCode();
			index = _length;
			return CombineHashCodes(hashCode, hashCode2, index.GetHashCode());
		}

		private static int CombineHashCodes(int left, int right)
		{
			return ((left << 5) + left) ^ right;
		}

		private static int CombineHashCodes(int h1, int h2, int h3)
		{
			return CombineHashCodes(CombineHashCodes(h1, h2), h3);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal object GetObjectStartLength(out int start, out int length)
		{
			start = _index;
			length = _length;
			return _object;
		}
	}
	[DebuggerTypeProxy(typeof(System.SpanDebugView<>))]
	[DebuggerDisplay("{ToString(),raw}")]
	[DebuggerTypeProxy(typeof(System.SpanDebugView<>))]
	[DebuggerDisplay("{ToString(),raw}")]
	public readonly ref struct ReadOnlySpan<T>
	{
		public ref struct Enumerator
		{
			private readonly ReadOnlySpan<T> _span;

			private int _index;

			public ref readonly T Current
			{
				[MethodImpl(MethodImplOptions.AggressiveInlining)]
				get
				{
					return ref _span[_index];
				}
			}

			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			internal Enumerator(ReadOnlySpan<T> span)
			{
				_span = span;
				_index = -1;
			}

			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			public bool MoveNext()
			{
				int num = _index + 1;
				if (num < _span.Length)
				{
					_index = num;
					return true;
				}
				return false;
			}
		}

		private readonly Pinnable<T> _pinnable;

		private readonly IntPtr _byteOffset;

		private readonly int _length;

		public int Length => _length;

		public bool IsEmpty => _length == 0;

		public static ReadOnlySpan<T> Empty => default(ReadOnlySpan<T>);

		public unsafe ref readonly T this[int index]
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				if ((uint)index >= (uint)_length)
				{
					System.ThrowHelper.ThrowIndexOutOfRangeException();
				}
				if (_pinnable == null)
				{
					IntPtr byteOffset = _byteOffset;
					return ref System.Runtime.CompilerServices.Unsafe.Add<T>(ref System.Runtime.CompilerServices.Unsafe.AsRef<T>(byteOffset.ToPointer()), index);
				}
				return ref System.Runtime.CompilerServices.Unsafe.Add<T>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset<T>(ref _pinnable.Data, _byteOffset), index);
			}
		}

		internal Pinnable<T> Pinnable => _pinnable;

		internal IntPtr ByteOffset => _byteOffset;

		public static bool operator !=(ReadOnlySpan<T> left, ReadOnlySpan<T> right)
		{
			return !(left == right);
		}

		[Obsolete("Equals() on ReadOnlySpan will always throw an exception. Use == instead.")]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override bool Equals(object obj)
		{
			throw new NotSupportedException(System.SR.NotSupported_CannotCallEqualsOnSpan);
		}

		[Obsolete("GetHashCode() on ReadOnlySpan will always throw an exception.")]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override int GetHashCode()
		{
			throw new NotSupportedException(System.SR.NotSupported_CannotCallGetHashCodeOnSpan);
		}

		public static implicit operator ReadOnlySpan<T>(T[] array)
		{
			return new ReadOnlySpan<T>(array);
		}

		public static implicit operator ReadOnlySpan<T>(ArraySegment<T> segment)
		{
			return new ReadOnlySpan<T>(segment.Array, segment.Offset, segment.Count);
		}

		public Enumerator GetEnumerator()
		{
			return new Enumerator(this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ReadOnlySpan(T[] array)
		{
			if (array == null)
			{
				this = default(ReadOnlySpan<T>);
				return;
			}
			_length = array.Length;
			_pinnable = System.Runtime.CompilerServices.Unsafe.As<Pinnable<T>>((object)array);
			_byteOffset = System.SpanHelpers.PerTypeValues<T>.ArrayAdjustment;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ReadOnlySpan(T[] array, int start, int length)
		{
			if (array == null)
			{
				if (start != 0 || length != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
				}
				this = default(ReadOnlySpan<T>);
				return;
			}
			if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			_length = length;
			_pinnable = System.Runtime.CompilerServices.Unsafe.As<Pinnable<T>>((object)array);
			_byteOffset = System.SpanHelpers.PerTypeValues<T>.ArrayAdjustment.Add<T>(start);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[CLSCompliant(false)]
		public unsafe ReadOnlySpan(void* pointer, int length)
		{
			if (System.SpanHelpers.IsReferenceOrContainsReferences<T>())
			{
				System.ThrowHelper.ThrowArgumentException_InvalidTypeWithPointersNotSupported(typeof(T));
			}
			if (length < 0)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			_length = length;
			_pinnable = null;
			_byteOffset = new IntPtr(pointer);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal ReadOnlySpan(Pinnable<T> pinnable, IntPtr byteOffset, int length)
		{
			_length = length;
			_pinnable = pinnable;
			_byteOffset = byteOffset;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public unsafe ref readonly T GetPinnableReference()
		{
			if (_length != 0)
			{
				if (_pinnable == null)
				{
					IntPtr byteOffset = _byteOffset;
					return ref System.Runtime.CompilerServices.Unsafe.AsRef<T>(byteOffset.ToPointer());
				}
				return ref System.Runtime.CompilerServices.Unsafe.AddByteOffset<T>(ref _pinnable.Data, _byteOffset);
			}
			return ref System.Runtime.CompilerServices.Unsafe.AsRef<T>((void*)null);
		}

		public void CopyTo(Span<T> destination)
		{
			if (!TryCopyTo(destination))
			{
				System.ThrowHelper.ThrowArgumentException_DestinationTooShort();
			}
		}

		public bool TryCopyTo(Span<T> destination)
		{
			int length = _length;
			int length2 = destination.Length;
			if (length == 0)
			{
				return true;
			}
			if ((uint)length > (uint)length2)
			{
				return false;
			}
			ref T src = ref DangerousGetPinnableReference();
			System.SpanHelpers.CopyTo(ref destination.DangerousGetPinnableReference(), length2, ref src, length);
			return true;
		}

		public static bool operator ==(ReadOnlySpan<T> left, ReadOnlySpan<T> right)
		{
			if (left._length == right._length)
			{
				return System.Runtime.CompilerServices.Unsafe.AreSame<T>(ref left.DangerousGetPinnableReference(), ref right.DangerousGetPinnableReference());
			}
			return false;
		}

		public unsafe override string ToString()
		{
			if (typeof(T) == typeof(char))
			{
				if (_byteOffset == MemoryExtensions.StringAdjustment)
				{
					object obj = System.Runtime.CompilerServices.Unsafe.As<object>((object)_pinnable);
					if (obj is string text && _length == text.Length)
					{
						return text;
					}
				}
				fixed (char* value = &System.Runtime.CompilerServices.Unsafe.As<T, char>(ref DangerousGetPinnableReference()))
				{
					return new string(value, 0, _length);
				}
			}
			return $"System.ReadOnlySpan<{typeof(T).Name}>[{_length}]";
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ReadOnlySpan<T> Slice(int start)
		{
			if ((uint)start > (uint)_length)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			IntPtr byteOffset = _byteOffset.Add<T>(start);
			int length = _length - start;
			return new ReadOnlySpan<T>(_pinnable, byteOffset, length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ReadOnlySpan<T> Slice(int start, int length)
		{
			if ((uint)start > (uint)_length || (uint)length > (uint)(_length - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			IntPtr byteOffset = _byteOffset.Add<T>(start);
			return new ReadOnlySpan<T>(_pinnable, byteOffset, length);
		}

		public T[] ToArray()
		{
			if (_length == 0)
			{
				return System.SpanHelpers.PerTypeValues<T>.EmptyArray;
			}
			T[] array = new T[_length];
			CopyTo(array);
			return array;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		internal unsafe ref T DangerousGetPinnableReference()
		{
			if (_pinnable == null)
			{
				IntPtr byteOffset = _byteOffset;
				return ref System.Runtime.CompilerServices.Unsafe.AsRef<T>(byteOffset.ToPointer());
			}
			return ref System.Runtime.CompilerServices.Unsafe.AddByteOffset<T>(ref _pinnable.Data, _byteOffset);
		}
	}
	[DebuggerTypeProxy(typeof(System.SpanDebugView<>))]
	[DebuggerDisplay("{ToString(),raw}")]
	[DebuggerTypeProxy(typeof(System.SpanDebugView<>))]
	[DebuggerDisplay("{ToString(),raw}")]
	public readonly ref struct Span<T>
	{
		public ref struct Enumerator
		{
			private readonly Span<T> _span;

			private int _index;

			public ref T Current
			{
				[MethodImpl(MethodImplOptions.AggressiveInlining)]
				get
				{
					return ref _span[_index];
				}
			}

			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			internal Enumerator(Span<T> span)
			{
				_span = span;
				_index = -1;
			}

			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			public bool MoveNext()
			{
				int num = _index + 1;
				if (num < _span.Length)
				{
					_index = num;
					return true;
				}
				return false;
			}
		}

		private readonly Pinnable<T> _pinnable;

		private readonly IntPtr _byteOffset;

		private readonly int _length;

		public int Length => _length;

		public bool IsEmpty => _length == 0;

		public static Span<T> Empty => default(Span<T>);

		public unsafe ref T this[int index]
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				if ((uint)index >= (uint)_length)
				{
					System.ThrowHelper.ThrowIndexOutOfRangeException();
				}
				if (_pinnable == null)
				{
					IntPtr byteOffset = _byteOffset;
					return ref System.Runtime.CompilerServices.Unsafe.Add<T>(ref System.Runtime.CompilerServices.Unsafe.AsRef<T>(byteOffset.ToPointer()), index);
				}
				return ref System.Runtime.CompilerServices.Unsafe.Add<T>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset<T>(ref _pinnable.Data, _byteOffset), index);
			}
		}

		internal Pinnable<T> Pinnable => _pinnable;

		internal IntPtr ByteOffset => _byteOffset;

		public static bool operator !=(Span<T> left, Span<T> right)
		{
			return !(left == right);
		}

		[Obsolete("Equals() on Span will always throw an exception. Use == instead.")]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override bool Equals(object obj)
		{
			throw new NotSupportedException(System.SR.NotSupported_CannotCallEqualsOnSpan);
		}

		[Obsolete("GetHashCode() on Span will always throw an exception.")]
		[EditorBrowsable(EditorBrowsableState.Never)]
		public override int GetHashCode()
		{
			throw new NotSupportedException(System.SR.NotSupported_CannotCallGetHashCodeOnSpan);
		}

		public static implicit operator Span<T>(T[] array)
		{
			return new Span<T>(array);
		}

		public static implicit operator Span<T>(ArraySegment<T> segment)
		{
			return new Span<T>(segment.Array, segment.Offset, segment.Count);
		}

		public Enumerator GetEnumerator()
		{
			return new Enumerator(this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Span(T[] array)
		{
			if (array == null)
			{
				this = default(Span<T>);
				return;
			}
			if (default(T) == null && array.GetType() != typeof(T[]))
			{
				System.ThrowHelper.ThrowArrayTypeMismatchException();
			}
			_length = array.Length;
			_pinnable = System.Runtime.CompilerServices.Unsafe.As<Pinnable<T>>((object)array);
			_byteOffset = System.SpanHelpers.PerTypeValues<T>.ArrayAdjustment;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static Span<T> Create(T[] array, int start)
		{
			if (array == null)
			{
				if (start != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
				}
				return default(Span<T>);
			}
			if (default(T) == null && array.GetType() != typeof(T[]))
			{
				System.ThrowHelper.ThrowArrayTypeMismatchException();
			}
			if ((uint)start > (uint)array.Length)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			IntPtr byteOffset = System.SpanHelpers.PerTypeValues<T>.ArrayAdjustment.Add<T>(start);
			int length = array.Length - start;
			return new Span<T>(System.Runtime.CompilerServices.Unsafe.As<Pinnable<T>>((object)array), byteOffset, length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Span(T[] array, int start, int length)
		{
			if (array == null)
			{
				if (start != 0 || length != 0)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
				}
				this = default(Span<T>);
				return;
			}
			if (default(T) == null && array.GetType() != typeof(T[]))
			{
				System.ThrowHelper.ThrowArrayTypeMismatchException();
			}
			if ((uint)start > (uint)array.Length || (uint)length > (uint)(array.Length - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			_length = length;
			_pinnable = System.Runtime.CompilerServices.Unsafe.As<Pinnable<T>>((object)array);
			_byteOffset = System.SpanHelpers.PerTypeValues<T>.ArrayAdjustment.Add<T>(start);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[CLSCompliant(false)]
		public unsafe Span(void* pointer, int length)
		{
			if (System.SpanHelpers.IsReferenceOrContainsReferences<T>())
			{
				System.ThrowHelper.ThrowArgumentException_InvalidTypeWithPointersNotSupported(typeof(T));
			}
			if (length < 0)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			_length = length;
			_pinnable = null;
			_byteOffset = new IntPtr(pointer);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal Span(Pinnable<T> pinnable, IntPtr byteOffset, int length)
		{
			_length = length;
			_pinnable = pinnable;
			_byteOffset = byteOffset;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public unsafe ref T GetPinnableReference()
		{
			if (_length != 0)
			{
				if (_pinnable == null)
				{
					IntPtr byteOffset = _byteOffset;
					return ref System.Runtime.CompilerServices.Unsafe.AsRef<T>(byteOffset.ToPointer());
				}
				return ref System.Runtime.CompilerServices.Unsafe.AddByteOffset<T>(ref _pinnable.Data, _byteOffset);
			}
			return ref System.Runtime.CompilerServices.Unsafe.AsRef<T>((void*)null);
		}

		public unsafe void Clear()
		{
			int length = _length;
			if (length == 0)
			{
				return;
			}
			UIntPtr byteLength = (UIntPtr)(ulong)((uint)length * System.Runtime.CompilerServices.Unsafe.SizeOf<T>());
			if ((System.Runtime.CompilerServices.Unsafe.SizeOf<T>() & (sizeof(IntPtr) - 1)) != 0)
			{
				if (_pinnable == null)
				{
					IntPtr byteOffset = _byteOffset;
					byte* ptr = (byte*)byteOffset.ToPointer();
					System.SpanHelpers.ClearLessThanPointerSized(ptr, byteLength);
				}
				else
				{
					System.SpanHelpers.ClearLessThanPointerSized(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset<T>(ref _pinnable.Data, _byteOffset)), byteLength);
				}
			}
			else if (System.SpanHelpers.IsReferenceOrContainsReferences<T>())
			{
				UIntPtr pointerSizeLength = (UIntPtr)(ulong)(length * System.Runtime.CompilerServices.Unsafe.SizeOf<T>() / sizeof(IntPtr));
				System.SpanHelpers.ClearPointerSizedWithReferences(ref System.Runtime.CompilerServices.Unsafe.As<T, IntPtr>(ref DangerousGetPinnableReference()), pointerSizeLength);
			}
			else
			{
				System.SpanHelpers.ClearPointerSizedWithoutReferences(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref DangerousGetPinnableReference()), byteLength);
			}
		}

		public unsafe void Fill(T value)
		{
			int length = _length;
			if (length == 0)
			{
				return;
			}
			if (System.Runtime.CompilerServices.Unsafe.SizeOf<T>() == 1)
			{
				byte b = System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref value);
				if (_pinnable == null)
				{
					IntPtr byteOffset = _byteOffset;
					System.Runtime.CompilerServices.Unsafe.InitBlockUnaligned(byteOffset.ToPointer(), b, (uint)length);
				}
				else
				{
					System.Runtime.CompilerServices.Unsafe.InitBlockUnaligned(ref System.Runtime.CompilerServices.Unsafe.As<T, byte>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset<T>(ref _pinnable.Data, _byteOffset)), b, (uint)length);
				}
				return;
			}
			ref T reference = ref DangerousGetPinnableReference();
			int i;
			for (i = 0; i < (length & -8); i += 8)
			{
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 1) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 2) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 3) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 4) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 5) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 6) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 7) = value;
			}
			if (i < (length & -4))
			{
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 1) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 2) = value;
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i + 3) = value;
				i += 4;
			}
			for (; i < length; i++)
			{
				System.Runtime.CompilerServices.Unsafe.Add<T>(ref reference, i) = value;
			}
		}

		public void CopyTo(Span<T> destination)
		{
			if (!TryCopyTo(destination))
			{
				System.ThrowHelper.ThrowArgumentException_DestinationTooShort();
			}
		}

		public bool TryCopyTo(Span<T> destination)
		{
			int length = _length;
			int length2 = destination._length;
			if (length == 0)
			{
				return true;
			}
			if ((uint)length > (uint)length2)
			{
				return false;
			}
			ref T src = ref DangerousGetPinnableReference();
			System.SpanHelpers.CopyTo(ref destination.DangerousGetPinnableReference(), length2, ref src, length);
			return true;
		}

		public static bool operator ==(Span<T> left, Span<T> right)
		{
			if (left._length == right._length)
			{
				return System.Runtime.CompilerServices.Unsafe.AreSame<T>(ref left.DangerousGetPinnableReference(), ref right.DangerousGetPinnableReference());
			}
			return false;
		}

		public static implicit operator ReadOnlySpan<T>(Span<T> span)
		{
			return new ReadOnlySpan<T>(span._pinnable, span._byteOffset, span._length);
		}

		public unsafe override string ToString()
		{
			if (typeof(T) == typeof(char))
			{
				fixed (char* value = &System.Runtime.CompilerServices.Unsafe.As<T, char>(ref DangerousGetPinnableReference()))
				{
					return new string(value, 0, _length);
				}
			}
			return $"System.Span<{typeof(T).Name}>[{_length}]";
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Span<T> Slice(int start)
		{
			if ((uint)start > (uint)_length)
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			IntPtr byteOffset = _byteOffset.Add<T>(start);
			int length = _length - start;
			return new Span<T>(_pinnable, byteOffset, length);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Span<T> Slice(int start, int length)
		{
			if ((uint)start > (uint)_length || (uint)length > (uint)(_length - start))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.start);
			}
			IntPtr byteOffset = _byteOffset.Add<T>(start);
			return new Span<T>(_pinnable, byteOffset, length);
		}

		public T[] ToArray()
		{
			if (_length == 0)
			{
				return System.SpanHelpers.PerTypeValues<T>.EmptyArray;
			}
			T[] array = new T[_length];
			CopyTo(array);
			return array;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[EditorBrowsable(EditorBrowsableState.Never)]
		internal unsafe ref T DangerousGetPinnableReference()
		{
			if (_pinnable == null)
			{
				IntPtr byteOffset = _byteOffset;
				return ref System.Runtime.CompilerServices.Unsafe.AsRef<T>(byteOffset.ToPointer());
			}
			return ref System.Runtime.CompilerServices.Unsafe.AddByteOffset<T>(ref _pinnable.Data, _byteOffset);
		}
	}
	internal sealed class SpanDebugView<T>
	{
		private readonly T[] _array;

		[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
		public T[] Items => _array;

		public SpanDebugView(Span<T> span)
		{
			_array = span.ToArray();
		}

		public SpanDebugView(ReadOnlySpan<T> span)
		{
			_array = span.ToArray();
		}
	}
	internal static class SpanHelpers
	{
		internal struct ComparerComparable<T, TComparer> : IComparable<T> where TComparer : IComparer<T>
		{
			private readonly T _value;

			private readonly TComparer _comparer;

			public ComparerComparable(T value, TComparer comparer)
			{
				_value = value;
				_comparer = comparer;
			}

			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			public int CompareTo(T other)
			{
				return _comparer.Compare(_value, other);
			}
		}

		[StructLayout(LayoutKind.Sequential, Size = 64)]
		private struct Reg64
		{
		}

		[StructLayout(LayoutKind.Sequential, Size = 32)]
		private struct Reg32
		{
		}

		[StructLayout(LayoutKind.Sequential, Size = 16)]
		private struct Reg16
		{
		}

		public static class PerTypeValues<T>
		{
			public static readonly bool IsReferenceOrContainsReferences = IsReferenceOrContainsReferencesCore(typeof(T));

			public static readonly T[] EmptyArray = new T[0];

			public static readonly IntPtr ArrayAdjustment = MeasureArrayAdjustment();

			private static IntPtr MeasureArrayAdjustment()
			{
				T[] array = new T[1];
				return System.Runtime.CompilerServices.Unsafe.ByteOffset<T>(ref System.Runtime.CompilerServices.Unsafe.As<Pinnable<T>>((object)array).Data, ref array[0]);
			}
		}

		private const ulong XorPowerOfTwoToHighByte = 283686952306184uL;

		private const ulong XorPowerOfTwoToHighChar = 4295098372uL;

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int BinarySearch<T, TComparable>(this ReadOnlySpan<T> span, TComparable comparable) where TComparable : IComparable<T>
		{
			if (comparable == null)
			{
				System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.comparable);
			}
			return BinarySearch(ref MemoryMarshal.GetReference(span), span.Length, comparable);
		}

		public static int BinarySearch<T, TComparable>(ref T spanStart, int length, TComparable comparable) where TComparable : IComparable<T>
		{
			int num = 0;
			int num2 = length - 1;
			while (num <= num2)
			{
				int num3 = num2 + num >>> 1;
				int num4 = comparable.CompareTo(System.Runtime.CompilerServices.Unsafe.Add<T>(ref spanStart, num3));
				if (num4 == 0)
				{
					return num3;
				}
				if (num4 > 0)
				{
					num = num3 + 1;
				}
				else
				{
					num2 = num3 - 1;
				}
			}
			return ~num;
		}

		public static int IndexOf(ref byte searchSpace, int searchSpaceLength, ref byte value, int valueLength)
		{
			if (valueLength == 0)
			{
				return 0;
			}
			byte value2 = value;
			ref byte second = ref System.Runtime.CompilerServices.Unsafe.Add<byte>(ref value, 1);
			int num = valueLength - 1;
			int num2 = 0;
			while (true)
			{
				int num3 = searchSpaceLength - num2 - num;
				if (num3 <= 0)
				{
					break;
				}
				int num4 = IndexOf(ref System.Runtime.CompilerServices.Unsafe.Add<byte>(ref searchSpace, num2), value2, num3);
				if (num4 == -1)
				{
					break;
				}
				num2 += num4;
				if (SequenceEqual(ref System.Runtime.CompilerServices.Unsafe.Add<byte>(ref searchSpace, num2 + 1), ref second, num))
				{
					return num2;
				}
				num2++;
			}
			return -1;
		}

		public static int IndexOfAny(ref byte searchSpace, int searchSpaceLength, ref byte value, int valueLength)
		{
			if (valueLength == 0)
			{
				return 0;
			}
			int num = -1;
			for (int i = 0; i < valueLength; i++)
			{
				int num2 = IndexOf(ref searchSpace, System.Runtime.CompilerServices.Unsafe.Add<byte>(ref value, i), searchSpaceLength);
				if ((uint)num2 < (uint)num)
				{
					num = num2;
					searchSpaceLength = num2;
					if (num == 0)
					{
						break;
			

BepInEx\plugins\Cyberhead\System.Numerics.Vectors.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Globalization;
using System.Numerics;
using System.Numerics.Hashing;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using FxResources.System.Numerics.Vectors;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyTitle("System.Numerics.Vectors")]
[assembly: AssemblyDescription("System.Numerics.Vectors")]
[assembly: AssemblyDefaultAlias("System.Numerics.Vectors")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation.  All rights reserved.")]
[assembly: AssemblyFileVersion("4.6.26515.06")]
[assembly: AssemblyInformationalVersion("4.6.26515.06 @BuiltBy: dlab-DDVSOWINAGE059 @Branch: release/2.1 @SrcCode: https://github.com/dotnet/corefx/tree/30ab651fcb4354552bd4891619a0bdd81e0ebdbf")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("4.1.4.0")]
[assembly: TypeForwardedTo(typeof(Matrix3x2))]
[assembly: TypeForwardedTo(typeof(Matrix4x4))]
[assembly: TypeForwardedTo(typeof(Plane))]
[assembly: TypeForwardedTo(typeof(Quaternion))]
[assembly: TypeForwardedTo(typeof(Vector2))]
[assembly: TypeForwardedTo(typeof(Vector3))]
[assembly: TypeForwardedTo(typeof(Vector4))]
[module: UnverifiableCode]
namespace FxResources.System.Numerics.Vectors
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class MathF
	{
		public const float PI = 3.1415927f;

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Abs(float x)
		{
			return Math.Abs(x);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Acos(float x)
		{
			return (float)Math.Acos(x);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Cos(float x)
		{
			return (float)Math.Cos(x);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float IEEERemainder(float x, float y)
		{
			return (float)Math.IEEERemainder(x, y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Pow(float x, float y)
		{
			return (float)Math.Pow(x, y);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Sin(float x)
		{
			return (float)Math.Sin(x);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Sqrt(float x)
		{
			return (float)Math.Sqrt(x);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static float Tan(float x)
		{
			return (float)Math.Tan(x);
		}
	}
	internal static class SR
	{
		private static ResourceManager s_resourceManager;

		private static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(ResourceType));

		internal static Type ResourceType { get; } = typeof(SR);


		internal static string Arg_ArgumentOutOfRangeException => GetResourceString("Arg_ArgumentOutOfRangeException", null);

		internal static string Arg_ElementsInSourceIsGreaterThanDestination => GetResourceString("Arg_ElementsInSourceIsGreaterThanDestination", null);

		internal static string Arg_NullArgumentNullRef => GetResourceString("Arg_NullArgumentNullRef", null);

		internal static string Arg_TypeNotSupported => GetResourceString("Arg_TypeNotSupported", null);

		internal static string Arg_InsufficientNumberOfElements => GetResourceString("Arg_InsufficientNumberOfElements", null);

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static bool UsingResourceKeys()
		{
			return false;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string text = null;
			try
			{
				text = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			if (defaultString != null && resourceKey.Equals(text, StringComparison.Ordinal))
			{
				return defaultString;
			}
			return text;
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Field, Inherited = false)]
	internal sealed class IntrinsicAttribute : Attribute
	{
	}
}
namespace System.Numerics
{
	internal class ConstantHelper
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static byte GetByteWithAllBitsSet()
		{
			byte result = 0;
			result = byte.MaxValue;
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static sbyte GetSByteWithAllBitsSet()
		{
			sbyte result = 0;
			result = -1;
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static ushort GetUInt16WithAllBitsSet()
		{
			ushort result = 0;
			result = ushort.MaxValue;
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static short GetInt16WithAllBitsSet()
		{
			short result = 0;
			result = -1;
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static uint GetUInt32WithAllBitsSet()
		{
			uint result = 0u;
			result = uint.MaxValue;
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int GetInt32WithAllBitsSet()
		{
			int result = 0;
			result = -1;
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static ulong GetUInt64WithAllBitsSet()
		{
			ulong result = 0uL;
			result = ulong.MaxValue;
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static long GetInt64WithAllBitsSet()
		{
			long result = 0L;
			result = -1L;
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public unsafe static float GetSingleWithAllBitsSet()
		{
			float result = 0f;
			*(int*)(&result) = -1;
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public unsafe static double GetDoubleWithAllBitsSet()
		{
			double result = 0.0;
			*(long*)(&result) = -1L;
			return result;
		}
	}
	[StructLayout(LayoutKind.Explicit)]
	internal struct Register
	{
		[FieldOffset(0)]
		internal byte byte_0;

		[FieldOffset(1)]
		internal byte byte_1;

		[FieldOffset(2)]
		internal byte byte_2;

		[FieldOffset(3)]
		internal byte byte_3;

		[FieldOffset(4)]
		internal byte byte_4;

		[FieldOffset(5)]
		internal byte byte_5;

		[FieldOffset(6)]
		internal byte byte_6;

		[FieldOffset(7)]
		internal byte byte_7;

		[FieldOffset(8)]
		internal byte byte_8;

		[FieldOffset(9)]
		internal byte byte_9;

		[FieldOffset(10)]
		internal byte byte_10;

		[FieldOffset(11)]
		internal byte byte_11;

		[FieldOffset(12)]
		internal byte byte_12;

		[FieldOffset(13)]
		internal byte byte_13;

		[FieldOffset(14)]
		internal byte byte_14;

		[FieldOffset(15)]
		internal byte byte_15;

		[FieldOffset(0)]
		internal sbyte sbyte_0;

		[FieldOffset(1)]
		internal sbyte sbyte_1;

		[FieldOffset(2)]
		internal sbyte sbyte_2;

		[FieldOffset(3)]
		internal sbyte sbyte_3;

		[FieldOffset(4)]
		internal sbyte sbyte_4;

		[FieldOffset(5)]
		internal sbyte sbyte_5;

		[FieldOffset(6)]
		internal sbyte sbyte_6;

		[FieldOffset(7)]
		internal sbyte sbyte_7;

		[FieldOffset(8)]
		internal sbyte sbyte_8;

		[FieldOffset(9)]
		internal sbyte sbyte_9;

		[FieldOffset(10)]
		internal sbyte sbyte_10;

		[FieldOffset(11)]
		internal sbyte sbyte_11;

		[FieldOffset(12)]
		internal sbyte sbyte_12;

		[FieldOffset(13)]
		internal sbyte sbyte_13;

		[FieldOffset(14)]
		internal sbyte sbyte_14;

		[FieldOffset(15)]
		internal sbyte sbyte_15;

		[FieldOffset(0)]
		internal ushort uint16_0;

		[FieldOffset(2)]
		internal ushort uint16_1;

		[FieldOffset(4)]
		internal ushort uint16_2;

		[FieldOffset(6)]
		internal ushort uint16_3;

		[FieldOffset(8)]
		internal ushort uint16_4;

		[FieldOffset(10)]
		internal ushort uint16_5;

		[FieldOffset(12)]
		internal ushort uint16_6;

		[FieldOffset(14)]
		internal ushort uint16_7;

		[FieldOffset(0)]
		internal short int16_0;

		[FieldOffset(2)]
		internal short int16_1;

		[FieldOffset(4)]
		internal short int16_2;

		[FieldOffset(6)]
		internal short int16_3;

		[FieldOffset(8)]
		internal short int16_4;

		[FieldOffset(10)]
		internal short int16_5;

		[FieldOffset(12)]
		internal short int16_6;

		[FieldOffset(14)]
		internal short int16_7;

		[FieldOffset(0)]
		internal uint uint32_0;

		[FieldOffset(4)]
		internal uint uint32_1;

		[FieldOffset(8)]
		internal uint uint32_2;

		[FieldOffset(12)]
		internal uint uint32_3;

		[FieldOffset(0)]
		internal int int32_0;

		[FieldOffset(4)]
		internal int int32_1;

		[FieldOffset(8)]
		internal int int32_2;

		[FieldOffset(12)]
		internal int int32_3;

		[FieldOffset(0)]
		internal ulong uint64_0;

		[FieldOffset(8)]
		internal ulong uint64_1;

		[FieldOffset(0)]
		internal long int64_0;

		[FieldOffset(8)]
		internal long int64_1;

		[FieldOffset(0)]
		internal float single_0;

		[FieldOffset(4)]
		internal float single_1;

		[FieldOffset(8)]
		internal float single_2;

		[FieldOffset(12)]
		internal float single_3;

		[FieldOffset(0)]
		internal double double_0;

		[FieldOffset(8)]
		internal double double_1;
	}
	[System.Runtime.CompilerServices.Intrinsic]
	public struct Vector<T> : IEquatable<Vector<T>>, IFormattable where T : struct
	{
		private struct VectorSizeHelper
		{
			internal Vector<T> _placeholder;

			internal byte _byte;
		}

		private System.Numerics.Register register;

		private static readonly int s_count = InitializeCount();

		private static readonly Vector<T> s_zero = default(Vector<T>);

		private static readonly Vector<T> s_one = new Vector<T>(GetOneValue());

		private static readonly Vector<T> s_allOnes = new Vector<T>(GetAllBitsSetValue());

		public static int Count
		{
			[System.Runtime.CompilerServices.Intrinsic]
			get
			{
				return s_count;
			}
		}

		public static Vector<T> Zero
		{
			[System.Runtime.CompilerServices.Intrinsic]
			get
			{
				return s_zero;
			}
		}

		public static Vector<T> One
		{
			[System.Runtime.CompilerServices.Intrinsic]
			get
			{
				return s_one;
			}
		}

		internal static Vector<T> AllOnes => s_allOnes;

		public unsafe T this[int index]
		{
			[System.Runtime.CompilerServices.Intrinsic]
			get
			{
				if (index >= Count || index < 0)
				{
					throw new IndexOutOfRangeException(System.SR.Format(System.SR.Arg_ArgumentOutOfRangeException, index));
				}
				if (typeof(T) == typeof(byte))
				{
					fixed (byte* ptr = &register.byte_0)
					{
						return (T)(object)ptr[index];
					}
				}
				if (typeof(T) == typeof(sbyte))
				{
					fixed (sbyte* ptr2 = &register.sbyte_0)
					{
						return (T)(object)ptr2[index];
					}
				}
				if (typeof(T) == typeof(ushort))
				{
					fixed (ushort* ptr3 = &register.uint16_0)
					{
						return (T)(object)ptr3[index];
					}
				}
				if (typeof(T) == typeof(short))
				{
					fixed (short* ptr4 = &register.int16_0)
					{
						return (T)(object)ptr4[index];
					}
				}
				if (typeof(T) == typeof(uint))
				{
					fixed (uint* ptr5 = &register.uint32_0)
					{
						return (T)(object)ptr5[index];
					}
				}
				if (typeof(T) == typeof(int))
				{
					fixed (int* ptr6 = &register.int32_0)
					{
						return (T)(object)ptr6[index];
					}
				}
				if (typeof(T) == typeof(ulong))
				{
					fixed (ulong* ptr7 = &register.uint64_0)
					{
						return (T)(object)ptr7[index];
					}
				}
				if (typeof(T) == typeof(long))
				{
					fixed (long* ptr8 = &register.int64_0)
					{
						return (T)(object)ptr8[index];
					}
				}
				if (typeof(T) == typeof(float))
				{
					fixed (float* ptr9 = &register.single_0)
					{
						return (T)(object)ptr9[index];
					}
				}
				if (typeof(T) == typeof(double))
				{
					fixed (double* ptr10 = &register.double_0)
					{
						return (T)(object)ptr10[index];
					}
				}
				throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
			}
		}

		private unsafe static int InitializeCount()
		{
			VectorSizeHelper vectorSizeHelper = default(VectorSizeHelper);
			byte* ptr = &vectorSizeHelper._placeholder.register.byte_0;
			byte* ptr2 = &vectorSizeHelper._byte;
			int num = (int)(ptr2 - ptr);
			int num2 = -1;
			if (typeof(T) == typeof(byte))
			{
				num2 = 1;
			}
			else if (typeof(T) == typeof(sbyte))
			{
				num2 = 1;
			}
			else if (typeof(T) == typeof(ushort))
			{
				num2 = 2;
			}
			else if (typeof(T) == typeof(short))
			{
				num2 = 2;
			}
			else if (typeof(T) == typeof(uint))
			{
				num2 = 4;
			}
			else if (typeof(T) == typeof(int))
			{
				num2 = 4;
			}
			else if (typeof(T) == typeof(ulong))
			{
				num2 = 8;
			}
			else if (typeof(T) == typeof(long))
			{
				num2 = 8;
			}
			else if (typeof(T) == typeof(float))
			{
				num2 = 4;
			}
			else
			{
				if (!(typeof(T) == typeof(double)))
				{
					throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
				}
				num2 = 8;
			}
			return num / num2;
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public unsafe Vector(T value)
		{
			this = default(Vector<T>);
			if (Vector.IsHardwareAccelerated)
			{
				if (typeof(T) == typeof(byte))
				{
					fixed (byte* ptr = &register.byte_0)
					{
						for (int i = 0; i < Count; i++)
						{
							ptr[i] = (byte)(object)value;
						}
					}
				}
				else if (typeof(T) == typeof(sbyte))
				{
					fixed (sbyte* ptr2 = &register.sbyte_0)
					{
						for (int j = 0; j < Count; j++)
						{
							ptr2[j] = (sbyte)(object)value;
						}
					}
				}
				else if (typeof(T) == typeof(ushort))
				{
					fixed (ushort* ptr3 = &register.uint16_0)
					{
						for (int k = 0; k < Count; k++)
						{
							ptr3[k] = (ushort)(object)value;
						}
					}
				}
				else if (typeof(T) == typeof(short))
				{
					fixed (short* ptr4 = &register.int16_0)
					{
						for (int l = 0; l < Count; l++)
						{
							ptr4[l] = (short)(object)value;
						}
					}
				}
				else if (typeof(T) == typeof(uint))
				{
					fixed (uint* ptr5 = &register.uint32_0)
					{
						for (int m = 0; m < Count; m++)
						{
							ptr5[m] = (uint)(object)value;
						}
					}
				}
				else if (typeof(T) == typeof(int))
				{
					fixed (int* ptr6 = &register.int32_0)
					{
						for (int n = 0; n < Count; n++)
						{
							ptr6[n] = (int)(object)value;
						}
					}
				}
				else if (typeof(T) == typeof(ulong))
				{
					fixed (ulong* ptr7 = &register.uint64_0)
					{
						for (int num = 0; num < Count; num++)
						{
							ptr7[num] = (ulong)(object)value;
						}
					}
				}
				else if (typeof(T) == typeof(long))
				{
					fixed (long* ptr8 = &register.int64_0)
					{
						for (int num2 = 0; num2 < Count; num2++)
						{
							ptr8[num2] = (long)(object)value;
						}
					}
				}
				else if (typeof(T) == typeof(float))
				{
					fixed (float* ptr9 = &register.single_0)
					{
						for (int num3 = 0; num3 < Count; num3++)
						{
							ptr9[num3] = (float)(object)value;
						}
					}
				}
				else
				{
					if (!(typeof(T) == typeof(double)))
					{
						return;
					}
					fixed (double* ptr10 = &register.double_0)
					{
						for (int num4 = 0; num4 < Count; num4++)
						{
							ptr10[num4] = (double)(object)value;
						}
					}
				}
			}
			else if (typeof(T) == typeof(byte))
			{
				register.byte_0 = (byte)(object)value;
				register.byte_1 = (byte)(object)value;
				register.byte_2 = (byte)(object)value;
				register.byte_3 = (byte)(object)value;
				register.byte_4 = (byte)(object)value;
				register.byte_5 = (byte)(object)value;
				register.byte_6 = (byte)(object)value;
				register.byte_7 = (byte)(object)value;
				register.byte_8 = (byte)(object)value;
				register.byte_9 = (byte)(object)value;
				register.byte_10 = (byte)(object)value;
				register.byte_11 = (byte)(object)value;
				register.byte_12 = (byte)(object)value;
				register.byte_13 = (byte)(object)value;
				register.byte_14 = (byte)(object)value;
				register.byte_15 = (byte)(object)value;
			}
			else if (typeof(T) == typeof(sbyte))
			{
				register.sbyte_0 = (sbyte)(object)value;
				register.sbyte_1 = (sbyte)(object)value;
				register.sbyte_2 = (sbyte)(object)value;
				register.sbyte_3 = (sbyte)(object)value;
				register.sbyte_4 = (sbyte)(object)value;
				register.sbyte_5 = (sbyte)(object)value;
				register.sbyte_6 = (sbyte)(object)value;
				register.sbyte_7 = (sbyte)(object)value;
				register.sbyte_8 = (sbyte)(object)value;
				register.sbyte_9 = (sbyte)(object)value;
				register.sbyte_10 = (sbyte)(object)value;
				register.sbyte_11 = (sbyte)(object)value;
				register.sbyte_12 = (sbyte)(object)value;
				register.sbyte_13 = (sbyte)(object)value;
				register.sbyte_14 = (sbyte)(object)value;
				register.sbyte_15 = (sbyte)(object)value;
			}
			else if (typeof(T) == typeof(ushort))
			{
				register.uint16_0 = (ushort)(object)value;
				register.uint16_1 = (ushort)(object)value;
				register.uint16_2 = (ushort)(object)value;
				register.uint16_3 = (ushort)(object)value;
				register.uint16_4 = (ushort)(object)value;
				register.uint16_5 = (ushort)(object)value;
				register.uint16_6 = (ushort)(object)value;
				register.uint16_7 = (ushort)(object)value;
			}
			else if (typeof(T) == typeof(short))
			{
				register.int16_0 = (short)(object)value;
				register.int16_1 = (short)(object)value;
				register.int16_2 = (short)(object)value;
				register.int16_3 = (short)(object)value;
				register.int16_4 = (short)(object)value;
				register.int16_5 = (short)(object)value;
				register.int16_6 = (short)(object)value;
				register.int16_7 = (short)(object)value;
			}
			else if (typeof(T) == typeof(uint))
			{
				register.uint32_0 = (uint)(object)value;
				register.uint32_1 = (uint)(object)value;
				register.uint32_2 = (uint)(object)value;
				register.uint32_3 = (uint)(object)value;
			}
			else if (typeof(T) == typeof(int))
			{
				register.int32_0 = (int)(object)value;
				register.int32_1 = (int)(object)value;
				register.int32_2 = (int)(object)value;
				register.int32_3 = (int)(object)value;
			}
			else if (typeof(T) == typeof(ulong))
			{
				register.uint64_0 = (ulong)(object)value;
				register.uint64_1 = (ulong)(object)value;
			}
			else if (typeof(T) == typeof(long))
			{
				register.int64_0 = (long)(object)value;
				register.int64_1 = (long)(object)value;
			}
			else if (typeof(T) == typeof(float))
			{
				register.single_0 = (float)(object)value;
				register.single_1 = (float)(object)value;
				register.single_2 = (float)(object)value;
				register.single_3 = (float)(object)value;
			}
			else if (typeof(T) == typeof(double))
			{
				register.double_0 = (double)(object)value;
				register.double_1 = (double)(object)value;
			}
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public Vector(T[] values)
			: this(values, 0)
		{
		}

		public unsafe Vector(T[] values, int index)
		{
			this = default(Vector<T>);
			if (values == null)
			{
				throw new NullReferenceException(System.SR.Arg_NullArgumentNullRef);
			}
			if (index < 0 || values.Length - index < Count)
			{
				throw new IndexOutOfRangeException(System.SR.Format(System.SR.Arg_InsufficientNumberOfElements, Count, "values"));
			}
			if (Vector.IsHardwareAccelerated)
			{
				if (typeof(T) == typeof(byte))
				{
					fixed (byte* ptr = &register.byte_0)
					{
						for (int i = 0; i < Count; i++)
						{
							ptr[i] = (byte)(object)values[i + index];
						}
					}
				}
				else if (typeof(T) == typeof(sbyte))
				{
					fixed (sbyte* ptr2 = &register.sbyte_0)
					{
						for (int j = 0; j < Count; j++)
						{
							ptr2[j] = (sbyte)(object)values[j + index];
						}
					}
				}
				else if (typeof(T) == typeof(ushort))
				{
					fixed (ushort* ptr3 = &register.uint16_0)
					{
						for (int k = 0; k < Count; k++)
						{
							ptr3[k] = (ushort)(object)values[k + index];
						}
					}
				}
				else if (typeof(T) == typeof(short))
				{
					fixed (short* ptr4 = &register.int16_0)
					{
						for (int l = 0; l < Count; l++)
						{
							ptr4[l] = (short)(object)values[l + index];
						}
					}
				}
				else if (typeof(T) == typeof(uint))
				{
					fixed (uint* ptr5 = &register.uint32_0)
					{
						for (int m = 0; m < Count; m++)
						{
							ptr5[m] = (uint)(object)values[m + index];
						}
					}
				}
				else if (typeof(T) == typeof(int))
				{
					fixed (int* ptr6 = &register.int32_0)
					{
						for (int n = 0; n < Count; n++)
						{
							ptr6[n] = (int)(object)values[n + index];
						}
					}
				}
				else if (typeof(T) == typeof(ulong))
				{
					fixed (ulong* ptr7 = &register.uint64_0)
					{
						for (int num = 0; num < Count; num++)
						{
							ptr7[num] = (ulong)(object)values[num + index];
						}
					}
				}
				else if (typeof(T) == typeof(long))
				{
					fixed (long* ptr8 = &register.int64_0)
					{
						for (int num2 = 0; num2 < Count; num2++)
						{
							ptr8[num2] = (long)(object)values[num2 + index];
						}
					}
				}
				else if (typeof(T) == typeof(float))
				{
					fixed (float* ptr9 = &register.single_0)
					{
						for (int num3 = 0; num3 < Count; num3++)
						{
							ptr9[num3] = (float)(object)values[num3 + index];
						}
					}
				}
				else
				{
					if (!(typeof(T) == typeof(double)))
					{
						return;
					}
					fixed (double* ptr10 = &register.double_0)
					{
						for (int num4 = 0; num4 < Count; num4++)
						{
							ptr10[num4] = (double)(object)values[num4 + index];
						}
					}
				}
			}
			else if (typeof(T) == typeof(byte))
			{
				fixed (byte* ptr11 = &register.byte_0)
				{
					*ptr11 = (byte)(object)values[index];
					ptr11[1] = (byte)(object)values[1 + index];
					ptr11[2] = (byte)(object)values[2 + index];
					ptr11[3] = (byte)(object)values[3 + index];
					ptr11[4] = (byte)(object)values[4 + index];
					ptr11[5] = (byte)(object)values[5 + index];
					ptr11[6] = (byte)(object)values[6 + index];
					ptr11[7] = (byte)(object)values[7 + index];
					ptr11[8] = (byte)(object)values[8 + index];
					ptr11[9] = (byte)(object)values[9 + index];
					ptr11[10] = (byte)(object)values[10 + index];
					ptr11[11] = (byte)(object)values[11 + index];
					ptr11[12] = (byte)(object)values[12 + index];
					ptr11[13] = (byte)(object)values[13 + index];
					ptr11[14] = (byte)(object)values[14 + index];
					ptr11[15] = (byte)(object)values[15 + index];
				}
			}
			else if (typeof(T) == typeof(sbyte))
			{
				fixed (sbyte* ptr12 = &register.sbyte_0)
				{
					*ptr12 = (sbyte)(object)values[index];
					ptr12[1] = (sbyte)(object)values[1 + index];
					ptr12[2] = (sbyte)(object)values[2 + index];
					ptr12[3] = (sbyte)(object)values[3 + index];
					ptr12[4] = (sbyte)(object)values[4 + index];
					ptr12[5] = (sbyte)(object)values[5 + index];
					ptr12[6] = (sbyte)(object)values[6 + index];
					ptr12[7] = (sbyte)(object)values[7 + index];
					ptr12[8] = (sbyte)(object)values[8 + index];
					ptr12[9] = (sbyte)(object)values[9 + index];
					ptr12[10] = (sbyte)(object)values[10 + index];
					ptr12[11] = (sbyte)(object)values[11 + index];
					ptr12[12] = (sbyte)(object)values[12 + index];
					ptr12[13] = (sbyte)(object)values[13 + index];
					ptr12[14] = (sbyte)(object)values[14 + index];
					ptr12[15] = (sbyte)(object)values[15 + index];
				}
			}
			else if (typeof(T) == typeof(ushort))
			{
				fixed (ushort* ptr13 = &register.uint16_0)
				{
					*ptr13 = (ushort)(object)values[index];
					ptr13[1] = (ushort)(object)values[1 + index];
					ptr13[2] = (ushort)(object)values[2 + index];
					ptr13[3] = (ushort)(object)values[3 + index];
					ptr13[4] = (ushort)(object)values[4 + index];
					ptr13[5] = (ushort)(object)values[5 + index];
					ptr13[6] = (ushort)(object)values[6 + index];
					ptr13[7] = (ushort)(object)values[7 + index];
				}
			}
			else if (typeof(T) == typeof(short))
			{
				fixed (short* ptr14 = &register.int16_0)
				{
					*ptr14 = (short)(object)values[index];
					ptr14[1] = (short)(object)values[1 + index];
					ptr14[2] = (short)(object)values[2 + index];
					ptr14[3] = (short)(object)values[3 + index];
					ptr14[4] = (short)(object)values[4 + index];
					ptr14[5] = (short)(object)values[5 + index];
					ptr14[6] = (short)(object)values[6 + index];
					ptr14[7] = (short)(object)values[7 + index];
				}
			}
			else if (typeof(T) == typeof(uint))
			{
				fixed (uint* ptr15 = &register.uint32_0)
				{
					*ptr15 = (uint)(object)values[index];
					ptr15[1] = (uint)(object)values[1 + index];
					ptr15[2] = (uint)(object)values[2 + index];
					ptr15[3] = (uint)(object)values[3 + index];
				}
			}
			else if (typeof(T) == typeof(int))
			{
				fixed (int* ptr16 = &register.int32_0)
				{
					*ptr16 = (int)(object)values[index];
					ptr16[1] = (int)(object)values[1 + index];
					ptr16[2] = (int)(object)values[2 + index];
					ptr16[3] = (int)(object)values[3 + index];
				}
			}
			else if (typeof(T) == typeof(ulong))
			{
				fixed (ulong* ptr17 = &register.uint64_0)
				{
					*ptr17 = (ulong)(object)values[index];
					ptr17[1] = (ulong)(object)values[1 + index];
				}
			}
			else if (typeof(T) == typeof(long))
			{
				fixed (long* ptr18 = &register.int64_0)
				{
					*ptr18 = (long)(object)values[index];
					ptr18[1] = (long)(object)values[1 + index];
				}
			}
			else if (typeof(T) == typeof(float))
			{
				fixed (float* ptr19 = &register.single_0)
				{
					*ptr19 = (float)(object)values[index];
					ptr19[1] = (float)(object)values[1 + index];
					ptr19[2] = (float)(object)values[2 + index];
					ptr19[3] = (float)(object)values[3 + index];
				}
			}
			else if (typeof(T) == typeof(double))
			{
				fixed (double* ptr20 = &register.double_0)
				{
					*ptr20 = (double)(object)values[index];
					ptr20[1] = (double)(object)values[1 + index];
				}
			}
		}

		internal unsafe Vector(void* dataPointer)
			: this(dataPointer, 0)
		{
		}

		internal unsafe Vector(void* dataPointer, int offset)
		{
			this = default(Vector<T>);
			if (typeof(T) == typeof(byte))
			{
				byte* ptr = (byte*)dataPointer;
				ptr += offset;
				fixed (byte* ptr2 = &register.byte_0)
				{
					for (int i = 0; i < Count; i++)
					{
						ptr2[i] = ptr[i];
					}
				}
				return;
			}
			if (typeof(T) == typeof(sbyte))
			{
				sbyte* ptr3 = (sbyte*)dataPointer;
				ptr3 += offset;
				fixed (sbyte* ptr4 = &register.sbyte_0)
				{
					for (int j = 0; j < Count; j++)
					{
						ptr4[j] = ptr3[j];
					}
				}
				return;
			}
			if (typeof(T) == typeof(ushort))
			{
				ushort* ptr5 = (ushort*)dataPointer;
				ptr5 += offset;
				fixed (ushort* ptr6 = &register.uint16_0)
				{
					for (int k = 0; k < Count; k++)
					{
						ptr6[k] = ptr5[k];
					}
				}
				return;
			}
			if (typeof(T) == typeof(short))
			{
				short* ptr7 = (short*)dataPointer;
				ptr7 += offset;
				fixed (short* ptr8 = &register.int16_0)
				{
					for (int l = 0; l < Count; l++)
					{
						ptr8[l] = ptr7[l];
					}
				}
				return;
			}
			if (typeof(T) == typeof(uint))
			{
				uint* ptr9 = (uint*)dataPointer;
				ptr9 += offset;
				fixed (uint* ptr10 = &register.uint32_0)
				{
					for (int m = 0; m < Count; m++)
					{
						ptr10[m] = ptr9[m];
					}
				}
				return;
			}
			if (typeof(T) == typeof(int))
			{
				int* ptr11 = (int*)dataPointer;
				ptr11 += offset;
				fixed (int* ptr12 = &register.int32_0)
				{
					for (int n = 0; n < Count; n++)
					{
						ptr12[n] = ptr11[n];
					}
				}
				return;
			}
			if (typeof(T) == typeof(ulong))
			{
				ulong* ptr13 = (ulong*)dataPointer;
				ptr13 += offset;
				fixed (ulong* ptr14 = &register.uint64_0)
				{
					for (int num = 0; num < Count; num++)
					{
						ptr14[num] = ptr13[num];
					}
				}
				return;
			}
			if (typeof(T) == typeof(long))
			{
				long* ptr15 = (long*)dataPointer;
				ptr15 += offset;
				fixed (long* ptr16 = &register.int64_0)
				{
					for (int num2 = 0; num2 < Count; num2++)
					{
						ptr16[num2] = ptr15[num2];
					}
				}
				return;
			}
			if (typeof(T) == typeof(float))
			{
				float* ptr17 = (float*)dataPointer;
				ptr17 += offset;
				fixed (float* ptr18 = &register.single_0)
				{
					for (int num3 = 0; num3 < Count; num3++)
					{
						ptr18[num3] = ptr17[num3];
					}
				}
				return;
			}
			if (typeof(T) == typeof(double))
			{
				double* ptr19 = (double*)dataPointer;
				ptr19 += offset;
				fixed (double* ptr20 = &register.double_0)
				{
					for (int num4 = 0; num4 < Count; num4++)
					{
						ptr20[num4] = ptr19[num4];
					}
				}
				return;
			}
			throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
		}

		private Vector(ref System.Numerics.Register existingRegister)
		{
			register = existingRegister;
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public void CopyTo(T[] destination)
		{
			CopyTo(destination, 0);
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public unsafe void CopyTo(T[] destination, int startIndex)
		{
			if (destination == null)
			{
				throw new NullReferenceException(System.SR.Arg_NullArgumentNullRef);
			}
			if (startIndex < 0 || startIndex >= destination.Length)
			{
				throw new ArgumentOutOfRangeException("startIndex", System.SR.Format(System.SR.Arg_ArgumentOutOfRangeException, startIndex));
			}
			if (destination.Length - startIndex < Count)
			{
				throw new ArgumentException(System.SR.Format(System.SR.Arg_ElementsInSourceIsGreaterThanDestination, startIndex));
			}
			if (Vector.IsHardwareAccelerated)
			{
				if (typeof(T) == typeof(byte))
				{
					fixed (byte* ptr = (byte[])(object)destination)
					{
						for (int i = 0; i < Count; i++)
						{
							ptr[startIndex + i] = (byte)(object)this[i];
						}
					}
				}
				else if (typeof(T) == typeof(sbyte))
				{
					fixed (sbyte* ptr2 = (sbyte[])(object)destination)
					{
						for (int j = 0; j < Count; j++)
						{
							ptr2[startIndex + j] = (sbyte)(object)this[j];
						}
					}
				}
				else if (typeof(T) == typeof(ushort))
				{
					fixed (ushort* ptr3 = (ushort[])(object)destination)
					{
						for (int k = 0; k < Count; k++)
						{
							ptr3[startIndex + k] = (ushort)(object)this[k];
						}
					}
				}
				else if (typeof(T) == typeof(short))
				{
					fixed (short* ptr4 = (short[])(object)destination)
					{
						for (int l = 0; l < Count; l++)
						{
							ptr4[startIndex + l] = (short)(object)this[l];
						}
					}
				}
				else if (typeof(T) == typeof(uint))
				{
					fixed (uint* ptr5 = (uint[])(object)destination)
					{
						for (int m = 0; m < Count; m++)
						{
							ptr5[startIndex + m] = (uint)(object)this[m];
						}
					}
				}
				else if (typeof(T) == typeof(int))
				{
					fixed (int* ptr6 = (int[])(object)destination)
					{
						for (int n = 0; n < Count; n++)
						{
							ptr6[startIndex + n] = (int)(object)this[n];
						}
					}
				}
				else if (typeof(T) == typeof(ulong))
				{
					fixed (ulong* ptr7 = (ulong[])(object)destination)
					{
						for (int num = 0; num < Count; num++)
						{
							ptr7[startIndex + num] = (ulong)(object)this[num];
						}
					}
				}
				else if (typeof(T) == typeof(long))
				{
					fixed (long* ptr8 = (long[])(object)destination)
					{
						for (int num2 = 0; num2 < Count; num2++)
						{
							ptr8[startIndex + num2] = (long)(object)this[num2];
						}
					}
				}
				else if (typeof(T) == typeof(float))
				{
					fixed (float* ptr9 = (float[])(object)destination)
					{
						for (int num3 = 0; num3 < Count; num3++)
						{
							ptr9[startIndex + num3] = (float)(object)this[num3];
						}
					}
				}
				else
				{
					if (!(typeof(T) == typeof(double)))
					{
						return;
					}
					fixed (double* ptr10 = (double[])(object)destination)
					{
						for (int num4 = 0; num4 < Count; num4++)
						{
							ptr10[startIndex + num4] = (double)(object)this[num4];
						}
					}
				}
			}
			else if (typeof(T) == typeof(byte))
			{
				fixed (byte* ptr11 = (byte[])(object)destination)
				{
					ptr11[startIndex] = register.byte_0;
					ptr11[startIndex + 1] = register.byte_1;
					ptr11[startIndex + 2] = register.byte_2;
					ptr11[startIndex + 3] = register.byte_3;
					ptr11[startIndex + 4] = register.byte_4;
					ptr11[startIndex + 5] = register.byte_5;
					ptr11[startIndex + 6] = register.byte_6;
					ptr11[startIndex + 7] = register.byte_7;
					ptr11[startIndex + 8] = register.byte_8;
					ptr11[startIndex + 9] = register.byte_9;
					ptr11[startIndex + 10] = register.byte_10;
					ptr11[startIndex + 11] = register.byte_11;
					ptr11[startIndex + 12] = register.byte_12;
					ptr11[startIndex + 13] = register.byte_13;
					ptr11[startIndex + 14] = register.byte_14;
					ptr11[startIndex + 15] = register.byte_15;
				}
			}
			else if (typeof(T) == typeof(sbyte))
			{
				fixed (sbyte* ptr12 = (sbyte[])(object)destination)
				{
					ptr12[startIndex] = register.sbyte_0;
					ptr12[startIndex + 1] = register.sbyte_1;
					ptr12[startIndex + 2] = register.sbyte_2;
					ptr12[startIndex + 3] = register.sbyte_3;
					ptr12[startIndex + 4] = register.sbyte_4;
					ptr12[startIndex + 5] = register.sbyte_5;
					ptr12[startIndex + 6] = register.sbyte_6;
					ptr12[startIndex + 7] = register.sbyte_7;
					ptr12[startIndex + 8] = register.sbyte_8;
					ptr12[startIndex + 9] = register.sbyte_9;
					ptr12[startIndex + 10] = register.sbyte_10;
					ptr12[startIndex + 11] = register.sbyte_11;
					ptr12[startIndex + 12] = register.sbyte_12;
					ptr12[startIndex + 13] = register.sbyte_13;
					ptr12[startIndex + 14] = register.sbyte_14;
					ptr12[startIndex + 15] = register.sbyte_15;
				}
			}
			else if (typeof(T) == typeof(ushort))
			{
				fixed (ushort* ptr13 = (ushort[])(object)destination)
				{
					ptr13[startIndex] = register.uint16_0;
					ptr13[startIndex + 1] = register.uint16_1;
					ptr13[startIndex + 2] = register.uint16_2;
					ptr13[startIndex + 3] = register.uint16_3;
					ptr13[startIndex + 4] = register.uint16_4;
					ptr13[startIndex + 5] = register.uint16_5;
					ptr13[startIndex + 6] = register.uint16_6;
					ptr13[startIndex + 7] = register.uint16_7;
				}
			}
			else if (typeof(T) == typeof(short))
			{
				fixed (short* ptr14 = (short[])(object)destination)
				{
					ptr14[startIndex] = register.int16_0;
					ptr14[startIndex + 1] = register.int16_1;
					ptr14[startIndex + 2] = register.int16_2;
					ptr14[startIndex + 3] = register.int16_3;
					ptr14[startIndex + 4] = register.int16_4;
					ptr14[startIndex + 5] = register.int16_5;
					ptr14[startIndex + 6] = register.int16_6;
					ptr14[startIndex + 7] = register.int16_7;
				}
			}
			else if (typeof(T) == typeof(uint))
			{
				fixed (uint* ptr15 = (uint[])(object)destination)
				{
					ptr15[startIndex] = register.uint32_0;
					ptr15[startIndex + 1] = register.uint32_1;
					ptr15[startIndex + 2] = register.uint32_2;
					ptr15[startIndex + 3] = register.uint32_3;
				}
			}
			else if (typeof(T) == typeof(int))
			{
				fixed (int* ptr16 = (int[])(object)destination)
				{
					ptr16[startIndex] = register.int32_0;
					ptr16[startIndex + 1] = register.int32_1;
					ptr16[startIndex + 2] = register.int32_2;
					ptr16[startIndex + 3] = register.int32_3;
				}
			}
			else if (typeof(T) == typeof(ulong))
			{
				fixed (ulong* ptr17 = (ulong[])(object)destination)
				{
					ptr17[startIndex] = register.uint64_0;
					ptr17[startIndex + 1] = register.uint64_1;
				}
			}
			else if (typeof(T) == typeof(long))
			{
				fixed (long* ptr18 = (long[])(object)destination)
				{
					ptr18[startIndex] = register.int64_0;
					ptr18[startIndex + 1] = register.int64_1;
				}
			}
			else if (typeof(T) == typeof(float))
			{
				fixed (float* ptr19 = (float[])(object)destination)
				{
					ptr19[startIndex] = register.single_0;
					ptr19[startIndex + 1] = register.single_1;
					ptr19[startIndex + 2] = register.single_2;
					ptr19[startIndex + 3] = register.single_3;
				}
			}
			else if (typeof(T) == typeof(double))
			{
				fixed (double* ptr20 = (double[])(object)destination)
				{
					ptr20[startIndex] = register.double_0;
					ptr20[startIndex + 1] = register.double_1;
				}
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public override bool Equals(object obj)
		{
			if (!(obj is Vector<T>))
			{
				return false;
			}
			return Equals((Vector<T>)obj);
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public bool Equals(Vector<T> other)
		{
			if (Vector.IsHardwareAccelerated)
			{
				for (int i = 0; i < Count; i++)
				{
					if (!ScalarEquals(this[i], other[i]))
					{
						return false;
					}
				}
				return true;
			}
			if (typeof(T) == typeof(byte))
			{
				if (register.byte_0 == other.register.byte_0 && register.byte_1 == other.register.byte_1 && register.byte_2 == other.register.byte_2 && register.byte_3 == other.register.byte_3 && register.byte_4 == other.register.byte_4 && register.byte_5 == other.register.byte_5 && register.byte_6 == other.register.byte_6 && register.byte_7 == other.register.byte_7 && register.byte_8 == other.register.byte_8 && register.byte_9 == other.register.byte_9 && register.byte_10 == other.register.byte_10 && register.byte_11 == other.register.byte_11 && register.byte_12 == other.register.byte_12 && register.byte_13 == other.register.byte_13 && register.byte_14 == other.register.byte_14)
				{
					return register.byte_15 == other.register.byte_15;
				}
				return false;
			}
			if (typeof(T) == typeof(sbyte))
			{
				if (register.sbyte_0 == other.register.sbyte_0 && register.sbyte_1 == other.register.sbyte_1 && register.sbyte_2 == other.register.sbyte_2 && register.sbyte_3 == other.register.sbyte_3 && register.sbyte_4 == other.register.sbyte_4 && register.sbyte_5 == other.register.sbyte_5 && register.sbyte_6 == other.register.sbyte_6 && register.sbyte_7 == other.register.sbyte_7 && register.sbyte_8 == other.register.sbyte_8 && register.sbyte_9 == other.register.sbyte_9 && register.sbyte_10 == other.register.sbyte_10 && register.sbyte_11 == other.register.sbyte_11 && register.sbyte_12 == other.register.sbyte_12 && register.sbyte_13 == other.register.sbyte_13 && register.sbyte_14 == other.register.sbyte_14)
				{
					return register.sbyte_15 == other.register.sbyte_15;
				}
				return false;
			}
			if (typeof(T) == typeof(ushort))
			{
				if (register.uint16_0 == other.register.uint16_0 && register.uint16_1 == other.register.uint16_1 && register.uint16_2 == other.register.uint16_2 && register.uint16_3 == other.register.uint16_3 && register.uint16_4 == other.register.uint16_4 && register.uint16_5 == other.register.uint16_5 && register.uint16_6 == other.register.uint16_6)
				{
					return register.uint16_7 == other.register.uint16_7;
				}
				return false;
			}
			if (typeof(T) == typeof(short))
			{
				if (register.int16_0 == other.register.int16_0 && register.int16_1 == other.register.int16_1 && register.int16_2 == other.register.int16_2 && register.int16_3 == other.register.int16_3 && register.int16_4 == other.register.int16_4 && register.int16_5 == other.register.int16_5 && register.int16_6 == other.register.int16_6)
				{
					return register.int16_7 == other.register.int16_7;
				}
				return false;
			}
			if (typeof(T) == typeof(uint))
			{
				if (register.uint32_0 == other.register.uint32_0 && register.uint32_1 == other.register.uint32_1 && register.uint32_2 == other.register.uint32_2)
				{
					return register.uint32_3 == other.register.uint32_3;
				}
				return false;
			}
			if (typeof(T) == typeof(int))
			{
				if (register.int32_0 == other.register.int32_0 && register.int32_1 == other.register.int32_1 && register.int32_2 == other.register.int32_2)
				{
					return register.int32_3 == other.register.int32_3;
				}
				return false;
			}
			if (typeof(T) == typeof(ulong))
			{
				if (register.uint64_0 == other.register.uint64_0)
				{
					return register.uint64_1 == other.register.uint64_1;
				}
				return false;
			}
			if (typeof(T) == typeof(long))
			{
				if (register.int64_0 == other.register.int64_0)
				{
					return register.int64_1 == other.register.int64_1;
				}
				return false;
			}
			if (typeof(T) == typeof(float))
			{
				if (register.single_0 == other.register.single_0 && register.single_1 == other.register.single_1 && register.single_2 == other.register.single_2)
				{
					return register.single_3 == other.register.single_3;
				}
				return false;
			}
			if (typeof(T) == typeof(double))
			{
				if (register.double_0 == other.register.double_0)
				{
					return register.double_1 == other.register.double_1;
				}
				return false;
			}
			throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
		}

		public override int GetHashCode()
		{
			int num = 0;
			if (Vector.IsHardwareAccelerated)
			{
				if (typeof(T) == typeof(byte))
				{
					for (int i = 0; i < Count; i++)
					{
						num = HashHelpers.Combine(num, ((byte)(object)this[i]).GetHashCode());
					}
					return num;
				}
				if (typeof(T) == typeof(sbyte))
				{
					for (int j = 0; j < Count; j++)
					{
						num = HashHelpers.Combine(num, ((sbyte)(object)this[j]).GetHashCode());
					}
					return num;
				}
				if (typeof(T) == typeof(ushort))
				{
					for (int k = 0; k < Count; k++)
					{
						num = HashHelpers.Combine(num, ((ushort)(object)this[k]).GetHashCode());
					}
					return num;
				}
				if (typeof(T) == typeof(short))
				{
					for (int l = 0; l < Count; l++)
					{
						num = HashHelpers.Combine(num, ((short)(object)this[l]).GetHashCode());
					}
					return num;
				}
				if (typeof(T) == typeof(uint))
				{
					for (int m = 0; m < Count; m++)
					{
						num = HashHelpers.Combine(num, ((uint)(object)this[m]).GetHashCode());
					}
					return num;
				}
				if (typeof(T) == typeof(int))
				{
					for (int n = 0; n < Count; n++)
					{
						num = HashHelpers.Combine(num, ((int)(object)this[n]).GetHashCode());
					}
					return num;
				}
				if (typeof(T) == typeof(ulong))
				{
					for (int num2 = 0; num2 < Count; num2++)
					{
						num = HashHelpers.Combine(num, ((ulong)(object)this[num2]).GetHashCode());
					}
					return num;
				}
				if (typeof(T) == typeof(long))
				{
					for (int num3 = 0; num3 < Count; num3++)
					{
						num = HashHelpers.Combine(num, ((long)(object)this[num3]).GetHashCode());
					}
					return num;
				}
				if (typeof(T) == typeof(float))
				{
					for (int num4 = 0; num4 < Count; num4++)
					{
						num = HashHelpers.Combine(num, ((float)(object)this[num4]).GetHashCode());
					}
					return num;
				}
				if (typeof(T) == typeof(double))
				{
					for (int num5 = 0; num5 < Count; num5++)
					{
						num = HashHelpers.Combine(num, ((double)(object)this[num5]).GetHashCode());
					}
					return num;
				}
				throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
			}
			if (typeof(T) == typeof(byte))
			{
				num = HashHelpers.Combine(num, register.byte_0.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_1.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_2.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_3.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_4.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_5.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_6.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_7.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_8.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_9.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_10.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_11.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_12.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_13.GetHashCode());
				num = HashHelpers.Combine(num, register.byte_14.GetHashCode());
				return HashHelpers.Combine(num, register.byte_15.GetHashCode());
			}
			if (typeof(T) == typeof(sbyte))
			{
				num = HashHelpers.Combine(num, register.sbyte_0.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_1.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_2.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_3.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_4.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_5.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_6.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_7.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_8.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_9.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_10.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_11.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_12.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_13.GetHashCode());
				num = HashHelpers.Combine(num, register.sbyte_14.GetHashCode());
				return HashHelpers.Combine(num, register.sbyte_15.GetHashCode());
			}
			if (typeof(T) == typeof(ushort))
			{
				num = HashHelpers.Combine(num, register.uint16_0.GetHashCode());
				num = HashHelpers.Combine(num, register.uint16_1.GetHashCode());
				num = HashHelpers.Combine(num, register.uint16_2.GetHashCode());
				num = HashHelpers.Combine(num, register.uint16_3.GetHashCode());
				num = HashHelpers.Combine(num, register.uint16_4.GetHashCode());
				num = HashHelpers.Combine(num, register.uint16_5.GetHashCode());
				num = HashHelpers.Combine(num, register.uint16_6.GetHashCode());
				return HashHelpers.Combine(num, register.uint16_7.GetHashCode());
			}
			if (typeof(T) == typeof(short))
			{
				num = HashHelpers.Combine(num, register.int16_0.GetHashCode());
				num = HashHelpers.Combine(num, register.int16_1.GetHashCode());
				num = HashHelpers.Combine(num, register.int16_2.GetHashCode());
				num = HashHelpers.Combine(num, register.int16_3.GetHashCode());
				num = HashHelpers.Combine(num, register.int16_4.GetHashCode());
				num = HashHelpers.Combine(num, register.int16_5.GetHashCode());
				num = HashHelpers.Combine(num, register.int16_6.GetHashCode());
				return HashHelpers.Combine(num, register.int16_7.GetHashCode());
			}
			if (typeof(T) == typeof(uint))
			{
				num = HashHelpers.Combine(num, register.uint32_0.GetHashCode());
				num = HashHelpers.Combine(num, register.uint32_1.GetHashCode());
				num = HashHelpers.Combine(num, register.uint32_2.GetHashCode());
				return HashHelpers.Combine(num, register.uint32_3.GetHashCode());
			}
			if (typeof(T) == typeof(int))
			{
				num = HashHelpers.Combine(num, register.int32_0.GetHashCode());
				num = HashHelpers.Combine(num, register.int32_1.GetHashCode());
				num = HashHelpers.Combine(num, register.int32_2.GetHashCode());
				return HashHelpers.Combine(num, register.int32_3.GetHashCode());
			}
			if (typeof(T) == typeof(ulong))
			{
				num = HashHelpers.Combine(num, register.uint64_0.GetHashCode());
				return HashHelpers.Combine(num, register.uint64_1.GetHashCode());
			}
			if (typeof(T) == typeof(long))
			{
				num = HashHelpers.Combine(num, register.int64_0.GetHashCode());
				return HashHelpers.Combine(num, register.int64_1.GetHashCode());
			}
			if (typeof(T) == typeof(float))
			{
				num = HashHelpers.Combine(num, register.single_0.GetHashCode());
				num = HashHelpers.Combine(num, register.single_1.GetHashCode());
				num = HashHelpers.Combine(num, register.single_2.GetHashCode());
				return HashHelpers.Combine(num, register.single_3.GetHashCode());
			}
			if (typeof(T) == typeof(double))
			{
				num = HashHelpers.Combine(num, register.double_0.GetHashCode());
				return HashHelpers.Combine(num, register.double_1.GetHashCode());
			}
			throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
		}

		public override string ToString()
		{
			return ToString("G", CultureInfo.CurrentCulture);
		}

		public string ToString(string format)
		{
			return ToString(format, CultureInfo.CurrentCulture);
		}

		public string ToString(string format, IFormatProvider formatProvider)
		{
			StringBuilder stringBuilder = new StringBuilder();
			string numberGroupSeparator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator;
			stringBuilder.Append('<');
			for (int i = 0; i < Count - 1; i++)
			{
				stringBuilder.Append(((IFormattable)(object)this[i]).ToString(format, formatProvider));
				stringBuilder.Append(numberGroupSeparator);
				stringBuilder.Append(' ');
			}
			stringBuilder.Append(((IFormattable)(object)this[Count - 1]).ToString(format, formatProvider));
			stringBuilder.Append('>');
			return stringBuilder.ToString();
		}

		public unsafe static Vector<T>operator +(Vector<T> left, Vector<T> right)
		{
			if (Vector.IsHardwareAccelerated)
			{
				if (typeof(T) == typeof(byte))
				{
					byte* ptr = stackalloc byte[(int)(uint)Count];
					for (int i = 0; i < Count; i++)
					{
						ptr[i] = (byte)(object)ScalarAdd(left[i], right[i]);
					}
					return new Vector<T>(ptr);
				}
				if (typeof(T) == typeof(sbyte))
				{
					sbyte* ptr2 = stackalloc sbyte[(int)(uint)Count];
					for (int j = 0; j < Count; j++)
					{
						ptr2[j] = (sbyte)(object)ScalarAdd(left[j], right[j]);
					}
					return new Vector<T>(ptr2);
				}
				if (typeof(T) == typeof(ushort))
				{
					ushort* ptr3 = stackalloc ushort[Count];
					for (int k = 0; k < Count; k++)
					{
						ptr3[k] = (ushort)(object)ScalarAdd(left[k], right[k]);
					}
					return new Vector<T>(ptr3);
				}
				if (typeof(T) == typeof(short))
				{
					short* ptr4 = stackalloc short[Count];
					for (int l = 0; l < Count; l++)
					{
						ptr4[l] = (short)(object)ScalarAdd(left[l], right[l]);
					}
					return new Vector<T>(ptr4);
				}
				if (typeof(T) == typeof(uint))
				{
					uint* ptr5 = stackalloc uint[Count];
					for (int m = 0; m < Count; m++)
					{
						ptr5[m] = (uint)(object)ScalarAdd(left[m], right[m]);
					}
					return new Vector<T>(ptr5);
				}
				if (typeof(T) == typeof(int))
				{
					int* ptr6 = stackalloc int[Count];
					for (int n = 0; n < Count; n++)
					{
						ptr6[n] = (int)(object)ScalarAdd(left[n], right[n]);
					}
					return new Vector<T>(ptr6);
				}
				if (typeof(T) == typeof(ulong))
				{
					ulong* ptr7 = stackalloc ulong[Count];
					for (int num = 0; num < Count; num++)
					{
						ptr7[num] = (ulong)(object)ScalarAdd(left[num], right[num]);
					}
					return new Vector<T>(ptr7);
				}
				if (typeof(T) == typeof(long))
				{
					long* ptr8 = stackalloc long[Count];
					for (int num2 = 0; num2 < Count; num2++)
					{
						ptr8[num2] = (long)(object)ScalarAdd(left[num2], right[num2]);
					}
					return new Vector<T>(ptr8);
				}
				if (typeof(T) == typeof(float))
				{
					float* ptr9 = stackalloc float[Count];
					for (int num3 = 0; num3 < Count; num3++)
					{
						ptr9[num3] = (float)(object)ScalarAdd(left[num3], right[num3]);
					}
					return new Vector<T>(ptr9);
				}
				if (typeof(T) == typeof(double))
				{
					double* ptr10 = stackalloc double[Count];
					for (int num4 = 0; num4 < Count; num4++)
					{
						ptr10[num4] = (double)(object)ScalarAdd(left[num4], right[num4]);
					}
					return new Vector<T>(ptr10);
				}
				throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
			}
			Vector<T> result = default(Vector<T>);
			if (typeof(T) == typeof(byte))
			{
				result.register.byte_0 = (byte)(left.register.byte_0 + right.register.byte_0);
				result.register.byte_1 = (byte)(left.register.byte_1 + right.register.byte_1);
				result.register.byte_2 = (byte)(left.register.byte_2 + right.register.byte_2);
				result.register.byte_3 = (byte)(left.register.byte_3 + right.register.byte_3);
				result.register.byte_4 = (byte)(left.register.byte_4 + right.register.byte_4);
				result.register.byte_5 = (byte)(left.register.byte_5 + right.register.byte_5);
				result.register.byte_6 = (byte)(left.register.byte_6 + right.register.byte_6);
				result.register.byte_7 = (byte)(left.register.byte_7 + right.register.byte_7);
				result.register.byte_8 = (byte)(left.register.byte_8 + right.register.byte_8);
				result.register.byte_9 = (byte)(left.register.byte_9 + right.register.byte_9);
				result.register.byte_10 = (byte)(left.register.byte_10 + right.register.byte_10);
				result.register.byte_11 = (byte)(left.register.byte_11 + right.register.byte_11);
				result.register.byte_12 = (byte)(left.register.byte_12 + right.register.byte_12);
				result.register.byte_13 = (byte)(left.register.byte_13 + right.register.byte_13);
				result.register.byte_14 = (byte)(left.register.byte_14 + right.register.byte_14);
				result.register.byte_15 = (byte)(left.register.byte_15 + right.register.byte_15);
			}
			else if (typeof(T) == typeof(sbyte))
			{
				result.register.sbyte_0 = (sbyte)(left.register.sbyte_0 + right.register.sbyte_0);
				result.register.sbyte_1 = (sbyte)(left.register.sbyte_1 + right.register.sbyte_1);
				result.register.sbyte_2 = (sbyte)(left.register.sbyte_2 + right.register.sbyte_2);
				result.register.sbyte_3 = (sbyte)(left.register.sbyte_3 + right.register.sbyte_3);
				result.register.sbyte_4 = (sbyte)(left.register.sbyte_4 + right.register.sbyte_4);
				result.register.sbyte_5 = (sbyte)(left.register.sbyte_5 + right.register.sbyte_5);
				result.register.sbyte_6 = (sbyte)(left.register.sbyte_6 + right.register.sbyte_6);
				result.register.sbyte_7 = (sbyte)(left.register.sbyte_7 + right.register.sbyte_7);
				result.register.sbyte_8 = (sbyte)(left.register.sbyte_8 + right.register.sbyte_8);
				result.register.sbyte_9 = (sbyte)(left.register.sbyte_9 + right.register.sbyte_9);
				result.register.sbyte_10 = (sbyte)(left.register.sbyte_10 + right.register.sbyte_10);
				result.register.sbyte_11 = (sbyte)(left.register.sbyte_11 + right.register.sbyte_11);
				result.register.sbyte_12 = (sbyte)(left.register.sbyte_12 + right.register.sbyte_12);
				result.register.sbyte_13 = (sbyte)(left.register.sbyte_13 + right.register.sbyte_13);
				result.register.sbyte_14 = (sbyte)(left.register.sbyte_14 + right.register.sbyte_14);
				result.register.sbyte_15 = (sbyte)(left.register.sbyte_15 + right.register.sbyte_15);
			}
			else if (typeof(T) == typeof(ushort))
			{
				result.register.uint16_0 = (ushort)(left.register.uint16_0 + right.register.uint16_0);
				result.register.uint16_1 = (ushort)(left.register.uint16_1 + right.register.uint16_1);
				result.register.uint16_2 = (ushort)(left.register.uint16_2 + right.register.uint16_2);
				result.register.uint16_3 = (ushort)(left.register.uint16_3 + right.register.uint16_3);
				result.register.uint16_4 = (ushort)(left.register.uint16_4 + right.register.uint16_4);
				result.register.uint16_5 = (ushort)(left.register.uint16_5 + right.register.uint16_5);
				result.register.uint16_6 = (ushort)(left.register.uint16_6 + right.register.uint16_6);
				result.register.uint16_7 = (ushort)(left.register.uint16_7 + right.register.uint16_7);
			}
			else if (typeof(T) == typeof(short))
			{
				result.register.int16_0 = (short)(left.register.int16_0 + right.register.int16_0);
				result.register.int16_1 = (short)(left.register.int16_1 + right.register.int16_1);
				result.register.int16_2 = (short)(left.register.int16_2 + right.register.int16_2);
				result.register.int16_3 = (short)(left.register.int16_3 + right.register.int16_3);
				result.register.int16_4 = (short)(left.register.int16_4 + right.register.int16_4);
				result.register.int16_5 = (short)(left.register.int16_5 + right.register.int16_5);
				result.register.int16_6 = (short)(left.register.int16_6 + right.register.int16_6);
				result.register.int16_7 = (short)(left.register.int16_7 + right.register.int16_7);
			}
			else if (typeof(T) == typeof(uint))
			{
				result.register.uint32_0 = left.register.uint32_0 + right.register.uint32_0;
				result.register.uint32_1 = left.register.uint32_1 + right.register.uint32_1;
				result.register.uint32_2 = left.register.uint32_2 + right.register.uint32_2;
				result.register.uint32_3 = left.register.uint32_3 + right.register.uint32_3;
			}
			else if (typeof(T) == typeof(int))
			{
				result.register.int32_0 = left.register.int32_0 + right.register.int32_0;
				result.register.int32_1 = left.register.int32_1 + right.register.int32_1;
				result.register.int32_2 = left.register.int32_2 + right.register.int32_2;
				result.register.int32_3 = left.register.int32_3 + right.register.int32_3;
			}
			else if (typeof(T) == typeof(ulong))
			{
				result.register.uint64_0 = left.register.uint64_0 + right.register.uint64_0;
				result.register.uint64_1 = left.register.uint64_1 + right.register.uint64_1;
			}
			else if (typeof(T) == typeof(long))
			{
				result.register.int64_0 = left.register.int64_0 + right.register.int64_0;
				result.register.int64_1 = left.register.int64_1 + right.register.int64_1;
			}
			else if (typeof(T) == typeof(float))
			{
				result.register.single_0 = left.register.single_0 + right.register.single_0;
				result.register.single_1 = left.register.single_1 + right.register.single_1;
				result.register.single_2 = left.register.single_2 + right.register.single_2;
				result.register.single_3 = left.register.single_3 + right.register.single_3;
			}
			else if (typeof(T) == typeof(double))
			{
				result.register.double_0 = left.register.double_0 + right.register.double_0;
				result.register.double_1 = left.register.double_1 + right.register.double_1;
			}
			return result;
		}

		public unsafe static Vector<T>operator -(Vector<T> left, Vector<T> right)
		{
			if (Vector.IsHardwareAccelerated)
			{
				if (typeof(T) == typeof(byte))
				{
					byte* ptr = stackalloc byte[(int)(uint)Count];
					for (int i = 0; i < Count; i++)
					{
						ptr[i] = (byte)(object)ScalarSubtract(left[i], right[i]);
					}
					return new Vector<T>(ptr);
				}
				if (typeof(T) == typeof(sbyte))
				{
					sbyte* ptr2 = stackalloc sbyte[(int)(uint)Count];
					for (int j = 0; j < Count; j++)
					{
						ptr2[j] = (sbyte)(object)ScalarSubtract(left[j], right[j]);
					}
					return new Vector<T>(ptr2);
				}
				if (typeof(T) == typeof(ushort))
				{
					ushort* ptr3 = stackalloc ushort[Count];
					for (int k = 0; k < Count; k++)
					{
						ptr3[k] = (ushort)(object)ScalarSubtract(left[k], right[k]);
					}
					return new Vector<T>(ptr3);
				}
				if (typeof(T) == typeof(short))
				{
					short* ptr4 = stackalloc short[Count];
					for (int l = 0; l < Count; l++)
					{
						ptr4[l] = (short)(object)ScalarSubtract(left[l], right[l]);
					}
					return new Vector<T>(ptr4);
				}
				if (typeof(T) == typeof(uint))
				{
					uint* ptr5 = stackalloc uint[Count];
					for (int m = 0; m < Count; m++)
					{
						ptr5[m] = (uint)(object)ScalarSubtract(left[m], right[m]);
					}
					return new Vector<T>(ptr5);
				}
				if (typeof(T) == typeof(int))
				{
					int* ptr6 = stackalloc int[Count];
					for (int n = 0; n < Count; n++)
					{
						ptr6[n] = (int)(object)ScalarSubtract(left[n], right[n]);
					}
					return new Vector<T>(ptr6);
				}
				if (typeof(T) == typeof(ulong))
				{
					ulong* ptr7 = stackalloc ulong[Count];
					for (int num = 0; num < Count; num++)
					{
						ptr7[num] = (ulong)(object)ScalarSubtract(left[num], right[num]);
					}
					return new Vector<T>(ptr7);
				}
				if (typeof(T) == typeof(long))
				{
					long* ptr8 = stackalloc long[Count];
					for (int num2 = 0; num2 < Count; num2++)
					{
						ptr8[num2] = (long)(object)ScalarSubtract(left[num2], right[num2]);
					}
					return new Vector<T>(ptr8);
				}
				if (typeof(T) == typeof(float))
				{
					float* ptr9 = stackalloc float[Count];
					for (int num3 = 0; num3 < Count; num3++)
					{
						ptr9[num3] = (float)(object)ScalarSubtract(left[num3], right[num3]);
					}
					return new Vector<T>(ptr9);
				}
				if (typeof(T) == typeof(double))
				{
					double* ptr10 = stackalloc double[Count];
					for (int num4 = 0; num4 < Count; num4++)
					{
						ptr10[num4] = (double)(object)ScalarSubtract(left[num4], right[num4]);
					}
					return new Vector<T>(ptr10);
				}
				throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
			}
			Vector<T> result = default(Vector<T>);
			if (typeof(T) == typeof(byte))
			{
				result.register.byte_0 = (byte)(left.register.byte_0 - right.register.byte_0);
				result.register.byte_1 = (byte)(left.register.byte_1 - right.register.byte_1);
				result.register.byte_2 = (byte)(left.register.byte_2 - right.register.byte_2);
				result.register.byte_3 = (byte)(left.register.byte_3 - right.register.byte_3);
				result.register.byte_4 = (byte)(left.register.byte_4 - right.register.byte_4);
				result.register.byte_5 = (byte)(left.register.byte_5 - right.register.byte_5);
				result.register.byte_6 = (byte)(left.register.byte_6 - right.register.byte_6);
				result.register.byte_7 = (byte)(left.register.byte_7 - right.register.byte_7);
				result.register.byte_8 = (byte)(left.register.byte_8 - right.register.byte_8);
				result.register.byte_9 = (byte)(left.register.byte_9 - right.register.byte_9);
				result.register.byte_10 = (byte)(left.register.byte_10 - right.register.byte_10);
				result.register.byte_11 = (byte)(left.register.byte_11 - right.register.byte_11);
				result.register.byte_12 = (byte)(left.register.byte_12 - right.register.byte_12);
				result.register.byte_13 = (byte)(left.register.byte_13 - right.register.byte_13);
				result.register.byte_14 = (byte)(left.register.byte_14 - right.register.byte_14);
				result.register.byte_15 = (byte)(left.register.byte_15 - right.register.byte_15);
			}
			else if (typeof(T) == typeof(sbyte))
			{
				result.register.sbyte_0 = (sbyte)(left.register.sbyte_0 - right.register.sbyte_0);
				result.register.sbyte_1 = (sbyte)(left.register.sbyte_1 - right.register.sbyte_1);
				result.register.sbyte_2 = (sbyte)(left.register.sbyte_2 - right.register.sbyte_2);
				result.register.sbyte_3 = (sbyte)(left.register.sbyte_3 - right.register.sbyte_3);
				result.register.sbyte_4 = (sbyte)(left.register.sbyte_4 - right.register.sbyte_4);
				result.register.sbyte_5 = (sbyte)(left.register.sbyte_5 - right.register.sbyte_5);
				result.register.sbyte_6 = (sbyte)(left.register.sbyte_6 - right.register.sbyte_6);
				result.register.sbyte_7 = (sbyte)(left.register.sbyte_7 - right.register.sbyte_7);
				result.register.sbyte_8 = (sbyte)(left.register.sbyte_8 - right.register.sbyte_8);
				result.register.sbyte_9 = (sbyte)(left.register.sbyte_9 - right.register.sbyte_9);
				result.register.sbyte_10 = (sbyte)(left.register.sbyte_10 - right.register.sbyte_10);
				result.register.sbyte_11 = (sbyte)(left.register.sbyte_11 - right.register.sbyte_11);
				result.register.sbyte_12 = (sbyte)(left.register.sbyte_12 - right.register.sbyte_12);
				result.register.sbyte_13 = (sbyte)(left.register.sbyte_13 - right.register.sbyte_13);
				result.register.sbyte_14 = (sbyte)(left.register.sbyte_14 - right.register.sbyte_14);
				result.register.sbyte_15 = (sbyte)(left.register.sbyte_15 - right.register.sbyte_15);
			}
			else if (typeof(T) == typeof(ushort))
			{
				result.register.uint16_0 = (ushort)(left.register.uint16_0 - right.register.uint16_0);
				result.register.uint16_1 = (ushort)(left.register.uint16_1 - right.register.uint16_1);
				result.register.uint16_2 = (ushort)(left.register.uint16_2 - right.register.uint16_2);
				result.register.uint16_3 = (ushort)(left.register.uint16_3 - right.register.uint16_3);
				result.register.uint16_4 = (ushort)(left.register.uint16_4 - right.register.uint16_4);
				result.register.uint16_5 = (ushort)(left.register.uint16_5 - right.register.uint16_5);
				result.register.uint16_6 = (ushort)(left.register.uint16_6 - right.register.uint16_6);
				result.register.uint16_7 = (ushort)(left.register.uint16_7 - right.register.uint16_7);
			}
			else if (typeof(T) == typeof(short))
			{
				result.register.int16_0 = (short)(left.register.int16_0 - right.register.int16_0);
				result.register.int16_1 = (short)(left.register.int16_1 - right.register.int16_1);
				result.register.int16_2 = (short)(left.register.int16_2 - right.register.int16_2);
				result.register.int16_3 = (short)(left.register.int16_3 - right.register.int16_3);
				result.register.int16_4 = (short)(left.register.int16_4 - right.register.int16_4);
				result.register.int16_5 = (short)(left.register.int16_5 - right.register.int16_5);
				result.register.int16_6 = (short)(left.register.int16_6 - right.register.int16_6);
				result.register.int16_7 = (short)(left.register.int16_7 - right.register.int16_7);
			}
			else if (typeof(T) == typeof(uint))
			{
				result.register.uint32_0 = left.register.uint32_0 - right.register.uint32_0;
				result.register.uint32_1 = left.register.uint32_1 - right.register.uint32_1;
				result.register.uint32_2 = left.register.uint32_2 - right.register.uint32_2;
				result.register.uint32_3 = left.register.uint32_3 - right.register.uint32_3;
			}
			else if (typeof(T) == typeof(int))
			{
				result.register.int32_0 = left.register.int32_0 - right.register.int32_0;
				result.register.int32_1 = left.register.int32_1 - right.register.int32_1;
				result.register.int32_2 = left.register.int32_2 - right.register.int32_2;
				result.register.int32_3 = left.register.int32_3 - right.register.int32_3;
			}
			else if (typeof(T) == typeof(ulong))
			{
				result.register.uint64_0 = left.register.uint64_0 - right.register.uint64_0;
				result.register.uint64_1 = left.register.uint64_1 - right.register.uint64_1;
			}
			else if (typeof(T) == typeof(long))
			{
				result.register.int64_0 = left.register.int64_0 - right.register.int64_0;
				result.register.int64_1 = left.register.int64_1 - right.register.int64_1;
			}
			else if (typeof(T) == typeof(float))
			{
				result.register.single_0 = left.register.single_0 - right.register.single_0;
				result.register.single_1 = left.register.single_1 - right.register.single_1;
				result.register.single_2 = left.register.single_2 - right.register.single_2;
				result.register.single_3 = left.register.single_3 - right.register.single_3;
			}
			else if (typeof(T) == typeof(double))
			{
				result.register.double_0 = left.register.double_0 - right.register.double_0;
				result.register.double_1 = left.register.double_1 - right.register.double_1;
			}
			return result;
		}

		public unsafe static Vector<T>operator *(Vector<T> left, Vector<T> right)
		{
			if (Vector.IsHardwareAccelerated)
			{
				if (typeof(T) == typeof(byte))
				{
					byte* ptr = stackalloc byte[(int)(uint)Count];
					for (int i = 0; i < Count; i++)
					{
						ptr[i] = (byte)(object)ScalarMultiply(left[i], right[i]);
					}
					return new Vector<T>(ptr);
				}
				if (typeof(T) == typeof(sbyte))
				{
					sbyte* ptr2 = stackalloc sbyte[(int)(uint)Count];
					for (int j = 0; j < Count; j++)
					{
						ptr2[j] = (sbyte)(object)ScalarMultiply(left[j], right[j]);
					}
					return new Vector<T>(ptr2);
				}
				if (typeof(T) == typeof(ushort))
				{
					ushort* ptr3 = stackalloc ushort[Count];
					for (int k = 0; k < Count; k++)
					{
						ptr3[k] = (ushort)(object)ScalarMultiply(left[k], right[k]);
					}
					return new Vector<T>(ptr3);
				}
				if (typeof(T) == typeof(short))
				{
					short* ptr4 = stackalloc short[Count];
					for (int l = 0; l < Count; l++)
					{
						ptr4[l] = (short)(object)ScalarMultiply(left[l], right[l]);
					}
					return new Vector<T>(ptr4);
				}
				if (typeof(T) == typeof(uint))
				{
					uint* ptr5 = stackalloc uint[Count];
					for (int m = 0; m < Count; m++)
					{
						ptr5[m] = (uint)(object)ScalarMultiply(left[m], right[m]);
					}
					return new Vector<T>(ptr5);
				}
				if (typeof(T) == typeof(int))
				{
					int* ptr6 = stackalloc int[Count];
					for (int n = 0; n < Count; n++)
					{
						ptr6[n] = (int)(object)ScalarMultiply(left[n], right[n]);
					}
					return new Vector<T>(ptr6);
				}
				if (typeof(T) == typeof(ulong))
				{
					ulong* ptr7 = stackalloc ulong[Count];
					for (int num = 0; num < Count; num++)
					{
						ptr7[num] = (ulong)(object)ScalarMultiply(left[num], right[num]);
					}
					return new Vector<T>(ptr7);
				}
				if (typeof(T) == typeof(long))
				{
					long* ptr8 = stackalloc long[Count];
					for (int num2 = 0; num2 < Count; num2++)
					{
						ptr8[num2] = (long)(object)ScalarMultiply(left[num2], right[num2]);
					}
					return new Vector<T>(ptr8);
				}
				if (typeof(T) == typeof(float))
				{
					float* ptr9 = stackalloc float[Count];
					for (int num3 = 0; num3 < Count; num3++)
					{
						ptr9[num3] = (float)(object)ScalarMultiply(left[num3], right[num3]);
					}
					return new Vector<T>(ptr9);
				}
				if (typeof(T) == typeof(double))
				{
					double* ptr10 = stackalloc double[Count];
					for (int num4 = 0; num4 < Count; num4++)
					{
						ptr10[num4] = (double)(object)ScalarMultiply(left[num4], right[num4]);
					}
					return new Vector<T>(ptr10);
				}
				throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
			}
			Vector<T> result = default(Vector<T>);
			if (typeof(T) == typeof(byte))
			{
				result.register.byte_0 = (byte)(left.register.byte_0 * right.register.byte_0);
				result.register.byte_1 = (byte)(left.register.byte_1 * right.register.byte_1);
				result.register.byte_2 = (byte)(left.register.byte_2 * right.register.byte_2);
				result.register.byte_3 = (byte)(left.register.byte_3 * right.register.byte_3);
				result.register.byte_4 = (byte)(left.register.byte_4 * right.register.byte_4);
				result.register.byte_5 = (byte)(left.register.byte_5 * right.register.byte_5);
				result.register.byte_6 = (byte)(left.register.byte_6 * right.register.byte_6);
				result.register.byte_7 = (byte)(left.register.byte_7 * right.register.byte_7);
				result.register.byte_8 = (byte)(left.register.byte_8 * right.register.byte_8);
				result.register.byte_9 = (byte)(left.register.byte_9 * right.register.byte_9);
				result.register.byte_10 = (byte)(left.register.byte_10 * right.register.byte_10);
				result.register.byte_11 = (byte)(left.register.byte_11 * right.register.byte_11);
				result.register.byte_12 = (byte)(left.register.byte_12 * right.register.byte_12);
				result.register.byte_13 = (byte)(left.register.byte_13 * right.register.byte_13);
				result.register.byte_14 = (byte)(left.register.byte_14 * right.register.byte_14);
				result.register.byte_15 = (byte)(left.register.byte_15 * right.register.byte_15);
			}
			else if (typeof(T) == typeof(sbyte))
			{
				result.register.sbyte_0 = (sbyte)(left.register.sbyte_0 * right.register.sbyte_0);
				result.register.sbyte_1 = (sbyte)(left.register.sbyte_1 * right.register.sbyte_1);
				result.register.sbyte_2 = (sbyte)(left.register.sbyte_2 * right.register.sbyte_2);
				result.register.sbyte_3 = (sbyte)(left.register.sbyte_3 * right.register.sbyte_3);
				result.register.sbyte_4 = (sbyte)(left.register.sbyte_4 * right.register.sbyte_4);
				result.register.sbyte_5 = (sbyte)(left.register.sbyte_5 * right.register.sbyte_5);
				result.register.sbyte_6 = (sbyte)(left.register.sbyte_6 * right.register.sbyte_6);
				result.register.sbyte_7 = (sbyte)(left.register.sbyte_7 * right.register.sbyte_7);
				result.register.sbyte_8 = (sbyte)(left.register.sbyte_8 * right.register.sbyte_8);
				result.register.sbyte_9 = (sbyte)(left.register.sbyte_9 * right.register.sbyte_9);
				result.register.sbyte_10 = (sbyte)(left.register.sbyte_10 * right.register.sbyte_10);
				result.register.sbyte_11 = (sbyte)(left.register.sbyte_11 * right.register.sbyte_11);
				result.register.sbyte_12 = (sbyte)(left.register.sbyte_12 * right.register.sbyte_12);
				result.register.sbyte_13 = (sbyte)(left.register.sbyte_13 * right.register.sbyte_13);
				result.register.sbyte_14 = (sbyte)(left.register.sbyte_14 * right.register.sbyte_14);
				result.register.sbyte_15 = (sbyte)(left.register.sbyte_15 * right.register.sbyte_15);
			}
			else if (typeof(T) == typeof(ushort))
			{
				result.register.uint16_0 = (ushort)(left.register.uint16_0 * right.register.uint16_0);
				result.register.uint16_1 = (ushort)(left.register.uint16_1 * right.register.uint16_1);
				result.register.uint16_2 = (ushort)(left.register.uint16_2 * right.register.uint16_2);
				result.register.uint16_3 = (ushort)(left.register.uint16_3 * right.register.uint16_3);
				result.register.uint16_4 = (ushort)(left.register.uint16_4 * right.register.uint16_4);
				result.register.uint16_5 = (ushort)(left.register.uint16_5 * right.register.uint16_5);
				result.register.uint16_6 = (ushort)(left.register.uint16_6 * right.register.uint16_6);
				result.register.uint16_7 = (ushort)(left.register.uint16_7 * right.register.uint16_7);
			}
			else if (typeof(T) == typeof(short))
			{
				result.register.int16_0 = (short)(left.register.int16_0 * right.register.int16_0);
				result.register.int16_1 = (short)(left.register.int16_1 * right.register.int16_1);
				result.register.int16_2 = (short)(left.register.int16_2 * right.register.int16_2);
				result.register.int16_3 = (short)(left.register.int16_3 * right.register.int16_3);
				result.register.int16_4 = (short)(left.register.int16_4 * right.register.int16_4);
				result.register.int16_5 = (short)(left.register.int16_5 * right.register.int16_5);
				result.register.int16_6 = (short)(left.register.int16_6 * right.register.int16_6);
				result.register.int16_7 = (short)(left.register.int16_7 * right.register.int16_7);
			}
			else if (typeof(T) == typeof(uint))
			{
				result.register.uint32_0 = left.register.uint32_0 * right.register.uint32_0;
				result.register.uint32_1 = left.register.uint32_1 * right.register.uint32_1;
				result.register.uint32_2 = left.register.uint32_2 * right.register.uint32_2;
				result.register.uint32_3 = left.register.uint32_3 * right.register.uint32_3;
			}
			else if (typeof(T) == typeof(int))
			{
				result.register.int32_0 = left.register.int32_0 * right.register.int32_0;
				result.register.int32_1 = left.register.int32_1 * right.register.int32_1;
				result.register.int32_2 = left.register.int32_2 * right.register.int32_2;
				result.register.int32_3 = left.register.int32_3 * right.register.int32_3;
			}
			else if (typeof(T) == typeof(ulong))
			{
				result.register.uint64_0 = left.register.uint64_0 * right.register.uint64_0;
				result.register.uint64_1 = left.register.uint64_1 * right.register.uint64_1;
			}
			else if (typeof(T) == typeof(long))
			{
				result.register.int64_0 = left.register.int64_0 * right.register.int64_0;
				result.register.int64_1 = left.register.int64_1 * right.register.int64_1;
			}
			else if (typeof(T) == typeof(float))
			{
				result.register.single_0 = left.register.single_0 * right.register.single_0;
				result.register.single_1 = left.register.single_1 * right.register.single_1;
				result.register.single_2 = left.register.single_2 * right.register.single_2;
				result.register.single_3 = left.register.single_3 * right.register.single_3;
			}
			else if (typeof(T) == typeof(double))
			{
				result.register.double_0 = left.register.double_0 * right.register.double_0;
				result.register.double_1 = left.register.double_1 * right.register.double_1;
			}
			return result;
		}

		public static Vector<T>operator *(Vector<T> value, T factor)
		{
			if (Vector.IsHardwareAccelerated)
			{
				return new Vector<T>(factor) * value;
			}
			Vector<T> result = default(Vector<T>);
			if (typeof(T) == typeof(byte))
			{
				result.register.byte_0 = (byte)(value.register.byte_0 * (byte)(object)factor);
				result.register.byte_1 = (byte)(value.register.byte_1 * (byte)(object)factor);
				result.register.byte_2 = (byte)(value.register.byte_2 * (byte)(object)factor);
				result.register.byte_3 = (byte)(value.register.byte_3 * (byte)(object)factor);
				result.register.byte_4 = (byte)(value.register.byte_4 * (byte)(object)factor);
				result.register.byte_5 = (byte)(value.register.byte_5 * (byte)(object)factor);
				result.register.byte_6 = (byte)(value.register.byte_6 * (byte)(object)factor);
				result.register.byte_7 = (byte)(value.register.byte_7 * (byte)(object)factor);
				result.register.byte_8 = (byte)(value.register.byte_8 * (byte)(object)factor);
				result.register.byte_9 = (byte)(value.register.byte_9 * (byte)(object)factor);
				result.register.byte_10 = (byte)(value.register.byte_10 * (byte)(object)factor);
				result.register.byte_11 = (byte)(value.register.byte_11 * (byte)(object)factor);
				result.register.byte_12 = (byte)(value.register.byte_12 * (byte)(object)factor);
				result.register.byte_13 = (byte)(value.register.byte_13 * (byte)(object)factor);
				result.register.byte_14 = (byte)(value.register.byte_14 * (byte)(object)factor);
				result.register.byte_15 = (byte)(value.register.byte_15 * (byte)(object)factor);
			}
			else if (typeof(T) == typeof(sbyte))
			{
				result.register.sbyte_0 = (sbyte)(value.register.sbyte_0 * (sbyte)(object)factor);
				result.register.sbyte_1 = (sbyte)(value.register.sbyte_1 * (sbyte)(object)factor);
				result.register.sbyte_2 = (sbyte)(value.register.sbyte_2 * (sbyte)(object)factor);
				result.register.sbyte_3 = (sbyte)(value.register.sbyte_3 * (sbyte)(object)factor);
				result.register.sbyte_4 = (sbyte)(value.register.sbyte_4 * (sbyte)(object)factor);
				result.register.sbyte_5 = (sbyte)(value.register.sbyte_5 * (sbyte)(object)factor);
				result.register.sbyte_6 = (sbyte)(value.register.sbyte_6 * (sbyte)(object)factor);
				result.register.sbyte_7 = (sbyte)(value.register.sbyte_7 * (sbyte)(object)factor);
				result.register.sbyte_8 = (sbyte)(value.register.sbyte_8 * (sbyte)(object)factor);
				result.register.sbyte_9 = (sbyte)(value.register.sbyte_9 * (sbyte)(object)factor);
				result.register.sbyte_10 = (sbyte)(value.register.sbyte_10 * (sbyte)(object)factor);
				result.register.sbyte_11 = (sbyte)(value.register.sbyte_11 * (sbyte)(object)factor);
				result.register.sbyte_12 = (sbyte)(value.register.sbyte_12 * (sbyte)(object)factor);
				result.register.sbyte_13 = (sbyte)(value.register.sbyte_13 * (sbyte)(object)factor);
				result.register.sbyte_14 = (sbyte)(value.register.sbyte_14 * (sbyte)(object)factor);
				result.register.sbyte_15 = (sbyte)(value.register.sbyte_15 * (sbyte)(object)factor);
			}
			else if (typeof(T) == typeof(ushort))
			{
				result.register.uint16_0 = (ushort)(value.register.uint16_0 * (ushort)(object)factor);
				result.register.uint16_1 = (ushort)(value.register.uint16_1 * (ushort)(object)factor);
				result.register.uint16_2 = (ushort)(value.register.uint16_2 * (ushort)(object)factor);
				result.register.uint16_3 = (ushort)(value.register.uint16_3 * (ushort)(object)factor);
				result.register.uint16_4 = (ushort)(value.register.uint16_4 * (ushort)(object)factor);
				result.register.uint16_5 = (ushort)(value.register.uint16_5 * (ushort)(object)factor);
				result.register.uint16_6 = (ushort)(value.register.uint16_6 * (ushort)(object)factor);
				result.register.uint16_7 = (ushort)(value.register.uint16_7 * (ushort)(object)factor);
			}
			else if (typeof(T) == typeof(short))
			{
				result.register.int16_0 = (short)(value.register.int16_0 * (short)(object)factor);
				result.register.int16_1 = (short)(value.register.int16_1 * (short)(object)factor);
				result.register.int16_2 = (short)(value.register.int16_2 * (short)(object)factor);
				result.register.int16_3 = (short)(value.register.int16_3 * (short)(object)factor);
				result.register.int16_4 = (short)(value.register.int16_4 * (short)(object)factor);
				result.register.int16_5 = (short)(value.register.int16_5 * (short)(object)factor);
				result.register.int16_6 = (short)(value.register.int16_6 * (short)(object)factor);
				result.register.int16_7 = (short)(value.register.int16_7 * (short)(object)factor);
			}
			else if (typeof(T) == typeof(uint))
			{
				result.register.uint32_0 = value.register.uint32_0 * (uint)(object)factor;
				result.register.uint32_1 = value.register.uint32_1 * (uint)(object)factor;
				result.register.uint32_2 = value.register.uint32_2 * (uint)(object)factor;
				result.register.uint32_3 = value.register.uint32_3 * (uint)(object)factor;
			}
			else if (typeof(T) == typeof(int))
			{
				result.register.int32_0 = value.register.int32_0 * (int)(object)factor;
				result.register.int32_1 = value.register.int32_1 * (int)(object)factor;
				result.register.int32_2 = value.register.int32_2 * (int)(object)factor;
				result.register.int32_3 = value.register.int32_3 * (int)(object)factor;
			}
			else if (typeof(T) == typeof(ulong))
			{
				result.register.uint64_0 = value.register.uint64_0 * (ulong)(object)factor;
				result.register.uint64_1 = value.register.uint64_1 * (ulong)(object)factor;
			}
			else if (typeof(T) == typeof(long))
			{
				result.register.int64_0 = value.register.int64_0 * (long)(object)factor;
				result.register.int64_1 = value.register.int64_1 * (long)(object)factor;
			}
			else if (typeof(T) == typeof(float))
			{
				result.register.single_0 = value.register.single_0 * (float)(object)factor;
				result.register.single_1 = value.register.single_1 * (float)(object)factor;
				result.register.single_2 = value.register.single_2 * (float)(object)factor;
				result.register.single_3 = value.register.single_3 * (float)(object)factor;
			}
			else if (typeof(T) == typeof(double))
			{
				result.register.double_0 = value.register.double_0 * (double)(object)factor;
				result.register.double_1 = value.register.double_1 * (double)(object)factor;
			}
			return result;
		}

		public static Vector<T>operator *(T factor, Vector<T> value)
		{
			if (Vector.IsHardwareAccelerated)
			{
				return new Vector<T>(factor) * value;
			}
			Vector<T> result = default(Vector<T>);
			if (typeof(T) == typeof(byte))
			{
				result.register.byte_0 = (byte)(value.register.byte_0 * (byte)(object)factor);
				result.register.byte_1 = (byte)(value.register.byte_1 * (byte)(object)factor);
				result.register.byte_2 = (byte)(value.register.byte_2 * (byte)(object)factor);
				result.register.byte_3 = (byte)(value.register.byte_3 * (byte)(object)factor);
				result.register.byte_4 = (byte)(value.register.byte_4 * (byte)(object)factor);
				result.register.byte_5 = (byte)(value.register.byte_5 * (byte)(object)factor);
				result.register.byte_6 = (byte)(value.register.byte_6 * (byte)(object)factor);
				result.register.byte_7 = (byte)(value.register.byte_7 * (byte)(object)factor);
				result.register.byte_8 = (byte)(value.register.byte_8 * (byte)(object)factor);
				result.register.byte_9 = (byte)(value.register.byte_9 * (byte)(object)factor);
				result.register.byte_10 = (byte)(value.register.byte_10 * (byte)(object)factor);
				result.register.byte_11 = (byte)(value.register.byte_11 * (byte)(object)factor);
				result.register.byte_12 = (byte)(value.register.byte_12 * (byte)(object)factor);
				result.register.byte_13 = (byte)(value.register.byte_13 * (byte)(object)factor);
				result.register.byte_14 = (byte)(value.register.byte_14 * (byte)(object)factor);
				result.register.byte_15 = (byte)(value.register.byte_15 * (byte)(object)factor);
			}
			else if (typeof(T) == typeof(sbyte))
			{
				result.register.sbyte_0 = (sbyte)(value.register.sbyte_0 * (sbyte)(object)factor);
				result.register.sbyte_1 = (sbyte)(value.register.sbyte_1 * (sbyte)(object)factor);
				result.register.sbyte_2 = (sbyte)(value.register.sbyte_2 * (sbyte)(object)factor);
				result.register.sbyte_3 = (sbyte)(value.register.sbyte_3 * (sbyte)(object)factor);
				result.register.sbyte_4 = (sbyte)(value.register.sbyte_4 * (sbyte)(object)factor);
				result.register.sbyte_5 = (sbyte)(value.register.sbyte_5 * (sbyte)(object)factor);
				result.register.sbyte_6 = (sbyte)(value.register.sbyte_6 * (sbyte)(object)factor);
				result.register.sbyte_7 = (sbyte)(value.register.sbyte_7 * (sbyte)(object)factor);
				result.register.sbyte_8 = (sbyte)(value.register.sbyte_8 * (sbyte)(object)factor);
				result.register.sbyte_9 = (sbyte)(value.register.sbyte_9 * (sbyte)(object)factor);
				result.register.sbyte_10 = (sbyte)(value.register.sbyte_10 * (sbyte)(object)factor);
				result.register.sbyte_11 = (sbyte)(value.register.sbyte_11 * (sbyte)(object)factor);
				result.register.sbyte_12 = (sbyte)(value.register.sbyte_12 * (sbyte)(object)factor);
				result.register.sbyte_13 = (sbyte)(value.register.sbyte_13 * (sbyte)(object)factor);
				result.register.sbyte_14 = (sbyte)(value.register.sbyte_14 * (sbyte)(object)factor);
				result.register.sbyte_15 = (sbyte)(value.register.sbyte_15 * (sbyte)(object)factor);
			}
			else if (typeof(T) == typeof(ushort))
			{
				result.register.uint16_0 = (ushort)(value.register.uint16_0 * (ushort)(object)factor);
				result.register.uint16_1 = (ushort)(value.register.uint16_1 * (ushort)(object)factor);
				result.register.uint16_2 = (ushort)(value.register.uint16_2 * (ushort)(object)factor);
				result.register.uint16_3 = (ushort)(value.register.uint16_3 * (ushort)(object)factor);
				result.register.uint16_4 = (ushort)(value.register.uint16_4 * (ushort)(object)factor);
				result.register.uint16_5 = (ushort)(value.register.uint16_5 * (ushort)(object)factor);
				result.register.uint16_6 = (ushort)(value.register.uint16_6 * (ushort)(object)factor);
				result.register.uint16_7 = (ushort)(value.register.uint16_7 * (ushort)(object)factor);
			}
			else if (typeof(T) == typeof(short))
			{
				result.register.int16_0 = (short)(value.register.int16_0 * (short)(object)factor);
				result.register.int16_1 = (short)(value.register.int16_1 * (short)(object)factor);
				result.register.int16_2 = (short)(value.register.int16_2 * (short)(object)factor);
				result.register.int16_3 = (short)(value.register.int16_3 * (short)(object)factor);
				result.register.int16_4 = (short)(value.register.int16_4 * (short)(object)factor);
				result.register.int16_5 = (short)(value.register.int16_5 * (short)(object)factor);
				result.register.int16_6 = (short)(value.register.int16_6 * (short)(object)factor);
				result.register.int16_7 = (short)(value.register.int16_7 * (short)(object)factor);
			}
			else if (typeof(T) == typeof(uint))
			{
				result.register.uint32_0 = value.register.uint32_0 * (uint)(object)factor;
				result.register.uint32_1 = value.register.uint32_1 * (uint)(object)factor;
				result.register.uint32_2 = value.register.uint32_2 * (uint)(object)factor;
				result.register.uint32_3 = value.register.uint32_3 * (uint)(object)factor;
			}
			else if (typeof(T) == typeof(int))
			{
				result.register.int32_0 = value.register.int32_0 * (int)(object)factor;
				result.register.int32_1 = value.register.int32_1 * (int)(object)factor;
				result.register.int32_2 = value.register.int32_2 * (int)(object)factor;
				result.register.int32_3 = value.register.int32_3 * (int)(object)factor;
			}
			else if (typeof(T) == typeof(ulong))
			{
				result.register.uint64_0 = value.register.uint64_0 * (ulong)(object)factor;
				result.register.uint64_1 = value.register.uint64_1 * (ulong)(object)factor;
			}
			else if (typeof(T) == typeof(long))
			{
				result.register.int64_0 = value.register.int64_0 * (long)(object)factor;
				result.register.int64_1 = value.register.int64_1 * (long)(object)factor;
			}
			else if (typeof(T) == typeof(float))
			{
				result.register.single_0 = value.register.single_0 * (float)(object)factor;
				result.register.single_1 = value.register.single_1 * (float)(object)factor;
				result.register.single_2 = value.register.single_2 * (float)(object)factor;
				result.register.single_3 = value.register.single_3 * (float)(object)factor;
			}
			else if (typeof(T) == typeof(double))
			{
				result.register.double_0 = value.register.double_0 * (double)(object)factor;
				result.register.double_1 = value.register.double_1 * (double)(object)factor;
			}
			return result;
		}

		public unsafe static Vector<T>operator /(Vector<T> left, Vector<T> right)
		{
			if (Vector.IsHardwareAccelerated)
			{
				if (typeof(T) == typeof(byte))
				{
					byte* ptr = stackalloc byte[(int)(uint)Count];
					for (int i = 0; i < Count; i++)
					{
						ptr[i] = (byte)(object)ScalarDivide(left[i], right[i]);
					}
					return new Vector<T>(ptr);
				}
				if (typeof(T) == typeof(sbyte))
				{
					sbyte* ptr2 = stackalloc sbyte[(int)(uint)Count];
					for (int j = 0; j < Count; j++)
					{
						ptr2[j] = (sbyte)(object)ScalarDivide(left[j], right[j]);
					}
					return new Vector<T>(ptr2);
				}
				if (typeof(T) == typeof(ushort))
				{
					ushort* ptr3 = stackalloc ushort[Count];
					for (int k = 0; k < Count; k++)
					{
						ptr3[k] = (ushort)(object)ScalarDivide(left[k], right[k]);
					}
					return new Vector<T>(ptr3);
				}
				if (typeof(T) == typeof(short))
				{
					short* ptr4 = stackalloc short[Count];
					for (int l = 0; l < Count; l++)
					{
						ptr4[l] = (short)(object)ScalarDivide(left[l], right[l]);
					}
					return new Vector<T>(ptr4);
				}
				if (typeof(T) == typeof(uint))
				{
					uint* ptr5 = stackalloc uint[Count];
					for (int m = 0; m < Count; m++)
					{
						ptr5[m] = (uint)(object)ScalarDivide(left[m], right[m]);
					}
					return new Vector<T>(ptr5);
				}
				if (typeof(T) == typeof(int))
				{
					int* ptr6 = stackalloc int[Count];
					for (int n = 0; n < Count; n++)
					{
						ptr6[n] = (int)(object)ScalarDivide(left[n], right[n]);
					}
					return new Vector<T>(ptr6);
				}
				if (typeof(T) == typeof(ulong))
				{
					ulong* ptr7 = stackalloc ulong[Count];
					for (int num = 0; num < Count; num++)
					{
						ptr7[num] = (ulong)(object)ScalarDivide(left[num], right[num]);
					}
					return new Vector<T>(ptr7);
				}
				if (typeof(T) == typeof(long))
				{
					long* ptr8 = stackalloc long[Count];
					for (int num2 = 0; num2 < Count; num2++)
					{
						ptr8[num2] = (long)(object)ScalarDivide(left[num2], right[num2]);
					}
					return new Vector<T>(ptr8);
				}
				if (typeof(T) == typeof(float))
				{
					float* ptr9 = stackalloc float[Count];
					for (int num3 = 0; num3 < Count; num3++)
					{
						ptr9[num3] = (float)(object)ScalarDivide(left[num3], right[num3]);
					}
					return new Vector<T>(ptr9);
				}
				if (typeof(T) == typeof(double))
				{
					double* ptr10 = stackalloc double[Count];
					for (int num4 = 0; num4 < Count; num4++)
					{
						ptr10[num4] = (double)(object)ScalarDivide(left[num4], right[num4]);
					}
					return new Vector<T>(ptr10);
				}
				throw new NotSupportedException(System.SR.Arg_TypeNotSupported);
			}
			Vector<T> result = default(Vector<T>);
			if (typeof(T) == typeof(byte))
			{
				result.register.byte_0 = (byte)(left.register.byte_0 / right.register.byte_0);
				result.register.byte_1 = (byte)(left.register.byte_1 / right.register.byte_1);
				result.register.byte_2 = (byte)(left.register.byte_2 / right.register.byte_2);
				result.register.byte_3 = (byte)(left.register.byte_3 / right.register.byte_3);
				result.register.byte_4 = (byte)(left.register.byte_4 / right.register.byte_4);
				result.register.byte_5 = (byte)(left.register.byte_5 / right.register.byte_5);
				result.register.byte_6 = (byte)(left.register.byte_6 / right.register.byte_6);
				result.register.byte_7 = (byte)(left.register.byte_7 / right.register.byte_7);
				result.register.byte_8 = (byte)(left.register.byte_8 / right.register.byte_8);
				result.register.byte_9 = (byte)(left.register.byte_9 / right.register.byte_9);
				result.register.byte_10 = (byte)(left.register.byte_10 / right.register.byte_10);
				result.register.byte_11 = (byte)(left.register.byte_11 / right.register.byte_11);
				result.register.byte_12 = (byte)(left.register.byte_12 / right.register.byte_12);
				result.register.byte_13 = (byte)(left.register.byte_13 / right.register.byte_13);
				result.register.byte_14 = (byte)(left.register.byte_14 / right.register.byte_14);
				result.register.byte_15 = (byte)(left.register.byte_15 / right.register.byte_15);
			}
			else if (typeof(T) == typeof(sbyte))
			{
				result.register.sbyte_0 = (sbyte)(left.register.sbyte_0 / right.register.sbyte_0);
				result.register.sbyte_1 = (sbyte)(left.register.sbyte_1 / right.register.sbyte_1);
				result.register.sbyte_2 = (sbyte)(left.register.sbyte_2 / right.register.sbyte_2);
				result.register.sbyte_3 = (sbyte)(left.register.sbyte_3 / right.register.sbyte_3);
				result.register.sbyte_4 = (sbyte)(left.register.sbyte_4 / right.register.sbyte_4);
				result.register.sbyte_5 = (sbyte)(left.register.sbyte_5 / right.register.sbyte_5);
				result.register.sbyte_6 = (sbyte)(left.register.sbyte_6 / right.register.sbyte_6);
				result.register.sbyte_7 = (sbyte)(left.register.sbyte_7 / right.register.sbyte_7);
				result.register.sbyte_8 = (sbyte)(left.register.sbyte_8 / right.register.sbyte_8);
				result.register.sbyte_9 = (sbyte)(left.register.sbyte_9 / right.register.sbyte_9);
				result.register.sbyte_10 = (sbyte)(left.register.sbyte_10 / right.register.sbyte_10);
				result.register.sbyte_11 = (sbyte)(left.register.sbyte_11 / right.register.sbyte_11);
				result.register.sbyte_12 = (sbyte)(left.register.sbyte_12 / right.register.sbyte_12);
				result.register.sbyte_13 = (sbyte)(left.register.sbyte_13 / right.register.sbyte_13);
				result.register.sbyte_14 = (sbyte)(left.register.sbyte_14 / right.register.sbyte_14);
				result.register.sbyte_15 = (sbyte)(left.register.sbyte_15 / right.register.sbyte_15);
			}
			else if (typeof(T) == typeof(ushort))
			{
				result.register.uint16_0 = (ushort)(left.register.uint16_0 / right.register.uint16_0);
				result.register.uint16_1 = (ushort)(left.register.uint16_1 / right.register.uint16_1);
				result.register.uint16_2 = (ushort)(left.register.uint16_2 / right.register.uint16_2);
				result.register.uint16_3 = (ushort)(left.register.uint16_3 / right.register.uint16_3);
				result.register.uint16_4 = (ushort)(left.register.uint16_4 / right.register.uint16_4);
				result.register.uint16_5 = (ushort)(left.register.uint16_5 / right.register.uint16_5);
				result.register.uint16_6 = (ushort)(left.register.uint16_6 / right.register.uint16_6);
				result.register.uint16_7 = (ushort)(left.register.uint16_7 / right.register.uint16_7);
			}
			else if (typeof(T) == typeof(short))
			{
				result.register.int16_0 = (short)(left.register.int16_0 / right.register.int16_0);
				result.register.int16_1 = (short)(left.register.int16_1 / right.register.int16_1);
				result.register.int16_2 = (short)(left.register.int16_2 / right.register.int16_2);
				result.register.int16_3 = (short)(left.register.int16_3 / right.register.int16_3);
				result.register.int16_4 = (short)(left.register.int16_4 / right.register.int16_4);
				result.register.int16_5 = (short)(left.register.int16_5 / right.register.int16_5);
				result.register.int16_6 = (short)(left.register.int16_6 / right.register.int16_6);
				result.register.int16_7 = (short)(left.register.int16_7 / right.register.int16_7);
			}
			else if (typeof(T) == typeof(uint))
			{
				result.register.uint32_0 = left.register.uint32_0 / right.register.uint32_0;
				result.register.uint32_1 = left.register.uint32_1 / right.register.uint32_1;
				result.register.uint32_2 = left.register.uint32_2 / right.register.uint32_2;
				result.register.uint32_3 = left.register.uint32_3 / right.register.uint32_3;
			}
			else if (typeof(T) == typeof(int))
			{
				result.register.int32_0 = left.register.int32_0 / right.register.int32_0;
				result.register.int32_1 = left.register.int32_1 / right.register.int32_1;
				result.register.int32_2 = left.register.int32_2 / right.register.int32_2;
				result.register.int32_3 = left.register.int32_3 / right.register.int32_3;
			}
			else if (typeof(T) == typeof(ulong))
			{
				result.register.uint64_0 = left.register.uint64_0 / right.register.uint64_0;
				result.register.uint64_1 = left.register.uint64_1 / right.register.uint64_1;
			}
			else if (typeof(T) == typeof(long))
			{
				result.register.int64_0 = left.register.int64_0 / right.register.int64_0;
				result.register.int64_1 = left.register.int64_1 / right.register.int64_1;
			}
			else if (typeof(T) == typeof(float))
			{
				result.register.single_0 = left.register.single_0 / right.register.single_0;
				result.register.single_1 = left.register.single_1 / right.register.single_1;
				result.register.single_2 = left.register.single_2 / right.register.single_2;
				result.register.single_3 = left.register.single_3 / right.register.single_3;
			}
			else if (typeof(T) == typeof(double))
			{
				result.register.double_0 = left.register.double_0 / right.register.double_0;
				result.register.double_1 = left.register.double_1 / right.register.double_1;
			}
			return result;
		}

		public static Vector<T>operator -(Vector<T> value)
		{
			return Zero - value;
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public unsafe static Vector<T>operator &(Vector<T> left, Vector<T> right)
		{
			Vector<T> result = default(Vector<T>);
			if (Vector.IsHardwareAccelerated)
			{
				long* ptr = &result.register.int64_0;
				long* ptr2 = &left.register.int64_0;
				long* ptr3 = &right.register.int64_0;
				for (int i = 0; i < Vector<long>.Count; i++)
				{
					ptr[i] = ptr2[i] & ptr3[i];
				}
			}
			else
			{
				result.register.int64_0 = left.register.int64_0 & right.register.int64_0;
				result.register.int64_1 = left.register.int64_1 & right.register.int64_1;
			}
			return result;
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public unsafe static Vector<T>operator |(Vector<T> left, Vector<T> right)
		{
			Vector<T> result = default(Vector<T>);
			if (Vector.IsHardwareAccelerated)
			{
				long* ptr = &result.register.int64_0;
				long* ptr2 = &left.register.int64_0;
				long* ptr3 = &right.register.int64_0;
				for (int i = 0; i < Vector<long>.Count; i++)
				{
					ptr[i] = ptr2[i] | ptr3[i];
				}
			}
			else
			{
				result.register.int64_0 = left.register.int64_0 | right.register.int64_0;
				result.register.int64_1 = left.register.int64_1 | right.register.int64_1;
			}
			return result;
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public unsafe static Vector<T>operator ^(Vector<T> left, Vector<T> right)
		{
			Vector<T> result = default(Vector<T>);
			if (Vector.IsHardwareAccelerated)
			{
				long* ptr = &result.register.int64_0;
				long* ptr2 = &left.register.int64_0;
				long* ptr3 = &right.register.int64_0;
				for (int i = 0; i < Vector<long>.Count; i++)
				{
					ptr[i] = ptr2[i] ^ ptr3[i];
				}
			}
			else
			{
				result.register.int64_0 = left.register.int64_0 ^ right.register.int64_0;
				result.register.int64_1 = left.register.int64_1 ^ right.register.int64_1;
			}
			return result;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static Vector<T>operator ~(Vector<T> value)
		{
			return s_allOnes ^ value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool operator ==(Vector<T> left, Vector<T> right)
		{
			return left.Equals(right);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool operator !=(Vector<T> left, Vector<T> right)
		{
			return !(left == right);
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<byte>(Vector<T> value)
		{
			return new Vector<byte>(ref value.register);
		}

		[CLSCompliant(false)]
		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<sbyte>(Vector<T> value)
		{
			return new Vector<sbyte>(ref value.register);
		}

		[CLSCompliant(false)]
		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<ushort>(Vector<T> value)
		{
			return new Vector<ushort>(ref value.register);
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<short>(Vector<T> value)
		{
			return new Vector<short>(ref value.register);
		}

		[CLSCompliant(false)]
		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<uint>(Vector<T> value)
		{
			return new Vector<uint>(ref value.register);
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<int>(Vector<T> value)
		{
			return new Vector<int>(ref value.register);
		}

		[CLSCompliant(false)]
		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<ulong>(Vector<T> value)
		{
			return new Vector<ulong>(ref value.register);
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<long>(Vector<T> value)
		{
			return new Vector<long>(ref value.register);
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<float>(Vector<T> value)
		{
			return new Vector<float>(ref value.register);
		}

		[System.Runtime.CompilerServices.Intrinsic]
		public static explicit operator Vector<double>(Vector<T> value)
		{
			return new Vector<double>(ref value.register);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Compile

BepInEx\plugins\Cyberhead\System.Runtime.CompilerServices.Unsafe.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Microsoft.CodeAnalysis;

[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: CLSCompliant(false)]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyDescription("System.Runtime.CompilerServices.Unsafe")]
[assembly: AssemblyFileVersion("6.0.21.52210")]
[assembly: AssemblyInformationalVersion("6.0.0")]
[assembly: AssemblyTitle("System.Runtime.CompilerServices.Unsafe")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: AssemblyCopyright("© Microsoft Corporation.  All rights reserved.")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyVersion("6.0.0.0")]
namespace System.Runtime.CompilerServices
{
	public static class Unsafe
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static T Read<T>(void* source)
		{
			return Unsafe.Read<T>(source);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static T ReadUnaligned<T>(void* source)
		{
			return Unsafe.ReadUnaligned<T>(source);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static T ReadUnaligned<T>(ref byte source)
		{
			return Unsafe.ReadUnaligned<T>(ref source);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void Write<T>(void* destination, T value)
		{
			Unsafe.Write(destination, value);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void WriteUnaligned<T>(void* destination, T value)
		{
			Unsafe.WriteUnaligned(destination, value);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static void WriteUnaligned<T>(ref byte destination, T value)
		{
			Unsafe.WriteUnaligned(ref destination, value);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void Copy<T>(void* destination, ref T source)
		{
			Unsafe.Write(destination, source);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void Copy<T>(ref T destination, void* source)
		{
			destination = Unsafe.Read<T>(source);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void* AsPointer<T>(ref T value)
		{
			return Unsafe.AsPointer(ref value);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static void SkipInit<T>(out T value)
		{
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static int SizeOf<T>()
		{
			return Unsafe.SizeOf<T>();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void CopyBlock(void* destination, void* source, uint byteCount)
		{
			// IL cpblk instruction
			Unsafe.CopyBlock(destination, source, byteCount);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static void CopyBlock(ref byte destination, ref byte source, uint byteCount)
		{
			// IL cpblk instruction
			Unsafe.CopyBlock(ref destination, ref source, byteCount);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void CopyBlockUnaligned(void* destination, void* source, uint byteCount)
		{
			// IL cpblk instruction
			Unsafe.CopyBlockUnaligned(destination, source, byteCount);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static void CopyBlockUnaligned(ref byte destination, ref byte source, uint byteCount)
		{
			// IL cpblk instruction
			Unsafe.CopyBlockUnaligned(ref destination, ref source, byteCount);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void InitBlock(void* startAddress, byte value, uint byteCount)
		{
			// IL initblk instruction
			Unsafe.InitBlock(startAddress, value, byteCount);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static void InitBlock(ref byte startAddress, byte value, uint byteCount)
		{
			// IL initblk instruction
			Unsafe.InitBlock(ref startAddress, value, byteCount);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void InitBlockUnaligned(void* startAddress, byte value, uint byteCount)
		{
			// IL initblk instruction
			Unsafe.InitBlockUnaligned(startAddress, value, byteCount);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static void InitBlockUnaligned(ref byte startAddress, byte value, uint byteCount)
		{
			// IL initblk instruction
			Unsafe.InitBlockUnaligned(ref startAddress, value, byteCount);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static T As<T>(object o) where T : class
		{
			return (T)o;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static ref T AsRef<T>(void* source)
		{
			return ref *(T*)source;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static ref T AsRef<T>(in T source)
		{
			return ref source;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static ref TTo As<TFrom, TTo>(ref TFrom source)
		{
			return ref Unsafe.As<TFrom, TTo>(ref source);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static ref T Unbox<T>(object box) where T : struct
		{
			return ref (T)box;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static ref T Add<T>(ref T source, int elementOffset)
		{
			return ref Unsafe.Add(ref source, elementOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void* Add<T>(void* source, int elementOffset)
		{
			return (byte*)source + (nint)elementOffset * (nint)Unsafe.SizeOf<T>();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static ref T Add<T>(ref T source, IntPtr elementOffset)
		{
			return ref Unsafe.Add(ref source, elementOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static ref T Add<T>(ref T source, [System.Runtime.Versioning.NonVersionable] nuint elementOffset)
		{
			return ref Unsafe.Add(ref source, elementOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static ref T AddByteOffset<T>(ref T source, IntPtr byteOffset)
		{
			return ref Unsafe.AddByteOffset(ref source, byteOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static ref T AddByteOffset<T>(ref T source, [System.Runtime.Versioning.NonVersionable] nuint byteOffset)
		{
			return ref Unsafe.AddByteOffset(ref source, byteOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static ref T Subtract<T>(ref T source, int elementOffset)
		{
			return ref Unsafe.Subtract(ref source, elementOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static void* Subtract<T>(void* source, int elementOffset)
		{
			return (byte*)source - (nint)elementOffset * (nint)Unsafe.SizeOf<T>();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static ref T Subtract<T>(ref T source, IntPtr elementOffset)
		{
			return ref Unsafe.Subtract(ref source, elementOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static ref T Subtract<T>(ref T source, [System.Runtime.Versioning.NonVersionable] nuint elementOffset)
		{
			return ref Unsafe.Subtract(ref source, elementOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static ref T SubtractByteOffset<T>(ref T source, IntPtr byteOffset)
		{
			return ref Unsafe.SubtractByteOffset(ref source, byteOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static ref T SubtractByteOffset<T>(ref T source, [System.Runtime.Versioning.NonVersionable] nuint byteOffset)
		{
			return ref Unsafe.SubtractByteOffset(ref source, byteOffset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static IntPtr ByteOffset<T>(ref T origin, ref T target)
		{
			return Unsafe.ByteOffset(target: ref target, origin: ref origin);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static bool AreSame<T>(ref T left, ref T right)
		{
			return Unsafe.AreSame(ref left, ref right);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static bool IsAddressGreaterThan<T>(ref T left, ref T right)
		{
			return Unsafe.IsAddressGreaterThan(ref left, ref right);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public static bool IsAddressLessThan<T>(ref T left, ref T right)
		{
			return Unsafe.IsAddressLessThan(ref left, ref right);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static bool IsNullRef<T>(ref T source)
		{
			return Unsafe.AsPointer(ref source) == null;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[System.Runtime.Versioning.NonVersionable]
		public unsafe static ref T NullRef<T>()
		{
			return ref *(T*)null;
		}
	}
}
namespace System.Runtime.Versioning
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class NonVersionableAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	[Microsoft.CodeAnalysis.Embedded]
	[CompilerGenerated]
	internal sealed class NativeIntegerAttribute : Attribute
	{
		public readonly bool[] TransformFlags;

		public NativeIntegerAttribute()
		{
			TransformFlags = new bool[1] { true };
		}

		public NativeIntegerAttribute(bool[] A_0)
		{
			TransformFlags = A_0;
		}
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}

BepInEx\plugins\Cyberhead\System.Text.Encodings.Web.dll

Decompiled a year ago
using System;
using System.Buffers;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Numerics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using System.Threading;
using FxResources.System.Text.Encodings.Web;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("System.Text.Encodings.Web")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Provides types for encoding and escaping strings for use in JavaScript, HyperText Markup Language (HTML), and uniform resource locators (URL).\r\n\r\nCommonly Used Types:\r\nSystem.Text.Encodings.Web.HtmlEncoder\r\nSystem.Text.Encodings.Web.UrlEncoder\r\nSystem.Text.Encodings.Web.JavaScriptEncoder")]
[assembly: AssemblyFileVersion("8.0.23.53103")]
[assembly: AssemblyInformationalVersion("8.0.0+5535e31a712343a63f5d7d796cd874e563e5ac14")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("System.Text.Encodings.Web")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("8.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsByRefLikeAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NativeIntegerAttribute : Attribute
	{
		public readonly bool[] TransformFlags;

		public NativeIntegerAttribute()
		{
			TransformFlags = new bool[1] { true };
		}

		public NativeIntegerAttribute(bool[] P_0)
		{
			TransformFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.System.Text.Encodings.Web
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class HexConverter
	{
		public enum Casing : uint
		{
			Upper = 0u,
			Lower = 8224u
		}

		public static ReadOnlySpan<byte> CharToHexLookup => new byte[256]
		{
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 0, 1,
			2, 3, 4, 5, 6, 7, 8, 9, 255, 255,
			255, 255, 255, 255, 255, 10, 11, 12, 13, 14,
			15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 10, 11, 12,
			13, 14, 15, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255
		};

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper)
		{
			uint num = (uint)(((value & 0xF0) << 4) + (value & 0xF) - 35209);
			uint num2 = ((((0 - num) & 0x7070) >> 4) + num + 47545) | (uint)casing;
			buffer[startingIndex + 1] = (byte)num2;
			buffer[startingIndex] = (byte)(num2 >> 8);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper)
		{
			uint num = (uint)(((value & 0xF0) << 4) + (value & 0xF) - 35209);
			uint num2 = ((((0 - num) & 0x7070) >> 4) + num + 47545) | (uint)casing;
			buffer[startingIndex + 1] = (char)(num2 & 0xFFu);
			buffer[startingIndex] = (char)(num2 >> 8);
		}

		public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper)
		{
			for (int i = 0; i < bytes.Length; i++)
			{
				ToCharsBuffer(bytes[i], chars, i * 2, casing);
			}
		}

		public static string ToString(ReadOnlySpan<byte> bytes, Casing casing = Casing.Upper)
		{
			Span<char> span = ((bytes.Length <= 16) ? stackalloc char[bytes.Length * 2] : new char[bytes.Length * 2].AsSpan());
			Span<char> buffer = span;
			int num = 0;
			ReadOnlySpan<byte> readOnlySpan = bytes;
			for (int i = 0; i < readOnlySpan.Length; i++)
			{
				byte value = readOnlySpan[i];
				ToCharsBuffer(value, buffer, num, casing);
				num += 2;
			}
			return buffer.ToString();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static char ToCharUpper(int value)
		{
			value &= 0xF;
			value += 48;
			if (value > 57)
			{
				value += 7;
			}
			return (char)value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static char ToCharLower(int value)
		{
			value &= 0xF;
			value += 48;
			if (value > 57)
			{
				value += 39;
			}
			return (char)value;
		}

		public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes)
		{
			int charsProcessed;
			return TryDecodeFromUtf16(chars, bytes, out charsProcessed);
		}

		public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
		{
			int num = 0;
			int num2 = 0;
			int num3 = 0;
			int num4 = 0;
			while (num2 < bytes.Length)
			{
				num3 = FromChar(chars[num + 1]);
				num4 = FromChar(chars[num]);
				if ((num3 | num4) == 255)
				{
					break;
				}
				bytes[num2++] = (byte)((num4 << 4) | num3);
				num += 2;
			}
			if (num3 == 255)
			{
				num++;
			}
			charsProcessed = num;
			return (num3 | num4) != 255;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int FromChar(int c)
		{
			if (c < CharToHexLookup.Length)
			{
				return CharToHexLookup[c];
			}
			return 255;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int FromUpperChar(int c)
		{
			if (c <= 71)
			{
				return CharToHexLookup[c];
			}
			return 255;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int FromLowerChar(int c)
		{
			switch (c)
			{
			case 48:
			case 49:
			case 50:
			case 51:
			case 52:
			case 53:
			case 54:
			case 55:
			case 56:
			case 57:
				return c - 48;
			case 97:
			case 98:
			case 99:
			case 100:
			case 101:
			case 102:
				return c - 97 + 10;
			default:
				return 255;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsHexChar(int c)
		{
			if (IntPtr.Size == 8)
			{
				ulong num = (uint)(c - 48);
				ulong num2 = (ulong)(-17875860044349952L << (int)num);
				ulong num3 = num - 64;
				return (long)(num2 & num3) < 0L;
			}
			return FromChar(c) != 255;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsHexUpperChar(int c)
		{
			if ((uint)(c - 48) > 9u)
			{
				return (uint)(c - 65) <= 5u;
			}
			return true;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsHexLowerChar(int c)
		{
			if ((uint)(c - 48) > 9u)
			{
				return (uint)(c - 97) <= 5u;
			}
			return true;
		}
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string TextEncoderDoesNotImplementMaxOutputCharsPerInputChar => GetResourceString("TextEncoderDoesNotImplementMaxOutputCharsPerInputChar");

		internal static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		private static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		private static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Numerics
{
	internal static class BitOperations
	{
		private static ReadOnlySpan<byte> Log2DeBruijn => new byte[32]
		{
			0, 9, 1, 10, 13, 21, 2, 29, 11, 14,
			16, 18, 22, 25, 3, 30, 8, 12, 20, 28,
			15, 17, 24, 7, 19, 27, 23, 6, 26, 5,
			4, 31
		};

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int Log2(uint value)
		{
			return Log2SoftwareFallback(value | 1u);
		}

		private static int Log2SoftwareFallback(uint value)
		{
			value |= value >> 1;
			value |= value >> 2;
			value |= value >> 4;
			value |= value >> 8;
			value |= value >> 16;
			return System.Runtime.CompilerServices.Unsafe.AddByteOffset<byte>(ref MemoryMarshal.GetReference(Log2DeBruijn), (IntPtr)(nint)(value * 130329821 >> 27));
		}
	}
}
namespace System.Text
{
	internal static class UnicodeDebug
	{
		[Conditional("DEBUG")]
		internal static void AssertIsBmpCodePoint(uint codePoint)
		{
			System.Text.UnicodeUtility.IsBmpCodePoint(codePoint);
		}

		[Conditional("DEBUG")]
		internal static void AssertIsHighSurrogateCodePoint(uint codePoint)
		{
			System.Text.UnicodeUtility.IsHighSurrogateCodePoint(codePoint);
		}

		[Conditional("DEBUG")]
		internal static void AssertIsLowSurrogateCodePoint(uint codePoint)
		{
			System.Text.UnicodeUtility.IsLowSurrogateCodePoint(codePoint);
		}

		[Conditional("DEBUG")]
		internal static void AssertIsValidCodePoint(uint codePoint)
		{
			System.Text.UnicodeUtility.IsValidCodePoint(codePoint);
		}

		[Conditional("DEBUG")]
		internal static void AssertIsValidScalar(uint scalarValue)
		{
			System.Text.UnicodeUtility.IsValidUnicodeScalar(scalarValue);
		}

		[Conditional("DEBUG")]
		internal static void AssertIsValidSupplementaryPlaneScalar(uint scalarValue)
		{
			if (System.Text.UnicodeUtility.IsValidUnicodeScalar(scalarValue))
			{
				System.Text.UnicodeUtility.IsBmpCodePoint(scalarValue);
			}
		}

		private static string ToHexString(uint codePoint)
		{
			return FormattableString.Invariant($"U+{codePoint:X4}");
		}
	}
	internal static class UnicodeUtility
	{
		public const uint ReplacementChar = 65533u;

		public static int GetPlane(uint codePoint)
		{
			return (int)(codePoint >> 16);
		}

		public static uint GetScalarFromUtf16SurrogatePair(uint highSurrogateCodePoint, uint lowSurrogateCodePoint)
		{
			return (highSurrogateCodePoint << 10) + lowSurrogateCodePoint - 56613888;
		}

		public static int GetUtf16SequenceLength(uint value)
		{
			value -= 65536;
			value += 33554432;
			value >>= 24;
			return (int)value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static void GetUtf16SurrogatesFromSupplementaryPlaneScalar(uint value, out char highSurrogateCodePoint, out char lowSurrogateCodePoint)
		{
			highSurrogateCodePoint = (char)(value + 56557568 >> 10);
			lowSurrogateCodePoint = (char)((value & 0x3FF) + 56320);
		}

		public static int GetUtf8SequenceLength(uint value)
		{
			int num = (int)(value - 2048) >> 31;
			value ^= 0xF800u;
			value -= 63616;
			value += 67108864;
			value >>= 24;
			return (int)value + num * 2;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsAsciiCodePoint(uint value)
		{
			return value <= 127;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsBmpCodePoint(uint value)
		{
			return value <= 65535;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsHighSurrogateCodePoint(uint value)
		{
			return IsInRangeInclusive(value, 55296u, 56319u);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsInRangeInclusive(uint value, uint lowerBound, uint upperBound)
		{
			return value - lowerBound <= upperBound - lowerBound;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsLowSurrogateCodePoint(uint value)
		{
			return IsInRangeInclusive(value, 56320u, 57343u);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsSurrogateCodePoint(uint value)
		{
			return IsInRangeInclusive(value, 55296u, 57343u);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsValidCodePoint(uint codePoint)
		{
			return codePoint <= 1114111;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsValidUnicodeScalar(uint value)
		{
			return ((value - 1114112) ^ 0xD800) >= 4293855232u;
		}
	}
	internal ref struct ValueStringBuilder
	{
		private char[] _arrayToReturnToPool;

		private Span<char> _chars;

		private int _pos;

		public int Length
		{
			get
			{
				return _pos;
			}
			set
			{
				_pos = value;
			}
		}

		public int Capacity => _chars.Length;

		public ref char this[int index] => ref _chars[index];

		public Span<char> RawChars => _chars;

		public ValueStringBuilder(Span<char> initialBuffer)
		{
			_arrayToReturnToPool = null;
			_chars = initialBuffer;
			_pos = 0;
		}

		public ValueStringBuilder(int initialCapacity)
		{
			_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(initialCapacity);
			_chars = _arrayToReturnToPool;
			_pos = 0;
		}

		public void EnsureCapacity(int capacity)
		{
			if ((uint)capacity > (uint)_chars.Length)
			{
				Grow(capacity - _pos);
			}
		}

		public ref char GetPinnableReference()
		{
			return ref MemoryMarshal.GetReference(_chars);
		}

		public ref char GetPinnableReference(bool terminate)
		{
			if (terminate)
			{
				EnsureCapacity(Length + 1);
				_chars[Length] = '\0';
			}
			return ref MemoryMarshal.GetReference(_chars);
		}

		public override string ToString()
		{
			string result = _chars.Slice(0, _pos).ToString();
			Dispose();
			return result;
		}

		public ReadOnlySpan<char> AsSpan(bool terminate)
		{
			if (terminate)
			{
				EnsureCapacity(Length + 1);
				_chars[Length] = '\0';
			}
			return _chars.Slice(0, _pos);
		}

		public ReadOnlySpan<char> AsSpan()
		{
			return _chars.Slice(0, _pos);
		}

		public ReadOnlySpan<char> AsSpan(int start)
		{
			return _chars.Slice(start, _pos - start);
		}

		public ReadOnlySpan<char> AsSpan(int start, int length)
		{
			return _chars.Slice(start, length);
		}

		public bool TryCopyTo(Span<char> destination, out int charsWritten)
		{
			if (_chars.Slice(0, _pos).TryCopyTo(destination))
			{
				charsWritten = _pos;
				Dispose();
				return true;
			}
			charsWritten = 0;
			Dispose();
			return false;
		}

		public void Insert(int index, char value, int count)
		{
			if (_pos > _chars.Length - count)
			{
				Grow(count);
			}
			int length = _pos - index;
			_chars.Slice(index, length).CopyTo(_chars.Slice(index + count));
			_chars.Slice(index, count).Fill(value);
			_pos += count;
		}

		public void Insert(int index, string s)
		{
			if (s != null)
			{
				int length = s.Length;
				if (_pos > _chars.Length - length)
				{
					Grow(length);
				}
				int length2 = _pos - index;
				_chars.Slice(index, length2).CopyTo(_chars.Slice(index + length));
				s.AsSpan().CopyTo(_chars.Slice(index));
				_pos += length;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void Append(char c)
		{
			int pos = _pos;
			Span<char> chars = _chars;
			if ((uint)pos < (uint)chars.Length)
			{
				chars[pos] = c;
				_pos = pos + 1;
			}
			else
			{
				GrowAndAppend(c);
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void Append(string s)
		{
			if (s != null)
			{
				int pos = _pos;
				if (s.Length == 1 && (uint)pos < (uint)_chars.Length)
				{
					_chars[pos] = s[0];
					_pos = pos + 1;
				}
				else
				{
					AppendSlow(s);
				}
			}
		}

		private void AppendSlow(string s)
		{
			int pos = _pos;
			if (pos > _chars.Length - s.Length)
			{
				Grow(s.Length);
			}
			s.AsSpan().CopyTo(_chars.Slice(pos));
			_pos += s.Length;
		}

		public void Append(char c, int count)
		{
			if (_pos > _chars.Length - count)
			{
				Grow(count);
			}
			Span<char> span = _chars.Slice(_pos, count);
			for (int i = 0; i < span.Length; i++)
			{
				span[i] = c;
			}
			_pos += count;
		}

		public unsafe void Append(char* value, int length)
		{
			int pos = _pos;
			if (pos > _chars.Length - length)
			{
				Grow(length);
			}
			Span<char> span = _chars.Slice(_pos, length);
			for (int i = 0; i < span.Length; i++)
			{
				span[i] = *(value++);
			}
			_pos += length;
		}

		public void Append(ReadOnlySpan<char> value)
		{
			int pos = _pos;
			if (pos > _chars.Length - value.Length)
			{
				Grow(value.Length);
			}
			value.CopyTo(_chars.Slice(_pos));
			_pos += value.Length;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public Span<char> AppendSpan(int length)
		{
			int pos = _pos;
			if (pos > _chars.Length - length)
			{
				Grow(length);
			}
			_pos = pos + length;
			return _chars.Slice(pos, length);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private void GrowAndAppend(char c)
		{
			Grow(1);
			Append(c);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private void Grow(int additionalCapacityBeyondPos)
		{
			int minimumLength = (int)Math.Max((uint)(_pos + additionalCapacityBeyondPos), Math.Min((uint)(_chars.Length * 2), 2147483591u));
			char[] array = ArrayPool<char>.Shared.Rent(minimumLength);
			_chars.Slice(0, _pos).CopyTo(array);
			char[] arrayToReturnToPool = _arrayToReturnToPool;
			_chars = (_arrayToReturnToPool = array);
			if (arrayToReturnToPool != null)
			{
				ArrayPool<char>.Shared.Return(arrayToReturnToPool);
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void Dispose()
		{
			char[] arrayToReturnToPool = _arrayToReturnToPool;
			this = default(System.Text.ValueStringBuilder);
			if (arrayToReturnToPool != null)
			{
				ArrayPool<char>.Shared.Return(arrayToReturnToPool);
			}
		}
	}
	internal readonly struct Rune : IEquatable<Rune>
	{
		private const int MaxUtf16CharsPerRune = 2;

		private const char HighSurrogateStart = '\ud800';

		private const char LowSurrogateStart = '\udc00';

		private const int HighSurrogateRange = 1023;

		private readonly uint _value;

		public bool IsAscii => System.Text.UnicodeUtility.IsAsciiCodePoint(_value);

		public bool IsBmp => System.Text.UnicodeUtility.IsBmpCodePoint(_value);

		public static Rune ReplacementChar => UnsafeCreate(65533u);

		public int Utf16SequenceLength => System.Text.UnicodeUtility.GetUtf16SequenceLength(_value);

		public int Value => (int)_value;

		public Rune(uint value)
		{
			if (!System.Text.UnicodeUtility.IsValidUnicodeScalar(value))
			{
				ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.value);
			}
			_value = value;
		}

		public Rune(int value)
			: this((uint)value)
		{
		}

		private Rune(uint scalarValue, bool _)
		{
			_value = scalarValue;
		}

		public static bool operator ==(Rune left, Rune right)
		{
			return left._value == right._value;
		}

		public static bool operator !=(Rune left, Rune right)
		{
			return left._value != right._value;
		}

		public static bool IsControl(Rune value)
		{
			return ((value._value + 1) & 0xFFFFFF7Fu) <= 32;
		}

		public static OperationStatus DecodeFromUtf16(ReadOnlySpan<char> source, out Rune result, out int charsConsumed)
		{
			if (!source.IsEmpty)
			{
				char c = source[0];
				if (TryCreate(c, out result))
				{
					charsConsumed = 1;
					return OperationStatus.Done;
				}
				if (1u < (uint)source.Length)
				{
					char lowSurrogate = source[1];
					if (TryCreate(c, lowSurrogate, out result))
					{
						charsConsumed = 2;
						return OperationStatus.Done;
					}
				}
				else if (char.IsHighSurrogate(c))
				{
					goto IL_004c;
				}
				charsConsumed = 1;
				result = ReplacementChar;
				return OperationStatus.InvalidData;
			}
			goto IL_004c;
			IL_004c:
			charsConsumed = source.Length;
			result = ReplacementChar;
			return OperationStatus.NeedMoreData;
		}

		public static OperationStatus DecodeFromUtf8(ReadOnlySpan<byte> source, out Rune result, out int bytesConsumed)
		{
			int num = 0;
			uint num2;
			if ((uint)num < (uint)source.Length)
			{
				num2 = source[num];
				if (System.Text.UnicodeUtility.IsAsciiCodePoint(num2))
				{
					goto IL_0021;
				}
				if (System.Text.UnicodeUtility.IsInRangeInclusive(num2, 194u, 244u))
				{
					num2 = num2 - 194 << 6;
					num++;
					if ((uint)num >= (uint)source.Length)
					{
						goto IL_0163;
					}
					int num3 = (sbyte)source[num];
					if (num3 < -64)
					{
						num2 += (uint)num3;
						num2 += 128;
						num2 += 128;
						if (num2 < 2048)
						{
							goto IL_0021;
						}
						if (System.Text.UnicodeUtility.IsInRangeInclusive(num2, 2080u, 3343u) && !System.Text.UnicodeUtility.IsInRangeInclusive(num2, 2912u, 2943u) && !System.Text.UnicodeUtility.IsInRangeInclusive(num2, 3072u, 3087u))
						{
							num++;
							if ((uint)num >= (uint)source.Length)
							{
								goto IL_0163;
							}
							num3 = (sbyte)source[num];
							if (num3 < -64)
							{
								num2 <<= 6;
								num2 += (uint)num3;
								num2 += 128;
								num2 -= 131072;
								if (num2 > 65535)
								{
									num++;
									if ((uint)num >= (uint)source.Length)
									{
										goto IL_0163;
									}
									num3 = (sbyte)source[num];
									if (num3 >= -64)
									{
										goto IL_0153;
									}
									num2 <<= 6;
									num2 += (uint)num3;
									num2 += 128;
									num2 -= 4194304;
								}
								goto IL_0021;
							}
						}
					}
				}
				else
				{
					num = 1;
				}
				goto IL_0153;
			}
			goto IL_0163;
			IL_0021:
			bytesConsumed = num + 1;
			result = UnsafeCreate(num2);
			return OperationStatus.Done;
			IL_0153:
			bytesConsumed = num;
			result = ReplacementChar;
			return OperationStatus.InvalidData;
			IL_0163:
			bytesConsumed = num;
			result = ReplacementChar;
			return OperationStatus.NeedMoreData;
		}

		public override bool Equals([NotNullWhen(true)] object obj)
		{
			if (obj is Rune other)
			{
				return Equals(other);
			}
			return false;
		}

		public bool Equals(Rune other)
		{
			return this == other;
		}

		public override int GetHashCode()
		{
			return Value;
		}

		public static bool TryCreate(char ch, out Rune result)
		{
			if (!System.Text.UnicodeUtility.IsSurrogateCodePoint(ch))
			{
				result = UnsafeCreate(ch);
				return true;
			}
			result = default(Rune);
			return false;
		}

		public static bool TryCreate(char highSurrogate, char lowSurrogate, out Rune result)
		{
			uint num = (uint)(highSurrogate - 55296);
			uint num2 = (uint)(lowSurrogate - 56320);
			if ((num | num2) <= 1023)
			{
				result = UnsafeCreate((uint)((int)(num << 10) + (lowSurrogate - 56320) + 65536));
				return true;
			}
			result = default(Rune);
			return false;
		}

		public bool TryEncodeToUtf16(Span<char> destination, out int charsWritten)
		{
			if (destination.Length >= 1)
			{
				if (IsBmp)
				{
					destination[0] = (char)_value;
					charsWritten = 1;
					return true;
				}
				if (destination.Length >= 2)
				{
					System.Text.UnicodeUtility.GetUtf16SurrogatesFromSupplementaryPlaneScalar(_value, out destination[0], out destination[1]);
					charsWritten = 2;
					return true;
				}
			}
			charsWritten = 0;
			return false;
		}

		public bool TryEncodeToUtf8(Span<byte> destination, out int bytesWritten)
		{
			if (destination.Length >= 1)
			{
				if (IsAscii)
				{
					destination[0] = (byte)_value;
					bytesWritten = 1;
					return true;
				}
				if (destination.Length >= 2)
				{
					if (_value <= 2047)
					{
						destination[0] = (byte)(_value + 12288 >> 6);
						destination[1] = (byte)((_value & 0x3F) + 128);
						bytesWritten = 2;
						return true;
					}
					if (destination.Length >= 3)
					{
						if (_value <= 65535)
						{
							destination[0] = (byte)(_value + 917504 >> 12);
							destination[1] = (byte)(((_value & 0xFC0) >> 6) + 128);
							destination[2] = (byte)((_value & 0x3F) + 128);
							bytesWritten = 3;
							return true;
						}
						if (destination.Length >= 4)
						{
							destination[0] = (byte)(_value + 62914560 >> 18);
							destination[1] = (byte)(((_value & 0x3F000) >> 12) + 128);
							destination[2] = (byte)(((_value & 0xFC0) >> 6) + 128);
							destination[3] = (byte)((_value & 0x3F) + 128);
							bytesWritten = 4;
							return true;
						}
					}
				}
			}
			bytesWritten = 0;
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static Rune UnsafeCreate(uint scalarValue)
		{
			return new Rune(scalarValue, _: false);
		}
	}
}
namespace System.Text.Unicode
{
	internal static class UnicodeHelpers
	{
		internal const int UNICODE_LAST_CODEPOINT = 1114111;

		private static ReadOnlySpan<byte> DefinedCharsBitmapSpan => new byte[8192]
		{
			0, 0, 0, 0, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 127, 0, 0, 0, 0,
			254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 252, 240, 215, 255, 255, 251, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 254, 255, 255, 255,
			127, 254, 255, 255, 255, 255, 255, 231, 254, 255,
			255, 255, 255, 255, 255, 0, 255, 255, 255, 135,
			31, 0, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 191, 255, 255, 255, 255,
			255, 255, 255, 231, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 3, 0, 255, 255,
			255, 255, 255, 255, 255, 231, 255, 255, 255, 255,
			255, 63, 255, 127, 255, 255, 255, 79, 255, 7,
			255, 255, 255, 127, 3, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 239, 159, 249, 255, 255, 253,
			197, 243, 159, 121, 128, 176, 207, 255, 255, 127,
			238, 135, 249, 255, 255, 253, 109, 211, 135, 57,
			2, 94, 192, 255, 127, 0, 238, 191, 251, 255,
			255, 253, 237, 243, 191, 59, 1, 0, 207, 255,
			3, 254, 238, 159, 249, 255, 255, 253, 237, 243,
			159, 57, 224, 176, 207, 255, 255, 0, 236, 199,
			61, 214, 24, 199, 255, 195, 199, 61, 129, 0,
			192, 255, 255, 7, 255, 223, 253, 255, 255, 253,
			255, 243, 223, 61, 96, 39, 207, 255, 128, 255,
			255, 223, 253, 255, 255, 253, 239, 243, 223, 61,
			96, 96, 207, 255, 14, 0, 255, 223, 253, 255,
			255, 255, 255, 255, 223, 253, 240, 255, 207, 255,
			255, 255, 238, 255, 127, 252, 255, 255, 251, 47,
			127, 132, 95, 255, 192, 255, 28, 0, 254, 255,
			255, 255, 255, 255, 255, 135, 255, 255, 255, 15,
			0, 0, 0, 0, 214, 247, 255, 255, 175, 255,
			255, 63, 95, 127, 255, 243, 0, 0, 0, 0,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 254,
			255, 255, 255, 31, 254, 255, 255, 255, 255, 254,
			255, 255, 255, 223, 255, 223, 255, 7, 0, 0,
			0, 0, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 191, 32, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 61, 127, 61, 255, 255,
			255, 255, 255, 61, 255, 255, 255, 255, 61, 127,
			61, 255, 127, 255, 255, 255, 255, 255, 255, 255,
			61, 255, 255, 255, 255, 255, 255, 255, 255, 231,
			255, 255, 255, 31, 255, 255, 255, 3, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 63, 63,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			254, 255, 255, 31, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 1, 255, 255, 63, 128,
			255, 255, 127, 0, 255, 255, 15, 0, 255, 223,
			13, 0, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 63, 255, 3, 255, 3, 255, 255,
			255, 3, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 1, 255, 255, 255, 255, 255, 7,
			255, 255, 255, 255, 255, 255, 255, 255, 63, 0,
			255, 255, 255, 127, 255, 15, 255, 15, 241, 255,
			255, 255, 255, 63, 31, 0, 255, 255, 255, 255,
			255, 15, 255, 255, 255, 3, 255, 199, 255, 255,
			255, 255, 255, 255, 255, 207, 255, 255, 255, 255,
			255, 255, 255, 127, 255, 255, 255, 159, 255, 3,
			255, 3, 255, 63, 255, 255, 255, 127, 0, 0,
			0, 0, 0, 0, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 31, 255, 255, 255, 255, 255, 127,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 15, 240, 255, 255, 255, 255,
			255, 255, 255, 248, 255, 227, 255, 255, 255, 255,
			255, 255, 255, 1, 255, 255, 255, 255, 255, 231,
			255, 0, 255, 255, 255, 255, 255, 7, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 63, 63, 255, 255, 255, 255,
			63, 63, 255, 170, 255, 255, 255, 63, 255, 255,
			255, 255, 255, 255, 223, 255, 223, 255, 207, 239,
			255, 255, 220, 127, 0, 248, 255, 255, 255, 124,
			255, 255, 255, 255, 255, 127, 223, 255, 243, 255,
			255, 127, 255, 31, 255, 255, 255, 255, 1, 0,
			255, 255, 255, 255, 1, 0, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 15, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 127, 0, 0, 0,
			255, 7, 0, 0, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			207, 255, 255, 255, 191, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 15, 254,
			255, 255, 255, 255, 191, 32, 255, 255, 255, 255,
			255, 255, 255, 128, 1, 128, 255, 255, 127, 0,
			127, 127, 127, 127, 127, 127, 127, 127, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 63, 0, 0, 0, 0, 255, 255,
			255, 251, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 15, 0, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			63, 0, 0, 0, 255, 15, 254, 255, 255, 255,
			255, 255, 255, 255, 254, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 127, 254, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 224, 255,
			255, 255, 255, 255, 254, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 127, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 15, 0, 255, 255,
			255, 255, 255, 127, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 31, 255, 255, 255, 255,
			255, 255, 127, 0, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 15, 0, 0,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 0, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 7,
			235, 3, 0, 0, 252, 255, 255, 255, 255, 255,
			255, 31, 255, 3, 255, 255, 255, 255, 255, 255,
			255, 0, 255, 255, 255, 255, 255, 255, 255, 255,
			63, 192, 255, 3, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 15, 128,
			255, 255, 255, 31, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 191, 255, 195, 255, 255, 255, 127,
			255, 255, 255, 255, 255, 255, 127, 0, 255, 63,
			255, 243, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 7, 0, 0, 248, 255, 255,
			127, 0, 126, 126, 126, 0, 127, 127, 255, 255,
			255, 255, 255, 255, 255, 15, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 63, 255, 3, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			15, 0, 255, 255, 127, 248, 255, 255, 255, 255,
			255, 15, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 63, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 3, 0, 0,
			0, 0, 127, 0, 248, 224, 255, 255, 127, 95,
			219, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 7, 0, 248, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 252, 255, 255, 255, 255, 255,
			255, 128, 0, 0, 0, 0, 255, 255, 255, 255,
			255, 3, 255, 255, 255, 255, 255, 255, 247, 255,
			127, 15, 223, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 31,
			254, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 127, 252, 252, 252, 28, 127, 127,
			0, 62
		};

		internal static ReadOnlySpan<byte> GetDefinedBmpCodePointsBitmapLittleEndian()
		{
			return DefinedCharsBitmapSpan;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static void GetUtf16SurrogatePairFromAstralScalarValue(uint scalar, out char highSurrogate, out char lowSurrogate)
		{
			highSurrogate = (char)(scalar + 56557568 >> 10);
			lowSurrogate = (char)((scalar & 0x3FF) + 56320);
		}

		internal static int GetUtf8RepresentationForScalarValue(uint scalar)
		{
			if (scalar <= 127)
			{
				return (byte)scalar;
			}
			if (scalar <= 2047)
			{
				byte b = (byte)(0xC0u | (scalar >> 6));
				byte b2 = (byte)(0x80u | (scalar & 0x3Fu));
				return (b2 << 8) | b;
			}
			if (scalar <= 65535)
			{
				byte b3 = (byte)(0xE0u | (scalar >> 12));
				byte b4 = (byte)(0x80u | ((scalar >> 6) & 0x3Fu));
				byte b5 = (byte)(0x80u | (scalar & 0x3Fu));
				return (((b5 << 8) | b4) << 8) | b3;
			}
			byte b6 = (byte)(0xF0u | (scalar >> 18));
			byte b7 = (byte)(0x80u | ((scalar >> 12) & 0x3Fu));
			byte b8 = (byte)(0x80u | ((scalar >> 6) & 0x3Fu));
			byte b9 = (byte)(0x80u | (scalar & 0x3Fu));
			return (((((b9 << 8) | b8) << 8) | b7) << 8) | b6;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static bool IsSupplementaryCodePoint(int scalar)
		{
			return (scalar & -65536) != 0;
		}
	}
	public sealed class UnicodeRange
	{
		public int FirstCodePoint { get; private set; }

		public int Length { get; private set; }

		public UnicodeRange(int firstCodePoint, int length)
		{
			if (firstCodePoint < 0 || firstCodePoint > 65535)
			{
				throw new ArgumentOutOfRangeException("firstCodePoint");
			}
			if (length < 0 || (long)firstCodePoint + (long)length > 65536)
			{
				throw new ArgumentOutOfRangeException("length");
			}
			FirstCodePoint = firstCodePoint;
			Length = length;
		}

		public static UnicodeRange Create(char firstCharacter, char lastCharacter)
		{
			if (lastCharacter < firstCharacter)
			{
				throw new ArgumentOutOfRangeException("lastCharacter");
			}
			return new UnicodeRange(firstCharacter, 1 + (lastCharacter - firstCharacter));
		}
	}
	public static class UnicodeRanges
	{
		private static UnicodeRange _none;

		private static UnicodeRange _all;

		private static UnicodeRange _u0000;

		private static UnicodeRange _u0080;

		private static UnicodeRange _u0100;

		private static UnicodeRange _u0180;

		private static UnicodeRange _u0250;

		private static UnicodeRange _u02B0;

		private static UnicodeRange _u0300;

		private static UnicodeRange _u0370;

		private static UnicodeRange _u0400;

		private static UnicodeRange _u0500;

		private static UnicodeRange _u0530;

		private static UnicodeRange _u0590;

		private static UnicodeRange _u0600;

		private static UnicodeRange _u0700;

		private static UnicodeRange _u0750;

		private static UnicodeRange _u0780;

		private static UnicodeRange _u07C0;

		private static UnicodeRange _u0800;

		private static UnicodeRange _u0840;

		private static UnicodeRange _u0860;

		private static UnicodeRange _u0870;

		private static UnicodeRange _u08A0;

		private static UnicodeRange _u0900;

		private static UnicodeRange _u0980;

		private static UnicodeRange _u0A00;

		private static UnicodeRange _u0A80;

		private static UnicodeRange _u0B00;

		private static UnicodeRange _u0B80;

		private static UnicodeRange _u0C00;

		private static UnicodeRange _u0C80;

		private static UnicodeRange _u0D00;

		private static UnicodeRange _u0D80;

		private static UnicodeRange _u0E00;

		private static UnicodeRange _u0E80;

		private static UnicodeRange _u0F00;

		private static UnicodeRange _u1000;

		private static UnicodeRange _u10A0;

		private static UnicodeRange _u1100;

		private static UnicodeRange _u1200;

		private static UnicodeRange _u1380;

		private static UnicodeRange _u13A0;

		private static UnicodeRange _u1400;

		private static UnicodeRange _u1680;

		private static UnicodeRange _u16A0;

		private static UnicodeRange _u1700;

		private static UnicodeRange _u1720;

		private static UnicodeRange _u1740;

		private static UnicodeRange _u1760;

		private static UnicodeRange _u1780;

		private static UnicodeRange _u1800;

		private static UnicodeRange _u18B0;

		private static UnicodeRange _u1900;

		private static UnicodeRange _u1950;

		private static UnicodeRange _u1980;

		private static UnicodeRange _u19E0;

		private static UnicodeRange _u1A00;

		private static UnicodeRange _u1A20;

		private static UnicodeRange _u1AB0;

		private static UnicodeRange _u1B00;

		private static UnicodeRange _u1B80;

		private static UnicodeRange _u1BC0;

		private static UnicodeRange _u1C00;

		private static UnicodeRange _u1C50;

		private static UnicodeRange _u1C80;

		private static UnicodeRange _u1C90;

		private static UnicodeRange _u1CC0;

		private static UnicodeRange _u1CD0;

		private static UnicodeRange _u1D00;

		private static UnicodeRange _u1D80;

		private static UnicodeRange _u1DC0;

		private static UnicodeRange _u1E00;

		private static UnicodeRange _u1F00;

		private static UnicodeRange _u2000;

		private static UnicodeRange _u2070;

		private static UnicodeRange _u20A0;

		private static UnicodeRange _u20D0;

		private static UnicodeRange _u2100;

		private static UnicodeRange _u2150;

		private static UnicodeRange _u2190;

		private static UnicodeRange _u2200;

		private static UnicodeRange _u2300;

		private static UnicodeRange _u2400;

		private static UnicodeRange _u2440;

		private static UnicodeRange _u2460;

		private static UnicodeRange _u2500;

		private static UnicodeRange _u2580;

		private static UnicodeRange _u25A0;

		private static UnicodeRange _u2600;

		private static UnicodeRange _u2700;

		private static UnicodeRange _u27C0;

		private static UnicodeRange _u27F0;

		private static UnicodeRange _u2800;

		private static UnicodeRange _u2900;

		private static UnicodeRange _u2980;

		private static UnicodeRange _u2A00;

		private static UnicodeRange _u2B00;

		private static UnicodeRange _u2C00;

		private static UnicodeRange _u2C60;

		private static UnicodeRange _u2C80;

		private static UnicodeRange _u2D00;

		private static UnicodeRange _u2D30;

		private static UnicodeRange _u2D80;

		private static UnicodeRange _u2DE0;

		private static UnicodeRange _u2E00;

		private static UnicodeRange _u2E80;

		private static UnicodeRange _u2F00;

		private static UnicodeRange _u2FF0;

		private static UnicodeRange _u3000;

		private static UnicodeRange _u3040;

		private static UnicodeRange _u30A0;

		private static UnicodeRange _u3100;

		private static UnicodeRange _u3130;

		private static UnicodeRange _u3190;

		private static UnicodeRange _u31A0;

		private static UnicodeRange _u31C0;

		private static UnicodeRange _u31F0;

		private static UnicodeRange _u3200;

		private static UnicodeRange _u3300;

		private static UnicodeRange _u3400;

		private static UnicodeRange _u4DC0;

		private static UnicodeRange _u4E00;

		private static UnicodeRange _uA000;

		private static UnicodeRange _uA490;

		private static UnicodeRange _uA4D0;

		private static UnicodeRange _uA500;

		private static UnicodeRange _uA640;

		private static UnicodeRange _uA6A0;

		private static UnicodeRange _uA700;

		private static UnicodeRange _uA720;

		private static UnicodeRange _uA800;

		private static UnicodeRange _uA830;

		private static UnicodeRange _uA840;

		private static UnicodeRange _uA880;

		private static UnicodeRange _uA8E0;

		private static UnicodeRange _uA900;

		private static UnicodeRange _uA930;

		private static UnicodeRange _uA960;

		private static UnicodeRange _uA980;

		private static UnicodeRange _uA9E0;

		private static UnicodeRange _uAA00;

		private static UnicodeRange _uAA60;

		private static UnicodeRange _uAA80;

		private static UnicodeRange _uAAE0;

		private static UnicodeRange _uAB00;

		private static UnicodeRange _uAB30;

		private static UnicodeRange _uAB70;

		private static UnicodeRange _uABC0;

		private static UnicodeRange _uAC00;

		private static UnicodeRange _uD7B0;

		private static UnicodeRange _uF900;

		private static UnicodeRange _uFB00;

		private static UnicodeRange _uFB50;

		private static UnicodeRange _uFE00;

		private static UnicodeRange _uFE10;

		private static UnicodeRange _uFE20;

		private static UnicodeRange _uFE30;

		private static UnicodeRange _uFE50;

		private static UnicodeRange _uFE70;

		private static UnicodeRange _uFF00;

		private static UnicodeRange _uFFF0;

		public static UnicodeRange None => _none ?? CreateEmptyRange(ref _none);

		public static UnicodeRange All => _all ?? CreateRange(ref _all, '\0', '\uffff');

		public static UnicodeRange BasicLatin => _u0000 ?? CreateRange(ref _u0000, '\0', '\u007f');

		public static UnicodeRange Latin1Supplement => _u0080 ?? CreateRange(ref _u0080, '\u0080', 'ÿ');

		public static UnicodeRange LatinExtendedA => _u0100 ?? CreateRange(ref _u0100, 'Ā', 'ſ');

		public static UnicodeRange LatinExtendedB => _u0180 ?? CreateRange(ref _u0180, 'ƀ', 'ɏ');

		public static UnicodeRange IpaExtensions => _u0250 ?? CreateRange(ref _u0250, 'ɐ', 'ʯ');

		public static UnicodeRange SpacingModifierLetters => _u02B0 ?? CreateRange(ref _u02B0, 'ʰ', '\u02ff');

		public static UnicodeRange CombiningDiacriticalMarks => _u0300 ?? CreateRange(ref _u0300, '\u0300', '\u036f');

		public static UnicodeRange GreekandCoptic => _u0370 ?? CreateRange(ref _u0370, 'Ͱ', 'Ͽ');

		public static UnicodeRange Cyrillic => _u0400 ?? CreateRange(ref _u0400, 'Ѐ', 'ӿ');

		public static UnicodeRange CyrillicSupplement => _u0500 ?? CreateRange(ref _u0500, 'Ԁ', 'ԯ');

		public static UnicodeRange Armenian => _u0530 ?? CreateRange(ref _u0530, '\u0530', '֏');

		public static UnicodeRange Hebrew => _u0590 ?? CreateRange(ref _u0590, '\u0590', '\u05ff');

		public static UnicodeRange Arabic => _u0600 ?? CreateRange(ref _u0600, '\u0600', 'ۿ');

		public static UnicodeRange Syriac => _u0700 ?? CreateRange(ref _u0700, '܀', 'ݏ');

		public static UnicodeRange ArabicSupplement => _u0750 ?? CreateRange(ref _u0750, 'ݐ', 'ݿ');

		public static UnicodeRange Thaana => _u0780 ?? CreateRange(ref _u0780, 'ހ', '\u07bf');

		public static UnicodeRange NKo => _u07C0 ?? CreateRange(ref _u07C0, '߀', '߿');

		public static UnicodeRange Samaritan => _u0800 ?? CreateRange(ref _u0800, 'ࠀ', '\u083f');

		public static UnicodeRange Mandaic => _u0840 ?? CreateRange(ref _u0840, 'ࡀ', '\u085f');

		public static UnicodeRange SyriacSupplement => _u0860 ?? CreateRange(ref _u0860, 'ࡠ', '\u086f');

		public static UnicodeRange ArabicExtendedB => _u0870 ?? CreateRange(ref _u0870, '\u0870', '\u089f');

		public static UnicodeRange ArabicExtendedA => _u08A0 ?? CreateRange(ref _u08A0, 'ࢠ', '\u08ff');

		public static UnicodeRange Devanagari => _u0900 ?? CreateRange(ref _u0900, '\u0900', 'ॿ');

		public static UnicodeRange Bengali => _u0980 ?? CreateRange(ref _u0980, 'ঀ', '\u09ff');

		public static UnicodeRange Gurmukhi => _u0A00 ?? CreateRange(ref _u0A00, '\u0a00', '\u0a7f');

		public static UnicodeRange Gujarati => _u0A80 ?? CreateRange(ref _u0A80, '\u0a80', '\u0aff');

		public static UnicodeRange Oriya => _u0B00 ?? CreateRange(ref _u0B00, '\u0b00', '\u0b7f');

		public static UnicodeRange Tamil => _u0B80 ?? CreateRange(ref _u0B80, '\u0b80', '\u0bff');

		public static UnicodeRange Telugu => _u0C00 ?? CreateRange(ref _u0C00, '\u0c00', '౿');

		public static UnicodeRange Kannada => _u0C80 ?? CreateRange(ref _u0C80, 'ಀ', '\u0cff');

		public static UnicodeRange Malayalam => _u0D00 ?? CreateRange(ref _u0D00, '\u0d00', 'ൿ');

		public static UnicodeRange Sinhala => _u0D80 ?? CreateRange(ref _u0D80, '\u0d80', '\u0dff');

		public static UnicodeRange Thai => _u0E00 ?? CreateRange(ref _u0E00, '\u0e00', '\u0e7f');

		public static UnicodeRange Lao => _u0E80 ?? CreateRange(ref _u0E80, '\u0e80', '\u0eff');

		public static UnicodeRange Tibetan => _u0F00 ?? CreateRange(ref _u0F00, 'ༀ', '\u0fff');

		public static UnicodeRange Myanmar => _u1000 ?? CreateRange(ref _u1000, 'က', '႟');

		public static UnicodeRange Georgian => _u10A0 ?? CreateRange(ref _u10A0, 'Ⴀ', 'ჿ');

		public static UnicodeRange HangulJamo => _u1100 ?? CreateRange(ref _u1100, 'ᄀ', 'ᇿ');

		public static UnicodeRange Ethiopic => _u1200 ?? CreateRange(ref _u1200, 'ሀ', '\u137f');

		public static UnicodeRange EthiopicSupplement => _u1380 ?? CreateRange(ref _u1380, 'ᎀ', '\u139f');

		public static UnicodeRange Cherokee => _u13A0 ?? CreateRange(ref _u13A0, 'Ꭰ', '\u13ff');

		public static UnicodeRange UnifiedCanadianAboriginalSyllabics => _u1400 ?? CreateRange(ref _u1400, '᐀', 'ᙿ');

		public static UnicodeRange Ogham => _u1680 ?? CreateRange(ref _u1680, '\u1680', '\u169f');

		public static UnicodeRange Runic => _u16A0 ?? CreateRange(ref _u16A0, 'ᚠ', '\u16ff');

		public static UnicodeRange Tagalog => _u1700 ?? CreateRange(ref _u1700, 'ᜀ', '\u171f');

		public static UnicodeRange Hanunoo => _u1720 ?? CreateRange(ref _u1720, 'ᜠ', '\u173f');

		public static UnicodeRange Buhid => _u1740 ?? CreateRange(ref _u1740, 'ᝀ', '\u175f');

		public static UnicodeRange Tagbanwa => _u1760 ?? CreateRange(ref _u1760, 'ᝠ', '\u177f');

		public static UnicodeRange Khmer => _u1780 ?? CreateRange(ref _u1780, 'ក', '\u17ff');

		public static UnicodeRange Mongolian => _u1800 ?? CreateRange(ref _u1800, '᠀', '\u18af');

		public static UnicodeRange UnifiedCanadianAboriginalSyllabicsExtended => _u18B0 ?? CreateRange(ref _u18B0, 'ᢰ', '\u18ff');

		public static UnicodeRange Limbu => _u1900 ?? CreateRange(ref _u1900, 'ᤀ', '᥏');

		public static UnicodeRange TaiLe => _u1950 ?? CreateRange(ref _u1950, 'ᥐ', '\u197f');

		public static UnicodeRange NewTaiLue => _u1980 ?? CreateRange(ref _u1980, 'ᦀ', '᧟');

		public static UnicodeRange KhmerSymbols => _u19E0 ?? CreateRange(ref _u19E0, '᧠', '᧿');

		public static UnicodeRange Buginese => _u1A00 ?? CreateRange(ref _u1A00, 'ᨀ', '᨟');

		public static UnicodeRange TaiTham => _u1A20 ?? CreateRange(ref _u1A20, 'ᨠ', '\u1aaf');

		public static UnicodeRange CombiningDiacriticalMarksExtended => _u1AB0 ?? CreateRange(ref _u1AB0, '\u1ab0', '\u1aff');

		public static UnicodeRange Balinese => _u1B00 ?? CreateRange(ref _u1B00, '\u1b00', '\u1b7f');

		public static UnicodeRange Sundanese => _u1B80 ?? CreateRange(ref _u1B80, '\u1b80', 'ᮿ');

		public static UnicodeRange Batak => _u1BC0 ?? CreateRange(ref _u1BC0, 'ᯀ', '᯿');

		public static UnicodeRange Lepcha => _u1C00 ?? CreateRange(ref _u1C00, 'ᰀ', 'ᱏ');

		public static UnicodeRange OlChiki => _u1C50 ?? CreateRange(ref _u1C50, '᱐', '᱿');

		public static UnicodeRange CyrillicExtendedC => _u1C80 ?? CreateRange(ref _u1C80, 'ᲀ', '\u1c8f');

		public static UnicodeRange GeorgianExtended => _u1C90 ?? CreateRange(ref _u1C90, 'Ა', 'Ჿ');

		public static UnicodeRange SundaneseSupplement => _u1CC0 ?? CreateRange(ref _u1CC0, '᳀', '\u1ccf');

		public static UnicodeRange VedicExtensions => _u1CD0 ?? CreateRange(ref _u1CD0, '\u1cd0', '\u1cff');

		public static UnicodeRange PhoneticExtensions => _u1D00 ?? CreateRange(ref _u1D00, 'ᴀ', 'ᵿ');

		public static UnicodeRange PhoneticExtensionsSupplement => _u1D80 ?? CreateRange(ref _u1D80, 'ᶀ', 'ᶿ');

		public static UnicodeRange CombiningDiacriticalMarksSupplement => _u1DC0 ?? CreateRange(ref _u1DC0, '\u1dc0', '\u1dff');

		public static UnicodeRange LatinExtendedAdditional => _u1E00 ?? CreateRange(ref _u1E00, 'Ḁ', 'ỿ');

		public static UnicodeRange GreekExtended => _u1F00 ?? CreateRange(ref _u1F00, 'ἀ', '\u1fff');

		public static UnicodeRange GeneralPunctuation => _u2000 ?? CreateRange(ref _u2000, '\u2000', '\u206f');

		public static UnicodeRange SuperscriptsandSubscripts => _u2070 ?? CreateRange(ref _u2070, '⁰', '\u209f');

		public static UnicodeRange CurrencySymbols => _u20A0 ?? CreateRange(ref _u20A0, '₠', '\u20cf');

		public static UnicodeRange CombiningDiacriticalMarksforSymbols => _u20D0 ?? CreateRange(ref _u20D0, '\u20d0', '\u20ff');

		public static UnicodeRange LetterlikeSymbols => _u2100 ?? CreateRange(ref _u2100, '℀', '⅏');

		public static UnicodeRange NumberForms => _u2150 ?? CreateRange(ref _u2150, '⅐', '\u218f');

		public static UnicodeRange Arrows => _u2190 ?? CreateRange(ref _u2190, '←', '⇿');

		public static UnicodeRange MathematicalOperators => _u2200 ?? CreateRange(ref _u2200, '∀', '⋿');

		public static UnicodeRange MiscellaneousTechnical => _u2300 ?? CreateRange(ref _u2300, '⌀', '⏿');

		public static UnicodeRange ControlPictures => _u2400 ?? CreateRange(ref _u2400, '␀', '\u243f');

		public static UnicodeRange OpticalCharacterRecognition => _u2440 ?? CreateRange(ref _u2440, '⑀', '\u245f');

		public static UnicodeRange EnclosedAlphanumerics => _u2460 ?? CreateRange(ref _u2460, '①', '⓿');

		public static UnicodeRange BoxDrawing => _u2500 ?? CreateRange(ref _u2500, '─', '╿');

		public static UnicodeRange BlockElements => _u2580 ?? CreateRange(ref _u2580, '▀', '▟');

		public static UnicodeRange GeometricShapes => _u25A0 ?? CreateRange(ref _u25A0, '■', '◿');

		public static UnicodeRange MiscellaneousSymbols => _u2600 ?? CreateRange(ref _u2600, '☀', '⛿');

		public static UnicodeRange Dingbats => _u2700 ?? CreateRange(ref _u2700, '✀', '➿');

		public static UnicodeRange MiscellaneousMathematicalSymbolsA => _u27C0 ?? CreateRange(ref _u27C0, '⟀', '⟯');

		public static UnicodeRange SupplementalArrowsA => _u27F0 ?? CreateRange(ref _u27F0, '⟰', '⟿');

		public static UnicodeRange BraillePatterns => _u2800 ?? CreateRange(ref _u2800, '⠀', '⣿');

		public static UnicodeRange SupplementalArrowsB => _u2900 ?? CreateRange(ref _u2900, '⤀', '⥿');

		public static UnicodeRange MiscellaneousMathematicalSymbolsB => _u2980 ?? CreateRange(ref _u2980, '⦀', '⧿');

		public static UnicodeRange SupplementalMathematicalOperators => _u2A00 ?? CreateRange(ref _u2A00, '⨀', '⫿');

		public static UnicodeRange MiscellaneousSymbolsandArrows => _u2B00 ?? CreateRange(ref _u2B00, '⬀', '⯿');

		public static UnicodeRange Glagolitic => _u2C00 ?? CreateRange(ref _u2C00, 'Ⰰ', '\u2c5f');

		public static UnicodeRange LatinExtendedC => _u2C60 ?? CreateRange(ref _u2C60, 'Ⱡ', 'Ɀ');

		public static UnicodeRange Coptic => _u2C80 ?? CreateRange(ref _u2C80, 'Ⲁ', '⳿');

		public static UnicodeRange GeorgianSupplement => _u2D00 ?? CreateRange(ref _u2D00, 'ⴀ', '\u2d2f');

		public static UnicodeRange Tifinagh => _u2D30 ?? CreateRange(ref _u2D30, 'ⴰ', '\u2d7f');

		public static UnicodeRange EthiopicExtended => _u2D80 ?? CreateRange(ref _u2D80, 'ⶀ', '\u2ddf');

		public static UnicodeRange CyrillicExtendedA => _u2DE0 ?? CreateRange(ref _u2DE0, '\u2de0', '\u2dff');

		public static UnicodeRange SupplementalPunctuation => _u2E00 ?? CreateRange(ref _u2E00, '⸀', '\u2e7f');

		public static UnicodeRange CjkRadicalsSupplement => _u2E80 ?? CreateRange(ref _u2E80, '⺀', '\u2eff');

		public static UnicodeRange KangxiRadicals => _u2F00 ?? CreateRange(ref _u2F00, '⼀', '\u2fdf');

		public static UnicodeRange IdeographicDescriptionCharacters => _u2FF0 ?? CreateRange(ref _u2FF0, '⿰', '\u2fff');

		public static UnicodeRange CjkSymbolsandPunctuation => _u3000 ?? CreateRange(ref _u3000, '\u3000', '〿');

		public static UnicodeRange Hiragana => _u3040 ?? CreateRange(ref _u3040, '\u3040', 'ゟ');

		public static UnicodeRange Katakana => _u30A0 ?? CreateRange(ref _u30A0, '゠', 'ヿ');

		public static UnicodeRange Bopomofo => _u3100 ?? CreateRange(ref _u3100, '\u3100', 'ㄯ');

		public static UnicodeRange HangulCompatibilityJamo => _u3130 ?? CreateRange(ref _u3130, '\u3130', '\u318f');

		public static UnicodeRange Kanbun => _u3190 ?? CreateRange(ref _u3190, '㆐', '㆟');

		public static UnicodeRange BopomofoExtended => _u31A0 ?? CreateRange(ref _u31A0, 'ㆠ', 'ㆿ');

		public static UnicodeRange CjkStrokes => _u31C0 ?? CreateRange(ref _u31C0, '㇀', '\u31ef');

		public static UnicodeRange KatakanaPhoneticExtensions => _u31F0 ?? CreateRange(ref _u31F0, 'ㇰ', 'ㇿ');

		public static UnicodeRange EnclosedCjkLettersandMonths => _u3200 ?? CreateRange(ref _u3200, '㈀', '㋿');

		public static UnicodeRange CjkCompatibility => _u3300 ?? CreateRange(ref _u3300, '㌀', '㏿');

		public static UnicodeRange CjkUnifiedIdeographsExtensionA => _u3400 ?? CreateRange(ref _u3400, '㐀', '䶿');

		public static UnicodeRange YijingHexagramSymbols => _u4DC0 ?? CreateRange(ref _u4DC0, '䷀', '䷿');

		public static UnicodeRange CjkUnifiedIdeographs => _u4E00 ?? CreateRange(ref _u4E00, '一', '\u9fff');

		public static UnicodeRange YiSyllables => _uA000 ?? CreateRange(ref _uA000, 'ꀀ', '\ua48f');

		public static UnicodeRange YiRadicals => _uA490 ?? CreateRange(ref _uA490, '꒐', '\ua4cf');

		public static UnicodeRange Lisu => _uA4D0 ?? CreateRange(ref _uA4D0, 'ꓐ', '꓿');

		public static UnicodeRange Vai => _uA500 ?? CreateRange(ref _uA500, 'ꔀ', '\ua63f');

		public static UnicodeRange CyrillicExtendedB => _uA640 ?? CreateRange(ref _uA640, 'Ꙁ', '\ua69f');

		public static UnicodeRange Bamum => _uA6A0 ?? CreateRange(ref _uA6A0, 'ꚠ', '\ua6ff');

		public static UnicodeRange ModifierToneLetters => _uA700 ?? CreateRange(ref _uA700, '\ua700', 'ꜟ');

		public static UnicodeRange LatinExtendedD => _uA720 ?? CreateRange(ref _uA720, '\ua720', 'ꟿ');

		public static UnicodeRange SylotiNagri => _uA800 ?? CreateRange(ref _uA800, 'ꠀ', '\ua82f');

		public static UnicodeRange CommonIndicNumberForms => _uA830 ?? CreateRange(ref _uA830, '꠰', '\ua83f');

		public static UnicodeRange Phagspa => _uA840 ?? CreateRange(ref _uA840, 'ꡀ', '\ua87f');

		public static UnicodeRange Saurashtra => _uA880 ?? CreateRange(ref _uA880, '\ua880', '\ua8df');

		public static UnicodeRange DevanagariExtended => _uA8E0 ?? CreateRange(ref _uA8E0, '\ua8e0', '\ua8ff');

		public static UnicodeRange KayahLi => _uA900 ?? CreateRange(ref _uA900, '꤀', '꤯');

		public static UnicodeRange Rejang => _uA930 ?? CreateRange(ref _uA930, 'ꤰ', '꥟');

		public static UnicodeRange HangulJamoExtendedA => _uA960 ?? CreateRange(ref _uA960, 'ꥠ', '\ua97f');

		public static UnicodeRange Javanese => _uA980 ?? CreateRange(ref _uA980, '\ua980', '꧟');

		public static UnicodeRange MyanmarExtendedB => _uA9E0 ?? CreateRange(ref _uA9E0, 'ꧠ', '\ua9ff');

		public static UnicodeRange Cham => _uAA00 ?? CreateRange(ref _uAA00, 'ꨀ', '꩟');

		public static UnicodeRange MyanmarExtendedA => _uAA60 ?? CreateRange(ref _uAA60, 'ꩠ', 'ꩿ');

		public static UnicodeRange TaiViet => _uAA80 ?? CreateRange(ref _uAA80, 'ꪀ', '꫟');

		public static UnicodeRange MeeteiMayekExtensions => _uAAE0 ?? CreateRange(ref _uAAE0, 'ꫠ', '\uaaff');

		public static UnicodeRange EthiopicExtendedA => _uAB00 ?? CreateRange(ref _uAB00, '\uab00', '\uab2f');

		public static UnicodeRange LatinExtendedE => _uAB30 ?? CreateRange(ref _uAB30, 'ꬰ', '\uab6f');

		public static UnicodeRange CherokeeSupplement => _uAB70 ?? CreateRange(ref _uAB70, 'ꭰ', 'ꮿ');

		public static UnicodeRange MeeteiMayek => _uABC0 ?? CreateRange(ref _uABC0, 'ꯀ', '\uabff');

		public static UnicodeRange HangulSyllables => _uAC00 ?? CreateRange(ref _uAC00, '가', '\ud7af');

		public static UnicodeRange HangulJamoExtendedB => _uD7B0 ?? CreateRange(ref _uD7B0, 'ힰ', '\ud7ff');

		public static UnicodeRange CjkCompatibilityIdeographs => _uF900 ?? CreateRange(ref _uF900, '豈', '\ufaff');

		public static UnicodeRange AlphabeticPresentationForms => _uFB00 ?? CreateRange(ref _uFB00, 'ff', 'ﭏ');

		public static UnicodeRange ArabicPresentationFormsA => _uFB50 ?? CreateRange(ref _uFB50, 'ﭐ', '\ufdff');

		public static UnicodeRange VariationSelectors => _uFE00 ?? CreateRange(ref _uFE00, '\ufe00', '\ufe0f');

		public static UnicodeRange VerticalForms => _uFE10 ?? CreateRange(ref _uFE10, '︐', '\ufe1f');

		public static UnicodeRange CombiningHalfMarks => _uFE20 ?? CreateRange(ref _uFE20, '\ufe20', '\ufe2f');

		public static UnicodeRange CjkCompatibilityForms => _uFE30 ?? CreateRange(ref _uFE30, '︰', '\ufe4f');

		public static UnicodeRange SmallFormVariants => _uFE50 ?? CreateRange(ref _uFE50, '﹐', '\ufe6f');

		public static UnicodeRange ArabicPresentationFormsB => _uFE70 ?? CreateRange(ref _uFE70, 'ﹰ', '\ufeff');

		public static UnicodeRange HalfwidthandFullwidthForms => _uFF00 ?? CreateRange(ref _uFF00, '\uff00', '\uffef');

		public static UnicodeRange Specials => _uFFF0 ?? CreateRange(ref _uFFF0, '\ufff0', '\uffff');

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static UnicodeRange CreateEmptyRange([NotNull] ref UnicodeRange range)
		{
			Volatile.Write(ref range, new UnicodeRange(0, 0));
			return range;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static UnicodeRange CreateRange([NotNull] ref UnicodeRange range, char first, char last)
		{
			Volatile.Write(ref range, UnicodeRange.Create(first, last));
			return range;
		}
	}
}
namespace System.Text.Encodings.Web
{
	internal struct AsciiByteMap
	{
		private const int BufferSize = 128;

		private unsafe fixed byte Buffer[128];

		internal unsafe void InsertAsciiChar(char key, byte value)
		{
			if (key < '\u0080')
			{
				Buffer[(uint)key] = value;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal unsafe readonly bool TryLookup(Rune key, out byte value)
		{
			if (key.IsAscii)
			{
				byte b = Buffer[(uint)key.Value];
				if (b != 0)
				{
					value = b;
					return true;
				}
			}
			value = 0;
			return false;
		}
	}
	internal struct AllowedBmpCodePointsBitmap
	{
		private const int BitmapLengthInDWords = 2048;

		private unsafe fixed uint Bitmap[2048];

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public unsafe void AllowChar(char value)
		{
			_GetIndexAndOffset(value, out UIntPtr index, out int offset);
			ref uint reference = ref Bitmap[(ulong)index];
			reference |= (uint)(1 << offset);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public unsafe void ForbidChar(char value)
		{
			_GetIndexAndOffset(value, out UIntPtr index, out int offset);
			ref uint reference = ref Bitmap[(ulong)index];
			reference &= (uint)(~(1 << offset));
		}

		public void ForbidHtmlCharacters()
		{
			ForbidChar('<');
			ForbidChar('>');
			ForbidChar('&');
			ForbidChar('\'');
			ForbidChar('"');
			ForbidChar('+');
		}

		public unsafe void ForbidUndefinedCharacters()
		{
			fixed (uint* pointer = Bitmap)
			{
				ReadOnlySpan<byte> definedBmpCodePointsBitmapLittleEndian = UnicodeHelpers.GetDefinedBmpCodePointsBitmapLittleEndian();
				Span<uint> span = new Span<uint>(pointer, 2048);
				for (int i = 0; i < span.Length; i++)
				{
					span[i] &= BinaryPrimitives.ReadUInt32LittleEndian(definedBmpCodePointsBitmapLittleEndian.Slice(i * 4));
				}
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public unsafe readonly bool IsCharAllowed(char value)
		{
			_GetIndexAndOffset(value, out UIntPtr index, out int offset);
			if ((Bitmap[(ulong)index] & (uint)(1 << offset)) != 0)
			{
				return true;
			}
			return false;
		}

		[MethodImpl(MethodI

BepInEx\plugins\Cyberhead\System.Text.Json.dll

Decompiled a year ago
using System;
using System.Buffers;
using System.Buffers.Text;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Numerics;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.Encodings.Web;
using System.Text.Json.Nodes;
using System.Text.Json.Reflection;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization.Converters;
using System.Text.Json.Serialization.Metadata;
using System.Threading;
using System.Threading.Tasks;
using FxResources.System.Text.Json;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyDefaultAlias("System.Text.Json")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("IsTrimmable", "True")]
[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyDescription("Provides high-performance and low-allocating types that serialize objects to JavaScript Object Notation (JSON) text and deserialize JSON text to objects, with UTF-8 support built-in. Also provides types to read and write JSON text encoded as UTF-8, and to create an in-memory document object model (DOM), that is read-only, for random access of the JSON elements within a structured view of the data.\r\n\r\nThe System.Text.Json library is built-in as part of the shared framework in .NET Runtime. The package can be installed when you need to use it in other target frameworks.")]
[assembly: AssemblyFileVersion("8.0.123.58001")]
[assembly: AssemblyInformationalVersion("8.0.1+bf5e279d9239bfef5bb1b8d6212f1b971c434606")]
[assembly: AssemblyProduct("Microsoft® .NET")]
[assembly: AssemblyTitle("System.Text.Json")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("8.0.0.1")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: System.Runtime.CompilerServices.NullablePublicOnly(false)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsUnmanagedAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsByRefLikeAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class NullablePublicOnlyAttribute : Attribute
	{
		public readonly bool IncludesInternals;

		public NullablePublicOnlyAttribute(bool P_0)
		{
			IncludesInternals = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class ScopedRefAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FxResources.System.Text.Json
{
	internal static class SR
	{
	}
}
namespace System
{
	internal static class HexConverter
	{
		public enum Casing : uint
		{
			Upper = 0u,
			Lower = 8224u
		}

		public static ReadOnlySpan<byte> CharToHexLookup => new byte[256]
		{
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 0, 1,
			2, 3, 4, 5, 6, 7, 8, 9, 255, 255,
			255, 255, 255, 255, 255, 10, 11, 12, 13, 14,
			15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 10, 11, 12,
			13, 14, 15, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
			255, 255, 255, 255, 255, 255
		};

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static void ToBytesBuffer(byte value, Span<byte> buffer, int startingIndex = 0, Casing casing = Casing.Upper)
		{
			uint num = (uint)(((value & 0xF0) << 4) + (value & 0xF) - 35209);
			uint num2 = ((((0 - num) & 0x7070) >> 4) + num + 47545) | (uint)casing;
			buffer[startingIndex + 1] = (byte)num2;
			buffer[startingIndex] = (byte)(num2 >> 8);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static void ToCharsBuffer(byte value, Span<char> buffer, int startingIndex = 0, Casing casing = Casing.Upper)
		{
			uint num = (uint)(((value & 0xF0) << 4) + (value & 0xF) - 35209);
			uint num2 = ((((0 - num) & 0x7070) >> 4) + num + 47545) | (uint)casing;
			buffer[startingIndex + 1] = (char)(num2 & 0xFFu);
			buffer[startingIndex] = (char)(num2 >> 8);
		}

		public static void EncodeToUtf16(ReadOnlySpan<byte> bytes, Span<char> chars, Casing casing = Casing.Upper)
		{
			for (int i = 0; i < bytes.Length; i++)
			{
				ToCharsBuffer(bytes[i], chars, i * 2, casing);
			}
		}

		public static string ToString(ReadOnlySpan<byte> bytes, Casing casing = Casing.Upper)
		{
			Span<char> span = ((bytes.Length <= 16) ? stackalloc char[bytes.Length * 2] : new char[bytes.Length * 2].AsSpan());
			Span<char> buffer = span;
			int num = 0;
			ReadOnlySpan<byte> readOnlySpan = bytes;
			for (int i = 0; i < readOnlySpan.Length; i++)
			{
				byte value = readOnlySpan[i];
				ToCharsBuffer(value, buffer, num, casing);
				num += 2;
			}
			return buffer.ToString();
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static char ToCharUpper(int value)
		{
			value &= 0xF;
			value += 48;
			if (value > 57)
			{
				value += 7;
			}
			return (char)value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static char ToCharLower(int value)
		{
			value &= 0xF;
			value += 48;
			if (value > 57)
			{
				value += 39;
			}
			return (char)value;
		}

		public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes)
		{
			int charsProcessed;
			return TryDecodeFromUtf16(chars, bytes, out charsProcessed);
		}

		public static bool TryDecodeFromUtf16(ReadOnlySpan<char> chars, Span<byte> bytes, out int charsProcessed)
		{
			int num = 0;
			int num2 = 0;
			int num3 = 0;
			int num4 = 0;
			while (num2 < bytes.Length)
			{
				num3 = FromChar(chars[num + 1]);
				num4 = FromChar(chars[num]);
				if ((num3 | num4) == 255)
				{
					break;
				}
				bytes[num2++] = (byte)((num4 << 4) | num3);
				num += 2;
			}
			if (num3 == 255)
			{
				num++;
			}
			charsProcessed = num;
			return (num3 | num4) != 255;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int FromChar(int c)
		{
			if (c < CharToHexLookup.Length)
			{
				return CharToHexLookup[c];
			}
			return 255;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int FromUpperChar(int c)
		{
			if (c <= 71)
			{
				return CharToHexLookup[c];
			}
			return 255;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static int FromLowerChar(int c)
		{
			switch (c)
			{
			case 48:
			case 49:
			case 50:
			case 51:
			case 52:
			case 53:
			case 54:
			case 55:
			case 56:
			case 57:
				return c - 48;
			case 97:
			case 98:
			case 99:
			case 100:
			case 101:
			case 102:
				return c - 97 + 10;
			default:
				return 255;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsHexChar(int c)
		{
			if (IntPtr.Size == 8)
			{
				ulong num = (uint)(c - 48);
				ulong num2 = (ulong)(-17875860044349952L << (int)num);
				ulong num3 = num - 64;
				return (long)(num2 & num3) < 0L;
			}
			return FromChar(c) != 255;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsHexUpperChar(int c)
		{
			if ((uint)(c - 48) > 9u)
			{
				return (uint)(c - 65) <= 5u;
			}
			return true;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public static bool IsHexLowerChar(int c)
		{
			if ((uint)(c - 48) > 9u)
			{
				return (uint)(c - 97) <= 5u;
			}
			return true;
		}
	}
	internal static class Obsoletions
	{
		internal const string SharedUrlFormat = "https://aka.ms/dotnet-warnings/{0}";

		internal const string SystemTextEncodingUTF7Message = "The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.";

		internal const string SystemTextEncodingUTF7DiagId = "SYSLIB0001";

		internal const string PrincipalPermissionAttributeMessage = "PrincipalPermissionAttribute is not honored by the runtime and must not be used.";

		internal const string PrincipalPermissionAttributeDiagId = "SYSLIB0002";

		internal const string CodeAccessSecurityMessage = "Code Access Security is not supported or honored by the runtime.";

		internal const string CodeAccessSecurityDiagId = "SYSLIB0003";

		internal const string ConstrainedExecutionRegionMessage = "The Constrained Execution Region (CER) feature is not supported.";

		internal const string ConstrainedExecutionRegionDiagId = "SYSLIB0004";

		internal const string GlobalAssemblyCacheMessage = "The Global Assembly Cache is not supported.";

		internal const string GlobalAssemblyCacheDiagId = "SYSLIB0005";

		internal const string ThreadAbortMessage = "Thread.Abort is not supported and throws PlatformNotSupportedException.";

		internal const string ThreadResetAbortMessage = "Thread.ResetAbort is not supported and throws PlatformNotSupportedException.";

		internal const string ThreadAbortDiagId = "SYSLIB0006";

		internal const string DefaultCryptoAlgorithmsMessage = "The default implementation of this cryptography algorithm is not supported.";

		internal const string DefaultCryptoAlgorithmsDiagId = "SYSLIB0007";

		internal const string CreatePdbGeneratorMessage = "The CreatePdbGenerator API is not supported and throws PlatformNotSupportedException.";

		internal const string CreatePdbGeneratorDiagId = "SYSLIB0008";

		internal const string AuthenticationManagerMessage = "The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.";

		internal const string AuthenticationManagerDiagId = "SYSLIB0009";

		internal const string RemotingApisMessage = "This Remoting API is not supported and throws PlatformNotSupportedException.";

		internal const string RemotingApisDiagId = "SYSLIB0010";

		internal const string BinaryFormatterMessage = "BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.";

		internal const string BinaryFormatterDiagId = "SYSLIB0011";

		internal const string CodeBaseMessage = "Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead.";

		internal const string CodeBaseDiagId = "SYSLIB0012";

		internal const string EscapeUriStringMessage = "Uri.EscapeUriString can corrupt the Uri string in some cases. Consider using Uri.EscapeDataString for query string components instead.";

		internal const string EscapeUriStringDiagId = "SYSLIB0013";

		internal const string WebRequestMessage = "WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.";

		internal const string WebRequestDiagId = "SYSLIB0014";

		internal const string DisablePrivateReflectionAttributeMessage = "DisablePrivateReflectionAttribute has no effect in .NET 6.0+.";

		internal const string DisablePrivateReflectionAttributeDiagId = "SYSLIB0015";

		internal const string GetContextInfoMessage = "Use the Graphics.GetContextInfo overloads that accept arguments for better performance and fewer allocations.";

		internal const string GetContextInfoDiagId = "SYSLIB0016";

		internal const string StrongNameKeyPairMessage = "Strong name signing is not supported and throws PlatformNotSupportedException.";

		internal const string StrongNameKeyPairDiagId = "SYSLIB0017";

		internal const string ReflectionOnlyLoadingMessage = "ReflectionOnly loading is not supported and throws PlatformNotSupportedException.";

		internal const string ReflectionOnlyLoadingDiagId = "SYSLIB0018";

		internal const string RuntimeEnvironmentMessage = "RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.";

		internal const string RuntimeEnvironmentDiagId = "SYSLIB0019";

		internal const string JsonSerializerOptionsIgnoreNullValuesMessage = "JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.";

		internal const string JsonSerializerOptionsIgnoreNullValuesDiagId = "SYSLIB0020";

		internal const string DerivedCryptographicTypesMessage = "Derived cryptographic types are obsolete. Use the Create method on the base type instead.";

		internal const string DerivedCryptographicTypesDiagId = "SYSLIB0021";

		internal const string RijndaelMessage = "The Rijndael and RijndaelManaged types are obsolete. Use Aes instead.";

		internal const string RijndaelDiagId = "SYSLIB0022";

		internal const string RNGCryptoServiceProviderMessage = "RNGCryptoServiceProvider is obsolete. To generate a random number, use one of the RandomNumberGenerator static methods instead.";

		internal const string RNGCryptoServiceProviderDiagId = "SYSLIB0023";

		internal const string AppDomainCreateUnloadMessage = "Creating and unloading AppDomains is not supported and throws an exception.";

		internal const string AppDomainCreateUnloadDiagId = "SYSLIB0024";

		internal const string SuppressIldasmAttributeMessage = "SuppressIldasmAttribute has no effect in .NET 6.0+.";

		internal const string SuppressIldasmAttributeDiagId = "SYSLIB0025";

		internal const string X509CertificateImmutableMessage = "X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.";

		internal const string X509CertificateImmutableDiagId = "SYSLIB0026";

		internal const string PublicKeyPropertyMessage = "PublicKey.Key is obsolete. Use the appropriate method to get the public key, such as GetRSAPublicKey.";

		internal const string PublicKeyPropertyDiagId = "SYSLIB0027";

		internal const string X509CertificatePrivateKeyMessage = "X509Certificate2.PrivateKey is obsolete. Use the appropriate method to get the private key, such as GetRSAPrivateKey, or use the CopyWithPrivateKey method to create a new instance with a private key.";

		internal const string X509CertificatePrivateKeyDiagId = "SYSLIB0028";

		internal const string ProduceLegacyHmacValuesMessage = "ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported.";

		internal const string ProduceLegacyHmacValuesDiagId = "SYSLIB0029";

		internal const string UseManagedSha1Message = "HMACSHA1 always uses the algorithm implementation provided by the platform. Use a constructor without the useManagedSha1 parameter.";

		internal const string UseManagedSha1DiagId = "SYSLIB0030";

		internal const string CryptoConfigEncodeOIDMessage = "EncodeOID is obsolete. Use the ASN.1 functionality provided in System.Formats.Asn1.";

		internal const string CryptoConfigEncodeOIDDiagId = "SYSLIB0031";

		internal const string CorruptedStateRecoveryMessage = "Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored.";

		internal const string CorruptedStateRecoveryDiagId = "SYSLIB0032";

		internal const string Rfc2898CryptDeriveKeyMessage = "Rfc2898DeriveBytes.CryptDeriveKey is obsolete and is not supported. Use PasswordDeriveBytes.CryptDeriveKey instead.";

		internal const string Rfc2898CryptDeriveKeyDiagId = "SYSLIB0033";

		internal const string CmsSignerCspParamsCtorMessage = "CmsSigner(CspParameters) is obsolete and is not supported. Use an alternative constructor instead.";

		internal const string CmsSignerCspParamsCtorDiagId = "SYSLIB0034";

		internal const string SignerInfoCounterSigMessage = "ComputeCounterSignature without specifying a CmsSigner is obsolete and is not supported. Use the overload that accepts a CmsSigner.";

		internal const string SignerInfoCounterSigDiagId = "SYSLIB0035";

		internal const string RegexCompileToAssemblyMessage = "Regex.CompileToAssembly is obsolete and not supported. Use the GeneratedRegexAttribute with the regular expression source generator instead.";

		internal const string RegexCompileToAssemblyDiagId = "SYSLIB0036";

		internal const string AssemblyNameMembersMessage = "AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.";

		internal const string AssemblyNameMembersDiagId = "SYSLIB0037";

		internal const string SystemDataSerializationFormatBinaryMessage = "SerializationFormat.Binary is obsolete and should not be used. See https://aka.ms/serializationformat-binary-obsolete for more information.";

		internal const string SystemDataSerializationFormatBinaryDiagId = "SYSLIB0038";

		internal const string TlsVersion10and11Message = "TLS versions 1.0 and 1.1 have known vulnerabilities and are not recommended. Use a newer TLS version instead, or use SslProtocols.None to defer to OS defaults.";

		internal const string TlsVersion10and11DiagId = "SYSLIB0039";

		internal const string EncryptionPolicyMessage = "EncryptionPolicy.NoEncryption and AllowEncryption significantly reduce security and should not be used in production code.";

		internal const string EncryptionPolicyDiagId = "SYSLIB0040";

		internal const string Rfc2898OutdatedCtorMessage = "The default hash algorithm and iteration counts in Rfc2898DeriveBytes constructors are outdated and insecure. Use a constructor that accepts the hash algorithm and the number of iterations.";

		internal const string Rfc2898OutdatedCtorDiagId = "SYSLIB0041";

		internal const string EccXmlExportImportMessage = "ToXmlString and FromXmlString have no implementation for ECC types, and are obsolete. Use a standard import and export format such as ExportSubjectPublicKeyInfo or ImportSubjectPublicKeyInfo for public keys and ExportPkcs8PrivateKey or ImportPkcs8PrivateKey for private keys.";

		internal const string EccXmlExportImportDiagId = "SYSLIB0042";

		internal const string EcDhPublicKeyBlobMessage = "ECDiffieHellmanPublicKey.ToByteArray() and the associated constructor do not have a consistent and interoperable implementation on all platforms. Use ECDiffieHellmanPublicKey.ExportSubjectPublicKeyInfo() instead.";

		internal const string EcDhPublicKeyBlobDiagId = "SYSLIB0043";

		internal const string AssemblyNameCodeBaseMessage = "AssemblyName.CodeBase and AssemblyName.EscapedCodeBase are obsolete. Using them for loading an assembly is not supported.";

		internal const string AssemblyNameCodeBaseDiagId = "SYSLIB0044";

		internal const string CryptoStringFactoryMessage = "Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.";

		internal const string CryptoStringFactoryDiagId = "SYSLIB0045";

		internal const string ControlledExecutionRunMessage = "ControlledExecution.Run method may corrupt the process and should not be used in production code.";

		internal const string ControlledExecutionRunDiagId = "SYSLIB0046";

		internal const string XmlSecureResolverMessage = "XmlSecureResolver is obsolete. Use XmlResolver.ThrowingResolver instead when attempting to forbid XML external entity resolution.";

		internal const string XmlSecureResolverDiagId = "SYSLIB0047";

		internal const string RsaEncryptDecryptValueMessage = "RSA.EncryptValue and DecryptValue are not supported and throw NotSupportedException. Use RSA.Encrypt and RSA.Decrypt instead.";

		internal const string RsaEncryptDecryptDiagId = "SYSLIB0048";

		internal const string JsonSerializerOptionsAddContextMessage = "JsonSerializerOptions.AddContext is obsolete. To register a JsonSerializerContext, use either the TypeInfoResolver or TypeInfoResolverChain properties.";

		internal const string JsonSerializerOptionsAddContextDiagId = "SYSLIB0049";

		internal const string LegacyFormatterMessage = "Formatter-based serialization is obsolete and should not be used.";

		internal const string LegacyFormatterDiagId = "SYSLIB0050";

		internal const string LegacyFormatterImplMessage = "This API supports obsolete formatter-based serialization. It should not be called or extended by application code.";

		internal const string LegacyFormatterImplDiagId = "SYSLIB0051";

		internal const string RegexExtensibilityImplMessage = "This API supports obsolete mechanisms for Regex extensibility. It is not supported.";

		internal const string RegexExtensibilityDiagId = "SYSLIB0052";

		internal const string AesGcmTagConstructorMessage = "AesGcm should indicate the required tag size for encryption and decryption. Use a constructor that accepts the tag size.";

		internal const string AesGcmTagConstructorDiagId = "SYSLIB0053";
	}
	internal static class SR
	{
		private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled;

		private static ResourceManager s_resourceManager;

		internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR)));

		internal static string ArrayDepthTooLarge => GetResourceString("ArrayDepthTooLarge");

		internal static string CallFlushToAvoidDataLoss => GetResourceString("CallFlushToAvoidDataLoss");

		internal static string CannotReadIncompleteUTF16 => GetResourceString("CannotReadIncompleteUTF16");

		internal static string CannotReadInvalidUTF16 => GetResourceString("CannotReadInvalidUTF16");

		internal static string CannotStartObjectArrayAfterPrimitiveOrClose => GetResourceString("CannotStartObjectArrayAfterPrimitiveOrClose");

		internal static string CannotStartObjectArrayWithoutProperty => GetResourceString("CannotStartObjectArrayWithoutProperty");

		internal static string CannotTranscodeInvalidUtf8 => GetResourceString("CannotTranscodeInvalidUtf8");

		internal static string CannotDecodeInvalidBase64 => GetResourceString("CannotDecodeInvalidBase64");

		internal static string CannotTranscodeInvalidUtf16 => GetResourceString("CannotTranscodeInvalidUtf16");

		internal static string CannotEncodeInvalidUTF16 => GetResourceString("CannotEncodeInvalidUTF16");

		internal static string CannotEncodeInvalidUTF8 => GetResourceString("CannotEncodeInvalidUTF8");

		internal static string CannotWritePropertyWithinArray => GetResourceString("CannotWritePropertyWithinArray");

		internal static string CannotWritePropertyAfterProperty => GetResourceString("CannotWritePropertyAfterProperty");

		internal static string CannotWriteValueAfterPrimitiveOrClose => GetResourceString("CannotWriteValueAfterPrimitiveOrClose");

		internal static string CannotWriteValueWithinObject => GetResourceString("CannotWriteValueWithinObject");

		internal static string DepthTooLarge => GetResourceString("DepthTooLarge");

		internal static string DestinationTooShort => GetResourceString("DestinationTooShort");

		internal static string EmptyJsonIsInvalid => GetResourceString("EmptyJsonIsInvalid");

		internal static string EndOfCommentNotFound => GetResourceString("EndOfCommentNotFound");

		internal static string EndOfStringNotFound => GetResourceString("EndOfStringNotFound");

		internal static string ExpectedEndAfterSingleJson => GetResourceString("ExpectedEndAfterSingleJson");

		internal static string ExpectedEndOfDigitNotFound => GetResourceString("ExpectedEndOfDigitNotFound");

		internal static string ExpectedFalse => GetResourceString("ExpectedFalse");

		internal static string ExpectedJsonTokens => GetResourceString("ExpectedJsonTokens");

		internal static string ExpectedOneCompleteToken => GetResourceString("ExpectedOneCompleteToken");

		internal static string ExpectedNextDigitEValueNotFound => GetResourceString("ExpectedNextDigitEValueNotFound");

		internal static string ExpectedNull => GetResourceString("ExpectedNull");

		internal static string ExpectedSeparatorAfterPropertyNameNotFound => GetResourceString("ExpectedSeparatorAfterPropertyNameNotFound");

		internal static string ExpectedStartOfPropertyNotFound => GetResourceString("ExpectedStartOfPropertyNotFound");

		internal static string ExpectedStartOfPropertyOrValueNotFound => GetResourceString("ExpectedStartOfPropertyOrValueNotFound");

		internal static string ExpectedStartOfValueNotFound => GetResourceString("ExpectedStartOfValueNotFound");

		internal static string ExpectedTrue => GetResourceString("ExpectedTrue");

		internal static string ExpectedValueAfterPropertyNameNotFound => GetResourceString("ExpectedValueAfterPropertyNameNotFound");

		internal static string FailedToGetLargerSpan => GetResourceString("FailedToGetLargerSpan");

		internal static string FoundInvalidCharacter => GetResourceString("FoundInvalidCharacter");

		internal static string InvalidCast => GetResourceString("InvalidCast");

		internal static string InvalidCharacterAfterEscapeWithinString => GetResourceString("InvalidCharacterAfterEscapeWithinString");

		internal static string InvalidCharacterWithinString => GetResourceString("InvalidCharacterWithinString");

		internal static string InvalidEnumTypeWithSpecialChar => GetResourceString("InvalidEnumTypeWithSpecialChar");

		internal static string InvalidEndOfJsonNonPrimitive => GetResourceString("InvalidEndOfJsonNonPrimitive");

		internal static string InvalidHexCharacterWithinString => GetResourceString("InvalidHexCharacterWithinString");

		internal static string JsonDocumentDoesNotSupportComments => GetResourceString("JsonDocumentDoesNotSupportComments");

		internal static string JsonElementHasWrongType => GetResourceString("JsonElementHasWrongType");

		internal static string DefaultTypeInfoResolverImmutable => GetResourceString("DefaultTypeInfoResolverImmutable");

		internal static string TypeInfoResolverChainImmutable => GetResourceString("TypeInfoResolverChainImmutable");

		internal static string TypeInfoImmutable => GetResourceString("TypeInfoImmutable");

		internal static string MaxDepthMustBePositive => GetResourceString("MaxDepthMustBePositive");

		internal static string CommentHandlingMustBeValid => GetResourceString("CommentHandlingMustBeValid");

		internal static string MismatchedObjectArray => GetResourceString("MismatchedObjectArray");

		internal static string CannotWriteEndAfterProperty => GetResourceString("CannotWriteEndAfterProperty");

		internal static string ObjectDepthTooLarge => GetResourceString("ObjectDepthTooLarge");

		internal static string PropertyNameTooLarge => GetResourceString("PropertyNameTooLarge");

		internal static string FormatDecimal => GetResourceString("FormatDecimal");

		internal static string FormatDouble => GetResourceString("FormatDouble");

		internal static string FormatInt32 => GetResourceString("FormatInt32");

		internal static string FormatInt64 => GetResourceString("FormatInt64");

		internal static string FormatSingle => GetResourceString("FormatSingle");

		internal static string FormatUInt32 => GetResourceString("FormatUInt32");

		internal static string FormatUInt64 => GetResourceString("FormatUInt64");

		internal static string RequiredDigitNotFoundAfterDecimal => GetResourceString("RequiredDigitNotFoundAfterDecimal");

		internal static string RequiredDigitNotFoundAfterSign => GetResourceString("RequiredDigitNotFoundAfterSign");

		internal static string RequiredDigitNotFoundEndOfData => GetResourceString("RequiredDigitNotFoundEndOfData");

		internal static string SpecialNumberValuesNotSupported => GetResourceString("SpecialNumberValuesNotSupported");

		internal static string ValueTooLarge => GetResourceString("ValueTooLarge");

		internal static string ZeroDepthAtEnd => GetResourceString("ZeroDepthAtEnd");

		internal static string DeserializeUnableToConvertValue => GetResourceString("DeserializeUnableToConvertValue");

		internal static string DeserializeWrongType => GetResourceString("DeserializeWrongType");

		internal static string SerializationInvalidBufferSize => GetResourceString("SerializationInvalidBufferSize");

		internal static string BufferWriterAdvancedTooFar => GetResourceString("BufferWriterAdvancedTooFar");

		internal static string InvalidComparison => GetResourceString("InvalidComparison");

		internal static string UnsupportedFormat => GetResourceString("UnsupportedFormat");

		internal static string ExpectedStartOfPropertyOrValueAfterComment => GetResourceString("ExpectedStartOfPropertyOrValueAfterComment");

		internal static string TrailingCommaNotAllowedBeforeArrayEnd => GetResourceString("TrailingCommaNotAllowedBeforeArrayEnd");

		internal static string TrailingCommaNotAllowedBeforeObjectEnd => GetResourceString("TrailingCommaNotAllowedBeforeObjectEnd");

		internal static string SerializerOptionsReadOnly => GetResourceString("SerializerOptionsReadOnly");

		internal static string SerializerOptions_InvalidChainedResolver => GetResourceString("SerializerOptions_InvalidChainedResolver");

		internal static string StreamNotWritable => GetResourceString("StreamNotWritable");

		internal static string CannotWriteCommentWithEmbeddedDelimiter => GetResourceString("CannotWriteCommentWithEmbeddedDelimiter");

		internal static string SerializerPropertyNameConflict => GetResourceString("SerializerPropertyNameConflict");

		internal static string SerializerPropertyNameNull => GetResourceString("SerializerPropertyNameNull");

		internal static string SerializationDataExtensionPropertyInvalid => GetResourceString("SerializationDataExtensionPropertyInvalid");

		internal static string SerializationDuplicateTypeAttribute => GetResourceString("SerializationDuplicateTypeAttribute");

		internal static string ExtensionDataConflictsWithUnmappedMemberHandling => GetResourceString("ExtensionDataConflictsWithUnmappedMemberHandling");

		internal static string SerializationNotSupportedType => GetResourceString("SerializationNotSupportedType");

		internal static string TypeRequiresAsyncSerialization => GetResourceString("TypeRequiresAsyncSerialization");

		internal static string InvalidCharacterAtStartOfComment => GetResourceString("InvalidCharacterAtStartOfComment");

		internal static string UnexpectedEndOfDataWhileReadingComment => GetResourceString("UnexpectedEndOfDataWhileReadingComment");

		internal static string CannotSkip => GetResourceString("CannotSkip");

		internal static string NotEnoughData => GetResourceString("NotEnoughData");

		internal static string UnexpectedEndOfLineSeparator => GetResourceString("UnexpectedEndOfLineSeparator");

		internal static string JsonSerializerDoesNotSupportComments => GetResourceString("JsonSerializerDoesNotSupportComments");

		internal static string DeserializeNoConstructor => GetResourceString("DeserializeNoConstructor");

		internal static string DeserializePolymorphicInterface => GetResourceString("DeserializePolymorphicInterface");

		internal static string SerializationConverterOnAttributeNotCompatible => GetResourceString("SerializationConverterOnAttributeNotCompatible");

		internal static string SerializationConverterOnAttributeInvalid => GetResourceString("SerializationConverterOnAttributeInvalid");

		internal static string SerializationConverterRead => GetResourceString("SerializationConverterRead");

		internal static string SerializationConverterNotCompatible => GetResourceString("SerializationConverterNotCompatible");

		internal static string ResolverTypeNotCompatible => GetResourceString("ResolverTypeNotCompatible");

		internal static string ResolverTypeInfoOptionsNotCompatible => GetResourceString("ResolverTypeInfoOptionsNotCompatible");

		internal static string SerializationConverterWrite => GetResourceString("SerializationConverterWrite");

		internal static string NamingPolicyReturnNull => GetResourceString("NamingPolicyReturnNull");

		internal static string SerializationDuplicateAttribute => GetResourceString("SerializationDuplicateAttribute");

		internal static string SerializeUnableToSerialize => GetResourceString("SerializeUnableToSerialize");

		internal static string FormatByte => GetResourceString("FormatByte");

		internal static string FormatInt16 => GetResourceString("FormatInt16");

		internal static string FormatSByte => GetResourceString("FormatSByte");

		internal static string FormatUInt16 => GetResourceString("FormatUInt16");

		internal static string SerializerCycleDetected => GetResourceString("SerializerCycleDetected");

		internal static string InvalidLeadingZeroInNumber => GetResourceString("InvalidLeadingZeroInNumber");

		internal static string MetadataCannotParsePreservedObjectToImmutable => GetResourceString("MetadataCannotParsePreservedObjectToImmutable");

		internal static string MetadataDuplicateIdFound => GetResourceString("MetadataDuplicateIdFound");

		internal static string MetadataIdIsNotFirstProperty => GetResourceString("MetadataIdIsNotFirstProperty");

		internal static string MetadataInvalidReferenceToValueType => GetResourceString("MetadataInvalidReferenceToValueType");

		internal static string MetadataInvalidTokenAfterValues => GetResourceString("MetadataInvalidTokenAfterValues");

		internal static string MetadataPreservedArrayFailed => GetResourceString("MetadataPreservedArrayFailed");

		internal static string MetadataInvalidPropertyInArrayMetadata => GetResourceString("MetadataInvalidPropertyInArrayMetadata");

		internal static string MetadataStandaloneValuesProperty => GetResourceString("MetadataStandaloneValuesProperty");

		internal static string MetadataReferenceCannotContainOtherProperties => GetResourceString("MetadataReferenceCannotContainOtherProperties");

		internal static string MetadataReferenceNotFound => GetResourceString("MetadataReferenceNotFound");

		internal static string MetadataValueWasNotString => GetResourceString("MetadataValueWasNotString");

		internal static string MetadataInvalidPropertyWithLeadingDollarSign => GetResourceString("MetadataInvalidPropertyWithLeadingDollarSign");

		internal static string MetadataUnexpectedProperty => GetResourceString("MetadataUnexpectedProperty");

		internal static string UnmappedJsonProperty => GetResourceString("UnmappedJsonProperty");

		internal static string MetadataDuplicateTypeProperty => GetResourceString("MetadataDuplicateTypeProperty");

		internal static string MultipleMembersBindWithConstructorParameter => GetResourceString("MultipleMembersBindWithConstructorParameter");

		internal static string ConstructorParamIncompleteBinding => GetResourceString("ConstructorParamIncompleteBinding");

		internal static string ObjectWithParameterizedCtorRefMetadataNotSupported => GetResourceString("ObjectWithParameterizedCtorRefMetadataNotSupported");

		internal static string SerializerConverterFactoryReturnsNull => GetResourceString("SerializerConverterFactoryReturnsNull");

		internal static string SerializationNotSupportedParentType => GetResourceString("SerializationNotSupportedParentType");

		internal static string ExtensionDataCannotBindToCtorParam => GetResourceString("ExtensionDataCannotBindToCtorParam");

		internal static string BufferMaximumSizeExceeded => GetResourceString("BufferMaximumSizeExceeded");

		internal static string CannotSerializeInvalidType => GetResourceString("CannotSerializeInvalidType");

		internal static string SerializeTypeInstanceNotSupported => GetResourceString("SerializeTypeInstanceNotSupported");

		internal static string JsonIncludeOnInaccessibleProperty => GetResourceString("JsonIncludeOnInaccessibleProperty");

		internal static string CannotSerializeInvalidMember => GetResourceString("CannotSerializeInvalidMember");

		internal static string CannotPopulateCollection => GetResourceString("CannotPopulateCollection");

		internal static string ConstructorContainsNullParameterNames => GetResourceString("ConstructorContainsNullParameterNames");

		internal static string DefaultIgnoreConditionAlreadySpecified => GetResourceString("DefaultIgnoreConditionAlreadySpecified");

		internal static string DefaultIgnoreConditionInvalid => GetResourceString("DefaultIgnoreConditionInvalid");

		internal static string DictionaryKeyTypeNotSupported => GetResourceString("DictionaryKeyTypeNotSupported");

		internal static string IgnoreConditionOnValueTypeInvalid => GetResourceString("IgnoreConditionOnValueTypeInvalid");

		internal static string NumberHandlingOnPropertyInvalid => GetResourceString("NumberHandlingOnPropertyInvalid");

		internal static string ConverterCanConvertMultipleTypes => GetResourceString("ConverterCanConvertMultipleTypes");

		internal static string MetadataReferenceOfTypeCannotBeAssignedToType => GetResourceString("MetadataReferenceOfTypeCannotBeAssignedToType");

		internal static string DeserializeUnableToAssignValue => GetResourceString("DeserializeUnableToAssignValue");

		internal static string DeserializeUnableToAssignNull => GetResourceString("DeserializeUnableToAssignNull");

		internal static string SerializerConverterFactoryReturnsJsonConverterFactory => GetResourceString("SerializerConverterFactoryReturnsJsonConverterFactory");

		internal static string SerializerConverterFactoryInvalidArgument => GetResourceString("SerializerConverterFactoryInvalidArgument");

		internal static string NodeElementWrongType => GetResourceString("NodeElementWrongType");

		internal static string NodeElementCannotBeObjectOrArray => GetResourceString("NodeElementCannotBeObjectOrArray");

		internal static string NodeAlreadyHasParent => GetResourceString("NodeAlreadyHasParent");

		internal static string NodeCycleDetected => GetResourceString("NodeCycleDetected");

		internal static string NodeUnableToConvert => GetResourceString("NodeUnableToConvert");

		internal static string NodeUnableToConvertElement => GetResourceString("NodeUnableToConvertElement");

		internal static string NodeValueNotAllowed => GetResourceString("NodeValueNotAllowed");

		internal static string NodeWrongType => GetResourceString("NodeWrongType");

		internal static string NodeParentWrongType => GetResourceString("NodeParentWrongType");

		internal static string NodeDuplicateKey => GetResourceString("NodeDuplicateKey");

		internal static string SerializerContextOptionsReadOnly => GetResourceString("SerializerContextOptionsReadOnly");

		internal static string ConverterForPropertyMustBeValid => GetResourceString("ConverterForPropertyMustBeValid");

		internal static string NoMetadataForType => GetResourceString("NoMetadataForType");

		internal static string AmbiguousMetadataForType => GetResourceString("AmbiguousMetadataForType");

		internal static string CollectionIsReadOnly => GetResourceString("CollectionIsReadOnly");

		internal static string ArrayIndexNegative => GetResourceString("ArrayIndexNegative");

		internal static string ArrayTooSmall => GetResourceString("ArrayTooSmall");

		internal static string NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty => GetResourceString("NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty");

		internal static string NoMetadataForTypeProperties => GetResourceString("NoMetadataForTypeProperties");

		internal static string FieldCannotBeVirtual => GetResourceString("FieldCannotBeVirtual");

		internal static string MissingFSharpCoreMember => GetResourceString("MissingFSharpCoreMember");

		internal static string FSharpDiscriminatedUnionsNotSupported => GetResourceString("FSharpDiscriminatedUnionsNotSupported");

		internal static string Polymorphism_BaseConverterDoesNotSupportMetadata => GetResourceString("Polymorphism_BaseConverterDoesNotSupportMetadata");

		internal static string Polymorphism_DerivedConverterDoesNotSupportMetadata => GetResourceString("Polymorphism_DerivedConverterDoesNotSupportMetadata");

		internal static string Polymorphism_TypeDoesNotSupportPolymorphism => GetResourceString("Polymorphism_TypeDoesNotSupportPolymorphism");

		internal static string Polymorphism_DerivedTypeIsNotSupported => GetResourceString("Polymorphism_DerivedTypeIsNotSupported");

		internal static string Polymorphism_DerivedTypeIsAlreadySpecified => GetResourceString("Polymorphism_DerivedTypeIsAlreadySpecified");

		internal static string Polymorphism_TypeDicriminatorIdIsAlreadySpecified => GetResourceString("Polymorphism_TypeDicriminatorIdIsAlreadySpecified");

		internal static string Polymorphism_InvalidCustomTypeDiscriminatorPropertyName => GetResourceString("Polymorphism_InvalidCustomTypeDiscriminatorPropertyName");

		internal static string Polymorphism_ConfigurationDoesNotSpecifyDerivedTypes => GetResourceString("Polymorphism_ConfigurationDoesNotSpecifyDerivedTypes");

		internal static string Polymorphism_UnrecognizedTypeDiscriminator => GetResourceString("Polymorphism_UnrecognizedTypeDiscriminator");

		internal static string Polymorphism_RuntimeTypeNotSupported => GetResourceString("Polymorphism_RuntimeTypeNotSupported");

		internal static string Polymorphism_RuntimeTypeDiamondAmbiguity => GetResourceString("Polymorphism_RuntimeTypeDiamondAmbiguity");

		internal static string InvalidJsonTypeInfoOperationForKind => GetResourceString("InvalidJsonTypeInfoOperationForKind");

		internal static string CreateObjectConverterNotCompatible => GetResourceString("CreateObjectConverterNotCompatible");

		internal static string JsonPropertyInfoBoundToDifferentParent => GetResourceString("JsonPropertyInfoBoundToDifferentParent");

		internal static string JsonSerializerOptionsNoTypeInfoResolverSpecified => GetResourceString("JsonSerializerOptionsNoTypeInfoResolverSpecified");

		internal static string JsonSerializerIsReflectionDisabled => GetResourceString("JsonSerializerIsReflectionDisabled");

		internal static string JsonPolymorphismOptionsAssociatedWithDifferentJsonTypeInfo => GetResourceString("JsonPolymorphismOptionsAssociatedWithDifferentJsonTypeInfo");

		internal static string JsonPropertyRequiredAndNotDeserializable => GetResourceString("JsonPropertyRequiredAndNotDeserializable");

		internal static string JsonPropertyRequiredAndExtensionData => GetResourceString("JsonPropertyRequiredAndExtensionData");

		internal static string JsonRequiredPropertiesMissing => GetResourceString("JsonRequiredPropertiesMissing");

		internal static string ObjectCreationHandlingPopulateNotSupportedByConverter => GetResourceString("ObjectCreationHandlingPopulateNotSupportedByConverter");

		internal static string ObjectCreationHandlingPropertyMustHaveAGetter => GetResourceString("ObjectCreationHandlingPropertyMustHaveAGetter");

		internal static string ObjectCreationHandlingPropertyValueTypeMustHaveASetter => GetResourceString("ObjectCreationHandlingPropertyValueTypeMustHaveASetter");

		internal static string ObjectCreationHandlingPropertyCannotAllowPolymorphicDeserialization => GetResourceString("ObjectCreationHandlingPropertyCannotAllowPolymorphicDeserialization");

		internal static string ObjectCreationHandlingPropertyCannotAllowReadOnlyMember => GetResourceString("ObjectCreationHandlingPropertyCannotAllowReadOnlyMember");

		internal static string ObjectCreationHandlingPropertyCannotAllowReferenceHandling => GetResourceString("ObjectCreationHandlingPropertyCannotAllowReferenceHandling");

		internal static string ObjectCreationHandlingPropertyDoesNotSupportParameterizedConstructors => GetResourceString("ObjectCreationHandlingPropertyDoesNotSupportParameterizedConstructors");

		internal static string FormatInt128 => GetResourceString("FormatInt128");

		internal static string FormatUInt128 => GetResourceString("FormatUInt128");

		internal static string FormatHalf => GetResourceString("FormatHalf");

		internal static bool UsingResourceKeys()
		{
			return s_usingResourceKeys;
		}

		private static string GetResourceString(string resourceKey)
		{
			if (UsingResourceKeys())
			{
				return resourceKey;
			}
			string result = null;
			try
			{
				result = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			return result;
		}

		private static string GetResourceString(string resourceKey, string defaultString)
		{
			string resourceString = GetResourceString(resourceKey);
			if (!(resourceKey == resourceString) && resourceString != null)
			{
				return resourceString;
			}
			return defaultString;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(provider, resourceFormat, p1);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(provider, resourceFormat, p1, p2);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(provider, resourceFormat, p1, p2, p3);
		}

		internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + ", " + string.Join(", ", args);
				}
				return string.Format(provider, resourceFormat, args);
			}
			return resourceFormat;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
	internal sealed class ObsoleteAttribute : Attribute
	{
		public string Message { get; }

		public bool IsError { get; }

		public string DiagnosticId { get; set; }

		public string UrlFormat { get; set; }

		public ObsoleteAttribute()
		{
		}

		public ObsoleteAttribute(string message)
		{
			Message = message;
		}

		public ObsoleteAttribute(string message, bool error)
		{
			Message = message;
			IsError = error;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Field, AllowMultiple = true, Inherited = false)]
	internal sealed class DynamicDependencyAttribute : Attribute
	{
		public string MemberSignature { get; }

		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public Type Type { get; }

		public string TypeName { get; }

		public string AssemblyName { get; }

		public string Condition { get; set; }

		public DynamicDependencyAttribute(string memberSignature)
		{
			MemberSignature = memberSignature;
		}

		public DynamicDependencyAttribute(string memberSignature, Type type)
		{
			MemberSignature = memberSignature;
			Type = type;
		}

		public DynamicDependencyAttribute(string memberSignature, string typeName, string assemblyName)
		{
			MemberSignature = memberSignature;
			TypeName = typeName;
			AssemblyName = assemblyName;
		}

		public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type)
		{
			MemberTypes = memberTypes;
			Type = type;
		}

		public DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, string typeName, string assemblyName)
		{
			MemberTypes = memberTypes;
			TypeName = typeName;
			AssemblyName = assemblyName;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)]
	internal sealed class DynamicallyAccessedMembersAttribute : Attribute
	{
		public DynamicallyAccessedMemberTypes MemberTypes { get; }

		public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
		{
			MemberTypes = memberTypes;
		}
	}
	[Flags]
	internal enum DynamicallyAccessedMemberTypes
	{
		None = 0,
		PublicParameterlessConstructor = 1,
		PublicConstructors = 3,
		NonPublicConstructors = 4,
		PublicMethods = 8,
		NonPublicMethods = 0x10,
		PublicFields = 0x20,
		NonPublicFields = 0x40,
		PublicNestedTypes = 0x80,
		NonPublicNestedTypes = 0x100,
		PublicProperties = 0x200,
		NonPublicProperties = 0x400,
		PublicEvents = 0x800,
		NonPublicEvents = 0x1000,
		Interfaces = 0x2000,
		All = -1
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresUnreferencedCodeAttribute : Attribute
	{
		public string Message { get; }

		public string Url { get; set; }

		public RequiresUnreferencedCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
	internal sealed class UnconditionalSuppressMessageAttribute : Attribute
	{
		public string Category { get; }

		public string CheckId { get; }

		public string Scope { get; set; }

		public string Target { get; set; }

		public string MessageId { get; set; }

		public string Justification { get; set; }

		public UnconditionalSuppressMessageAttribute(string category, string checkId)
		{
			Category = category;
			CheckId = checkId;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
	internal sealed class StringSyntaxAttribute : Attribute
	{
		public const string CompositeFormat = "CompositeFormat";

		public const string DateOnlyFormat = "DateOnlyFormat";

		public const string DateTimeFormat = "DateTimeFormat";

		public const string EnumFormat = "EnumFormat";

		public const string GuidFormat = "GuidFormat";

		public const string Json = "Json";

		public const string NumericFormat = "NumericFormat";

		public const string Regex = "Regex";

		public const string TimeOnlyFormat = "TimeOnlyFormat";

		public const string TimeSpanFormat = "TimeSpanFormat";

		public const string Uri = "Uri";

		public const string Xml = "Xml";

		public string Syntax { get; }

		public object[] Arguments { get; }

		public StringSyntaxAttribute(string syntax)
		{
			Syntax = syntax;
			Arguments = Array.Empty<object>();
		}

		public StringSyntaxAttribute(string syntax, params object[] arguments)
		{
			Syntax = syntax;
			Arguments = arguments;
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class RequiresDynamicCodeAttribute : Attribute
	{
		public string Message { get; }

		public string Url { get; set; }

		public RequiresDynamicCodeAttribute(string message)
		{
			Message = message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullAttribute : Attribute
	{
		public string[] Members { get; }

		public MemberNotNullAttribute(string member)
		{
			Members = new string[1] { member };
		}

		public MemberNotNullAttribute(params string[] members)
		{
			Members = members;
		}
	}
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
	internal sealed class MemberNotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public string[] Members { get; }

		public MemberNotNullWhenAttribute(bool returnValue, string member)
		{
			ReturnValue = returnValue;
			Members = new string[1] { member };
		}

		public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
		{
			ReturnValue = returnValue;
			Members = members;
		}
	}
}
namespace System.Runtime.InteropServices
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
	internal sealed class LibraryImportAttribute : Attribute
	{
		public string LibraryName { get; }

		public string EntryPoint { get; set; }

		public StringMarshalling StringMarshalling { get; set; }

		public Type StringMarshallingCustomType { get; set; }

		public bool SetLastError { get; set; }

		public LibraryImportAttribute(string libraryName)
		{
			LibraryName = libraryName;
		}
	}
	internal enum StringMarshalling
	{
		Custom,
		Utf8,
		Utf16
	}
}
namespace System.Runtime.Versioning
{
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false)]
	internal sealed class RequiresPreviewFeaturesAttribute : Attribute
	{
		public string Message { get; }

		public string Url { get; set; }

		public RequiresPreviewFeaturesAttribute()
		{
		}

		public RequiresPreviewFeaturesAttribute(string message)
		{
			Message = message;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[EditorBrowsable(EditorBrowsableState.Never)]
	internal static class IsExternalInit
	{
	}
}
namespace System.Collections.Generic
{
	internal sealed class ReferenceEqualityComparer : IEqualityComparer<object>, IEqualityComparer
	{
		public static ReferenceEqualityComparer Instance { get; } = new ReferenceEqualityComparer();


		private ReferenceEqualityComparer()
		{
		}

		public new bool Equals(object x, object y)
		{
			return x == y;
		}

		public int GetHashCode(object obj)
		{
			return RuntimeHelpers.GetHashCode(obj);
		}
	}
	internal static class StackExtensions
	{
		public static bool TryPeek<T>(this Stack<T> stack, [MaybeNullWhen(false)] out T result)
		{
			if (stack.Count > 0)
			{
				result = stack.Peek();
				return true;
			}
			result = default(T);
			return false;
		}

		public static bool TryPop<T>(this Stack<T> stack, [MaybeNullWhen(false)] out T result)
		{
			if (stack.Count > 0)
			{
				result = stack.Pop();
				return true;
			}
			result = default(T);
			return false;
		}
	}
}
namespace System.Buffers
{
	internal sealed class ArrayBufferWriter<T> : IBufferWriter<T>
	{
		private const int ArrayMaxLength = 2147483591;

		private const int DefaultInitialBufferSize = 256;

		private T[] _buffer;

		private int _index;

		public ReadOnlyMemory<T> WrittenMemory => _buffer.AsMemory(0, _index);

		public ReadOnlySpan<T> WrittenSpan => _buffer.AsSpan(0, _index);

		public int WrittenCount => _index;

		public int Capacity => _buffer.Length;

		public int FreeCapacity => _buffer.Length - _index;

		public ArrayBufferWriter()
		{
			_buffer = Array.Empty<T>();
			_index = 0;
		}

		public ArrayBufferWriter(int initialCapacity)
		{
			if (initialCapacity <= 0)
			{
				throw new ArgumentException(null, "initialCapacity");
			}
			_buffer = new T[initialCapacity];
			_index = 0;
		}

		public void Clear()
		{
			_buffer.AsSpan(0, _index).Clear();
			_index = 0;
		}

		public void ResetWrittenCount()
		{
			_index = 0;
		}

		public void Advance(int count)
		{
			if (count < 0)
			{
				throw new ArgumentException(null, "count");
			}
			if (_index > _buffer.Length - count)
			{
				ThrowInvalidOperationException_AdvancedTooFar(_buffer.Length);
			}
			_index += count;
		}

		public Memory<T> GetMemory(int sizeHint = 0)
		{
			CheckAndResizeBuffer(sizeHint);
			return _buffer.AsMemory(_index);
		}

		public Span<T> GetSpan(int sizeHint = 0)
		{
			CheckAndResizeBuffer(sizeHint);
			return _buffer.AsSpan(_index);
		}

		private void CheckAndResizeBuffer(int sizeHint)
		{
			if (sizeHint < 0)
			{
				throw new ArgumentException("sizeHint");
			}
			if (sizeHint == 0)
			{
				sizeHint = 1;
			}
			if (sizeHint <= FreeCapacity)
			{
				return;
			}
			int num = _buffer.Length;
			int num2 = Math.Max(sizeHint, num);
			if (num == 0)
			{
				num2 = Math.Max(num2, 256);
			}
			int num3 = num + num2;
			if ((uint)num3 > 2147483647u)
			{
				uint num4 = (uint)(num - FreeCapacity + sizeHint);
				if (num4 > 2147483591)
				{
					ThrowOutOfMemoryException(num4);
				}
				num3 = 2147483591;
			}
			Array.Resize(ref _buffer, num3);
		}

		private static void ThrowInvalidOperationException_AdvancedTooFar(int capacity)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.BufferWriterAdvancedTooFar, capacity));
		}

		private static void ThrowOutOfMemoryException(uint capacity)
		{
			throw new OutOfMemoryException(System.SR.Format(System.SR.BufferMaximumSizeExceeded, capacity));
		}
	}
}
namespace System.Buffers.Text
{
	internal enum SequenceValidity
	{
		Empty,
		WellFormed,
		Incomplete,
		Invalid
	}
}
namespace System.Text.Json
{
	internal sealed class PooledByteBufferWriter : IBufferWriter<byte>, IDisposable
	{
		private byte[] _rentedBuffer;

		private int _index;

		private const int MinimumBufferSize = 256;

		public const int MaximumBufferSize = 2147483591;

		public ReadOnlyMemory<byte> WrittenMemory => _rentedBuffer.AsMemory(0, _index);

		public int WrittenCount => _index;

		public int Capacity => _rentedBuffer.Length;

		public int FreeCapacity => _rentedBuffer.Length - _index;

		private PooledByteBufferWriter()
		{
		}

		public PooledByteBufferWriter(int initialCapacity)
			: this()
		{
			_rentedBuffer = ArrayPool<byte>.Shared.Rent(initialCapacity);
			_index = 0;
		}

		public void Clear()
		{
			ClearHelper();
		}

		public void ClearAndReturnBuffers()
		{
			ClearHelper();
			byte[] rentedBuffer = _rentedBuffer;
			_rentedBuffer = null;
			ArrayPool<byte>.Shared.Return(rentedBuffer);
		}

		private void ClearHelper()
		{
			_rentedBuffer.AsSpan(0, _index).Clear();
			_index = 0;
		}

		public void Dispose()
		{
			if (_rentedBuffer != null)
			{
				ClearHelper();
				byte[] rentedBuffer = _rentedBuffer;
				_rentedBuffer = null;
				ArrayPool<byte>.Shared.Return(rentedBuffer);
			}
		}

		public void InitializeEmptyInstance(int initialCapacity)
		{
			_rentedBuffer = ArrayPool<byte>.Shared.Rent(initialCapacity);
			_index = 0;
		}

		public static PooledByteBufferWriter CreateEmptyInstanceForCaching()
		{
			return new PooledByteBufferWriter();
		}

		public void Advance(int count)
		{
			_index += count;
		}

		public Memory<byte> GetMemory(int sizeHint = 256)
		{
			CheckAndResizeBuffer(sizeHint);
			return _rentedBuffer.AsMemory(_index);
		}

		public Span<byte> GetSpan(int sizeHint = 256)
		{
			CheckAndResizeBuffer(sizeHint);
			return _rentedBuffer.AsSpan(_index);
		}

		internal Task WriteToStreamAsync(Stream destination, CancellationToken cancellationToken)
		{
			return destination.WriteAsync(_rentedBuffer, 0, _index, cancellationToken);
		}

		internal void WriteToStream(Stream destination)
		{
			destination.Write(_rentedBuffer, 0, _index);
		}

		private void CheckAndResizeBuffer(int sizeHint)
		{
			int num = _rentedBuffer.Length;
			int num2 = num - _index;
			if (_index >= 1073741795)
			{
				sizeHint = Math.Max(sizeHint, 2147483591 - num);
			}
			if (sizeHint <= num2)
			{
				return;
			}
			int num3 = Math.Max(sizeHint, num);
			int num4 = num + num3;
			if ((uint)num4 > 2147483591u)
			{
				num4 = num + sizeHint;
				if ((uint)num4 > 2147483591u)
				{
					ThrowHelper.ThrowOutOfMemoryException_BufferMaximumSizeExceeded((uint)num4);
				}
			}
			byte[] rentedBuffer = _rentedBuffer;
			_rentedBuffer = ArrayPool<byte>.Shared.Rent(num4);
			Span<byte> span = rentedBuffer.AsSpan(0, _index);
			span.CopyTo(_rentedBuffer);
			span.Clear();
			ArrayPool<byte>.Shared.Return(rentedBuffer);
		}
	}
	internal static class ThrowHelper
	{
		public const string ExceptionSourceValueToRethrowAsJsonException = "System.Text.Json.Rethrowable";

		[MethodImpl(MethodImplOptions.NoInlining)]
		[DoesNotReturn]
		public static void ThrowOutOfMemoryException_BufferMaximumSizeExceeded(uint capacity)
		{
			throw new OutOfMemoryException(System.SR.Format(System.SR.BufferMaximumSizeExceeded, capacity));
		}

		[DoesNotReturn]
		public static void ThrowArgumentNullException(string parameterName)
		{
			throw new ArgumentNullException(parameterName);
		}

		[DoesNotReturn]
		public static void ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(string parameterName)
		{
			throw GetArgumentOutOfRangeException(parameterName, System.SR.MaxDepthMustBePositive);
		}

		private static ArgumentOutOfRangeException GetArgumentOutOfRangeException(string parameterName, string message)
		{
			return new ArgumentOutOfRangeException(parameterName, message);
		}

		[DoesNotReturn]
		public static void ThrowArgumentOutOfRangeException_CommentEnumMustBeInRange(string parameterName)
		{
			throw GetArgumentOutOfRangeException(parameterName, System.SR.CommentHandlingMustBeValid);
		}

		[DoesNotReturn]
		public static void ThrowArgumentOutOfRangeException_ArrayIndexNegative(string paramName)
		{
			throw new ArgumentOutOfRangeException(paramName, System.SR.ArrayIndexNegative);
		}

		[DoesNotReturn]
		public static void ThrowArgumentOutOfRangeException_JsonConverterFactory_TypeNotSupported(Type typeToConvert)
		{
			throw new ArgumentOutOfRangeException("typeToConvert", System.SR.Format(System.SR.SerializerConverterFactoryInvalidArgument, typeToConvert.FullName));
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_ArrayTooSmall(string paramName)
		{
			throw new ArgumentException(System.SR.ArrayTooSmall, paramName);
		}

		private static ArgumentException GetArgumentException(string message)
		{
			return new ArgumentException(message);
		}

		[DoesNotReturn]
		public static void ThrowArgumentException(string message)
		{
			throw GetArgumentException(message);
		}

		public static InvalidOperationException GetInvalidOperationException_CallFlushFirst(int _buffered)
		{
			return GetInvalidOperationException(System.SR.Format(System.SR.CallFlushToAvoidDataLoss, _buffered));
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_DestinationTooShort()
		{
			throw GetArgumentException(System.SR.DestinationTooShort);
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_PropertyNameTooLarge(int tokenLength)
		{
			throw GetArgumentException(System.SR.Format(System.SR.PropertyNameTooLarge, tokenLength));
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_ValueTooLarge(long tokenLength)
		{
			throw GetArgumentException(System.SR.Format(System.SR.ValueTooLarge, tokenLength));
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_ValueNotSupported()
		{
			throw GetArgumentException(System.SR.SpecialNumberValuesNotSupported);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_NeedLargerSpan()
		{
			throw GetInvalidOperationException(System.SR.FailedToGetLargerSpan);
		}

		[DoesNotReturn]
		public static void ThrowPropertyNameTooLargeArgumentException(int length)
		{
			throw GetArgumentException(System.SR.Format(System.SR.PropertyNameTooLarge, length));
		}

		[DoesNotReturn]
		public static void ThrowArgumentException(ReadOnlySpan<byte> propertyName, ReadOnlySpan<byte> value)
		{
			if (propertyName.Length > 166666666)
			{
				ThrowArgumentException(System.SR.Format(System.SR.PropertyNameTooLarge, propertyName.Length));
			}
			else
			{
				ThrowArgumentException(System.SR.Format(System.SR.ValueTooLarge, value.Length));
			}
		}

		[DoesNotReturn]
		public static void ThrowArgumentException(ReadOnlySpan<byte> propertyName, ReadOnlySpan<char> value)
		{
			if (propertyName.Length > 166666666)
			{
				ThrowArgumentException(System.SR.Format(System.SR.PropertyNameTooLarge, propertyName.Length));
			}
			else
			{
				ThrowArgumentException(System.SR.Format(System.SR.ValueTooLarge, value.Length));
			}
		}

		[DoesNotReturn]
		public static void ThrowArgumentException(ReadOnlySpan<char> propertyName, ReadOnlySpan<byte> value)
		{
			if (propertyName.Length > 166666666)
			{
				ThrowArgumentException(System.SR.Format(System.SR.PropertyNameTooLarge, propertyName.Length));
			}
			else
			{
				ThrowArgumentException(System.SR.Format(System.SR.ValueTooLarge, value.Length));
			}
		}

		[DoesNotReturn]
		public static void ThrowArgumentException(ReadOnlySpan<char> propertyName, ReadOnlySpan<char> value)
		{
			if (propertyName.Length > 166666666)
			{
				ThrowArgumentException(System.SR.Format(System.SR.PropertyNameTooLarge, propertyName.Length));
			}
			else
			{
				ThrowArgumentException(System.SR.Format(System.SR.ValueTooLarge, value.Length));
			}
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan<byte> propertyName, int currentDepth, int maxDepth)
		{
			currentDepth &= 0x7FFFFFFF;
			if (currentDepth >= maxDepth)
			{
				ThrowInvalidOperationException(System.SR.Format(System.SR.DepthTooLarge, currentDepth, maxDepth));
			}
			else
			{
				ThrowArgumentException(System.SR.Format(System.SR.PropertyNameTooLarge, propertyName.Length));
			}
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException(int currentDepth, int maxDepth)
		{
			currentDepth &= 0x7FFFFFFF;
			ThrowInvalidOperationException(System.SR.Format(System.SR.DepthTooLarge, currentDepth, maxDepth));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException(string message)
		{
			throw GetInvalidOperationException(message);
		}

		private static InvalidOperationException GetInvalidOperationException(string message)
		{
			return new InvalidOperationException(message)
			{
				Source = "System.Text.Json.Rethrowable"
			};
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_DepthNonZeroOrEmptyJson(int currentDepth)
		{
			throw GetInvalidOperationException(currentDepth);
		}

		private static InvalidOperationException GetInvalidOperationException(int currentDepth)
		{
			currentDepth &= 0x7FFFFFFF;
			if (currentDepth != 0)
			{
				return GetInvalidOperationException(System.SR.Format(System.SR.ZeroDepthAtEnd, currentDepth));
			}
			return GetInvalidOperationException(System.SR.EmptyJsonIsInvalid);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan<char> propertyName, int currentDepth, int maxDepth)
		{
			currentDepth &= 0x7FFFFFFF;
			if (currentDepth >= maxDepth)
			{
				ThrowInvalidOperationException(System.SR.Format(System.SR.DepthTooLarge, currentDepth, maxDepth));
			}
			else
			{
				ThrowArgumentException(System.SR.Format(System.SR.PropertyNameTooLarge, propertyName.Length));
			}
		}

		public static InvalidOperationException GetInvalidOperationException_ExpectedArray(JsonTokenType tokenType)
		{
			return GetInvalidOperationException("array", tokenType);
		}

		public static InvalidOperationException GetInvalidOperationException_ExpectedObject(JsonTokenType tokenType)
		{
			return GetInvalidOperationException("object", tokenType);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ExpectedNumber(JsonTokenType tokenType)
		{
			throw GetInvalidOperationException("number", tokenType);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ExpectedBoolean(JsonTokenType tokenType)
		{
			throw GetInvalidOperationException("boolean", tokenType);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType)
		{
			throw GetInvalidOperationException("string", tokenType);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ExpectedPropertyName(JsonTokenType tokenType)
		{
			throw GetInvalidOperationException("propertyName", tokenType);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ExpectedStringComparison(JsonTokenType tokenType)
		{
			throw GetInvalidOperationException(tokenType);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ExpectedComment(JsonTokenType tokenType)
		{
			throw GetInvalidOperationException("comment", tokenType);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_CannotSkipOnPartial()
		{
			throw GetInvalidOperationException(System.SR.CannotSkip);
		}

		private static InvalidOperationException GetInvalidOperationException(string message, JsonTokenType tokenType)
		{
			return GetInvalidOperationException(System.SR.Format(System.SR.InvalidCast, tokenType, message));
		}

		private static InvalidOperationException GetInvalidOperationException(JsonTokenType tokenType)
		{
			return GetInvalidOperationException(System.SR.Format(System.SR.InvalidComparison, tokenType));
		}

		[DoesNotReturn]
		internal static void ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)
		{
			throw GetJsonElementWrongTypeException(expectedType.ToValueKind(), actualType.ToValueKind());
		}

		internal static InvalidOperationException GetJsonElementWrongTypeException(JsonValueKind expectedType, JsonValueKind actualType)
		{
			return GetInvalidOperationException(System.SR.Format(System.SR.JsonElementHasWrongType, expectedType, actualType));
		}

		internal static InvalidOperationException GetJsonElementWrongTypeException(string expectedTypeName, JsonValueKind actualType)
		{
			return GetInvalidOperationException(System.SR.Format(System.SR.JsonElementHasWrongType, expectedTypeName, actualType));
		}

		[DoesNotReturn]
		public static void ThrowJsonReaderException(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte = 0, ReadOnlySpan<byte> bytes = default(ReadOnlySpan<byte>))
		{
			throw GetJsonReaderException(ref json, resource, nextByte, bytes);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static JsonException GetJsonReaderException(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte, ReadOnlySpan<byte> bytes)
		{
			string resourceString = GetResourceString(ref json, resource, nextByte, JsonHelpers.Utf8GetString(bytes));
			long lineNumber = json.CurrentState._lineNumber;
			long bytePositionInLine = json.CurrentState._bytePositionInLine;
			resourceString += $" LineNumber: {lineNumber} | BytePositionInLine: {bytePositionInLine}.";
			return new JsonReaderException(resourceString, lineNumber, bytePositionInLine);
		}

		private static bool IsPrintable(byte value)
		{
			if (value >= 32)
			{
				return value < 127;
			}
			return false;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal static string GetPrintableString(byte value)
		{
			if (!IsPrintable(value))
			{
				return $"0x{value:X2}";
			}
			char c = (char)value;
			return c.ToString();
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static string GetResourceString(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte, string characters)
		{
			string printableString = GetPrintableString(nextByte);
			string result = "";
			switch (resource)
			{
			case ExceptionResource.ArrayDepthTooLarge:
				result = System.SR.Format(System.SR.ArrayDepthTooLarge, json.CurrentState.Options.MaxDepth);
				break;
			case ExceptionResource.MismatchedObjectArray:
				result = System.SR.Format(System.SR.MismatchedObjectArray, printableString);
				break;
			case ExceptionResource.TrailingCommaNotAllowedBeforeArrayEnd:
				result = System.SR.TrailingCommaNotAllowedBeforeArrayEnd;
				break;
			case ExceptionResource.TrailingCommaNotAllowedBeforeObjectEnd:
				result = System.SR.TrailingCommaNotAllowedBeforeObjectEnd;
				break;
			case ExceptionResource.EndOfStringNotFound:
				result = System.SR.EndOfStringNotFound;
				break;
			case ExceptionResource.RequiredDigitNotFoundAfterSign:
				result = System.SR.Format(System.SR.RequiredDigitNotFoundAfterSign, printableString);
				break;
			case ExceptionResource.RequiredDigitNotFoundAfterDecimal:
				result = System.SR.Format(System.SR.RequiredDigitNotFoundAfterDecimal, printableString);
				break;
			case ExceptionResource.RequiredDigitNotFoundEndOfData:
				result = System.SR.RequiredDigitNotFoundEndOfData;
				break;
			case ExceptionResource.ExpectedEndAfterSingleJson:
				result = System.SR.Format(System.SR.ExpectedEndAfterSingleJson, printableString);
				break;
			case ExceptionResource.ExpectedEndOfDigitNotFound:
				result = System.SR.Format(System.SR.ExpectedEndOfDigitNotFound, printableString);
				break;
			case ExceptionResource.ExpectedNextDigitEValueNotFound:
				result = System.SR.Format(System.SR.ExpectedNextDigitEValueNotFound, printableString);
				break;
			case ExceptionResource.ExpectedSeparatorAfterPropertyNameNotFound:
				result = System.SR.Format(System.SR.ExpectedSeparatorAfterPropertyNameNotFound, printableString);
				break;
			case ExceptionResource.ExpectedStartOfPropertyNotFound:
				result = System.SR.Format(System.SR.ExpectedStartOfPropertyNotFound, printableString);
				break;
			case ExceptionResource.ExpectedStartOfPropertyOrValueNotFound:
				result = System.SR.ExpectedStartOfPropertyOrValueNotFound;
				break;
			case ExceptionResource.ExpectedStartOfPropertyOrValueAfterComment:
				result = System.SR.Format(System.SR.ExpectedStartOfPropertyOrValueAfterComment, printableString);
				break;
			case ExceptionResource.ExpectedStartOfValueNotFound:
				result = System.SR.Format(System.SR.ExpectedStartOfValueNotFound, printableString);
				break;
			case ExceptionResource.ExpectedValueAfterPropertyNameNotFound:
				result = System.SR.ExpectedValueAfterPropertyNameNotFound;
				break;
			case ExceptionResource.FoundInvalidCharacter:
				result = System.SR.Format(System.SR.FoundInvalidCharacter, printableString);
				break;
			case ExceptionResource.InvalidEndOfJsonNonPrimitive:
				result = System.SR.Format(System.SR.InvalidEndOfJsonNonPrimitive, json.TokenType);
				break;
			case ExceptionResource.ObjectDepthTooLarge:
				result = System.SR.Format(System.SR.ObjectDepthTooLarge, json.CurrentState.Options.MaxDepth);
				break;
			case ExceptionResource.ExpectedFalse:
				result = System.SR.Format(System.SR.ExpectedFalse, characters);
				break;
			case ExceptionResource.ExpectedNull:
				result = System.SR.Format(System.SR.ExpectedNull, characters);
				break;
			case ExceptionResource.ExpectedTrue:
				result = System.SR.Format(System.SR.ExpectedTrue, characters);
				break;
			case ExceptionResource.InvalidCharacterWithinString:
				result = System.SR.Format(System.SR.InvalidCharacterWithinString, printableString);
				break;
			case ExceptionResource.InvalidCharacterAfterEscapeWithinString:
				result = System.SR.Format(System.SR.InvalidCharacterAfterEscapeWithinString, printableString);
				break;
			case ExceptionResource.InvalidHexCharacterWithinString:
				result = System.SR.Format(System.SR.InvalidHexCharacterWithinString, printableString);
				break;
			case ExceptionResource.EndOfCommentNotFound:
				result = System.SR.EndOfCommentNotFound;
				break;
			case ExceptionResource.ZeroDepthAtEnd:
				result = System.SR.Format(System.SR.ZeroDepthAtEnd);
				break;
			case ExceptionResource.ExpectedJsonTokens:
				result = System.SR.ExpectedJsonTokens;
				break;
			case ExceptionResource.NotEnoughData:
				result = System.SR.NotEnoughData;
				break;
			case ExceptionResource.ExpectedOneCompleteToken:
				result = System.SR.ExpectedOneCompleteToken;
				break;
			case ExceptionResource.InvalidCharacterAtStartOfComment:
				result = System.SR.Format(System.SR.InvalidCharacterAtStartOfComment, printableString);
				break;
			case ExceptionResource.UnexpectedEndOfDataWhileReadingComment:
				result = System.SR.Format(System.SR.UnexpectedEndOfDataWhileReadingComment);
				break;
			case ExceptionResource.UnexpectedEndOfLineSeparator:
				result = System.SR.Format(System.SR.UnexpectedEndOfLineSeparator);
				break;
			case ExceptionResource.InvalidLeadingZeroInNumber:
				result = System.SR.Format(System.SR.InvalidLeadingZeroInNumber, printableString);
				break;
			}
			return result;
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException(ExceptionResource resource, int currentDepth, int maxDepth, byte token, JsonTokenType tokenType)
		{
			throw GetInvalidOperationException(resource, currentDepth, maxDepth, token, tokenType);
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_InvalidCommentValue()
		{
			throw new ArgumentException(System.SR.CannotWriteCommentWithEmbeddedDelimiter);
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_InvalidUTF8(ReadOnlySpan<byte> value)
		{
			StringBuilder stringBuilder = new StringBuilder();
			int num = Math.Min(value.Length, 10);
			for (int i = 0; i < num; i++)
			{
				byte b = value[i];
				if (IsPrintable(b))
				{
					stringBuilder.Append((char)b);
				}
				else
				{
					stringBuilder.Append($"0x{b:X2}");
				}
			}
			if (num < value.Length)
			{
				stringBuilder.Append("...");
			}
			throw new ArgumentException(System.SR.Format(System.SR.CannotEncodeInvalidUTF8, stringBuilder));
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_InvalidUTF16(int charAsInt)
		{
			throw new ArgumentException(System.SR.Format(System.SR.CannotEncodeInvalidUTF16, $"0x{charAsInt:X2}"));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ReadInvalidUTF16(int charAsInt)
		{
			throw GetInvalidOperationException(System.SR.Format(System.SR.CannotReadInvalidUTF16, $"0x{charAsInt:X2}"));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ReadIncompleteUTF16()
		{
			throw GetInvalidOperationException(System.SR.CannotReadIncompleteUTF16);
		}

		public static InvalidOperationException GetInvalidOperationException_ReadInvalidUTF8(DecoderFallbackException innerException = null)
		{
			return GetInvalidOperationException(System.SR.CannotTranscodeInvalidUtf8, innerException);
		}

		public static ArgumentException GetArgumentException_ReadInvalidUTF16(EncoderFallbackException innerException)
		{
			return new ArgumentException(System.SR.CannotTranscodeInvalidUtf16, innerException);
		}

		public static InvalidOperationException GetInvalidOperationException(string message, Exception innerException)
		{
			InvalidOperationException ex = new InvalidOperationException(message, innerException);
			ex.Source = "System.Text.Json.Rethrowable";
			return ex;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static InvalidOperationException GetInvalidOperationException(ExceptionResource resource, int currentDepth, int maxDepth, byte token, JsonTokenType tokenType)
		{
			string resourceString = GetResourceString(resource, currentDepth, maxDepth, token, tokenType);
			InvalidOperationException invalidOperationException = GetInvalidOperationException(resourceString);
			invalidOperationException.Source = "System.Text.Json.Rethrowable";
			return invalidOperationException;
		}

		[DoesNotReturn]
		public static void ThrowOutOfMemoryException(uint capacity)
		{
			throw new OutOfMemoryException(System.SR.Format(System.SR.BufferMaximumSizeExceeded, capacity));
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static string GetResourceString(ExceptionResource resource, int currentDepth, int maxDepth, byte token, JsonTokenType tokenType)
		{
			string result = "";
			switch (resource)
			{
			case ExceptionResource.MismatchedObjectArray:
				result = ((tokenType == JsonTokenType.PropertyName) ? System.SR.Format(System.SR.CannotWriteEndAfterProperty, (char)token) : System.SR.Format(System.SR.MismatchedObjectArray, (char)token));
				break;
			case ExceptionResource.DepthTooLarge:
				result = System.SR.Format(System.SR.DepthTooLarge, currentDepth & 0x7FFFFFFF, maxDepth);
				break;
			case ExceptionResource.CannotStartObjectArrayWithoutProperty:
				result = System.SR.Format(System.SR.CannotStartObjectArrayWithoutProperty, tokenType);
				break;
			case ExceptionResource.CannotStartObjectArrayAfterPrimitiveOrClose:
				result = System.SR.Format(System.SR.CannotStartObjectArrayAfterPrimitiveOrClose, tokenType);
				break;
			case ExceptionResource.CannotWriteValueWithinObject:
				result = System.SR.Format(System.SR.CannotWriteValueWithinObject, tokenType);
				break;
			case ExceptionResource.CannotWritePropertyWithinArray:
				result = ((tokenType == JsonTokenType.PropertyName) ? System.SR.Format(System.SR.CannotWritePropertyAfterProperty) : System.SR.Format(System.SR.CannotWritePropertyWithinArray, tokenType));
				break;
			case ExceptionResource.CannotWriteValueAfterPrimitiveOrClose:
				result = System.SR.Format(System.SR.CannotWriteValueAfterPrimitiveOrClose, tokenType);
				break;
			}
			return result;
		}

		[DoesNotReturn]
		public static void ThrowFormatException()
		{
			throw new FormatException
			{
				Source = "System.Text.Json.Rethrowable"
			};
		}

		public static void ThrowFormatException(NumericType numericType)
		{
			string message = "";
			switch (numericType)
			{
			case NumericType.Byte:
				message = System.SR.FormatByte;
				break;
			case NumericType.SByte:
				message = System.SR.FormatSByte;
				break;
			case NumericType.Int16:
				message = System.SR.FormatInt16;
				break;
			case NumericType.Int32:
				message = System.SR.FormatInt32;
				break;
			case NumericType.Int64:
				message = System.SR.FormatInt64;
				break;
			case NumericType.Int128:
				message = System.SR.FormatInt128;
				break;
			case NumericType.UInt16:
				message = System.SR.FormatUInt16;
				break;
			case NumericType.UInt32:
				message = System.SR.FormatUInt32;
				break;
			case NumericType.UInt64:
				message = System.SR.FormatUInt64;
				break;
			case NumericType.UInt128:
				message = System.SR.FormatUInt128;
				break;
			case NumericType.Half:
				message = System.SR.FormatHalf;
				break;
			case NumericType.Single:
				message = System.SR.FormatSingle;
				break;
			case NumericType.Double:
				message = System.SR.FormatDouble;
				break;
			case NumericType.Decimal:
				message = System.SR.FormatDecimal;
				break;
			}
			throw new FormatException(message)
			{
				Source = "System.Text.Json.Rethrowable"
			};
		}

		[DoesNotReturn]
		public static void ThrowFormatException(DataType dataType)
		{
			string message = "";
			switch (dataType)
			{
			case DataType.Boolean:
			case DataType.DateOnly:
			case DataType.DateTime:
			case DataType.DateTimeOffset:
			case DataType.TimeOnly:
			case DataType.TimeSpan:
			case DataType.Guid:
			case DataType.Version:
				message = System.SR.Format(System.SR.UnsupportedFormat, dataType);
				break;
			case DataType.Base64String:
				message = System.SR.CannotDecodeInvalidBase64;
				break;
			}
			throw new FormatException(message)
			{
				Source = "System.Text.Json.Rethrowable"
			};
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ExpectedChar(JsonTokenType tokenType)
		{
			throw GetInvalidOperationException("char", tokenType);
		}

		[DoesNotReturn]
		public static void ThrowObjectDisposedException_Utf8JsonWriter()
		{
			throw new ObjectDisposedException("Utf8JsonWriter");
		}

		[DoesNotReturn]
		public static void ThrowObjectDisposedException_JsonDocument()
		{
			throw new ObjectDisposedException("JsonDocument");
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_NodeValueNotAllowed(string paramName)
		{
			throw new ArgumentException(System.SR.NodeValueNotAllowed, paramName);
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_DuplicateKey(string paramName, string propertyName)
		{
			throw new ArgumentException(System.SR.Format(System.SR.NodeDuplicateKey, propertyName), paramName);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_NodeAlreadyHasParent()
		{
			throw new InvalidOperationException(System.SR.NodeAlreadyHasParent);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_NodeCycleDetected()
		{
			throw new InvalidOperationException(System.SR.NodeCycleDetected);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_NodeElementCannotBeObjectOrArray()
		{
			throw new InvalidOperationException(System.SR.NodeElementCannotBeObjectOrArray);
		}

		[DoesNotReturn]
		public static void ThrowNotSupportedException_CollectionIsReadOnly()
		{
			throw GetNotSupportedException_CollectionIsReadOnly();
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_NodeWrongType(string typeName)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.NodeWrongType, typeName));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_NodeParentWrongType(string typeName)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.NodeParentWrongType, typeName));
		}

		public static NotSupportedException GetNotSupportedException_CollectionIsReadOnly()
		{
			return new NotSupportedException(System.SR.CollectionIsReadOnly);
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_DeserializeWrongType(Type type, object value)
		{
			throw new ArgumentException(System.SR.Format(System.SR.DeserializeWrongType, type, value.GetType()));
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_SerializerDoesNotSupportComments(string paramName)
		{
			throw new ArgumentException(System.SR.JsonSerializerDoesNotSupportComments, paramName);
		}

		[DoesNotReturn]
		public static void ThrowNotSupportedException_SerializationNotSupported(Type propertyType)
		{
			throw new NotSupportedException(System.SR.Format(System.SR.SerializationNotSupportedType, propertyType));
		}

		[DoesNotReturn]
		public static void ThrowNotSupportedException_TypeRequiresAsyncSerialization(Type propertyType)
		{
			throw new NotSupportedException(System.SR.Format(System.SR.TypeRequiresAsyncSerialization, propertyType));
		}

		[DoesNotReturn]
		public static void ThrowNotSupportedException_DictionaryKeyTypeNotSupported(Type keyType, JsonConverter converter)
		{
			throw new NotSupportedException(System.SR.Format(System.SR.DictionaryKeyTypeNotSupported, keyType, converter.GetType()));
		}

		[DoesNotReturn]
		public static void ThrowJsonException_DeserializeUnableToConvertValue(Type propertyType)
		{
			throw new JsonException(System.SR.Format(System.SR.DeserializeUnableToConvertValue, propertyType))
			{
				AppendPathInformation = true
			};
		}

		[DoesNotReturn]
		public static void ThrowInvalidCastException_DeserializeUnableToAssignValue(Type typeOfValue, Type declaredType)
		{
			throw new InvalidCastException(System.SR.Format(System.SR.DeserializeUnableToAssignValue, typeOfValue, declaredType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_DeserializeUnableToAssignNull(Type declaredType)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.DeserializeUnableToAssignNull, declaredType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ObjectCreationHandlingPopulateNotSupportedByConverter(JsonPropertyInfo propertyInfo)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.ObjectCreationHandlingPopulateNotSupportedByConverter, propertyInfo.Name, propertyInfo.DeclaringType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ObjectCreationHandlingPropertyMustHaveAGetter(JsonPropertyInfo propertyInfo)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.ObjectCreationHandlingPropertyMustHaveAGetter, propertyInfo.Name, propertyInfo.DeclaringType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ObjectCreationHandlingPropertyValueTypeMustHaveASetter(JsonPropertyInfo propertyInfo)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.ObjectCreationHandlingPropertyValueTypeMustHaveASetter, propertyInfo.Name, propertyInfo.DeclaringType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ObjectCreationHandlingPropertyCannotAllowPolymorphicDeserialization(JsonPropertyInfo propertyInfo)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.ObjectCreationHandlingPropertyCannotAllowPolymorphicDeserialization, propertyInfo.Name, propertyInfo.DeclaringType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ObjectCreationHandlingPropertyCannotAllowReadOnlyMember(JsonPropertyInfo propertyInfo)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.ObjectCreationHandlingPropertyCannotAllowReadOnlyMember, propertyInfo.Name, propertyInfo.DeclaringType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ObjectCreationHandlingPropertyCannotAllowReferenceHandling()
		{
			throw new InvalidOperationException(System.SR.ObjectCreationHandlingPropertyCannotAllowReferenceHandling);
		}

		[DoesNotReturn]
		public static void ThrowNotSupportedException_ObjectCreationHandlingPropertyDoesNotSupportParameterizedConstructors()
		{
			throw new NotSupportedException(System.SR.ObjectCreationHandlingPropertyDoesNotSupportParameterizedConstructors);
		}

		[DoesNotReturn]
		public static void ThrowJsonException_SerializationConverterRead(JsonConverter converter)
		{
			throw new JsonException(System.SR.Format(System.SR.SerializationConverterRead, converter))
			{
				AppendPathInformation = true
			};
		}

		[DoesNotReturn]
		public static void ThrowJsonException_SerializationConverterWrite(JsonConverter converter)
		{
			throw new JsonException(System.SR.Format(System.SR.SerializationConverterWrite, converter))
			{
				AppendPathInformation = true
			};
		}

		[DoesNotReturn]
		public static void ThrowJsonException_SerializerCycleDetected(int maxDepth)
		{
			throw new JsonException(System.SR.Format(System.SR.SerializerCycleDetected, maxDepth))
			{
				AppendPathInformation = true
			};
		}

		[DoesNotReturn]
		public static void ThrowJsonException(string message = null)
		{
			throw new JsonException(message)
			{
				AppendPathInformation = true
			};
		}

		[DoesNotReturn]
		public static void ThrowArgumentException_CannotSerializeInvalidType(string paramName, Type typeToConvert, Type declaringType, string propertyName)
		{
			if (declaringType == null)
			{
				throw new ArgumentException(System.SR.Format(System.SR.CannotSerializeInvalidType, typeToConvert), paramName);
			}
			throw new ArgumentException(System.SR.Format(System.SR.CannotSerializeInvalidMember, typeToConvert, propertyName, declaringType), paramName);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_CannotSerializeInvalidType(Type typeToConvert, Type declaringType, MemberInfo memberInfo)
		{
			if (declaringType == null)
			{
				throw new InvalidOperationException(System.SR.Format(System.SR.CannotSerializeInvalidType, typeToConvert));
			}
			throw new InvalidOperationException(System.SR.Format(System.SR.CannotSerializeInvalidMember, typeToConvert, memberInfo.Name, declaringType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_SerializationConverterNotCompatible(Type converterType, Type type)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.SerializationConverterNotCompatible, converterType, type));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ResolverTypeNotCompatible(Type requestedType, Type actualType)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.ResolverTypeNotCompatible, actualType, requestedType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_ResolverTypeInfoOptionsNotCompatible()
		{
			throw new InvalidOperationException(System.SR.ResolverTypeInfoOptionsNotCompatible);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_JsonSerializerOptionsNoTypeInfoResolverSpecified()
		{
			throw new InvalidOperationException(System.SR.JsonSerializerOptionsNoTypeInfoResolverSpecified);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_JsonSerializerIsReflectionDisabled()
		{
			throw new InvalidOperationException(System.SR.JsonSerializerIsReflectionDisabled);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_SerializationConverterOnAttributeInvalid(Type classType, MemberInfo memberInfo)
		{
			string text = classType.ToString();
			if (memberInfo != null)
			{
				text = text + "." + memberInfo.Name;
			}
			throw new InvalidOperationException(System.SR.Format(System.SR.SerializationConverterOnAttributeInvalid, text));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_SerializationConverterOnAttributeNotCompatible(Type classTypeAttributeIsOn, MemberInfo memberInfo, Type typeToConvert)
		{
			string text = classTypeAttributeIsOn.ToString();
			if (memberInfo != null)
			{
				text = text + "." + memberInfo.Name;
			}
			throw new InvalidOperationException(System.SR.Format(System.SR.SerializationConverterOnAttributeNotCompatible, text, typeToConvert));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_SerializerOptionsReadOnly(JsonSerializerContext context)
		{
			string message = ((context == null) ? System.SR.SerializerOptionsReadOnly : System.SR.SerializerContextOptionsReadOnly);
			throw new InvalidOperationException(message);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_DefaultTypeInfoResolverImmutable()
		{
			throw new InvalidOperationException(System.SR.DefaultTypeInfoResolverImmutable);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_TypeInfoResolverChainImmutable()
		{
			throw new InvalidOperationException(System.SR.TypeInfoResolverChainImmutable);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_TypeInfoImmutable()
		{
			throw new InvalidOperationException(System.SR.TypeInfoImmutable);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_InvalidChainedResolver()
		{
			throw new InvalidOperationException(System.SR.SerializerOptions_InvalidChainedResolver);
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_SerializerPropertyNameConflict(Type type, string propertyName)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.SerializerPropertyNameConflict, type, propertyName));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_SerializerPropertyNameNull(JsonPropertyInfo jsonPropertyInfo)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.SerializerPropertyNameNull, jsonPropertyInfo.DeclaringType, jsonPropertyInfo.MemberName));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_JsonPropertyRequiredAndNotDeserializable(JsonPropertyInfo jsonPropertyInfo)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.JsonPropertyRequiredAndNotDeserializable, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_JsonPropertyRequiredAndExtensionData(JsonPropertyInfo jsonPropertyInfo)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.JsonPropertyRequiredAndExtensionData, jsonPropertyInfo.Name, jsonPropertyInfo.DeclaringType));
		}

		[DoesNotReturn]
		public static void ThrowJsonException_JsonRequiredPropertyMissing(JsonTypeInfo parent, BitArray requiredPropertiesSet)
		{
			StringBuilder stringBuilder = new StringBuilder();
			bool flag = true;
			foreach (KeyValuePair<string, JsonPropertyInfo> item in parent.PropertyCache.List)
			{
				JsonPropertyInfo value = item.Value;
				if (value.IsRequired && !requiredPropertiesSet[value.RequiredPropertyIndex])
				{
					if (!flag)
					{
						stringBuilder.Append(CultureInfo.CurrentUICulture.TextInfo.ListSeparator);
						stringBuilder.Append(' ');
					}
					stringBuilder.Append(value.Name);
					flag = false;
					if (stringBuilder.Length >= 50)
					{
						break;
					}
				}
			}
			throw new JsonException(System.SR.Format(System.SR.JsonRequiredPropertiesMissing, parent.Type, stringBuilder.ToString()));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_NamingPolicyReturnNull(JsonNamingPolicy namingPolicy)
		{
			throw new InvalidOperationException(System.SR.Format(System.SR.NamingPolicyReturnNull, namingPolicy));
		}

		[DoesNotReturn]
		public static void ThrowInvalidOperationException_SerializerConverterFactoryReturnsNull(Type converterType)
		{
			throw new InvalidOperatio

BepInEx\plugins\Cyberhead\System.Threading.Tasks.Extensions.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Threading.Tasks;
using System.Threading.Tasks.Sources;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("System.Threading.Tasks.Extensions")]
[assembly: AssemblyDescription("System.Threading.Tasks.Extensions")]
[assembly: AssemblyDefaultAlias("System.Threading.Tasks.Extensions")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.6.28619.01")]
[assembly: AssemblyInformationalVersion("4.6.28619.01 @BuiltBy: dlab14-DDVSOWINAGE069 @Branch: release/2.1 @SrcCode: https://github.com/dotnet/corefx/tree/7601f4f6225089ffb291dc7d58293c7bbf5c5d4f")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyVersion("4.2.0.1")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
}
namespace System
{
	internal static class ThrowHelper
	{
		internal static void ThrowArgumentNullException(System.ExceptionArgument argument)
		{
			throw GetArgumentNullException(argument);
		}

		internal static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument)
		{
			throw GetArgumentOutOfRangeException(argument);
		}

		private static ArgumentNullException GetArgumentNullException(System.ExceptionArgument argument)
		{
			return new ArgumentNullException(GetArgumentName(argument));
		}

		private static ArgumentOutOfRangeException GetArgumentOutOfRangeException(System.ExceptionArgument argument)
		{
			return new ArgumentOutOfRangeException(GetArgumentName(argument));
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static string GetArgumentName(System.ExceptionArgument argument)
		{
			return argument.ToString();
		}
	}
	internal enum ExceptionArgument
	{
		task,
		source,
		state
	}
}
namespace System.Threading.Tasks
{
	[StructLayout(LayoutKind.Auto)]
	[AsyncMethodBuilder(typeof(AsyncValueTaskMethodBuilder))]
	public readonly struct ValueTask : IEquatable<ValueTask>
	{
		private sealed class ValueTaskSourceAsTask : TaskCompletionSource<bool>
		{
			private static readonly Action<object> s_completionAction = delegate(object state)
			{
				IValueTaskSource source;
				if (!(state is ValueTaskSourceAsTask valueTaskSourceAsTask) || (source = valueTaskSourceAsTask._source) == null)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.state);
					return;
				}
				valueTaskSourceAsTask._source = null;
				ValueTaskSourceStatus status = source.GetStatus(valueTaskSourceAsTask._token);
				try
				{
					source.GetResult(valueTaskSourceAsTask._token);
					valueTaskSourceAsTask.TrySetResult(result: false);
				}
				catch (Exception exception)
				{
					if (status == ValueTaskSourceStatus.Canceled)
					{
						valueTaskSourceAsTask.TrySetCanceled();
					}
					else
					{
						valueTaskSourceAsTask.TrySetException(exception);
					}
				}
			};

			private IValueTaskSource _source;

			private readonly short _token;

			public ValueTaskSourceAsTask(IValueTaskSource source, short token)
			{
				_token = token;
				_source = source;
				source.OnCompleted(s_completionAction, this, token, ValueTaskSourceOnCompletedFlags.None);
			}
		}

		private static readonly Task s_canceledTask = Task.Delay(-1, new CancellationToken(canceled: true));

		internal readonly object _obj;

		internal readonly short _token;

		internal readonly bool _continueOnCapturedContext;

		internal static Task CompletedTask { get; } = Task.Delay(0);


		public bool IsCompleted
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				object obj = _obj;
				if (obj == null)
				{
					return true;
				}
				if (obj is Task task)
				{
					return task.IsCompleted;
				}
				return System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj).GetStatus(_token) != ValueTaskSourceStatus.Pending;
			}
		}

		public bool IsCompletedSuccessfully
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				object obj = _obj;
				if (obj == null)
				{
					return true;
				}
				if (obj is Task task)
				{
					return task.Status == TaskStatus.RanToCompletion;
				}
				return System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj).GetStatus(_token) == ValueTaskSourceStatus.Succeeded;
			}
		}

		public bool IsFaulted
		{
			get
			{
				object obj = _obj;
				if (obj == null)
				{
					return false;
				}
				if (obj is Task task)
				{
					return task.IsFaulted;
				}
				return System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj).GetStatus(_token) == ValueTaskSourceStatus.Faulted;
			}
		}

		public bool IsCanceled
		{
			get
			{
				object obj = _obj;
				if (obj == null)
				{
					return false;
				}
				if (obj is Task task)
				{
					return task.IsCanceled;
				}
				return System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj).GetStatus(_token) == ValueTaskSourceStatus.Canceled;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ValueTask(Task task)
		{
			if (task == null)
			{
				System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.task);
			}
			_obj = task;
			_continueOnCapturedContext = true;
			_token = 0;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ValueTask(IValueTaskSource source, short token)
		{
			if (source == null)
			{
				System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.source);
			}
			_obj = source;
			_token = token;
			_continueOnCapturedContext = true;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private ValueTask(object obj, short token, bool continueOnCapturedContext)
		{
			_obj = obj;
			_token = token;
			_continueOnCapturedContext = continueOnCapturedContext;
		}

		public override int GetHashCode()
		{
			return _obj?.GetHashCode() ?? 0;
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTask)
			{
				return Equals((ValueTask)obj);
			}
			return false;
		}

		public bool Equals(ValueTask other)
		{
			if (_obj == other._obj)
			{
				return _token == other._token;
			}
			return false;
		}

		public static bool operator ==(ValueTask left, ValueTask right)
		{
			return left.Equals(right);
		}

		public static bool operator !=(ValueTask left, ValueTask right)
		{
			return !left.Equals(right);
		}

		public Task AsTask()
		{
			object obj = _obj;
			object obj2;
			if (obj != null)
			{
				obj2 = obj as Task;
				if (obj2 == null)
				{
					return GetTaskForValueTaskSource(System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj));
				}
			}
			else
			{
				obj2 = CompletedTask;
			}
			return (Task)obj2;
		}

		public ValueTask Preserve()
		{
			if (_obj != null)
			{
				return new ValueTask(AsTask());
			}
			return this;
		}

		private Task GetTaskForValueTaskSource(IValueTaskSource t)
		{
			ValueTaskSourceStatus status = t.GetStatus(_token);
			if (status != 0)
			{
				try
				{
					t.GetResult(_token);
					return CompletedTask;
				}
				catch (Exception exception)
				{
					if (status == ValueTaskSourceStatus.Canceled)
					{
						return s_canceledTask;
					}
					TaskCompletionSource<bool> taskCompletionSource = new TaskCompletionSource<bool>();
					taskCompletionSource.TrySetException(exception);
					return taskCompletionSource.Task;
				}
			}
			ValueTaskSourceAsTask valueTaskSourceAsTask = new ValueTaskSourceAsTask(t, _token);
			return valueTaskSourceAsTask.Task;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[StackTraceHidden]
		internal void ThrowIfCompletedUnsuccessfully()
		{
			object obj = _obj;
			if (obj != null)
			{
				if (obj is Task task)
				{
					task.GetAwaiter().GetResult();
				}
				else
				{
					System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj).GetResult(_token);
				}
			}
		}

		public ValueTaskAwaiter GetAwaiter()
		{
			return new ValueTaskAwaiter(this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ConfiguredValueTaskAwaitable ConfigureAwait(bool continueOnCapturedContext)
		{
			return new ConfiguredValueTaskAwaitable(new ValueTask(_obj, _token, continueOnCapturedContext));
		}
	}
	[StructLayout(LayoutKind.Auto)]
	[AsyncMethodBuilder(typeof(AsyncValueTaskMethodBuilder<>))]
	public readonly struct ValueTask<TResult> : IEquatable<ValueTask<TResult>>
	{
		private sealed class ValueTaskSourceAsTask : TaskCompletionSource<TResult>
		{
			private static readonly Action<object> s_completionAction = delegate(object state)
			{
				IValueTaskSource<TResult> source;
				if (!(state is ValueTaskSourceAsTask valueTaskSourceAsTask) || (source = valueTaskSourceAsTask._source) == null)
				{
					System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.state);
					return;
				}
				valueTaskSourceAsTask._source = null;
				ValueTaskSourceStatus status = source.GetStatus(valueTaskSourceAsTask._token);
				try
				{
					valueTaskSourceAsTask.TrySetResult(source.GetResult(valueTaskSourceAsTask._token));
				}
				catch (Exception exception)
				{
					if (status == ValueTaskSourceStatus.Canceled)
					{
						valueTaskSourceAsTask.TrySetCanceled();
					}
					else
					{
						valueTaskSourceAsTask.TrySetException(exception);
					}
				}
			};

			private IValueTaskSource<TResult> _source;

			private readonly short _token;

			public ValueTaskSourceAsTask(IValueTaskSource<TResult> source, short token)
			{
				_source = source;
				_token = token;
				source.OnCompleted(s_completionAction, this, token, ValueTaskSourceOnCompletedFlags.None);
			}
		}

		private static Task<TResult> s_canceledTask;

		internal readonly object _obj;

		internal readonly TResult _result;

		internal readonly short _token;

		internal readonly bool _continueOnCapturedContext;

		public bool IsCompleted
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				object obj = _obj;
				if (obj == null)
				{
					return true;
				}
				if (obj is Task<TResult> task)
				{
					return task.IsCompleted;
				}
				return System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj).GetStatus(_token) != ValueTaskSourceStatus.Pending;
			}
		}

		public bool IsCompletedSuccessfully
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				object obj = _obj;
				if (obj == null)
				{
					return true;
				}
				if (obj is Task<TResult> task)
				{
					return task.Status == TaskStatus.RanToCompletion;
				}
				return System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj).GetStatus(_token) == ValueTaskSourceStatus.Succeeded;
			}
		}

		public bool IsFaulted
		{
			get
			{
				object obj = _obj;
				if (obj == null)
				{
					return false;
				}
				if (obj is Task<TResult> task)
				{
					return task.IsFaulted;
				}
				return System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj).GetStatus(_token) == ValueTaskSourceStatus.Faulted;
			}
		}

		public bool IsCanceled
		{
			get
			{
				object obj = _obj;
				if (obj == null)
				{
					return false;
				}
				if (obj is Task<TResult> task)
				{
					return task.IsCanceled;
				}
				return System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj).GetStatus(_token) == ValueTaskSourceStatus.Canceled;
			}
		}

		public TResult Result
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				object obj = _obj;
				if (obj == null)
				{
					return _result;
				}
				if (obj is Task<TResult> task)
				{
					return task.GetAwaiter().GetResult();
				}
				return System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj).GetResult(_token);
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ValueTask(TResult result)
		{
			_result = result;
			_obj = null;
			_continueOnCapturedContext = true;
			_token = 0;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ValueTask(Task<TResult> task)
		{
			if (task == null)
			{
				System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.task);
			}
			_obj = task;
			_result = default(TResult);
			_continueOnCapturedContext = true;
			_token = 0;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ValueTask(IValueTaskSource<TResult> source, short token)
		{
			if (source == null)
			{
				System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.source);
			}
			_obj = source;
			_token = token;
			_result = default(TResult);
			_continueOnCapturedContext = true;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		private ValueTask(object obj, TResult result, short token, bool continueOnCapturedContext)
		{
			_obj = obj;
			_result = result;
			_token = token;
			_continueOnCapturedContext = continueOnCapturedContext;
		}

		public override int GetHashCode()
		{
			if (_obj == null)
			{
				if (_result == null)
				{
					return 0;
				}
				return _result.GetHashCode();
			}
			return _obj.GetHashCode();
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTask<TResult>)
			{
				return Equals((ValueTask<TResult>)obj);
			}
			return false;
		}

		public bool Equals(ValueTask<TResult> other)
		{
			if (_obj == null && other._obj == null)
			{
				return EqualityComparer<TResult>.Default.Equals(_result, other._result);
			}
			if (_obj == other._obj)
			{
				return _token == other._token;
			}
			return false;
		}

		public static bool operator ==(ValueTask<TResult> left, ValueTask<TResult> right)
		{
			return left.Equals(right);
		}

		public static bool operator !=(ValueTask<TResult> left, ValueTask<TResult> right)
		{
			return !left.Equals(right);
		}

		public Task<TResult> AsTask()
		{
			object obj = _obj;
			if (obj == null)
			{
				return Task.FromResult(_result);
			}
			if (obj is Task<TResult> result)
			{
				return result;
			}
			return GetTaskForValueTaskSource(System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj));
		}

		public ValueTask<TResult> Preserve()
		{
			if (_obj != null)
			{
				return new ValueTask<TResult>(AsTask());
			}
			return this;
		}

		private Task<TResult> GetTaskForValueTaskSource(IValueTaskSource<TResult> t)
		{
			ValueTaskSourceStatus status = t.GetStatus(_token);
			if (status != 0)
			{
				try
				{
					return Task.FromResult(t.GetResult(_token));
				}
				catch (Exception exception)
				{
					if (status == ValueTaskSourceStatus.Canceled)
					{
						Task<TResult> task = s_canceledTask;
						if (task == null)
						{
							TaskCompletionSource<TResult> taskCompletionSource = new TaskCompletionSource<TResult>();
							taskCompletionSource.TrySetCanceled();
							task = (s_canceledTask = taskCompletionSource.Task);
						}
						return task;
					}
					TaskCompletionSource<TResult> taskCompletionSource2 = new TaskCompletionSource<TResult>();
					taskCompletionSource2.TrySetException(exception);
					return taskCompletionSource2.Task;
				}
			}
			ValueTaskSourceAsTask valueTaskSourceAsTask = new ValueTaskSourceAsTask(t, _token);
			return valueTaskSourceAsTask.Task;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ValueTaskAwaiter<TResult> GetAwaiter()
		{
			return new ValueTaskAwaiter<TResult>(this);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ConfiguredValueTaskAwaitable<TResult> ConfigureAwait(bool continueOnCapturedContext)
		{
			return new ConfiguredValueTaskAwaitable<TResult>(new ValueTask<TResult>(_obj, _result, _token, continueOnCapturedContext));
		}

		public override string ToString()
		{
			if (IsCompletedSuccessfully)
			{
				TResult result = Result;
				if (result != null)
				{
					return result.ToString();
				}
			}
			return string.Empty;
		}
	}
}
namespace System.Threading.Tasks.Sources
{
	[Flags]
	public enum ValueTaskSourceOnCompletedFlags
	{
		None = 0,
		UseSchedulingContext = 1,
		FlowExecutionContext = 2
	}
	public enum ValueTaskSourceStatus
	{
		Pending,
		Succeeded,
		Faulted,
		Canceled
	}
	public interface IValueTaskSource
	{
		ValueTaskSourceStatus GetStatus(short token);

		void OnCompleted(Action<object> continuation, object state, short token, ValueTaskSourceOnCompletedFlags flags);

		void GetResult(short token);
	}
	public interface IValueTaskSource<out TResult>
	{
		ValueTaskSourceStatus GetStatus(short token);

		void OnCompleted(Action<object> continuation, object state, short token, ValueTaskSourceOnCompletedFlags flags);

		TResult GetResult(short token);
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate, Inherited = false, AllowMultiple = false)]
	public sealed class AsyncMethodBuilderAttribute : Attribute
	{
		public Type BuilderType { get; }

		public AsyncMethodBuilderAttribute(Type builderType)
		{
			BuilderType = builderType;
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public struct AsyncValueTaskMethodBuilder
	{
		private AsyncTaskMethodBuilder _methodBuilder;

		private bool _haveResult;

		private bool _useBuilder;

		public ValueTask Task
		{
			get
			{
				if (_haveResult)
				{
					return default(ValueTask);
				}
				_useBuilder = true;
				return new ValueTask(_methodBuilder.Task);
			}
		}

		public static AsyncValueTaskMethodBuilder Create()
		{
			return default(AsyncValueTaskMethodBuilder);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine
		{
			_methodBuilder.Start(ref stateMachine);
		}

		public void SetStateMachine(IAsyncStateMachine stateMachine)
		{
			_methodBuilder.SetStateMachine(stateMachine);
		}

		public void SetResult()
		{
			if (_useBuilder)
			{
				_methodBuilder.SetResult();
			}
			else
			{
				_haveResult = true;
			}
		}

		public void SetException(Exception exception)
		{
			_methodBuilder.SetException(exception);
		}

		public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine
		{
			_useBuilder = true;
			_methodBuilder.AwaitOnCompleted(ref awaiter, ref stateMachine);
		}

		[SecuritySafeCritical]
		public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine
		{
			_useBuilder = true;
			_methodBuilder.AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine);
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public struct AsyncValueTaskMethodBuilder<TResult>
	{
		private AsyncTaskMethodBuilder<TResult> _methodBuilder;

		private TResult _result;

		private bool _haveResult;

		private bool _useBuilder;

		public ValueTask<TResult> Task
		{
			get
			{
				if (_haveResult)
				{
					return new ValueTask<TResult>(_result);
				}
				_useBuilder = true;
				return new ValueTask<TResult>(_methodBuilder.Task);
			}
		}

		public static AsyncValueTaskMethodBuilder<TResult> Create()
		{
			return default(AsyncValueTaskMethodBuilder<TResult>);
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine
		{
			_methodBuilder.Start(ref stateMachine);
		}

		public void SetStateMachine(IAsyncStateMachine stateMachine)
		{
			_methodBuilder.SetStateMachine(stateMachine);
		}

		public void SetResult(TResult result)
		{
			if (_useBuilder)
			{
				_methodBuilder.SetResult(result);
				return;
			}
			_result = result;
			_haveResult = true;
		}

		public void SetException(Exception exception)
		{
			_methodBuilder.SetException(exception);
		}

		public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine
		{
			_useBuilder = true;
			_methodBuilder.AwaitOnCompleted(ref awaiter, ref stateMachine);
		}

		[SecuritySafeCritical]
		public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine
		{
			_useBuilder = true;
			_methodBuilder.AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine);
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public readonly struct ConfiguredValueTaskAwaitable
	{
		[StructLayout(LayoutKind.Auto)]
		public readonly struct ConfiguredValueTaskAwaiter : ICriticalNotifyCompletion, INotifyCompletion
		{
			private readonly ValueTask _value;

			public bool IsCompleted
			{
				[MethodImpl(MethodImplOptions.AggressiveInlining)]
				get
				{
					return _value.IsCompleted;
				}
			}

			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			internal ConfiguredValueTaskAwaiter(ValueTask value)
			{
				_value = value;
			}

			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			[StackTraceHidden]
			public void GetResult()
			{
				_value.ThrowIfCompletedUnsuccessfully();
			}

			public void OnCompleted(Action continuation)
			{
				object obj = _value._obj;
				if (obj is Task task)
				{
					task.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().OnCompleted(continuation);
				}
				else if (obj != null)
				{
					System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj).OnCompleted(ValueTaskAwaiter.s_invokeActionDelegate, continuation, _value._token, ValueTaskSourceOnCompletedFlags.FlowExecutionContext | (_value._continueOnCapturedContext ? ValueTaskSourceOnCompletedFlags.UseSchedulingContext : ValueTaskSourceOnCompletedFlags.None));
				}
				else
				{
					ValueTask.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().OnCompleted(continuation);
				}
			}

			public void UnsafeOnCompleted(Action continuation)
			{
				object obj = _value._obj;
				if (obj is Task task)
				{
					task.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().UnsafeOnCompleted(continuation);
				}
				else if (obj != null)
				{
					System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj).OnCompleted(ValueTaskAwaiter.s_invokeActionDelegate, continuation, _value._token, _value._continueOnCapturedContext ? ValueTaskSourceOnCompletedFlags.UseSchedulingContext : ValueTaskSourceOnCompletedFlags.None);
				}
				else
				{
					ValueTask.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().UnsafeOnCompleted(continuation);
				}
			}
		}

		private readonly ValueTask _value;

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal ConfiguredValueTaskAwaitable(ValueTask value)
		{
			_value = value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ConfiguredValueTaskAwaiter GetAwaiter()
		{
			return new ConfiguredValueTaskAwaiter(_value);
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public readonly struct ConfiguredValueTaskAwaitable<TResult>
	{
		[StructLayout(LayoutKind.Auto)]
		public readonly struct ConfiguredValueTaskAwaiter : ICriticalNotifyCompletion, INotifyCompletion
		{
			private readonly ValueTask<TResult> _value;

			public bool IsCompleted
			{
				[MethodImpl(MethodImplOptions.AggressiveInlining)]
				get
				{
					return _value.IsCompleted;
				}
			}

			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			internal ConfiguredValueTaskAwaiter(ValueTask<TResult> value)
			{
				_value = value;
			}

			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			[StackTraceHidden]
			public TResult GetResult()
			{
				return _value.Result;
			}

			public void OnCompleted(Action continuation)
			{
				object obj = _value._obj;
				if (obj is Task<TResult> task)
				{
					task.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().OnCompleted(continuation);
				}
				else if (obj != null)
				{
					System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj).OnCompleted(ValueTaskAwaiter.s_invokeActionDelegate, continuation, _value._token, ValueTaskSourceOnCompletedFlags.FlowExecutionContext | (_value._continueOnCapturedContext ? ValueTaskSourceOnCompletedFlags.UseSchedulingContext : ValueTaskSourceOnCompletedFlags.None));
				}
				else
				{
					ValueTask.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().OnCompleted(continuation);
				}
			}

			public void UnsafeOnCompleted(Action continuation)
			{
				object obj = _value._obj;
				if (obj is Task<TResult> task)
				{
					task.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().UnsafeOnCompleted(continuation);
				}
				else if (obj != null)
				{
					System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj).OnCompleted(ValueTaskAwaiter.s_invokeActionDelegate, continuation, _value._token, _value._continueOnCapturedContext ? ValueTaskSourceOnCompletedFlags.UseSchedulingContext : ValueTaskSourceOnCompletedFlags.None);
				}
				else
				{
					ValueTask.CompletedTask.ConfigureAwait(_value._continueOnCapturedContext).GetAwaiter().UnsafeOnCompleted(continuation);
				}
			}
		}

		private readonly ValueTask<TResult> _value;

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal ConfiguredValueTaskAwaitable(ValueTask<TResult> value)
		{
			_value = value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		public ConfiguredValueTaskAwaiter GetAwaiter()
		{
			return new ConfiguredValueTaskAwaiter(_value);
		}
	}
	public readonly struct ValueTaskAwaiter : ICriticalNotifyCompletion, INotifyCompletion
	{
		internal static readonly Action<object> s_invokeActionDelegate = delegate(object state)
		{
			if (!(state is Action action))
			{
				System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument.state);
			}
			else
			{
				action();
			}
		};

		private readonly ValueTask _value;

		public bool IsCompleted
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				return _value.IsCompleted;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal ValueTaskAwaiter(ValueTask value)
		{
			_value = value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[StackTraceHidden]
		public void GetResult()
		{
			_value.ThrowIfCompletedUnsuccessfully();
		}

		public void OnCompleted(Action continuation)
		{
			object obj = _value._obj;
			if (obj is Task task)
			{
				task.GetAwaiter().OnCompleted(continuation);
			}
			else if (obj != null)
			{
				System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj).OnCompleted(s_invokeActionDelegate, continuation, _value._token, ValueTaskSourceOnCompletedFlags.UseSchedulingContext | ValueTaskSourceOnCompletedFlags.FlowExecutionContext);
			}
			else
			{
				ValueTask.CompletedTask.GetAwaiter().OnCompleted(continuation);
			}
		}

		public void UnsafeOnCompleted(Action continuation)
		{
			object obj = _value._obj;
			if (obj is Task task)
			{
				task.GetAwaiter().UnsafeOnCompleted(continuation);
			}
			else if (obj != null)
			{
				System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource>(obj).OnCompleted(s_invokeActionDelegate, continuation, _value._token, ValueTaskSourceOnCompletedFlags.UseSchedulingContext);
			}
			else
			{
				ValueTask.CompletedTask.GetAwaiter().UnsafeOnCompleted(continuation);
			}
		}
	}
	public readonly struct ValueTaskAwaiter<TResult> : ICriticalNotifyCompletion, INotifyCompletion
	{
		private readonly ValueTask<TResult> _value;

		public bool IsCompleted
		{
			[MethodImpl(MethodImplOptions.AggressiveInlining)]
			get
			{
				return _value.IsCompleted;
			}
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		internal ValueTaskAwaiter(ValueTask<TResult> value)
		{
			_value = value;
		}

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[StackTraceHidden]
		public TResult GetResult()
		{
			return _value.Result;
		}

		public void OnCompleted(Action continuation)
		{
			object obj = _value._obj;
			if (obj is Task<TResult> task)
			{
				task.GetAwaiter().OnCompleted(continuation);
			}
			else if (obj != null)
			{
				System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj).OnCompleted(ValueTaskAwaiter.s_invokeActionDelegate, continuation, _value._token, ValueTaskSourceOnCompletedFlags.UseSchedulingContext | ValueTaskSourceOnCompletedFlags.FlowExecutionContext);
			}
			else
			{
				ValueTask.CompletedTask.GetAwaiter().OnCompleted(continuation);
			}
		}

		public void UnsafeOnCompleted(Action continuation)
		{
			object obj = _value._obj;
			if (obj is Task<TResult> task)
			{
				task.GetAwaiter().UnsafeOnCompleted(continuation);
			}
			else if (obj != null)
			{
				System.Runtime.CompilerServices.Unsafe.As<IValueTaskSource<TResult>>(obj).OnCompleted(ValueTaskAwaiter.s_invokeActionDelegate, continuation, _value._token, ValueTaskSourceOnCompletedFlags.UseSchedulingContext);
			}
			else
			{
				ValueTask.CompletedTask.GetAwaiter().UnsafeOnCompleted(continuation);
			}
		}
	}
}
namespace System.Diagnostics
{
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, Inherited = false)]
	internal sealed class StackTraceHiddenAttribute : Attribute
	{
	}
}

BepInEx\plugins\Cyberhead\System.ValueTuple.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Numerics.Hashing;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using FxResources.System.ValueTuple;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyTitle("System.ValueTuple")]
[assembly: AssemblyDescription("System.ValueTuple")]
[assembly: AssemblyDefaultAlias("System.ValueTuple")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation.  All rights reserved.")]
[assembly: AssemblyFileVersion("4.6.26515.06")]
[assembly: AssemblyInformationalVersion("4.6.26515.06 @BuiltBy: dlab-DDVSOWINAGE059 @Branch: release/2.1 @SrcCode: https://github.com/dotnet/corefx/tree/30ab651fcb4354552bd4891619a0bdd81e0ebdbf")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")]
[assembly: AssemblyMetadata("Serviceable", "True")]
[assembly: AssemblyMetadata("PreferInbox", "True")]
[assembly: AssemblyVersion("4.0.3.0")]
namespace FxResources.System.ValueTuple
{
	internal static class SR
	{
	}
}
namespace System
{
	public static class TupleExtensions
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1>(this Tuple<T1> value, out T1 item1)
		{
			item1 = value.Item1;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2>(this Tuple<T1, T2> value, out T1 item1, out T2 item2)
		{
			item1 = value.Item1;
			item2 = value.Item2;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3>(this Tuple<T1, T2, T3> value, out T1 item1, out T2 item2, out T3 item3)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4>(this Tuple<T1, T2, T3, T4> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5>(this Tuple<T1, T2, T3, T4, T5> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6>(this Tuple<T1, T2, T3, T4, T5, T6> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7>(this Tuple<T1, T2, T3, T4, T5, T6, T7> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
			item13 = value.Rest.Item6;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
			item13 = value.Rest.Item6;
			item14 = value.Rest.Item7;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
			item13 = value.Rest.Item6;
			item14 = value.Rest.Item7;
			item15 = value.Rest.Rest.Item1;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
			item13 = value.Rest.Item6;
			item14 = value.Rest.Item7;
			item15 = value.Rest.Rest.Item1;
			item16 = value.Rest.Rest.Item2;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
			item13 = value.Rest.Item6;
			item14 = value.Rest.Item7;
			item15 = value.Rest.Rest.Item1;
			item16 = value.Rest.Rest.Item2;
			item17 = value.Rest.Rest.Item3;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
			item13 = value.Rest.Item6;
			item14 = value.Rest.Item7;
			item15 = value.Rest.Rest.Item1;
			item16 = value.Rest.Rest.Item2;
			item17 = value.Rest.Rest.Item3;
			item18 = value.Rest.Rest.Item4;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
			item13 = value.Rest.Item6;
			item14 = value.Rest.Item7;
			item15 = value.Rest.Rest.Item1;
			item16 = value.Rest.Rest.Item2;
			item17 = value.Rest.Rest.Item3;
			item18 = value.Rest.Rest.Item4;
			item19 = value.Rest.Rest.Item5;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19, out T20 item20)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
			item13 = value.Rest.Item6;
			item14 = value.Rest.Item7;
			item15 = value.Rest.Rest.Item1;
			item16 = value.Rest.Rest.Item2;
			item17 = value.Rest.Rest.Item3;
			item18 = value.Rest.Rest.Item4;
			item19 = value.Rest.Rest.Item5;
			item20 = value.Rest.Rest.Item6;
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20, T21>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19, out T20 item20, out T21 item21)
		{
			item1 = value.Item1;
			item2 = value.Item2;
			item3 = value.Item3;
			item4 = value.Item4;
			item5 = value.Item5;
			item6 = value.Item6;
			item7 = value.Item7;
			item8 = value.Rest.Item1;
			item9 = value.Rest.Item2;
			item10 = value.Rest.Item3;
			item11 = value.Rest.Item4;
			item12 = value.Rest.Item5;
			item13 = value.Rest.Item6;
			item14 = value.Rest.Item7;
			item15 = value.Rest.Rest.Item1;
			item16 = value.Rest.Rest.Item2;
			item17 = value.Rest.Rest.Item3;
			item18 = value.Rest.Rest.Item4;
			item19 = value.Rest.Rest.Item5;
			item20 = value.Rest.Rest.Item6;
			item21 = value.Rest.Rest.Item7;
		}

		public static ValueTuple<T1> ToValueTuple<T1>(this Tuple<T1> value)
		{
			return ValueTuple.Create(value.Item1);
		}

		public static (T1, T2) ToValueTuple<T1, T2>(this Tuple<T1, T2> value)
		{
			return ValueTuple.Create(value.Item1, value.Item2);
		}

		public static (T1, T2, T3) ToValueTuple<T1, T2, T3>(this Tuple<T1, T2, T3> value)
		{
			return ValueTuple.Create(value.Item1, value.Item2, value.Item3);
		}

		public static (T1, T2, T3, T4) ToValueTuple<T1, T2, T3, T4>(this Tuple<T1, T2, T3, T4> value)
		{
			return ValueTuple.Create(value.Item1, value.Item2, value.Item3, value.Item4);
		}

		public static (T1, T2, T3, T4, T5) ToValueTuple<T1, T2, T3, T4, T5>(this Tuple<T1, T2, T3, T4, T5> value)
		{
			return ValueTuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5);
		}

		public static (T1, T2, T3, T4, T5, T6) ToValueTuple<T1, T2, T3, T4, T5, T6>(this Tuple<T1, T2, T3, T4, T5, T6> value)
		{
			return ValueTuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6);
		}

		public static (T1, T2, T3, T4, T5, T6, T7) ToValueTuple<T1, T2, T3, T4, T5, T6, T7>(this Tuple<T1, T2, T3, T4, T5, T6, T7> value)
		{
			return ValueTuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7);
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>> value)
		{
			return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, ValueTuple.Create(value.Rest.Item1));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9>> value)
		{
			return CreateLong<T1, T2, T3, T4, T5, T6, T7, (T8, T9)>(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, ValueTuple.Create(value.Rest.Item1, value.Rest.Item2));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10>> value)
		{
			return CreateLong<T1, T2, T3, T4, T5, T6, T7, (T8, T9, T10)>(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11>> value)
		{
			return CreateLong<T1, T2, T3, T4, T5, T6, T7, (T8, T9, T10, T11)>(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12>> value)
		{
			return CreateLong<T1, T2, T3, T4, T5, T6, T7, (T8, T9, T10, T11, T12)>(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13>> value)
		{
			return CreateLong<T1, T2, T3, T4, T5, T6, T7, (T8, T9, T10, T11, T12, T13)>(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14>> value)
		{
			return CreateLong<T1, T2, T3, T4, T5, T6, T7, (T8, T9, T10, T11, T12, T13, T14)>(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, ValueTuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15>>> value)
		{
			return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLong(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, ValueTuple.Create(value.Rest.Rest.Item1)));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16>>> value)
		{
			return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLong<T8, T9, T10, T11, T12, T13, T14, (T15, T16)>(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2)));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17>>> value)
		{
			return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLong<T8, T9, T10, T11, T12, T13, T14, (T15, T16, T17)>(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3)));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18>>> value)
		{
			return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLong<T8, T9, T10, T11, T12, T13, T14, (T15, T16, T17, T18)>(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4)));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19>>> value)
		{
			return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLong<T8, T9, T10, T11, T12, T13, T14, (T15, T16, T17, T18, T19)>(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5)));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20>>> value)
		{
			return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLong<T8, T9, T10, T11, T12, T13, T14, (T15, T16, T17, T18, T19, T20)>(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5, value.Rest.Rest.Item6)));
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20, T21>>> value)
		{
			return CreateLong(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLong<T8, T9, T10, T11, T12, T13, T14, (T15, T16, T17, T18, T19, T20, T21)>(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, ValueTuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5, value.Rest.Rest.Item6, value.Rest.Rest.Item7)));
		}

		public static Tuple<T1> ToTuple<T1>(this ValueTuple<T1> value)
		{
			return Tuple.Create(value.Item1);
		}

		public static Tuple<T1, T2> ToTuple<T1, T2>(this (T1, T2) value)
		{
			return Tuple.Create(value.Item1, value.Item2);
		}

		public static Tuple<T1, T2, T3> ToTuple<T1, T2, T3>(this (T1, T2, T3) value)
		{
			return Tuple.Create(value.Item1, value.Item2, value.Item3);
		}

		public static Tuple<T1, T2, T3, T4> ToTuple<T1, T2, T3, T4>(this (T1, T2, T3, T4) value)
		{
			return Tuple.Create(value.Item1, value.Item2, value.Item3, value.Item4);
		}

		public static Tuple<T1, T2, T3, T4, T5> ToTuple<T1, T2, T3, T4, T5>(this (T1, T2, T3, T4, T5) value)
		{
			return Tuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5);
		}

		public static Tuple<T1, T2, T3, T4, T5, T6> ToTuple<T1, T2, T3, T4, T5, T6>(this (T1, T2, T3, T4, T5, T6) value)
		{
			return Tuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6);
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7> ToTuple<T1, T2, T3, T4, T5, T6, T7>(this (T1, T2, T3, T4, T5, T6, T7) value)
		{
			return Tuple.Create(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7);
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8>(this (T1, T2, T3, T4, T5, T6, T7, T8) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, Tuple.Create(value.Rest.Item1));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, Tuple.Create(value.Rest.Item1, value.Rest.Item2));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, Tuple.Create(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, Tuple.Create(value.Rest.Rest.Item1)));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2)));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3)));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4)));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5)));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5, value.Rest.Rest.Item6)));
		}

		public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15, T16, T17, T18, T19, T20, T21>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) value)
		{
			return CreateLongRef(value.Item1, value.Item2, value.Item3, value.Item4, value.Item5, value.Item6, value.Item7, CreateLongRef(value.Rest.Item1, value.Rest.Item2, value.Rest.Item3, value.Rest.Item4, value.Rest.Item5, value.Rest.Item6, value.Rest.Item7, Tuple.Create(value.Rest.Rest.Item1, value.Rest.Rest.Item2, value.Rest.Rest.Item3, value.Rest.Rest.Item4, value.Rest.Rest.Item5, value.Rest.Rest.Item6, value.Rest.Rest.Item7)));
		}

		private static ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> CreateLong<T1, T2, T3, T4, T5, T6, T7, TRest>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) where TRest : struct
		{
			return new ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>(item1, item2, item3, item4, item5, item6, item7, rest);
		}

		private static Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> CreateLongRef<T1, T2, T3, T4, T5, T6, T7, TRest>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest)
		{
			return new Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>(item1, item2, item3, item4, item5, item6, item7, rest);
		}
	}
	internal interface ITupleInternal
	{
		int Size { get; }

		int GetHashCode(IEqualityComparer comparer);

		string ToStringEnd();
	}
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	public struct ValueTuple : IEquatable<ValueTuple>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable<ValueTuple>, System.ITupleInternal
	{
		int System.ITupleInternal.Size => 0;

		public override bool Equals(object obj)
		{
			return obj is ValueTuple;
		}

		public bool Equals(ValueTuple other)
		{
			return true;
		}

		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			return other is ValueTuple;
		}

		int IComparable.CompareTo(object other)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return 0;
		}

		public int CompareTo(ValueTuple other)
		{
			return 0;
		}

		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return 0;
		}

		public override int GetHashCode()
		{
			return 0;
		}

		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			return 0;
		}

		int System.ITupleInternal.GetHashCode(IEqualityComparer comparer)
		{
			return 0;
		}

		public override string ToString()
		{
			return "()";
		}

		string System.ITupleInternal.ToStringEnd()
		{
			return ")";
		}

		public static ValueTuple Create()
		{
			return default(ValueTuple);
		}

		public static ValueTuple<T1> Create<T1>(T1 item1)
		{
			return new ValueTuple<T1>(item1);
		}

		public static (T1, T2) Create<T1, T2>(T1 item1, T2 item2)
		{
			return (item1, item2);
		}

		public static (T1, T2, T3) Create<T1, T2, T3>(T1 item1, T2 item2, T3 item3)
		{
			return (item1, item2, item3);
		}

		public static (T1, T2, T3, T4) Create<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4)
		{
			return (item1, item2, item3, item4);
		}

		public static (T1, T2, T3, T4, T5) Create<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5)
		{
			return (item1, item2, item3, item4, item5);
		}

		public static (T1, T2, T3, T4, T5, T6) Create<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6)
		{
			return (item1, item2, item3, item4, item5, item6);
		}

		public static (T1, T2, T3, T4, T5, T6, T7) Create<T1, T2, T3, T4, T5, T6, T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7)
		{
			return (item1, item2, item3, item4, item5, item6, item7);
		}

		public static (T1, T2, T3, T4, T5, T6, T7, T8) Create<T1, T2, T3, T4, T5, T6, T7, T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8)
		{
			return new ValueTuple<T1, T2, T3, T4, T5, T6, T7, ValueTuple<T8>>(item1, item2, item3, item4, item5, item6, item7, Create(item8));
		}

		internal static int CombineHashCodes(int h1, int h2)
		{
			return HashHelpers.Combine(HashHelpers.Combine(HashHelpers.RandomSeed, h1), h2);
		}

		internal static int CombineHashCodes(int h1, int h2, int h3)
		{
			return HashHelpers.Combine(CombineHashCodes(h1, h2), h3);
		}

		internal static int CombineHashCodes(int h1, int h2, int h3, int h4)
		{
			return HashHelpers.Combine(CombineHashCodes(h1, h2, h3), h4);
		}

		internal static int CombineHashCodes(int h1, int h2, int h3, int h4, int h5)
		{
			return HashHelpers.Combine(CombineHashCodes(h1, h2, h3, h4), h5);
		}

		internal static int CombineHashCodes(int h1, int h2, int h3, int h4, int h5, int h6)
		{
			return HashHelpers.Combine(CombineHashCodes(h1, h2, h3, h4, h5), h6);
		}

		internal static int CombineHashCodes(int h1, int h2, int h3, int h4, int h5, int h6, int h7)
		{
			return HashHelpers.Combine(CombineHashCodes(h1, h2, h3, h4, h5, h6), h7);
		}

		internal static int CombineHashCodes(int h1, int h2, int h3, int h4, int h5, int h6, int h7, int h8)
		{
			return HashHelpers.Combine(CombineHashCodes(h1, h2, h3, h4, h5, h6, h7), h8);
		}
	}
	public struct ValueTuple<T1> : IEquatable<ValueTuple<T1>>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable<ValueTuple<T1>>, System.ITupleInternal
	{
		private static readonly EqualityComparer<T1> s_t1Comparer = EqualityComparer<T1>.Default;

		public T1 Item1;

		int System.ITupleInternal.Size => 1;

		public ValueTuple(T1 item1)
		{
			Item1 = item1;
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTuple<T1>)
			{
				return Equals((ValueTuple<T1>)obj);
			}
			return false;
		}

		public bool Equals(ValueTuple<T1> other)
		{
			return s_t1Comparer.Equals(Item1, other.Item1);
		}

		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (other == null || !(other is ValueTuple<T1> valueTuple))
			{
				return false;
			}
			return comparer.Equals(Item1, valueTuple.Item1);
		}

		int IComparable.CompareTo(object other)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1> valueTuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return Comparer<T1>.Default.Compare(Item1, valueTuple.Item1);
		}

		public int CompareTo(ValueTuple<T1> other)
		{
			return Comparer<T1>.Default.Compare(Item1, other.Item1);
		}

		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1> valueTuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return comparer.Compare(Item1, valueTuple.Item1);
		}

		public override int GetHashCode()
		{
			return s_t1Comparer.GetHashCode(Item1);
		}

		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			return comparer.GetHashCode(Item1);
		}

		int System.ITupleInternal.GetHashCode(IEqualityComparer comparer)
		{
			return comparer.GetHashCode(Item1);
		}

		public override string ToString()
		{
			return "(" + Item1?.ToString() + ")";
		}

		string System.ITupleInternal.ToStringEnd()
		{
			return Item1?.ToString() + ")";
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public struct ValueTuple<T1, T2> : IEquatable<(T1, T2)>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable<(T1, T2)>, System.ITupleInternal
	{
		private static readonly EqualityComparer<T1> s_t1Comparer = EqualityComparer<T1>.Default;

		private static readonly EqualityComparer<T2> s_t2Comparer = EqualityComparer<T2>.Default;

		public T1 Item1;

		public T2 Item2;

		int System.ITupleInternal.Size => 2;

		public ValueTuple(T1 item1, T2 item2)
		{
			Item1 = item1;
			Item2 = item2;
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTuple<T1, T2>)
			{
				return Equals(((T1, T2))obj);
			}
			return false;
		}

		public bool Equals((T1, T2) other)
		{
			if (s_t1Comparer.Equals(Item1, other.Item1))
			{
				return s_t2Comparer.Equals(Item2, other.Item2);
			}
			return false;
		}

		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (other == null || !(other is (T1, T2) tuple))
			{
				return false;
			}
			if (comparer.Equals(Item1, tuple.Item1))
			{
				return comparer.Equals(Item2, tuple.Item2);
			}
			return false;
		}

		int IComparable.CompareTo(object other)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1, T2>))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return CompareTo(((T1, T2))other);
		}

		public int CompareTo((T1, T2) other)
		{
			int num = Comparer<T1>.Default.Compare(Item1, other.Item1);
			if (num != 0)
			{
				return num;
			}
			return Comparer<T2>.Default.Compare(Item2, other.Item2);
		}

		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is (T1, T2) tuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			int num = comparer.Compare(Item1, tuple.Item1);
			if (num != 0)
			{
				return num;
			}
			return comparer.Compare(Item2, tuple.Item2);
		}

		public override int GetHashCode()
		{
			return ValueTuple.CombineHashCodes(s_t1Comparer.GetHashCode(Item1), s_t2Comparer.GetHashCode(Item2));
		}

		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		private int GetHashCodeCore(IEqualityComparer comparer)
		{
			return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2));
		}

		int System.ITupleInternal.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		public override string ToString()
		{
			return "(" + Item1?.ToString() + ", " + Item2?.ToString() + ")";
		}

		string System.ITupleInternal.ToStringEnd()
		{
			return Item1?.ToString() + ", " + Item2?.ToString() + ")";
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public struct ValueTuple<T1, T2, T3> : IEquatable<(T1, T2, T3)>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable<(T1, T2, T3)>, System.ITupleInternal
	{
		private static readonly EqualityComparer<T1> s_t1Comparer = EqualityComparer<T1>.Default;

		private static readonly EqualityComparer<T2> s_t2Comparer = EqualityComparer<T2>.Default;

		private static readonly EqualityComparer<T3> s_t3Comparer = EqualityComparer<T3>.Default;

		public T1 Item1;

		public T2 Item2;

		public T3 Item3;

		int System.ITupleInternal.Size => 3;

		public ValueTuple(T1 item1, T2 item2, T3 item3)
		{
			Item1 = item1;
			Item2 = item2;
			Item3 = item3;
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTuple<T1, T2, T3>)
			{
				return Equals(((T1, T2, T3))obj);
			}
			return false;
		}

		public bool Equals((T1, T2, T3) other)
		{
			if (s_t1Comparer.Equals(Item1, other.Item1) && s_t2Comparer.Equals(Item2, other.Item2))
			{
				return s_t3Comparer.Equals(Item3, other.Item3);
			}
			return false;
		}

		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (other == null || !(other is (T1, T2, T3) tuple))
			{
				return false;
			}
			if (comparer.Equals(Item1, tuple.Item1) && comparer.Equals(Item2, tuple.Item2))
			{
				return comparer.Equals(Item3, tuple.Item3);
			}
			return false;
		}

		int IComparable.CompareTo(object other)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1, T2, T3>))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return CompareTo(((T1, T2, T3))other);
		}

		public int CompareTo((T1, T2, T3) other)
		{
			int num = Comparer<T1>.Default.Compare(Item1, other.Item1);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T2>.Default.Compare(Item2, other.Item2);
			if (num != 0)
			{
				return num;
			}
			return Comparer<T3>.Default.Compare(Item3, other.Item3);
		}

		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is (T1, T2, T3) tuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			int num = comparer.Compare(Item1, tuple.Item1);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item2, tuple.Item2);
			if (num != 0)
			{
				return num;
			}
			return comparer.Compare(Item3, tuple.Item3);
		}

		public override int GetHashCode()
		{
			return ValueTuple.CombineHashCodes(s_t1Comparer.GetHashCode(Item1), s_t2Comparer.GetHashCode(Item2), s_t3Comparer.GetHashCode(Item3));
		}

		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		private int GetHashCodeCore(IEqualityComparer comparer)
		{
			return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2), comparer.GetHashCode(Item3));
		}

		int System.ITupleInternal.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		public override string ToString()
		{
			return "(" + Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ")";
		}

		string System.ITupleInternal.ToStringEnd()
		{
			return Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ")";
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public struct ValueTuple<T1, T2, T3, T4> : IEquatable<(T1, T2, T3, T4)>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable<(T1, T2, T3, T4)>, System.ITupleInternal
	{
		private static readonly EqualityComparer<T1> s_t1Comparer = EqualityComparer<T1>.Default;

		private static readonly EqualityComparer<T2> s_t2Comparer = EqualityComparer<T2>.Default;

		private static readonly EqualityComparer<T3> s_t3Comparer = EqualityComparer<T3>.Default;

		private static readonly EqualityComparer<T4> s_t4Comparer = EqualityComparer<T4>.Default;

		public T1 Item1;

		public T2 Item2;

		public T3 Item3;

		public T4 Item4;

		int System.ITupleInternal.Size => 4;

		public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4)
		{
			Item1 = item1;
			Item2 = item2;
			Item3 = item3;
			Item4 = item4;
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTuple<T1, T2, T3, T4>)
			{
				return Equals(((T1, T2, T3, T4))obj);
			}
			return false;
		}

		public bool Equals((T1, T2, T3, T4) other)
		{
			if (s_t1Comparer.Equals(Item1, other.Item1) && s_t2Comparer.Equals(Item2, other.Item2) && s_t3Comparer.Equals(Item3, other.Item3))
			{
				return s_t4Comparer.Equals(Item4, other.Item4);
			}
			return false;
		}

		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (other == null || !(other is (T1, T2, T3, T4) tuple))
			{
				return false;
			}
			if (comparer.Equals(Item1, tuple.Item1) && comparer.Equals(Item2, tuple.Item2) && comparer.Equals(Item3, tuple.Item3))
			{
				return comparer.Equals(Item4, tuple.Item4);
			}
			return false;
		}

		int IComparable.CompareTo(object other)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1, T2, T3, T4>))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return CompareTo(((T1, T2, T3, T4))other);
		}

		public int CompareTo((T1, T2, T3, T4) other)
		{
			int num = Comparer<T1>.Default.Compare(Item1, other.Item1);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T2>.Default.Compare(Item2, other.Item2);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T3>.Default.Compare(Item3, other.Item3);
			if (num != 0)
			{
				return num;
			}
			return Comparer<T4>.Default.Compare(Item4, other.Item4);
		}

		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is (T1, T2, T3, T4) tuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			int num = comparer.Compare(Item1, tuple.Item1);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item2, tuple.Item2);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item3, tuple.Item3);
			if (num != 0)
			{
				return num;
			}
			return comparer.Compare(Item4, tuple.Item4);
		}

		public override int GetHashCode()
		{
			return ValueTuple.CombineHashCodes(s_t1Comparer.GetHashCode(Item1), s_t2Comparer.GetHashCode(Item2), s_t3Comparer.GetHashCode(Item3), s_t4Comparer.GetHashCode(Item4));
		}

		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		private int GetHashCodeCore(IEqualityComparer comparer)
		{
			return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4));
		}

		int System.ITupleInternal.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		public override string ToString()
		{
			return "(" + Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ", " + Item4?.ToString() + ")";
		}

		string System.ITupleInternal.ToStringEnd()
		{
			return Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ", " + Item4?.ToString() + ")";
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public struct ValueTuple<T1, T2, T3, T4, T5> : IEquatable<(T1, T2, T3, T4, T5)>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable<(T1, T2, T3, T4, T5)>, System.ITupleInternal
	{
		private static readonly EqualityComparer<T1> s_t1Comparer = EqualityComparer<T1>.Default;

		private static readonly EqualityComparer<T2> s_t2Comparer = EqualityComparer<T2>.Default;

		private static readonly EqualityComparer<T3> s_t3Comparer = EqualityComparer<T3>.Default;

		private static readonly EqualityComparer<T4> s_t4Comparer = EqualityComparer<T4>.Default;

		private static readonly EqualityComparer<T5> s_t5Comparer = EqualityComparer<T5>.Default;

		public T1 Item1;

		public T2 Item2;

		public T3 Item3;

		public T4 Item4;

		public T5 Item5;

		int System.ITupleInternal.Size => 5;

		public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5)
		{
			Item1 = item1;
			Item2 = item2;
			Item3 = item3;
			Item4 = item4;
			Item5 = item5;
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTuple<T1, T2, T3, T4, T5>)
			{
				return Equals(((T1, T2, T3, T4, T5))obj);
			}
			return false;
		}

		public bool Equals((T1, T2, T3, T4, T5) other)
		{
			if (s_t1Comparer.Equals(Item1, other.Item1) && s_t2Comparer.Equals(Item2, other.Item2) && s_t3Comparer.Equals(Item3, other.Item3) && s_t4Comparer.Equals(Item4, other.Item4))
			{
				return s_t5Comparer.Equals(Item5, other.Item5);
			}
			return false;
		}

		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (other == null || !(other is (T1, T2, T3, T4, T5) tuple))
			{
				return false;
			}
			if (comparer.Equals(Item1, tuple.Item1) && comparer.Equals(Item2, tuple.Item2) && comparer.Equals(Item3, tuple.Item3) && comparer.Equals(Item4, tuple.Item4))
			{
				return comparer.Equals(Item5, tuple.Item5);
			}
			return false;
		}

		int IComparable.CompareTo(object other)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1, T2, T3, T4, T5>))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return CompareTo(((T1, T2, T3, T4, T5))other);
		}

		public int CompareTo((T1, T2, T3, T4, T5) other)
		{
			int num = Comparer<T1>.Default.Compare(Item1, other.Item1);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T2>.Default.Compare(Item2, other.Item2);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T3>.Default.Compare(Item3, other.Item3);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T4>.Default.Compare(Item4, other.Item4);
			if (num != 0)
			{
				return num;
			}
			return Comparer<T5>.Default.Compare(Item5, other.Item5);
		}

		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is (T1, T2, T3, T4, T5) tuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			int num = comparer.Compare(Item1, tuple.Item1);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item2, tuple.Item2);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item3, tuple.Item3);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item4, tuple.Item4);
			if (num != 0)
			{
				return num;
			}
			return comparer.Compare(Item5, tuple.Item5);
		}

		public override int GetHashCode()
		{
			return ValueTuple.CombineHashCodes(s_t1Comparer.GetHashCode(Item1), s_t2Comparer.GetHashCode(Item2), s_t3Comparer.GetHashCode(Item3), s_t4Comparer.GetHashCode(Item4), s_t5Comparer.GetHashCode(Item5));
		}

		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		private int GetHashCodeCore(IEqualityComparer comparer)
		{
			return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5));
		}

		int System.ITupleInternal.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		public override string ToString()
		{
			return "(" + Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ", " + Item4?.ToString() + ", " + Item5?.ToString() + ")";
		}

		string System.ITupleInternal.ToStringEnd()
		{
			return Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ", " + Item4?.ToString() + ", " + Item5?.ToString() + ")";
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public struct ValueTuple<T1, T2, T3, T4, T5, T6> : IEquatable<(T1, T2, T3, T4, T5, T6)>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable<(T1, T2, T3, T4, T5, T6)>, System.ITupleInternal
	{
		private static readonly EqualityComparer<T1> s_t1Comparer = EqualityComparer<T1>.Default;

		private static readonly EqualityComparer<T2> s_t2Comparer = EqualityComparer<T2>.Default;

		private static readonly EqualityComparer<T3> s_t3Comparer = EqualityComparer<T3>.Default;

		private static readonly EqualityComparer<T4> s_t4Comparer = EqualityComparer<T4>.Default;

		private static readonly EqualityComparer<T5> s_t5Comparer = EqualityComparer<T5>.Default;

		private static readonly EqualityComparer<T6> s_t6Comparer = EqualityComparer<T6>.Default;

		public T1 Item1;

		public T2 Item2;

		public T3 Item3;

		public T4 Item4;

		public T5 Item5;

		public T6 Item6;

		int System.ITupleInternal.Size => 6;

		public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6)
		{
			Item1 = item1;
			Item2 = item2;
			Item3 = item3;
			Item4 = item4;
			Item5 = item5;
			Item6 = item6;
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTuple<T1, T2, T3, T4, T5, T6>)
			{
				return Equals(((T1, T2, T3, T4, T5, T6))obj);
			}
			return false;
		}

		public bool Equals((T1, T2, T3, T4, T5, T6) other)
		{
			if (s_t1Comparer.Equals(Item1, other.Item1) && s_t2Comparer.Equals(Item2, other.Item2) && s_t3Comparer.Equals(Item3, other.Item3) && s_t4Comparer.Equals(Item4, other.Item4) && s_t5Comparer.Equals(Item5, other.Item5))
			{
				return s_t6Comparer.Equals(Item6, other.Item6);
			}
			return false;
		}

		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (other == null || !(other is (T1, T2, T3, T4, T5, T6) tuple))
			{
				return false;
			}
			if (comparer.Equals(Item1, tuple.Item1) && comparer.Equals(Item2, tuple.Item2) && comparer.Equals(Item3, tuple.Item3) && comparer.Equals(Item4, tuple.Item4) && comparer.Equals(Item5, tuple.Item5))
			{
				return comparer.Equals(Item6, tuple.Item6);
			}
			return false;
		}

		int IComparable.CompareTo(object other)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1, T2, T3, T4, T5, T6>))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return CompareTo(((T1, T2, T3, T4, T5, T6))other);
		}

		public int CompareTo((T1, T2, T3, T4, T5, T6) other)
		{
			int num = Comparer<T1>.Default.Compare(Item1, other.Item1);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T2>.Default.Compare(Item2, other.Item2);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T3>.Default.Compare(Item3, other.Item3);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T4>.Default.Compare(Item4, other.Item4);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T5>.Default.Compare(Item5, other.Item5);
			if (num != 0)
			{
				return num;
			}
			return Comparer<T6>.Default.Compare(Item6, other.Item6);
		}

		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is (T1, T2, T3, T4, T5, T6) tuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			int num = comparer.Compare(Item1, tuple.Item1);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item2, tuple.Item2);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item3, tuple.Item3);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item4, tuple.Item4);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item5, tuple.Item5);
			if (num != 0)
			{
				return num;
			}
			return comparer.Compare(Item6, tuple.Item6);
		}

		public override int GetHashCode()
		{
			return ValueTuple.CombineHashCodes(s_t1Comparer.GetHashCode(Item1), s_t2Comparer.GetHashCode(Item2), s_t3Comparer.GetHashCode(Item3), s_t4Comparer.GetHashCode(Item4), s_t5Comparer.GetHashCode(Item5), s_t6Comparer.GetHashCode(Item6));
		}

		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		private int GetHashCodeCore(IEqualityComparer comparer)
		{
			return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6));
		}

		int System.ITupleInternal.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		public override string ToString()
		{
			return "(" + Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ", " + Item4?.ToString() + ", " + Item5?.ToString() + ", " + Item6?.ToString() + ")";
		}

		string System.ITupleInternal.ToStringEnd()
		{
			return Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ", " + Item4?.ToString() + ", " + Item5?.ToString() + ", " + Item6?.ToString() + ")";
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public struct ValueTuple<T1, T2, T3, T4, T5, T6, T7> : IEquatable<(T1, T2, T3, T4, T5, T6, T7)>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable<(T1, T2, T3, T4, T5, T6, T7)>, System.ITupleInternal
	{
		private static readonly EqualityComparer<T1> s_t1Comparer = EqualityComparer<T1>.Default;

		private static readonly EqualityComparer<T2> s_t2Comparer = EqualityComparer<T2>.Default;

		private static readonly EqualityComparer<T3> s_t3Comparer = EqualityComparer<T3>.Default;

		private static readonly EqualityComparer<T4> s_t4Comparer = EqualityComparer<T4>.Default;

		private static readonly EqualityComparer<T5> s_t5Comparer = EqualityComparer<T5>.Default;

		private static readonly EqualityComparer<T6> s_t6Comparer = EqualityComparer<T6>.Default;

		private static readonly EqualityComparer<T7> s_t7Comparer = EqualityComparer<T7>.Default;

		public T1 Item1;

		public T2 Item2;

		public T3 Item3;

		public T4 Item4;

		public T5 Item5;

		public T6 Item6;

		public T7 Item7;

		int System.ITupleInternal.Size => 7;

		public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7)
		{
			Item1 = item1;
			Item2 = item2;
			Item3 = item3;
			Item4 = item4;
			Item5 = item5;
			Item6 = item6;
			Item7 = item7;
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTuple<T1, T2, T3, T4, T5, T6, T7>)
			{
				return Equals(((T1, T2, T3, T4, T5, T6, T7))obj);
			}
			return false;
		}

		public bool Equals((T1, T2, T3, T4, T5, T6, T7) other)
		{
			if (s_t1Comparer.Equals(Item1, other.Item1) && s_t2Comparer.Equals(Item2, other.Item2) && s_t3Comparer.Equals(Item3, other.Item3) && s_t4Comparer.Equals(Item4, other.Item4) && s_t5Comparer.Equals(Item5, other.Item5) && s_t6Comparer.Equals(Item6, other.Item6))
			{
				return s_t7Comparer.Equals(Item7, other.Item7);
			}
			return false;
		}

		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (other == null || !(other is (T1, T2, T3, T4, T5, T6, T7) tuple))
			{
				return false;
			}
			if (comparer.Equals(Item1, tuple.Item1) && comparer.Equals(Item2, tuple.Item2) && comparer.Equals(Item3, tuple.Item3) && comparer.Equals(Item4, tuple.Item4) && comparer.Equals(Item5, tuple.Item5) && comparer.Equals(Item6, tuple.Item6))
			{
				return comparer.Equals(Item7, tuple.Item7);
			}
			return false;
		}

		int IComparable.CompareTo(object other)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1, T2, T3, T4, T5, T6, T7>))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return CompareTo(((T1, T2, T3, T4, T5, T6, T7))other);
		}

		public int CompareTo((T1, T2, T3, T4, T5, T6, T7) other)
		{
			int num = Comparer<T1>.Default.Compare(Item1, other.Item1);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T2>.Default.Compare(Item2, other.Item2);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T3>.Default.Compare(Item3, other.Item3);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T4>.Default.Compare(Item4, other.Item4);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T5>.Default.Compare(Item5, other.Item5);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T6>.Default.Compare(Item6, other.Item6);
			if (num != 0)
			{
				return num;
			}
			return Comparer<T7>.Default.Compare(Item7, other.Item7);
		}

		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is (T1, T2, T3, T4, T5, T6, T7) tuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			int num = comparer.Compare(Item1, tuple.Item1);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item2, tuple.Item2);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item3, tuple.Item3);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item4, tuple.Item4);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item5, tuple.Item5);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item6, tuple.Item6);
			if (num != 0)
			{
				return num;
			}
			return comparer.Compare(Item7, tuple.Item7);
		}

		public override int GetHashCode()
		{
			return ValueTuple.CombineHashCodes(s_t1Comparer.GetHashCode(Item1), s_t2Comparer.GetHashCode(Item2), s_t3Comparer.GetHashCode(Item3), s_t4Comparer.GetHashCode(Item4), s_t5Comparer.GetHashCode(Item5), s_t6Comparer.GetHashCode(Item6), s_t7Comparer.GetHashCode(Item7));
		}

		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		private int GetHashCodeCore(IEqualityComparer comparer)
		{
			return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7));
		}

		int System.ITupleInternal.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		public override string ToString()
		{
			return "(" + Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ", " + Item4?.ToString() + ", " + Item5?.ToString() + ", " + Item6?.ToString() + ", " + Item7?.ToString() + ")";
		}

		string System.ITupleInternal.ToStringEnd()
		{
			return Item1?.ToString() + ", " + Item2?.ToString() + ", " + Item3?.ToString() + ", " + Item4?.ToString() + ", " + Item5?.ToString() + ", " + Item6?.ToString() + ", " + Item7?.ToString() + ")";
		}
	}
	[StructLayout(LayoutKind.Auto)]
	public struct ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> : IEquatable<ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable<ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>>, System.ITupleInternal where TRest : struct
	{
		private static readonly EqualityComparer<T1> s_t1Comparer = EqualityComparer<T1>.Default;

		private static readonly EqualityComparer<T2> s_t2Comparer = EqualityComparer<T2>.Default;

		private static readonly EqualityComparer<T3> s_t3Comparer = EqualityComparer<T3>.Default;

		private static readonly EqualityComparer<T4> s_t4Comparer = EqualityComparer<T4>.Default;

		private static readonly EqualityComparer<T5> s_t5Comparer = EqualityComparer<T5>.Default;

		private static readonly EqualityComparer<T6> s_t6Comparer = EqualityComparer<T6>.Default;

		private static readonly EqualityComparer<T7> s_t7Comparer = EqualityComparer<T7>.Default;

		private static readonly EqualityComparer<TRest> s_tRestComparer = EqualityComparer<TRest>.Default;

		public T1 Item1;

		public T2 Item2;

		public T3 Item3;

		public T4 Item4;

		public T5 Item5;

		public T6 Item6;

		public T7 Item7;

		public TRest Rest;

		int System.ITupleInternal.Size
		{
			get
			{
				if ((object)Rest is System.ITupleInternal tupleInternal)
				{
					return 7 + tupleInternal.Size;
				}
				return 8;
			}
		}

		public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest)
		{
			if (!(rest is System.ITupleInternal))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleLastArgumentNotAValueTuple);
			}
			Item1 = item1;
			Item2 = item2;
			Item3 = item3;
			Item4 = item4;
			Item5 = item5;
			Item6 = item6;
			Item7 = item7;
			Rest = rest;
		}

		public override bool Equals(object obj)
		{
			if (obj is ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>)
			{
				return Equals((ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>)obj);
			}
			return false;
		}

		public bool Equals(ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> other)
		{
			if (s_t1Comparer.Equals(Item1, other.Item1) && s_t2Comparer.Equals(Item2, other.Item2) && s_t3Comparer.Equals(Item3, other.Item3) && s_t4Comparer.Equals(Item4, other.Item4) && s_t5Comparer.Equals(Item5, other.Item5) && s_t6Comparer.Equals(Item6, other.Item6) && s_t7Comparer.Equals(Item7, other.Item7))
			{
				return s_tRestComparer.Equals(Rest, other.Rest);
			}
			return false;
		}

		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (other == null || !(other is ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> valueTuple))
			{
				return false;
			}
			if (comparer.Equals(Item1, valueTuple.Item1) && comparer.Equals(Item2, valueTuple.Item2) && comparer.Equals(Item3, valueTuple.Item3) && comparer.Equals(Item4, valueTuple.Item4) && comparer.Equals(Item5, valueTuple.Item5) && comparer.Equals(Item6, valueTuple.Item6) && comparer.Equals(Item7, valueTuple.Item7))
			{
				return comparer.Equals(Rest, valueTuple.Rest);
			}
			return false;
		}

		int IComparable.CompareTo(object other)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			return CompareTo((ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>)other);
		}

		public int CompareTo(ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> other)
		{
			int num = Comparer<T1>.Default.Compare(Item1, other.Item1);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T2>.Default.Compare(Item2, other.Item2);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T3>.Default.Compare(Item3, other.Item3);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T4>.Default.Compare(Item4, other.Item4);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T5>.Default.Compare(Item5, other.Item5);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T6>.Default.Compare(Item6, other.Item6);
			if (num != 0)
			{
				return num;
			}
			num = Comparer<T7>.Default.Compare(Item7, other.Item7);
			if (num != 0)
			{
				return num;
			}
			return Comparer<TRest>.Default.Compare(Rest, other.Rest);
		}

		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> valueTuple))
			{
				throw new ArgumentException(System.SR.ArgumentException_ValueTupleIncorrectType, "other");
			}
			int num = comparer.Compare(Item1, valueTuple.Item1);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item2, valueTuple.Item2);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item3, valueTuple.Item3);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item4, valueTuple.Item4);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item5, valueTuple.Item5);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item6, valueTuple.Item6);
			if (num != 0)
			{
				return num;
			}
			num = comparer.Compare(Item7, valueTuple.Item7);
			if (num != 0)
			{
				return num;
			}
			return comparer.Compare(Rest, valueTuple.Rest);
		}

		public override int GetHashCode()
		{
			if (!((object)Rest is System.ITupleInternal tupleInternal))
			{
				return ValueTuple.CombineHashCodes(s_t1Comparer.GetHashCode(Item1), s_t2Comparer.GetHashCode(Item2), s_t3Comparer.GetHashCode(Item3), s_t4Comparer.GetHashCode(Item4), s_t5Comparer.GetHashCode(Item5), s_t6Comparer.GetHashCode(Item6), s_t7Comparer.GetHashCode(Item7));
			}
			int size = tupleInternal.Size;
			if (size >= 8)
			{
				return tupleInternal.GetHashCode();
			}
			switch (8 - size)
			{
			case 1:
				return ValueTuple.CombineHashCodes(s_t7Comparer.GetHashCode(Item7), tupleInternal.GetHashCode());
			case 2:
				return ValueTuple.CombineHashCodes(s_t6Comparer.GetHashCode(Item6), s_t7Comparer.GetHashCode(Item7), tupleInternal.GetHashCode());
			case 3:
				return ValueTuple.CombineHashCodes(s_t5Comparer.GetHashCode(Item5), s_t6Comparer.GetHashCode(Item6), s_t7Comparer.GetHashCode(Item7), tupleInternal.GetHashCode());
			case 4:
				return ValueTuple.CombineHashCodes(s_t4Comparer.GetHashCode(Item4), s_t5Comparer.GetHashCode(Item5), s_t6Comparer.GetHashCode(Item6), s_t7Comparer.GetHashCode(Item7), tupleInternal.GetHashCode());
			case 5:
				return ValueTuple.CombineHashCodes(s_t3Comparer.GetHashCode(Item3), s_t4Comparer.GetHashCode(Item4), s_t5Comparer.GetHashCode(Item5), s_t6Comparer.GetHashCode(Item6), s_t7Comparer.GetHashCode(Item7), tupleInternal.GetHashCode());
			case 6:
				return ValueTuple.CombineHashCodes(s_t2Comparer.GetHashCode(Item2), s_t3Comparer.GetHashCode(Item3), s_t4Comparer.GetHashCode(Item4), s_t5Comparer.GetHashCode(Item5), s_t6Comparer.GetHashCode(Item6), s_t7Comparer.GetHashCode(Item7), tupleInternal.GetHashCode());
			case 7:
			case 8:
				return ValueTuple.CombineHashCodes(s_t1Comparer.GetHashCode(Item1), s_t2Comparer.GetHashCode(Item2), s_t3Comparer.GetHashCode(Item3), s_t4Comparer.GetHashCode(Item4), s_t5Comparer.GetHashCode(Item5), s_t6Comparer.GetHashCode(Item6), s_t7Comparer.GetHashCode(Item7), tupleInternal.GetHashCode());
			default:
				return -1;
			}
		}

		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		private int GetHashCodeCore(IEqualityComparer comparer)
		{
			if (!((object)Rest is System.ITupleInternal tupleInternal))
			{
				return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7));
			}
			int size = tupleInternal.Size;
			if (size >= 8)
			{
				return tupleInternal.GetHashCode(comparer);
			}
			switch (8 - size)
			{
			case 1:
				return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item7), tupleInternal.GetHashCode(comparer));
			case 2:
				return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), tupleInternal.GetHashCode(comparer));
			case 3:
				return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), tupleInternal.GetHashCode(comparer));
			case 4:
				return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), tupleInternal.GetHashCode(comparer));
			case 5:
				return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), tupleInternal.GetHashCode(comparer));
			case 6:
				return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), tupleInternal.GetHashCode(comparer));
			case 7:
			case 8:
				return ValueTuple.CombineHashCodes(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), tupleInternal.GetHashCode(comparer));
			default:
				return -1;
			}
		}

		int System.ITupleInternal.GetHashCode(IEqualityComparer comparer)
		{
			return GetHashCodeCore(comparer);
		}

		public override string ToString()
		{
			string[] obj;
			T1 val;
			object obj2;
			if (!((object)Rest is System.ITupleInternal tupleInternal))
			{
				obj = new string[17]
				{
					"(", null, null, null, null, null, null, null, null, null,
					null, null, null, null, null, null, null
				};
				ref T1 reference = ref Item1;
				val = default(T1);
				if (val == null)
				{
					val = reference;
					reference = ref val;
					if (val == null)
					{
						obj2 = null;
						goto IL_005d;
					}
				}
				obj2 = reference.ToString();
				goto IL_005d;
			}
			string[] obj3 = new string[16]
			{
				"(", null, null, null, null, null, null, null, null, null,
				null, null, null, null, null, null
			};
			ref T1 reference2 = ref Item1;
			val = default(T1);
			object obj4;
			if (val == null)
			{
				val = reference2;
				reference2 = ref val;
				if (val == null)
				{
					obj4 = null;
					goto IL_0262;
				}
			}
			obj4 = reference2.ToString();
			goto IL_0262;
			IL_02e2:
			object obj5;
			obj3[5] = (string)obj5;
			obj3[6] = ", ";
			ref T4 reference3 = ref Item4;
			T4 val2 = default(T4);
			object obj6;
			if (val2 == null)
			{
				val2 = reference3;
				reference3 = ref val2;
				if (val2 == null)
				{
					obj6 = null;
					goto IL_0325;
				}
			}
			obj6 = reference3.ToString();
			goto IL_0325;
			IL_03f3:
			object obj7;
			obj3[13] = (string)obj7;
			obj3[14] = ", ";
			obj3[15] = tupleInternal.ToStringEnd();
			return string.Concat(obj3);
			IL_03ae:
			object obj8;
			obj3[11] = (string)obj8;
			obj3[12] = ", ";
			ref T7 reference4 = ref Item7;
			T7 val3 = default(T7);
			if (val3 == null)
			{
				val3 = reference4;
				reference4 = ref val3;
				if (val3 == null)
				{
					obj7 = null;
					goto IL_03f3;
				}
			}
			obj7 = reference4.ToString();
			goto IL_03f3;
			IL_0120:
			object obj9;
			obj[7] = (string)obj9;
			obj[8] = ", ";
			ref T5 reference5 = ref Item5;
			T5 val4 = default(T5);
			object obj10;
			if (val4 == null)
			{
				val4 = reference5;
				reference5 = ref val4;
				if (val4 == null)
				{
					obj10 = null;
					goto IL_0164;
				}
			}
			obj10 = reference5.ToString();
			goto IL_0164;
			IL_005d:
			obj[1] = (string)obj2;
			obj[2] = ", ";
			ref T2 reference6 = ref Item2;
			T2 val5 = default(T2);
			object obj11;
			if (val5 == null)
			{
				val5 = reference6;
				reference6 = ref val5;
				if (val5 == null)
				{
					obj11 = null;
					goto IL_009d;
				}
			}
			obj11 = reference6.ToString();
			goto IL_009d;
			IL_0164:
			obj[9] = (string)obj10;
			obj[10] = ", ";
			ref T6 reference7 = ref Item6;
			T6 val6 = default(T6);
			object obj12;
			if (val6 == null)
			{
				val6 = reference7;
				reference7 = ref val6;
				if (val6 == null)
				{
					obj12 = null;
					goto IL_01a9;
				}
			}
			obj12 = reference7.ToString();
			goto IL_01a9;
			IL_02a2:
			object obj13;
			obj3[3] = (string)obj13;
			obj3[4] = ", ";
			ref T3 reference8 = ref Item3;
			T3 val7 = default(T3);
			if (val7 == null)
			{
				val7 = reference8;
				reference8 = ref val7;
				if (val7 == null)
				{
					obj5 = null;
					goto IL_02e2;
				}
			}
			obj5 = reference8.ToString();
			goto IL_02e2;
			IL_01ee:
			object obj14;
			obj[13] = (string)obj14;
			obj[14] = ", ";
			obj[15] = Rest.ToString();
			obj[16] = ")";
			return string.Concat(obj);
			IL_009d:
			obj[3] = (string)obj11;
			obj[4] = ", ";
			ref T3 reference9 = ref Item3;
			val7 = default(T3);
			object obj15;
			if (val7 == null)
			{
				val7 = reference9;
				reference9 = ref val7;
				if (val7 == null)
				{
					obj15 = null;
					goto IL_00dd;
				}
			}
			obj15 = reference9.ToString();
			goto IL_00dd;
			IL_0325:
			obj3[7] = (string)obj6;
			obj3[8] = ", ";
			ref T5 reference10 = ref Item5;
			val4 = default(T5);
			object obj16;
			if (val4 == null)
			{
				val4 = reference10;
				reference10 = ref val4;
				if (val4 == null)
				{
					obj16 = null;
					goto IL_0369;
				}
			}
			obj16 = reference10.ToString();
			goto IL_0369;
			IL_01a9:
			obj[11] = (string)obj12;
			obj[12] = ", ";
			ref T7 reference11 = ref Item7;
			val3 = default(T7);
			if (val3 == null)
			{
				val3 = reference11;
				reference11 = ref val3;
				if (val3 == null)
				{
					obj14 = null;
					goto IL_01ee;
				}
			}
			obj14 = reference11.ToString();
			goto IL_01ee;
			IL_0262:
			obj3[1] = (string)obj4;
			obj3[2] = ", ";
			ref T2 reference12 = ref Item2;
			val5 = default(T2);
			if (val5 == null)
			{
				val5 = reference12;
				reference12 = ref val5;
				if (val5 == null)
				{
					obj13 = null;
					goto IL_02a2;
				}
			}
			obj13 = reference12.ToString();
			goto IL_02a2;
			IL_00dd:
			obj[5] = (string)obj15;
			obj[6] = ", ";
			ref T4 reference13 = ref Item4;
			val2 = default(T4);
			if (val2 == null)
			{
				val2 = reference13;
				reference13 = ref val2;
				if (val2 == null)
				{
					obj9 = null;
					goto IL_0120;
				}
			}
			obj9 = reference13.ToString();
			goto IL_0120;
			IL_0369:
			obj3[9] = (string)obj16;
			obj3[10] = ", ";
			ref T6 reference14 = ref Item6;
			val6 = default(T6);
			if (val6 == null)
			{
				val6 = reference14;
				reference14 = ref val6;
				if (val6 == null)
				{
					obj8 = null;
					goto IL_03ae;
				}
			}
			obj8 = reference14.ToString();
			goto IL_03ae;
		}

		string System.ITupleInternal.ToStringEnd()
		{
			string[] array;
			T1 val;
			object obj;
			if (!((object)Rest is System.ITupleInternal tupleInternal))
			{
				array = new string[16];
				ref T1 reference = ref Item1;
				val = default(T1);
				if (val == null)
				{
					val = reference;
					reference = ref val;
					if (val == null)
					{
						obj = null;
						goto IL_0055;
					}
				}
				obj = reference.ToString();
				goto IL_0055;
			}
			string[] array2 = new string[15];
			ref T1 reference2 = ref Item1;
			val = default(T1);
			object obj2;
			if (val == null)
			{
				val = reference2;
				reference2 = ref val;
				if (val == null)
				{
					obj2 = null;
					goto IL_0251;
				}
			}
			obj2 = reference2.ToString();
			goto IL_0251;
			IL_02d1:
			object obj3;
			array2[4] = (string)obj3;
			array2[5] = ", ";
			ref T4 reference3 = ref Item4;
			T4 val2 = default(T4);
			object obj4;
			if (val2 == null)
			{
				val2 = reference3;
				reference3 = ref val2;
				if (val2 == null)
				{
					obj4 = null;
					goto IL_0314;
				}
			}
			obj4 = reference3.ToString();
			goto IL_0314;
			IL_03e1:
			object obj5;
			array2[12] = (string)obj5;
			array2[13] = ", ";
			array2[14] = tupleInternal.ToStringEnd();
			return string.Concat(array2);
			IL_039c:
			object obj6;
			array2[10] = (string)obj6;
			array2[11] = ", ";
			ref T7 reference4 = ref Item7;
			T7 val3 = default(T7);
			if (val3 == null)
			{
				val3 = reference4;
				reference4 = ref val3;
				if (val3 == null)
				{
					obj5 = null;
					goto IL_03e1;
				}
			}
			obj5 = reference4.ToString();
			goto IL_03e1;
			IL_0118:
			object obj7;
			array[6] = (string)obj7;
			array[7] = ", ";
			ref T5 reference5 = ref Item5;
			T5 val4 = default(T5);
			object obj8;
			if (val4 == null)
			{
				val4 = reference5;
				reference5 = ref val4;
				if (val4 == null)
				{
					obj8 = null;
					goto IL_015b;
				}
			}
			obj8 = reference5.ToString();
			goto IL_015b;
			IL_0055:
			array[0] = (string)obj;
			array[1] = ", ";
			ref T2 reference6 = ref Item2;
			T2 val5 = default(T2);
			object obj9;
			if (val5 == null)
			{
				val5 = reference6;
				reference6 = ref val5;
				if (val5 == null)
				{
					obj9 = null;
					goto IL_0095;
				}
			}
			obj9 = reference6.ToString();
			goto IL_0095;
			IL_015b:
			array[8] = (string)obj8;
			array[9] = ", ";
			ref T6 reference7 = ref Item6;
			T6 val6 = default(T6);
			object obj10;
			if (val6 == null)
			{
				val6 = reference7;
				reference7 = ref val6;
				if (val6 == null)
				{
					obj10 = null;
					goto IL_01a0;
				}
			}
			obj10 = reference7.ToString();
			goto IL_01a0;
			IL_0291:
			object obj11;
			array2[2] = (string)obj11;
			array2[3] = ", ";
			ref T3 reference8 = ref Item3;
			T3 val7 = default(T3);
			if (val7 == null)
			{
				val7 = reference8;
				reference8 = ref val7;
				if (val7 == null)
				{
					obj3 = null;
					goto IL_02d1;
				}
			}
			obj3 = reference8.ToString();
			goto IL_02d1;
			IL_01e5:
			object obj12;
			array[12] = (string)obj12;
			array[13] = ", ";
			array[14] = Rest.ToString();
			array[15] = ")";
			return string.Concat(array);
			IL_0095:
			array[2] = (string)obj9;
			array[3] = ", ";
			ref T3 reference9 = ref Item3;
			val7 = default(T3);
			object obj13;
			if (val7 == null)
			{
				val7 = reference9;
				reference9 = ref val7;
				if (val7 == null)
				{
					obj13 = null;
					goto IL_00d5;
				}
			}
			obj13 = reference9.ToString();
			goto IL_00d5;
			IL_0314:
			array2[6] = (string)obj4;
			array2[7] = ", ";
			ref T5 reference10 = ref Item5;
			val4 = default(T5);
			object obj14;
			if (val4 == null)
			{
				val4 = reference10;
				reference10 = ref val4;
				if (val4 == null)
				{
					obj14 = null;
					goto IL_0357;
				}
			}
			obj14 = reference10.ToString();
			goto IL_0357;
			IL_01a0:
			array[10] = (string)obj10;
			array[11] = ", ";
			ref T7 reference11 = ref Item7;
			val3 = default(T7);
			if (val3 == null)
			{
				val3 = reference11;
				reference11 = ref val3;
				if (val3 == null)
				{
					obj12 = null;
					goto IL_01e5;
				}
			}
			obj12 = reference11.ToString();
			goto IL_01e5;
			IL_0251:
			array2[0] = (string)obj2;
			array2[1] = ", ";
			ref T2 reference12 = ref Item2;
			val5 = default(T2);
			if (val5 == null)
			{
				val5 = reference12;
				reference12 = ref val5;
				if (val5 == null)
				{
					obj11 = null;
					goto IL_0291;
				}
			}
			obj11 = reference12.ToString();
			goto IL_0291;
			IL_00d5:
			array[4] = (string)obj13;
			array[5] = ", ";
			ref T4 reference13 = ref Item4;
			val2 = default(T4);
			if (val2 == null)
			{
				val2 = reference13;
				reference13 = ref val2;
				if (val2 == null)
				{
					obj7 = null;
					goto IL_0118;
				}
			}
			obj7 = reference13.ToString();
			goto IL_0118;
			IL_0357:
			array2[8] = (string)obj14;
			array2[9] = ", ";
			ref T6 reference14 = ref Item6;
			val6 = default(T6);
			if (val6 == null)
			{
				val6 = reference14;
				reference14 = ref val6;
				if (val6 == null)
				{
					obj6 = null;
					goto IL_039c;
				}
			}
			obj6 = reference14.ToString();
			goto IL_039c;
		}
	}
	internal static class SR
	{
		private static ResourceManager s_resourceManager;

		private static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(ResourceType));

		internal static Type ResourceType { get; } = typeof(SR);


		internal static string ArgumentException_ValueTupleIncorrectType => GetResourceString("ArgumentException_ValueTupleIncorrectType", null);

		internal static string ArgumentException_ValueTupleLastArgumentNotAValueTuple => GetResourceString("ArgumentException_ValueTupleLastArgumentNotAValueTuple", null);

		[MethodImpl(MethodImplOptions.NoInlining)]
		private static bool UsingResourceKeys()
		{
			return false;
		}

		internal static string GetResourceString(string resourceKey, string defaultString)
		{
			string text = null;
			try
			{
				text = ResourceManager.GetString(resourceKey);
			}
			catch (MissingManifestResourceException)
			{
			}
			if (defaultString != null && resourceKey.Equals(text, StringComparison.Ordinal))
			{
				return defaultString;
			}
			return text;
		}

		internal static string Format(string resourceFormat, params object[] args)
		{
			if (args != null)
			{
				if (UsingResourceKeys())
				{
					return resourceFormat + string.Join(", ", args);
				}
				return string.Format(resourceFormat, args);
			}
			return resourceFormat;
		}

		internal static string Format(string resourceFormat, object p1)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1);
			}
			return string.Format(resourceFormat, p1);
		}

		internal static string Format(string resourceFormat, object p1, object p2)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2);
			}
			return string.Format(resourceFormat, p1, p2);
		}

		internal static string Format(string resourceFormat, object p1, object p2, object p3)
		{
			if (UsingResourceKeys())
			{
				return string.Join(", ", resourceFormat, p1, p2, p3);
			}
			return string.Format(resourceFormat, p1, p2, p3);
		}
	}
}
namespace System.Numerics.Hashing
{
	internal static class HashHelpers
	{
		public static readonly int RandomSeed = Guid.NewGuid().GetHashCode();

		public static int Combine(int h1, int h2)
		{
			uint num = (uint)(h1 << 5) | ((uint)h1 >> 27);
			return ((int)num + h1) ^ h2;
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[CLSCompliant(false)]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
	public sealed class TupleElementNamesAttribute : Attribute
	{
		private readonly string[] _transformNames;

		public IList<string> TransformNames => _transformNames;

		public TupleElementNamesAttribute(string[] transformNames)
		{
			if (transformNames == null)
			{
				throw new ArgumentNullException("transformNames");
			}
			_transformNames = transformNames;
		}
	}
}

BepInEx\plugins\Cyberhead\Unity.Burst.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using AOT;
using Microsoft.CodeAnalysis;
using Unity.Burst.LowLevel;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Scripting;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Unity.Burst.CodeGen")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst.Tests.UnitTests")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor.Tests")]
[assembly: InternalsVisibleTo("Unity.Burst.Benchmarks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsUnmanagedAttribute : Attribute
	{
	}
}
namespace Unity.Burst
{
	public enum OptimizeFor
	{
		Default,
		Performance,
		Size,
		FastCompilation,
		Balanced
	}
	public enum FloatMode
	{
		Default,
		Strict,
		Deterministic,
		Fast
	}
	public enum FloatPrecision
	{
		Standard,
		High,
		Medium,
		Low
	}
	[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method)]
	public class BurstCompileAttribute : Attribute
	{
		internal bool? _compileSynchronously;

		internal bool? _debug;

		internal bool? _disableSafetyChecks;

		internal bool? _disableDirectCall;

		public FloatMode FloatMode { get; set; }

		public FloatPrecision FloatPrecision { get; set; }

		public bool CompileSynchronously
		{
			get
			{
				if (!_compileSynchronously.HasValue)
				{
					return false;
				}
				return _compileSynchronously.Value;
			}
			set
			{
				_compileSynchronously = value;
			}
		}

		public bool Debug
		{
			get
			{
				if (!_debug.HasValue)
				{
					return false;
				}
				return _debug.Value;
			}
			set
			{
				_debug = value;
			}
		}

		public bool DisableSafetyChecks
		{
			get
			{
				if (!_disableSafetyChecks.HasValue)
				{
					return false;
				}
				return _disableSafetyChecks.Value;
			}
			set
			{
				_disableSafetyChecks = value;
			}
		}

		public bool DisableDirectCall
		{
			get
			{
				if (!_disableDirectCall.HasValue)
				{
					return false;
				}
				return _disableDirectCall.Value;
			}
			set
			{
				_disableDirectCall = value;
			}
		}

		public OptimizeFor OptimizeFor { get; set; }

		internal string[] Options { get; set; }

		public BurstCompileAttribute()
		{
		}

		public BurstCompileAttribute(FloatPrecision floatPrecision, FloatMode floatMode)
		{
			FloatMode = floatMode;
			FloatPrecision = floatPrecision;
		}

		internal BurstCompileAttribute(string[] options)
		{
			Options = options;
		}
	}
	public static class BurstCompiler
	{
		private class CommandBuilder
		{
			private StringBuilder _builder;

			private bool _hasArgs;

			public CommandBuilder()
			{
				_builder = new StringBuilder();
				_hasArgs = false;
			}

			public CommandBuilder Begin(string cmd)
			{
				_builder.Clear();
				_hasArgs = false;
				_builder.Append(cmd);
				return this;
			}

			public CommandBuilder With(string arg)
			{
				if (!_hasArgs)
				{
					_builder.Append(' ');
				}
				_hasArgs = true;
				_builder.Append(arg);
				return this;
			}

			public CommandBuilder With(IntPtr arg)
			{
				if (!_hasArgs)
				{
					_builder.Append(' ');
				}
				_hasArgs = true;
				_builder.AppendFormat("0x{0:X16}", arg.ToInt64());
				return this;
			}

			public CommandBuilder And(char sep = '|')
			{
				_builder.Append(sep);
				return this;
			}

			public string SendToCompiler()
			{
				return SendRawCommandToCompiler(_builder.ToString());
			}
		}

		[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
		internal class StaticTypeReinitAttribute : Attribute
		{
			public readonly Type reinitType;

			public StaticTypeReinitAttribute(Type toReinit)
			{
				reinitType = toReinit;
			}
		}

		[BurstCompile]
		internal static class BurstCompilerHelper
		{
			[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
			private delegate bool IsBurstEnabledDelegate();

			private static readonly IsBurstEnabledDelegate IsBurstEnabledImpl = IsBurstEnabled;

			public static readonly bool IsBurstGenerated = IsCompiledByBurst(IsBurstEnabledImpl);

			[BurstCompile]
			[MonoPInvokeCallback(typeof(IsBurstEnabledDelegate))]
			private static bool IsBurstEnabled()
			{
				bool value = true;
				DiscardedMethod(ref value);
				return value;
			}

			[BurstDiscard]
			private static void DiscardedMethod(ref bool value)
			{
				value = false;
			}

			private unsafe static bool IsCompiledByBurst(Delegate del)
			{
				return BurstCompilerService.GetAsyncCompiledAsyncDelegateMethod(BurstCompilerService.CompileAsyncDelegateMethod((object)del, string.Empty)) != null;
			}
		}

		private class FakeDelegate
		{
			[Preserve]
			public MethodInfo Method { get; }

			public FakeDelegate(MethodInfo method)
			{
				Method = method;
			}
		}

		[ThreadStatic]
		private static CommandBuilder _cmdBuilder;

		internal static bool _IsEnabled;

		public static readonly BurstCompilerOptions Options = new BurstCompilerOptions(isGlobal: true);

		internal static Action OnCompileILPPMethod2;

		private static readonly MethodInfo DummyMethodInfo = typeof(BurstCompiler).GetMethod("DummyMethod", BindingFlags.Static | BindingFlags.NonPublic);

		public static bool IsEnabled
		{
			get
			{
				if (_IsEnabled)
				{
					return BurstCompilerHelper.IsBurstGenerated;
				}
				return false;
			}
		}

		public static bool IsLoadAdditionalLibrarySupported()
		{
			return IsApiAvailable("LoadBurstLibrary");
		}

		private static CommandBuilder BeginCompilerCommand(string cmd)
		{
			if (_cmdBuilder == null)
			{
				_cmdBuilder = new CommandBuilder();
			}
			return _cmdBuilder.Begin(cmd);
		}

		public static void SetExecutionMode(BurstExecutionEnvironment mode)
		{
			BurstCompilerService.SetCurrentExecutionMode((uint)mode);
		}

		public static BurstExecutionEnvironment GetExecutionMode()
		{
			return (BurstExecutionEnvironment)BurstCompilerService.GetCurrentExecutionMode();
		}

		internal unsafe static T CompileDelegate<T>(T delegateMethod) where T : class
		{
			return (T)(object)Marshal.GetDelegateForFunctionPointer((IntPtr)Compile(delegateMethod, isFunctionPointer: false), delegateMethod.GetType());
		}

		[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
		private static void VerifyDelegateIsNotMulticast<T>(T delegateMethod) where T : class
		{
			if ((delegateMethod as Delegate).GetInvocationList().Length > 1)
			{
				throw new InvalidOperationException($"Burst does not support multicast delegates, please use a regular delegate for `{delegateMethod}'");
			}
		}

		[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
		private static void VerifyDelegateHasCorrectUnmanagedFunctionPointerAttribute<T>(T delegateMethod) where T : class
		{
			UnmanagedFunctionPointerAttribute customAttribute = delegateMethod.GetType().GetCustomAttribute<UnmanagedFunctionPointerAttribute>();
			if (customAttribute == null || customAttribute.CallingConvention != CallingConvention.Cdecl)
			{
				Debug.LogWarning((object)("The delegate type " + delegateMethod.GetType().FullName + " should be decorated with [UnmanagedFunctionPointer(CallingConvention.Cdecl)] to ensure runtime interoperabilty between managed code and Burst-compiled code."));
			}
		}

		[Obsolete("This method will be removed in a future version of Burst")]
		public static IntPtr CompileILPPMethod(RuntimeMethodHandle burstMethodHandle, RuntimeMethodHandle managedMethodHandle, RuntimeTypeHandle delegateTypeHandle)
		{
			throw new NotImplementedException();
		}

		public unsafe static IntPtr CompileILPPMethod2(RuntimeMethodHandle burstMethodHandle)
		{
			if (burstMethodHandle.Value == IntPtr.Zero)
			{
				throw new ArgumentNullException("burstMethodHandle");
			}
			OnCompileILPPMethod2?.Invoke();
			MethodInfo methodInfo = (MethodInfo)MethodBase.GetMethodFromHandle(burstMethodHandle);
			return (IntPtr)Compile(new FakeDelegate(methodInfo), methodInfo, isFunctionPointer: true, isILPostProcessing: true);
		}

		[Obsolete("This method will be removed in a future version of Burst")]
		public unsafe static void* GetILPPMethodFunctionPointer(IntPtr ilppMethod)
		{
			throw new NotImplementedException();
		}

		public unsafe static void* GetILPPMethodFunctionPointer2(IntPtr ilppMethod, RuntimeMethodHandle managedMethodHandle, RuntimeTypeHandle delegateTypeHandle)
		{
			if (ilppMethod == IntPtr.Zero)
			{
				throw new ArgumentNullException("ilppMethod");
			}
			if (managedMethodHandle.Value == IntPtr.Zero)
			{
				throw new ArgumentNullException("managedMethodHandle");
			}
			if (delegateTypeHandle.Value == IntPtr.Zero)
			{
				throw new ArgumentNullException("delegateTypeHandle");
			}
			return ilppMethod.ToPointer();
		}

		[Obsolete("This method will be removed in a future version of Burst")]
		public unsafe static void* CompileUnsafeStaticMethod(RuntimeMethodHandle handle)
		{
			throw new NotImplementedException();
		}

		public unsafe static FunctionPointer<T> CompileFunctionPointer<T>(T delegateMethod) where T : class
		{
			return new FunctionPointer<T>(new IntPtr(Compile(delegateMethod, isFunctionPointer: true)));
		}

		private unsafe static void* Compile(object delegateObj, bool isFunctionPointer)
		{
			if (!(delegateObj is Delegate))
			{
				throw new ArgumentException("object instance must be a System.Delegate", "delegateObj");
			}
			Delegate @delegate = (Delegate)delegateObj;
			return Compile(@delegate, @delegate.Method, isFunctionPointer, isILPostProcessing: false);
		}

		private unsafe static void* Compile(object delegateObj, MethodInfo methodInfo, bool isFunctionPointer, bool isILPostProcessing)
		{
			if (delegateObj == null)
			{
				throw new ArgumentNullException("delegateObj");
			}
			if (delegateObj.GetType().IsGenericType)
			{
				throw new InvalidOperationException($"The delegate type `{delegateObj.GetType()}` must be a non-generic type");
			}
			if (!methodInfo.IsStatic)
			{
				throw new InvalidOperationException($"The method `{methodInfo}` must be static. Instance methods are not supported");
			}
			if (methodInfo.IsGenericMethod)
			{
				throw new InvalidOperationException($"The method `{methodInfo}` must be a non-generic method");
			}
			Delegate @delegate = null;
			if (!isILPostProcessing)
			{
				@delegate = delegateObj as Delegate;
			}
			if (BurstCompilerOptions.HasBurstCompileAttribute(methodInfo))
			{
				void* ptr;
				if (Options.EnableBurstCompilation && BurstCompilerHelper.IsBurstGenerated)
				{
					ptr = BurstCompilerService.GetAsyncCompiledAsyncDelegateMethod(BurstCompilerService.CompileAsyncDelegateMethod(delegateObj, string.Empty));
				}
				else
				{
					if (isILPostProcessing)
					{
						return null;
					}
					GCHandle.Alloc(@delegate);
					ptr = (void*)Marshal.GetFunctionPointerForDelegate(@delegate);
				}
				if (ptr == null)
				{
					throw new InvalidOperationException($"Burst failed to compile the function pointer `{methodInfo}`");
				}
				return ptr;
			}
			throw new InvalidOperationException($"Burst cannot compile the function pointer `{methodInfo}` because the `[BurstCompile]` attribute is missing");
		}

		internal static void Shutdown()
		{
		}

		internal static void Cancel()
		{
		}

		internal static bool IsCurrentCompilationDone()
		{
			return true;
		}

		internal static void Enable()
		{
		}

		internal static void Disable()
		{
		}

		internal static bool IsHostEditorArm()
		{
			return false;
		}

		internal static void TriggerUnsafeStaticMethodRecompilation()
		{
			Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
			for (int i = 0; i < assemblies.Length; i++)
			{
				foreach (Attribute item in from x in assemblies[i].GetCustomAttributes()
					where x.GetType().FullName == "Unity.Burst.BurstCompiler+StaticTypeReinitAttribute"
					select x)
				{
					(item as StaticTypeReinitAttribute).reinitType.GetMethod("Constructor", BindingFlags.Static | BindingFlags.Public).Invoke(null, new object[0]);
				}
			}
		}

		internal static void TriggerRecompilation()
		{
		}

		internal static void UnloadAdditionalLibraries()
		{
			SendCommandToCompiler("$unload_burst_natives");
		}

		internal static void InitialiseDebuggerHooks()
		{
			if (IsApiAvailable("BurstManagedDebuggerPluginV1"))
			{
				SendCommandToCompiler(SendCommandToCompiler("$request_debug_command"));
			}
		}

		internal static bool IsApiAvailable(string apiName)
		{
			return SendCommandToCompiler("$is_native_api_available", apiName) == "True";
		}

		internal static int RequestSetProtocolVersion(int version)
		{
			string text = SendCommandToCompiler("$request_set_protocol_version_editor", $"{version}");
			if (string.IsNullOrEmpty(text) || !int.TryParse(text, out var result))
			{
				result = 0;
			}
			SendCommandToCompiler("$set_protocol_version_burst", $"{result}");
			return result;
		}

		internal static void Initialize(string[] assemblyFolders)
		{
		}

		internal static void NotifyCompilationStarted(string[] assemblyFolders)
		{
		}

		internal static void NotifyAssemblyCompilationNotRequired(string assemblyName)
		{
		}

		internal static void NotifyAssemblyCompilationFinished(string assemblyName)
		{
		}

		internal static void NotifyCompilationFinished()
		{
		}

		internal static string AotCompilation(string[] assemblyFolders, string[] assemblyRoots, string options)
		{
			return "failed";
		}

		internal static void SetProfilerCallbacks()
		{
		}

		private static string SendRawCommandToCompiler(string command)
		{
			string disassembly = BurstCompilerService.GetDisassembly(DummyMethodInfo, command);
			if (!string.IsNullOrEmpty(disassembly))
			{
				return disassembly.TrimStart('\n');
			}
			return "";
		}

		private static string SendCommandToCompiler(string commandName, string commandArgs = null)
		{
			if (commandName == null)
			{
				throw new ArgumentNullException("commandName");
			}
			if (commandArgs == null)
			{
				return SendRawCommandToCompiler(commandName);
			}
			return BeginCompilerCommand(commandName).With(commandArgs).SendToCompiler();
		}

		private static void DummyMethod()
		{
		}
	}
	internal enum GlobalSafetyChecksSettingKind
	{
		Off,
		On,
		ForceOn
	}
	public sealed class BurstCompilerOptions
	{
		private const string DisableCompilationArg = "--burst-disable-compilation";

		private const string ForceSynchronousCompilationArg = "--burst-force-sync-compilation";

		internal const string DefaultLibraryName = "lib_burst_generated";

		internal const string BurstInitializeName = "burst.initialize";

		internal const string BurstInitializeExternalsName = "burst.initialize.externals";

		internal const string BurstInitializeStaticsName = "burst.initialize.statics";

		internal const string OptionBurstcSwitch = "+burstc";

		internal const string OptionGroup = "group";

		internal const string OptionPlatform = "platform=";

		internal const string OptionBackend = "backend=";

		internal const string OptionGlobalSafetyChecksSetting = "global-safety-checks-setting=";

		internal const string OptionDisableSafetyChecks = "disable-safety-checks";

		internal const string OptionDisableOpt = "disable-opt";

		internal const string OptionFastMath = "fastmath";

		internal const string OptionTarget = "target=";

		internal const string OptionOptLevel = "opt-level=";

		internal const string OptionLogTimings = "log-timings";

		internal const string OptionOptForSize = "opt-for-size";

		internal const string OptionFloatPrecision = "float-precision=";

		internal const string OptionFloatMode = "float-mode=";

		internal const string OptionBranchProtection = "branch-protection=";

		internal const string OptionDisableWarnings = "disable-warnings=";

		internal const string OptionCompilationDefines = "compilation-defines=";

		internal const string OptionDump = "dump=";

		internal const string OptionFormat = "format=";

		internal const string OptionDebugTrap = "debugtrap";

		internal const string OptionDisableVectors = "disable-vectors";

		internal const string OptionDebug = "debug=";

		internal const string OptionDebugMode = "debugMode";

		internal const string OptionStaticLinkage = "generate-static-linkage-methods";

		internal const string OptionJobMarshalling = "generate-job-marshalling-methods";

		internal const string OptionTempDirectory = "temp-folder=";

		internal const string OptionEnableDirectExternalLinking = "enable-direct-external-linking";

		internal const string OptionLinkerOptions = "linker-options=";

		internal const string OptionEnableAutoLayoutFallbackCheck = "enable-autolayout-fallback-check";

		internal const string OptionGenerateLinkXml = "generate-link-xml=";

		internal const string OptionMetaDataGeneration = "meta-data-generation=";

		internal const string OptionCacheDirectory = "cache-directory=";

		internal const string OptionJitDisableFunctionCaching = "disable-function-caching";

		internal const string OptionJitDisableAssemblyCaching = "disable-assembly-caching";

		internal const string OptionJitEnableAssemblyCachingLogs = "enable-assembly-caching-logs";

		internal const string OptionJitEnableSynchronousCompilation = "enable-synchronous-compilation";

		internal const string OptionJitCompilationPriority = "compilation-priority=";

		internal const string OptionJitIsForFunctionPointer = "is-for-function-pointer";

		internal const string OptionJitManagedFunctionPointer = "managed-function-pointer=";

		internal const string OptionJitManagedDelegateHandle = "managed-delegate-handle=";

		internal const string OptionEnableInterpreter = "enable-interpreter";

		internal const string OptionAotAssemblyFolder = "assembly-folder=";

		internal const string OptionRootAssembly = "root-assembly=";

		internal const string OptionIncludeRootAssemblyReferences = "include-root-assembly-references=";

		internal const string OptionAotMethod = "method=";

		internal const string OptionAotType = "type=";

		internal const string OptionAotAssembly = "assembly=";

		internal const string OptionAotOutputPath = "output=";

		internal const string OptionAotKeepIntermediateFiles = "keep-intermediate-files";

		internal const string OptionAotNoLink = "nolink";

		internal const string OptionAotPatchedAssembliesOutputFolder = "patch-assemblies-into=";

		internal const string OptionAotPinvokeNameToPatch = "pinvoke-name=";

		internal const string OptionAotExecuteMethodNameToFind = "execute-method-name=";

		internal const string OptionAotOnlyStaticMethods = "only-static-methods";

		internal const string OptionMethodPrefix = "method-prefix=";

		internal const string OptionAotNoNativeToolchain = "no-native-toolchain";

		internal const string OptionAotEmitLlvmObjects = "emit-llvm-objects";

		internal const string OptionAotKeyFolder = "key-folder=";

		internal const string OptionAotDecodeFolder = "decode-folder=";

		internal const string OptionVerbose = "verbose";

		internal const string OptionValidateExternalToolChain = "validate-external-tool-chain";

		internal const string OptionCompilerThreads = "threads=";

		internal const string OptionChunkSize = "chunk-size=";

		internal const string OptionPrintLogOnMissingPInvokeCallbackAttribute = "print-monopinvokecallbackmissing-message";

		internal const string OptionOutputMode = "output-mode=";

		internal const string OptionAlwaysCreateOutput = "always-create-output=";

		internal const string OptionAotPdbSearchPaths = "pdb-search-paths=";

		internal const string OptionSafetyChecks = "safety-checks";

		internal const string OptionLibraryOutputMode = "library-output-mode=";

		internal const string OptionCompilationId = "compilation-id=";

		internal const string CompilerCommandShutdown = "$shutdown";

		internal const string CompilerCommandCancel = "$cancel";

		internal const string CompilerCommandEnableCompiler = "$enable_compiler";

		internal const string CompilerCommandDisableCompiler = "$disable_compiler";

		internal const string CompilerCommandSetDefaultOptions = "$set_default_options";

		internal const string CompilerCommandTriggerSetupRecompilation = "$trigger_setup_recompilation";

		internal const string CompilerCommandIsCurrentCompilationDone = "$is_current_compilation_done";

		internal const string CompilerCommandTriggerRecompilation = "$trigger_recompilation";

		internal const string CompilerCommandInitialize = "$initialize";

		internal const string CompilerCommandDomainReload = "$domain_reload";

		internal const string CompilerCommandVersionNotification = "$version";

		internal const string CompilerCommandSetProfileCallbacks = "$set_profile_callbacks";

		internal const string CompilerCommandUnloadBurstNatives = "$unload_burst_natives";

		internal const string CompilerCommandIsNativeApiAvailable = "$is_native_api_available";

		internal const string CompilerCommandILPPCompilation = "$ilpp_compilation";

		internal const string CompilerCommandIsArmTestEnv = "$is_arm_test_env";

		internal const string CompilerCommandNotifyAssemblyCompilationNotRequired = "$notify_assembly_compilation_not_required";

		internal const string CompilerCommandNotifyAssemblyCompilationFinished = "$notify_assembly_compilation_finished";

		internal const string CompilerCommandNotifyCompilationStarted = "$notify_compilation_started";

		internal const string CompilerCommandNotifyCompilationFinished = "$notify_compilation_finished";

		internal const string CompilerCommandAotCompilation = "$aot_compilation";

		internal const string CompilerCommandRequestInitialiseDebuggerCommmand = "$request_debug_command";

		internal const string CompilerCommandInitialiseDebuggerCommmand = "$load_debugger_interface";

		internal const string CompilerCommandRequestSetProtocolVersionEditor = "$request_set_protocol_version_editor";

		internal const string CompilerCommandSetProtocolVersionBurst = "$set_protocol_version_burst";

		internal static readonly bool ForceDisableBurstCompilation;

		private static readonly bool ForceBurstCompilationSynchronously;

		internal static readonly bool IsSecondaryUnityProcess;

		private bool _enableBurstCompilation;

		private bool _enableBurstCompileSynchronously;

		private bool _enableBurstSafetyChecks;

		private bool _enableBurstTimings;

		private bool _enableBurstDebug;

		private bool _forceEnableBurstSafetyChecks;

		private bool IsGlobal { get; }

		public bool IsEnabled
		{
			get
			{
				if (EnableBurstCompilation)
				{
					return !ForceDisableBurstCompilation;
				}
				return false;
			}
		}

		public bool EnableBurstCompilation
		{
			get
			{
				return _enableBurstCompilation;
			}
			set
			{
				if (IsGlobal && ForceDisableBurstCompilation)
				{
					value = false;
				}
				bool num = _enableBurstCompilation != value;
				_enableBurstCompilation = value;
				if (IsGlobal)
				{
					JobsUtility.JobCompilerEnabled = value;
					BurstCompiler._IsEnabled = value;
				}
				if (num)
				{
					OnOptionsChanged();
				}
			}
		}

		public bool EnableBurstCompileSynchronously
		{
			get
			{
				return _enableBurstCompileSynchronously;
			}
			set
			{
				bool num = _enableBurstCompileSynchronously != value;
				_enableBurstCompileSynchronously = value;
				if (num)
				{
					OnOptionsChanged();
				}
			}
		}

		public bool EnableBurstSafetyChecks
		{
			get
			{
				return _enableBurstSafetyChecks;
			}
			set
			{
				bool num = _enableBurstSafetyChecks != value;
				_enableBurstSafetyChecks = value;
				if (num)
				{
					OnOptionsChanged();
					MaybeTriggerRecompilation();
				}
			}
		}

		public bool ForceEnableBurstSafetyChecks
		{
			get
			{
				return _forceEnableBurstSafetyChecks;
			}
			set
			{
				bool num = _forceEnableBurstSafetyChecks != value;
				_forceEnableBurstSafetyChecks = value;
				if (num)
				{
					OnOptionsChanged();
					MaybeTriggerRecompilation();
				}
			}
		}

		public bool EnableBurstDebug
		{
			get
			{
				return _enableBurstDebug;
			}
			set
			{
				bool num = _enableBurstDebug != value;
				_enableBurstDebug = value;
				if (num)
				{
					OnOptionsChanged();
					MaybeTriggerRecompilation();
				}
			}
		}

		[Obsolete("This property is no longer used and will be removed in a future major release")]
		public bool DisableOptimizations
		{
			get
			{
				return false;
			}
			set
			{
			}
		}

		[Obsolete("This property is no longer used and will be removed in a future major release. Use the [BurstCompile(FloatMode = FloatMode.Fast)] on the method directly to enable this feature")]
		public bool EnableFastMath
		{
			get
			{
				return true;
			}
			set
			{
			}
		}

		internal bool EnableBurstTimings
		{
			get
			{
				return _enableBurstTimings;
			}
			set
			{
				bool num = _enableBurstTimings != value;
				_enableBurstTimings = value;
				if (num)
				{
					OnOptionsChanged();
				}
			}
		}

		internal bool RequiresSynchronousCompilation
		{
			get
			{
				if (!EnableBurstCompileSynchronously)
				{
					return ForceBurstCompilationSynchronously;
				}
				return true;
			}
		}

		internal Action OptionsChanged { get; set; }

		internal static string SerialiseCompilationOptionsSafe(string[] roots, string[] folders, string options)
		{
			return SafeStringArrayHelper.SerialiseStringArraySafe(new string[3]
			{
				SafeStringArrayHelper.SerialiseStringArraySafe(roots),
				SafeStringArrayHelper.SerialiseStringArraySafe(folders),
				options
			});
		}

		internal static (string[] roots, string[] folders, string options) DeserialiseCompilationOptionsSafe(string from)
		{
			string[] array = SafeStringArrayHelper.DeserialiseStringArraySafe(from);
			return (SafeStringArrayHelper.DeserialiseStringArraySafe(array[0]), SafeStringArrayHelper.DeserialiseStringArraySafe(array[1]), array[2]);
		}

		private BurstCompilerOptions()
			: this(isGlobal: false)
		{
		}

		internal BurstCompilerOptions(bool isGlobal)
		{
			IsGlobal = isGlobal;
			EnableBurstCompilation = true;
			EnableBurstSafetyChecks = true;
		}

		internal BurstCompilerOptions Clone()
		{
			return new BurstCompilerOptions
			{
				EnableBurstCompilation = EnableBurstCompilation,
				EnableBurstCompileSynchronously = EnableBurstCompileSynchronously,
				EnableBurstSafetyChecks = EnableBurstSafetyChecks,
				EnableBurstTimings = EnableBurstTimings,
				EnableBurstDebug = EnableBurstDebug,
				ForceEnableBurstSafetyChecks = ForceEnableBurstSafetyChecks
			};
		}

		private static bool TryGetAttribute(MemberInfo member, out BurstCompileAttribute attribute)
		{
			attribute = null;
			if (member == null)
			{
				return false;
			}
			attribute = GetBurstCompileAttribute(member);
			if (attribute == null)
			{
				return false;
			}
			return true;
		}

		private static bool TryGetAttribute(Assembly assembly, out BurstCompileAttribute attribute)
		{
			if (assembly == null)
			{
				attribute = null;
				return false;
			}
			attribute = assembly.GetCustomAttribute<BurstCompileAttribute>();
			return attribute != null;
		}

		private static BurstCompileAttribute GetBurstCompileAttribute(MemberInfo memberInfo)
		{
			BurstCompileAttribute customAttribute = memberInfo.GetCustomAttribute<BurstCompileAttribute>();
			if (customAttribute != null)
			{
				return customAttribute;
			}
			foreach (Attribute customAttribute2 in memberInfo.GetCustomAttributes())
			{
				if (customAttribute2.GetType().FullName == "Burst.Compiler.IL.Tests.TestCompilerAttribute")
				{
					List<string> list = new List<string>();
					return new BurstCompileAttribute(FloatPrecision.Standard, FloatMode.Default)
					{
						CompileSynchronously = true,
						Options = list.ToArray()
					};
				}
			}
			return null;
		}

		internal static bool HasBurstCompileAttribute(MemberInfo member)
		{
			if (member == null)
			{
				throw new ArgumentNullException("member");
			}
			BurstCompileAttribute attribute;
			return TryGetAttribute(member, out attribute);
		}

		internal static void MergeAttributes(ref BurstCompileAttribute memberAttribute, in BurstCompileAttribute assemblyAttribute)
		{
			if (memberAttribute.FloatMode == FloatMode.Default)
			{
				memberAttribute.FloatMode = assemblyAttribute.FloatMode;
			}
			if (memberAttribute.FloatPrecision == FloatPrecision.Standard)
			{
				memberAttribute.FloatPrecision = assemblyAttribute.FloatPrecision;
			}
			if (memberAttribute.OptimizeFor == OptimizeFor.Default)
			{
				memberAttribute.OptimizeFor = assemblyAttribute.OptimizeFor;
			}
			if (!memberAttribute._compileSynchronously.HasValue && assemblyAttribute._compileSynchronously.HasValue)
			{
				memberAttribute._compileSynchronously = assemblyAttribute._compileSynchronously;
			}
			if (!memberAttribute._debug.HasValue && assemblyAttribute._debug.HasValue)
			{
				memberAttribute._debug = assemblyAttribute._debug;
			}
			if (!memberAttribute._disableDirectCall.HasValue && assemblyAttribute._disableDirectCall.HasValue)
			{
				memberAttribute._disableDirectCall = assemblyAttribute._disableDirectCall;
			}
			if (!memberAttribute._disableSafetyChecks.HasValue && assemblyAttribute._disableSafetyChecks.HasValue)
			{
				memberAttribute._disableSafetyChecks = assemblyAttribute._disableSafetyChecks;
			}
		}

		internal bool TryGetOptions(MemberInfo member, bool isJit, out string flagsOut, bool isForILPostProcessing = false)
		{
			flagsOut = null;
			if (!TryGetAttribute(member, out var attribute))
			{
				return false;
			}
			if (TryGetAttribute(member.Module.Assembly, out var attribute2))
			{
				MergeAttributes(ref attribute, in attribute2);
			}
			flagsOut = GetOptions(isJit, attribute, isForILPostProcessing);
			return true;
		}

		internal string GetOptions(bool isJit, BurstCompileAttribute attr = null, bool isForILPostProcessing = false, bool isForCompilerClient = false)
		{
			StringBuilder stringBuilder = new StringBuilder();
			if (isJit && !isForCompilerClient && ((attr != null && attr.CompileSynchronously) || RequiresSynchronousCompilation))
			{
				AddOption(stringBuilder, GetOption("enable-synchronous-compilation"));
			}
			if (isJit)
			{
				AddOption(stringBuilder, GetOption("debug=", "LineOnly"));
			}
			if (isForILPostProcessing)
			{
				AddOption(stringBuilder, GetOption("compilation-priority=", CompilationPriority.ILPP));
			}
			if (attr != null)
			{
				if (attr.FloatMode != 0)
				{
					AddOption(stringBuilder, GetOption("float-mode=", attr.FloatMode));
				}
				if (attr.FloatPrecision != 0)
				{
					AddOption(stringBuilder, GetOption("float-precision=", attr.FloatPrecision));
				}
				if (attr.DisableSafetyChecks)
				{
					AddOption(stringBuilder, GetOption("disable-safety-checks"));
				}
				if (attr.Options != null)
				{
					string[] options = attr.Options;
					foreach (string text in options)
					{
						if (!string.IsNullOrEmpty(text))
						{
							AddOption(stringBuilder, text);
						}
					}
				}
				switch (attr.OptimizeFor)
				{
				case OptimizeFor.Default:
				case OptimizeFor.Balanced:
					AddOption(stringBuilder, GetOption("opt-level=", 2));
					break;
				case OptimizeFor.Performance:
					AddOption(stringBuilder, GetOption("opt-level=", 3));
					break;
				case OptimizeFor.Size:
					AddOption(stringBuilder, GetOption("opt-for-size"));
					AddOption(stringBuilder, GetOption("opt-level=", 3));
					break;
				case OptimizeFor.FastCompilation:
					AddOption(stringBuilder, GetOption("opt-level=", 1));
					break;
				}
			}
			if (ForceEnableBurstSafetyChecks)
			{
				AddOption(stringBuilder, GetOption("global-safety-checks-setting=", GlobalSafetyChecksSettingKind.ForceOn));
			}
			else if (EnableBurstSafetyChecks)
			{
				AddOption(stringBuilder, GetOption("global-safety-checks-setting=", GlobalSafetyChecksSettingKind.On));
			}
			else
			{
				AddOption(stringBuilder, GetOption("global-safety-checks-setting=", GlobalSafetyChecksSettingKind.Off));
			}
			if (isJit && EnableBurstTimings)
			{
				AddOption(stringBuilder, GetOption("log-timings"));
			}
			if (EnableBurstDebug || (attr != null && attr.Debug))
			{
				AddOption(stringBuilder, GetOption("debugMode"));
			}
			AddOption(stringBuilder, GetOption("temp-folder=", Path.Combine(Environment.CurrentDirectory, "Temp", "Burst")));
			return stringBuilder.ToString();
		}

		private static void AddOption(StringBuilder builder, string option)
		{
			if (builder.Length != 0)
			{
				builder.Append('\n');
			}
			builder.Append(option);
		}

		internal static string GetOption(string optionName, object value = null)
		{
			if (optionName == null)
			{
				throw new ArgumentNullException("optionName");
			}
			return "--" + optionName + (value ?? string.Empty);
		}

		private void OnOptionsChanged()
		{
			OptionsChanged?.Invoke();
		}

		private void MaybeTriggerRecompilation()
		{
		}

		static BurstCompilerOptions()
		{
			string[] commandLineArgs = Environment.GetCommandLineArgs();
			foreach (string text in commandLineArgs)
			{
				if (!(text == "--burst-disable-compilation"))
				{
					if (text == "--burst-force-sync-compilation")
					{
						ForceBurstCompilationSynchronously = true;
					}
				}
				else
				{
					ForceDisableBurstCompilation = true;
				}
			}
			if (CheckIsSecondaryUnityProcess())
			{
				ForceDisableBurstCompilation = true;
				IsSecondaryUnityProcess = true;
			}
		}

		private static bool CheckIsSecondaryUnityProcess()
		{
			return false;
		}
	}
	internal enum BurstTargetCpu
	{
		Auto,
		X86_SSE2,
		X86_SSE4,
		X64_SSE2,
		X64_SSE4,
		AVX,
		AVX2,
		WASM32,
		ARMV7A_NEON32,
		ARMV8A_AARCH64,
		THUMB2_NEON32,
		ARMV8A_AARCH64_HALFFP,
		ARMV9A
	}
	[Flags]
	internal enum NativeDumpFlags
	{
		None = 0,
		IL = 1,
		Unused = 2,
		IR = 4,
		IROptimized = 8,
		Asm = 0x10,
		Function = 0x20,
		Analysis = 0x40,
		IRPassAnalysis = 0x80,
		ILPre = 0x100,
		IRPerEntryPoint = 0x200,
		All = 0x3FD
	}
	internal enum CompilationPriority
	{
		EagerCompilationSynchronous,
		Asynchronous,
		ILPP,
		EagerCompilationAsynchronous
	}
	public enum BurstExecutionEnvironment
	{
		Default = 0,
		NonDeterministic = 0,
		Deterministic = 1
	}
	public static class BurstRuntime
	{
		[StructLayout(LayoutKind.Sequential, Size = 1)]
		private struct HashCode32<T>
		{
			public static readonly int Value = HashStringWithFNV1A32(typeof(T).AssemblyQualifiedName);
		}

		[StructLayout(LayoutKind.Sequential, Size = 1)]
		private struct HashCode64<T>
		{
			public static readonly long Value = HashStringWithFNV1A64(typeof(T).AssemblyQualifiedName);
		}

		internal class PreserveAttribute : Attribute
		{
		}

		public static int GetHashCode32<T>()
		{
			return HashCode32<T>.Value;
		}

		public static int GetHashCode32(Type type)
		{
			return HashStringWithFNV1A32(type.AssemblyQualifiedName);
		}

		public static long GetHashCode64<T>()
		{
			return HashCode64<T>.Value;
		}

		public static long GetHashCode64(Type type)
		{
			return HashStringWithFNV1A64(type.AssemblyQualifiedName);
		}

		internal static int HashStringWithFNV1A32(string text)
		{
			uint num = 2166136261u;
			foreach (char c in text)
			{
				num = 16777619 * (num ^ (byte)(c & 0xFF));
				num = 16777619 * (num ^ (byte)((int)c >> 8));
			}
			return (int)num;
		}

		internal static long HashStringWithFNV1A64(string text)
		{
			ulong num = 14695981039346656037uL;
			foreach (char c in text)
			{
				num = 1099511628211L * (num ^ (byte)(c & 0xFF));
				num = 1099511628211L * (num ^ (byte)((int)c >> 8));
			}
			return (long)num;
		}

		public static bool LoadAdditionalLibrary(string pathToLibBurstGenerated)
		{
			if (BurstCompiler.IsLoadAdditionalLibrarySupported())
			{
				return LoadAdditionalLibraryInternal(pathToLibBurstGenerated);
			}
			return false;
		}

		internal static bool LoadAdditionalLibraryInternal(string pathToLibBurstGenerated)
		{
			return (bool)typeof(BurstCompilerService).GetMethod("LoadBurstLibrary").Invoke(null, new object[1] { pathToLibBurstGenerated });
		}

		internal static void Initialize()
		{
		}

		[Preserve]
		internal static void PreventRequiredAttributeStrip()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			new BurstDiscardAttribute();
			new ConditionalAttribute("HEJSA");
		}

		[Preserve]
		internal unsafe static void Log(byte* message, int logType, byte* fileName, int lineNumber)
		{
			BurstCompilerService.Log((void*)null, (BurstLogType)logType, message, (byte*)null, lineNumber);
		}

		public unsafe static byte* GetUTF8LiteralPointer(string str, out int byteCount)
		{
			throw new NotImplementedException("This function only works from Burst");
		}
	}
	internal static class BurstString
	{
		internal class PreserveAttribute : Attribute
		{
		}

		private enum NumberBufferKind
		{
			Integer,
			Float
		}

		private struct NumberBuffer
		{
			private unsafe readonly byte* _buffer;

			public NumberBufferKind Kind;

			public int DigitsCount;

			public int Scale;

			public readonly bool IsNegative;

			public unsafe NumberBuffer(NumberBufferKind kind, byte* buffer, int digitsCount, int scale, bool isNegative)
			{
				Kind = kind;
				_buffer = buffer;
				DigitsCount = digitsCount;
				Scale = scale;
				IsNegative = isNegative;
			}

			public unsafe byte* GetDigitsPointer()
			{
				return _buffer;
			}
		}

		public enum NumberFormatKind : byte
		{
			General,
			Decimal,
			DecimalForceSigned,
			Hexadecimal
		}

		public struct FormatOptions
		{
			public NumberFormatKind Kind;

			public sbyte AlignAndSize;

			public byte Specifier;

			public bool Lowercase;

			public bool Uppercase => !Lowercase;

			public FormatOptions(NumberFormatKind kind, sbyte alignAndSize, byte specifier, bool lowercase)
			{
				this = default(FormatOptions);
				Kind = kind;
				AlignAndSize = alignAndSize;
				Specifier = specifier;
				Lowercase = lowercase;
			}

			public unsafe int EncodeToRaw()
			{
				FormatOptions formatOptions = this;
				return *(int*)(&formatOptions);
			}

			public int GetBase()
			{
				if (Kind == NumberFormatKind.Hexadecimal)
				{
					return 16;
				}
				return 10;
			}

			public override string ToString()
			{
				return string.Format("{0}: {1}, {2}: {3}, {4}: {5}, {6}: {7}", "Kind", Kind, "AlignAndSize", AlignAndSize, "Specifier", Specifier, "Uppercase", Uppercase);
			}
		}

		public struct tBigInt
		{
			private const int c_BigInt_MaxBlocks = 35;

			public int m_length;

			public unsafe fixed uint m_blocks[35];

			public int GetLength()
			{
				return m_length;
			}

			public unsafe uint GetBlock(int idx)
			{
				return m_blocks[idx];
			}

			public void SetZero()
			{
				m_length = 0;
			}

			public bool IsZero()
			{
				return m_length == 0;
			}

			public unsafe void SetU64(ulong val)
			{
				if (val > uint.MaxValue)
				{
					m_blocks[0] = (uint)(val & 0xFFFFFFFFu);
					m_blocks[1] = (uint)((val >> 32) & 0xFFFFFFFFu);
					m_length = 2;
				}
				else if (val != 0L)
				{
					m_blocks[0] = (uint)(val & 0xFFFFFFFFu);
					m_length = 1;
				}
				else
				{
					m_length = 0;
				}
			}

			public unsafe void SetU32(uint val)
			{
				if (val != 0)
				{
					m_blocks[0] = val;
					m_length = ((val != 0) ? 1 : 0);
				}
				else
				{
					m_length = 0;
				}
			}

			public unsafe uint GetU32()
			{
				if (m_length != 0)
				{
					return m_blocks[0];
				}
				return 0u;
			}
		}

		public enum CutoffMode
		{
			Unique,
			TotalLength,
			FractionLength
		}

		public enum PrintFloatFormat
		{
			Positional,
			Scientific
		}

		[StructLayout(LayoutKind.Explicit)]
		public struct tFloatUnion32
		{
			[FieldOffset(0)]
			public float m_floatingPoint;

			[FieldOffset(0)]
			public uint m_integer;

			public bool IsNegative()
			{
				return m_integer >> 31 != 0;
			}

			public uint GetExponent()
			{
				return (m_integer >> 23) & 0xFFu;
			}

			public uint GetMantissa()
			{
				return m_integer & 0x7FFFFFu;
			}
		}

		[StructLayout(LayoutKind.Explicit)]
		public struct tFloatUnion64
		{
			[FieldOffset(0)]
			public double m_floatingPoint;

			[FieldOffset(0)]
			public ulong m_integer;

			public bool IsNegative()
			{
				return m_integer >> 63 != 0;
			}

			public uint GetExponent()
			{
				return (uint)((m_integer >> 52) & 0x7FF);
			}

			public ulong GetMantissa()
			{
				return m_integer & 0xFFFFFFFFFFFFFuL;
			}
		}

		private static readonly char[] SplitByColon = new char[1] { ':' };

		private static readonly byte[] logTable = new byte[256]
		{
			0, 0, 1, 1, 2, 2, 2, 2, 3, 3,
			3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
			4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
			4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
			5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
			5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
			5, 5, 5, 5, 6, 6, 6, 6, 6, 6,
			6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
			6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
			6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
			6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
			6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
			6, 6, 6, 6, 6, 6, 6, 6, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 7
		};

		private static readonly uint[] g_PowerOf10_U32 = new uint[8] { 1u, 10u, 100u, 1000u, 10000u, 100000u, 1000000u, 10000000u };

		private static readonly byte[] InfinityString = new byte[8] { 73, 110, 102, 105, 110, 105, 116, 121 };

		private static readonly byte[] NanString = new byte[3] { 78, 97, 78 };

		private const int SinglePrecision = 9;

		private const int DoublePrecision = 17;

		internal const int SingleNumberBufferLength = 10;

		internal const int DoubleNumberBufferLength = 18;

		private const int SinglePrecisionCustomFormat = 7;

		private const int DoublePrecisionCustomFormat = 15;

		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		[Preserve]
		public unsafe static void CopyFixedString(byte* dest, int destLength, byte* src, int srcLength)
		{
			int num = ((srcLength > destLength) ? destLength : srcLength);
			*(ushort*)(dest - 2) = (ushort)num;
			dest[num] = 0;
			UnsafeUtility.MemCpy((void*)dest, (void*)src, (long)num);
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, byte* src, int srcLength, int formatOptionsRaw)
		{
			FormatOptions formatOptions = *(FormatOptions*)(&formatOptionsRaw);
			if (!AlignLeft(dest, ref destIndex, destLength, formatOptions.AlignAndSize, srcLength))
			{
				int num = destLength - destIndex;
				int num2 = ((srcLength > num) ? num : srcLength);
				if (num2 > 0)
				{
					UnsafeUtility.MemCpy((void*)(dest + destIndex), (void*)src, (long)num2);
					destIndex += num2;
					AlignRight(dest, ref destIndex, destLength, formatOptions.AlignAndSize, srcLength);
				}
			}
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, float value, int formatOptionsRaw)
		{
			FormatOptions formatOptions = *(FormatOptions*)(&formatOptionsRaw);
			ConvertFloatToString(dest, ref destIndex, destLength, value, formatOptions);
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, double value, int formatOptionsRaw)
		{
			FormatOptions formatOptions = *(FormatOptions*)(&formatOptionsRaw);
			ConvertDoubleToString(dest, ref destIndex, destLength, value, formatOptions);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, bool value, int formatOptionsRaw)
		{
			int length = (value ? 4 : 5);
			FormatOptions formatOptions = *(FormatOptions*)(&formatOptionsRaw);
			if (AlignLeft(dest, ref destIndex, destLength, formatOptions.AlignAndSize, length))
			{
				return;
			}
			if (value)
			{
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 84;
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 114;
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 117;
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 101;
			}
			else
			{
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 70;
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 97;
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 108;
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 115;
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 101;
			}
			AlignRight(dest, ref destIndex, destLength, formatOptions.AlignAndSize, length);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, char value, int formatOptionsRaw)
		{
			int num = ((value <= '\u007f') ? 1 : ((value <= '߿') ? 2 : 3));
			FormatOptions formatOptions = *(FormatOptions*)(&formatOptionsRaw);
			if (AlignLeft(dest, ref destIndex, destLength, formatOptions.AlignAndSize, 1))
			{
				return;
			}
			switch (num)
			{
			case 1:
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = (byte)value;
				break;
			case 2:
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = (byte)((uint)((int)value >> 6) | 0xC0u);
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = (byte)((value & 0x3Fu) | 0x80u);
				break;
			case 3:
				if (value >= '\ud800' && value <= '\udfff')
				{
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = 239;
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = 191;
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = 189;
				}
				else
				{
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = (byte)((uint)((int)value >> 12) | 0xE0u);
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = (byte)(((uint)((int)value >> 6) & 0x3Fu) | 0x80u);
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = (byte)((value & 0x3Fu) | 0x80u);
				}
				break;
			}
			AlignRight(dest, ref destIndex, destLength, formatOptions.AlignAndSize, 1);
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, byte value, int formatOptionsRaw)
		{
			Format(dest, ref destIndex, destLength, (ulong)value, formatOptionsRaw);
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, ushort value, int formatOptionsRaw)
		{
			Format(dest, ref destIndex, destLength, (ulong)value, formatOptionsRaw);
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, uint value, int formatOptionsRaw)
		{
			FormatOptions options = *(FormatOptions*)(&formatOptionsRaw);
			ConvertUnsignedIntegerToString(dest, ref destIndex, destLength, value, options);
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, ulong value, int formatOptionsRaw)
		{
			FormatOptions options = *(FormatOptions*)(&formatOptionsRaw);
			ConvertUnsignedIntegerToString(dest, ref destIndex, destLength, value, options);
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, sbyte value, int formatOptionsRaw)
		{
			FormatOptions options = *(FormatOptions*)(&formatOptionsRaw);
			if (options.Kind == NumberFormatKind.Hexadecimal)
			{
				ConvertUnsignedIntegerToString(dest, ref destIndex, destLength, (byte)value, options);
			}
			else
			{
				ConvertIntegerToString(dest, ref destIndex, destLength, value, options);
			}
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, short value, int formatOptionsRaw)
		{
			FormatOptions options = *(FormatOptions*)(&formatOptionsRaw);
			if (options.Kind == NumberFormatKind.Hexadecimal)
			{
				ConvertUnsignedIntegerToString(dest, ref destIndex, destLength, (ushort)value, options);
			}
			else
			{
				ConvertIntegerToString(dest, ref destIndex, destLength, value, options);
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, int value, int formatOptionsRaw)
		{
			FormatOptions options = *(FormatOptions*)(&formatOptionsRaw);
			if (options.Kind == NumberFormatKind.Hexadecimal)
			{
				ConvertUnsignedIntegerToString(dest, ref destIndex, destLength, (uint)value, options);
			}
			else
			{
				ConvertIntegerToString(dest, ref destIndex, destLength, value, options);
			}
		}

		[Preserve]
		public unsafe static void Format(byte* dest, ref int destIndex, int destLength, long value, int formatOptionsRaw)
		{
			FormatOptions options = *(FormatOptions*)(&formatOptionsRaw);
			if (options.Kind == NumberFormatKind.Hexadecimal)
			{
				ConvertUnsignedIntegerToString(dest, ref destIndex, destLength, (ulong)value, options);
			}
			else
			{
				ConvertIntegerToString(dest, ref destIndex, destLength, value, options);
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private unsafe static void ConvertUnsignedIntegerToString(byte* dest, ref int destIndex, int destLength, ulong value, FormatOptions options)
		{
			uint @base = (uint)options.GetBase();
			if (@base >= 2 && @base <= 36)
			{
				int num = 0;
				ulong num2 = value;
				do
				{
					num2 /= @base;
					num++;
				}
				while (num2 != 0L);
				int num3 = num - 1;
				byte* ptr = stackalloc byte[(int)(uint)(num + 1)];
				num2 = value;
				do
				{
					ptr[num3--] = ValueToIntegerChar((int)(num2 % @base), options.Uppercase);
					num2 /= @base;
				}
				while (num2 != 0L);
				ptr[num] = 0;
				NumberBuffer number = new NumberBuffer(NumberBufferKind.Integer, ptr, num, num, isNegative: false);
				FormatNumber(dest, ref destIndex, destLength, ref number, options.Specifier, options);
			}
		}

		private static int GetLengthIntegerToString(long value, int basis, int zeroPadding)
		{
			int num = 0;
			long num2 = value;
			do
			{
				num2 /= basis;
				num++;
			}
			while (num2 != 0L);
			if (num < zeroPadding)
			{
				num = zeroPadding;
			}
			if (value < 0)
			{
				num++;
			}
			return num;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private unsafe static void ConvertIntegerToString(byte* dest, ref int destIndex, int destLength, long value, FormatOptions options)
		{
			int @base = options.GetBase();
			if (@base >= 2 && @base <= 36)
			{
				int num = 0;
				long num2 = value;
				do
				{
					num2 /= @base;
					num++;
				}
				while (num2 != 0L);
				byte* ptr = stackalloc byte[(int)(uint)(num + 1)];
				num2 = value;
				int num3 = num - 1;
				do
				{
					ptr[num3--] = ValueToIntegerChar((int)(num2 % @base), options.Uppercase);
					num2 /= @base;
				}
				while (num2 != 0L);
				ptr[num] = 0;
				NumberBuffer number = new NumberBuffer(NumberBufferKind.Integer, ptr, num, num, value < 0);
				FormatNumber(dest, ref destIndex, destLength, ref number, options.Specifier, options);
			}
		}

		private unsafe static void FormatNumber(byte* dest, ref int destIndex, int destLength, ref NumberBuffer number, int nMaxDigits, FormatOptions options)
		{
			bool isCorrectlyRounded = number.Kind == NumberBufferKind.Float;
			if (number.Kind == NumberBufferKind.Integer && options.Kind == NumberFormatKind.General && options.Specifier == 0)
			{
				options.Kind = NumberFormatKind.Decimal;
			}
			NumberFormatKind kind = options.Kind;
			if (kind != 0 && kind - 1 <= NumberFormatKind.DecimalForceSigned)
			{
				int num = number.DigitsCount;
				int specifier = options.Specifier;
				int zeroPadding = 0;
				if (num < specifier)
				{
					zeroPadding = specifier - num;
					num = specifier;
				}
				bool flag = options.Kind == NumberFormatKind.DecimalForceSigned;
				num += ((number.IsNegative || flag) ? 1 : 0);
				if (!AlignLeft(dest, ref destIndex, destLength, options.AlignAndSize, num))
				{
					FormatDecimalOrHexadecimal(dest, ref destIndex, destLength, ref number, zeroPadding, flag);
					AlignRight(dest, ref destIndex, destLength, options.AlignAndSize, num);
				}
			}
			else
			{
				if (nMaxDigits < 1)
				{
					nMaxDigits = number.DigitsCount;
				}
				RoundNumber(ref number, nMaxDigits, isCorrectlyRounded);
				int num = GetLengthForFormatGeneral(ref number, nMaxDigits);
				if (!AlignLeft(dest, ref destIndex, destLength, options.AlignAndSize, num))
				{
					FormatGeneral(dest, ref destIndex, destLength, ref number, nMaxDigits, (byte)(options.Uppercase ? 69 : 101));
					AlignRight(dest, ref destIndex, destLength, options.AlignAndSize, num);
				}
			}
		}

		private unsafe static void FormatDecimalOrHexadecimal(byte* dest, ref int destIndex, int destLength, ref NumberBuffer number, int zeroPadding, bool outputPositiveSign)
		{
			if (number.IsNegative)
			{
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 45;
			}
			else if (outputPositiveSign)
			{
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 43;
			}
			for (int i = 0; i < zeroPadding; i++)
			{
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 48;
			}
			int digitsCount = number.DigitsCount;
			byte* digitsPointer = number.GetDigitsPointer();
			for (int j = 0; j < digitsCount; j++)
			{
				if (destIndex >= destLength)
				{
					break;
				}
				dest[destIndex++] = digitsPointer[j];
			}
		}

		private static byte ValueToIntegerChar(int value, bool uppercase)
		{
			value = ((value < 0) ? (-value) : value);
			if (value <= 9)
			{
				return (byte)(48 + value);
			}
			if (value < 36)
			{
				return (byte)((uppercase ? 65 : 97) + (value - 10));
			}
			return 63;
		}

		private static void OptsSplit(string fullFormat, out string padding, out string format)
		{
			string[] array = fullFormat.Split(SplitByColon, StringSplitOptions.RemoveEmptyEntries);
			format = array[0];
			padding = null;
			if (array.Length == 2)
			{
				padding = format;
				format = array[1];
				return;
			}
			if (array.Length == 1)
			{
				if (format[0] == ',')
				{
					padding = format;
					format = null;
				}
				return;
			}
			throw new ArgumentException($"Format `{format}` not supported. Invalid number {array.Length} of :. Expecting no more than one.");
		}

		public static FormatOptions ParseFormatToFormatOptions(string fullFormat)
		{
			if (string.IsNullOrWhiteSpace(fullFormat))
			{
				return default(FormatOptions);
			}
			OptsSplit(fullFormat, out var padding, out var format);
			format = format?.Trim();
			padding = padding?.Trim();
			int result = 0;
			NumberFormatKind kind = NumberFormatKind.General;
			bool lowercase = false;
			int num = 0;
			if (!string.IsNullOrEmpty(format))
			{
				switch (format[0])
				{
				case 'G':
					kind = NumberFormatKind.General;
					break;
				case 'g':
					kind = NumberFormatKind.General;
					lowercase = true;
					break;
				case 'D':
					kind = NumberFormatKind.Decimal;
					break;
				case 'd':
					kind = NumberFormatKind.Decimal;
					lowercase = true;
					break;
				case 'X':
					kind = NumberFormatKind.Hexadecimal;
					break;
				case 'x':
					kind = NumberFormatKind.Hexadecimal;
					lowercase = true;
					break;
				default:
					throw new ArgumentException("Format `" + format + "` not supported. Only G, g, D, d, X, x are supported.");
				}
				if (format.Length > 1)
				{
					string text = format.Substring(1);
					if (!uint.TryParse(text, out var result2))
					{
						throw new ArgumentException("Expecting an unsigned integer for specifier `" + format + "` instead of " + text + ".");
					}
					num = (int)result2;
				}
			}
			if (!string.IsNullOrEmpty(padding))
			{
				if (padding[0] != ',')
				{
					throw new ArgumentException("Invalid padding `" + padding + "`, expecting to start with a leading `,` comma.");
				}
				string text2 = padding.Substring(1);
				if (!int.TryParse(text2, out result))
				{
					throw new ArgumentException("Expecting an integer for align/size padding `" + text2 + "`.");
				}
			}
			return new FormatOptions(kind, (sbyte)result, (byte)num, lowercase);
		}

		private unsafe static bool AlignRight(byte* dest, ref int destIndex, int destLength, int align, int length)
		{
			if (align < 0)
			{
				align = -align;
				return AlignLeft(dest, ref destIndex, destLength, align, length);
			}
			return false;
		}

		private unsafe static bool AlignLeft(byte* dest, ref int destIndex, int destLength, int align, int length)
		{
			if (align > 0)
			{
				while (length < align)
				{
					if (destIndex >= destLength)
					{
						return true;
					}
					dest[destIndex++] = 32;
					length++;
				}
			}
			return false;
		}

		private unsafe static int GetLengthForFormatGeneral(ref NumberBuffer number, int nMaxDigits)
		{
			int num = 0;
			int i = number.Scale;
			bool flag = false;
			if (i > nMaxDigits || i < -3)
			{
				i = 1;
				flag = true;
			}
			byte* ptr = number.GetDigitsPointer();
			if (number.IsNegative)
			{
				num++;
			}
			if (i > 0)
			{
				do
				{
					if (*ptr != 0)
					{
						ptr++;
					}
					num++;
				}
				while (--i > 0);
			}
			else
			{
				num++;
			}
			if (*ptr != 0 || i < 0)
			{
				num++;
				for (; i < 0; i++)
				{
					num++;
				}
				for (; *ptr != 0; ptr++)
				{
					num++;
				}
			}
			if (flag)
			{
				num++;
				int num2 = number.Scale - 1;
				if (num2 >= 0)
				{
					num++;
				}
				num += GetLengthIntegerToString(num2, 10, 2);
			}
			return num;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private unsafe static void FormatGeneral(byte* dest, ref int destIndex, int destLength, ref NumberBuffer number, int nMaxDigits, byte expChar)
		{
			int i = number.Scale;
			bool flag = false;
			if (i > nMaxDigits || i < -3)
			{
				i = 1;
				flag = true;
			}
			byte* digitsPointer = number.GetDigitsPointer();
			if (number.IsNegative)
			{
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 45;
			}
			if (i > 0)
			{
				do
				{
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = (byte)((*digitsPointer != 0) ? (*(digitsPointer++)) : 48);
				}
				while (--i > 0);
			}
			else
			{
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 48;
			}
			if (*digitsPointer != 0 || i < 0)
			{
				if (destIndex >= destLength)
				{
					return;
				}
				dest[destIndex++] = 46;
				for (; i < 0; i++)
				{
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = 48;
				}
				while (*digitsPointer != 0)
				{
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = *(digitsPointer++);
				}
			}
			if (flag && destIndex < destLength)
			{
				dest[destIndex++] = expChar;
				int num = number.Scale - 1;
				FormatOptions options = new FormatOptions(NumberFormatKind.DecimalForceSigned, 0, 2, lowercase: false);
				ConvertIntegerToString(dest, ref destIndex, destLength, num, options);
			}
		}

		private unsafe static void RoundNumber(ref NumberBuffer number, int pos, bool isCorrectlyRounded)
		{
			byte* digitsPointer = number.GetDigitsPointer();
			int i;
			for (i = 0; i < pos && digitsPointer[i] != 0; i++)
			{
			}
			if (i == pos && ShouldRoundUp(digitsPointer, i, isCorrectlyRounded))
			{
				while (i > 0 && digitsPointer[i - 1] == 57)
				{
					i--;
				}
				if (i > 0)
				{
					byte* num = digitsPointer + (i - 1);
					(*num)++;
				}
				else
				{
					number.Scale++;
					*digitsPointer = 49;
					i = 1;
				}
			}
			else
			{
				while (i > 0 && digitsPointer[i - 1] == 48)
				{
					i--;
				}
			}
			if (i == 0)
			{
				number.Scale = 0;
			}
			digitsPointer[i] = 0;
			number.DigitsCount = i;
		}

		private unsafe static bool ShouldRoundUp(byte* dig, int i, bool isCorrectlyRounded)
		{
			byte b = dig[i];
			if (b == 0 || isCorrectlyRounded)
			{
				return false;
			}
			return b >= 53;
		}

		private static uint LogBase2(uint val)
		{
			uint num = val >> 24;
			if (num != 0)
			{
				return (uint)(24 + logTable[num]);
			}
			num = val >> 16;
			if (num != 0)
			{
				return (uint)(16 + logTable[num]);
			}
			num = val >> 8;
			if (num != 0)
			{
				return (uint)(8 + logTable[num]);
			}
			return logTable[val];
		}

		private unsafe static int BigInt_Compare(in tBigInt lhs, in tBigInt rhs)
		{
			int num = lhs.m_length - rhs.m_length;
			if (num != 0)
			{
				return num;
			}
			for (int num2 = lhs.m_length - 1; num2 >= 0; num2--)
			{
				if (lhs.m_blocks[num2] != rhs.m_blocks[num2])
				{
					if (lhs.m_blocks[num2] > rhs.m_blocks[num2])
					{
						return 1;
					}
					return -1;
				}
			}
			return 0;
		}

		private static void BigInt_Add(out tBigInt pResult, in tBigInt lhs, in tBigInt rhs)
		{
			if (lhs.m_length < rhs.m_length)
			{
				BigInt_Add_internal(out pResult, in rhs, in lhs);
			}
			else
			{
				BigInt_Add_internal(out pResult, in lhs, in rhs);
			}
		}

		private unsafe static void BigInt_Add_internal(out tBigInt pResult, in tBigInt pLarge, in tBigInt pSmall)
		{
			int length = pLarge.m_length;
			int length2 = pSmall.m_length;
			pResult.m_length = length;
			ulong num = 0uL;
			fixed (uint* ptr = pLarge.m_blocks)
			{
				fixed (uint* ptr3 = pSmall.m_blocks)
				{
					fixed (uint* ptr5 = pResult.m_blocks)
					{
						uint* ptr2 = ptr;
						uint* ptr4 = ptr3;
						uint* ptr6 = ptr5;
						uint* ptr7 = ptr2 + length;
						uint* ptr8 = ptr4 + length2;
						while (ptr4 != ptr8)
						{
							ulong num2 = num + *ptr2 + *ptr4;
							num = num2 >> 32;
							*ptr6 = (uint)(num2 & 0xFFFFFFFFu);
							ptr2++;
							ptr4++;
							ptr6++;
						}
						while (ptr2 != ptr7)
						{
							ulong num3 = num + *ptr2;
							num = num3 >> 32;
							*ptr6 = (uint)(num3 & 0xFFFFFFFFu);
							ptr2++;
							ptr6++;
						}
						if (num != 0L)
						{
							*ptr6 = 1u;
							pResult.m_length = length + 1;
						}
						else
						{
							pResult.m_length = length;
						}
					}
				}
			}
		}

		private static void BigInt_Multiply(out tBigInt pResult, in tBigInt lhs, in tBigInt rhs)
		{
			if (lhs.m_length < rhs.m_length)
			{
				BigInt_Multiply_internal(out pResult, in rhs, in lhs);
			}
			else
			{
				BigInt_Multiply_internal(out pResult, in lhs, in rhs);
			}
		}

		private unsafe static void BigInt_Multiply_internal(out tBigInt pResult, in tBigInt pLarge, in tBigInt pSmall)
		{
			int num = pLarge.m_length + pSmall.m_length;
			for (int i = 0; i < num; i++)
			{
				pResult.m_blocks[i] = 0u;
			}
			fixed (uint* ptr = pLarge.m_blocks)
			{
				uint* ptr2 = ptr + pLarge.m_length;
				fixed (uint* ptr6 = pResult.m_blocks)
				{
					fixed (uint* ptr3 = pSmall.m_blocks)
					{
						uint* ptr4 = ptr3;
						uint* ptr5 = ptr4 + pSmall.m_length;
						uint* ptr7 = ptr6;
						while (ptr4 != ptr5)
						{
							uint num2 = *ptr4;
							if (num2 != 0)
							{
								uint* ptr8 = ptr;
								uint* ptr9 = ptr7;
								ulong num3 = 0uL;
								do
								{
									ulong num4 = (ulong)(*ptr9 + (long)(*ptr8) * (long)num2) + num3;
									num3 = num4 >> 32;
									*ptr9 = (uint)(num4 & 0xFFFFFFFFu);
									ptr8++;
									ptr9++;
								}
								while (ptr8 != ptr2);
								*ptr9 = (uint)(num3 & 0xFFFFFFFFu);
							}
							ptr4++;
							ptr7++;
						}
						if (num > 0 && pResult.m_blocks[num - 1] == 0)
						{
							pResult.m_length = num - 1;
						}
						else
						{
							pResult.m_length = num;
						}
					}
				}
			}
		}

		private unsafe static void BigInt_Multiply(out tBigInt pResult, in tBigInt lhs, uint rhs)
		{
			uint num = 0u;
			fixed (uint* ptr = pResult.m_blocks)
			{
				fixed (uint* ptr3 = lhs.m_blocks)
				{
					uint* ptr2 = ptr;
					uint* ptr4 = ptr3;
					uint* ptr5 = ptr4 + lhs.m_length;
					while (ptr4 != ptr5)
					{
						ulong num2 = (ulong)((long)(*ptr4) * (long)rhs + num);
						*ptr2 = (uint)(num2 & 0xFFFFFFFFu);
						num = (uint)(num2 >> 32);
						ptr4++;
						ptr2++;
					}
					if (num != 0)
					{
						*ptr2 = num;
						pResult.m_length = lhs.m_length + 1;
					}
					else
					{
						pResult.m_length = lhs.m_length;
					}
				}
			}
		}

		private unsafe static void BigInt_Multiply2(out tBigInt pResult, in tBigInt input)
		{
			uint num = 0u;
			fixed (uint* ptr = pResult.m_blocks)
			{
				fixed (uint* ptr3 = input.m_blocks)
				{
					uint* ptr2 = ptr;
					uint* ptr4 = ptr3;
					uint* ptr5 = ptr4 + input.m_length;
					while (ptr4 != ptr5)
					{
						uint num2 = *ptr4;
						*ptr2 = (num2 << 1) | num;
						num = num2 >> 31;
						ptr4++;
						ptr2++;
					}
					if (num != 0)
					{
						*ptr2 = num;
						pResult.m_length = input.m_length + 1;
					}
					else
					{
						pResult.m_length = input.m_length;
					}
				}
			}
		}

		private unsafe static void BigInt_Multiply2(ref tBigInt pResult)
		{
			uint num = 0u;
			fixed (uint* ptr = pResult.m_blocks)
			{
				uint* ptr2 = ptr;
				for (uint* ptr3 = ptr2 + pResult.m_length; ptr2 != ptr3; ptr2++)
				{
					uint num2 = *ptr2;
					*ptr2 = (num2 << 1) | num;
					num = num2 >> 31;
				}
				if (num != 0)
				{
					*ptr2 = num;
					pResult.m_length++;
				}
			}
		}

		private unsafe static void BigInt_Multiply10(ref tBigInt pResult)
		{
			ulong num = 0uL;
			fixed (uint* ptr = pResult.m_blocks)
			{
				uint* ptr2 = ptr;
				for (uint* ptr3 = ptr2 + pResult.m_length; ptr2 != ptr3; ptr2++)
				{
					ulong num2 = (ulong)((long)(*ptr2) * 10L) + num;
					*ptr2 = (uint)(num2 & 0xFFFFFFFFu);
					num = num2 >> 32;
				}
				if (num != 0L)
				{
					*ptr2 = (uint)num;
					pResult.m_length++;
				}
			}
		}

		private unsafe static tBigInt g_PowerOf10_Big(int i)
		{
			tBigInt result = default(tBigInt);
			switch (i)
			{
			case 0:
				result.m_length = 1;
				result.m_blocks[0] = 100000000u;
				break;
			case 1:
				result.m_length = 2;
				result.m_blocks[0] = 1874919424u;
				result.m_blocks[1] = 2328306u;
				break;
			case 2:
				result.m_length = 4;
				result.m_blocks[0] = 0u;
				result.m_blocks[1] = 2242703233u;
				result.m_blocks[2] = 762134875u;
				result.m_blocks[3] = 1262u;
				break;
			case 3:
				result.m_length = 7;
				result.m_blocks[0] = 0u;
				result.m_blocks[1] = 0u;
				result.m_blocks[2] = 3211403009u;
				result.m_blocks[3] = 1849224548u;
				result.m_blocks[4] = 3668416493u;
				result.m_blocks[5] = 3913284084u;
				result.m_blocks[6] = 1593091u;
				break;
			case 4:
				result.m_length = 14;
				result.m_blocks[0] = 0u;
				result.m_blocks[1] = 0u;
				result.m_blocks[2] = 0u;
				result.m_blocks[3] = 0u;
				result.m_blocks[4] = 781532673u;
				result.m_blocks[5] = 64985353u;
				result.m_blocks[6] = 253049085u;
				result.m_blocks[7] = 594863151u;
				result.m_blocks[8] = 3553621484u;
				result.m_blocks[9] = 3288652808u;
				result.m_blocks[10] = 3167596762u;
				result.m_blocks[11] = 2788392729u;
				result.m_blocks[12] = 3911132675u;
				result.m_blocks[13] = 590u;
				break;
			default:
				result.m_length = 27;
				result.m_blocks[0] = 0u;
				result.m_blocks[1] = 0u;
				result.m_blocks[2] = 0u;
				result.m_blocks[3] = 0u;
				result.m_blocks[4] = 0u;
				result.m_blocks[5] = 0u;
				result.m_blocks[6] = 0u;
				result.m_blocks[7] = 0u;
				result.m_blocks[8] = 2553183233u;
				result.m_blocks[9] = 3201533787u;
				result.m_blocks[10] = 3638140786u;
				result.m_blocks[11] = 303378311u;
				result.m_blocks[12] = 1809731782u;
				result.m_blocks[13] = 3477761648u;
				result.m_blocks[14] = 3583367183u;
				result.m_blocks[15] = 649228654u;
				result.m_blocks[16] = 2915460784u;
				result.m_blocks[17] = 487929380u;
				result.m_blocks[18] = 1011012442u;
				result.m_blocks[19] = 1677677582u;
				result.m_blocks[20] = 3428152256u;
				result.m_blocks[21] = 1710878487u;
				result.m_blocks[22] = 1438394610u;
				result.m_blocks[23] = 2161952759u;
				result.m_blocks[24] = 4100910556u;
				result.m_blocks[25] = 1608314830u;
				result.m_blocks[26] = 349175u;
				break;
			}
			return result;
		}

		private static void BigInt_Pow10(out tBigInt pResult, uint exponent)
		{
			tBigInt lhs = default(tBigInt);
			tBigInt pResult2 = default(tBigInt);
			uint num = exponent & 7u;
			lhs.SetU32(g_PowerOf10_U32[num]);
			exponent >>= 3;
			int num2 = 0;
			while (exponent != 0)
			{
				if ((exponent & (true ? 1u : 0u)) != 0)
				{
					tBigInt rhs = g_PowerOf10_Big(num2);
					BigInt_Multiply(out pResult2, in lhs, in rhs);
					lhs = pResult2;
					pResult2 = lhs;
				}
				num2++;
				exponent >>= 1;
			}
			pResult = lhs;
		}

		private static void BigInt_MultiplyPow10(out tBigInt pResult, in tBigInt input, uint exponent)
		{
			tBigInt pResult2 = default(tBigInt);
			tBigInt pResult3 = default(tBigInt);
			uint num = exponent & 7u;
			if (num != 0)
			{
				BigInt_Multiply(out pResult2, in input, g_PowerOf10_U32[num]);
			}
			else
			{
				pResult2 = input;
			}
			exponent >>= 3;
			int num2 = 0;
			while (exponent != 0)
			{
				if ((exponent & (true ? 1u : 0u)) != 0)
				{
					tBigInt rhs = g_PowerOf10_Big(num2);
					BigInt_Multiply(out pResult3, in pResult2, in rhs);
					pResult2 = pResult3;
					pResult3 = pResult2;
				}
				num2++;
				exponent >>= 1;
			}
			pResult = pResult2;
		}

		private unsafe static void BigInt_Pow2(out tBigInt pResult, uint exponent)
		{
			int num = (int)exponent / 32;
			for (uint num2 = 0u; num2 <= num; num2++)
			{
				pResult.m_blocks[num2] = 0u;
			}
			pResult.m_length = num + 1;
			int num3 = (int)exponent % 32;
			ref uint reference = ref pResult.m_blocks[num];
			reference |= (uint)(1 << num3);
		}

		private unsafe static uint BigInt_DivideWithRemainder_MaxQuotient9(ref tBigInt pDividend, in tBigInt divisor)
		{
			int num = divisor.m_length;
			if (pDividend.m_length < divisor.m_length)
			{
				return 0u;
			}
			fixed (uint* ptr = divisor.m_blocks)
			{
				fixed (uint* ptr3 = pDividend.m_blocks)
				{
					uint* ptr2 = ptr;
					uint* ptr4 = ptr3;
					uint* ptr5 = ptr2 + num - 1;
					uint num2 = *(ptr4 + num - 1) / (*ptr5 + 1);
					if (num2 != 0)
					{
						ulong num3 = 0uL;
						ulong num4 = 0uL;
						do
						{
							ulong num5 = (ulong)((long)(*ptr2) * (long)num2) + num4;
							num4 = num5 >> 32;
							ulong num6 = *ptr4 - (num5 & 0xFFFFFFFFu) - num3;
							num3 = (num6 >> 32) & 1;
							*ptr4 = (uint)(num6 & 0xFFFFFFFFu);
							ptr2++;
							ptr4++;
						}
						while (ptr2 <= ptr5);
						while (num > 0 && pDividend.m_blocks[num - 1] == 0)
						{
							num--;
						}
						pDividend.m_length = num;
					}
					if (BigInt_Compare(in pDividend, in divisor) >= 0)
					{
						num2++;
						ptr2 = ptr;
						ptr4 = ptr3;
						ulong num7 = 0uL;
						do
						{
							ulong num8 = (ulong)((long)(*ptr4) - (long)(*ptr2)) - num7;
							num7 = (num8 >> 32) & 1;
							*ptr4 = (uint)(num8 & 0xFFFFFFFFu);
							ptr2++;
							ptr4++;
						}
						while (ptr2 <= ptr5);
						while (num > 0 && pDividend.m_blocks[num - 1] == 0)
						{
							num--;
						}
						pDividend.m_length = num;
					}
					return num2;
				}
			}
		}

		private unsafe static void BigInt_ShiftLeft(ref tBigInt pResult, uint shift)
		{
			int num = (int)shift / 32;
			int num2 = (int)shift % 32;
			int length = pResult.m_length;
			if (num2 == 0)
			{
				fixed (uint* ptr = pResult.m_blocks)
				{
					uint* ptr2 = ptr + length - 1;
					uint* ptr3 = ptr2 + num;
					while (ptr2 >= ptr)
					{
						*ptr3 = *ptr2;
						ptr2--;
						ptr3--;
					}
				}
				for (uint num3 = 0u; num3 < num; num3++)
				{
					pResult.m_blocks[num3] = 0u;
				}
				pResult.m_length += num;
				return;
			}
			int num4 = length - 1;
			int num5 = length + num;
			pResult.m_length = num5 + 1;
			int num6 = 32 - num2;
			uint num7 = 0u;
			uint num8 = pResult.m_blocks[num4];
			uint num9 = num8 >> num6;
			while (num4 > 0)
			{
				pResult.m_blocks[num5] = num7 | num9;
				num7 = num8 << num2;
				num4--;
				num5--;
				num8 = pResult.m_blocks[num4];
				num9 = num8 >> num6;
			}
			pResult.m_blocks[num5] = num7 | num9;
			pResult.m_blocks[num5 - 1] = num8 << num2;
			for (uint num10 = 0u; num10 < num; num10++)
			{
				pResult.m_blocks[num10] = 0u;
			}
			if (pResult.m_blocks[pResult.m_length - 1] == 0)
			{
				pResult.m_length--;
			}
		}

		private unsafe static uint Dragon4(ulong mantissa, int exponent, uint mantissaHighBitIdx, bool hasUnequalMargins, CutoffMode cutoffMode, uint cutoffNumber, byte* pOutBuffer, uint bufferSize, out int pOutExponent)
		{
			byte* ptr = pOutBuffer;
			if (mantissa == 0L)
			{
				*ptr = 48;
				pOutExponent = 0;
				return 1u;
			}
			tBigInt pResult = default(tBigInt);
			tBigInt pResult2 = default(tBigInt);
			tBigInt pResult3 = default(tBigInt);
			tBigInt pResult4 = default(tBigInt);
			tBigInt* ptr2;
			if (hasUnequalMargins)
			{
				if (exponent > 0)
				{
					pResult2.SetU64(4 * mantissa);
					BigInt_ShiftLeft(ref pResult2, (uint)exponent);
					pResult.SetU32(4u);
					BigInt_Pow2(out pResult3, (uint)exponent);
					BigInt_Pow2(out pResult4, (uint)(exponent + 1));
				}
				else
				{
					pResult2.SetU64(4 * mantissa);
					BigInt_Pow2(out pResult, (uint)(-exponent + 2));
					pResult3.SetU32(1u);
					pResult4.SetU32(2u);
				}
				ptr2 = &pResult4;
			}
			else
			{
				if (exponent > 0)
				{
					pResult2.SetU64(2 * mantissa);
					BigInt_ShiftLeft(ref pResult2, (uint)exponent);
					pResult.SetU32(2u);
					BigInt_Pow2(out pResult3, (uint)exponent);
				}
				else
				{
					pResult2.SetU64(2 * mantissa);
					BigInt_Pow2(out pResult, (uint)(-exponent + 1));
					pResult3.SetU32(1u);
				}
				ptr2 = &pResult3;
			}
			int num = (int)Math.Ceiling((double)((int)mantissaHighBitIdx + exponent) * 0.3010299956639812 - 0.69);
			if (cutoffMode == CutoffMode.FractionLength && num <= (int)(0 - cutoffNumber))
			{
				num = (int)(0 - cutoffNumber + 1);
			}
			if (num > 0)
			{
				BigInt_MultiplyPow10(out var pResult5, in pResult, (uint)num);
				pResult = pResult5;
			}
			else if (num < 0)
			{
				BigInt_Pow10(out var pResult6, (uint)(-num));
				BigInt_Multiply(out var pResult7, in pResult2, in pResult6);
				pResult2 = pResult7;
				BigInt_Multiply(out pResult7, in pResult3, in pResult6);
				pResult3 = pResult7;
				if (ptr2 != &pResult3)
				{
					BigInt_Multiply2(out *ptr2, in pResult3);
				}
			}
			if (BigInt_Compare(in pResult2, in pResult) >= 0)
			{
				num++;
			}
			else
			{
				BigInt_Multiply10(ref pResult2);
				BigInt_Multiply10(ref pResult3);
				if (ptr2 != &pResult3)
				{
					BigInt_Multiply2(out *ptr2, in pResult3);
				}
			}
			int num2 = num - (int)bufferSize;
			switch (cutoffMode)
			{
			case CutoffMode.TotalLength:
			{
				int num4 = num - (int)cutoffNumber;
				if (num4 > num2)
				{
					num2 = num4;
				}
				break;
			}
			case CutoffMode.FractionLength:
			{
				int num3 = (int)(0 - cutoffNumber);
				if (num3 > num2)
				{
					num2 = num3;
				}
				break;
			}
			}
			pOutExponent = num - 1;
			uint block = pResult.GetBlock(pResult.GetLength() - 1);
			if (block < 8 || block > 429496729)
			{
				uint num5 = LogBase2(block);
				uint shift = (59 - num5) % 32;
				BigInt_ShiftLeft(ref pResult, shift);
				BigInt_ShiftLeft(ref pResult2, shift);
				BigInt_ShiftLeft(ref pResult3, shift);
				if (ptr2 != &pResult3)
				{
					BigInt_Multiply2(out *ptr2, in pResult3);
				}
			}
			uint num6;
			bool flag;
			bool flag2;
			if (cutoffMode == CutoffMode.Unique)
			{
				while (true)
				{
					num--;
					num6 = BigInt_DivideWithRemainder_MaxQuotient9(ref pResult2, in pResult);
					BigInt_Add(out var pResult8, in pResult2, in *ptr2);
					flag = BigInt_Compare(in pResult2, in pResult3) < 0;
					flag2 = BigInt_Compare(in pResult8, in pResult) > 0;
					if (flag || flag2 || num == num2)
					{
						break;
					}
					*ptr = (byte)(48 + num6);
					ptr++;
					BigInt_Multiply10(ref pResult2);
					BigInt_Multiply10(ref pResult3);
					if (ptr2 != &pResult3)
					{
						BigInt_Multiply2(out *ptr2, in pResult3);
					}
				}
			}
			else
			{
				flag = false;
				flag2 = false;
				while (true)
				{
					num--;
					num6 = BigInt_DivideWithRemainder_MaxQuotient9(ref pResult2, in pResult);
					if (pResult2.IsZero() || num == num2)
					{
						break;
					}
					*ptr = (byte)(48 + num6);
					ptr++;
					BigInt_Multiply10(ref pResult2);
				}
			}
			bool flag3 = flag;
			if (flag == flag2)
			{
				BigInt_Multiply2(ref pResult2);
				int num7 = BigInt_Compare(in pResult2, in pResult);
				flag3 = num7 < 0;
				if (num7 == 0)
				{
					flag3 = (num6 & 1) == 0;
				}
			}
			if (flag3)
			{
				*ptr = (byte)(48 + num6);
				ptr++;
			}
			else if (num6 == 9)
			{
				while (true)
				{
					if (ptr == pOutBuffer)
					{
						*ptr = 49;
						ptr++;
						pOutExponent++;
						break;
					}
					ptr--;
					if (*ptr != 57)
					{
						byte* intPtr = ptr;
						(*intPtr)++;
						ptr++;
						break;
					}
				}
			}
			else
			{
				*ptr = (byte)(48 + num6 + 1);
				ptr++;
			}
			return (uint)(ptr - pOutBuffer);
		}

		private unsafe static int FormatPositional(byte* pOutBuffer, uint bufferSize, ulong mantissa, int exponent, uint mantissaHighBitIdx, bool hasUnequalMargins, int precision)
		{
			uint num = bufferSize - 1;
			int pOutExponent;
			uint num2 = ((precision >= 0) ? Dragon4(mantissa, exponent, mantissaHighBitIdx, hasUnequalMargins, CutoffMode.FractionLength, (uint)precision, pOutBuffer, num, out pOutExponent) : Dragon4(mantissa, exponent, mantissaHighBitIdx, hasUnequalMargins, CutoffMode.Unique, 0u, pOutBuffer, num, out pOutExponent));
			uint num3 = 0u;
			if (pOutExponent >= 0)
			{
				uint num4 = (uint)(pOutExponent + 1);
				if (num2 < num4)
				{
					if (num4 > num)
					{
						num4 = num;
					}
					for (; num2 < num4; num2++)
					{
						pOutBuffer[num2] = 48;
					}
				}
				else if (num2 > num4)
				{
					num3 = num2 - num4;
					uint num5 = num - num4 - 1;
					if (num3 > num5)
					{
						num3 = num5;
					}
					Unsafe.CopyBlock((void*)(pOutBuffer + num4 + 1), (void*)(pOutBuffer + num4), num3);
					pOutBuffer[num4] = 46;
					num2 = num4 + 1 + num3;
				}
			}
			else
			{
				if (num > 2)
				{
					uint num6 = (uint)(-pOutExponent - 1);
					uint num7 = num - 2;
					if (num6 > num7)
					{
						num6 = num7;
					}
					uint num8 = 2 + num6;
					num3 = num2;
					uint num9 = num - num8;
					if (num3 > num9)
					{
						num3 = num9;
					}
					Unsafe.CopyBlock((void*)(pOutBuffer + num8), (void*)pOutBuffer, num3);
					for (uint num10 = 2u; num10 < num8; num10++)
					{
						pOutBuffer[num10] = 48;
					}
					num3 += num6;
					num2 = num3;
				}
				if (num > 1)
				{
					pOutBuffer[1] = 46;
					num2++;
				}
				if (num != 0)
				{
					*pOutBuffer = 48;
					num2++;
				}
			}
			if (precision > (int)num3 && num2 < num)
			{
				if (num3 == 0)
				{
					pOutBuffer[num2++] = 46;
				}
				uint num11 = (uint)(num2 + (precision - (int)num3));
				if (num11 > num)
				{
					num11 = num;
				}
				for (; num2 < num11; num2++)
				{
					pOutBuffer[num2] = 48;
				}
			}
			return (int)num2;
		}

		private unsafe static int FormatScientific(byte* pOutBuffer, uint bufferSize, ulong mantissa, int exponent, uint mantissaHighBitIdx, bool hasUnequalMargins, int precision)
		{
			int pOutExponent;
			uint num = ((precision >= 0) ? Dragon4(mantissa, exponent, mantissaHighBitIdx, hasUnequalMargins, CutoffMode.TotalLength, (uint)(precision + 1), pOutBuffer, bufferSize, out pOutExponent) : Dragon4(mantissa, exponent, mantissaHighBitIdx, hasUnequalMargins, CutoffMode.Unique, 0u, pOutBuffer, bufferSize, out pOutExponent));
			byte* ptr = pOutBuffer;
			if (bufferSize > 1)
			{
				ptr++;
				bufferSize--;
			}
			uint num2 = num - 1;
			if (num2 != 0 && bufferSize > 1)
			{
				uint num3 = bufferSize - 2;
				if (num2 > num3)
				{
					num2 = num3;
				}
				Unsafe.CopyBlock((void*)(ptr + 1), (void*)ptr, num2);
				*ptr = 46;
				ptr += 1 + num2;
				bufferSize -= 1 + num2;
			}
			if (precision > (int)num2 && bufferSize > 1)
			{
				if (num2 == 0)
				{
					*ptr = 46;
					ptr++;
					bufferSize--;
				}
				uint num4 = (uint)(precision - num2);
				if (num4 > bufferSize - 1)
				{
					num4 = bufferSize - 1;
				}
				for (byte* ptr2 = ptr + num4; ptr < ptr2; ptr++)
				{
					*ptr = 48;
				}
			}
			if (bufferSize > 1)
			{
				byte* ptr3 = stackalloc byte[5];
				*ptr3 = 101;
				if (pOutExponent >= 0)
				{
					ptr3[1] = 43;
				}
				else
				{
					ptr3[1] = 45;
					pOutExponent = -pOutExponent;
				}
				uint num5 = (uint)(pOutExponent / 100);
				uint num6 = (uint)((pOutExponent - num5 * 100) / 10);
				uint num7 = (uint)(pOutExponent - num5 * 100 - num6 * 10);
				ptr3[2] = (byte)(48 + num5);
				ptr3[3] = (byte)(48 + num6);
				ptr3[4] = (byte)(48 + num7);
				uint num8 = bufferSize - 1;
				uint num9 = ((5 < num8) ? 5u : num8);
				Unsafe.CopyBlock((void*)ptr, (void*)ptr3, num9);
				ptr += num9;
				bufferSize -= num9;
			}
			return (int)(ptr - pOutBuffer);
		}

		private unsafe static void FormatInfinityNaN(byte* dest, ref int destIndex, int destLength, ulong mantissa, bool isNegative, FormatOptions formatOptions)
		{
			int length = ((mantissa == 0L) ? (8 + (isNegative ? 1 : 0)) : 3);
			int alignAndSize = formatOptions.AlignAndSize;
			if (AlignLeft(dest, ref destIndex, destLength, alignAndSize, length))
			{
				return;
			}
			if (mantissa == 0L)
			{
				if (isNegative)
				{
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = 45;
				}
				for (int i = 0; i < 8; i++)
				{
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = InfinityString[i];
				}
			}
			else
			{
				for (int j = 0; j < 3; j++)
				{
					if (destIndex >= destLength)
					{
						return;
					}
					dest[destIndex++] = NanString[j];
				}
			}
			AlignRight(dest, ref destIndex, destLength, alignAndSize, length);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private unsafe static void ConvertFloatToString(byte* dest, ref int destIndex, int destLength, float value, FormatOptions formatOptions)
		{
			tFloatUnion32 tFloatUnion = default(tFloatUnion32);
			tFloatUnion.m_floatingPoint = value;
			uint exponent = tFloatUnion.GetExponent();
			uint mantissa = tFloatUnion.GetMantissa();
			uint num;
			int exponent2;
			uint mantissaHighBitIdx;
			bool hasUnequalMargins;
			switch (exponent)
			{
			case 255u:
				FormatInfinityNaN(dest, ref destIndex, destLength, mantissa, tFloatUnion.IsNegative(), formatOptions);
				return;
			default:
				num = (uint)(0x800000uL | (ulong)mantissa);
				exponent2 = (int)(exponent - 127 - 23);
				mantissaHighBitIdx = 23u;
				hasUnequalMargins = exponent != 1 && mantissa == 0;
				break;
			case 0u:
				num = mantissa;
				exponent2 = -149;
				mantissaHighBitIdx = LogBase2(num);
				hasUnequalMargins = false;
				break;
			}
			int num2 = ((formatOptions.Specifier == 0) ? (-1) : formatOptions.Specifier);
			int num3 = Math.Max(10, num2 + 1);
			byte* ptr = stackalloc byte[(int)(uint)num3];
			if (num2 < 0)
			{
				num2 = 7;
			}
			int pOutExponent;
			uint num4 = Dragon4(num, exponent2, mantissaHighBitIdx, hasUnequalMargins, CutoffMode.TotalLength, (uint)num2, ptr, (uint)(num3 - 1), out pOutExponent);
			ptr[num4] = 0;
			bool isNegative = tFloatUnion.IsNegative();
			if (tFloatUnion.m_integer == 2147483648u)
			{
				isNegative = false;
			}
			NumberBuffer number = new NumberBuffer(NumberBufferKind.Float, ptr, (int)num4, pOutExponent + 1, isNegative);
			FormatNumber(dest, ref destIndex, destLength, ref number, num2, formatOptions);
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		private unsafe static void ConvertDoubleToString(byte* dest, ref int destIndex, int destLength, double value, FormatOptions formatOptions)
		{
			tFloatUnion64 tFloatUnion = default(tFloatUnion64);
			tFloatUnion.m_floatingPoint = value;
			uint exponent = tFloatUnion.GetExponent();
			ulong mantissa = tFloatUnion.GetMantissa();
			ulong num;
			int exponent2;
			uint mantissaHighBitIdx;
			bool hasUnequalMargins;
			switch (exponent)
			{
			case 2047u:
				FormatInfinityNaN(dest, ref destIndex, destLength, mantissa, tFloatUnion.IsNegative(), formatOptions);
				return;
			default:
				num = 0x10000000000000uL | mantissa;
				exponent2 = (int)(exponent - 1023 - 52);
				mantissaHighBitIdx = 52u;
				hasUnequalMargins = exponent != 1 && mantissa == 0;
				break;
			case 0u:
				num = mantissa;
				exponent2 = -1074;
				mantissaHighBitIdx = LogBase2((uint)num);
				hasUnequalMargins = false;
				break;
			}
			int num2 = ((formatOptions.Specifier == 0) ? (-1) : formatOptions.Specifier);
			int num3 = Math.Max(18, num2 + 1);
			byte* ptr = stackalloc byte[(int)(uint)num3];
			if (num2 < 0)
			{
				num2 = 15;
			}
			int pOutExponent;
			uint num4 = Dragon4(num, exponent2, mantissaHighBitIdx, hasUnequalMargins, CutoffMode.TotalLength, (uint)num2, ptr, (uint)(num3 - 1), out pOutExponent);
			ptr[num4] = 0;
			bool isNegative = tFloatUnion.IsNegative();
			if (tFloatUnion.m_integer == 9223372036854775808uL)
			{
				isNegative = false;
			}
			NumberBuffer number = new NumberBuffer(NumberBufferKind.Float, ptr, (int)num4, pOutExponent + 1, isNegative);
			FormatNumber(dest, ref destIndex, destLength, ref number, num2, formatOptions);
		}
	}
	internal enum DiagnosticId
	{
		ERR_InternalCompilerErrorInBackend = 100,
		ERR_InternalCompilerErrorInFunction = 101,
		ERR_InternalCompilerErrorInInstruction = 102,
		ERR_OnlyStaticMethodsAllowed = 1000,
		ERR_UnableToAccessManagedMethod = 1001,
		ERR_UnableToFindInterfaceMethod = 1002,
		ERR_UnexpectedEmptyMethodBody = 1003,
		ERR_ManagedArgumentsNotSupported = 1004,
		ERR_CatchConstructionNotSupported = 1006,
		ERR_CatchAndFilterConstructionNotSupported = 1007,
		ERR_LdfldaWithFixedArrayExpected = 1008,
		ERR_PointerExpected = 1009,
		ERR_LoadingFieldFromManagedObjectNotSupported = 1010,
		ERR_LoadingFieldWithManagedTypeNotSupported = 1011,
		ERR_LoadingArgumentWithManagedTypeNotSupported = 1012,
		ERR_CallingBurstDiscardMethodWithReturnValueNotSupported = 1015,
		ERR_CallingManagedMethodNotSupported = 1016,
		ERR_InstructionUnboxNotSupported = 1019,
		ERR_InstructionBoxNotSupported = 1020,
		ERR_InstructionNewobjWithManagedTypeNotSupported = 1021,
		ERR_AccessingManagedArrayNotSupported = 1022,
		ERR_InstructionLdtokenFieldNotSupported = 1023,
		ERR_InstructionLdtokenMethodNotSupported = 1024,
		ERR_InstructionLdtokenTypeNotSupported = 1025,
		ERR_InstructionLdtokenNotSupported = 1026,
		ERR_InstructionLdvirtftnNotSupported = 1027,
		ERR_InstructionNewarrNotSupported = 1028,
		ERR_InstructionRethrowNotSupported = 1029,
		ERR_InstructionCastclassNotSupported = 1030,
		ERR_InstructionLdftnNotSupported = 1032,
		ERR_InstructionLdstrNotSupported = 1033,
		ERR_InstructionStsfldNotSupported = 1034,
		ERR_InstructionEndfilterNotSupported = 1035,
		ERR_InstructionEndfinallyNotSupported = 1036,
		ERR_InstructionLeaveNotSupported = 1037,
		ERR_InstructionNotSupported = 1038,
		ERR_LoadingFromStaticFieldNotSupported = 1039,
		ERR_LoadingFromNonReadonlyStaticFieldNotSupported = 1040,
		ERR_LoadingFromManagedStaticFieldNotSupported = 1041,
		ERR_LoadingFromManagedNonReadonlyStaticFieldNotSupported = 1042,
		ERR_InstructionStfldToManagedObjectNotSupported = 1043,
		ERR_InstructionLdlenNonConstantLengthNotSupported = 1044,
		ERR_StructWithAutoLayoutNotSupported = 1045,
		ERR_StructWithGenericParametersAndExplicitLayoutNotSupported = 1047,
		ERR_StructSizeNotSupported = 1048,
		ERR_StructZeroSizeNotSupported = 1049,
		ERR_MarshalAsOnFieldNotSupported = 1050,
		ERR_TypeNotSupported = 1051,
		ERR_RequiredTypeModifierNotSupported = 1052,
		ERR_ErrorWhileProcessingVariable = 1053,
		ERR_UnableToResolveType = 1054,
		ERR_UnableToResolveMethod = 1055,
		ERR_ConstructorNotSupported = 1056,
		ERR_FunctionPointerMethodMissingBurstCompileAttribute = 1057,
		ERR_FunctionPointerTypeMissingBurstCompileAttribute = 1058,
		ERR_FunctionPointerMethodAndTypeMissingBurstCompileAttribute = 1059,
		INF_FunctionPointerMethodAndTypeMissingMonoPInvokeCallbackAttribute = 10590,
		ERR_MarshalAsOnParameterNotSupported = 1061,
		ERR_MarshalAsOnReturnTypeNotSupported = 1062,
		ERR_TypeNotBlittableForFunctionPointer = 1063,
		ERR_StructByValueNotSupported = 1064,
		ERR_StructsWithNonUnicodeCharsNotSupported = 1066,
		ERR_VectorsByValueNotSupported = 1067,
		ERR_MissingExternBindings = 1068,
		ERR_MarshalAsNativeTypeOnReturnTypeNotSupported = 1069,
		ERR_AssertTypeNotSupported = 1071,
		ERR_StoringToReadOnlyFieldNotAllowed = 1072,
		ERR_StoringToFieldInReadOnlyParameterNotAllowed = 1073,
		ERR_StoringToReadOnlyParameterNotAllowed = 1074,
		ERR_TypeManagerStaticFieldNotCompatible = 1075,
		ERR_UnableToFindTypeIndexForTypeManagerType = 1076,
		ERR_UnableToFindFieldForTypeManager = 1077,
		ERR_CircularStaticConstructorUsage = 1090,
		ERR_ExternalInternalCallsInStaticConstructorsNotSupported = 1091,
		ERR_PlatformNotSupported = 1092,
		ERR_InitModuleVerificationError = 1093,
		ERR_ModuleVerificationError = 1094,
		ERR_UnableToFindTypeRequiredForTypeManager = 1095,
		ERR_UnexpectedIntegerTypesForBinaryOperation = 1096,
		ERR_BinaryOperationNotSupported = 1097,
		ERR_CalliWithThisNotSupported = 1098,
		ERR_CalliNonCCallingConventionNotSupported = 1099,
		ERR_StringLiteralTooBig = 1100,
		ERR_LdftnNonCCallingConventionNotSupported = 1101,
		ERR_InstructionTargetCpuFeatureNotAllowedInThisBlock = 1200,
		ERR_AssumeRangeTypeMustBeInteger = 1201,
		ERR_AssumeRangeTypeMustBeSameSign = 1202,
		ERR_UnsupportedSpillTransform = 1300,
		ERR_UnsupportedSpillTransformTooManyUsers = 1301,
		ERR_MethodNotSupported = 1302,
		ERR_VectorsLoadFieldIsAddress = 1303,
		ERR_ConstantExpressionRequired = 1304,
		ERR_PointerArgumentsUnexpectedAliasing = 1310,
		ERR_LoopIntrinsicMustBeCalledInsideLoop = 1320,
		ERR_LoopUnexpectedAutoVectorization = 1321,
		WRN_LoopIntrinsicCalledButLoopOptimizedAway = 1322,
		ERR_AssertArgTypesDiffer = 1330,
		ERR_StringInternalCompilerFixedStringTooManyUsers = 1340,
		ERR_StringInvalidFormatMissingClosingBrace = 1341,
		ERR_StringInvalidIntegerForArgumentIndex = 1342,
		ERR_StringInvalidFormatForArgument = 1343,
		ERR_StringArgumentIndexOutOfRange = 1344,
		ERR_StringInvalidArgumentType = 1345,
		ERR_DebugLogNotSupported = 1346,
		ERR_StringInvalidNonLiteralFormat = 1347,
		ERR_StringInvalidStringFormatMethod = 1348,
		ERR_StringInvalidArgument = 1349,
		ERR_StringArrayInvalidArrayCreation = 1350,
		ERR_StringArrayInvalidArraySize = 1351,
		ERR_StringArrayInvalidControlFlow = 1352,
		ERR_StringArrayInvalidArrayIndex = 1353,
		ERR_StringArrayInvalidArrayIndexOutOfRange = 1354,
		ERR_UnmanagedStringMethodMissing = 1355,
		ERR_UnmanagedStringMethodInvalid = 1356,
		ERR_ManagedStaticConstructor = 1360,
		ERR_StaticConstantArrayInStaticConstructor = 1361,
		WRN_ExceptionThrownInNonSafetyCheckGuardedFunction = 1370,
		WRN_ACallToMethodHasBeenDiscarded = 1371,
		ERR_AccessingNestedManagedArrayNotSupported = 1380,
		ERR_LdobjFromANonPointerNonReference = 1381,
		ERR_StringLiteralRequired = 1382,
		ERR_MultiDimensionalArrayUnsupported = 1383,
		ERR_NonBlittableAndNonManagedSequentialStructNotSupported = 1384,
		ERR_VarArgFunctionNotSupported = 1385
	}
	public interface IFunctionPointer
	{
		[Obsolete("This method will be removed in a future version of Burst")]
		IFunctionPointer FromIntPtr(IntPtr ptr);
	}
	public readonly struct FunctionPointer<T> : IFunctionPointer
	{
		[NativeDisableUnsafePtrRestriction]
		private readonly IntPtr _ptr;

		public IntPtr Value => _ptr;

		public T Invoke => Marshal.GetDelegateForFunctionPointer<T>(_ptr);

		public bool IsCreated => _ptr != IntPtr.Zero;

		public FunctionPointer(IntPtr ptr)
		{
			_ptr = ptr;
		}

		[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
		private void CheckIsCreated()
		{
			if (!IsCreated)
			{
				throw new NullReferenceException("Object reference not set to an instance of an object");
			}
		}

		IFunctionPointer IFunctionPointer.FromIntPtr(IntPtr ptr)
		{
			return new FunctionPointer<T>(ptr);
		}
	}
	[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]
	public class NoAliasAttribute : Attribute
	{
	}
	internal static class SafeStringArrayHelper
	{
		public static string SerialiseStringArraySafe(string[] array)
		{
			StringBuilder stringBuilder = new StringBuilder();
			foreach (string text in array)
			{
				stringBuilder.Append($"{Encoding.UTF8.GetByteCount(text)}]");
				stringBuilder.Append(text);
			}
			return stringBuilder.ToString();
		}

		public static string[] DeserialiseStringArraySafe(string input)
		{
			byte[] bytes = Encoding.UTF8.GetBytes(input);
			List<string> list = new List<string>();
			int num = 0;
			int num2 = bytes.Length;
			while (num < num2)
			{
				int num3 = 0;
				while (true)
				{
					if (num >= num2)
					{
						throw new FormatException("Invalid input `" + input + "`: reached end while reading length");
					}
					byte b = bytes[num];
					switch (b)
					{
					case 93:
						break;
					default:
						throw new FormatException($"Invalid input `{input}` at {num}: Got non-digit character while reading length");
					case 48:
					case 49:
					case 50:
					case 51:
					case 52:
					case 53:
					case 54:
					case 55:
					case 56:
					case 57:
						goto IL_006b;
					}
					break;
					IL_006b:
					num3 = num3 * 10 + (b - 48);
					num++;
				}
				num++;
				list.Add(Encoding.UTF8.GetString(bytes, num, num3));
				num += num3;
			}
			return list.ToArray();
		}
	}
	public readonly struct SharedStatic<T> where T : struct
	{
		private unsafe readonly void* _buffer;

		private const uint DefaultAlignment = 16u;

		public unsafe ref T Data => ref Unsafe.AsRef<T>(_buffer);

		public unsafe void* UnsafeDataPointer => _buffer;

		private unsafe SharedStatic(void* buffer)
		{
			_buffer = buffer;
		}

		public static SharedStatic<T> GetOrCreate<TContext>(uint alignment = 0u)
		{
			return GetOrCreateUnsafe(alignment, BurstRuntime.GetHashCode64<TContext>(), 0L);
		}

		public static SharedStatic<T> GetOrCreate<TContext, TSubContext>(uint alignment = 0u)
		{
			return GetOrCreateUnsafe(alignment, BurstRuntime.GetHashCode64<TContext>(), BurstRuntime.GetHashCode64<TSubContext>());
		}

		public unsafe static SharedStatic<T> GetOrCreateUnsafe(uint alignment, long hashCode, long subHashCode)
		{
			return new SharedStatic<T>(SharedStatic.GetOrCreateSharedStaticInternal(hashCode, subHashCode, (uint)UnsafeUtility.SizeOf<T>(), (alignment == 0) ? 16u : alignment));
		}

		public unsafe static SharedStatic<T> GetOrCreatePartiallyUnsafeWithHashCode<TSubContext>(uint alignment, long hashCode)
		{
			return new SharedStatic<T>(SharedStatic.GetOrCreateSharedStaticInternal(hashCode, BurstRuntime.GetHashCode64<TSubContext>(), (uint)UnsafeUtility.SizeOf<T>(), (alignment == 0) ? 16u : alignment));
		}

		public unsafe static SharedStatic<T> GetOrCreatePartiallyUnsafeWithSubHashCode<TContext>(uint alignment, long subHashCode)
		{
			return new SharedStatic<T>(SharedStatic.GetOrCreateSharedStaticInternal(BurstRuntime.GetHashCode64<TContext>(), subHashCode, (uint)UnsafeUtility.SizeOf<T>(), (alignment == 0) ? 16u : alignment));
		}

		public static SharedStatic<T> GetOrCreate(Type contextType, uint alignment = 0u)
		{
			return GetOrCreateUnsafe(alignment, BurstRuntime.GetHashCode64(contextType), 0L);
		}

		public static SharedStatic<T> GetOrCreate(Type contextType, Type subContextType, uint alignment = 0u)
		{
			return GetOrCreateUnsafe(alignment, BurstRuntime.GetHashCode64(contextType), BurstRuntime.GetHashCode64(subContextType));
		}

		[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
		private static void CheckIf_T_IsUnmanagedOrThrow()
		{
			if (!UnsafeUtility.IsUnmanaged<T>())
			{
				throw new InvalidOperationException($"The type {typeof(T)} used in SharedStatic<{typeof(T)}> must be unmanaged (contain no managed types).");
			}
		}
	}
	internal static class SharedStatic
	{
		internal class PreserveAttribute : Attribute
		{
		}

		[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
		private static void CheckSizeOf(uint sizeOf)
		{
			if (sizeOf == 0)
			{
				throw new ArgumentException("sizeOf must be > 0", "sizeOf");
			}
		}

		[Conditional("ENABLE_UNITY_COLLECTIONS_CHECKS")]
		private unsafe static void CheckResult(void* result)
		{
			if (result == null)
			{
				throw new InvalidOperationException("Unable to create a SharedStatic for this key. This is most likely due to the size of the struct inside of the SharedStatic having changed or the same key being reused for differently sized values. To fix this the editor needs to be restarted.");
			}
		}

		[Preserve]
		public unsafe static void* GetOrCreateSharedStaticInternal(long getHashCode64, long getSubHashCode64, uint sizeOf, uint alignment)
		{
			Hash128 val = default(Hash128);
			((Hash128)(ref val))..ctor((ulong)getHashCode64, (ulong)getSubHashCode64);
			return BurstCompilerService.GetOrCreateSharedMemory(ref val, sizeOf, alignment);
		}
	}
}
namespace Unity.Burst.Intrinsics
{
	public static class Arm
	{
		public class Neon
		{
			public static bool IsNeonSupported => false;

			public static bool IsNeonArmv82FeaturesSupported => false;

			public static bool IsNeonCryptoSupported => false;

			public static bool IsNeonDotProdSupported => false;

			public static bool IsNeonRDMASupported => false;

			[DebuggerStepThrough]
			public static v64 vadd_s8(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddq_s8(v128 a0, v128 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v64 vadd_s16(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddq_s16(v128 a0, v128 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v64 vadd_s32(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddq_s32(v128 a0, v128 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v64 vadd_s64(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddq_s64(v128 a0, v128 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v64 vadd_u8(v64 a0, v64 a1)
			{
				return vadd_s8(a0, a1);
			}

			[DebuggerStepThrough]
			public static v128 vaddq_u8(v128 a0, v128 a1)
			{
				return vaddq_s8(a0, a1);
			}

			[DebuggerStepThrough]
			public static v64 vadd_u16(v64 a0, v64 a1)
			{
				return vadd_s16(a0, a1);
			}

			[DebuggerStepThrough]
			public static v128 vaddq_u16(v128 a0, v128 a1)
			{
				return vaddq_s16(a0, a1);
			}

			[DebuggerStepThrough]
			public static v64 vadd_u32(v64 a0, v64 a1)
			{
				return vadd_s32(a0, a1);
			}

			[DebuggerStepThrough]
			public static v128 vaddq_u32(v128 a0, v128 a1)
			{
				return vaddq_s32(a0, a1);
			}

			[DebuggerStepThrough]
			public static v64 vadd_u64(v64 a0, v64 a1)
			{
				return vadd_s64(a0, a1);
			}

			[DebuggerStepThrough]
			public static v128 vaddq_u64(v128 a0, v128 a1)
			{
				return vaddq_s64(a0, a1);
			}

			[DebuggerStepThrough]
			public static v64 vadd_f32(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddq_f32(v128 a0, v128 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddl_s8(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddl_s16(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddl_s32(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddl_u8(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddl_u16(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddl_u32(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddw_s8(v128 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddw_s16(v128 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddw_s32(v128 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddw_u8(v128 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddw_u16(v128 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vaddw_u32(v128 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v64 vhadd_s8(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v128 vhaddq_s8(v128 a0, v128 a1)
			{
				throw new NotImplementedException();
			}

			[DebuggerStepThrough]
			public static v64 vhadd_s16(v64 a0, v64 a1)
			{
				throw new NotImplementedException();
			}

BepInEx\plugins\Cyberhead\Unity.InputSystem.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.XR.GoogleVr;
using Unity.XR.OpenVR;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Experimental.Rendering;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Composites;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.DualShock;
using UnityEngine.InputSystem.DualShock.LowLevel;
using UnityEngine.InputSystem.HID;
using UnityEngine.InputSystem.Haptics;
using UnityEngine.InputSystem.Interactions;
using UnityEngine.InputSystem.Layouts;
using UnityEngine.InputSystem.LowLevel;
using UnityEngine.InputSystem.Processors;
using UnityEngine.InputSystem.Switch;
using UnityEngine.InputSystem.Switch.LowLevel;
using UnityEngine.InputSystem.UI;
using UnityEngine.InputSystem.Users;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.InputSystem.XInput;
using UnityEngine.InputSystem.XInput.LowLevel;
using UnityEngine.InputSystem.XR;
using UnityEngine.InputSystem.XR.Haptics;
using UnityEngine.Networking.PlayerConnection;
using UnityEngine.Pool;
using UnityEngine.Scripting;
using UnityEngine.Serialization;
using UnityEngine.UI;
using UnityEngine.UIElements;
using UnityEngine.XR;
using UnityEngine.XR.WindowsMR.Input;
using UnityEngineInternal.Input;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Unity.InputSystem.TestFramework")]
[assembly: InternalsVisibleTo("Unity.InputSystem.Tests.Editor")]
[assembly: InternalsVisibleTo("Unity.InputSystem.Tests")]
[assembly: InternalsVisibleTo("Unity.InputSystem.IntegrationTests")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.7.0.0")]
[module: UnverifiableCode]
internal static class UISupport
{
	public static void Initialize()
	{
		InputSystem.RegisterLayout("\n            {\n                \"name\" : \"VirtualMouse\",\n                \"extend\" : \"Mouse\"\n            }\n        ");
	}
}
namespace Unity.XR.OpenVR
{
	[InputControlLayout(displayName = "OpenVR Headset", hideInUI = true)]
	public class OpenVRHMD : XRHMD
	{
		[InputControl(noisy = true)]
		public Vector3Control deviceVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control deviceAngularVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control leftEyeVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control leftEyeAngularVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control rightEyeVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control rightEyeAngularVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control centerEyeVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control centerEyeAngularVelocity { get; protected set; }

		protected override void FinishSetup()
		{
			base.FinishSetup();
			deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity");
			deviceAngularVelocity = GetChildControl<Vector3Control>("deviceAngularVelocity");
			leftEyeVelocity = GetChildControl<Vector3Control>("leftEyeVelocity");
			leftEyeAngularVelocity = GetChildControl<Vector3Control>("leftEyeAngularVelocity");
			rightEyeVelocity = GetChildControl<Vector3Control>("rightEyeVelocity");
			rightEyeAngularVelocity = GetChildControl<Vector3Control>("rightEyeAngularVelocity");
			centerEyeVelocity = GetChildControl<Vector3Control>("centerEyeVelocity");
			centerEyeAngularVelocity = GetChildControl<Vector3Control>("centerEyeAngularVelocity");
		}
	}
	[InputControlLayout(displayName = "Windows MR Controller (OpenVR)", commonUsages = new string[] { "LeftHand", "RightHand" }, hideInUI = true)]
	public class OpenVRControllerWMR : XRController
	{
		[InputControl(noisy = true)]
		public Vector3Control deviceVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control deviceAngularVelocity { get; protected set; }

		[InputControl(aliases = new string[] { "primary2DAxisClick", "joystickOrPadPressed" })]
		public ButtonControl touchpadClick { get; protected set; }

		[InputControl(aliases = new string[] { "primary2DAxisTouch", "joystickOrPadTouched" })]
		public ButtonControl touchpadTouch { get; protected set; }

		[InputControl]
		public ButtonControl gripPressed { get; protected set; }

		[InputControl]
		public ButtonControl triggerPressed { get; protected set; }

		[InputControl(aliases = new string[] { "primary" })]
		public ButtonControl menu { get; protected set; }

		[InputControl]
		public AxisControl trigger { get; protected set; }

		[InputControl]
		public AxisControl grip { get; protected set; }

		[InputControl(aliases = new string[] { "secondary2DAxis" })]
		public Vector2Control touchpad { get; protected set; }

		[InputControl(aliases = new string[] { "primary2DAxis" })]
		public Vector2Control joystick { get; protected set; }

		protected override void FinishSetup()
		{
			base.FinishSetup();
			deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity");
			deviceAngularVelocity = GetChildControl<Vector3Control>("deviceAngularVelocity");
			touchpadClick = GetChildControl<ButtonControl>("touchpadClick");
			touchpadTouch = GetChildControl<ButtonControl>("touchpadTouch");
			gripPressed = GetChildControl<ButtonControl>("gripPressed");
			triggerPressed = GetChildControl<ButtonControl>("triggerPressed");
			menu = GetChildControl<ButtonControl>("menu");
			trigger = GetChildControl<AxisControl>("trigger");
			grip = GetChildControl<AxisControl>("grip");
			touchpad = GetChildControl<Vector2Control>("touchpad");
			joystick = GetChildControl<Vector2Control>("joystick");
		}
	}
	[InputControlLayout(displayName = "Vive Wand", commonUsages = new string[] { "LeftHand", "RightHand" }, hideInUI = true)]
	public class ViveWand : XRControllerWithRumble
	{
		[InputControl]
		public AxisControl grip { get; protected set; }

		[InputControl]
		public ButtonControl gripPressed { get; protected set; }

		[InputControl]
		public ButtonControl primary { get; protected set; }

		[InputControl(aliases = new string[] { "primary2DAxisClick", "joystickOrPadPressed" })]
		public ButtonControl trackpadPressed { get; protected set; }

		[InputControl(aliases = new string[] { "primary2DAxisTouch", "joystickOrPadTouched" })]
		public ButtonControl trackpadTouched { get; protected set; }

		[InputControl(aliases = new string[] { "Primary2DAxis" })]
		public Vector2Control trackpad { get; protected set; }

		[InputControl]
		public AxisControl trigger { get; protected set; }

		[InputControl]
		public ButtonControl triggerPressed { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control deviceVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control deviceAngularVelocity { get; protected set; }

		protected override void FinishSetup()
		{
			base.FinishSetup();
			grip = GetChildControl<AxisControl>("grip");
			primary = GetChildControl<ButtonControl>("primary");
			gripPressed = GetChildControl<ButtonControl>("gripPressed");
			trackpadPressed = GetChildControl<ButtonControl>("trackpadPressed");
			trackpadTouched = GetChildControl<ButtonControl>("trackpadTouched");
			trackpad = GetChildControl<Vector2Control>("trackpad");
			trigger = GetChildControl<AxisControl>("trigger");
			triggerPressed = GetChildControl<ButtonControl>("triggerPressed");
			deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity");
			deviceAngularVelocity = GetChildControl<Vector3Control>("deviceAngularVelocity");
		}
	}
	[InputControlLayout(displayName = "Vive Lighthouse", hideInUI = true)]
	public class ViveLighthouse : TrackedDevice
	{
	}
	[InputControlLayout(displayName = "Vive Tracker")]
	public class ViveTracker : TrackedDevice
	{
		[InputControl(noisy = true)]
		public Vector3Control deviceVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control deviceAngularVelocity { get; protected set; }

		protected override void FinishSetup()
		{
			base.FinishSetup();
			deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity");
			deviceAngularVelocity = GetChildControl<Vector3Control>("deviceAngularVelocity");
		}
	}
	[InputControlLayout(displayName = "Handed Vive Tracker", commonUsages = new string[] { "LeftHand", "RightHand" }, hideInUI = true)]
	public class HandedViveTracker : ViveTracker
	{
		[InputControl]
		public AxisControl grip { get; protected set; }

		[InputControl]
		public ButtonControl gripPressed { get; protected set; }

		[InputControl]
		public ButtonControl primary { get; protected set; }

		[InputControl(aliases = new string[] { "JoystickOrPadPressed" })]
		public ButtonControl trackpadPressed { get; protected set; }

		[InputControl]
		public ButtonControl triggerPressed { get; protected set; }

		protected override void FinishSetup()
		{
			grip = GetChildControl<AxisControl>("grip");
			primary = GetChildControl<ButtonControl>("primary");
			gripPressed = GetChildControl<ButtonControl>("gripPressed");
			trackpadPressed = GetChildControl<ButtonControl>("trackpadPressed");
			triggerPressed = GetChildControl<ButtonControl>("triggerPressed");
			base.FinishSetup();
		}
	}
	[InputControlLayout(displayName = "Oculus Touch Controller (OpenVR)", commonUsages = new string[] { "LeftHand", "RightHand" }, hideInUI = true)]
	public class OpenVROculusTouchController : XRControllerWithRumble
	{
		[InputControl]
		public Vector2Control thumbstick { get; protected set; }

		[InputControl]
		public AxisControl trigger { get; protected set; }

		[InputControl]
		public AxisControl grip { get; protected set; }

		[InputControl(aliases = new string[] { "Alternate" })]
		public ButtonControl primaryButton { get; protected set; }

		[InputControl(aliases = new string[] { "Primary" })]
		public ButtonControl secondaryButton { get; protected set; }

		[InputControl]
		public ButtonControl gripPressed { get; protected set; }

		[InputControl]
		public ButtonControl triggerPressed { get; protected set; }

		[InputControl(aliases = new string[] { "primary2DAxisClicked" })]
		public ButtonControl thumbstickClicked { get; protected set; }

		[InputControl(aliases = new string[] { "primary2DAxisTouch" })]
		public ButtonControl thumbstickTouched { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control deviceVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control deviceAngularVelocity { get; protected set; }

		protected override void FinishSetup()
		{
			base.FinishSetup();
			thumbstick = GetChildControl<Vector2Control>("thumbstick");
			trigger = GetChildControl<AxisControl>("trigger");
			grip = GetChildControl<AxisControl>("grip");
			primaryButton = GetChildControl<ButtonControl>("primaryButton");
			secondaryButton = GetChildControl<ButtonControl>("secondaryButton");
			gripPressed = GetChildControl<ButtonControl>("gripPressed");
			thumbstickClicked = GetChildControl<ButtonControl>("thumbstickClicked");
			thumbstickTouched = GetChildControl<ButtonControl>("thumbstickTouched");
			triggerPressed = GetChildControl<ButtonControl>("triggerPressed");
			deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity");
			deviceAngularVelocity = GetChildControl<Vector3Control>("deviceAngularVelocity");
		}
	}
}
namespace Unity.XR.GoogleVr
{
	[InputControlLayout(displayName = "Daydream Headset", hideInUI = true)]
	public class DaydreamHMD : XRHMD
	{
	}
	[InputControlLayout(displayName = "Daydream Controller", commonUsages = new string[] { "LeftHand", "RightHand" }, hideInUI = true)]
	public class DaydreamController : XRController
	{
		[InputControl]
		public Vector2Control touchpad { get; protected set; }

		[InputControl]
		public ButtonControl volumeUp { get; protected set; }

		[InputControl]
		public ButtonControl recentered { get; protected set; }

		[InputControl]
		public ButtonControl volumeDown { get; protected set; }

		[InputControl]
		public ButtonControl recentering { get; protected set; }

		[InputControl]
		public ButtonControl app { get; protected set; }

		[InputControl]
		public ButtonControl home { get; protected set; }

		[InputControl]
		public ButtonControl touchpadClicked { get; protected set; }

		[InputControl]
		public ButtonControl touchpadTouched { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control deviceVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control deviceAcceleration { get; protected set; }

		protected override void FinishSetup()
		{
			base.FinishSetup();
			touchpad = GetChildControl<Vector2Control>("touchpad");
			volumeUp = GetChildControl<ButtonControl>("volumeUp");
			recentered = GetChildControl<ButtonControl>("recentered");
			volumeDown = GetChildControl<ButtonControl>("volumeDown");
			recentering = GetChildControl<ButtonControl>("recentering");
			app = GetChildControl<ButtonControl>("app");
			home = GetChildControl<ButtonControl>("home");
			touchpadClicked = GetChildControl<ButtonControl>("touchpadClicked");
			touchpadTouched = GetChildControl<ButtonControl>("touchpadTouched");
			deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity");
			deviceAcceleration = GetChildControl<Vector3Control>("deviceAcceleration");
		}
	}
}
namespace UnityEngine.XR.WindowsMR.Input
{
	[InputControlLayout(displayName = "Windows MR Headset", hideInUI = true)]
	public class WMRHMD : XRHMD
	{
		[InputControl]
		[InputControl(name = "devicePosition", layout = "Vector3", aliases = new string[] { "HeadPosition" })]
		[InputControl(name = "deviceRotation", layout = "Quaternion", aliases = new string[] { "HeadRotation" })]
		public ButtonControl userPresence { get; protected set; }

		protected override void FinishSetup()
		{
			base.FinishSetup();
			userPresence = GetChildControl<ButtonControl>("userPresence");
		}
	}
	[InputControlLayout(displayName = "HoloLens Hand", commonUsages = new string[] { "LeftHand", "RightHand" }, hideInUI = true)]
	public class HololensHand : XRController
	{
		[InputControl(noisy = true, aliases = new string[] { "gripVelocity" })]
		public Vector3Control deviceVelocity { get; protected set; }

		[InputControl(aliases = new string[] { "triggerbutton" })]
		public ButtonControl airTap { get; protected set; }

		[InputControl(noisy = true)]
		public AxisControl sourceLossRisk { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control sourceLossMitigationDirection { get; protected set; }

		protected override void FinishSetup()
		{
			base.FinishSetup();
			airTap = GetChildControl<ButtonControl>("airTap");
			deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity");
			sourceLossRisk = GetChildControl<AxisControl>("sourceLossRisk");
			sourceLossMitigationDirection = GetChildControl<Vector3Control>("sourceLossMitigationDirection");
		}
	}
	[InputControlLayout(displayName = "Windows MR Controller", commonUsages = new string[] { "LeftHand", "RightHand" }, hideInUI = true)]
	public class WMRSpatialController : XRControllerWithRumble
	{
		[InputControl(aliases = new string[] { "Primary2DAxis", "thumbstickaxes" })]
		public Vector2Control joystick { get; protected set; }

		[InputControl(aliases = new string[] { "Secondary2DAxis", "touchpadaxes" })]
		public Vector2Control touchpad { get; protected set; }

		[InputControl(aliases = new string[] { "gripaxis" })]
		public AxisControl grip { get; protected set; }

		[InputControl(aliases = new string[] { "gripbutton" })]
		public ButtonControl gripPressed { get; protected set; }

		[InputControl(aliases = new string[] { "Primary", "menubutton" })]
		public ButtonControl menu { get; protected set; }

		[InputControl(aliases = new string[] { "triggeraxis" })]
		public AxisControl trigger { get; protected set; }

		[InputControl(aliases = new string[] { "triggerbutton" })]
		public ButtonControl triggerPressed { get; protected set; }

		[InputControl(aliases = new string[] { "thumbstickpressed" })]
		public ButtonControl joystickClicked { get; protected set; }

		[InputControl(aliases = new string[] { "joystickorpadpressed", "touchpadpressed" })]
		public ButtonControl touchpadClicked { get; protected set; }

		[InputControl(aliases = new string[] { "joystickorpadtouched", "touchpadtouched" })]
		public ButtonControl touchpadTouched { get; protected set; }

		[InputControl(noisy = true, aliases = new string[] { "gripVelocity" })]
		public Vector3Control deviceVelocity { get; protected set; }

		[InputControl(noisy = true, aliases = new string[] { "gripAngularVelocity" })]
		public Vector3Control deviceAngularVelocity { get; protected set; }

		[InputControl(noisy = true)]
		public AxisControl batteryLevel { get; protected set; }

		[InputControl(noisy = true)]
		public AxisControl sourceLossRisk { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control sourceLossMitigationDirection { get; protected set; }

		[InputControl(noisy = true)]
		public Vector3Control pointerPosition { get; protected set; }

		[InputControl(noisy = true, aliases = new string[] { "PointerOrientation" })]
		public QuaternionControl pointerRotation { get; protected set; }

		protected override void FinishSetup()
		{
			base.FinishSetup();
			joystick = GetChildControl<Vector2Control>("joystick");
			trigger = GetChildControl<AxisControl>("trigger");
			touchpad = GetChildControl<Vector2Control>("touchpad");
			grip = GetChildControl<AxisControl>("grip");
			gripPressed = GetChildControl<ButtonControl>("gripPressed");
			menu = GetChildControl<ButtonControl>("menu");
			joystickClicked = GetChildControl<ButtonControl>("joystickClicked");
			triggerPressed = GetChildControl<ButtonControl>("triggerPressed");
			touchpadClicked = GetChildControl<ButtonControl>("touchpadClicked");
			touchpadTouched = GetChildControl<ButtonControl>("touchPadTouched");
			deviceVelocity = GetChildControl<Vector3Control>("deviceVelocity");
			deviceAngularVelocity = GetChildControl<Vector3Control>("deviceAngularVelocity");
			batteryLevel = GetChildControl<AxisControl>("batteryLevel");
			sourceLossRisk = GetChildControl<AxisControl>("sourceLossRisk");
			sourceLossMitigationDirection = GetChildControl<Vector3Control>("sourceLossMitigationDirection");
			pointerPosition = GetChildControl<Vector3Control>("pointerPosition");
			pointerRotation = GetChildControl<QuaternionControl>("pointerRotation");
		}
	}
}
namespace UnityEngine.InputSystem
{
	public interface IInputActionCollection : IEnumerable<InputAction>, IEnumerable
	{
		InputBinding? bindingMask { get; set; }

		ReadOnlyArray<InputDevice>? devices { get; set; }

		ReadOnlyArray<InputControlScheme> controlSchemes { get; }

		bool Contains(InputAction action);

		void Enable();

		void Disable();
	}
	public interface IInputActionCollection2 : IInputActionCollection, IEnumerable<InputAction>, IEnumerable
	{
		IEnumerable<InputBinding> bindings { get; }

		InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false);

		int FindBinding(InputBinding mask, out InputAction action);
	}
	public interface IInputInteraction
	{
		void Process(ref InputInteractionContext context);

		void Reset();
	}
	public interface IInputInteraction<TValue> : IInputInteraction where TValue : struct
	{
	}
	internal static class InputInteraction
	{
		public static TypeTable s_Interactions;

		public static Type GetValueType(Type interactionType)
		{
			if (interactionType == null)
			{
				throw new ArgumentNullException("interactionType");
			}
			return TypeHelpers.GetGenericTypeArgumentFromHierarchy(interactionType, typeof(IInputInteraction<>), 0);
		}

		public static string GetDisplayName(string interaction)
		{
			if (string.IsNullOrEmpty(interaction))
			{
				throw new ArgumentNullException("interaction");
			}
			Type type = s_Interactions.LookupTypeRegistration(interaction);
			if (type == null)
			{
				return interaction;
			}
			return GetDisplayName(type);
		}

		public static string GetDisplayName(Type interactionType)
		{
			if (interactionType == null)
			{
				throw new ArgumentNullException("interactionType");
			}
			DisplayNameAttribute customAttribute = interactionType.GetCustomAttribute<DisplayNameAttribute>();
			if (customAttribute == null)
			{
				if (interactionType.Name.EndsWith("Interaction"))
				{
					return interactionType.Name.Substring(0, interactionType.Name.Length - "Interaction".Length);
				}
				return interactionType.Name;
			}
			return customAttribute.DisplayName;
		}
	}
	[Serializable]
	public sealed class InputAction : ICloneable, IDisposable
	{
		[Flags]
		internal enum ActionFlags
		{
			WantsInitialStateCheck = 1
		}

		public struct CallbackContext
		{
			internal InputActionState m_State;

			internal int m_ActionIndex;

			private int actionIndex => m_ActionIndex;

			private unsafe int bindingIndex => m_State.actionStates[actionIndex].bindingIndex;

			private unsafe int controlIndex => m_State.actionStates[actionIndex].controlIndex;

			private unsafe int interactionIndex => m_State.actionStates[actionIndex].interactionIndex;

			public unsafe InputActionPhase phase
			{
				get
				{
					if (m_State == null)
					{
						return InputActionPhase.Disabled;
					}
					return m_State.actionStates[actionIndex].phase;
				}
			}

			public bool started => phase == InputActionPhase.Started;

			public bool performed => phase == InputActionPhase.Performed;

			public bool canceled => phase == InputActionPhase.Canceled;

			public InputAction action => m_State?.GetActionOrNull(bindingIndex);

			public InputControl control
			{
				get
				{
					InputActionState state = m_State;
					if (state == null)
					{
						return null;
					}
					return state.controls[controlIndex];
				}
			}

			public IInputInteraction interaction
			{
				get
				{
					if (m_State == null)
					{
						return null;
					}
					int num = interactionIndex;
					if (num == -1)
					{
						return null;
					}
					return m_State.interactions[num];
				}
			}

			public unsafe double time
			{
				get
				{
					if (m_State == null)
					{
						return 0.0;
					}
					return m_State.actionStates[actionIndex].time;
				}
			}

			public unsafe double startTime
			{
				get
				{
					if (m_State == null)
					{
						return 0.0;
					}
					return m_State.actionStates[actionIndex].startTime;
				}
			}

			public double duration => time - startTime;

			public Type valueType => m_State?.GetValueType(bindingIndex, controlIndex);

			public int valueSizeInBytes
			{
				get
				{
					if (m_State == null)
					{
						return 0;
					}
					return m_State.GetValueSizeInBytes(bindingIndex, controlIndex);
				}
			}

			public unsafe void ReadValue(void* buffer, int bufferSize)
			{
				if (buffer == null)
				{
					throw new ArgumentNullException("buffer");
				}
				if (m_State != null && phase.IsInProgress())
				{
					m_State.ReadValue(bindingIndex, controlIndex, buffer, bufferSize);
					return;
				}
				int num = valueSizeInBytes;
				if (bufferSize < num)
				{
					throw new ArgumentException($"Expected buffer of at least {num} bytes but got buffer of only {bufferSize} bytes", "bufferSize");
				}
				UnsafeUtility.MemClear(buffer, (long)valueSizeInBytes);
			}

			public TValue ReadValue<TValue>() where TValue : struct
			{
				TValue val = default(TValue);
				if (m_State != null)
				{
					return phase.IsInProgress() ? m_State.ReadValue<TValue>(bindingIndex, controlIndex) : m_State.ApplyProcessors(bindingIndex, val);
				}
				return val;
			}

			public bool ReadValueAsButton()
			{
				bool result = false;
				if (m_State != null && phase.IsInProgress())
				{
					result = m_State.ReadValueAsButton(bindingIndex, controlIndex);
				}
				return result;
			}

			public object ReadValueAsObject()
			{
				if (m_State != null && phase.IsInProgress())
				{
					return m_State.ReadValueAsObject(bindingIndex, controlIndex);
				}
				return null;
			}

			public override string ToString()
			{
				return $"{{ action={action} phase={phase} time={time} control={control} value={ReadValueAsObject()} interaction={interaction} }}";
			}
		}

		[Tooltip("Human readable name of the action. Must be unique within its action map (case is ignored). Can be changed without breaking references to the action.")]
		[SerializeField]
		internal string m_Name;

		[Tooltip("Determines how the action triggers.\n\nA Value action will start and perform when a control moves from its default value and then perform on every value change. It will cancel when controls go back to default value. Also, when enabled, a Value action will respond right away to a control's current value.\n\nA Button action will start when a button is pressed and perform when the press threshold (see 'Default Button Press Point' in settings) is reached. It will cancel when the button is going below the release threshold (see 'Button Release Threshold' in settings). Also, if a button is already pressed when the action is enabled, the button has to be released first.\n\nA Pass-Through action will not explicitly start and will never cancel. Instead, for every value change on any bound control, the action will perform.")]
		[SerializeField]
		internal InputActionType m_Type;

		[FormerlySerializedAs("m_ExpectedControlLayout")]
		[Tooltip("The type of control expected by the action (e.g. \"Button\" or \"Stick\"). This will limit the controls shown when setting up bindings in the UI and will also limit which controls can be bound interactively to the action.")]
		[SerializeField]
		internal string m_ExpectedControlType;

		[Tooltip("Unique ID of the action (GUID). Used to reference the action from bindings such that actions can be renamed without breaking references.")]
		[SerializeField]
		internal string m_Id;

		[SerializeField]
		internal string m_Processors;

		[SerializeField]
		internal string m_Interactions;

		[SerializeField]
		internal InputBinding[] m_SingletonActionBindings;

		[SerializeField]
		internal ActionFlags m_Flags;

		[NonSerialized]
		internal InputBinding? m_BindingMask;

		[NonSerialized]
		internal int m_BindingsStartIndex;

		[NonSerialized]
		internal int m_BindingsCount;

		[NonSerialized]
		internal int m_ControlStartIndex;

		[NonSerialized]
		internal int m_ControlCount;

		[NonSerialized]
		internal int m_ActionIndexInState = -1;

		[NonSerialized]
		internal InputActionMap m_ActionMap;

		[NonSerialized]
		internal CallbackArray<Action<CallbackContext>> m_OnStarted;

		[NonSerialized]
		internal CallbackArray<Action<CallbackContext>> m_OnCanceled;

		[NonSerialized]
		internal CallbackArray<Action<CallbackContext>> m_OnPerformed;

		public string name => m_Name;

		public InputActionType type => m_Type;

		public Guid id
		{
			get
			{
				MakeSureIdIsInPlace();
				return new Guid(m_Id);
			}
		}

		internal Guid idDontGenerate
		{
			get
			{
				if (string.IsNullOrEmpty(m_Id))
				{
					return default(Guid);
				}
				return new Guid(m_Id);
			}
		}

		public string expectedControlType
		{
			get
			{
				return m_ExpectedControlType;
			}
			set
			{
				m_ExpectedControlType = value;
			}
		}

		public string processors => m_Processors;

		public string interactions => m_Interactions;

		public InputActionMap actionMap
		{
			get
			{
				if (!isSingletonAction)
				{
					return m_ActionMap;
				}
				return null;
			}
		}

		public InputBinding? bindingMask
		{
			get
			{
				return m_BindingMask;
			}
			set
			{
				if (!(value == m_BindingMask))
				{
					if (value.HasValue)
					{
						InputBinding value2 = value.Value;
						value2.action = name;
						value = value2;
					}
					m_BindingMask = value;
					InputActionMap orCreateActionMap = GetOrCreateActionMap();
					if (orCreateActionMap.m_State != null)
					{
						orCreateActionMap.LazyResolveBindings(fullResolve: true);
					}
				}
			}
		}

		public ReadOnlyArray<InputBinding> bindings => GetOrCreateActionMap().GetBindingsForSingleAction(this);

		public ReadOnlyArray<InputControl> controls
		{
			get
			{
				InputActionMap orCreateActionMap = GetOrCreateActionMap();
				orCreateActionMap.ResolveBindingsIfNecessary();
				return orCreateActionMap.GetControlsForSingleAction(this);
			}
		}

		public InputActionPhase phase => currentState.phase;

		public bool inProgress => phase.IsInProgress();

		public bool enabled => phase != InputActionPhase.Disabled;

		public bool triggered => WasPerformedThisFrame();

		public unsafe InputControl activeControl
		{
			get
			{
				InputActionState state = GetOrCreateActionMap().m_State;
				if (state != null)
				{
					int controlIndex = state.actionStates[m_ActionIndexInState].controlIndex;
					if (controlIndex != -1)
					{
						return state.controls[controlIndex];
					}
				}
				return null;
			}
		}

		public bool wantsInitialStateCheck
		{
			get
			{
				if (type != 0)
				{
					return (m_Flags & ActionFlags.WantsInitialStateCheck) != 0;
				}
				return true;
			}
			set
			{
				if (value)
				{
					m_Flags |= ActionFlags.WantsInitialStateCheck;
				}
				else
				{
					m_Flags &= ~ActionFlags.WantsInitialStateCheck;
				}
			}
		}

		internal bool isSingletonAction
		{
			get
			{
				if (m_ActionMap != null)
				{
					return m_ActionMap.m_SingletonAction == this;
				}
				return true;
			}
		}

		private InputActionState.TriggerState currentState
		{
			get
			{
				if (m_ActionIndexInState == -1)
				{
					return default(InputActionState.TriggerState);
				}
				return m_ActionMap.m_State.FetchActionState(this);
			}
		}

		public event Action<CallbackContext> started
		{
			add
			{
				m_OnStarted.AddCallback(value);
			}
			remove
			{
				m_OnStarted.RemoveCallback(value);
			}
		}

		public event Action<CallbackContext> canceled
		{
			add
			{
				m_OnCanceled.AddCallback(value);
			}
			remove
			{
				m_OnCanceled.RemoveCallback(value);
			}
		}

		public event Action<CallbackContext> performed
		{
			add
			{
				m_OnPerformed.AddCallback(value);
			}
			remove
			{
				m_OnPerformed.RemoveCallback(value);
			}
		}

		public InputAction()
		{
			m_Id = Guid.NewGuid().ToString();
		}

		public InputAction(string name = null, InputActionType type = InputActionType.Value, string binding = null, string interactions = null, string processors = null, string expectedControlType = null)
		{
			m_Name = name;
			m_Type = type;
			if (!string.IsNullOrEmpty(binding))
			{
				m_SingletonActionBindings = new InputBinding[1]
				{
					new InputBinding
					{
						path = binding,
						interactions = interactions,
						processors = processors,
						action = m_Name,
						id = Guid.NewGuid()
					}
				};
				m_BindingsStartIndex = 0;
				m_BindingsCount = 1;
			}
			else
			{
				m_Interactions = interactions;
				m_Processors = processors;
			}
			m_ExpectedControlType = expectedControlType;
			m_Id = Guid.NewGuid().ToString();
		}

		public void Dispose()
		{
			m_ActionMap?.m_State?.Dispose();
		}

		public override string ToString()
		{
			string text = ((m_Name == null) ? "<Unnamed>" : ((m_ActionMap == null || isSingletonAction || string.IsNullOrEmpty(m_ActionMap.name)) ? m_Name : (m_ActionMap.name + "/" + m_Name)));
			ReadOnlyArray<InputControl> readOnlyArray = controls;
			if (readOnlyArray.Count > 0)
			{
				text += "[";
				bool flag = true;
				foreach (InputControl item in readOnlyArray)
				{
					if (!flag)
					{
						text += ",";
					}
					text += item.path;
					flag = false;
				}
				text += "]";
			}
			return text;
		}

		public void Enable()
		{
			if (!enabled)
			{
				InputActionMap orCreateActionMap = GetOrCreateActionMap();
				orCreateActionMap.ResolveBindingsIfNecessary();
				orCreateActionMap.m_State.EnableSingleAction(this);
			}
		}

		public void Disable()
		{
			if (enabled)
			{
				m_ActionMap.m_State.DisableSingleAction(this);
			}
		}

		public InputAction Clone()
		{
			return new InputAction(m_Name, m_Type)
			{
				m_SingletonActionBindings = bindings.ToArray(),
				m_BindingsCount = m_BindingsCount,
				m_ExpectedControlType = m_ExpectedControlType,
				m_Interactions = m_Interactions,
				m_Processors = m_Processors,
				m_Flags = m_Flags
			};
		}

		object ICloneable.Clone()
		{
			return Clone();
		}

		public unsafe TValue ReadValue<TValue>() where TValue : struct
		{
			InputActionState state = GetOrCreateActionMap().m_State;
			if (state == null)
			{
				return default(TValue);
			}
			InputActionState.TriggerState* ptr = state.actionStates + m_ActionIndexInState;
			if (!ptr->phase.IsInProgress())
			{
				return state.ApplyProcessors(ptr->bindingIndex, default(TValue));
			}
			return state.ReadValue<TValue>(ptr->bindingIndex, ptr->controlIndex);
		}

		public unsafe object ReadValueAsObject()
		{
			InputActionState state = GetOrCreateActionMap().m_State;
			if (state == null)
			{
				return null;
			}
			InputActionState.TriggerState* ptr = state.actionStates + m_ActionIndexInState;
			if (ptr->phase.IsInProgress())
			{
				int controlIndex = ptr->controlIndex;
				if (controlIndex != -1)
				{
					return state.ReadValueAsObject(ptr->bindingIndex, controlIndex);
				}
			}
			return null;
		}

		public void Reset()
		{
			GetOrCreateActionMap().m_State?.ResetActionState(m_ActionIndexInState, enabled ? InputActionPhase.Waiting : InputActionPhase.Disabled, hardReset: true);
		}

		public unsafe bool IsPressed()
		{
			InputActionState state = GetOrCreateActionMap().m_State;
			if (state != null)
			{
				return state.actionStates[m_ActionIndexInState].isPressed;
			}
			return false;
		}

		public unsafe bool IsInProgress()
		{
			InputActionState state = GetOrCreateActionMap().m_State;
			if (state != null)
			{
				return state.actionStates[m_ActionIndexInState].phase.IsInProgress();
			}
			return false;
		}

		public unsafe bool WasPressedThisFrame()
		{
			InputActionState state = GetOrCreateActionMap().m_State;
			if (state != null)
			{
				InputActionState.TriggerState* num = state.actionStates + m_ActionIndexInState;
				uint s_UpdateStepCount = InputUpdate.s_UpdateStepCount;
				if (num->pressedInUpdate == s_UpdateStepCount)
				{
					return s_UpdateStepCount != 0;
				}
				return false;
			}
			return false;
		}

		public unsafe bool WasReleasedThisFrame()
		{
			InputActionState state = GetOrCreateActionMap().m_State;
			if (state != null)
			{
				InputActionState.TriggerState* num = state.actionStates + m_ActionIndexInState;
				uint s_UpdateStepCount = InputUpdate.s_UpdateStepCount;
				if (num->releasedInUpdate == s_UpdateStepCount)
				{
					return s_UpdateStepCount != 0;
				}
				return false;
			}
			return false;
		}

		public unsafe bool WasPerformedThisFrame()
		{
			InputActionState state = GetOrCreateActionMap().m_State;
			if (state != null)
			{
				InputActionState.TriggerState* num = state.actionStates + m_ActionIndexInState;
				uint s_UpdateStepCount = InputUpdate.s_UpdateStepCount;
				if (num->lastPerformedInUpdate == s_UpdateStepCount)
				{
					return s_UpdateStepCount != 0;
				}
				return false;
			}
			return false;
		}

		public unsafe float GetTimeoutCompletionPercentage()
		{
			InputActionState state = GetOrCreateActionMap().m_State;
			if (state == null)
			{
				return 0f;
			}
			ref InputActionState.TriggerState reference = ref state.actionStates[m_ActionIndexInState];
			int interactionIndex = reference.interactionIndex;
			if (interactionIndex == -1)
			{
				return (reference.phase == InputActionPhase.Performed) ? 1 : 0;
			}
			ref InputActionState.InteractionState reference2 = ref state.interactionStates[interactionIndex];
			switch (reference2.phase)
			{
			case InputActionPhase.Started:
			{
				float num = 0f;
				if (reference2.isTimerRunning)
				{
					float timerDuration = reference2.timerDuration;
					double num2 = reference2.timerStartTime + (double)timerDuration - InputState.currentTime;
					num = ((!(num2 <= 0.0)) ? ((float)(((double)timerDuration - num2) / (double)timerDuration)) : 1f);
				}
				if (reference2.totalTimeoutCompletionTimeRemaining > 0f)
				{
					return (reference2.totalTimeoutCompletionDone + num * reference2.timerDuration) / (reference2.totalTimeoutCompletionDone + reference2.totalTimeoutCompletionTimeRemaining);
				}
				return num;
			}
			case InputActionPhase.Performed:
				return 1f;
			default:
				return 0f;
			}
		}

		internal string MakeSureIdIsInPlace()
		{
			if (string.IsNullOrEmpty(m_Id))
			{
				GenerateId();
			}
			return m_Id;
		}

		internal void GenerateId()
		{
			m_Id = Guid.NewGuid().ToString();
		}

		internal InputActionMap GetOrCreateActionMap()
		{
			if (m_ActionMap == null)
			{
				CreateInternalActionMapForSingletonAction();
			}
			return m_ActionMap;
		}

		private void CreateInternalActionMapForSingletonAction()
		{
			m_ActionMap = new InputActionMap
			{
				m_Actions = new InputAction[1] { this },
				m_SingletonAction = this,
				m_Bindings = m_SingletonActionBindings
			};
		}

		internal void RequestInitialStateCheckOnEnabledAction()
		{
			GetOrCreateActionMap().m_State.SetInitialStateCheckPending(m_ActionIndexInState);
		}

		internal bool ActiveControlIsValid(InputControl control)
		{
			if (control == null)
			{
				return false;
			}
			InputDevice device = control.device;
			if (!device.added)
			{
				return false;
			}
			ReadOnlyArray<InputDevice>? devices = GetOrCreateActionMap().devices;
			if (devices.HasValue && !devices.Value.ContainsReference(device))
			{
				return false;
			}
			return true;
		}

		internal InputBinding? FindEffectiveBindingMask()
		{
			if (m_BindingMask.HasValue)
			{
				return m_BindingMask;
			}
			InputActionMap inputActionMap = m_ActionMap;
			if (inputActionMap != null && inputActionMap.m_BindingMask.HasValue)
			{
				return m_ActionMap.m_BindingMask;
			}
			return m_ActionMap?.m_Asset?.m_BindingMask;
		}

		internal int BindingIndexOnActionToBindingIndexOnMap(int indexOfBindingOnAction)
		{
			InputBinding[] array = GetOrCreateActionMap().m_Bindings;
			int num = array.LengthSafe();
			_ = name;
			int num2 = -1;
			for (int i = 0; i < num; i++)
			{
				if (array[i].TriggersAction(this))
				{
					num2++;
					if (num2 == indexOfBindingOnAction)
					{
						return i;
					}
				}
			}
			throw new ArgumentOutOfRangeException("indexOfBindingOnAction", $"Binding index {indexOfBindingOnAction} is out of range for action '{this}' with {num2 + 1} bindings");
		}

		internal int BindingIndexOnMapToBindingIndexOnAction(int indexOfBindingOnMap)
		{
			InputBinding[] array = GetOrCreateActionMap().m_Bindings;
			string strB = name;
			int num = 0;
			for (int num2 = indexOfBindingOnMap - 1; num2 >= 0; num2--)
			{
				ref InputBinding reference = ref array[num2];
				if (string.Compare(reference.action, strB, StringComparison.InvariantCultureIgnoreCase) == 0 || reference.action == m_Id)
				{
					num++;
				}
			}
			return num;
		}
	}
	public class InputActionAsset : ScriptableObject, IInputActionCollection2, IInputActionCollection, IEnumerable<InputAction>, IEnumerable
	{
		[Serializable]
		internal struct WriteFileJson
		{
			public string name;

			public InputActionMap.WriteMapJson[] maps;

			public InputControlScheme.SchemeJson[] controlSchemes;
		}

		[Serializable]
		internal struct ReadFileJson
		{
			public string name;

			public InputActionMap.ReadMapJson[] maps;

			public InputControlScheme.SchemeJson[] controlSchemes;

			public void ToAsset(InputActionAsset asset)
			{
				((Object)asset).name = name;
				InputActionMap.ReadFileJson readFileJson = new InputActionMap.ReadFileJson
				{
					maps = maps
				};
				asset.m_ActionMaps = readFileJson.ToMaps();
				asset.m_ControlSchemes = InputControlScheme.SchemeJson.ToSchemes(controlSchemes);
				if (asset.m_ActionMaps != null)
				{
					InputActionMap[] actionMaps = asset.m_ActionMaps;
					for (int i = 0; i < actionMaps.Length; i++)
					{
						actionMaps[i].m_Asset = asset;
					}
				}
			}
		}

		public const string Extension = "inputactions";

		[SerializeField]
		internal InputActionMap[] m_ActionMaps;

		[SerializeField]
		internal InputControlScheme[] m_ControlSchemes;

		[NonSerialized]
		internal InputActionState m_SharedStateForAllMaps;

		[NonSerialized]
		internal InputBinding? m_BindingMask;

		[NonSerialized]
		internal int m_ParameterOverridesCount;

		[NonSerialized]
		internal InputActionRebindingExtensions.ParameterOverride[] m_ParameterOverrides;

		[NonSerialized]
		internal InputActionMap.DeviceArray m_Devices;

		public bool enabled
		{
			get
			{
				foreach (InputActionMap actionMap in actionMaps)
				{
					if (actionMap.enabled)
					{
						return true;
					}
				}
				return false;
			}
		}

		public ReadOnlyArray<InputActionMap> actionMaps => new ReadOnlyArray<InputActionMap>(m_ActionMaps);

		public ReadOnlyArray<InputControlScheme> controlSchemes => new ReadOnlyArray<InputControlScheme>(m_ControlSchemes);

		public IEnumerable<InputBinding> bindings
		{
			get
			{
				int numActionMaps = m_ActionMaps.LengthSafe();
				if (numActionMaps == 0)
				{
					yield break;
				}
				int i = 0;
				while (i < numActionMaps)
				{
					InputActionMap inputActionMap = m_ActionMaps[i];
					InputBinding[] bindings = inputActionMap.m_Bindings;
					int numBindings = bindings.LengthSafe();
					int num;
					for (int j = 0; j < numBindings; j = num)
					{
						yield return bindings[j];
						num = j + 1;
					}
					num = i + 1;
					i = num;
				}
			}
		}

		public InputBinding? bindingMask
		{
			get
			{
				return m_BindingMask;
			}
			set
			{
				if (!(m_BindingMask == value))
				{
					m_BindingMask = value;
					ReResolveIfNecessary(fullResolve: true);
				}
			}
		}

		public ReadOnlyArray<InputDevice>? devices
		{
			get
			{
				return m_Devices.Get();
			}
			set
			{
				if (m_Devices.Set(value))
				{
					ReResolveIfNecessary(fullResolve: false);
				}
			}
		}

		public InputAction this[string actionNameOrId] => FindAction(actionNameOrId) ?? throw new KeyNotFoundException($"Cannot find action '{actionNameOrId}' in '{this}'");

		public string ToJson()
		{
			WriteFileJson writeFileJson = default(WriteFileJson);
			writeFileJson.name = ((Object)this).name;
			writeFileJson.maps = InputActionMap.WriteFileJson.FromMaps(m_ActionMaps).maps;
			writeFileJson.controlSchemes = InputControlScheme.SchemeJson.ToJson(m_ControlSchemes);
			return JsonUtility.ToJson((object)writeFileJson, true);
		}

		public void LoadFromJson(string json)
		{
			if (string.IsNullOrEmpty(json))
			{
				throw new ArgumentNullException("json");
			}
			JsonUtility.FromJson<ReadFileJson>(json).ToAsset(this);
		}

		public static InputActionAsset FromJson(string json)
		{
			if (string.IsNullOrEmpty(json))
			{
				throw new ArgumentNullException("json");
			}
			InputActionAsset inputActionAsset = ScriptableObject.CreateInstance<InputActionAsset>();
			inputActionAsset.LoadFromJson(json);
			return inputActionAsset;
		}

		public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
		{
			if (actionNameOrId == null)
			{
				throw new ArgumentNullException("actionNameOrId");
			}
			if (m_ActionMaps != null)
			{
				int num = actionNameOrId.IndexOf('/');
				if (num == -1)
				{
					InputAction inputAction = null;
					for (int i = 0; i < m_ActionMaps.Length; i++)
					{
						InputAction inputAction2 = m_ActionMaps[i].FindAction(actionNameOrId);
						if (inputAction2 != null)
						{
							if (inputAction2.enabled || inputAction2.m_Id == actionNameOrId)
							{
								return inputAction2;
							}
							if (inputAction == null)
							{
								inputAction = inputAction2;
							}
						}
					}
					if (inputAction != null)
					{
						return inputAction;
					}
				}
				else
				{
					Substring right = new Substring(actionNameOrId, 0, num);
					Substring right2 = new Substring(actionNameOrId, num + 1);
					if (right.isEmpty || right2.isEmpty)
					{
						throw new ArgumentException("Malformed action path: " + actionNameOrId, "actionNameOrId");
					}
					for (int j = 0; j < m_ActionMaps.Length; j++)
					{
						InputActionMap inputActionMap = m_ActionMaps[j];
						if (Substring.Compare(inputActionMap.name, right, StringComparison.InvariantCultureIgnoreCase) != 0)
						{
							continue;
						}
						InputAction[] actions = inputActionMap.m_Actions;
						foreach (InputAction inputAction3 in actions)
						{
							if (Substring.Compare(inputAction3.name, right2, StringComparison.InvariantCultureIgnoreCase) == 0)
							{
								return inputAction3;
							}
						}
						break;
					}
				}
			}
			if (throwIfNotFound)
			{
				throw new ArgumentException($"No action '{actionNameOrId}' in '{this}'");
			}
			return null;
		}

		public int FindBinding(InputBinding mask, out InputAction action)
		{
			int num = m_ActionMaps.LengthSafe();
			for (int i = 0; i < num; i++)
			{
				int num2 = m_ActionMaps[i].FindBinding(mask, out action);
				if (num2 >= 0)
				{
					return num2;
				}
			}
			action = null;
			return -1;
		}

		public InputActionMap FindActionMap(string nameOrId, bool throwIfNotFound = false)
		{
			if (nameOrId == null)
			{
				throw new ArgumentNullException("nameOrId");
			}
			if (m_ActionMaps == null)
			{
				return null;
			}
			if (nameOrId.Contains('-') && Guid.TryParse(nameOrId, out var result))
			{
				for (int i = 0; i < m_ActionMaps.Length; i++)
				{
					InputActionMap inputActionMap = m_ActionMaps[i];
					if (inputActionMap.idDontGenerate == result)
					{
						return inputActionMap;
					}
				}
			}
			for (int j = 0; j < m_ActionMaps.Length; j++)
			{
				InputActionMap inputActionMap2 = m_ActionMaps[j];
				if (string.Compare(nameOrId, inputActionMap2.name, StringComparison.InvariantCultureIgnoreCase) == 0)
				{
					return inputActionMap2;
				}
			}
			if (throwIfNotFound)
			{
				throw new ArgumentException($"Cannot find action map '{nameOrId}' in '{this}'");
			}
			return null;
		}

		public InputActionMap FindActionMap(Guid id)
		{
			if (m_ActionMaps == null)
			{
				return null;
			}
			for (int i = 0; i < m_ActionMaps.Length; i++)
			{
				InputActionMap inputActionMap = m_ActionMaps[i];
				if (inputActionMap.idDontGenerate == id)
				{
					return inputActionMap;
				}
			}
			return null;
		}

		public InputAction FindAction(Guid guid)
		{
			if (m_ActionMaps == null)
			{
				return null;
			}
			for (int i = 0; i < m_ActionMaps.Length; i++)
			{
				InputAction inputAction = m_ActionMaps[i].FindAction(guid);
				if (inputAction != null)
				{
					return inputAction;
				}
			}
			return null;
		}

		public int FindControlSchemeIndex(string name)
		{
			if (string.IsNullOrEmpty(name))
			{
				throw new ArgumentNullException("name");
			}
			if (m_ControlSchemes == null)
			{
				return -1;
			}
			for (int i = 0; i < m_ControlSchemes.Length; i++)
			{
				if (string.Compare(name, m_ControlSchemes[i].name, StringComparison.InvariantCultureIgnoreCase) == 0)
				{
					return i;
				}
			}
			return -1;
		}

		public InputControlScheme? FindControlScheme(string name)
		{
			if (string.IsNullOrEmpty(name))
			{
				throw new ArgumentNullException("name");
			}
			int num = FindControlSchemeIndex(name);
			if (num == -1)
			{
				return null;
			}
			return m_ControlSchemes[num];
		}

		public bool IsUsableWithDevice(InputDevice device)
		{
			if (device == null)
			{
				throw new ArgumentNullException("device");
			}
			int num = m_ControlSchemes.LengthSafe();
			if (num > 0)
			{
				for (int i = 0; i < num; i++)
				{
					if (m_ControlSchemes[i].SupportsDevice(device))
					{
						return true;
					}
				}
			}
			else
			{
				int num2 = m_ActionMaps.LengthSafe();
				for (int j = 0; j < num2; j++)
				{
					if (m_ActionMaps[j].IsUsableWithDevice(device))
					{
						return true;
					}
				}
			}
			return false;
		}

		public void Enable()
		{
			foreach (InputActionMap actionMap in actionMaps)
			{
				actionMap.Enable();
			}
		}

		public void Disable()
		{
			foreach (InputActionMap actionMap in actionMaps)
			{
				actionMap.Disable();
			}
		}

		public bool Contains(InputAction action)
		{
			InputActionMap inputActionMap = action?.actionMap;
			if (inputActionMap == null)
			{
				return false;
			}
			return (Object)(object)inputActionMap.asset == (Object)(object)this;
		}

		public IEnumerator<InputAction> GetEnumerator()
		{
			if (m_ActionMaps == null)
			{
				yield break;
			}
			int i = 0;
			while (i < m_ActionMaps.Length)
			{
				ReadOnlyArray<InputAction> actions = m_ActionMaps[i].actions;
				int actionCount = actions.Count;
				int num;
				for (int j = 0; j < actionCount; j = num)
				{
					yield return actions[j];
					num = j + 1;
				}
				num = i + 1;
				i = num;
			}
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}

		internal void MarkAsDirty()
		{
		}

		internal void OnWantToChangeSetup()
		{
			if (m_ActionMaps.LengthSafe() > 0)
			{
				m_ActionMaps[0].OnWantToChangeSetup();
			}
		}

		internal void OnSetupChanged()
		{
			MarkAsDirty();
			if (m_ActionMaps.LengthSafe() > 0)
			{
				m_ActionMaps[0].OnSetupChanged();
			}
			else
			{
				m_SharedStateForAllMaps = null;
			}
		}

		private void ReResolveIfNecessary(bool fullResolve)
		{
			if (m_SharedStateForAllMaps != null)
			{
				m_ActionMaps[0].LazyResolveBindings(fullResolve);
			}
		}

		internal void ResolveBindingsIfNecessary()
		{
			if (m_ActionMaps.LengthSafe() > 0)
			{
				InputActionMap[] array = m_ActionMaps;
				for (int i = 0; i < array.Length && !array[i].ResolveBindingsIfNecessary(); i++)
				{
				}
			}
		}

		private void OnDestroy()
		{
			Disable();
			if (m_SharedStateForAllMaps != null)
			{
				m_SharedStateForAllMaps.Dispose();
				m_SharedStateForAllMaps = null;
			}
		}
	}
	public enum InputActionChange
	{
		ActionEnabled,
		ActionDisabled,
		ActionMapEnabled,
		ActionMapDisabled,
		ActionStarted,
		ActionPerformed,
		ActionCanceled,
		BoundControlsAboutToChange,
		BoundControlsChanged
	}
	[Serializable]
	public sealed class InputActionMap : ICloneable, ISerializationCallbackReceiver, IInputActionCollection2, IInputActionCollection, IEnumerable<InputAction>, IEnumerable, IDisposable
	{
		[Flags]
		private enum Flags
		{
			NeedToResolveBindings = 1,
			BindingResolutionNeedsFullReResolve = 2,
			ControlsForEachActionInitialized = 4,
			BindingsForEachActionInitialized = 8
		}

		internal struct DeviceArray
		{
			private bool m_HaveValue;

			private int m_DeviceCount;

			private InputDevice[] m_DeviceArray;

			public int IndexOf(InputDevice device)
			{
				return m_DeviceArray.IndexOfReference(device, m_DeviceCount);
			}

			public bool Remove(InputDevice device)
			{
				int num = IndexOf(device);
				if (num < 0)
				{
					return false;
				}
				m_DeviceArray.EraseAtWithCapacity(ref m_DeviceCount, num);
				return true;
			}

			public ReadOnlyArray<InputDevice>? Get()
			{
				if (!m_HaveValue)
				{
					return null;
				}
				return new ReadOnlyArray<InputDevice>(m_DeviceArray, 0, m_DeviceCount);
			}

			public bool Set(ReadOnlyArray<InputDevice>? devices)
			{
				if (!devices.HasValue)
				{
					if (!m_HaveValue)
					{
						return false;
					}
					if (m_DeviceCount > 0)
					{
						Array.Clear(m_DeviceArray, 0, m_DeviceCount);
					}
					m_DeviceCount = 0;
					m_HaveValue = false;
				}
				else
				{
					ReadOnlyArray<InputDevice> value = devices.Value;
					if (m_HaveValue && value.Count == m_DeviceCount && value.HaveEqualReferences(m_DeviceArray, m_DeviceCount))
					{
						return false;
					}
					if (m_DeviceCount > 0)
					{
						m_DeviceArray.Clear(ref m_DeviceCount);
					}
					m_HaveValue = true;
					m_DeviceCount = 0;
					ArrayHelpers.AppendListWithCapacity(ref m_DeviceArray, ref m_DeviceCount, value);
				}
				return true;
			}
		}

		[Serializable]
		internal struct BindingOverrideListJson
		{
			public List<BindingOverrideJson> bindings;
		}

		[Serializable]
		internal struct BindingOverrideJson
		{
			public string action;

			public string id;

			public string path;

			public string interactions;

			public string processors;

			public static BindingOverrideJson FromBinding(InputBinding binding, string actionName)
			{
				BindingOverrideJson result = default(BindingOverrideJson);
				result.action = actionName;
				result.id = binding.id.ToString();
				result.path = binding.overridePath ?? "null";
				result.interactions = binding.overrideInteractions ?? "null";
				result.processors = binding.overrideProcessors ?? "null";
				return result;
			}

			public static BindingOverrideJson FromBinding(InputBinding binding)
			{
				return FromBinding(binding, binding.action);
			}

			public static InputBinding ToBinding(BindingOverrideJson bindingOverride)
			{
				InputBinding result = default(InputBinding);
				result.overridePath = ((bindingOverride.path != "null") ? bindingOverride.path : null);
				result.overrideInteractions = ((bindingOverride.interactions != "null") ? bindingOverride.interactions : null);
				result.overrideProcessors = ((bindingOverride.processors != "null") ? bindingOverride.processors : null);
				return result;
			}
		}

		[Serializable]
		internal struct BindingJson
		{
			public string name;

			public string id;

			public string path;

			public string interactions;

			public string processors;

			public string groups;

			public string action;

			public bool isComposite;

			public bool isPartOfComposite;

			public InputBinding ToBinding()
			{
				InputBinding result = default(InputBinding);
				result.name = (string.IsNullOrEmpty(name) ? null : name);
				result.m_Id = (string.IsNullOrEmpty(id) ? null : id);
				result.path = path;
				result.action = (string.IsNullOrEmpty(action) ? null : action);
				result.interactions = (string.IsNullOrEmpty(interactions) ? null : interactions);
				result.processors = (string.IsNullOrEmpty(processors) ? null : processors);
				result.groups = (string.IsNullOrEmpty(groups) ? null : groups);
				result.isComposite = isComposite;
				result.isPartOfComposite = isPartOfComposite;
				return result;
			}

			public static BindingJson FromBinding(ref InputBinding binding)
			{
				BindingJson result = default(BindingJson);
				result.name = binding.name;
				result.id = binding.m_Id;
				result.path = binding.path;
				result.action = binding.action;
				result.interactions = binding.interactions;
				result.processors = binding.processors;
				result.groups = binding.groups;
				result.isComposite = binding.isComposite;
				result.isPartOfComposite = binding.isPartOfComposite;
				return result;
			}
		}

		[Serializable]
		internal struct ReadActionJson
		{
			public string name;

			public string type;

			public string id;

			public string expectedControlType;

			public string expectedControlLayout;

			public string processors;

			public string interactions;

			public bool passThrough;

			public bool initialStateCheck;

			public BindingJson[] bindings;

			public InputAction ToAction(string actionName = null)
			{
				if (!string.IsNullOrEmpty(expectedControlLayout))
				{
					expectedControlType = expectedControlLayout;
				}
				InputActionType inputActionType = InputActionType.Value;
				if (!string.IsNullOrEmpty(type))
				{
					inputActionType = (InputActionType)Enum.Parse(typeof(InputActionType), type, ignoreCase: true);
				}
				else if (passThrough)
				{
					inputActionType = InputActionType.PassThrough;
				}
				else if (initialStateCheck)
				{
					inputActionType = InputActionType.Value;
				}
				else if (!string.IsNullOrEmpty(expectedControlType) && (expectedControlType == "Button" || expectedControlType == "Key"))
				{
					inputActionType = InputActionType.Button;
				}
				return new InputAction(actionName ?? name, inputActionType)
				{
					m_Id = (string.IsNullOrEmpty(id) ? null : id),
					m_ExpectedControlType = ((!string.IsNullOrEmpty(expectedControlType)) ? expectedControlType : null),
					m_Processors = processors,
					m_Interactions = interactions,
					wantsInitialStateCheck = initialStateCheck
				};
			}
		}

		[Serializable]
		internal struct WriteActionJson
		{
			public string name;

			public string type;

			public string id;

			public string expectedControlType;

			public string processors;

			public string interactions;

			public bool initialStateCheck;

			public static WriteActionJson FromAction(InputAction action)
			{
				WriteActionJson result = default(WriteActionJson);
				result.name = action.m_Name;
				result.type = action.m_Type.ToString();
				result.id = action.m_Id;
				result.expectedControlType = action.m_ExpectedControlType;
				result.processors = action.processors;
				result.interactions = action.interactions;
				result.initialStateCheck = action.wantsInitialStateCheck;
				return result;
			}
		}

		[Serializable]
		internal struct ReadMapJson
		{
			public string name;

			public string id;

			public ReadActionJson[] actions;

			public BindingJson[] bindings;
		}

		[Serializable]
		internal struct WriteMapJson
		{
			public string name;

			public string id;

			public WriteActionJson[] actions;

			public BindingJson[] bindings;

			public static WriteMapJson FromMap(InputActionMap map)
			{
				WriteActionJson[] array = null;
				BindingJson[] array2 = null;
				InputAction[] array3 = map.m_Actions;
				if (array3 != null)
				{
					int num = array3.Length;
					array = new WriteActionJson[num];
					for (int i = 0; i < num; i++)
					{
						array[i] = WriteActionJson.FromAction(array3[i]);
					}
				}
				InputBinding[] array4 = map.m_Bindings;
				if (array4 != null)
				{
					int num2 = array4.Length;
					array2 = new BindingJson[num2];
					for (int j = 0; j < num2; j++)
					{
						array2[j] = BindingJson.FromBinding(ref array4[j]);
					}
				}
				WriteMapJson result = default(WriteMapJson);
				result.name = map.name;
				result.id = map.id.ToString();
				result.actions = array;
				result.bindings = array2;
				return result;
			}
		}

		[Serializable]
		internal struct WriteFileJson
		{
			public WriteMapJson[] maps;

			public static WriteFileJson FromMap(InputActionMap map)
			{
				WriteFileJson result = default(WriteFileJson);
				result.maps = new WriteMapJson[1] { WriteMapJson.FromMap(map) };
				return result;
			}

			public static WriteFileJson FromMaps(IEnumerable<InputActionMap> maps)
			{
				int num = maps.Count();
				if (num == 0)
				{
					return default(WriteFileJson);
				}
				WriteMapJson[] array = new WriteMapJson[num];
				int num2 = 0;
				foreach (InputActionMap map in maps)
				{
					array[num2++] = WriteMapJson.FromMap(map);
				}
				WriteFileJson result = default(WriteFileJson);
				result.maps = array;
				return result;
			}
		}

		[Serializable]
		internal struct ReadFileJson
		{
			public ReadActionJson[] actions;

			public ReadMapJson[] maps;

			public InputActionMap[] ToMaps()
			{
				List<InputActionMap> list = new List<InputActionMap>();
				List<List<InputAction>> list2 = new List<List<InputAction>>();
				List<List<InputBinding>> list3 = new List<List<InputBinding>>();
				ReadActionJson[] array = actions;
				int num = ((array != null) ? array.Length : 0);
				for (int i = 0; i < num; i++)
				{
					ReadActionJson readActionJson = actions[i];
					if (string.IsNullOrEmpty(readActionJson.name))
					{
						throw new InvalidOperationException($"Action number {i + 1} has no name");
					}
					string text = null;
					string text2 = readActionJson.name;
					int num2 = text2.IndexOf('/');
					if (num2 != -1)
					{
						text = text2.Substring(0, num2);
						text2 = text2.Substring(num2 + 1);
						if (string.IsNullOrEmpty(text2))
						{
							throw new InvalidOperationException("Invalid action name '" + readActionJson.name + "' (missing action name after '/')");
						}
					}
					InputActionMap inputActionMap = null;
					int j;
					for (j = 0; j < list.Count; j++)
					{
						if (string.Compare(list[j].name, text, StringComparison.InvariantCultureIgnoreCase) == 0)
						{
							inputActionMap = list[j];
							break;
						}
					}
					if (inputActionMap == null)
					{
						inputActionMap = new InputActionMap(text);
						j = list.Count;
						list.Add(inputActionMap);
						list2.Add(new List<InputAction>());
						list3.Add(new List<InputBinding>());
					}
					InputAction inputAction = readActionJson.ToAction(text2);
					list2[j].Add(inputAction);
					if (readActionJson.bindings != null)
					{
						List<InputBinding> list4 = list3[j];
						for (int k = 0; k < readActionJson.bindings.Length; k++)
						{
							BindingJson bindingJson = readActionJson.bindings[k];
							InputBinding item = bindingJson.ToBinding();
							item.action = inputAction.m_Name;
							list4.Add(item);
						}
					}
				}
				ReadMapJson[] array2 = maps;
				int num3 = ((array2 != null) ? array2.Length : 0);
				for (int l = 0; l < num3; l++)
				{
					ReadMapJson readMapJson = maps[l];
					string name = readMapJson.name;
					if (string.IsNullOrEmpty(name))
					{
						throw new InvalidOperationException($"Map number {l + 1} has no name");
					}
					InputActionMap inputActionMap2 = null;
					int m;
					for (m = 0; m < list.Count; m++)
					{
						if (string.Compare(list[m].name, name, StringComparison.InvariantCultureIgnoreCase) == 0)
						{
							inputActionMap2 = list[m];
							break;
						}
					}
					if (inputActionMap2 == null)
					{
						inputActionMap2 = new InputActionMap(name)
						{
							m_Id = (string.IsNullOrEmpty(readMapJson.id) ? null : readMapJson.id)
						};
						m = list.Count;
						list.Add(inputActionMap2);
						list2.Add(new List<InputAction>());
						list3.Add(new List<InputBinding>());
					}
					ReadActionJson[] array3 = readMapJson.actions;
					int num4 = ((array3 != null) ? array3.Length : 0);
					for (int n = 0; n < num4; n++)
					{
						ReadActionJson readActionJson2 = readMapJson.actions[n];
						if (string.IsNullOrEmpty(readActionJson2.name))
						{
							throw new InvalidOperationException($"Action number {l + 1} in map '{name}' has no name");
						}
						InputAction inputAction2 = readActionJson2.ToAction();
						list2[m].Add(inputAction2);
						if (readActionJson2.bindings != null)
						{
							List<InputBinding> list5 = list3[m];
							for (int num5 = 0; num5 < readActionJson2.bindings.Length; num5++)
							{
								BindingJson bindingJson2 = readActionJson2.bindings[num5];
								InputBinding item2 = bindingJson2.ToBinding();
								item2.action = inputAction2.m_Name;
								list5.Add(item2);
							}
						}
					}
					BindingJson[] bindings = readMapJson.bindings;
					int num6 = ((bindings != null) ? bindings.Length : 0);
					List<InputBinding> list6 = list3[m];
					for (int num7 = 0; num7 < num6; num7++)
					{
						BindingJson bindingJson3 = readMapJson.bindings[num7];
						InputBinding item3 = bindingJson3.ToBinding();
						list6.Add(item3);
					}
				}
				for (int num8 = 0; num8 < list.Count; num8++)
				{
					InputActionMap inputActionMap3 = list[num8];
					InputAction[] array4 = list2[num8].ToArray();
					InputBinding[] bindings2 = list3[num8].ToArray();
					inputActionMap3.m_Actions = array4;
					inputActionMap3.m_Bindings = bindings2;
					for (int num9 = 0; num9 < array4.Length; num9++)
					{
						array4[num9].m_ActionMap = inputActionMap3;
					}
				}
				return list.ToArray();
			}
		}

		[SerializeField]
		internal string m_Name;

		[SerializeField]
		internal string m_Id;

		[SerializeField]
		internal InputActionAsset m_Asset;

		[SerializeField]
		internal InputAction[] m_Actions;

		[SerializeField]
		internal InputBinding[] m_Bindings;

		[NonSerialized]
		private InputBinding[] m_BindingsForEachAction;

		[NonSerialized]
		private InputControl[] m_ControlsForEachAction;

		[NonSerialized]
		internal int m_EnabledActionsCount;

		[NonSerialized]
		internal InputAction m_SingletonAction;

		[NonSerialized]
		internal int m_MapIndexInState = -1;

		[NonSerialized]
		internal InputActionState m_State;

		[NonSerialized]
		internal InputBinding? m_BindingMask;

		[NonSerialized]
		private Flags m_Flags;

		[NonSerialized]
		internal int m_ParameterOverridesCount;

		[NonSerialized]
		internal InputActionRebindingExtensions.ParameterOverride[] m_ParameterOverrides;

		[NonSerialized]
		internal DeviceArray m_Devices;

		[NonSerialized]
		internal CallbackArray<Action<InputAction.CallbackContext>> m_ActionCallbacks;

		[NonSerialized]
		internal Dictionary<string, int> m_ActionIndexByNameOrId;

		internal static int s_DeferBindingResolution;

		public string name => m_Name;

		public InputActionAsset asset => m_Asset;

		public Guid id
		{
			get
			{
				if (string.IsNullOrEmpty(m_Id))
				{
					GenerateId();
				}
				return new Guid(m_Id);
			}
		}

		internal Guid idDontGenerate
		{
			get
			{
				if (string.IsNullOrEmpty(m_Id))
				{
					return default(Guid);
				}
				return new Guid(m_Id);
			}
		}

		public bool enabled => m_EnabledActionsCount > 0;

		public ReadOnlyArray<InputAction> actions => new ReadOnlyArray<InputAction>(m_Actions);

		public ReadOnlyArray<InputBinding> bindings => new ReadOnlyArray<InputBinding>(m_Bindings);

		IEnumerable<InputBinding> IInputActionCollection2.bindings => bindings;

		public ReadOnlyArray<InputControlScheme> controlSchemes
		{
			get
			{
				if ((Object)(object)m_Asset == (Object)null)
				{
					return default(ReadOnlyArray<InputControlScheme>);
				}
				return m_Asset.controlSchemes;
			}
		}

		public InputBinding? bindingMask
		{
			get
			{
				return m_BindingMask;
			}
			set
			{
				if (!(m_BindingMask == value))
				{
					m_BindingMask = value;
					LazyResolveBindings(fullResolve: true);
				}
			}
		}

		public ReadOnlyArray<InputDevice>? devices
		{
			get
			{
				return m_Devices.Get() ?? m_Asset?.devices;
			}
			set
			{
				if (m_Devices.Set(value))
				{
					LazyResolveBindings(fullResolve: false);
				}
			}
		}

		public InputAction this[string actionNameOrId]
		{
			get
			{
				if (actionNameOrId == null)
				{
					throw new ArgumentNullException("actionNameOrId");
				}
				return FindAction(actionNameOrId) ?? throw new KeyNotFoundException("Cannot find action '" + actionNameOrId + "'");
			}
		}

		private bool needToResolveBindings
		{
			get
			{
				return (m_Flags & Flags.NeedToResolveBindings) != 0;
			}
			set
			{
				if (value)
				{
					m_Flags |= Flags.NeedToResolveBindings;
				}
				else
				{
					m_Flags &= ~Flags.NeedToResolveBindings;
				}
			}
		}

		private bool bindingResolutionNeedsFullReResolve
		{
			get
			{
				return (m_Flags & Flags.BindingResolutionNeedsFullReResolve) != 0;
			}
			set
			{
				if (value)
				{
					m_Flags |= Flags.BindingResolutionNeedsFullReResolve;
				}
				else
				{
					m_Flags &= ~Flags.BindingResolutionNeedsFullReResolve;
				}
			}
		}

		private bool controlsForEachActionInitialized
		{
			get
			{
				return (m_Flags & Flags.ControlsForEachActionInitialized) != 0;
			}
			set
			{
				if (value)
				{
					m_Flags |= Flags.ControlsForEachActionInitialized;
				}
				else
				{
					m_Flags &= ~Flags.ControlsForEachActionInitialized;
				}
			}
		}

		private bool bindingsForEachActionInitialized
		{
			get
			{
				return (m_Flags & Flags.BindingsForEachActionInitialized) != 0;
			}
			set
			{
				if (value)
				{
					m_Flags |= Flags.BindingsForEachActionInitialized;
				}
				else
				{
					m_Flags &= ~Flags.BindingsForEachActionInitialized;
				}
			}
		}

		public event Action<InputAction.CallbackContext> actionTriggered
		{
			add
			{
				m_ActionCallbacks.AddCallback(value);
			}
			remove
			{
				m_ActionCallbacks.RemoveCallback(value);
			}
		}

		public InputActionMap()
		{
		}

		public InputActionMap(string name)
			: this()
		{
			m_Name = name;
		}

		public void Dispose()
		{
			m_State?.Dispose();
		}

		internal int FindActionIndex(string nameOrId)
		{
			if (string.IsNullOrEmpty(nameOrId))
			{
				return -1;
			}
			if (m_Actions == null)
			{
				return -1;
			}
			SetUpActionLookupTable();
			int num = m_Actions.Length;
			if (nameOrId.StartsWith("{") && nameOrId.EndsWith("}"))
			{
				int length = nameOrId.Length - 2;
				for (int i = 0; i < num; i++)
				{
					if (string.Compare(m_Actions[i].m_Id, 0, nameOrId, 1, length) == 0)
					{
						return i;
					}
				}
			}
			if (m_ActionIndexByNameOrId.TryGetValue(nameOrId, out var value))
			{
				return value;
			}
			for (int j = 0; j < num; j++)
			{
				if (m_Actions[j].m_Id == nameOrId || string.Compare(m_Actions[j].m_Name, nameOrId, StringComparison.InvariantCultureIgnoreCase) == 0)
				{
					return j;
				}
			}
			return -1;
		}

		private void SetUpActionLookupTable()
		{
			if (m_ActionIndexByNameOrId == null && m_Actions != null)
			{
				m_ActionIndexByNameOrId = new Dictionary<string, int>();
				int num = m_Actions.Length;
				for (int i = 0; i < num; i++)
				{
					InputAction inputAction = m_Actions[i];
					inputAction.MakeSureIdIsInPlace();
					m_ActionIndexByNameOrId[inputAction.name] = i;
					m_ActionIndexByNameOrId[inputAction.m_Id] = i;
				}
			}
		}

		internal void ClearActionLookupTable()
		{
			m_ActionIndexByNameOrId?.Clear();
		}

		private int FindActionIndex(Guid id)
		{
			if (m_Actions == null)
			{
				return -1;
			}
			int num = m_Actions.Length;
			for (int i = 0; i < num; i++)
			{
				if (m_Actions[i].idDontGenerate == id)
				{
					return i;
				}
			}
			return -1;
		}

		public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
		{
			if (actionNameOrId == null)
			{
				throw new ArgumentNullException("actionNameOrId");
			}
			int num = FindActionIndex(actionNameOrId);
			if (num == -1)
			{
				if (throwIfNotFound)
				{
					throw new ArgumentException($"No action '{actionNameOrId}' in '{this}'", "actionNameOrId");
				}
				return null;
			}
			return m_Actions[num];
		}

		public InputAction FindAction(Guid id)
		{
			int num = FindActionIndex(id);
			if (num == -1)
			{
				return null;
			}
			return m_Actions[num];
		}

		public bool IsUsableWithDevice(InputDevice device)
		{
			if (device == null)
			{
				throw new ArgumentNullException("device");
			}
			if (m_Bindings == null)
			{
				return false;
			}
			InputBinding[] array = m_Bindings;
			foreach (InputBinding inputBinding in array)
			{
				string effectivePath = inputBinding.effectivePath;
				if (!string.IsNullOrEmpty(effectivePath) && InputControlPath.Matches(effectivePath, device))
				{
					return true;
				}
			}
			return false;
		}

		public void Enable()
		{
			if (m_Actions != null && m_EnabledActionsCount != m_Actions.Length)
			{
				ResolveBindingsIfNecessary();
				m_State.EnableAllActions(this);
			}
		}

		public void Disable()
		{
			if (enabled)
			{
				m_State.DisableAllActions(this);
			}
		}

		public InputActionMap Clone()
		{
			InputActionMap inputActionMap = new InputActionMap
			{
				m_Name = m_Name
			};
			if (m_Actions != null)
			{
				int num = m_Actions.Length;
				InputAction[] array = new InputAction[num];
				for (int i = 0; i < num; i++)
				{
					InputAction inputAction = m_Actions[i];
					array[i] = new InputAction
					{
						m_Name = inputAction.m_Name,
						m_ActionMap = inputActionMap,
						m_Type = inputAction.m_Type,
						m_Interactions = inputAction.m_Interactions,
						m_Processors = inputAction.m_Processors,
						m_ExpectedControlType = inputAction.m_ExpectedControlType,
						m_Flags = inputAction.m_Flags
					};
				}
				inputActionMap.m_Actions = array;
			}
			if (m_Bindings != null)
			{
				int num2 = m_Bindings.Length;
				InputBinding[] array2 = new InputBinding[num2];
				Array.Copy(m_Bindings, 0, array2, 0, num2);
				for (int j = 0; j < num2; j++)
				{
					array2[j].m_Id = null;
				}
				inputActionMap.m_Bindings = array2;
			}
			return inputActionMap;
		}

		object ICloneable.Clone()
		{
			return Clone();
		}

		public bool Contains(InputAction action)
		{
			if (action == null)
			{
				return false;
			}
			return action.actionMap == this;
		}

		public override string ToString()
		{
			if ((Object)(object)m_Asset != (Object)null)
			{
				return $"{m_Asset}:{m_Name}";
			}
			if (!string.IsNullOrEmpty(m_Name))
			{
				return m_Name;
			}
			return "<Unnamed Action Map>";
		}

		public IEnumerator<InputAction> GetEnumerator()
		{
			return actions.GetEnumerator();
		}

		IEnumerator IEnumerable.GetEnumerator()
		{
			return GetEnumerator();
		}

		internal ReadOnlyArray<InputBinding> GetBindingsForSingleAction(InputAction action)
		{
			if (!bindingsForEachActionInitialized)
			{
				SetUpPerActionControlAndBindingArrays();
			}
			return new ReadOnlyArray<InputBinding>(m_BindingsForEachAction, action.m_BindingsStartIndex, action.m_BindingsCount);
		}

		internal ReadOnlyArray<InputControl> GetControlsForSingleAction(InputAction action)
		{
			if (!controlsForEachActionInitialized)
			{
				SetUpPerActionControlAndBindingArrays();
			}
			return new ReadOnlyArray<InputControl>(m_ControlsForEachAction, action.m_ControlStartIndex, action.m_ControlCount);
		}

		private unsafe void SetUpPerActionControlAndBindingArrays()
		{
			if (m_Bindings == null)
			{
				m_ControlsForEachAction = null;
				m_BindingsForEachAction = null;
				controlsForEachActionInitialized = true;
				bindingsForEachActionInitialized = true;
				return;
			}
			if (m_SingletonAction != null)
			{
				m_BindingsForEachAction = m_Bindings;
				m_ControlsForEachAction = m_State?.controls;
				m_SingletonAction.m_BindingsStartIndex = 0;
				m_SingletonAction.m_BindingsCount = m_Bindings.Length;
				m_SingletonAction.m_ControlStartIndex = 0;
				m_SingletonAction.m_ControlCount = m_State?.totalControlCount ?? 0;
				if (m_ControlsForEachAction.HaveDuplicateReferences(0, m_SingletonAction.m_ControlCount))
				{
					int num = 0;
					InputControl[] array = new InputControl[m_SingletonAction.m_ControlCount];
					for (int i = 0; i < m_SingletonAction.m_ControlCount; i++)
					{
						if (!array.ContainsReference(m_ControlsForEachAction[i]))
						{
							array[num] = m_ControlsForEachAction[i];
							num++;
						}
					}
					m_ControlsForEachAction = array;
					m_SingletonAction.m_ControlCount = num;
				}
			}
			else
			{
				InputActionState.ActionMapIndices actionMapIndices = m_State?.FetchMapIndices(this) ?? default(InputActionState.ActionMapIndices);
				for (int j = 0; j < m_Actions.Length; j++)
				{
					InputAction obj = m_Actions[j];
					obj.m_BindingsCount = 0;
					obj.m_BindingsStartIndex = -1;
					obj.m_ControlCount = 0;
					obj.m_ControlStartIndex = -1;
				}
				int num2 = m_Bindings.Length;
				for (int k = 0; k < num2; k++)
				{
					InputAction inputAction = FindAction(m_Bindings[k].action);
					if (inputAction != null)
					{
						inputAction.m_BindingsCount++;
					}
				}
				int num3 = 0;
				if (m_State != null && (m_ControlsForEachAction == null || m_ControlsForEachAction.Length != actionMapIndices.controlCount))
				{
					if (actionMapIndices.controlCount == 0)
					{
						m_ControlsForEachAction = null;
					}
					else
					{
						m_ControlsForEachAction = new InputControl[actionMapIndices.controlCount];
					}
				}
				InputBinding[] array2 = null;
				int num4 = 0;
				int num5 = 0;
				while (num5 < m_Bindings.Length)
				{
					InputAction inputAction2 = FindAction(m_Bindings[num5].action);
					if (inputAction2 == null || inputAction2.m_BindingsStartIndex != -1)
					{
						num5++;
						continue;
					}
					inputAction2.m_BindingsStartIndex = ((array2 != null) ? num3 : num5);
					inputAction2.m_ControlStartIndex = num4;
					int bindingsCount = inputAction2.m_BindingsCount;
					int num6 = num5;
					for (int l = 0; l < bindingsCount; l++)
					{
						if (FindAction(m_Bindings[num6].action) != inputAction2)
						{
							if (array2 == null)
							{
								array2 = new InputBinding[m_Bindings.Length];
								num3 = num6;
								Array.Copy(m_Bindings, 0, array2, 0, num6);
							}
							do
							{
								num6++;
							}
							while (FindAction(m_Bindings[num6].action) != inputAction2);
						}
						else if (num5 == num6)
						{
							num5++;
						}
						if (array2 != null)
						{
							array2[num3++] = m_Bindings[num6];
						}
						if (m_State != null && !m_Bindings[num6].isComposite)
						{
							ref InputActionState.BindingState reference = ref m_State.bindingStates[actionMapIndices.bindingStartIndex + num6];
							int controlCount = reference.controlCount;
							if (controlCount > 0)
							{
								int controlStartIndex = reference.controlStartIndex;
								for (int m = 0; m < controlCount; m++)
								{
									InputControl inputControl = m_State.controls[controlStartIndex + m];
									if (!m_ControlsForEachAction.ContainsReference(inputAction2.m_ControlStartIndex, inputAction2.m_ControlCount, inputControl))
									{
										m_ControlsForEachAction[num4] = inputControl;
										num4++;
										inputAction2.m_ControlCount++;
									}
								}
							}
						}
						num6++;
					}
				}
				if (array2 == null)
				{
					m_BindingsForEachAction = m_Bindings;
				}
				else
				{
					m_BindingsForEachAction = array2;
				}
			}
			controlsForEachActionInitialized = true;
			bindingsForEachActionInitialized = true;
		}

		internal void OnWantToChangeSetup()
		{
			if ((Object)(object)asset != (Object)null)
			{
				foreach (InputActionMap actionMap in asset.actionMaps)
				{
					if (actionMap.enabled)
					{
						throw new InvalidOperationException($"Cannot add, remove, or change elements of InputActionAsset {asset} while one or more of its actions are enabled");
					}
				}
				return;
			}
			if (enabled)
			{
				throw new InvalidOperationException($"Cannot add, remove, or change elements of InputActionMap {this} while one or more of its actions are enabled");
			}
		}

		internal void OnSetupChanged()
		{
			if ((Object)(object)m_Asset != (Object)null)
			{
				m_Asset.MarkAsDirty();
				foreach (InputActionMap actionMap in m_Asset.actionMaps)
				{
					actionMap.m_State = null;
				}
			}
			else
			{
				m_State = null;
			}
			ClearCachedActionData();
			LazyResolveBindings(fullResolve: true);
		}

		internal void OnBindingModified()
		{
			ClearCachedActionData();
			LazyResolveBindings(fullResolve: true);
		}

		internal void ClearCachedActionData(bool onlyControls = false)
		{
			if (!onlyControls)
			{
				bindingsForEachActionInitialized = false;
				m_BindingsForEachAction = null;
				m_ActionIndexByNameOrId = null;
			}
			controlsForEachActionInitialized = false;
			m_ControlsForEachAction = null;
		}

		internal void GenerateId()
		{
			m_Id = Guid.NewGuid().ToString();
		}

		internal bool LazyResolveBindings(bool fullResolve)
		{
			m_ControlsForEachAction = null;
			controlsForEachActionInitialized = false;
			if (m_State == null)
			{
				return false;
			}
			needToResolveBindings = true;
			bindingResolutionNeedsFullReResolve |= fullResolve;
			if (s_DeferBindingResolution > 0)
			{
				return false;
			}
			ResolveBindings();
			return true;
		}

		internal bool ResolveBindingsIfNecessary()
		{
			if (m_State == null || needToResolveBindings)
			{
				if (m_State != null && m_State.isProcessingControlStateChange)
				{
					return false;
				}
				ResolveBindings();
				return true;
			}
			return false;
		}

		internal void ResolveBindings()
		{
			using (InputActionRebindingExtensions.DeferBindingResolution())
			{
				InputActionState.UnmanagedMemory oldMemory = default(InputActionState.UnmanagedMemory);
				try
				{
					InputBindingResolver resolver = default(InputBindingResolver);
					bool flag = m_State == null;
					OneOrMore<InputActionMap, ReadOnlyArray<InputActionMap>> oneOrMore;
					if ((Object)(object)m_Asset != (Object)null)
					{
						oneOrMore = m_Asset.actionMaps;
						resolver.bindingMask = m_Asset.m_BindingMask;
						foreach (InputActionMap item in oneOrMore)
						{
							flag |= item.bindingResolutionNeedsFullReResolve;
							item.needToResolveBindings = false;
							item.bindingResolutionNeedsFullReResolve = false;
							item.controlsForEachActionInitialized = false;
						}
					}
					else
					{
						oneOrMore = this;
						flag |= bindingResolutionNeedsFullReResolve;
						needToResolveBindings = false;
						bindingResolutionNeedsFullReResolve = false;
						controlsForEachActionInitialized = false;
					}
					bool hasEnabledActions = false;
					InputControlList<InputControl> activeControls = default(InputControlList<InputControl>);
					if (m_State != null)
					{
						oldMemory = m_State.memory.Clone();
						m_State.PrepareForBindingReResolution(flag, ref activeControls, ref hasEnabledActions);
						resolver.StartWithPreviousResolve(m_State, flag);
						m_State.memory.Dispose();
					}
					foreach (InputActionMap item2 in oneOrMore)
					{
						resolver.AddActionMap(item2);
					}
					if (m_State == null)
					{
						m_State = new InputActionState();
						m_State.Initialize(resolver);
					}
					else
					{
						m_State.ClaimDataFrom(resolver);
					}
					if ((Object)(object)m_Asset != (Object)null)
					{
						foreach (InputActionMap item3 in oneOrMore)
						{
							item3.m_State = m_State;
						}
						m_Asset.m_SharedStateForAllMaps = m_State;
					}
					m_State.FinishBindingResolution(hasEnabledActions, oldMemory, activeControls, flag);
				}
				finally
				{
					oldMemory.Dispose();
				}
			}
		}

		public int FindBinding(InputBinding mask, out InputAction action)
		{
			int num = FindBindingRelativeToMap(mask);
			if (num == -1)
			{
				action = null;
				return -1;
			}
			action = m_SingletonAction ?? FindAction(bindings[num].action);
			return action.BindingIndexOnMapToBindingIndexOnAction(num);
		}

		internal int FindBindingRelativeToMap(InputBinding mask)
		{
			InputBinding[] array = m_Bindings;
			int num = array.LengthSafe();
			for (int i = 0; i < num; i++)
			{
				if (mask.Matches(ref array[i]))
				{
					return i;
				}
			}
			return -1;
		}

		public static InputActionMap[] FromJson(string json)
		{
			if (json == null)
			{
				throw new ArgumentNullException("json");
			}
			return JsonUtility.FromJson<ReadFileJson>(json).ToMaps();
		}

		public static string ToJson(IEnumerable<InputActionMap> maps)
		{
			if (maps == null)
			{
				throw new ArgumentNullException("maps");
			}
			return JsonUtility.ToJson((object)WriteFileJson.FromMaps(maps), true);
		}

		public string ToJson()
		{
			return JsonUtility.ToJson((object)WriteFileJson.FromMap(this), true);
		}

		public void OnBeforeSerialize()
		{
		}

		public void OnAfterDeserialize()
		{
			m_State = null;
			m_MapIndexInState = -1;
			if (m_Actions != null)
			{
				int num = m_Actions.Length;
				for (int i = 0; i < num; i++)
				{
					m_Actions[i].m_ActionMap = this;
				}
			}
			ClearCachedActionData();
			ClearActionLookupTable();
		}
	}
	public static class InputActionRebindingExtensions
	{
		internal struct Parameter
		{
			public object instance;

			public FieldInfo field;

			public int bindingIndex;
		}

		private struct ParameterEnumerable : IEnumerable<Parameter>, IEnumerable
		{
			private InputActionState m_State;

			private ParameterOverride m_Parameter;

			private int m_MapIndex;

			public ParameterEnumerable(InputActionState state, ParameterOverride parameter, int mapIndex = -1)
			{
				m_State = state;
				m_Parameter = parameter;
				m_MapIndex = mapIndex;
			}

			public ParameterEnumerator GetEnumerator()
			{
				return new ParameterEnumerator(m_State, m_Parameter, m_MapIndex);
			}

			IEnumerator<Parameter> IEnumerable<Parameter>.GetEnumerator()
			{
				return GetEnumerator();
			}

			IEnumerator IEnumerable.GetEnumerator()
			{
				return GetEnumerator();
			}
		}

		private struct ParameterEnumerator : IEnumerator<Parameter>, IEnumerator, IDisposable
		{
			private InputActionState m_State;

			private int m_MapIndex;

			private int m_BindingCurrentIndex;

			private int m_BindingEndIndex;

			private int m_InteractionCurrentIndex;

			private int m_InteractionEndIndex;

			private int m_ProcessorCurrentIndex;

			private int m_ProcessorEndIndex;

			private InputBinding m_BindingMask;

			private Type m_ObjectType;

			private string m_ParameterName;

			private bool m_MayBeInteraction;

			private bool m_MayBeProcessor;

			private bool m_MayBeComposite;

			private bool m_CurrentBindingIsComposite;

			private object m_CurrentObject;

			private FieldInfo m_CurrentParameter;

			public Parameter Current
			{
				get
				{
					Parameter result = default(Parameter);
					result.instance = m_CurrentObject;
					result.field = m_CurrentParameter;
					result.bindingIndex = m_BindingCurrentIndex;
					return result;
				}
			}

			object IEnumerator.Current => Current;

			public ParameterEnumerator(InputActionState state, ParameterOverride parameter, int mapIndex = -1)
			{
				this = default(ParameterEnumerator);
				m_State = state;
				m_ParameterName = parameter.parameter;
				m_MapIndex = mapIndex;
				m_ObjectType = parameter.objectType;
				m_MayBeComposite = m_ObjectType == null || typeof(InputBindingComposite).IsAssignableFrom(m_ObjectType);
				m_MayBeProcessor = m_ObjectType == null || typeof(InputProcessor).IsAssignableFrom(m_ObjectType);
				m_MayBeInteraction = m_ObjectType == null || typeof(IInputInteraction).IsAssignableFrom(m_ObjectType);
				m_BindingMask = parameter.bindingMask;
				Reset();
			}

			private bool MoveToNextBinding()
			{
				ref InputBinding binding;
				ref InputActionState.BindingState bindingState;
				do
				{
					m_BindingCurrentIndex++;
					if (m_BindingCurrentIndex >= m_BindingEndIndex)
					{
						return false;
					}
					binding = ref m_State.GetBinding(m_BindingCurrentIndex);
					bindingState = ref m_State.GetBindingState(m_BindingCurrentIndex);
				}
				while ((bindingState.processorCount == 0 && bindingState.interactionCount == 0 && !binding.isComposite) || (m_MayBeComposite && !m_MayBeProcessor && !m_MayBeInteraction && !binding.isComposite) || (m_MayBeProcessor && !m_MayBeComposite && !m_MayBeInteraction && bindingState.processorCount == 0) || (m_MayBeInteraction && !m_MayBeComposite && !m_MayBeProcessor && bindingState.interactionCount == 0) || !m_BindingMask.Matches(ref binding));
				if (m_MayBeComposite)
				{
					m_CurrentBindingIsComposite = binding.isComposite;
				}
				m_ProcessorCurrentIndex = bindingState.processorStartIndex - 1;
				m_ProcessorEndIndex = bindingState.processorStartIndex + bindingState.processorCount;
				m_InteractionCurrentIndex = bindingState.interactionStartIndex - 1;
				m_InteractionEndIndex = bindingState.interactionStartIndex + bindingState.interactionCount;
				return true;
			}

			private bool MoveToNextInteraction()
			{
				while (m_InteractionCurrentIndex < m_InteractionEndIndex)
				{
					m_InteractionCurrentIndex++;
					if (m_InteractionCurrentIndex == m_InteractionEndIndex)
					{
						break;
					}
					IInputInteraction instance = m_State.interactions[m_InteractionCurrentIndex];
					if (FindParameter(instance))
					{
						return true;
					}
				}
				return false;
			}

			private bool MoveToNextProcessor()
			{
				while (m_ProcessorCurrentIndex < m_ProcessorEndIndex)
				{
					m_ProcessorCurrentIndex++;
					if (m_ProcessorCurrentIndex == m_ProcessorEndIndex)
					{
						break;
					}
					InputProcessor instance = m_State.processors[m_ProcessorCurrentIndex];
					if (FindParameter(instance))
					{
						return true;
					}
				}
				return false;
			}

			private bool FindParameter(object instance)
			{
				if (m_ObjectType != null && !m_ObjectType.IsInstanceOfType(instance))
				{
					return false;
				}
				FieldInfo field = instance.GetType().GetField(m_ParameterName, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Public);
				if (field == null)
				{
					return false;
				}
				m_CurrentParameter = field;
				m_CurrentObject = instance;
				return true;
			}

			public bool MoveNext()
			{
				while (true)
				{
					if (m_MayBeInteraction && MoveToNextInteraction())
					{
						return true;
					}
					if (m_MayBeProcessor && MoveToNextProcessor())
					{
						return true;
					}
					if (!MoveToNextBinding())
					{
						return false;
					}
					if (m_MayBeComposite && m_CurrentBindingIsComposite)
					{
						int compositeOrCompositeBindingIndex = m_State.GetBindingState(m_BindingCurrentIndex).compositeOrCompositeBindingIndex;
						InputBindingComposite instance = m_State.composites[compositeOrCompositeBindingIndex];
						if (FindParameter(instance))
						{
							break;
						}
					}
				}
				return true;
			}

			public unsafe void Reset()
			{
				m_CurrentObject = null;
				m_CurrentParameter = null;
				m_InteractionCurrentIndex = 0;
				m_InteractionEndIndex = 0;
				m_ProcessorCurrentIndex = 0;
				m_ProcessorEndIndex = 0;
				m_CurrentBindingIsComposite = false;
				if (m_MapIndex < 0)
				{
					m_BindingCurrentIndex = -1;
					m_BindingEndIndex = m_State.totalBindingCount;
				}
				else
				{
					m_BindingCurrentIndex = m_State.mapIndices[m_MapIndex].bindingStartIndex - 1;
					m_BindingEndIndex = m_State.mapIndices[m_MapIndex].bindingStartIndex + m_State.mapIndices[m_MapIndex].bindingCount;
				}
			}

			public void Dispose()
			{
			}
		}

		internal struct ParameterOverride
		{
			public string objectRegistrationName;

			public string parameter;

			public InputBinding bindingMask;

			public PrimitiveValue value;

			public Type objectType => InputProcessor.s_Processors.LookupTypeRegistration(objectRegistrationName) ?? InputInteraction.s_Interactions.LookupTypeRegistration(objectRegistrationName) ?? InputBindingComposite.s_Composites.LookupTypeRegistration(objectRegistrationName);

			public ParameterOverride(string parameterName, InputBinding bindingMask, PrimitiveValue value = default(PrimitiveValue))
			{
				int num = parameterName.IndexOf(':');
				if (num < 0)
				{
					objectRegistrationName = null;
					parameter = parameterName;
				}
				else
				{
					objectRegistrationName = parameterName.Substring(0, num);
					parameter = parameterName.Substring(num + 1);
				}
				this.bindingMask = bindingMask;
				this.value = value;
			}

			public ParameterOverride(string objectRegistrationName, string parameterName, InputBinding bindingMask, PrimitiveValue value = default(PrimitiveValue))
			{
				this.objectRegistrationName = objectRegistrationName;
				parameter = parameterName;
				this.bindingMask = bindingMask;
				this.value = value;
			}

			public static ParameterOverride? Find(InputActionMap actionMap, ref InputBinding binding, string parameterName, string objectRegistrationName)
			{
				ParameterOverride? first = Find(actionMap.m_ParameterOverrides, actionMap.m_ParameterOverridesCount, ref binding, parameterName, objectRegistrationName);
				InputActionAsset asset = actionMap.asset;
				ParameterOverride? second = (((Object)(object)asset != (Object)null) ? Find(asset.m_ParameterOverrides, asset.m_ParameterOverridesCount, ref binding, parameterName, objectRegistrationName) : null);
				return PickMoreSpecificOne(first, second);
			}

			private static ParameterOverride? Find(ParameterOverride[] overrides, int overrideCount, ref InputBinding binding, string parameterName, string objectRegistrationName)
			{
				ParameterOverride? parameterOverride = null;
				for (int i = 0; i < overrideCount; i++)
				{
					ref ParameterOverride reference = ref overrides[i];
					if (string.Equals(parameterName, reference.parameter, StringComparison.OrdinalIgnoreCase) && reference.bindingMask.Matches(binding) && (reference.objectRegistrationName == null || string.Equals(reference.objectRegistrationName, objectRegistrationName, StringComparison.OrdinalIgnoreCase)))
					{
						parameterOverride = (parameterOverride.HasValue ? PickMoreSpecificOne(parameterOverride, reference) : new ParameterOverride?(reference));
					}
				}
				return parameterOverride;
			}

			private static ParameterOverride? PickMoreSpecificOne(ParameterOverride? first, ParameterOverride? second)
			{
				if (!first.HasValue)
				{
					return second;
				}
				if (!second.HasValue)
				{
					return first;
				}
				if (first.Value.objectRegistrationName != null && second.Value.objectRegistrationName == null)
				{
					return first;
				}
				if (second.Value.objectRegistrationName != null && first.Value.objectRegistrationName == null)
				{
					return second;
				}
				if (first.Value.bindingMask.effectivePath != null && second.Value.bindingMask.effectivePath == null)
				{
					return first;
				}
				if (second.Value.bindingMask.effectivePath != null && first.Value.bindingMask.effectivePath == null)
				{
					return second;
				}
				if (first.Value.bindingMask.action != null && second.Value.bindingMask.action == null)
				{
					return first;
				}
				if (second.Value.bindingMask.action != null && first.Value.bindingMask.action == null)
				{
					return second;
				}
				return first;
			}
		}

		public sealed class RebindingOperation : IDisposable
		{
			[Flags]
			private enum Flags
			{
				Started = 1,
				Completed = 2,
				Canceled = 4,
				OnEventHooked = 8,
				OnAfterUpdateHooked = 0x10,
				DontIgnoreNoisyControls = 0x40,
				DontGeneralizePathOfSelectedControl = 0x80,
				AddNewBinding = 0x100,
				SuppressMatchingEvents = 0x200
			}

			public const float kDefaultMagnitudeThreshold = 0.2f;

			private InputAction m_ActionToRebind;

			private InputBinding? m_BindingMask;

			private Type m_ControlType;

			private InternedString m_ExpectedLayout;

			private int m_IncludePathCount;

			private string[] m_IncludePaths;

			private int m_ExcludePathCount;

			private string[] m_ExcludePaths;

			private int m_TargetBindingIndex = -1;

			private string m_BindingGroupForNewBinding;

			private string m_CancelBinding;

			private float m_MagnitudeThreshold = 0.2f;

			private float[] m_Scores;

			private float[] m_Magnitudes;

			private double m_LastMatchTime;

			private double m_StartTime;

			private float m_Timeout;

			private float m_WaitSecondsAfterMatch;

			private InputControlList<InputControl> m_Candidates;

			private Action<RebindingOperation> m_OnComplete;

			private Action<RebindingOperation> m_OnCancel;

			private Action<RebindingOperation> m_OnPotentialMatch;

			private Func<InputControl, string> m_OnGeneratePath;

			private Func<InputControl, InputEventPtr, float> m_OnComputeScore;

			private Action<RebindingOperation, string> m_OnApplyBinding;

			private Action<InputEventPtr, InputDevice> m_OnEventDelegate;

			private Action m_OnAfterUpdateDelegate;

			private InputControlLayout.Cache m_LayoutCache;

			private StringBuilder m_PathBuilder;

			private Flags m_Flags;

			private Dictionary<InputControl, float> m_StartingActuations = new Dictionary<InputControl, float>();

			public InputAction action => m_ActionToRebind;

			public InputBinding? bindingMask => m_BindingMask;

			public InputControlList<InputControl> candidates => m_Candidates;

			public ReadOnlyArray<float> scores => new ReadOnlyArray<float>(m_Scores, 0, m_Candidates.Count);

			public ReadOnlyArray<float> magnitudes => new ReadOnlyArray<float>(m_Magnitudes, 0, m_Candidates.Count);

			public InputControl selectedControl
			{
				get
				{
					if (m_Candidates.Count == 0)
					{
						return null;
					}
					return m_Candidates[0];
				}
			}

			public bool started => (m_Flags & Flags.Started) != 0;

			public bool completed => (m_Flags & Flags.Completed) != 0;

			public bool canceled => (m_Flags & Flags.Canceled) != 0;

			public double startTime => m_StartTime;

			public float timeout => m_Timeout;

			public string expectedControlType => m_ExpectedLayout;

			public RebindingOperation WithAction(InputAction action)
			{
				ThrowIfRebindInProgress();
				if (action == null)
				{
					throw new ArgumentNullException("action");
				}
				if (action.enabled)
				{
					throw new InvalidOperationException($"Cannot rebind action '{action}' while it is enabled");
				}
				m_ActionToRebind = action;
				if (!string.IsNullOrEmpty(action.expectedControlType))
				{
					WithExpectedControlType(action.expectedControlType);
				}
				else if (action.type == InputActionType.Button)
				{
					WithExpectedControlType("Button");
				}
				return this;
			}

			public RebindingOperation WithMatchingEventsBeingSuppressed(bool value = true)
			{
				ThrowIfRebindInProgress();
				if (value)
				{
					m_Flags |= Flags.SuppressMatchingEvents;
				}
				else
				{
					m_Flags &= ~Flags.SuppressMatchingEvents;
				}
				return this;
			}

			public RebindingOperation WithCancelingThrough(string binding)
			{
				ThrowIfRebindInProgress();
				m_CancelBinding = binding;
				return this;
			}

			public RebindingOperation WithCancelingThrough(InputControl control)
			{
				ThrowIfRebindInProgress();
				if (control == null)
				{
					throw new ArgumentNullException("control");
				}
				return WithCancelingThrough(control.path);
			}

			public RebindingOperation WithExpectedControlType(string layoutName)
			{
				ThrowIfRebindInProgress();
				m_ExpectedLayout = new InternedString(layoutName);
				return this;
			}

			public RebindingOperation WithExpectedControlType(Type type)
			{
				ThrowIfRebindInProgress();
				if (type != null && !typeof(InputControl).IsAssignableFrom(type))
				{
					throw new ArgumentException("Type '" + type.Name + "' is not an InputControl", "type");
				}
				m_ControlType = type;
				return this;
			}

			public RebindingOperation WithExpectedControlType<TControl>() where TControl : InputControl
			{
				ThrowIfRebindInProgress();
				return WithExpectedControlType(typeof(TControl));
			}

			public RebindingOperation WithTargetBinding(int bindingIndex)
			{
				if (bindingIndex < 0)
				{
					throw new ArgumentOutOfRangeException("bindingIndex");
				}
				m_TargetBindingIndex = bindingIndex;
				if (m_ActionToRebind != null && bindingIndex < m_ActionToRebind.bindings.Count)
				{
					InputBinding inputBinding = m_ActionToRebind.bindings[bindingIndex];
					if (inputBinding.isPartOfComposite)
					{
						string nameOfComposite = m_ActionToRebind.ChangeBinding(bindingIndex).PreviousCompositeBinding().binding.GetNameOfComposite();
						string name = inputBinding.name;
						string expectedControlLayoutName = InputBindingComposite.GetExpectedControlLayoutName(nameOfComposite, name);
						if (!string.IsNullOrEmpty(expectedControlLayoutName))
						{
							WithExpectedControlType(expectedControlLayoutName);
						}
					}
					InputActionAsset inputActionAsset = action.actionMap?.asset;
					if ((Object)(object)inputActionAsset != (Object)null && !string.IsNullOrEmpty(inputBinding.groups))
					{
						string[] array = inputBinding.groups.Split(';');
						foreach (string group in array)
						{
							int num = inputActionAsset.controlSchemes.IndexOf((InputControlScheme x) => group.Equals(x.bindingGroup, StringComparison.InvariantCultureIgnoreCase));
							if (num == -1)
							{
								continue;
							}
							foreach (InputControlScheme.DeviceRequirement deviceRequirement in inputActionAsset.controlSchemes[num].deviceRequirements)
							{
								WithControlsHavingToMatchPath(deviceRequirement.controlPath);
							}
						}
					}
				}
				return this;
			}

			public RebindingOperation WithBindingMask(InputBinding? bindingMask)
			{
				m_BindingMask = bindingMask;
				return this;
			}

			public RebindingOperation WithBindingGroup(string group)
			{
				return WithBindingMask(new InputBinding
				{
					groups = group
				});
			}

			public RebindingOperation WithoutGeneralizingPathOfSelectedControl()
			{
				m_Flags |= Flags.DontGeneralizePathOfSelectedControl;
				return this;
			}

			public RebindingOperation WithRebindAddingNewBinding(string group = null)
			{
				m_Flags |= Flags.AddNewBinding;
				m_BindingGroupForNewBinding = group;
				return this;
			}

			public RebindingOperation WithMagnitudeHavingToBeGreaterThan(float magnitude)
			{
				ThrowIfRebindInProgress();
				if (magnitude < 0f)
				{
					throw new ArgumentException($"Magnitude has to be positive but was {magnitude}", "magnitude");
				}
				m_MagnitudeThreshold = magnitude;
				return this;
			}

			public RebindingOperation WithoutIgnoringNoisyControls()
			{
				ThrowIfRebindInProgress();
				m_Flags |= Flags.DontIgnoreNoisyControls;
				return this;
			}

			public RebindingOperation WithControlsHavingToMatchPath(string path)
			{
				ThrowIfRebindInProgress();
				if (string.IsNullOrEmpty(path))
				{
					throw new ArgumentNullException("path");
				}
				for (int i = 0; i < m_IncludePathCount; i++)
				{
					if (string.Compare(m_IncludePaths[i], path, StringComparison.InvariantCultureIgnoreCase) == 0)
					{
						return this;
					}
				}
				ArrayHelpers.AppendWithCapacity(ref m_IncludePaths, ref m_IncludePathCount, path);
				return this;
			}

			public RebindingOperation WithControlsExcluding(string path)
			{
				ThrowIfRebindInProgress();
				if (string.IsNullOrEmpty(path))
				{
					throw new ArgumentNullException("path");
				}
				for (int i = 0; i < m_ExcludePathCount; i++)
				{
					if (string.Compare(m_ExcludePaths[i], path, StringComparison.InvariantCultureIgnoreCase) == 0)
					{
						return this;
					}
				}
				ArrayHelpers.AppendWithCapacity(ref m_ExcludePaths, ref m_ExcludePathCount, path);
				return this;
			}

			public RebindingOperation WithTimeout(float timeInSeconds)
			{
				m_Timeout = timeInSeconds;
				return this;
			}

			public RebindingOperation OnComplete(Action<RebindingOperation> callback)
			{
				m_OnComplete = callback;
				return this;
			}

BepInEx\plugins\Cyberhead\Unity.XR.CoreUtils.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Unity.Collections;
using Unity.XR.CoreUtils.Bindings.Variables;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.InputSystem.XR;
using UnityEngine.SceneManagement;
using UnityEngine.Serialization;
using UnityEngine.SpatialTracking;
using UnityEngine.UI;
using UnityEngine.XR;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Unity.XR.CoreUtils
{
	public readonly struct ARTrackablesParentTransformChangedEventArgs : IEquatable<ARTrackablesParentTransformChangedEventArgs>
	{
		public XROrigin Origin { get; }

		public Transform TrackablesParent { get; }

		public ARTrackablesParentTransformChangedEventArgs(XROrigin origin, Transform trackablesParent)
		{
			if ((Object)(object)origin == (Object)null)
			{
				throw new ArgumentNullException("origin");
			}
			if ((Object)(object)trackablesParent == (Object)null)
			{
				throw new ArgumentNullException("trackablesParent");
			}
			Origin = origin;
			TrackablesParent = trackablesParent;
		}

		public bool Equals(ARTrackablesParentTransformChangedEventArgs other)
		{
			if ((Object)(object)Origin == (Object)(object)other.Origin)
			{
				return (Object)(object)TrackablesParent == (Object)(object)other.TrackablesParent;
			}
			return false;
		}

		public override bool Equals(object obj)
		{
			if (obj is ARTrackablesParentTransformChangedEventArgs other)
			{
				return Equals(other);
			}
			return false;
		}

		public override int GetHashCode()
		{
			return HashCodeUtil.Combine(HashCodeUtil.ReferenceHash(Origin), HashCodeUtil.ReferenceHash(TrackablesParent));
		}

		public static bool operator ==(ARTrackablesParentTransformChangedEventArgs lhs, ARTrackablesParentTransformChangedEventArgs rhs)
		{
			return lhs.Equals(rhs);
		}

		public static bool operator !=(ARTrackablesParentTransformChangedEventArgs lhs, ARTrackablesParentTransformChangedEventArgs rhs)
		{
			return !lhs.Equals(rhs);
		}
	}
	public class ReadOnlyAttribute : PropertyAttribute
	{
	}
	[AttributeUsage(AttributeTargets.Class)]
	public class ScriptableSettingsPathAttribute : Attribute
	{
		private readonly string m_Path;

		public string Path => m_Path;

		public ScriptableSettingsPathAttribute(string path = "")
		{
			m_Path = path;
		}
	}
	public static class BoundsUtils
	{
		private static readonly List<Renderer> k_Renderers = new List<Renderer>();

		private static readonly List<Transform> k_Transforms = new List<Transform>();

		public static Bounds GetBounds(List<GameObject> gameObjects)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			Bounds? val = null;
			foreach (GameObject gameObject in gameObjects)
			{
				Bounds bounds = GetBounds(gameObject.transform);
				if (!val.HasValue)
				{
					val = bounds;
					continue;
				}
				((Bounds)(ref bounds)).Encapsulate(val.Value);
				val = bounds;
			}
			return val.GetValueOrDefault();
		}

		public static Bounds GetBounds(Transform[] transforms)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			Bounds? val = null;
			for (int i = 0; i < transforms.Length; i++)
			{
				Bounds bounds = GetBounds(transforms[i]);
				if (!val.HasValue)
				{
					val = bounds;
					continue;
				}
				((Bounds)(ref bounds)).Encapsulate(val.Value);
				val = bounds;
			}
			return val.GetValueOrDefault();
		}

		public static Bounds GetBounds(Transform transform)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			((Component)transform).GetComponentsInChildren<Renderer>(k_Renderers);
			Bounds bounds = GetBounds(k_Renderers);
			if (((Bounds)(ref bounds)).size == Vector3.zero)
			{
				((Component)transform).GetComponentsInChildren<Transform>(k_Transforms);
				if (k_Transforms.Count > 0)
				{
					((Bounds)(ref bounds)).center = k_Transforms[0].position;
				}
				foreach (Transform k_Transform in k_Transforms)
				{
					((Bounds)(ref bounds)).Encapsulate(k_Transform.position);
				}
			}
			return bounds;
		}

		public static Bounds GetBounds(List<Renderer> renderers)
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			Bounds result2;
			if (renderers.Count > 0)
			{
				Renderer val = renderers[0];
				Bounds result = default(Bounds);
				((Bounds)(ref result))..ctor(((Component)val).transform.position, Vector3.zero);
				{
					foreach (Renderer renderer in renderers)
					{
						result2 = renderer.bounds;
						if (((Bounds)(ref result2)).size != Vector3.zero)
						{
							((Bounds)(ref result)).Encapsulate(renderer.bounds);
						}
					}
					return result;
				}
			}
			result2 = default(Bounds);
			return result2;
		}

		public static Bounds GetBounds<T>(List<T> colliders) where T : Collider
		{
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			Bounds result2;
			if (colliders.Count > 0)
			{
				T val = colliders[0];
				Bounds result = default(Bounds);
				((Bounds)(ref result))..ctor(((Component)(object)val).transform.position, Vector3.zero);
				{
					foreach (T collider in colliders)
					{
						result2 = ((Collider)collider).bounds;
						if (((Bounds)(ref result2)).size != Vector3.zero)
						{
							((Bounds)(ref result)).Encapsulate(((Collider)collider).bounds);
						}
					}
					return result;
				}
			}
			result2 = default(Bounds);
			return result2;
		}

		public static Bounds GetBounds(List<Vector3> points)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			Bounds result = default(Bounds);
			if (points.Count < 1)
			{
				return result;
			}
			Vector3 val = points[0];
			Vector3 val2 = val;
			for (int i = 1; i < points.Count; i++)
			{
				Vector3 val3 = points[i];
				if (val3.x < val.x)
				{
					val.x = val3.x;
				}
				if (val3.y < val.y)
				{
					val.y = val3.y;
				}
				if (val3.z < val.z)
				{
					val.z = val3.z;
				}
				if (val3.x > val2.x)
				{
					val2.x = val3.x;
				}
				if (val3.y > val2.y)
				{
					val2.y = val3.y;
				}
				if (val3.z > val2.z)
				{
					val2.z = val3.z;
				}
			}
			((Bounds)(ref result)).SetMinMax(val, val2);
			return result;
		}
	}
	public interface IComponentHost<THostType> where THostType : class
	{
		THostType[] HostedComponents { get; }
	}
	[Flags]
	public enum CachedSearchType
	{
		Children = 1,
		Self = 2,
		Parents = 4
	}
	public class CachedComponentFilter<TFilterType, TRootType> : IDisposable where TFilterType : class where TRootType : Component
	{
		private readonly List<TFilterType> m_MasterComponentStorage;

		private static readonly List<TFilterType> k_TempComponentList = new List<TFilterType>();

		private static readonly List<IComponentHost<TFilterType>> k_TempHostComponentList = new List<IComponentHost<TFilterType>>();

		private bool m_DisposedValue;

		public CachedComponentFilter(TRootType componentRoot, CachedSearchType cachedSearchType = CachedSearchType.Children | CachedSearchType.Self, bool includeDisabled = true)
		{
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			m_MasterComponentStorage = CollectionPool<List<TFilterType>, TFilterType>.GetCollection();
			k_TempComponentList.Clear();
			k_TempHostComponentList.Clear();
			if ((cachedSearchType & CachedSearchType.Self) == CachedSearchType.Self)
			{
				((Component)componentRoot).GetComponents<TFilterType>(k_TempComponentList);
				((Component)componentRoot).GetComponents<IComponentHost<TFilterType>>(k_TempHostComponentList);
				FilteredCopyToMaster(includeDisabled);
			}
			if ((cachedSearchType & CachedSearchType.Parents) == CachedSearchType.Parents)
			{
				Transform parent = ((Component)componentRoot).transform.parent;
				while ((Object)(object)parent != (Object)null && !((Object)(object)((Component)parent).GetComponent<TRootType>() != (Object)null))
				{
					((Component)parent).GetComponents<TFilterType>(k_TempComponentList);
					((Component)parent).GetComponents<IComponentHost<TFilterType>>(k_TempHostComponentList);
					FilteredCopyToMaster(includeDisabled);
					parent = ((Component)parent).transform.parent;
				}
			}
			if ((cachedSearchType & CachedSearchType.Children) != CachedSearchType.Children)
			{
				return;
			}
			foreach (Transform item in ((Component)componentRoot).transform)
			{
				((Component)item).GetComponentsInChildren<TFilterType>(k_TempComponentList);
				((Component)item).GetComponentsInChildren<IComponentHost<TFilterType>>(k_TempHostComponentList);
				FilteredCopyToMaster(includeDisabled, componentRoot);
			}
		}

		public CachedComponentFilter(TFilterType[] componentList, bool includeDisabled = true)
		{
			if (componentList != null)
			{
				m_MasterComponentStorage = CollectionPool<List<TFilterType>, TFilterType>.GetCollection();
				k_TempComponentList.Clear();
				k_TempComponentList.AddRange(componentList);
				FilteredCopyToMaster(includeDisabled);
			}
		}

		public void StoreMatchingComponents<TChildType>(List<TChildType> outputList) where TChildType : class, TFilterType
		{
			foreach (TFilterType item2 in m_MasterComponentStorage)
			{
				if (item2 is TChildType item)
				{
					outputList.Add(item);
				}
			}
		}

		public TChildType[] GetMatchingComponents<TChildType>() where TChildType : class, TFilterType
		{
			int num = 0;
			foreach (TFilterType item in m_MasterComponentStorage)
			{
				if (item is TChildType)
				{
					num++;
				}
			}
			TChildType[] array = new TChildType[num];
			num = 0;
			foreach (TFilterType item2 in m_MasterComponentStorage)
			{
				if (item2 is TChildType val)
				{
					array[num] = val;
					num++;
				}
			}
			return array;
		}

		private void FilteredCopyToMaster(bool includeDisabled)
		{
			if (includeDisabled)
			{
				m_MasterComponentStorage.AddRange(k_TempComponentList);
				{
					foreach (IComponentHost<TFilterType> k_TempHostComponent in k_TempHostComponentList)
					{
						m_MasterComponentStorage.AddRange(k_TempHostComponent.HostedComponents);
					}
					return;
				}
			}
			foreach (TFilterType k_TempComponent in k_TempComponentList)
			{
				Behaviour val = (Behaviour)(object)((k_TempComponent is Behaviour) ? k_TempComponent : null);
				if (!((Object)(object)val != (Object)null) || val.enabled)
				{
					m_MasterComponentStorage.Add(k_TempComponent);
				}
			}
			foreach (IComponentHost<TFilterType> k_TempHostComponent2 in k_TempHostComponentList)
			{
				Behaviour val2 = (Behaviour)((k_TempHostComponent2 is Behaviour) ? k_TempHostComponent2 : null);
				if (!((Object)(object)val2 != (Object)null) || val2.enabled)
				{
					m_MasterComponentStorage.AddRange(k_TempHostComponent2.HostedComponents);
				}
			}
		}

		private void FilteredCopyToMaster(bool includeDisabled, TRootType requiredRoot)
		{
			if (includeDisabled)
			{
				foreach (TFilterType k_TempComponent in k_TempComponentList)
				{
					Component val = (Component)(object)((k_TempComponent is Component) ? k_TempComponent : null);
					if (!((Object)(object)val.transform == (Object)(object)requiredRoot) && !((Object)(object)val.GetComponentInParent<TRootType>() != (Object)(object)requiredRoot))
					{
						m_MasterComponentStorage.Add(k_TempComponent);
					}
				}
				{
					foreach (IComponentHost<TFilterType> k_TempHostComponent in k_TempHostComponentList)
					{
						Component val2 = (Component)((k_TempHostComponent is Component) ? k_TempHostComponent : null);
						if (!((Object)(object)val2.transform == (Object)(object)requiredRoot) && !((Object)(object)val2.GetComponentInParent<TRootType>() != (Object)(object)requiredRoot))
						{
							m_MasterComponentStorage.AddRange(k_TempHostComponent.HostedComponents);
						}
					}
					return;
				}
			}
			foreach (TFilterType k_TempComponent2 in k_TempComponentList)
			{
				Behaviour val3 = (Behaviour)(object)((k_TempComponent2 is Behaviour) ? k_TempComponent2 : null);
				if (val3.enabled && !((Object)(object)((Component)val3).transform == (Object)(object)requiredRoot) && !((Object)(object)((Component)val3).GetComponentInParent<TRootType>() != (Object)(object)requiredRoot))
				{
					m_MasterComponentStorage.Add(k_TempComponent2);
				}
			}
			foreach (IComponentHost<TFilterType> k_TempHostComponent2 in k_TempHostComponentList)
			{
				Behaviour val4 = (Behaviour)((k_TempHostComponent2 is Behaviour) ? k_TempHostComponent2 : null);
				if (val4.enabled && !((Object)(object)((Component)val4).transform == (Object)(object)requiredRoot) && !((Object)(object)((Component)val4).GetComponentInParent<TRootType>() != (Object)(object)requiredRoot))
				{
					m_MasterComponentStorage.AddRange(k_TempHostComponent2.HostedComponents);
				}
			}
		}

		protected virtual void Dispose(bool disposing)
		{
			if (!m_DisposedValue)
			{
				if (disposing && m_MasterComponentStorage != null)
				{
					CollectionPool<List<TFilterType>, TFilterType>.RecycleCollection(m_MasterComponentStorage);
				}
				m_DisposedValue = true;
			}
		}

		public void Dispose()
		{
			Dispose(disposing: true);
		}
	}
	public static class CollectionPool<TCollection, TValue> where TCollection : ICollection<TValue>, new()
	{
		private static readonly Queue<TCollection> k_CollectionQueue = new Queue<TCollection>();

		public static TCollection GetCollection()
		{
			if (k_CollectionQueue.Count <= 0)
			{
				return new TCollection();
			}
			return k_CollectionQueue.Dequeue();
		}

		public static void RecycleCollection(TCollection collection)
		{
			collection.Clear();
			k_CollectionQueue.Enqueue(collection);
		}
	}
	public static class ComponentUtils<T>
	{
		private static readonly List<T> k_RetrievalList = new List<T>();

		public static T GetComponent(GameObject gameObject)
		{
			T result = default(T);
			gameObject.GetComponents<T>(k_RetrievalList);
			if (k_RetrievalList.Count > 0)
			{
				return k_RetrievalList[0];
			}
			return result;
		}

		public static T GetComponentInChildren(GameObject gameObject)
		{
			T result = default(T);
			gameObject.GetComponentsInChildren<T>(k_RetrievalList);
			if (k_RetrievalList.Count > 0)
			{
				return k_RetrievalList[0];
			}
			return result;
		}
	}
	public static class ComponentUtils
	{
		public static T GetOrAddIf<T>(GameObject gameObject, bool add) where T : Component
		{
			T val = gameObject.GetComponent<T>();
			if (add && (Object)(object)val == (Object)null)
			{
				val = gameObject.AddComponent<T>();
			}
			return val;
		}
	}
	public static class EnumValues<T>
	{
		public static readonly T[] Values = (T[])Enum.GetValues(typeof(T));
	}
	public static class BoundsExtensions
	{
		public static bool ContainsCompletely(this Bounds outerBounds, Bounds innerBounds)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			Vector3 max = ((Bounds)(ref outerBounds)).max;
			Vector3 min = ((Bounds)(ref outerBounds)).min;
			Vector3 max2 = ((Bounds)(ref innerBounds)).max;
			Vector3 min2 = ((Bounds)(ref innerBounds)).min;
			if (max.x >= max2.x && max.y >= max2.y && max.z >= max2.z && min.x <= min2.x && min.y <= min2.y)
			{
				return min.z <= min2.z;
			}
			return false;
		}
	}
	public static class CameraExtensions
	{
		private const float k_OneOverSqrt2 = 0.70710677f;

		public static float GetVerticalFieldOfView(this Camera camera, float aspectNeutralFieldOfView)
		{
			return Mathf.Atan(Mathf.Tan(aspectNeutralFieldOfView * 0.5f * ((float)Math.PI / 180f)) * 0.70710677f / Mathf.Sqrt(camera.aspect)) * 2f * 57.29578f;
		}

		public static float GetHorizontalFieldOfView(this Camera camera)
		{
			float num = camera.fieldOfView * 0.5f;
			return 57.29578f * Mathf.Atan(Mathf.Tan(num * ((float)Math.PI / 180f)) * camera.aspect);
		}

		public static float GetVerticalOrthographicSize(this Camera camera, float size)
		{
			return size * 0.70710677f / Mathf.Sqrt(camera.aspect);
		}
	}
	public static class CollectionExtensions
	{
		private static readonly StringBuilder k_String = new StringBuilder();

		public static string Stringify<T>(this ICollection<T> collection)
		{
			k_String.Length = 0;
			int num = collection.Count - 1;
			int num2 = 0;
			foreach (T item in collection)
			{
				k_String.AppendFormat((num2++ == num) ? "{0}" : "{0}, ", item);
			}
			return k_String.ToString();
		}
	}
	public static class DictionaryExtensions
	{
		public static KeyValuePair<TKey, TValue> First<TKey, TValue>(this Dictionary<TKey, TValue> dictionary)
		{
			KeyValuePair<TKey, TValue> result = default(KeyValuePair<TKey, TValue>);
			Dictionary<TKey, TValue>.Enumerator enumerator = dictionary.GetEnumerator();
			if (enumerator.MoveNext())
			{
				result = enumerator.Current;
			}
			enumerator.Dispose();
			return result;
		}
	}
	public static class GameObjectExtensions
	{
		public static void SetHideFlagsRecursively(this GameObject gameObject, HideFlags hideFlags)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			((Object)gameObject).hideFlags = hideFlags;
			foreach (Transform item in gameObject.transform)
			{
				((Component)item).gameObject.SetHideFlagsRecursively(hideFlags);
			}
		}

		public static void AddToHideFlagsRecursively(this GameObject gameObject, HideFlags hideFlags)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			((Object)gameObject).hideFlags = (HideFlags)(((Object)gameObject).hideFlags | hideFlags);
			foreach (Transform item in gameObject.transform)
			{
				((Component)item).gameObject.AddToHideFlagsRecursively(hideFlags);
			}
		}

		public static void SetLayerRecursively(this GameObject gameObject, int layer)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			gameObject.layer = layer;
			foreach (Transform item in gameObject.transform)
			{
				((Component)item).gameObject.SetLayerRecursively(layer);
			}
		}

		public static void SetLayerAndAddToHideFlagsRecursively(this GameObject gameObject, int layer, HideFlags hideFlags)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			gameObject.layer = layer;
			((Object)gameObject).hideFlags = (HideFlags)(((Object)gameObject).hideFlags | hideFlags);
			foreach (Transform item in gameObject.transform)
			{
				((Component)item).gameObject.SetLayerAndAddToHideFlagsRecursively(layer, hideFlags);
			}
		}

		public static void SetLayerAndHideFlagsRecursively(this GameObject gameObject, int layer, HideFlags hideFlags)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			gameObject.layer = layer;
			((Object)gameObject).hideFlags = hideFlags;
			foreach (Transform item in gameObject.transform)
			{
				((Component)item).gameObject.SetLayerAndHideFlagsRecursively(layer, hideFlags);
			}
		}

		public static void SetRunInEditModeRecursively(this GameObject gameObject, bool enabled)
		{
		}
	}
	public static class GuidExtensions
	{
		public static void Decompose(this Guid guid, out ulong low, out ulong high)
		{
			byte[] value = guid.ToByteArray();
			low = BitConverter.ToUInt64(value, 0);
			high = BitConverter.ToUInt64(value, 8);
		}
	}
	public static class HashSetExtensions
	{
		public static void ExceptWithNonAlloc<T>(this HashSet<T> self, HashSet<T> other)
		{
			foreach (T item in other)
			{
				self.Remove(item);
			}
		}

		public static T First<T>(this HashSet<T> set)
		{
			HashSet<T>.Enumerator enumerator = set.GetEnumerator();
			T result = (enumerator.MoveNext() ? enumerator.Current : default(T));
			enumerator.Dispose();
			return result;
		}
	}
	public static class LayerMaskExtensions
	{
		public static int GetFirstLayerIndex(this LayerMask layerMask)
		{
			if (((LayerMask)(ref layerMask)).value == 0)
			{
				return -1;
			}
			int num = 0;
			int num2 = ((LayerMask)(ref layerMask)).value;
			while ((num2 & 1) == 0)
			{
				num2 >>= 1;
				num++;
			}
			return num;
		}

		public static bool Contains(this LayerMask mask, int layer)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return ((uint)LayerMask.op_Implicit(mask) & (1 << layer)) > 0;
		}
	}
	public static class ListExtensions
	{
		public static List<T> Fill<T>(this List<T> list, int count) where T : new()
		{
			for (int i = 0; i < count; i++)
			{
				list.Add(new T());
			}
			return list;
		}

		public static void EnsureCapacity<T>(this List<T> list, int capacity)
		{
			if (list.Capacity < capacity)
			{
				list.Capacity = capacity;
			}
		}

		public static void SwapAtIndices<T>(this List<T> list, int first, int second)
		{
			T val = list[second];
			T val2 = list[first];
			T val4 = (list[first] = val);
			val4 = (list[second] = val2);
		}
	}
	public static class MonoBehaviourExtensions
	{
	}
	public static class PoseExtensions
	{
		public static Pose ApplyOffsetTo(this Pose pose, Pose otherPose)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = pose.rotation;
			return new Pose(rotation * otherPose.position + pose.position, rotation * otherPose.rotation);
		}

		public static Vector3 ApplyOffsetTo(this Pose pose, Vector3 position)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			return pose.rotation * position + pose.position;
		}

		public static Vector3 ApplyInverseOffsetTo(this Pose pose, Vector3 position)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			return Quaternion.Inverse(pose.rotation) * (position - pose.position);
		}
	}
	public static class QuaternionExtensions
	{
		public static Quaternion ConstrainYaw(this Quaternion rotation)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			rotation.x = 0f;
			rotation.z = 0f;
			return rotation;
		}

		public static Quaternion ConstrainYawNormalized(this Quaternion rotation)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			rotation.x = 0f;
			rotation.z = 0f;
			((Quaternion)(ref rotation)).Normalize();
			return rotation;
		}

		public static Quaternion ConstrainYawPitchNormalized(this Quaternion rotation)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
			eulerAngles.z = 0f;
			return Quaternion.Euler(eulerAngles);
		}
	}
	public static class StringExtensions
	{
		private static readonly StringBuilder k_StringBuilder = new StringBuilder();

		public static string FirstToUpper(this string str)
		{
			if (string.IsNullOrEmpty(str))
			{
				return string.Empty;
			}
			if (str.Length == 1)
			{
				return char.ToUpper(str[0]).ToString();
			}
			return $"{char.ToUpper(str[0])}{str.Substring(1)}";
		}

		public static string InsertSpacesBetweenWords(this string str)
		{
			if (string.IsNullOrEmpty(str))
			{
				return string.Empty;
			}
			k_StringBuilder.Length = 0;
			k_StringBuilder.Append(str[0]);
			int length = str.Length;
			for (int i = 0; i < length - 1; i++)
			{
				char c = str[i];
				char c2 = str[i + 1];
				bool flag = char.IsLower(c);
				bool flag2 = char.IsLower(c2);
				bool flag3 = flag && !flag2;
				if (i + 2 < length)
				{
					bool flag4 = char.IsLower(str[i + 2]);
					flag3 = flag3 || (!flag && !flag2 && flag4);
				}
				if (flag3)
				{
					k_StringBuilder.Append(' ');
				}
				k_StringBuilder.Append(c2);
			}
			return k_StringBuilder.ToString();
		}
	}
	public static class TransformExtensions
	{
		public static Pose GetLocalPose(this Transform transform)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = default(Vector3);
			Quaternion val2 = default(Quaternion);
			transform.GetLocalPositionAndRotation(ref val, ref val2);
			return new Pose(val, val2);
		}

		public static Pose GetWorldPose(this Transform transform)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = default(Vector3);
			Quaternion val2 = default(Quaternion);
			transform.GetPositionAndRotation(ref val, ref val2);
			return new Pose(val, val2);
		}

		public static void SetLocalPose(this Transform transform, Pose pose)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			transform.SetLocalPositionAndRotation(pose.position, pose.rotation);
		}

		public static void SetWorldPose(this Transform transform, Pose pose)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			transform.SetPositionAndRotation(pose.position, pose.rotation);
		}

		public static Pose TransformPose(this Transform transform, Pose pose)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return ((Pose)(ref pose)).GetTransformedBy(transform);
		}

		public static Pose InverseTransformPose(this Transform transform, Pose pose)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)transform == (Object)null)
			{
				throw new ArgumentNullException("transform");
			}
			Pose result = default(Pose);
			result.position = transform.InverseTransformPoint(pose.position);
			result.rotation = Quaternion.Inverse(transform.rotation) * pose.rotation;
			return result;
		}

		public static Ray InverseTransformRay(this Transform transform, Ray ray)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)transform == (Object)null)
			{
				throw new ArgumentNullException("transform");
			}
			return new Ray(transform.InverseTransformPoint(((Ray)(ref ray)).origin), transform.InverseTransformDirection(((Ray)(ref ray)).direction));
		}
	}
	public static class TypeExtensions
	{
		private static readonly List<FieldInfo> k_Fields = new List<FieldInfo>();

		private static readonly List<string> k_TypeNames = new List<string>();

		public static void GetAssignableTypes(this Type type, List<Type> list, Func<Type, bool> predicate = null)
		{
			ReflectionUtils.ForEachType(delegate(Type t)
			{
				if (type.IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract && (predicate == null || predicate(t)))
				{
					list.Add(t);
				}
			});
		}

		public static void GetImplementationsOfInterface(this Type type, List<Type> list)
		{
			if (type.IsInterface)
			{
				type.GetAssignableTypes(list);
			}
		}

		public static void GetExtensionsOfClass(this Type type, List<Type> list)
		{
			if (type.IsClass)
			{
				type.GetAssignableTypes(list);
			}
		}

		public static void GetGenericInterfaces(this Type type, Type genericInterface, List<Type> interfaces)
		{
			Type[] interfaces2 = type.GetInterfaces();
			foreach (Type type2 in interfaces2)
			{
				if (type2.IsGenericType && type2.GetGenericTypeDefinition() == genericInterface)
				{
					interfaces.Add(type2);
				}
			}
		}

		public static PropertyInfo GetPropertyRecursively(this Type type, string name, BindingFlags bindingAttr)
		{
			PropertyInfo propertyInfo = type.GetProperty(name, bindingAttr);
			if (propertyInfo != null)
			{
				return propertyInfo;
			}
			if (type.BaseType != null)
			{
				propertyInfo = type.BaseType.GetPropertyRecursively(name, bindingAttr);
			}
			return propertyInfo;
		}

		public static FieldInfo GetFieldRecursively(this Type type, string name, BindingFlags bindingAttr)
		{
			FieldInfo fieldInfo = type.GetField(name, bindingAttr);
			if (fieldInfo != null)
			{
				return fieldInfo;
			}
			if (type.BaseType != null)
			{
				fieldInfo = type.BaseType.GetFieldRecursively(name, bindingAttr);
			}
			return fieldInfo;
		}

		public static void GetFieldsRecursively(this Type type, List<FieldInfo> fields, BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
		{
			while (true)
			{
				FieldInfo[] fields2 = type.GetFields(bindingAttr);
				foreach (FieldInfo item in fields2)
				{
					fields.Add(item);
				}
				Type baseType = type.BaseType;
				if (baseType != null)
				{
					type = baseType;
					continue;
				}
				break;
			}
		}

		public static void GetPropertiesRecursively(this Type type, List<PropertyInfo> fields, BindingFlags bindingAttr = BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
		{
			while (true)
			{
				PropertyInfo[] properties = type.GetProperties(bindingAttr);
				foreach (PropertyInfo item in properties)
				{
					fields.Add(item);
				}
				Type baseType = type.BaseType;
				if (baseType != null)
				{
					type = baseType;
					continue;
				}
				break;
			}
		}

		public static void GetInterfaceFieldsFromClasses(this IEnumerable<Type> classes, List<FieldInfo> fields, List<Type> interfaceTypes, BindingFlags bindingAttr)
		{
			foreach (Type interfaceType in interfaceTypes)
			{
				if (!interfaceType.IsInterface)
				{
					throw new ArgumentException($"Type {interfaceType} in interfaceTypes is not an interface!");
				}
			}
			foreach (Type @class in classes)
			{
				if (!@class.IsClass)
				{
					throw new ArgumentException($"Type {@class} in classes is not a class!");
				}
				k_Fields.Clear();
				@class.GetFieldsRecursively(k_Fields, bindingAttr);
				foreach (FieldInfo k_Field in k_Fields)
				{
					Type[] interfaces = k_Field.FieldType.GetInterfaces();
					foreach (Type item in interfaces)
					{
						if (interfaceTypes.Contains(item))
						{
							fields.Add(k_Field);
							break;
						}
					}
				}
			}
		}

		public static TAttribute GetAttribute<TAttribute>(this Type type, bool inherit = false) where TAttribute : Attribute
		{
			return (TAttribute)type.GetCustomAttributes(typeof(TAttribute), inherit)[0];
		}

		public static void IsDefinedGetInheritedTypes<TAttribute>(this Type type, List<Type> types) where TAttribute : Attribute
		{
			while (type != null)
			{
				if (type.IsDefined(typeof(TAttribute), inherit: true))
				{
					types.Add(type);
				}
				type = type.BaseType;
			}
		}

		public static FieldInfo GetFieldInTypeOrBaseType(this Type type, string fieldName)
		{
			FieldInfo field;
			while (true)
			{
				if (type == null)
				{
					return null;
				}
				field = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
				if (field != null)
				{
					break;
				}
				type = type.BaseType;
			}
			return field;
		}

		public static string GetNameWithGenericArguments(this Type type)
		{
			string name = type.Name;
			name = name.Replace('+', '.');
			if (!type.IsGenericType)
			{
				return name;
			}
			name = name.Split('`')[0];
			Type[] genericArguments = type.GetGenericArguments();
			int num = genericArguments.Length;
			string[] array = new string[num];
			for (int i = 0; i < num; i++)
			{
				array[i] = genericArguments[i].GetNameWithGenericArguments();
			}
			return name + "<" + string.Join(", ", array) + ">";
		}

		public static string GetNameWithFullGenericArguments(this Type type)
		{
			string name = type.Name;
			name = name.Replace('+', '.');
			if (!type.IsGenericType)
			{
				return name;
			}
			name = name.Split('`')[0];
			Type[] genericArguments = type.GetGenericArguments();
			int num = genericArguments.Length;
			string[] array = new string[num];
			for (int i = 0; i < num; i++)
			{
				array[i] = genericArguments[i].GetFullNameWithGenericArgumentsInternal();
			}
			return name + "<" + string.Join(", ", array) + ">";
		}

		public static string GetFullNameWithGenericArguments(this Type type)
		{
			Type type2 = type.DeclaringType;
			if (type2 != null && !type.IsGenericParameter)
			{
				k_TypeNames.Clear();
				string nameWithFullGenericArguments = type.GetNameWithFullGenericArguments();
				k_TypeNames.Add(nameWithFullGenericArguments);
				while (true)
				{
					Type declaringType = type2.DeclaringType;
					if (declaringType == null)
					{
						break;
					}
					nameWithFullGenericArguments = type2.GetNameWithFullGenericArguments();
					k_TypeNames.Insert(0, nameWithFullGenericArguments);
					type2 = declaringType;
				}
				nameWithFullGenericArguments = type2.GetFullNameWithGenericArguments();
				k_TypeNames.Insert(0, nameWithFullGenericArguments);
				return string.Join(".", k_TypeNames.ToArray());
			}
			return type.GetFullNameWithGenericArgumentsInternal();
		}

		private static string GetFullNameWithGenericArgumentsInternal(this Type type)
		{
			string fullName = type.FullName;
			if (!type.IsGenericType)
			{
				return fullName;
			}
			fullName = fullName.Split('`')[0];
			Type[] genericArguments = type.GetGenericArguments();
			int num = genericArguments.Length;
			string[] array = new string[num];
			for (int i = 0; i < num; i++)
			{
				array[i] = genericArguments[i].GetFullNameWithGenericArguments();
			}
			return fullName + "<" + string.Join(", ", array) + ">";
		}

		public static bool IsAssignableFromOrSubclassOf(this Type checkType, Type baseType)
		{
			if (!checkType.IsAssignableFrom(baseType))
			{
				return checkType.IsSubclassOf(baseType);
			}
			return true;
		}

		public static MethodInfo GetMethodRecursively(this Type type, string name, BindingFlags bindingAttr)
		{
			MethodInfo methodInfo = type.GetMethod(name, bindingAttr);
			if (methodInfo != null)
			{
				return methodInfo;
			}
			if (type.BaseType != null)
			{
				methodInfo = type.BaseType.GetMethodRecursively(name, bindingAttr);
			}
			return methodInfo;
		}
	}
	[Serializable]
	public class BoolUnityEvent : UnityEvent<bool>
	{
	}
	[Serializable]
	public class FloatUnityEvent : UnityEvent<float>
	{
	}
	[Serializable]
	public class Vector2UnityEvent : UnityEvent<Vector2>
	{
	}
	[Serializable]
	public class Vector3UnityEvent : UnityEvent<Vector3>
	{
	}
	[Serializable]
	public class Vector4UnityEvent : UnityEvent<Vector4>
	{
	}
	[Serializable]
	public class QuaternionUnityEvent : UnityEvent<Quaternion>
	{
	}
	[Serializable]
	public class IntUnityEvent : UnityEvent<int>
	{
	}
	[Serializable]
	public class ColorUnityEvent : UnityEvent<Color>
	{
	}
	[Serializable]
	public class StringUnityEvent : UnityEvent<string>
	{
	}
	public static class Vector2Extensions
	{
		public static Vector2 Inverse(this Vector2 vector)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			return new Vector2(1f / vector.x, 1f / vector.y);
		}

		public static float MinComponent(this Vector2 vector)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return Mathf.Min(vector.x, vector.y);
		}

		public static float MaxComponent(this Vector2 vector)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return Mathf.Max(vector.x, vector.y);
		}

		public static Vector2 Abs(this Vector2 vector)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			vector.x = Mathf.Abs(vector.x);
			vector.y = Mathf.Abs(vector.y);
			return vector;
		}
	}
	public static class Vector3Extensions
	{
		public static Vector3 Inverse(this Vector3 vector)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(1f / vector.x, 1f / vector.y, 1f / vector.z);
		}

		public static float MinComponent(this Vector3 vector)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			return Mathf.Min(Mathf.Min(vector.x, vector.y), vector.z);
		}

		public static float MaxComponent(this Vector3 vector)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			return Mathf.Max(Mathf.Max(vector.x, vector.y), vector.z);
		}

		public static Vector3 Abs(this Vector3 vector)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			vector.x = Mathf.Abs(vector.x);
			vector.y = Mathf.Abs(vector.y);
			vector.z = Mathf.Abs(vector.z);
			return vector;
		}

		public static Vector3 Multiply(this Vector3 value, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(value.x * scale.x, value.y * scale.y, value.z * scale.z);
		}

		public static Vector3 Divide(this Vector3 value, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(value.x / scale.x, value.y / scale.y, value.z / scale.z);
		}

		public static Vector3 SafeDivide(this Vector3 value, Vector3 scale)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			float num = (Mathf.Approximately(scale.x, 0f) ? 0f : (value.x / scale.x));
			if (float.IsNaN(num))
			{
				num = 0f;
			}
			float num2 = (Mathf.Approximately(scale.y, 0f) ? 0f : (value.y / scale.y));
			if (float.IsNaN(num2))
			{
				num2 = 0f;
			}
			float num3 = (Mathf.Approximately(scale.z, 0f) ? 0f : (value.z / scale.z));
			if (float.IsNaN(num3))
			{
				num3 = 0f;
			}
			return new Vector3(num, num2, num3);
		}
	}
	public static class GameObjectUtils
	{
		private static readonly List<GameObject> k_GameObjects = new List<GameObject>();

		private static readonly List<Transform> k_Transforms = new List<Transform>();

		public static event Action<GameObject> GameObjectInstantiated;

		public static GameObject Create()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			GameObject val = new GameObject();
			GameObjectUtils.GameObjectInstantiated?.Invoke(val);
			return val;
		}

		public static GameObject Create(string name)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			GameObject val = new GameObject(name);
			GameObjectUtils.GameObjectInstantiated?.Invoke(val);
			return val;
		}

		public static GameObject Instantiate(GameObject original, Transform parent = null, bool worldPositionStays = true)
		{
			GameObject val = Object.Instantiate<GameObject>(original, parent, worldPositionStays);
			if ((Object)(object)val != (Object)null && GameObjectUtils.GameObjectInstantiated != null)
			{
				GameObjectUtils.GameObjectInstantiated(val);
			}
			return val;
		}

		public static GameObject Instantiate(GameObject original, Vector3 position, Quaternion rotation)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return Instantiate(original, null, position, rotation);
		}

		public static GameObject Instantiate(GameObject original, Transform parent, Vector3 position, Quaternion rotation)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(original, position, rotation, parent);
			if ((Object)(object)val != (Object)null && GameObjectUtils.GameObjectInstantiated != null)
			{
				GameObjectUtils.GameObjectInstantiated(val);
			}
			return val;
		}

		public static GameObject CloneWithHideFlags(GameObject original, Transform parent = null)
		{
			GameObject val = Object.Instantiate<GameObject>(original, parent);
			CopyHideFlagsRecursively(original, val);
			return val;
		}

		private static void CopyHideFlagsRecursively(GameObject copyFrom, GameObject copyTo)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			((Object)copyTo).hideFlags = ((Object)copyFrom).hideFlags;
			Transform transform = copyFrom.transform;
			Transform transform2 = copyTo.transform;
			for (int i = 0; i < transform.childCount; i++)
			{
				CopyHideFlagsRecursively(((Component)transform.GetChild(i)).gameObject, ((Component)transform2.GetChild(i)).gameObject);
			}
		}

		public static T ExhaustiveComponentSearch<T>(GameObject desiredSource) where T : Component
		{
			T val = default(T);
			if ((Object)(object)desiredSource != (Object)null)
			{
				val = desiredSource.GetComponentInChildren<T>(true);
			}
			if ((Object)(object)val == (Object)null)
			{
				val = Object.FindObjectOfType<T>();
			}
			_ = (Object)(object)val != (Object)null;
			return val;
		}

		public static T ExhaustiveTaggedComponentSearch<T>(GameObject desiredSource, string tag) where T : Component
		{
			T val = default(T);
			if ((Object)(object)desiredSource != (Object)null)
			{
				T[] componentsInChildren = desiredSource.GetComponentsInChildren<T>(true);
				foreach (T val2 in componentsInChildren)
				{
					if (((Component)val2).gameObject.CompareTag(tag))
					{
						val = val2;
						break;
					}
				}
			}
			if ((Object)(object)val == (Object)null)
			{
				GameObject[] array = GameObject.FindGameObjectsWithTag(tag);
				for (int i = 0; i < array.Length; i++)
				{
					val = array[i].GetComponent<T>();
					if ((Object)(object)val != (Object)null)
					{
						break;
					}
				}
			}
			if ((Object)(object)val == (Object)null)
			{
				val = Object.FindObjectOfType<T>();
			}
			return val;
		}

		public static T GetComponentInScene<T>(Scene scene) where T : Component
		{
			((Scene)(ref scene)).GetRootGameObjects(k_GameObjects);
			foreach (GameObject k_GameObject in k_GameObjects)
			{
				T componentInChildren = k_GameObject.GetComponentInChildren<T>();
				if (Object.op_Implicit((Object)(object)componentInChildren))
				{
					return componentInChildren;
				}
			}
			return default(T);
		}

		public static void GetComponentsInScene<T>(Scene scene, List<T> components, bool includeInactive = false) where T : Component
		{
			((Scene)(ref scene)).GetRootGameObjects(k_GameObjects);
			foreach (GameObject k_GameObject in k_GameObjects)
			{
				if (includeInactive || k_GameObject.activeInHierarchy)
				{
					components.AddRange(k_GameObject.GetComponentsInChildren<T>(includeInactive));
				}
			}
		}

		public static T GetComponentInActiveScene<T>() where T : Component
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return GetComponentInScene<T>(SceneManager.GetActiveScene());
		}

		public static void GetComponentsInActiveScene<T>(List<T> components, bool includeInactive = false) where T : Component
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			GetComponentsInScene(SceneManager.GetActiveScene(), components, includeInactive);
		}

		public static void GetComponentsInAllScenes<T>(List<T> components, bool includeInactive = false) where T : Component
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			int sceneCount = SceneManager.sceneCount;
			for (int i = 0; i < sceneCount; i++)
			{
				Scene sceneAt = SceneManager.GetSceneAt(i);
				if (((Scene)(ref sceneAt)).isLoaded)
				{
					GetComponentsInScene(sceneAt, components, includeInactive);
				}
			}
		}

		public static void GetChildGameObjects(this GameObject go, List<GameObject> childGameObjects)
		{
			Transform transform = go.transform;
			int childCount = transform.childCount;
			if (childCount != 0)
			{
				ListExtensions.EnsureCapacity(childGameObjects, childCount);
				for (int i = 0; i < childCount; i++)
				{
					childGameObjects.Add(((Component)transform.GetChild(i)).gameObject);
				}
			}
		}

		public static GameObject GetNamedChild(this GameObject go, string name)
		{
			k_Transforms.Clear();
			go.GetComponentsInChildren<Transform>(k_Transforms);
			Transform val = k_Transforms.Find((Transform currentTransform) => ((Object)currentTransform).name == name);
			k_Transforms.Clear();
			if ((Object)(object)val != (Object)null)
			{
				return ((Component)val).gameObject;
			}
			return null;
		}
	}
	public static class GeometryUtils
	{
		private const float k_TwoPi = (float)Math.PI * 2f;

		private static readonly Vector3 k_Up = Vector3.up;

		private static readonly Vector3 k_Forward = Vector3.forward;

		private static readonly Vector3 k_Zero = Vector3.zero;

		private static readonly Quaternion k_VerticalCorrection = Quaternion.AngleAxis(180f, k_Up);

		private const float k_MostlyVertical = 0.95f;

		private static readonly List<Vector3> k_HullEdgeDirections = new List<Vector3>();

		private static readonly HashSet<int> k_HullIndices = new HashSet<int>();

		public static bool FindClosestEdge(List<Vector3> vertices, Vector3 point, out Vector3 vertexA, out Vector3 vertexB)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			int count = vertices.Count;
			if (count < 1)
			{
				vertexA = Vector3.zero;
				vertexB = Vector3.zero;
				return false;
			}
			float num = float.MaxValue;
			Vector3 val = Vector3.zero;
			Vector3 val2 = Vector3.zero;
			for (int i = 0; i < count; i++)
			{
				Vector3 val3 = vertices[i];
				Vector3 val4 = vertices[(i + 1) % vertices.Count];
				Vector3 val5 = ClosestPointOnLineSegment(point, val3, val4);
				float num2 = Vector3.SqrMagnitude(point - val5);
				if (num2 < num)
				{
					num = num2;
					val = val3;
					val2 = val4;
				}
			}
			vertexA = val;
			vertexB = val2;
			return true;
		}

		public static Vector3 PointOnOppositeSideOfPolygon(List<Vector3> vertices, Vector3 point)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			int count = vertices.Count;
			if (count < 3)
			{
				return Vector3.zero;
			}
			Vector3 val = vertices[0];
			Vector3 val2 = vertices[1];
			Vector3 val3 = vertices[2];
			Vector3 val4 = Vector3.Cross(val2 - val, val3 - val);
			Vector3 normalized = ((Vector3)(ref val4)).normalized;
			Vector3 val5 = Vector3.zero;
			foreach (Vector3 vertex in vertices)
			{
				val5 += vertex;
			}
			val5 *= 1f / (float)count;
			Vector3 val6 = Vector3.ProjectOnPlane(point - val5, normalized);
			int num = count - 1;
			for (int i = 0; i < count; i++)
			{
				Vector3 val7 = vertices[i];
				Vector3 val8 = ((i == num) ? val : vertices[i + 1]) - val7;
				ClosestTimesOnTwoLines(val7, val8, val5, -val6 * 100f, out var s, out var t);
				if (t >= 0f && s >= 0f && s <= 1f)
				{
					return val7 + val8 * s;
				}
			}
			return Vector3.zero;
		}

		public static void TriangulatePolygon(List<int> indices, int vertCount, bool reverse = false)
		{
			vertCount -= 2;
			ListExtensions.EnsureCapacity(indices, vertCount * 3);
			if (reverse)
			{
				for (int i = 0; i < vertCount; i++)
				{
					indices.Add(0);
					indices.Add(i + 2);
					indices.Add(i + 1);
				}
			}
			else
			{
				for (int j = 0; j < vertCount; j++)
				{
					indices.Add(0);
					indices.Add(j + 1);
					indices.Add(j + 2);
				}
			}
		}

		public static bool ClosestTimesOnTwoLines(Vector3 positionA, Vector3 velocityA, Vector3 positionB, Vector3 velocityB, out float s, out float t, double parallelTest = double.Epsilon)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			double num = Vector3.Dot(velocityA, velocityA);
			double num2 = Vector3.Dot(velocityA, velocityB);
			double num3 = Vector3.Dot(velocityB, velocityB);
			double num4 = num * num3 - num2 * num2;
			if (Math.Abs(num4) < parallelTest)
			{
				s = 0f;
				t = 0f;
				return false;
			}
			Vector3 val = positionA - positionB;
			float num5 = Vector3.Dot(velocityA, val);
			float num6 = Vector3.Dot(velocityB, val);
			s = (float)((num2 * (double)num6 - (double)num5 * num3) / num4);
			t = (float)((num * (double)num6 - (double)num5 * num2) / num4);
			return true;
		}

		public static bool ClosestTimesOnTwoLinesXZ(Vector3 positionA, Vector3 velocityA, Vector3 positionB, Vector3 velocityB, out float s, out float t, double parallelTest = double.Epsilon)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			double num = velocityA.x * velocityA.x + velocityA.z * velocityA.z;
			double num2 = velocityA.x * velocityB.x + velocityA.z * velocityB.z;
			double num3 = velocityB.x * velocityB.x + velocityB.z * velocityB.z;
			double num4 = num * num3 - num2 * num2;
			if (Math.Abs(num4) < parallelTest)
			{
				s = 0f;
				t = 0f;
				return false;
			}
			Vector3 val = positionA - positionB;
			float num5 = velocityA.x * val.x + velocityA.z * val.z;
			float num6 = velocityB.x * val.x + velocityB.z * val.z;
			s = (float)((num2 * (double)num6 - (double)num5 * num3) / num4);
			t = (float)((num * (double)num6 - (double)num5 * num2) / num4);
			return true;
		}

		public static bool ClosestPointsOnTwoLineSegments(Vector3 a, Vector3 aLineVector, Vector3 b, Vector3 bLineVector, out Vector3 resultA, out Vector3 resultB, double parallelTest = double.Epsilon)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			float s;
			float t;
			bool flag = !ClosestTimesOnTwoLines(a, aLineVector, b, bLineVector, out s, out t, parallelTest);
			if (s > 0f && s <= 1f && t > 0f && t <= 1f)
			{
				resultA = a + aLineVector * s;
				resultB = b + bLineVector * t;
			}
			else
			{
				Vector3 val = b + bLineVector;
				Vector3 val2 = a + aLineVector;
				Vector3 val3 = ClosestPointOnLineSegment(a, b, val);
				Vector3 val4 = ClosestPointOnLineSegment(val2, b, val);
				float num = Vector3.Distance(a, val3);
				resultA = a;
				resultB = val3;
				float num2 = Vector3.Distance(val2, val4);
				if (num2 < num)
				{
					resultA = val2;
					resultB = val4;
					num = num2;
				}
				Vector3 val5 = ClosestPointOnLineSegment(b, a, val2);
				num2 = Vector3.Distance(b, val5);
				if (num2 < num)
				{
					resultA = val5;
					resultB = b;
					num = num2;
				}
				Vector3 val6 = ClosestPointOnLineSegment(val, a, val2);
				num2 = Vector3.Distance(val, val6);
				if (num2 < num)
				{
					resultA = val6;
					resultB = val;
				}
				if (flag)
				{
					if (Vector3.Dot(aLineVector, bLineVector) > 0f)
					{
						t = Vector3.Dot(val - a, ((Vector3)(ref aLineVector)).normalized) * 0.5f;
						Vector3 val7 = a + ((Vector3)(ref aLineVector)).normalized * t;
						Vector3 val8 = val + ((Vector3)(ref bLineVector)).normalized * (0f - t);
						if (t > 0f && t < ((Vector3)(ref aLineVector)).magnitude)
						{
							resultA = val7;
							resultB = val8;
						}
					}
					else
					{
						t = Vector3.Dot(val2 - val, ((Vector3)(ref aLineVector)).normalized) * 0.5f;
						Vector3 val9 = val2 + ((Vector3)(ref aLineVector)).normalized * (0f - t);
						Vector3 val10 = val + ((Vector3)(ref bLineVector)).normalized * (0f - t);
						if (t > 0f && t < ((Vector3)(ref aLineVector)).magnitude)
						{
							resultA = val9;
							resultB = val10;
						}
					}
				}
			}
			return flag;
		}

		public static Vector3 ClosestPointOnLineSegment(Vector3 point, Vector3 a, Vector3 b)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = b - a;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			float num = Vector3.Dot(point - a, normalized);
			if (num < 0f)
			{
				return a;
			}
			if (num * num > ((Vector3)(ref val)).sqrMagnitude)
			{
				return b;
			}
			return a + num * normalized;
		}

		public static void ClosestPolygonApproach(List<Vector3> verticesA, List<Vector3> verticesB, out Vector3 pointA, out Vector3 pointB, float parallelTest = 0f)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			pointA = default(Vector3);
			pointB = default(Vector3);
			float num = float.MaxValue;
			int count = verticesA.Count;
			int count2 = verticesB.Count;
			int num2 = count - 1;
			int num3 = count2 - 1;
			Vector3 val = verticesA[0];
			Vector3 val2 = verticesB[0];
			for (int i = 0; i < count; i++)
			{
				Vector3 val3 = verticesA[i];
				Vector3 aLineVector = ((i == num2) ? val : verticesA[i + 1]) - val3;
				for (int j = 0; j < count2; j++)
				{
					Vector3 val4 = verticesB[j];
					Vector3 bLineVector = ((j == num3) ? val2 : verticesB[j + 1]) - val4;
					Vector3 resultA;
					Vector3 resultB;
					bool num4 = ClosestPointsOnTwoLineSegments(val3, aLineVector, val4, bLineVector, out resultA, out resultB, parallelTest);
					float num5 = Vector3.Distance(resultA, resultB);
					if (num4)
					{
						if (num5 - num < parallelTest)
						{
							num = num5 - parallelTest;
							pointA = resultA;
							pointB = resultB;
						}
					}
					else if (num5 < num)
					{
						num = num5;
						pointA = resultA;
						pointB = resultB;
					}
				}
			}
		}

		public static bool PointInPolygon(Vector3 testPoint, List<Vector3> vertices)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			if (vertices.Count < 3)
			{
				return false;
			}
			int num = 0;
			int i = 0;
			Vector3 val = vertices[vertices.Count - 1];
			val.x -= testPoint.x;
			val.z -= testPoint.z;
			bool flag = false;
			if (!MathUtility.ApproximatelyZero(val.z))
			{
				flag = val.z < 0f;
			}
			else
			{
				for (int num2 = vertices.Count - 2; num2 >= 0; num2--)
				{
					float z = vertices[num2].z;
					z -= testPoint.z;
					if (!MathUtility.ApproximatelyZero(z))
					{
						flag = z < 0f;
						break;
					}
				}
			}
			for (; i < vertices.Count; i++)
			{
				Vector3 val2 = vertices[i];
				val2.x -= testPoint.x;
				val2.z -= testPoint.z;
				Vector3 val3 = val2 - val;
				float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude;
				if (MathUtility.ApproximatelyZero(val3.x * val2.z - val3.z * val2.x) && ((Vector3)(ref val)).sqrMagnitude <= sqrMagnitude && ((Vector3)(ref val2)).sqrMagnitude <= sqrMagnitude)
				{
					return true;
				}
				if (!MathUtility.ApproximatelyZero(val2.z))
				{
					bool flag2 = val2.z < 0f;
					if (flag2 != flag)
					{
						flag = flag2;
						if ((val.x * val2.z - val.z * val2.x) / (0f - (val.z - val2.z)) > 0f)
						{
							num++;
						}
					}
				}
				val = val2;
			}
			return num % 2 > 0;
		}

		public static bool PointInPolygon3D(Vector3 testPoint, List<Vector3> vertices)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			if (vertices.Count < 3)
			{
				return false;
			}
			double num = 0.0;
			for (int i = 0; i < vertices.Count; i++)
			{
				Vector3 val = vertices[i] - testPoint;
				Vector3 val2 = vertices[(i + 1) % vertices.Count] - testPoint;
				float num2 = ((Vector3)(ref val)).sqrMagnitude * ((Vector3)(ref val2)).sqrMagnitude;
				if (num2 <= MathUtility.EpsilonScaled)
				{
					return true;
				}
				double num3 = Math.Acos(Vector3.Dot(val, val2) / Mathf.Sqrt(num2));
				num += num3;
			}
			return Mathf.Abs((float)num - (float)Math.PI * 2f) < 0.01f;
		}

		public static Vector3 ProjectPointOnPlane(Vector3 planeNormal, Vector3 planePoint, Vector3 point)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			float num = 0f - Vector3.Dot(((Vector3)(ref planeNormal)).normalized, point - planePoint);
			return point + ((Vector3)(ref planeNormal)).normalized * num;
		}

		public static bool ConvexHull2D(List<Vector3> points, List<Vector3> hull)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			if (points.Count < 3)
			{
				return false;
			}
			k_HullIndices.Clear();
			int count = points.Count;
			int num = 0;
			for (int i = 1; i < count; i++)
			{
				Vector3 val = points[i];
				float x = val.x;
				float z = val.z;
				Vector3 val2 = points[num];
				float x2 = val2.x;
				float z2 = val2.z;
				if (x < x2 || (MathUtility.Approximately(x, x2) && z < z2))
				{
					num = i;
				}
			}
			int num2 = num;
			do
			{
				Vector3 val3 = points[num2];
				hull.Add(val3);
				k_HullIndices.Add(num2);
				int num3 = 0;
				Vector3 val4 = points[num3];
				for (int j = 1; j < count; j++)
				{
					if (j == num2 || (k_HullIndices.Contains(j) && j != num))
					{
						continue;
					}
					Vector3 val5 = points[j];
					Vector3 val6 = val4 - val3;
					Vector3 val7 = val5 - val3;
					float num4 = val6.z * val7.x - val6.x * val7.z;
					bool flag = num4 < 0f;
					if ((flag ? (0f - num4) : num4) < MathUtility.EpsilonScaled)
					{
						if (Vector3.SqrMagnitude(val3 - val4) < Vector3.SqrMagnitude(val3 - val5))
						{
							num3 = j;
							val4 = points[num3];
						}
					}
					else if (flag)
					{
						num3 = j;
						val4 = points[num3];
					}
				}
				num2 = num3;
			}
			while (num2 != num);
			return true;
		}

		public static Vector3 PolygonCentroid2D(List<Vector3> vertices)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			/

BepInEx\plugins\Cyberhead\Unity.XR.Interaction.Toolkit.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Text;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Profiling;
using Unity.XR.CoreUtils;
using Unity.XR.CoreUtils.Bindings;
using Unity.XR.CoreUtils.Bindings.Variables;
using Unity.XR.CoreUtils.Collections;
using Unity.XR.CoreUtils.Datums;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Experimental.XR.Interaction;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.Layouts;
using UnityEngine.InputSystem.LowLevel;
using UnityEngine.InputSystem.UI;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.InputSystem.XR;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.Scripting;
using UnityEngine.Scripting.APIUpdating;
using UnityEngine.Serialization;
using UnityEngine.SpatialTracking;
using UnityEngine.UI;
using UnityEngine.XR.Interaction.Toolkit;
using UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Jobs;
using UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Receiver;
using UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Receiver.Primitives;
using UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Rendering;
using UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.State;
using UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Theme;
using UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Theme.Audio;
using UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.Theme.Primitives;
using UnityEngine.XR.Interaction.Toolkit.Filtering;
using UnityEngine.XR.Interaction.Toolkit.Inputs;
using UnityEngine.XR.Interaction.Toolkit.Inputs.Simulation.Hands;
using UnityEngine.XR.Interaction.Toolkit.Transformers;
using UnityEngine.XR.Interaction.Toolkit.UI;
using UnityEngine.XR.Interaction.Toolkit.Utilities;
using UnityEngine.XR.Interaction.Toolkit.Utilities.Collections;
using UnityEngine.XR.Interaction.Toolkit.Utilities.Curves;
using UnityEngine.XR.Interaction.Toolkit.Utilities.Internal;
using UnityEngine.XR.Interaction.Toolkit.Utilities.Pooling;
using UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.Primitives;
using UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.SmartTweenableVariables;
using UnityEngine.XR.OpenXR.Features.Interactions;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Unity.XR.Interaction.Toolkit.Editor")]
[assembly: InternalsVisibleTo("Unity.XR.Interaction.Toolkit.Samples.StarterAssets.Editor")]
[assembly: InternalsVisibleTo("Unity.XR.Interaction.Toolkit.Tests")]
[assembly: InternalsVisibleTo("Unity.XR.Interaction.Toolkit.Editor.Tests")]
[assembly: InternalsVisibleTo("Unity.XR.Interaction.Toolkit.Samples.StarterAssets")]
[assembly: InternalsVisibleTo("Unity.XR.Interaction.Toolkit.Samples.ARStarterAssets")]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.EaseAttachBurst_0000028F$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.StepSmoothingBurst_00000290$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.EvaluateLineEndPoint_0000037D$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.GetAssistedVelocityInternal_00000690$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.OrthogonalUpVector_00000925$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.OrthogonalUpVector_00000926$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.OrthogonalLookRotation_00000927$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.OrthogonalLookRotation_00000928$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.ProjectOnPlane_00000929$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.ProjectOnPlane_0000092A$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.LookRotationWithForwardProjectedOnPlane_0000092B$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.LookRotationWithForwardProjectedOnPlane_0000092C$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Angle_0000092D$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.FastVectorEquals_0000092E$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.FastVectorEquals_0000092F$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.FastSafeDivide_00000930$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.FastSafeDivide_00000931$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Scale_00000932$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Scale_00000933$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.GetSphereOverlapParameters_00000934$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.GetConecastParameters_00000935$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.GetConecastOffset_00000936$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.SmartTweenableVariables.ComputeNewTweenTarget_000009C3$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.SmartTweenableVariables.ComputeNewTweenTarget_000009CF$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Tweenables.SmartTweenableVariables.IsNewTargetWithinThreshold_000009D0$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Curves.SampleQuadraticBezierPoint_000009F0$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Curves.SampleCubicBezierPoint_000009F1$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Curves.ElevateQuadraticToCubicBezier_000009F2$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Curves.SampleProjectilePoint_000009F4$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Utilities.Curves.CalculateProjectileFlightTime_000009F5$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Transformers.ComputeNewObjectPosition_00000BEF$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Transformers.AdjustPositionForPermittedAxesBurst_00000BF3$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Transformers.ComputeNewOneHandedScale_00000BF5$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Transformers.ComputeNewTwoHandedScale_00000BF6$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Transformers.FastCalculateRadiusOffset_00000C18$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Transformers.FastComputeNewTrackedPose_00000C19$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Transformers.IsWithinRadius_00000C1A$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Transformers.CalculateScaleToFit_00000C1B$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Inputs.StabilizeTransform_00000D36$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Inputs.StabilizePosition_00000D37$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Inputs.StabilizeOptimalRotation_00000D38$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Inputs.CalculateStabilizedLerp_00000D39$BurstDirectCall))]
[assembly: StaticTypeReinit(typeof(UnityEngine.XR.Interaction.Toolkit.Inputs.CalculateRotationParams_00000D3A$BurstDirectCall))]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.XR.Interaction.Toolkit
{
	[AttributeUsage(AttributeTargets.Class)]
	public sealed class CanFocusMultipleAttribute : Attribute
	{
		public bool allowMultiple { get; }

		public CanFocusMultipleAttribute(bool allowMultiple = true)
		{
			this.allowMultiple = allowMultiple;
		}
	}
	[AttributeUsage(AttributeTargets.Class)]
	public sealed class CanSelectMultipleAttribute : Attribute
	{
		public bool allowMultiple { get; }

		public CanSelectMultipleAttribute(bool allowMultiple = true)
		{
			this.allowMultiple = allowMultiple;
		}
	}
	[AddComponentMenu("XR/XR Controller (Action-based)", 11)]
	[HelpURL("https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.XR.Interaction.Toolkit.ActionBasedController.html")]
	public class ActionBasedController : XRBaseController
	{
		[SerializeField]
		private InputActionProperty m_PositionAction = new InputActionProperty(new InputAction("Position", (InputActionType)0, (string)null, (string)null, (string)null, "Vector3"));

		[SerializeField]
		private InputActionProperty m_RotationAction = new InputActionProperty(new InputAction("Rotation", (InputActionType)0, (string)null, (string)null, (string)null, "Quaternion"));

		[SerializeField]
		private InputActionProperty m_IsTrackedAction = new InputActionProperty(new InputAction("Is Tracked", (InputActionType)1, (string)null, (string)null, (string)null, (string)null)
		{
			wantsInitialStateCheck = true
		});

		[SerializeField]
		private InputActionProperty m_TrackingStateAction = new InputActionProperty(new InputAction("Tracking State", (InputActionType)0, (string)null, (string)null, (string)null, "Integer"));

		[SerializeField]
		private InputActionProperty m_SelectAction = new InputActionProperty(new InputAction("Select", (InputActionType)1, (string)null, (string)null, (string)null, (string)null));

		[SerializeField]
		private InputActionProperty m_SelectActionValue = new InputActionProperty(new InputAction("Select Value", (InputActionType)0, (string)null, (string)null, (string)null, "Axis"));

		[SerializeField]
		private InputActionProperty m_ActivateAction = new InputActionProperty(new InputAction("Activate", (InputActionType)1, (string)null, (string)null, (string)null, (string)null));

		[SerializeField]
		private InputActionProperty m_ActivateActionValue = new InputActionProperty(new InputAction("Activate Value", (InputActionType)0, (string)null, (string)null, (string)null, "Axis"));

		[SerializeField]
		private InputActionProperty m_UIPressAction = new InputActionProperty(new InputAction("UI Press", (InputActionType)1, (string)null, (string)null, (string)null, (string)null));

		[SerializeField]
		private InputActionProperty m_UIPressActionValue = new InputActionProperty(new InputAction("UI Press Value", (InputActionType)0, (string)null, (string)null, (string)null, "Axis"));

		[SerializeField]
		private InputActionProperty m_UIScrollAction = new InputActionProperty(new InputAction("UI Scroll", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		[SerializeField]
		private InputActionProperty m_HapticDeviceAction = new InputActionProperty(new InputAction("Haptic Device", (InputActionType)2, (string)null, (string)null, (string)null, (string)null));

		[SerializeField]
		private InputActionProperty m_RotateAnchorAction = new InputActionProperty(new InputAction("Rotate Anchor", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		[SerializeField]
		private InputActionProperty m_DirectionalAnchorRotationAction = new InputActionProperty(new InputAction("Directional Anchor Rotation", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		[SerializeField]
		private InputActionProperty m_TranslateAnchorAction = new InputActionProperty(new InputAction("Translate Anchor", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		[SerializeField]
		private InputActionProperty m_ScaleToggleAction = new InputActionProperty(new InputAction("Scale Toggle", (InputActionType)1, (string)null, (string)null, (string)null, (string)null));

		[SerializeField]
		private InputActionProperty m_ScaleDeltaAction = new InputActionProperty(new InputAction("Scale Delta", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		private bool m_HasCheckedDisabledTrackingInputReferenceActions;

		private bool m_HasCheckedDisabledInputReferenceActions;

		[SerializeField]
		private float m_ButtonPressPoint = 0.5f;

		public InputActionProperty positionAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_PositionAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_PositionAction, value);
			}
		}

		public InputActionProperty rotationAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_RotationAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_RotationAction, value);
			}
		}

		public InputActionProperty isTrackedAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_IsTrackedAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_IsTrackedAction, value);
			}
		}

		public InputActionProperty trackingStateAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_TrackingStateAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_TrackingStateAction, value);
			}
		}

		public InputActionProperty selectAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_SelectAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_SelectAction, value);
			}
		}

		public InputActionProperty selectActionValue
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_SelectActionValue;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_SelectActionValue, value);
			}
		}

		public InputActionProperty activateAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_ActivateAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_ActivateAction, value);
			}
		}

		public InputActionProperty activateActionValue
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_ActivateActionValue;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_ActivateActionValue, value);
			}
		}

		public InputActionProperty uiPressAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_UIPressAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_UIPressAction, value);
			}
		}

		public InputActionProperty uiPressActionValue
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_UIPressActionValue;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_UIPressActionValue, value);
			}
		}

		public InputActionProperty uiScrollAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_UIScrollAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_UIScrollAction, value);
			}
		}

		public InputActionProperty hapticDeviceAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_HapticDeviceAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_HapticDeviceAction, value);
			}
		}

		public InputActionProperty rotateAnchorAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_RotateAnchorAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_RotateAnchorAction, value);
			}
		}

		public InputActionProperty directionalAnchorRotationAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_DirectionalAnchorRotationAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_DirectionalAnchorRotationAction, value);
			}
		}

		public InputActionProperty translateAnchorAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_TranslateAnchorAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_TranslateAnchorAction, value);
			}
		}

		public InputActionProperty scaleToggleAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_ScaleToggleAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_ScaleToggleAction, value);
			}
		}

		public InputActionProperty scaleDeltaAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_ScaleDeltaAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_ScaleDeltaAction, value);
			}
		}

		[Obsolete("Deprecated, this obsolete property is not used when Input System version is 1.1.0 or higher. Configure press point on the action or binding instead.", true)]
		public float buttonPressPoint
		{
			get
			{
				return m_ButtonPressPoint;
			}
			set
			{
				m_ButtonPressPoint = value;
			}
		}

		protected override void OnEnable()
		{
			base.OnEnable();
			EnableAllDirectActions();
		}

		protected override void OnDisable()
		{
			base.OnDisable();
			DisableAllDirectActions();
		}

		protected override void UpdateTrackingInput(XRControllerState controllerState)
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			base.UpdateTrackingInput(controllerState);
			if (controllerState == null)
			{
				return;
			}
			InputAction action = ((InputActionProperty)(ref m_PositionAction)).action;
			InputAction action2 = ((InputActionProperty)(ref m_RotationAction)).action;
			InputAction action3 = ((InputActionProperty)(ref m_IsTrackedAction)).action;
			InputAction action4 = ((InputActionProperty)(ref m_TrackingStateAction)).action;
			if (!m_HasCheckedDisabledTrackingInputReferenceActions && (action != null || action2 != null))
			{
				if (IsDisabledReferenceAction(m_PositionAction) || IsDisabledReferenceAction(m_RotationAction))
				{
					Debug.LogWarning((object)"'Enable Input Tracking' is enabled, but Position and/or Rotation Action is disabled. The pose of the controller will not be updated correctly until the Input Actions are enabled. Input Actions in an Input Action Asset must be explicitly enabled to read the current value of the action. The Input Action Manager behavior can be added to a GameObject in a Scene and used to enable all Input Actions in a referenced Input Action Asset.", (Object)(object)this);
				}
				m_HasCheckedDisabledTrackingInputReferenceActions = true;
			}
			controllerState.isTracked = false;
			controllerState.inputTrackingState = (InputTrackingState)0;
			if (action3 != null && action3.bindings.Count > 0)
			{
				controllerState.isTracked = IsPressed(action3);
			}
			else
			{
				object obj;
				if (action4 == null)
				{
					obj = null;
				}
				else
				{
					InputControl activeControl = action4.activeControl;
					obj = ((activeControl != null) ? activeControl.device : null);
				}
				TrackedDevice val = (TrackedDevice)((obj is TrackedDevice) ? obj : null);
				if (val != null)
				{
					controllerState.isTracked = val.isTracked.isPressed;
				}
				else
				{
					object obj2;
					if (action == null)
					{
						obj2 = null;
					}
					else
					{
						InputControl activeControl2 = action.activeControl;
						obj2 = ((activeControl2 != null) ? activeControl2.device : null);
					}
					object obj3 = ((obj2 is TrackedDevice) ? obj2 : null);
					object obj4;
					if (action2 == null)
					{
						obj4 = null;
					}
					else
					{
						InputControl activeControl3 = action2.activeControl;
						obj4 = ((activeControl3 != null) ? activeControl3.device : null);
					}
					TrackedDevice val2 = (TrackedDevice)((obj4 is TrackedDevice) ? obj4 : null);
					bool flag = obj3 != null && ((TrackedDevice)obj3).isTracked.isPressed;
					if (obj3 != val2)
					{
						bool flag2 = val2 != null && val2.isTracked.isPressed;
						controllerState.isTracked = flag && flag2;
					}
					else
					{
						controllerState.isTracked = flag;
					}
				}
			}
			if (action4 != null && action4.bindings.Count > 0)
			{
				controllerState.inputTrackingState = (InputTrackingState)action4.ReadValue<int>();
			}
			else
			{
				object obj5;
				if (action3 == null)
				{
					obj5 = null;
				}
				else
				{
					InputControl activeControl4 = action3.activeControl;
					obj5 = ((activeControl4 != null) ? activeControl4.device : null);
				}
				TrackedDevice val3 = (TrackedDevice)((obj5 is TrackedDevice) ? obj5 : null);
				if (val3 != null)
				{
					controllerState.inputTrackingState = (InputTrackingState)((InputControl<int>)(object)val3.trackingState).ReadValue();
				}
				else
				{
					object obj6;
					if (action == null)
					{
						obj6 = null;
					}
					else
					{
						InputControl activeControl5 = action.activeControl;
						obj6 = ((activeControl5 != null) ? activeControl5.device : null);
					}
					TrackedDevice val4 = (TrackedDevice)((obj6 is TrackedDevice) ? obj6 : null);
					object obj7;
					if (action2 == null)
					{
						obj7 = null;
					}
					else
					{
						InputControl activeControl6 = action2.activeControl;
						obj7 = ((activeControl6 != null) ? activeControl6.device : null);
					}
					TrackedDevice val5 = (TrackedDevice)((obj7 is TrackedDevice) ? obj7 : null);
					InputTrackingState val6 = (InputTrackingState)((val4 != null) ? ((InputControl<int>)(object)val4.trackingState).ReadValue() : 0);
					if (val4 != val5)
					{
						InputTrackingState val7 = (InputTrackingState)((val5 != null) ? ((InputControl<int>)(object)val5.trackingState).ReadValue() : 0);
						controllerState.inputTrackingState = (InputTrackingState)((val6 & 1) | (val7 & 2));
					}
					else
					{
						controllerState.inputTrackingState = val6;
					}
				}
			}
			if (action != null && (controllerState.inputTrackingState & 1) != 0)
			{
				controllerState.position = action.ReadValue<Vector3>();
			}
			if (action2 != null && (controllerState.inputTrackingState & 2) != 0)
			{
				controllerState.rotation = action2.ReadValue<Quaternion>();
			}
		}

		protected override void UpdateInput(XRControllerState controllerState)
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			base.UpdateInput(controllerState);
			if (controllerState == null)
			{
				return;
			}
			if (!m_HasCheckedDisabledInputReferenceActions && (((InputActionProperty)(ref m_SelectAction)).action != null || ((InputActionProperty)(ref m_ActivateAction)).action != null || ((InputActionProperty)(ref m_UIPressAction)).action != null))
			{
				if (IsDisabledReferenceAction(m_SelectAction) || IsDisabledReferenceAction(m_ActivateAction) || IsDisabledReferenceAction(m_UIPressAction))
				{
					Debug.LogWarning((object)"'Enable Input Actions' is enabled, but Select, Activate, and/or UI Press Action is disabled. The controller input will not be handled correctly until the Input Actions are enabled. Input Actions in an Input Action Asset must be explicitly enabled to read the current value of the action. The Input Action Manager behavior can be added to a GameObject in a Scene and used to enable all Input Actions in a referenced Input Action Asset.", (Object)(object)this);
				}
				m_HasCheckedDisabledInputReferenceActions = true;
			}
			controllerState.ResetFrameDependentStates();
			InputAction action = ((InputActionProperty)(ref m_SelectActionValue)).action;
			if (action == null || action.bindings.Count <= 0)
			{
				action = ((InputActionProperty)(ref m_SelectAction)).action;
			}
			controllerState.selectInteractionState.SetFrameState(IsPressed(((InputActionProperty)(ref m_SelectAction)).action), ReadValue(action));
			InputAction action2 = ((InputActionProperty)(ref m_ActivateActionValue)).action;
			if (action2 == null || action2.bindings.Count <= 0)
			{
				action2 = ((InputActionProperty)(ref m_ActivateAction)).action;
			}
			controllerState.activateInteractionState.SetFrameState(IsPressed(((InputActionProperty)(ref m_ActivateAction)).action), ReadValue(action2));
			InputAction action3 = ((InputActionProperty)(ref m_UIPressActionValue)).action;
			if (action3 == null || action3.bindings.Count <= 0)
			{
				action3 = ((InputActionProperty)(ref m_UIPressAction)).action;
			}
			controllerState.uiPressInteractionState.SetFrameState(IsPressed(((InputActionProperty)(ref m_UIPressAction)).action), ReadValue(action3));
			InputAction action4 = ((InputActionProperty)(ref m_UIScrollAction)).action;
			if (action4 != null)
			{
				controllerState.uiScrollValue = action4.ReadValue<Vector2>();
			}
		}

		protected virtual bool IsPressed(InputAction action)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			if (action == null)
			{
				return false;
			}
			return (int)action.phase == 3;
		}

		protected virtual float ReadValue(InputAction action)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (action == null)
			{
				return 0f;
			}
			if (action.activeControl is AxisControl)
			{
				return action.ReadValue<float>();
			}
			if (action.activeControl is Vector2Control)
			{
				Vector2 val = action.ReadValue<Vector2>();
				return ((Vector2)(ref val)).magnitude;
			}
			if (!IsPressed(action))
			{
				return 0f;
			}
			return 1f;
		}

		public override bool SendHapticImpulse(float amplitude, float duration)
		{
			InputAction action = ((InputActionProperty)(ref m_HapticDeviceAction)).action;
			object obj;
			if (action == null)
			{
				obj = null;
			}
			else
			{
				InputControl activeControl = action.activeControl;
				obj = ((activeControl != null) ? activeControl.device : null);
			}
			XRControllerWithRumble val = (XRControllerWithRumble)((obj is XRControllerWithRumble) ? obj : null);
			if (val != null)
			{
				val.SendImpulse(amplitude, duration);
				return true;
			}
			return false;
		}

		private void EnableAllDirectActions()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			m_PositionAction.EnableDirectAction();
			m_RotationAction.EnableDirectAction();
			m_IsTrackedAction.EnableDirectAction();
			m_TrackingStateAction.EnableDirectAction();
			m_SelectAction.EnableDirectAction();
			m_SelectActionValue.EnableDirectAction();
			m_ActivateAction.EnableDirectAction();
			m_ActivateActionValue.EnableDirectAction();
			m_UIPressAction.EnableDirectAction();
			m_UIPressActionValue.EnableDirectAction();
			m_UIScrollAction.EnableDirectAction();
			m_HapticDeviceAction.EnableDirectAction();
			m_RotateAnchorAction.EnableDirectAction();
			m_DirectionalAnchorRotationAction.EnableDirectAction();
			m_TranslateAnchorAction.EnableDirectAction();
			m_ScaleToggleAction.EnableDirectAction();
			m_ScaleDeltaAction.EnableDirectAction();
		}

		private void DisableAllDirectActions()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			m_PositionAction.DisableDirectAction();
			m_RotationAction.DisableDirectAction();
			m_IsTrackedAction.DisableDirectAction();
			m_TrackingStateAction.DisableDirectAction();
			m_SelectAction.DisableDirectAction();
			m_SelectActionValue.DisableDirectAction();
			m_ActivateAction.DisableDirectAction();
			m_ActivateActionValue.DisableDirectAction();
			m_UIPressAction.DisableDirectAction();
			m_UIPressActionValue.DisableDirectAction();
			m_UIScrollAction.DisableDirectAction();
			m_HapticDeviceAction.DisableDirectAction();
			m_RotateAnchorAction.DisableDirectAction();
			m_DirectionalAnchorRotationAction.DisableDirectAction();
			m_TranslateAnchorAction.DisableDirectAction();
			m_ScaleToggleAction.DisableDirectAction();
			m_ScaleDeltaAction.DisableDirectAction();
		}

		private void SetInputActionProperty(ref InputActionProperty property, InputActionProperty value)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (Application.isPlaying)
			{
				property.DisableDirectAction();
			}
			property = value;
			if (Application.isPlaying && ((Behaviour)this).isActiveAndEnabled)
			{
				property.EnableDirectAction();
			}
		}

		private static bool IsDisabledReferenceAction(InputActionProperty property)
		{
			if ((Object)(object)((InputActionProperty)(ref property)).reference != (Object)null && ((InputActionProperty)(ref property)).reference.action != null)
			{
				return !((InputActionProperty)(ref property)).reference.action.enabled;
			}
			return false;
		}
	}
	public enum ScaleMode
	{
		None,
		Input,
		Distance
	}
	public interface IXRScaleValueProvider
	{
		ScaleMode scaleMode { get; set; }

		float scaleValue { get; }
	}
	[DefaultExecutionOrder(-29990)]
	[DisallowMultipleComponent]
	public abstract class XRBaseController : MonoBehaviour
	{
		public enum UpdateType
		{
			UpdateAndBeforeRender,
			Update,
			BeforeRender,
			Fixed
		}

		[SerializeField]
		private UpdateType m_UpdateTrackingType;

		[SerializeField]
		private bool m_EnableInputTracking = true;

		[SerializeField]
		private bool m_EnableInputActions = true;

		[SerializeField]
		private Transform m_ModelPrefab;

		[SerializeField]
		[FormerlySerializedAs("m_ModelTransform")]
		private Transform m_ModelParent;

		[SerializeField]
		private Transform m_Model;

		[SerializeField]
		private bool m_AnimateModel;

		[SerializeField]
		private string m_ModelSelectTransition;

		[SerializeField]
		private string m_ModelDeSelectTransition;

		private bool m_HideControllerModel;

		private InteractionState m_SelectInteractionState;

		private InteractionState m_ActivateInteractionState;

		private InteractionState m_UIPressInteractionState;

		private Vector2 m_UIScrollValue;

		private XRControllerState m_ControllerState;

		private bool m_CreateControllerState = true;

		private Animator m_ModelAnimator;

		private bool m_HasWarnedAnimatorMissing;

		private bool m_PerformSetup = true;

		public UpdateType updateTrackingType
		{
			get
			{
				return m_UpdateTrackingType;
			}
			set
			{
				m_UpdateTrackingType = value;
			}
		}

		public bool enableInputTracking
		{
			get
			{
				return m_EnableInputTracking;
			}
			set
			{
				m_EnableInputTracking = value;
			}
		}

		public bool enableInputActions
		{
			get
			{
				return m_EnableInputActions;
			}
			set
			{
				m_EnableInputActions = value;
			}
		}

		public Transform modelPrefab
		{
			get
			{
				return m_ModelPrefab;
			}
			set
			{
				m_ModelPrefab = value;
			}
		}

		public Transform modelParent
		{
			get
			{
				return m_ModelParent;
			}
			set
			{
				m_ModelParent = value;
				if ((Object)(object)m_Model != (Object)null)
				{
					m_Model.parent = m_ModelParent;
				}
			}
		}

		public Transform model
		{
			get
			{
				return m_Model;
			}
			set
			{
				m_Model = value;
			}
		}

		public bool animateModel
		{
			get
			{
				return m_AnimateModel;
			}
			set
			{
				m_AnimateModel = value;
			}
		}

		public string modelSelectTransition
		{
			get
			{
				return m_ModelSelectTransition;
			}
			set
			{
				m_ModelSelectTransition = value;
			}
		}

		public string modelDeSelectTransition
		{
			get
			{
				return m_ModelDeSelectTransition;
			}
			set
			{
				m_ModelDeSelectTransition = value;
			}
		}

		public bool hideControllerModel
		{
			get
			{
				return m_HideControllerModel;
			}
			set
			{
				m_HideControllerModel = value;
				if ((Object)(object)m_Model != (Object)null)
				{
					((Component)m_Model).gameObject.SetActive(!m_HideControllerModel);
				}
			}
		}

		public InteractionState selectInteractionState => m_SelectInteractionState;

		public InteractionState activateInteractionState => m_ActivateInteractionState;

		public InteractionState uiPressInteractionState => m_UIPressInteractionState;

		public Vector2 uiScrollValue => m_UIScrollValue;

		public XRControllerState currentControllerState
		{
			get
			{
				SetupControllerState();
				return m_ControllerState;
			}
			set
			{
				m_ControllerState = value;
				m_CreateControllerState = false;
			}
		}

		[Obsolete("modelTransform has been deprecated due to being renamed. Use modelParent instead. (UnityUpgradable) -> modelParent")]
		public Transform modelTransform
		{
			get
			{
				return modelParent;
			}
			set
			{
				modelParent = value;
			}
		}

		[Obsolete("anchorControlDeadzone is obsolete. Please configure deadzone on the Rotate Anchor and Translate Anchor Actions.", true)]
		public float anchorControlDeadzone { get; set; }

		[Obsolete("anchorControlOffAxisDeadzone is obsolete. Please configure deadzone on the Rotate Anchor and Translate Anchor Actions.", true)]
		public float anchorControlOffAxisDeadzone { get; set; }

		protected virtual void Awake()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)m_ModelParent == (Object)null)
			{
				m_ModelParent = new GameObject("[" + ((Object)((Component)this).gameObject).name + "] Model Parent").transform;
				m_ModelParent.SetParent(((Component)this).transform, false);
				m_ModelParent.localPosition = Vector3.zero;
				m_ModelParent.localRotation = Quaternion.identity;
			}
		}

		protected virtual void OnEnable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			Application.onBeforeRender += new UnityAction(OnBeforeRender);
		}

		protected virtual void OnDisable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			Application.onBeforeRender -= new UnityAction(OnBeforeRender);
		}

		protected void Update()
		{
			UpdateController();
		}

		private void SetupModel()
		{
			if ((Object)(object)m_Model == (Object)null)
			{
				GameObject val = GetModelPrefab();
				if ((Object)(object)val != (Object)null)
				{
					m_Model = Object.Instantiate<GameObject>(val, m_ModelParent).transform;
				}
			}
			if ((Object)(object)m_Model != (Object)null)
			{
				((Component)m_Model).gameObject.SetActive(!m_HideControllerModel);
			}
		}

		private void SetupControllerState()
		{
			if (m_ControllerState == null && m_CreateControllerState)
			{
				m_ControllerState = new XRControllerState();
			}
		}

		protected virtual GameObject GetModelPrefab()
		{
			if (!((Object)(object)m_ModelPrefab != (Object)null))
			{
				return null;
			}
			return ((Component)m_ModelPrefab).gameObject;
		}

		protected virtual void UpdateController()
		{
			if (m_PerformSetup)
			{
				SetupModel();
				SetupControllerState();
				m_PerformSetup = false;
			}
			if (m_EnableInputTracking && (m_UpdateTrackingType == UpdateType.Update || m_UpdateTrackingType == UpdateType.UpdateAndBeforeRender))
			{
				UpdateTrackingInput(m_ControllerState);
			}
			if (m_EnableInputActions)
			{
				UpdateInput(m_ControllerState);
				UpdateControllerModelAnimation();
			}
			ApplyControllerState(XRInteractionUpdateOrder.UpdatePhase.Dynamic, m_ControllerState);
		}

		protected virtual void OnBeforeRender()
		{
			if (m_EnableInputTracking && (m_UpdateTrackingType == UpdateType.BeforeRender || m_UpdateTrackingType == UpdateType.UpdateAndBeforeRender))
			{
				UpdateTrackingInput(m_ControllerState);
			}
			ApplyControllerState(XRInteractionUpdateOrder.UpdatePhase.OnBeforeRender, m_ControllerState);
		}

		protected virtual void FixedUpdate()
		{
			if (m_EnableInputTracking && m_UpdateTrackingType == UpdateType.Fixed)
			{
				UpdateTrackingInput(m_ControllerState);
			}
			ApplyControllerState(XRInteractionUpdateOrder.UpdatePhase.Fixed, m_ControllerState);
		}

		protected virtual void ApplyControllerState(XRInteractionUpdateOrder.UpdatePhase updatePhase, XRControllerState controllerState)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			if (controllerState == null)
			{
				return;
			}
			if (updatePhase == XRInteractionUpdateOrder.UpdatePhase.Dynamic)
			{
				m_SelectInteractionState = controllerState.selectInteractionState;
				m_ActivateInteractionState = controllerState.activateInteractionState;
				m_UIPressInteractionState = controllerState.uiPressInteractionState;
				m_UIScrollValue = controllerState.uiScrollValue;
			}
			if (updatePhase == XRInteractionUpdateOrder.UpdatePhase.Dynamic || updatePhase == XRInteractionUpdateOrder.UpdatePhase.OnBeforeRender || updatePhase == XRInteractionUpdateOrder.UpdatePhase.Fixed)
			{
				if ((controllerState.inputTrackingState & 1) != 0)
				{
					((Component)this).transform.localPosition = controllerState.position;
				}
				if ((controllerState.inputTrackingState & 2) != 0)
				{
					((Component)this).transform.localRotation = controllerState.rotation;
				}
			}
		}

		protected virtual void UpdateTrackingInput(XRControllerState controllerState)
		{
		}

		protected virtual void UpdateInput(XRControllerState controllerState)
		{
		}

		protected virtual void UpdateControllerModelAnimation()
		{
			if (!m_AnimateModel || !((Object)(object)m_Model != (Object)null))
			{
				return;
			}
			if (((Object)(object)m_ModelAnimator == (Object)null || (Object)(object)((Component)m_ModelAnimator).gameObject != (Object)(object)((Component)m_Model).gameObject) && !((Component)m_Model).TryGetComponent<Animator>(ref m_ModelAnimator))
			{
				if (!m_HasWarnedAnimatorMissing)
				{
					Debug.LogWarning((object)"Animate Model is enabled, but there is no Animator component on the model. Unable to activate named triggers to animate the model.", (Object)(object)this);
					m_HasWarnedAnimatorMissing = true;
				}
			}
			else if (m_SelectInteractionState.activatedThisFrame)
			{
				m_ModelAnimator.SetTrigger(m_ModelSelectTransition);
			}
			else if (m_SelectInteractionState.deactivatedThisFrame)
			{
				m_ModelAnimator.SetTrigger(m_ModelDeSelectTransition);
			}
		}

		public virtual bool SendHapticImpulse(float amplitude, float duration)
		{
			return false;
		}

		[Obsolete("GetControllerState has been deprecated. Use currentControllerState instead.")]
		public virtual bool GetControllerState(out XRControllerState controllerState)
		{
			controllerState = currentControllerState;
			return false;
		}

		[Obsolete("SetControllerState has been deprecated. Use currentControllerState instead.")]
		public virtual void SetControllerState(XRControllerState controllerState)
		{
			currentControllerState = controllerState;
		}
	}
	[AddComponentMenu("XR/XR Controller (Device-based)", 11)]
	[HelpURL("https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.XR.Interaction.Toolkit.XRController.html")]
	public class XRController : XRBaseController
	{
		[SerializeField]
		private XRNode m_ControllerNode = (XRNode)5;

		private XRNode m_InputDeviceControllerNode;

		[SerializeField]
		private InputHelpers.Button m_SelectUsage = InputHelpers.Button.Grip;

		[SerializeField]
		private InputHelpers.Button m_ActivateUsage = InputHelpers.Button.Trigger;

		[SerializeField]
		private InputHelpers.Button m_UIPressUsage = InputHelpers.Button.Trigger;

		[SerializeField]
		private float m_AxisToPressThreshold = 0.1f;

		[SerializeField]
		private InputHelpers.Button m_RotateAnchorLeft = InputHelpers.Button.PrimaryAxis2DLeft;

		[SerializeField]
		private InputHelpers.Button m_RotateAnchorRight = InputHelpers.Button.PrimaryAxis2DRight;

		[SerializeField]
		private InputHelpers.Button m_MoveObjectIn = InputHelpers.Button.PrimaryAxis2DUp;

		[SerializeField]
		private InputHelpers.Button m_MoveObjectOut = InputHelpers.Button.PrimaryAxis2DDown;

		[SerializeField]
		private InputHelpers.Axis2D m_DirectionalAnchorRotation = InputHelpers.Axis2D.PrimaryAxis2D;

		[SerializeField]
		private BasePoseProvider m_PoseProvider;

		private InputDevice m_InputDevice;

		public XRNode controllerNode
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_ControllerNode;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_ControllerNode = value;
			}
		}

		public InputHelpers.Button selectUsage
		{
			get
			{
				return m_SelectUsage;
			}
			set
			{
				m_SelectUsage = value;
			}
		}

		public InputHelpers.Button activateUsage
		{
			get
			{
				return m_ActivateUsage;
			}
			set
			{
				m_ActivateUsage = value;
			}
		}

		public InputHelpers.Button uiPressUsage
		{
			get
			{
				return m_UIPressUsage;
			}
			set
			{
				m_UIPressUsage = value;
			}
		}

		public float axisToPressThreshold
		{
			get
			{
				return m_AxisToPressThreshold;
			}
			set
			{
				m_AxisToPressThreshold = value;
			}
		}

		public InputHelpers.Button rotateObjectLeft
		{
			get
			{
				return m_RotateAnchorLeft;
			}
			set
			{
				m_RotateAnchorLeft = value;
			}
		}

		public InputHelpers.Button rotateObjectRight
		{
			get
			{
				return m_RotateAnchorRight;
			}
			set
			{
				m_RotateAnchorRight = value;
			}
		}

		public InputHelpers.Button moveObjectIn
		{
			get
			{
				return m_MoveObjectIn;
			}
			set
			{
				m_MoveObjectIn = value;
			}
		}

		public InputHelpers.Button moveObjectOut
		{
			get
			{
				return m_MoveObjectOut;
			}
			set
			{
				m_MoveObjectOut = value;
			}
		}

		public InputHelpers.Axis2D directionalAnchorRotation
		{
			get
			{
				return m_DirectionalAnchorRotation;
			}
			set
			{
				m_DirectionalAnchorRotation = value;
			}
		}

		public BasePoseProvider poseProvider
		{
			get
			{
				return m_PoseProvider;
			}
			set
			{
				m_PoseProvider = value;
			}
		}

		public InputDevice inputDevice
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				if (m_InputDeviceControllerNode != m_ControllerNode || !((InputDevice)(ref m_InputDevice)).isValid)
				{
					m_InputDevice = InputDevices.GetDeviceAtXRNode(m_ControllerNode);
					m_InputDeviceControllerNode = m_ControllerNode;
				}
				return m_InputDevice;
			}
		}

		protected override void UpdateTrackingInput(XRControllerState controllerState)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			base.UpdateTrackingInput(controllerState);
			if (controllerState == null)
			{
				return;
			}
			InputDevice val = inputDevice;
			bool flag = default(bool);
			controllerState.isTracked = ((InputDevice)(ref val)).TryGetFeatureValue(CommonUsages.isTracked, ref flag) && flag;
			controllerState.inputTrackingState = (InputTrackingState)0;
			if ((Object)(object)m_PoseProvider != (Object)null)
			{
				Pose val2 = default(Pose);
				PoseDataFlags poseFromProvider = m_PoseProvider.GetPoseFromProvider(ref val2);
				if ((poseFromProvider & 1) != 0)
				{
					controllerState.position = val2.position;
					controllerState.inputTrackingState = (InputTrackingState)(controllerState.inputTrackingState | 1);
				}
				if ((poseFromProvider & 2) != 0)
				{
					controllerState.rotation = val2.rotation;
					controllerState.inputTrackingState = (InputTrackingState)(controllerState.inputTrackingState | 2);
				}
				return;
			}
			val = inputDevice;
			InputTrackingState val3 = default(InputTrackingState);
			if (!((InputDevice)(ref val)).TryGetFeatureValue(CommonUsages.trackingState, ref val3))
			{
				return;
			}
			controllerState.inputTrackingState = val3;
			if ((val3 & 1) != 0)
			{
				val = inputDevice;
				Vector3 position = default(Vector3);
				if (((InputDevice)(ref val)).TryGetFeatureValue(CommonUsages.devicePosition, ref position))
				{
					controllerState.position = position;
				}
			}
			if ((val3 & 2) != 0)
			{
				val = inputDevice;
				Quaternion rotation = default(Quaternion);
				if (((InputDevice)(ref val)).TryGetFeatureValue(CommonUsages.deviceRotation, ref rotation))
				{
					controllerState.rotation = rotation;
				}
			}
		}

		protected override void UpdateInput(XRControllerState controllerState)
		{
			base.UpdateInput(controllerState);
			if (controllerState != null)
			{
				controllerState.ResetFrameDependentStates();
				controllerState.selectInteractionState.SetFrameState(IsPressed(m_SelectUsage), ReadValue(m_SelectUsage));
				controllerState.activateInteractionState.SetFrameState(IsPressed(m_ActivateUsage), ReadValue(m_ActivateUsage));
				controllerState.uiPressInteractionState.SetFrameState(IsPressed(m_UIPressUsage), ReadValue(m_UIPressUsage));
			}
		}

		protected virtual bool IsPressed(InputHelpers.Button button)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			inputDevice.IsPressed(button, out var isPressed, m_AxisToPressThreshold);
			return isPressed;
		}

		protected virtual float ReadValue(InputHelpers.Button button)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			inputDevice.TryReadSingleValue(button, out var singleValue);
			return singleValue;
		}

		public override bool SendHapticImpulse(float amplitude, float duration)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			InputDevice val = inputDevice;
			HapticCapabilities val2 = default(HapticCapabilities);
			if (((InputDevice)(ref val)).TryGetHapticCapabilities(ref val2) && ((HapticCapabilities)(ref val2)).supportsImpulse)
			{
				val = inputDevice;
				return ((InputDevice)(ref val)).SendHapticImpulse(0u, amplitude, duration);
			}
			return false;
		}
	}
	[AddComponentMenu("XR/Debug/XR Controller Recorder", 11)]
	[DisallowMultipleComponent]
	[DefaultExecutionOrder(-30000)]
	[HelpURL("https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.XR.Interaction.Toolkit.XRControllerRecorder.html")]
	public class XRControllerRecorder : MonoBehaviour
	{
		[Header("Input Recording/Playback")]
		[SerializeField]
		[Tooltip("Controls whether this recording will start playing when the component's Awake() method is called.")]
		private bool m_PlayOnStart;

		[SerializeField]
		[Tooltip("Controller Recording asset for recording and playback of controller events.")]
		private XRControllerRecording m_Recording;

		[SerializeField]
		[Tooltip("XR Controller who's output will be recorded and played back")]
		private XRBaseController m_XRController;

		[SerializeField]
		[Tooltip("If true, every frame of the recording must be visited even if a larger time period has passed.")]
		private bool m_VisitEachFrame;

		private double m_CurrentTime;

		private bool m_IsRecording;

		private bool m_IsPlaying;

		private double m_LastPlaybackTime;

		private int m_LastFrameIdx;

		private bool m_PrevEnableInputActions;

		private bool m_PrevEnableInputTracking;

		public bool playOnStart
		{
			get
			{
				return m_PlayOnStart;
			}
			set
			{
				m_PlayOnStart = value;
			}
		}

		public XRControllerRecording recording
		{
			get
			{
				return m_Recording;
			}
			set
			{
				m_Recording = value;
			}
		}

		public XRBaseController xrController
		{
			get
			{
				return m_XRController;
			}
			set
			{
				m_XRController = value;
			}
		}

		public bool visitEachFrame
		{
			get
			{
				return m_VisitEachFrame;
			}
			set
			{
				m_VisitEachFrame = value;
			}
		}

		public bool isRecording
		{
			get
			{
				return m_IsRecording;
			}
			set
			{
				if (m_IsRecording == value)
				{
					return;
				}
				recordingStartTime = Time.time;
				isPlaying = false;
				m_CurrentTime = 0.0;
				if (Object.op_Implicit((Object)(object)m_Recording))
				{
					if (value)
					{
						m_Recording.InitRecording();
					}
					else
					{
						m_Recording.SaveRecording();
					}
				}
				m_IsRecording = value;
			}
		}

		public bool isPlaying
		{
			get
			{
				return m_IsPlaying;
			}
			set
			{
				if (m_IsPlaying != value)
				{
					isRecording = false;
					if (Object.op_Implicit((Object)(object)m_Recording))
					{
						ResetPlayback();
					}
					m_CurrentTime = 0.0;
					m_IsPlaying = value;
					if (value && (Object)(object)m_XRController != (Object)null)
					{
						m_PrevEnableInputActions = m_XRController.enableInputActions;
						m_PrevEnableInputTracking = m_XRController.enableInputTracking;
						m_XRController.enableInputActions = false;
						m_XRController.enableInputTracking = false;
					}
					else if ((Object)(object)m_XRController != (Object)null)
					{
						m_XRController.enableInputActions = m_PrevEnableInputActions;
						m_XRController.enableInputTracking = m_PrevEnableInputTracking;
					}
				}
			}
		}

		public double currentTime => m_CurrentTime;

		public double duration
		{
			get
			{
				if (!((Object)(object)m_Recording != (Object)null))
				{
					return 0.0;
				}
				return m_Recording.duration;
			}
		}

		protected float recordingStartTime { get; set; }

		protected void Awake()
		{
			if ((Object)(object)m_XRController == (Object)null)
			{
				m_XRController = ((Component)this).GetComponent<XRBaseController>();
			}
			m_CurrentTime = 0.0;
			if (m_PlayOnStart)
			{
				isPlaying = true;
			}
		}

		protected virtual void Update()
		{
			if (isRecording && (Object)(object)m_XRController != (Object)null)
			{
				XRControllerState currentControllerState = m_XRController.currentControllerState;
				currentControllerState.time = Time.time - recordingStartTime;
				m_Recording.AddRecordingFrame(currentControllerState);
			}
			else if (isPlaying)
			{
				UpdatePlaybackTime(m_CurrentTime);
			}
			if (isRecording || isPlaying)
			{
				m_CurrentTime += Time.deltaTime;
			}
			if (isPlaying && m_CurrentTime > m_Recording.duration && (!m_VisitEachFrame || m_LastFrameIdx >= m_Recording.frames.Count - 1))
			{
				isPlaying = false;
			}
		}

		protected void OnDestroy()
		{
			isRecording = false;
			isPlaying = false;
		}

		public void ResetPlayback()
		{
			m_LastPlaybackTime = 0.0;
			m_LastFrameIdx = 0;
		}

		private void UpdatePlaybackTime(double playbackTime)
		{
			if (!Object.op_Implicit((Object)(object)m_Recording) || (Object)(object)m_Recording == (Object)null || m_Recording.frames.Count == 0 || m_LastFrameIdx >= m_Recording.frames.Count)
			{
				return;
			}
			XRControllerState xRControllerState = m_Recording.frames[m_LastFrameIdx];
			int num = m_LastFrameIdx;
			if (xRControllerState.time < playbackTime)
			{
				while (num < m_Recording.frames.Count && m_Recording.frames[num].time >= m_LastPlaybackTime && m_Recording.frames[num].time <= playbackTime)
				{
					num++;
					if (m_VisitEachFrame)
					{
						if (num < m_Recording.frames.Count)
						{
							playbackTime = m_Recording.frames[num].time;
						}
						break;
					}
				}
			}
			if (num < m_Recording.frames.Count)
			{
				if ((Object)(object)m_XRController != (Object)null)
				{
					XRControllerState currentControllerState = m_Recording.frames[num];
					m_XRController.currentControllerState = currentControllerState;
				}
				m_LastFrameIdx = num;
				m_LastPlaybackTime = playbackTime;
			}
		}

		public virtual bool GetControllerState(out XRControllerState controllerState)
		{
			if (isPlaying)
			{
				if (m_Recording.frames.Count > m_LastFrameIdx)
				{
					controllerState = m_Recording.frames[m_LastFrameIdx];
					return true;
				}
			}
			else if (isRecording)
			{
				if (m_Recording.frames.Count > 0)
				{
					controllerState = m_Recording.frames[m_Recording.frames.Count - 1];
					return true;
				}
			}
			else if ((Object)(object)m_XRController != (Object)null)
			{
				controllerState = m_XRController.currentControllerState;
				return false;
			}
			controllerState = new XRControllerState();
			return false;
		}
	}
	[Serializable]
	[CreateAssetMenu(menuName = "XR/XR Controller Recording")]
	[PreferBinarySerialization]
	[HelpURL("https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.XR.Interaction.Toolkit.XRControllerRecording.html")]
	public class XRControllerRecording : ScriptableObject, ISerializationCallbackReceiver
	{
		[SerializeField]
		private bool m_SelectActivatedInFirstFrame;

		[SerializeField]
		private bool m_ActivateActivatedInFirstFrame;

		[SerializeField]
		private bool m_FirstUIPressActivatedInFirstFrame;

		[SerializeField]
		private List<XRControllerState> m_Frames = new List<XRControllerState>();

		public List<XRControllerState> frames => m_Frames;

		public double duration
		{
			get
			{
				if (m_Frames.Count != 0)
				{
					return m_Frames[m_Frames.Count - 1].time;
				}
				return 0.0;
			}
		}

		void ISerializationCallbackReceiver.OnBeforeSerialize()
		{
			if (m_Frames != null && m_Frames.Count > 0)
			{
				XRControllerState xRControllerState = m_Frames[0];
				m_SelectActivatedInFirstFrame = xRControllerState.selectInteractionState.activatedThisFrame;
				m_ActivateActivatedInFirstFrame = xRControllerState.activateInteractionState.activatedThisFrame;
				m_FirstUIPressActivatedInFirstFrame = xRControllerState.uiPressInteractionState.activatedThisFrame;
			}
		}

		void ISerializationCallbackReceiver.OnAfterDeserialize()
		{
			SetFrameDependentData();
		}

		internal void SetFrameDependentData()
		{
			if (m_Frames != null && m_Frames.Count > 0)
			{
				XRControllerState xRControllerState = m_Frames[0];
				xRControllerState.selectInteractionState.SetFrameDependent(!m_SelectActivatedInFirstFrame && xRControllerState.selectInteractionState.active);
				xRControllerState.activateInteractionState.SetFrameDependent(!m_ActivateActivatedInFirstFrame && xRControllerState.activateInteractionState.active);
				xRControllerState.uiPressInteractionState.SetFrameDependent(!m_FirstUIPressActivatedInFirstFrame && xRControllerState.uiPressInteractionState.active);
				for (int i = 1; i < m_Frames.Count; i++)
				{
					XRControllerState xRControllerState2 = m_Frames[i];
					XRControllerState xRControllerState3 = m_Frames[i - 1];
					xRControllerState2.selectInteractionState.SetFrameDependent(xRControllerState3.selectInteractionState.active);
					xRControllerState2.activateInteractionState.SetFrameDependent(xRControllerState3.activateInteractionState.active);
					xRControllerState2.uiPressInteractionState.SetFrameDependent(xRControllerState3.uiPressInteractionState.active);
				}
			}
		}

		public void AddRecordingFrame(XRControllerState state)
		{
			frames.Add(new XRControllerState(state));
		}

		public void AddRecordingFrameNonAlloc(XRControllerState state)
		{
			frames.Add(state);
		}

		public void InitRecording()
		{
			m_SelectActivatedInFirstFrame = false;
			m_ActivateActivatedInFirstFrame = false;
			m_FirstUIPressActivatedInFirstFrame = false;
			m_Frames.Clear();
		}

		public void SaveRecording()
		{
		}

		[Obsolete("AddRecordingFrame has been deprecated. Use the overload method with the XRControllerState parameter or the method AddRecordingFrameNonAlloc.")]
		public void AddRecordingFrame(double time, Vector3 position, Quaternion rotation, bool selectActive, bool activateActive, bool pressActive)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			AddRecordingFrameNonAlloc(new XRControllerState(time, position, rotation, (InputTrackingState)3, selectActive, activateActive, pressActive));
		}
	}
	[Serializable]
	public struct InteractionState
	{
		[Range(0f, 1f)]
		[SerializeField]
		private float m_Value;

		[SerializeField]
		private bool m_Active;

		private bool m_ActivatedThisFrame;

		private bool m_DeactivatedThisFrame;

		public float value
		{
			get
			{
				return m_Value;
			}
			set
			{
				m_Value = value;
			}
		}

		public bool active
		{
			get
			{
				return m_Active;
			}
			set
			{
				m_Active = value;
			}
		}

		public bool activatedThisFrame
		{
			get
			{
				return m_ActivatedThisFrame;
			}
			set
			{
				m_ActivatedThisFrame = value;
			}
		}

		public bool deactivatedThisFrame
		{
			get
			{
				return m_DeactivatedThisFrame;
			}
			set
			{
				m_DeactivatedThisFrame = value;
			}
		}

		[Obsolete("deActivatedThisFrame has been deprecated. Use deactivatedThisFrame instead. (UnityUpgradable) -> deactivatedThisFrame")]
		public bool deActivatedThisFrame
		{
			get
			{
				return deactivatedThisFrame;
			}
			set
			{
				deactivatedThisFrame = value;
			}
		}

		public void SetFrameState(bool isActive)
		{
			SetFrameState(isActive, isActive ? 1f : 0f);
		}

		public void SetFrameState(bool isActive, float newValue)
		{
			value = newValue;
			activatedThisFrame = !active && isActive;
			deactivatedThisFrame = active && !isActive;
			active = isActive;
		}

		public void SetFrameDependent(bool wasActive)
		{
			activatedThisFrame = !wasActive && active;
			deactivatedThisFrame = wasActive && !active;
		}

		public void ResetFrameDependent()
		{
			activatedThisFrame = false;
			deactivatedThisFrame = false;
		}

		[Obsolete("Reset has been renamed. Use ResetFrameDependent instead. (UnityUpgradable) -> ResetFrameDependent()")]
		public void Reset()
		{
			ResetFrameDependent();
		}
	}
	[Serializable]
	public class XRControllerState
	{
		public double time;

		public InputTrackingState inputTrackingState;

		public bool isTracked;

		public Vector3 position;

		public Quaternion rotation;

		public InteractionState selectInteractionState;

		public InteractionState activateInteractionState;

		public InteractionState uiPressInteractionState;

		public Vector2 uiScrollValue;

		[Obsolete("poseDataFlags has been deprecated. Use inputTrackingState instead.")]
		public PoseDataFlags poseDataFlags
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				PoseDataFlags val = (PoseDataFlags)0;
				if ((inputTrackingState & 1) != 0)
				{
					val = (PoseDataFlags)(val | 1);
				}
				if ((inputTrackingState & 2) != 0)
				{
					val = (PoseDataFlags)(val | 2);
				}
				return val;
			}
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				inputTrackingState = (InputTrackingState)0;
				if ((value & 1) != 0)
				{
					inputTrackingState = (InputTrackingState)(inputTrackingState | 1);
				}
				if ((value & 2) != 0)
				{
					inputTrackingState = (InputTrackingState)(inputTrackingState | 2);
				}
			}
		}

		protected XRControllerState(double time, Vector3 position, Quaternion rotation, InputTrackingState inputTrackingState, bool isTracked)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			this.time = time;
			this.position = position;
			this.rotation = rotation;
			this.inputTrackingState = inputTrackingState;
			this.isTracked = isTracked;
		}

		public XRControllerState()
			: this(0.0, Vector3.zero, Quaternion.identity, (InputTrackingState)0, isTracked: false)
		{
		}//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)


		public XRControllerState(XRControllerState value)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			time = value.time;
			position = value.position;
			rotation = value.rotation;
			inputTrackingState = value.inputTrackingState;
			isTracked = value.isTracked;
			selectInteractionState = value.selectInteractionState;
			activateInteractionState = value.activateInteractionState;
			uiPressInteractionState = value.uiPressInteractionState;
			uiScrollValue = value.uiScrollValue;
		}

		public XRControllerState(double time, Vector3 position, Quaternion rotation, InputTrackingState inputTrackingState, bool isTracked, bool selectActive, bool activateActive, bool pressActive)
			: this(time, position, rotation, inputTrackingState, isTracked)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			selectInteractionState.SetFrameState(selectActive);
			activateInteractionState.SetFrameState(activateActive);
			uiPressInteractionState.SetFrameState(pressActive);
		}

		public XRControllerState(double time, Vector3 position, Quaternion rotation, InputTrackingState inputTrackingState, bool isTracked, bool selectActive, bool activateActive, bool pressActive, float selectValue, float activateValue, float pressValue)
			: this(time, position, rotation, inputTrackingState, isTracked)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			selectInteractionState.SetFrameState(selectActive, selectValue);
			activateInteractionState.SetFrameState(activateActive, activateValue);
			uiPressInteractionState.SetFrameState(pressActive, pressValue);
		}

		public void ResetFrameDependentStates()
		{
			selectInteractionState.ResetFrameDependent();
			activateInteractionState.ResetFrameDependent();
			uiPressInteractionState.ResetFrameDependent();
		}

		public override string ToString()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			return $"time: {time}, position: {position}, rotation: {rotation}, selectActive: {selectInteractionState.active}, activateActive: {activateInteractionState.active}, pressActive: {uiPressInteractionState.active}, isTracked: {isTracked}, inputTrackingState: {inputTrackingState}";
		}

		[Obsolete("This constructor has been deprecated. Use the constructors with the inputTrackingState parameter.")]
		public XRControllerState(double time, Vector3 position, Quaternion rotation, bool selectActive, bool activateActive, bool pressActive)
			: this(time, position, rotation, (InputTrackingState)3, selectActive, activateActive, pressActive)
		{
		}//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)


		[Obsolete("This constructor has been deprecated. Use the constructor with the isTracked parameter.")]
		protected XRControllerState(double time, Vector3 position, Quaternion rotation, InputTrackingState inputTrackingState)
			: this(time, position, rotation, inputTrackingState, isTracked: true)
		{
		}//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0004: Unknown result type (might be due to invalid IL or missing references)


		[Obsolete("This constructor has been deprecated. Use the constructor with the isTracked parameter.")]
		public XRControllerState(double time, Vector3 position, Quaternion rotation, InputTrackingState inputTrackingState, bool selectActive, bool activateActive, bool pressActive)
			: this(time, position, rotation, inputTrackingState, isTracked: true)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			selectInteractionState.SetFrameState(selectActive);
			activateInteractionState.SetFrameState(activateActive);
			uiPressInteractionState.SetFrameState(pressActive);
		}

		[Obsolete("This constructor has been deprecated. Use the constructor with the isTracked parameter.")]
		public XRControllerState(double time, Vector3 position, Quaternion rotation, InputTrackingState inputTrackingState, bool selectActive, bool activateActive, bool pressActive, float selectValue, float activateValue, float pressValue)
			: this(time, position, rotation, inputTrackingState, isTracked: true)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			selectInteractionState.SetFrameState(selectActive, selectValue);
			activateInteractionState.SetFrameState(activateActive, activateValue);
			uiPressInteractionState.SetFrameState(pressActive, pressValue);
		}

		[Obsolete("ResetInputs has been renamed. Use ResetFrameDependentStates instead. (UnityUpgradable) -> ResetFrameDependentStates()")]
		public void ResetInputs()
		{
			ResetFrameDependentStates();
		}
	}
	[AddComponentMenu("XR/XR Screen Space Controller", 11)]
	[HelpURL("https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.XR.Interaction.Toolkit.XRScreenSpaceController.html")]
	public class XRScreenSpaceController : XRBaseController
	{
		[Header("Touchscreen Gesture Actions")]
		[SerializeField]
		[Tooltip("When enabled, a Touchscreen Gesture Input Controller will be added to the Input System device list to detect touch gestures.")]
		private bool m_EnableTouchscreenGestureInputController = true;

		[SerializeField]
		[Tooltip("The action to use for the screen tap position. (Vector 2 Control).")]
		private InputActionProperty m_TapStartPositionAction = new InputActionProperty(new InputAction("Tap Start Position", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		[SerializeField]
		[Tooltip("The action to use for the current screen drag position. (Vector 2 Control).")]
		private InputActionProperty m_DragCurrentPositionAction = new InputActionProperty(new InputAction("Drag Current Position", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		[SerializeField]
		[Tooltip("The action to use for the delta of the screen drag. (Vector 2 Control).")]
		private InputActionProperty m_DragDeltaAction = new InputActionProperty(new InputAction("Drag Delta", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		[SerializeField]
		[FormerlySerializedAs("m_PinchStartPosition")]
		[Tooltip("The action to use for the screen pinch gesture start position. (Vector 2 Control).")]
		private InputActionProperty m_PinchStartPositionAction = new InputActionProperty(new InputAction("Pinch Start Position", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		[SerializeField]
		[Tooltip("The action to use for the gap of the screen pinch gesture. (Axis Control).")]
		private InputActionProperty m_PinchGapAction = new InputActionProperty(new InputAction((string)null, (InputActionType)0, (string)null, (string)null, (string)null, "Axis"));

		[SerializeField]
		[Tooltip("The action to use for the delta of the screen pinch gesture. (Axis Control).")]
		private InputActionProperty m_PinchGapDeltaAction = new InputActionProperty(new InputAction("Pinch Gap Delta", (InputActionType)0, (string)null, (string)null, (string)null, "Axis"));

		[SerializeField]
		[FormerlySerializedAs("m_TwistStartPosition")]
		[Tooltip("The action to use for the screen twist gesture start position. (Vector 2 Control).")]
		private InputActionProperty m_TwistStartPositionAction = new InputActionProperty(new InputAction("Twist Start Position", (InputActionType)0, (string)null, (string)null, (string)null, "Vector2"));

		[SerializeField]
		[FormerlySerializedAs("m_TwistRotationDeltaAction")]
		[Tooltip("The action to use for the delta of the screen twist gesture. (Axis Control).")]
		private InputActionProperty m_TwistDeltaRotationAction = new InputActionProperty(new InputAction("Twist Delta Rotation", (InputActionType)0, (string)null, (string)null, (string)null, "Axis"));

		[SerializeField]
		[FormerlySerializedAs("m_ScreenTouchCount")]
		[Tooltip("The number of concurrent touches on the screen. (Integer Control).")]
		private InputActionProperty m_ScreenTouchCountAction = new InputActionProperty(new InputAction("Screen Touch Count", (InputActionType)0, (string)null, (string)null, (string)null, "Integer"));

		[SerializeField]
		[Tooltip("The camera associated with the screen, and through which screen presses/touches will be interpreted.")]
		private Camera m_ControllerCamera;

		[SerializeField]
		[Tooltip("Tells the XR Screen Space Controller to ignore interactions when hitting a screen space canvas.")]
		private bool m_BlockInteractionsWithScreenSpaceUI = true;

		private bool m_HasCheckedDisabledTrackingInputReferenceActions;

		private bool m_HasCheckedDisabledInputReferenceActions;

		private UIInputModule m_UIInputModule;

		public bool enableTouchscreenGestureInputController
		{
			get
			{
				return m_EnableTouchscreenGestureInputController;
			}
			set
			{
				m_EnableTouchscreenGestureInputController = value;
			}
		}

		public InputActionProperty tapStartPositionAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_TapStartPositionAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_TapStartPositionAction, value);
			}
		}

		public InputActionProperty dragCurrentPositionAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_DragCurrentPositionAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_DragCurrentPositionAction, value);
			}
		}

		public InputActionProperty dragDeltaAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_DragDeltaAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_DragDeltaAction, value);
			}
		}

		public InputActionProperty pinchStartPositionAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_PinchStartPositionAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_PinchStartPositionAction, value);
			}
		}

		public InputActionProperty pinchGapAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_PinchGapAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_PinchGapAction, value);
			}
		}

		public InputActionProperty pinchGapDeltaAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_PinchGapDeltaAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_PinchGapDeltaAction, value);
			}
		}

		public InputActionProperty twistStartPositionAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_TwistStartPositionAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_TwistStartPositionAction, value);
			}
		}

		public InputActionProperty twistDeltaRotationAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_TwistDeltaRotationAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_TwistDeltaRotationAction, value);
			}
		}

		public InputActionProperty screenTouchCountAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_ScreenTouchCountAction;
			}
			set
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				SetInputActionProperty(ref m_ScreenTouchCountAction, value);
			}
		}

		public Camera controllerCamera
		{
			get
			{
				return m_ControllerCamera;
			}
			set
			{
				m_ControllerCamera = value;
			}
		}

		public bool blockInteractionsWithScreenSpaceUI
		{
			get
			{
				return m_BlockInteractionsWithScreenSpaceUI;
			}
			set
			{
				m_BlockInteractionsWithScreenSpaceUI = value;
			}
		}

		public float scaleDelta { get; private set; }

		[Obsolete("pinchStartPosition has been deprecated. Use pinchStartPositionAction instead. (UnityUpgradable) -> pinchStartPositionAction")]
		public InputActionProperty pinchStartPosition
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return pinchStartPositionAction;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				pinchStartPositionAction = value;
			}
		}

		[Obsolete("pinchGapDelta has been deprecated. Use pinchGapDeltaAction instead. (UnityUpgradable) -> pinchGapDeltaAction")]
		public InputActionProperty pinchGapDelta
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return pinchGapDeltaAction;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				pinchGapDeltaAction = value;
			}
		}

		[Obsolete("twistStartPosition has been deprecated. Use twistStartPositionAction instead. (UnityUpgradable) -> twistStartPositionAction")]
		public InputActionProperty twistStartPosition
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return twistStartPositionAction;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				twistStartPositionAction = value;
			}
		}

		[Obsolete("twistRotationDeltaAction has been deprecated. Use twistDeltaRotationAction instead. (UnityUpgradable) -> twistDeltaRotationAction")]
		public InputActionProperty twistRotationDeltaAction
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return twistDeltaRotationAction;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				twistDeltaRotationAction = value;
			}
		}

		[Obsolete("screenTouchCount has been deprecated. Use screenTouchCountAction instead. (UnityUpgradable) -> screenTouchCountAction")]
		public InputActionProperty screenTouchCount
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return screenTouchCountAction;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				screenTouchCountAction = value;
			}
		}

		protected void Start()
		{
			if ((Object)(object)m_ControllerCamera == (Object)null)
			{
				m_ControllerCamera = Camera.main;
				if ((Object)(object)m_ControllerCamera == (Object)null)
				{
					Debug.LogWarning((object)"Could not find associated Camera in scene.This XRScreenSpaceController will be disabled.", (Object)(object)this);
					((Behaviour)this).enabled = false;
				}
			}
		}

		protected override void OnEnable()
		{
			base.OnEnable();
			EnableAllDirectActions();
			InitializeTouchscreenGestureController();
		}

		protected override void OnDisable()
		{
			base.OnDisable();
			DisableAllDirectActions();
			DestroyTouchscreenGestureController();
			m_UIInputModule = null;
		}

		protected override void UpdateTrackingInput(XRControllerState controllerState)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			base.UpdateTrackingInput(controllerState);
			if (controllerState == null || IsPointerOverScreenSpaceCanvas())
			{
				return;
			}
			if (!m_HasCheckedDisabledTrackingInputReferenceActions && (((InputActionProperty)(ref m_DragCurrentPositionAction)).action != null || ((InputActionProperty)(ref m_TapStartPositionAction)).action != null || ((InputActionProperty)(ref m_TwistStartPositionAction)).action != null))
			{
				if (IsDisabledReferenceAction(m_DragCurrentPositionAction) || IsDisabledReferenceAction(m_TapStartPositionAction) || IsDisabledReferenceAction(m_TwistStartPositionAction))
				{
					Debug.LogWarning((object)"'Enable Input Tracking' is enabled, but the Tap, Drag, Pinch, and/or Twist Action is disabled. The pose of the controller will not be updated correctly until the Input Actions are enabled. Input Actions in an Input Action Asset must be explicitly enabled to read the current value of the action. The Input Action Manager behavior can be added to a GameObject in a Scene and used to enable all Input Actions in a referenced Input Action Asset.", (Object)(object)this);
				}
				m_HasCheckedDisabledTrackingInputReferenceActions = true;
			}
			InputAction action = ((InputActionProperty)(ref m_ScreenTouchCountAction)).action;
			int num = ((action != null) ? action.ReadValue<int>() : 0);
			controllerState.isTracked = num > 0;
			if (TryGetCurrentPositionAction(num, out var action2))
			{
				Vector2 val = action2.ReadValue<Vector2>();
				Vector3 val2 = m_ControllerCamera.ScreenToWorldPoint(new Vector3(val.x, val.y, m_ControllerCamera.nearClipPlane));
				Vector3 val3 = val2 - ((Component)m_ControllerCamera).transform.position;
				Vector3 normalized = ((Vector3)(ref val3)).normalized;
				controllerState.position = (((Object)(object)((Component)this).transform.parent != (Object)null) ? ((Component)this).transform.parent.InverseTransformPoint(val2) : val2);
				controllerState.rotation = Quaternion.LookRotation(normalized);
				controllerState.inputTrackingState = (InputTrackingState)3;
			}
			else
			{
				controllerState.inputTrackingState = (InputTrackingState)0;
			}
		}

		protected override void UpdateInput(XRControllerState controllerState)
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Invalid comparison between Unknown and I4
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			base.UpdateInput(controllerState);
			if (controllerState == null || IsPointerOverScreenSpaceCanvas())
			{
				return;
			}
			if (!m_HasCheckedDisabledInputReferenceActions && (((InputActionProperty)(ref m_TwistDeltaRotationAction)).action != null || ((InputActionProperty)(ref m_DragCurrentPositionAction)).action != null || ((InputActionProperty)(ref m_TapStartPositionAction)).action != null))
			{
				if (IsDisabledReferenceAction(m_TwistDeltaRotationAction) || IsDisabledReferenceAction(m_DragCurrentPositionAction) || IsDisabledReferenceAction(m_TapStartPositionAction))
				{
					Debug.LogWarning((object)"'Enable Input Actions' is enabled, but the Tap, Drag, Pinch, and/or Twist Action is disabled. The controller input will not be handled correctly until the Input Actions are enabled. Input Actions in an Input Action Asset must be explicitly enabled to read the current value of the action. The Input Action Manager behavior can be added to a GameObject in a Scene and used to enable all Input Actions in a referenced Input Action Asset.", (Object)(object)this);
				}
				m_HasCheckedDisabledInputReferenceActions = true;
			}
			controllerState.ResetFrameDependentStates();
			InputAction action2;
			if (TryGetCurrentTwoInputSelectAction(out var action))
			{
				controllerState.selectInteractionState.SetFrameState(InputExtensions.IsInProgress(action.phase), action.ReadValue<float>());
			}
			else if (TryGetCurrentOneInputSelectAction(out action2))
			{
				ref InteractionState reference = ref controllerState.selectInteractionState;
				bool isActive = (int)action2.phase == 2;
				Vector2 val = action2.ReadValue<Vector2>();
				reference.SetFrameState(isActive, ((Vector2)(ref val)).magnitude);
			}
			else
			{
				controllerState.selectInteractionState.SetFrameState(isActive: false, 0f);
			}
			scaleDelta = ((((InputActionProperty)(ref m_PinchGapDeltaAction)).action != null) ? (((InputActionProperty)(ref m_PinchGapDeltaAction)).action.ReadValue<float>() / Screen.dpi) : 0f);
		}

		private bool TryGetCurrentPositionAction(int touchCount, out InputAction action)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Invalid comparison between Unknown and I4
			if (touchCount <= 1)
			{
				if (((InputActionProperty)(ref m_DragCurrentPositionAction)).action != null && (int)((InputActionProperty)(ref m_DragCurrentPositionAction)).action.phase == 2)
				{
					action = ((InputActionProperty)(ref m_DragCurrentPositionAction)).action;
					return true;
				}
				if (((InputActionProperty)(ref m_TapStartPositionAction)).action != null && (int)((InputActionProperty)(ref m_TapStartPositionAction)).action.phase == 2)
				{
					action = ((InputActionProperty)(ref m_TapStartPositionAction)).action;
					return true;
				}
			}
			action = null;
			return false;
		}

		private bool TryGetCurrentOneInputSelectAction(out InputAction action)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Invalid comparison between Unknown and I4
			if (((InputActionProperty)(ref m_DragCurrentPositionAction)).action != null && (int)((InputActionProperty)(ref m_DragCurrentPositionAction)).action.phase == 2)
			{
				action = ((InputActionProperty)(ref m_DragCurrentPositionAction)).action;
				return true;
			}
			if (((InputActionProperty)(ref m_TapStartPositionAction)).action != null && (int)((InputActionProperty)(ref m_TapStartPositionAction)).action.phase == 2)
			{
				action = ((InputActionProperty)(ref m_TapStartPositionAction)).action;
				return true;
			}
			action = null;
			return false;
		}

		private bool TryGetCurrentTwoInputSelectAction(out InputAction action)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			if (((InputActionProperty)(ref m_PinchGapAction)).action != null && InputExtensions.IsInProgress(((InputActionProperty)(ref m_PinchGapAction)).action.phase))
			{
				action = ((InputActionProperty)(ref m_PinchGapAction)).action;
				return true;
			}
			if (((InputActionProperty)(ref m_PinchGapDeltaAction)).action != null && InputExtensions.IsInProgress(((InputActionProperty)(ref m_PinchGapDeltaAction)).action.phase))
			{
				action = ((InputActionProperty)(ref m_PinchGapDeltaAction)).action;
				return true;
			}
			if (((InputActionProperty)(ref m_TwistDeltaRotationAction)).action != null && InputExtensions.IsInProgress(((InputActionProperty)(ref m_TwistDeltaRotationAction)).action.

BepInEx\plugins\Cyberhead\Unity.XR.Management.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using UnityEngine.Rendering;
using UnityEngine.Serialization;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Unity.XR.Management.Editor")]
[assembly: InternalsVisibleTo("Unity.XR.Management.Tests")]
[assembly: InternalsVisibleTo("Unity.XR.Management.EditorTests")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace UnityEngine.XR.Management;

[AttributeUsage(AttributeTargets.Class)]
public sealed class XRConfigurationDataAttribute : Attribute
{
	public string displayName { get; set; }

	public string buildSettingsKey { get; set; }

	private XRConfigurationDataAttribute()
	{
	}

	public XRConfigurationDataAttribute(string displayName, string buildSettingsKey)
	{
		this.displayName = displayName;
		this.buildSettingsKey = buildSettingsKey;
	}
}
public class XRGeneralSettings : ScriptableObject
{
	public static string k_SettingsKey = "com.unity.xr.management.loader_settings";

	internal static XRGeneralSettings s_RuntimeSettingsInstance = null;

	[SerializeField]
	internal XRManagerSettings m_LoaderManagerInstance;

	[SerializeField]
	[Tooltip("Toggling this on/off will enable/disable the automatic startup of XR at run time.")]
	internal bool m_InitManagerOnStart = true;

	private XRManagerSettings m_XRManager;

	private bool m_ProviderIntialized;

	private bool m_ProviderStarted;

	public XRManagerSettings Manager
	{
		get
		{
			return m_LoaderManagerInstance;
		}
		set
		{
			m_LoaderManagerInstance = value;
		}
	}

	public static XRGeneralSettings Instance => s_RuntimeSettingsInstance;

	public XRManagerSettings AssignedSettings => m_LoaderManagerInstance;

	public bool InitManagerOnStart => m_InitManagerOnStart;

	private void Awake()
	{
		Debug.Log((object)"XRGeneral Settings awakening...");
		s_RuntimeSettingsInstance = this;
		Application.quitting += Quit;
		Object.DontDestroyOnLoad((Object)(object)s_RuntimeSettingsInstance);
	}

	private static void Quit()
	{
		XRGeneralSettings instance = Instance;
		if (!((Object)(object)instance == (Object)null))
		{
			instance.DeInitXRSDK();
		}
	}

	private void Start()
	{
		StartXRSDK();
	}

	private void OnDestroy()
	{
		DeInitXRSDK();
	}

	[RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)]
	internal static void AttemptInitializeXRSDKOnLoad()
	{
		XRGeneralSettings instance = Instance;
		if (!((Object)(object)instance == (Object)null) && instance.InitManagerOnStart)
		{
			instance.InitXRSDK();
		}
	}

	[RuntimeInitializeOnLoadMethod(/*Could not decode attribute arguments.*/)]
	internal static void AttemptStartXRSDKOnBeforeSplashScreen()
	{
		XRGeneralSettings instance = Instance;
		if (!((Object)(object)instance == (Object)null) && instance.InitManagerOnStart)
		{
			instance.StartXRSDK();
		}
	}

	private void InitXRSDK()
	{
		if (!((Object)(object)Instance == (Object)null) && !((Object)(object)Instance.m_LoaderManagerInstance == (Object)null) && Instance.m_InitManagerOnStart)
		{
			m_XRManager = Instance.m_LoaderManagerInstance;
			if ((Object)(object)m_XRManager == (Object)null)
			{
				Debug.LogError((object)"Assigned GameObject for XR Management loading is invalid. No XR Providers will be automatically loaded.");
				return;
			}
			m_XRManager.automaticLoading = false;
			m_XRManager.automaticRunning = false;
			m_XRManager.InitializeLoaderSync();
			m_ProviderIntialized = true;
		}
	}

	private void StartXRSDK()
	{
		if ((Object)(object)m_XRManager != (Object)null && (Object)(object)m_XRManager.activeLoader != (Object)null)
		{
			m_XRManager.StartSubsystems();
			m_ProviderStarted = true;
		}
	}

	private void StopXRSDK()
	{
		if ((Object)(object)m_XRManager != (Object)null && (Object)(object)m_XRManager.activeLoader != (Object)null)
		{
			m_XRManager.StopSubsystems();
			m_ProviderStarted = false;
		}
	}

	private void DeInitXRSDK()
	{
		if ((Object)(object)m_XRManager != (Object)null && (Object)(object)m_XRManager.activeLoader != (Object)null)
		{
			m_XRManager.DeinitializeLoader();
			m_XRManager = null;
			m_ProviderIntialized = false;
		}
	}
}
public abstract class XRLoader : ScriptableObject
{
	public virtual bool Initialize()
	{
		return true;
	}

	public virtual bool Start()
	{
		return true;
	}

	public virtual bool Stop()
	{
		return true;
	}

	public virtual bool Deinitialize()
	{
		return true;
	}

	public abstract T GetLoadedSubsystem<T>() where T : class, ISubsystem;

	public virtual List<GraphicsDeviceType> GetSupportedGraphicsDeviceTypes(bool buildingPlayer)
	{
		return new List<GraphicsDeviceType>();
	}
}
public abstract class XRLoaderHelper : XRLoader
{
	protected Dictionary<Type, ISubsystem> m_SubsystemInstanceMap = new Dictionary<Type, ISubsystem>();

	public override T GetLoadedSubsystem<T>()
	{
		Type typeFromHandle = typeof(T);
		m_SubsystemInstanceMap.TryGetValue(typeFromHandle, out var value);
		return value as T;
	}

	protected void StartSubsystem<T>() where T : class, ISubsystem
	{
		T loadedSubsystem = GetLoadedSubsystem<T>();
		if (loadedSubsystem != null)
		{
			((ISubsystem)loadedSubsystem).Start();
		}
	}

	protected void StopSubsystem<T>() where T : class, ISubsystem
	{
		T loadedSubsystem = GetLoadedSubsystem<T>();
		if (loadedSubsystem != null)
		{
			((ISubsystem)loadedSubsystem).Stop();
		}
	}

	protected void DestroySubsystem<T>() where T : class, ISubsystem
	{
		T loadedSubsystem = GetLoadedSubsystem<T>();
		if (loadedSubsystem != null)
		{
			Type typeFromHandle = typeof(T);
			if (m_SubsystemInstanceMap.ContainsKey(typeFromHandle))
			{
				m_SubsystemInstanceMap.Remove(typeFromHandle);
			}
			((ISubsystem)loadedSubsystem).Destroy();
		}
	}

	protected void CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem
	{
		if (descriptors == null)
		{
			throw new ArgumentNullException("descriptors");
		}
		SubsystemManager.GetSubsystemDescriptors<TDescriptor>(descriptors);
		if (descriptors.Count <= 0)
		{
			return;
		}
		foreach (TDescriptor descriptor in descriptors)
		{
			ISubsystem val = null;
			if (string.Compare(((ISubsystemDescriptor)descriptor).id, id, ignoreCase: true) == 0)
			{
				val = ((ISubsystemDescriptor)descriptor).Create();
			}
			if (val != null)
			{
				m_SubsystemInstanceMap[typeof(TSubsystem)] = val;
				break;
			}
		}
	}

	[Obsolete("This method is obsolete. Please use the geenric CreateSubsystem method.", false)]
	protected void CreateIntegratedSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : IntegratedSubsystemDescriptor where TSubsystem : IntegratedSubsystem
	{
		CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id);
	}

	[Obsolete("This method is obsolete. Please use the generic CreateSubsystem method.", false)]
	protected void CreateStandaloneSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : SubsystemDescriptor where TSubsystem : Subsystem
	{
		CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id);
	}

	public override bool Deinitialize()
	{
		m_SubsystemInstanceMap.Clear();
		return base.Deinitialize();
	}
}
internal static class XRManagementAnalytics
{
	[Serializable]
	private struct BuildEvent
	{
		public string buildGuid;

		public string buildTarget;

		public string buildTargetGroup;

		public string[] assigned_loaders;
	}

	private const int kMaxEventsPerHour = 1000;

	private const int kMaxNumberOfElements = 1000;

	private const string kVendorKey = "unity.xrmanagement";

	private const string kEventBuild = "xrmanagment_build";

	private static bool s_Initialized;

	private static bool Initialize()
	{
		return s_Initialized;
	}
}
public sealed class XRManagerSettings : ScriptableObject
{
	[HideInInspector]
	private bool m_InitializationComplete;

	[HideInInspector]
	[SerializeField]
	private bool m_RequiresSettingsUpdate;

	[SerializeField]
	[Tooltip("Determines if the XR Manager instance is responsible for creating and destroying the appropriate loader instance.")]
	[FormerlySerializedAs("AutomaticLoading")]
	private bool m_AutomaticLoading;

	[SerializeField]
	[Tooltip("Determines if the XR Manager instance is responsible for starting and stopping subsystems for the active loader instance.")]
	[FormerlySerializedAs("AutomaticRunning")]
	private bool m_AutomaticRunning;

	[SerializeField]
	[Tooltip("List of XR Loader instances arranged in desired load order.")]
	[FormerlySerializedAs("Loaders")]
	private List<XRLoader> m_Loaders = new List<XRLoader>();

	[SerializeField]
	[HideInInspector]
	private HashSet<XRLoader> m_RegisteredLoaders = new HashSet<XRLoader>();

	public bool automaticLoading
	{
		get
		{
			return m_AutomaticLoading;
		}
		set
		{
			m_AutomaticLoading = value;
		}
	}

	public bool automaticRunning
	{
		get
		{
			return m_AutomaticRunning;
		}
		set
		{
			m_AutomaticRunning = value;
		}
	}

	[Obsolete("'XRManagerSettings.loaders' property is obsolete. Use 'XRManagerSettings.activeLoaders' instead to get a list of the current loaders.")]
	public List<XRLoader> loaders => m_Loaders;

	public IReadOnlyList<XRLoader> activeLoaders => m_Loaders;

	public bool isInitializationComplete => m_InitializationComplete;

	[HideInInspector]
	public XRLoader activeLoader { get; private set; }

	internal List<XRLoader> currentLoaders
	{
		get
		{
			return m_Loaders;
		}
		set
		{
			m_Loaders = value;
		}
	}

	internal HashSet<XRLoader> registeredLoaders => m_RegisteredLoaders;

	public T ActiveLoaderAs<T>() where T : XRLoader
	{
		return activeLoader as T;
	}

	public void InitializeLoaderSync()
	{
		if ((Object)(object)activeLoader != (Object)null)
		{
			Debug.LogWarning((object)"XR Management has already initialized an active loader in this scene. Please make sure to stop all subsystems and deinitialize the active loader before initializing a new one.");
			return;
		}
		foreach (XRLoader currentLoader in currentLoaders)
		{
			if ((Object)(object)currentLoader != (Object)null && CheckGraphicsAPICompatibility(currentLoader) && currentLoader.Initialize())
			{
				activeLoader = currentLoader;
				m_InitializationComplete = true;
				return;
			}
		}
		activeLoader = null;
	}

	public IEnumerator InitializeLoader()
	{
		if ((Object)(object)activeLoader != (Object)null)
		{
			Debug.LogWarning((object)"XR Management has already initialized an active loader in this scene. Please make sure to stop all subsystems and deinitialize the active loader before initializing a new one.");
			yield break;
		}
		foreach (XRLoader currentLoader in currentLoaders)
		{
			if ((Object)(object)currentLoader != (Object)null && CheckGraphicsAPICompatibility(currentLoader) && currentLoader.Initialize())
			{
				activeLoader = currentLoader;
				m_InitializationComplete = true;
				yield break;
			}
			yield return null;
		}
		activeLoader = null;
	}

	public bool TryAddLoader(XRLoader loader, int index = -1)
	{
		if ((Object)(object)loader == (Object)null || currentLoaders.Contains(loader))
		{
			return false;
		}
		if (!m_RegisteredLoaders.Contains(loader))
		{
			return false;
		}
		if (index < 0 || index >= currentLoaders.Count)
		{
			currentLoaders.Add(loader);
		}
		else
		{
			currentLoaders.Insert(index, loader);
		}
		return true;
	}

	public bool TryRemoveLoader(XRLoader loader)
	{
		bool result = true;
		if (currentLoaders.Contains(loader))
		{
			result = currentLoaders.Remove(loader);
		}
		return result;
	}

	public bool TrySetLoaders(List<XRLoader> reorderedLoaders)
	{
		List<XRLoader> list = new List<XRLoader>(activeLoaders);
		currentLoaders.Clear();
		foreach (XRLoader reorderedLoader in reorderedLoaders)
		{
			if (!TryAddLoader(reorderedLoader))
			{
				currentLoaders = list;
				return false;
			}
		}
		return true;
	}

	private void Awake()
	{
		foreach (XRLoader currentLoader in currentLoaders)
		{
			if (!m_RegisteredLoaders.Contains(currentLoader))
			{
				m_RegisteredLoaders.Add(currentLoader);
			}
		}
	}

	private bool CheckGraphicsAPICompatibility(XRLoader loader)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		GraphicsDeviceType graphicsDeviceType = SystemInfo.graphicsDeviceType;
		List<GraphicsDeviceType> supportedGraphicsDeviceTypes = loader.GetSupportedGraphicsDeviceTypes(buildingPlayer: false);
		if (supportedGraphicsDeviceTypes.Count > 0 && !supportedGraphicsDeviceTypes.Contains(graphicsDeviceType))
		{
			Debug.LogWarning((object)$"The {((Object)loader).name} does not support the initialized graphics device, {((object)(GraphicsDeviceType)(ref graphicsDeviceType)).ToString()}. Please change the preffered Graphics API in PlayerSettings. Attempting to start the next XR loader.");
			return false;
		}
		return true;
	}

	public void StartSubsystems()
	{
		if (!m_InitializationComplete)
		{
			Debug.LogWarning((object)"Call to StartSubsystems without an initialized manager.Please make sure wait for initialization to complete before calling this API.");
		}
		else if ((Object)(object)activeLoader != (Object)null)
		{
			activeLoader.Start();
		}
	}

	public void StopSubsystems()
	{
		if (!m_InitializationComplete)
		{
			Debug.LogWarning((object)"Call to StopSubsystems without an initialized manager.Please make sure wait for initialization to complete before calling this API.");
		}
		else if ((Object)(object)activeLoader != (Object)null)
		{
			activeLoader.Stop();
		}
	}

	public void DeinitializeLoader()
	{
		if (!m_InitializationComplete)
		{
			Debug.LogWarning((object)"Call to DeinitializeLoader without an initialized manager.Please make sure wait for initialization to complete before calling this API.");
			return;
		}
		StopSubsystems();
		if ((Object)(object)activeLoader != (Object)null)
		{
			activeLoader.Deinitialize();
			activeLoader = null;
		}
		m_InitializationComplete = false;
	}

	private void Start()
	{
		if (automaticLoading && automaticRunning)
		{
			StartSubsystems();
		}
	}

	private void OnDisable()
	{
		if (automaticLoading && automaticRunning)
		{
			StopSubsystems();
		}
	}

	private void OnDestroy()
	{
		if (automaticLoading)
		{
			DeinitializeLoader();
		}
	}
}

BepInEx\plugins\Cyberhead\Unity.XR.OpenXR.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text;
using AOT;
using UnityEngine.Analytics;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.Layouts;
using UnityEngine.InputSystem.LowLevel;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.InputSystem.XR;
using UnityEngine.Scripting;
using UnityEngine.Serialization;
using UnityEngine.XR.Management;
using UnityEngine.XR.OpenXR.Features;
using UnityEngine.XR.OpenXR.Features.Interactions;
using UnityEngine.XR.OpenXR.Input;
using UnityEngine.XR.OpenXR.NativeTypes;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("Unity.XR.OpenXR.Editor")]
[assembly: InternalsVisibleTo("UnityEditor.XR.OpenXR.Tests")]
[assembly: Preserve]
[assembly: InternalsVisibleTo("Unity.XR.OpenXR.TestHelpers")]
[assembly: InternalsVisibleTo("Unity.XR.OpenXR.Tests")]
[assembly: InternalsVisibleTo("Unity.XR.OpenXR.Tests.Editor")]
[assembly: InternalsVisibleTo("Unity.XR.OpenXR.Features.MockRuntime")]
[assembly: InternalsVisibleTo("Unity.XR.OpenXR.Features.ConformanceAutomation")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace UnityEngine.XR.OpenXR
{
	[Serializable]
	public class OpenXRSettings : ScriptableObject
	{
		public enum RenderMode
		{
			MultiPass,
			SinglePassInstanced
		}

		public enum DepthSubmissionMode
		{
			None,
			Depth16Bit,
			Depth24Bit
		}

		[FormerlySerializedAs("extensions")]
		[HideInInspector]
		[SerializeField]
		internal OpenXRFeature[] features = new OpenXRFeature[0];

		[SerializeField]
		private RenderMode m_renderMode = RenderMode.SinglePassInstanced;

		[SerializeField]
		private DepthSubmissionMode m_depthSubmissionMode;

		private const string LibraryName = "UnityOpenXR";

		private static OpenXRSettings s_RuntimeInstance;

		public int featureCount => features.Length;

		public RenderMode renderMode
		{
			get
			{
				if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null)
				{
					return Internal_GetRenderMode();
				}
				return m_renderMode;
			}
			set
			{
				if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null)
				{
					Internal_SetRenderMode(value);
				}
				else
				{
					m_renderMode = value;
				}
			}
		}

		public DepthSubmissionMode depthSubmissionMode
		{
			get
			{
				if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null)
				{
					return Internal_GetDepthSubmissionMode();
				}
				return m_depthSubmissionMode;
			}
			set
			{
				if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null)
				{
					Internal_SetDepthSubmissionMode(value);
				}
				else
				{
					m_depthSubmissionMode = value;
				}
			}
		}

		public static OpenXRSettings ActiveBuildTargetInstance => GetInstance(useActiveBuildTarget: true);

		public static OpenXRSettings Instance => GetInstance(useActiveBuildTarget: false);

		public TFeature GetFeature<TFeature>() where TFeature : OpenXRFeature
		{
			return (TFeature)GetFeature(typeof(TFeature));
		}

		public OpenXRFeature GetFeature(Type featureType)
		{
			OpenXRFeature[] array = features;
			foreach (OpenXRFeature openXRFeature in array)
			{
				if (featureType.IsInstanceOfType(openXRFeature))
				{
					return openXRFeature;
				}
			}
			return null;
		}

		public OpenXRFeature[] GetFeatures<TFeature>()
		{
			return GetFeatures(typeof(TFeature));
		}

		public OpenXRFeature[] GetFeatures(Type featureType)
		{
			List<OpenXRFeature> list = new List<OpenXRFeature>();
			OpenXRFeature[] array = features;
			foreach (OpenXRFeature openXRFeature in array)
			{
				if (featureType.IsInstanceOfType(openXRFeature))
				{
					list.Add(openXRFeature);
				}
			}
			return list.ToArray();
		}

		public int GetFeatures<TFeature>(List<TFeature> featuresOut) where TFeature : OpenXRFeature
		{
			featuresOut.Clear();
			OpenXRFeature[] array = features;
			for (int i = 0; i < array.Length; i++)
			{
				if (array[i] is TFeature item)
				{
					featuresOut.Add(item);
				}
			}
			return featuresOut.Count;
		}

		public int GetFeatures(Type featureType, List<OpenXRFeature> featuresOut)
		{
			featuresOut.Clear();
			OpenXRFeature[] array = features;
			foreach (OpenXRFeature openXRFeature in array)
			{
				if (featureType.IsInstanceOfType(openXRFeature))
				{
					featuresOut.Add(openXRFeature);
				}
			}
			return featuresOut.Count;
		}

		public OpenXRFeature[] GetFeatures()
		{
			return ((OpenXRFeature[])features?.Clone()) ?? new OpenXRFeature[0];
		}

		public int GetFeatures(List<OpenXRFeature> featuresOut)
		{
			featuresOut.Clear();
			featuresOut.AddRange(features);
			return featuresOut.Count;
		}

		private void ApplyRenderSettings()
		{
			Internal_SetRenderMode(m_renderMode);
			Internal_SetDepthSubmissionMode(m_depthSubmissionMode);
		}

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetRenderMode")]
		private static extern void Internal_SetRenderMode(RenderMode renderMode);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRenderMode")]
		private static extern RenderMode Internal_GetRenderMode();

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetDepthSubmissionMode")]
		private static extern void Internal_SetDepthSubmissionMode(DepthSubmissionMode depthSubmissionMode);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetDepthSubmissionMode")]
		private static extern DepthSubmissionMode Internal_GetDepthSubmissionMode();

		private void Awake()
		{
			s_RuntimeInstance = this;
		}

		internal void ApplySettings()
		{
			ApplyRenderSettings();
		}

		private static OpenXRSettings GetInstance(bool useActiveBuildTarget)
		{
			OpenXRSettings openXRSettings = null;
			openXRSettings = s_RuntimeInstance;
			if ((Object)(object)openXRSettings == (Object)null)
			{
				openXRSettings = ScriptableObject.CreateInstance<OpenXRSettings>();
			}
			return openXRSettings;
		}
	}
	internal static class OpenXRAnalytics
	{
		[Serializable]
		private struct InitializeEvent
		{
			public bool success;

			public string runtime;

			public string runtime_version;

			public string plugin_version;

			public string api_version;

			public string[] available_extensions;

			public string[] enabled_extensions;

			public string[] enabled_features;

			public string[] failed_features;
		}

		private const int kMaxEventsPerHour = 1000;

		private const int kMaxNumberOfElements = 1000;

		private const string kVendorKey = "unity.openxr";

		private const string kEventInitialize = "openxr_initialize";

		private static bool s_Initialized;

		private static bool Initialize()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (s_Initialized)
			{
				return true;
			}
			if ((int)Analytics.RegisterEvent("openxr_initialize", 1000, 1000, "unity.openxr", "") != 0)
			{
				return false;
			}
			s_Initialized = true;
			return true;
		}

		public static void SendInitializeEvent(bool success)
		{
			if (s_Initialized || Initialize())
			{
				SendPlayerAnalytics(CreateInitializeEvent(success));
			}
		}

		private static InitializeEvent CreateInitializeEvent(bool success)
		{
			InitializeEvent result = default(InitializeEvent);
			result.success = success;
			result.runtime = OpenXRRuntime.name;
			result.runtime_version = OpenXRRuntime.version;
			result.plugin_version = OpenXRRuntime.pluginVersion;
			result.api_version = OpenXRRuntime.apiVersion;
			result.enabled_extensions = (from ext in OpenXRRuntime.GetEnabledExtensions()
				select $"{ext}_{OpenXRRuntime.GetExtensionVersion(ext)}").ToArray();
			result.available_extensions = (from ext in OpenXRRuntime.GetAvailableExtensions()
				select $"{ext}_{OpenXRRuntime.GetExtensionVersion(ext)}").ToArray();
			result.enabled_features = (from f in OpenXRSettings.Instance.features
				where (Object)(object)f != (Object)null && f.enabled
				select ((object)f).GetType().FullName + "_" + f.version).ToArray();
			result.failed_features = (from f in OpenXRSettings.Instance.features
				where (Object)(object)f != (Object)null && f.failedInitialization
				select ((object)f).GetType().FullName + "_" + f.version).ToArray();
			return result;
		}

		private static void SendPlayerAnalytics(InitializeEvent data)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			Analytics.SendEvent("openxr_initialize", (object)data, 1, "");
		}
	}
	public static class Constants
	{
		public const string k_SettingsKey = "com.unity.xr.openxr.settings4";
	}
	internal class DiagnosticReport
	{
		private const string LibraryName = "UnityOpenXR";

		public static readonly ulong k_NullSection;

		[DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_StartReport")]
		public static extern void StartReport();

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_GetSection")]
		public static extern ulong GetSection(string sectionName);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_AddSectionEntry")]
		public static extern void AddSectionEntry(ulong sectionHandle, string sectionEntry, string sectionBody);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_AddSectionBreak")]
		public static extern void AddSectionBreak(ulong sectionHandle);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "DiagnosticReport_AddEventEntry")]
		public static extern void AddEventEntry(string eventName, string eventData);

		[DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_DumpReport")]
		private static extern void Internal_DumpReport();

		[DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_DumpReportWithReason")]
		private static extern void Internal_DumpReport(string reason);

		[DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_GenerateReport")]
		private static extern IntPtr Internal_GenerateReport();

		[DllImport("UnityOpenXR", EntryPoint = "DiagnosticReport_ReleaseReport")]
		private static extern void Internal_ReleaseReport(IntPtr report);

		internal static string GenerateReport()
		{
			string result = "";
			IntPtr intPtr = Internal_GenerateReport();
			if (intPtr != IntPtr.Zero)
			{
				result = Marshal.PtrToStringAnsi(intPtr);
				Internal_ReleaseReport(intPtr);
				intPtr = IntPtr.Zero;
			}
			return result;
		}

		public static void DumpReport(string reason)
		{
			Internal_DumpReport(reason);
		}
	}
	public class OpenXRLoader : OpenXRLoaderBase
	{
	}
	public class OpenXRLoaderBase : XRLoaderHelper
	{
		internal enum LoaderState
		{
			Uninitialized,
			InitializeAttempted,
			Initialized,
			StartAttempted,
			Started,
			StopAttempted,
			Stopped,
			DeinitializeAttempted
		}

		internal delegate void ReceiveNativeEventDelegate(OpenXRFeature.NativeEvent e, ulong payload);

		private const double k_IdlePollingWaitTimeInSeconds = 0.1;

		private static List<XRDisplaySubsystemDescriptor> s_DisplaySubsystemDescriptors = new List<XRDisplaySubsystemDescriptor>();

		private static List<XRInputSubsystemDescriptor> s_InputSubsystemDescriptors = new List<XRInputSubsystemDescriptor>();

		private List<LoaderState> validLoaderInitStates = new List<LoaderState>
		{
			LoaderState.Uninitialized,
			LoaderState.InitializeAttempted
		};

		private List<LoaderState> validLoaderStartStates = new List<LoaderState>
		{
			LoaderState.Initialized,
			LoaderState.StartAttempted,
			LoaderState.Stopped
		};

		private List<LoaderState> validLoaderStopStates = new List<LoaderState>
		{
			LoaderState.StartAttempted,
			LoaderState.Started,
			LoaderState.StopAttempted
		};

		private List<LoaderState> validLoaderDeinitStates = new List<LoaderState>
		{
			LoaderState.InitializeAttempted,
			LoaderState.Initialized,
			LoaderState.Stopped,
			LoaderState.DeinitializeAttempted
		};

		private List<LoaderState> runningStates = new List<LoaderState>
		{
			LoaderState.Initialized,
			LoaderState.StartAttempted,
			LoaderState.Started
		};

		private OpenXRFeature.NativeEvent currentOpenXRState;

		private bool actionSetsAttached;

		private UnhandledExceptionEventHandler unhandledExceptionHandler;

		internal bool DisableValidationChecksOnEnteringPlaymode;

		private double lastPollCheckTime;

		private const string LibraryName = "UnityOpenXR";

		internal static OpenXRLoaderBase Instance { get; private set; }

		internal LoaderState currentLoaderState { get; private set; }

		internal XRDisplaySubsystem displaySubsystem => ((XRLoaderHelper)this).GetLoadedSubsystem<XRDisplaySubsystem>();

		internal XRInputSubsystem inputSubsystem
		{
			get
			{
				OpenXRLoaderBase instance = Instance;
				if (instance == null)
				{
					return null;
				}
				return ((XRLoaderHelper)instance).GetLoadedSubsystem<XRInputSubsystem>();
			}
		}

		private bool isInitialized
		{
			get
			{
				if (currentLoaderState != 0)
				{
					return currentLoaderState != LoaderState.DeinitializeAttempted;
				}
				return false;
			}
		}

		private bool isStarted => runningStates.Contains(currentLoaderState);

		private static void ExceptionHandler(object sender, UnhandledExceptionEventArgs args)
		{
			ulong section = DiagnosticReport.GetSection("Unhandled Exception Report");
			DiagnosticReport.AddSectionEntry(section, "Is Terminating", $"{args.IsTerminating}");
			Exception ex = (Exception)args.ExceptionObject;
			DiagnosticReport.AddSectionEntry(section, "Message", ex.Message ?? "");
			DiagnosticReport.AddSectionEntry(section, "Source", ex.Source ?? "");
			DiagnosticReport.AddSectionEntry(section, "Stack Trace", "\n" + ex.StackTrace);
			DiagnosticReport.DumpReport("Uncaught Exception");
		}

		public override bool Initialize()
		{
			if (currentLoaderState == LoaderState.Initialized)
			{
				return true;
			}
			if (!validLoaderInitStates.Contains(currentLoaderState))
			{
				return false;
			}
			if ((Object)(object)Instance != (Object)null)
			{
				Debug.LogError((object)"Only one OpenXRLoader can be initialized at any given time");
				return false;
			}
			DiagnosticReport.StartReport();
			try
			{
				if (InitializeInternal())
				{
					return true;
				}
			}
			catch (Exception ex)
			{
				Debug.LogException(ex);
			}
			((XRLoader)this).Deinitialize();
			Instance = null;
			OpenXRAnalytics.SendInitializeEvent(success: false);
			return false;
		}

		private bool InitializeInternal()
		{
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Expected O, but got Unknown
			Instance = this;
			currentLoaderState = LoaderState.InitializeAttempted;
			Internal_SetSuccessfullyInitialized(value: false);
			OpenXRInput.RegisterLayouts();
			OpenXRFeature.Initialize();
			if (!LoadOpenXRSymbols())
			{
				Debug.LogError((object)"Failed to load openxr runtime loader.");
				return false;
			}
			OpenXRSettings.Instance.features = (from f in OpenXRSettings.Instance.features
				where (Object)(object)f != (Object)null
				orderby f.priority descending, f.nameUi
				select f).ToArray();
			OpenXRFeature.HookGetInstanceProcAddr();
			if (!Internal_InitializeSession())
			{
				return false;
			}
			SetApplicationInfo();
			RequestOpenXRFeatures();
			RegisterOpenXRCallbacks();
			if ((Object)null != (Object)(object)OpenXRSettings.Instance)
			{
				OpenXRSettings.Instance.ApplySettings();
			}
			if (!CreateSubsystems())
			{
				return false;
			}
			if (OpenXRFeature.requiredFeatureFailed)
			{
				return false;
			}
			OpenXRAnalytics.SendInitializeEvent(success: true);
			OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemCreate);
			DebugLogEnabledSpecExtensions();
			Application.onBeforeRender += new UnityAction(ProcessOpenXRMessageLoop);
			currentLoaderState = LoaderState.Initialized;
			return true;
		}

		private bool CreateSubsystems()
		{
			if (displaySubsystem == null)
			{
				this.CreateSubsystem<XRDisplaySubsystemDescriptor, XRDisplaySubsystem>(s_DisplaySubsystemDescriptors, "OpenXR Display");
				if (displaySubsystem == null)
				{
					return false;
				}
			}
			if (inputSubsystem == null)
			{
				this.CreateSubsystem<XRInputSubsystemDescriptor, XRInputSubsystem>(s_InputSubsystemDescriptors, "OpenXR Input");
				if (inputSubsystem == null)
				{
					return false;
				}
			}
			return true;
		}

		internal void ProcessOpenXRMessageLoop()
		{
			if (currentOpenXRState == OpenXRFeature.NativeEvent.XrIdle || currentOpenXRState == OpenXRFeature.NativeEvent.XrStopping || currentOpenXRState == OpenXRFeature.NativeEvent.XrExiting || currentOpenXRState == OpenXRFeature.NativeEvent.XrLossPending || currentOpenXRState == OpenXRFeature.NativeEvent.XrInstanceLossPending)
			{
				float realtimeSinceStartup = Time.realtimeSinceStartup;
				if ((double)realtimeSinceStartup - lastPollCheckTime < 0.1)
				{
					return;
				}
				lastPollCheckTime = realtimeSinceStartup;
			}
			Internal_PumpMessageLoop();
		}

		public override bool Start()
		{
			if (currentLoaderState == LoaderState.Started)
			{
				return true;
			}
			if (!validLoaderStartStates.Contains(currentLoaderState))
			{
				return false;
			}
			currentLoaderState = LoaderState.StartAttempted;
			if (!StartInternal())
			{
				((XRLoader)this).Stop();
				return false;
			}
			currentLoaderState = LoaderState.Started;
			return true;
		}

		private bool StartInternal()
		{
			if (!Internal_CreateSessionIfNeeded())
			{
				return false;
			}
			if (currentOpenXRState != OpenXRFeature.NativeEvent.XrReady || (currentLoaderState != LoaderState.StartAttempted && currentLoaderState != LoaderState.Started))
			{
				return true;
			}
			this.StartSubsystem<XRDisplaySubsystem>();
			XRDisplaySubsystem obj = displaySubsystem;
			if (obj != null && !((IntegratedSubsystem)obj).running)
			{
				return false;
			}
			Internal_BeginSession();
			if (!actionSetsAttached)
			{
				OpenXRInput.AttachActionSets();
				actionSetsAttached = true;
			}
			XRDisplaySubsystem obj2 = displaySubsystem;
			if (obj2 != null && !((IntegratedSubsystem)obj2).running)
			{
				this.StartSubsystem<XRDisplaySubsystem>();
			}
			XRInputSubsystem obj3 = inputSubsystem;
			if (obj3 != null && !((IntegratedSubsystem)obj3).running)
			{
				this.StartSubsystem<XRInputSubsystem>();
			}
			XRInputSubsystem obj4 = inputSubsystem;
			bool num = obj4 != null && ((IntegratedSubsystem)obj4).running;
			XRDisplaySubsystem obj5 = displaySubsystem;
			bool flag = obj5 != null && ((IntegratedSubsystem)obj5).running;
			if (num && flag)
			{
				OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemStart);
				return true;
			}
			return false;
		}

		public override bool Stop()
		{
			if (currentLoaderState == LoaderState.Stopped)
			{
				return true;
			}
			if (!validLoaderStopStates.Contains(currentLoaderState))
			{
				return false;
			}
			currentLoaderState = LoaderState.StopAttempted;
			XRInputSubsystem obj = inputSubsystem;
			bool num = obj != null && ((IntegratedSubsystem)obj).running;
			XRDisplaySubsystem obj2 = displaySubsystem;
			bool flag = obj2 != null && ((IntegratedSubsystem)obj2).running;
			if (num || flag)
			{
				OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemStop);
			}
			if (num)
			{
				this.StopSubsystem<XRInputSubsystem>();
			}
			if (flag)
			{
				this.StopSubsystem<XRDisplaySubsystem>();
			}
			StopInternal();
			currentLoaderState = LoaderState.Stopped;
			return true;
		}

		private void StopInternal()
		{
			Internal_EndSession();
			ProcessOpenXRMessageLoop();
		}

		public override bool Deinitialize()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			if (currentLoaderState == LoaderState.Uninitialized)
			{
				return true;
			}
			if (!validLoaderDeinitStates.Contains(currentLoaderState))
			{
				return false;
			}
			currentLoaderState = LoaderState.DeinitializeAttempted;
			try
			{
				Internal_RequestExitSession();
				Application.onBeforeRender -= new UnityAction(ProcessOpenXRMessageLoop);
				ProcessOpenXRMessageLoop();
				OpenXRFeature.ReceiveLoaderEvent(this, OpenXRFeature.LoaderEvent.SubsystemDestroy);
				this.DestroySubsystem<XRInputSubsystem>();
				this.DestroySubsystem<XRDisplaySubsystem>();
				DiagnosticReport.DumpReport("System Shutdown");
				Internal_DestroySession();
				ProcessOpenXRMessageLoop();
				Internal_UnloadOpenXRLibrary();
				currentLoaderState = LoaderState.Uninitialized;
				actionSetsAttached = false;
				if (unhandledExceptionHandler != null)
				{
					AppDomain.CurrentDomain.UnhandledException -= unhandledExceptionHandler;
					unhandledExceptionHandler = null;
				}
				return ((XRLoaderHelper)this).Deinitialize();
			}
			finally
			{
				Instance = null;
			}
		}

		internal void CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem
		{
			((XRLoaderHelper)this).CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id);
		}

		internal void StartSubsystem<T>() where T : class, ISubsystem
		{
			((XRLoaderHelper)this).StartSubsystem<T>();
		}

		internal void StopSubsystem<T>() where T : class, ISubsystem
		{
			((XRLoaderHelper)this).StopSubsystem<T>();
		}

		internal void DestroySubsystem<T>() where T : class, ISubsystem
		{
			((XRLoaderHelper)this).DestroySubsystem<T>();
		}

		private void SetApplicationInfo()
		{
			byte[] array = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(Application.version));
			if (BitConverter.IsLittleEndian)
			{
				Array.Reverse(array);
			}
			uint applicationVersionHash = BitConverter.ToUInt32(array, 0);
			Internal_SetApplicationInfo(Application.productName, Application.version, applicationVersionHash, Application.unityVersion);
		}

		internal static byte[] StringToWCHAR_T(string s)
		{
			return ((Environment.OSVersion.Platform == PlatformID.Unix) ? Encoding.UTF32 : Encoding.Unicode).GetBytes(s + "\0");
		}

		private bool LoadOpenXRSymbols()
		{
			if (!Internal_LoadOpenXRLibrary(StringToWCHAR_T("openxr_loader")))
			{
				return false;
			}
			return true;
		}

		private void RequestOpenXRFeatures()
		{
			OpenXRSettings instance = OpenXRSettings.Instance;
			if ((Object)(object)instance == (Object)null || instance.features == null)
			{
				return;
			}
			StringBuilder stringBuilder = new StringBuilder("");
			StringBuilder stringBuilder2 = new StringBuilder("");
			uint num = 0u;
			uint num2 = 0u;
			OpenXRFeature[] features = instance.features;
			foreach (OpenXRFeature openXRFeature in features)
			{
				if ((Object)(object)openXRFeature == (Object)null || !openXRFeature.enabled)
				{
					continue;
				}
				num++;
				stringBuilder.Append("  " + openXRFeature.nameUi + ": Version=" + openXRFeature.version + ", Company=\"" + openXRFeature.company + "\"");
				if (!string.IsNullOrEmpty(openXRFeature.openxrExtensionStrings))
				{
					stringBuilder.Append(", Extensions=\"" + openXRFeature.openxrExtensionStrings + "\"");
					string[] array = openXRFeature.openxrExtensionStrings.Split(' ');
					foreach (string text in array)
					{
						if (!string.IsNullOrWhiteSpace(text) && !Internal_RequestEnableExtensionString(text))
						{
							num2++;
							stringBuilder2.Append("  " + text + ": Feature=\"" + openXRFeature.nameUi + "\": Version=" + openXRFeature.version + ", Company=\"" + openXRFeature.company + "\"\n");
						}
					}
				}
				stringBuilder.Append("\n");
			}
			ulong section = DiagnosticReport.GetSection("OpenXR Runtime Info");
			DiagnosticReport.AddSectionBreak(section);
			DiagnosticReport.AddSectionEntry(section, "Features requested to be enabled", $"({num})\n{stringBuilder.ToString()}");
			DiagnosticReport.AddSectionBreak(section);
			DiagnosticReport.AddSectionEntry(section, "Requested feature extensions not supported by runtime", $"({num2})\n{stringBuilder2.ToString()}");
		}

		private static void DebugLogEnabledSpecExtensions()
		{
			ulong section = DiagnosticReport.GetSection("OpenXR Runtime Info");
			DiagnosticReport.AddSectionBreak(section);
			string[] enabledExtensions = OpenXRRuntime.GetEnabledExtensions();
			StringBuilder stringBuilder = new StringBuilder($"({enabledExtensions.Length})\n");
			string[] array = enabledExtensions;
			foreach (string text in array)
			{
				stringBuilder.Append($"  {text}: Version={OpenXRRuntime.GetExtensionVersion(text)}\n");
			}
			DiagnosticReport.AddSectionEntry(section, "Runtime extensions enabled", stringBuilder.ToString());
		}

		[MonoPInvokeCallback(typeof(ReceiveNativeEventDelegate))]
		private static void ReceiveNativeEvent(OpenXRFeature.NativeEvent e, ulong payload)
		{
			OpenXRLoaderBase instance = Instance;
			if ((Object)(object)instance != (Object)null)
			{
				instance.currentOpenXRState = e;
			}
			switch (e)
			{
			case OpenXRFeature.NativeEvent.XrRestartRequested:
				OpenXRRestarter.Instance.ShutdownAndRestart();
				break;
			case OpenXRFeature.NativeEvent.XrReady:
				instance.StartInternal();
				break;
			case OpenXRFeature.NativeEvent.XrFocused:
				DiagnosticReport.DumpReport("System Startup Completed");
				break;
			case OpenXRFeature.NativeEvent.XrRequestRestartLoop:
				Debug.Log((object)"XR Initialization failed, will try to restart xr periodically.");
				OpenXRRestarter.Instance.PauseAndShutdownAndRestart();
				break;
			case OpenXRFeature.NativeEvent.XrRequestGetSystemLoop:
				OpenXRRestarter.Instance.PauseAndRetryInitialization();
				break;
			case OpenXRFeature.NativeEvent.XrStopping:
				instance.StopInternal();
				break;
			}
			OpenXRFeature.ReceiveNativeEvent(e, payload);
			if ((!((Object)(object)instance == (Object)null) && instance.isStarted) || e == OpenXRFeature.NativeEvent.XrInstanceChanged)
			{
				switch (e)
				{
				case OpenXRFeature.NativeEvent.XrExiting:
					OpenXRRestarter.Instance.Shutdown();
					break;
				case OpenXRFeature.NativeEvent.XrLossPending:
					OpenXRRestarter.Instance.ShutdownAndRestart();
					break;
				case OpenXRFeature.NativeEvent.XrInstanceLossPending:
					OpenXRRestarter.Instance.Shutdown();
					break;
				}
			}
		}

		internal static void RegisterOpenXRCallbacks()
		{
			Internal_SetCallbacks(ReceiveNativeEvent);
		}

		[DllImport("UnityOpenXR", EntryPoint = "main_LoadOpenXRLibrary")]
		[return: MarshalAs(UnmanagedType.U1)]
		internal static extern bool Internal_LoadOpenXRLibrary(byte[] loaderPath);

		[DllImport("UnityOpenXR", EntryPoint = "main_UnloadOpenXRLibrary")]
		internal static extern void Internal_UnloadOpenXRLibrary();

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetCallbacks")]
		private static extern void Internal_SetCallbacks(ReceiveNativeEventDelegate callback);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "NativeConfig_SetApplicationInfo")]
		private static extern void Internal_SetApplicationInfo(string applicationName, string applicationVersion, uint applicationVersionHash, string engineVersion);

		[DllImport("UnityOpenXR", EntryPoint = "session_RequestExitSession")]
		internal static extern void Internal_RequestExitSession();

		[DllImport("UnityOpenXR", EntryPoint = "session_InitializeSession")]
		[return: MarshalAs(UnmanagedType.U1)]
		internal static extern bool Internal_InitializeSession();

		[DllImport("UnityOpenXR", EntryPoint = "session_CreateSessionIfNeeded")]
		[return: MarshalAs(UnmanagedType.U1)]
		internal static extern bool Internal_CreateSessionIfNeeded();

		[DllImport("UnityOpenXR", EntryPoint = "session_BeginSession")]
		internal static extern void Internal_BeginSession();

		[DllImport("UnityOpenXR", EntryPoint = "session_EndSession")]
		internal static extern void Internal_EndSession();

		[DllImport("UnityOpenXR", EntryPoint = "session_DestroySession")]
		internal static extern void Internal_DestroySession();

		[DllImport("UnityOpenXR", EntryPoint = "messagepump_PumpMessageLoop")]
		private static extern void Internal_PumpMessageLoop();

		[DllImport("UnityOpenXR", EntryPoint = "session_SetSuccessfullyInitialized")]
		internal static extern void Internal_SetSuccessfullyInitialized(bool value);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_RequestEnableExtensionString")]
		[return: MarshalAs(UnmanagedType.U1)]
		internal static extern bool Internal_RequestEnableExtensionString(string extensionString);
	}
	public class OpenXRLoaderNoPreInit : OpenXRLoaderBase
	{
	}
	internal class OpenXRRestarter : MonoBehaviour
	{
		internal Action onAfterRestart;

		internal Action onAfterShutdown;

		internal Action onQuit;

		internal Action onAfterCoroutine;

		internal Action onAfterSuccessfulRestart;

		private static OpenXRRestarter s_Instance;

		private Coroutine m_Coroutine;

		private static int m_pauseAndRestartAttempts;

		public bool isRunning => m_Coroutine != null;

		public static float TimeBetweenRestartAttempts { get; set; }

		public static int PauseAndRestartAttempts => m_pauseAndRestartAttempts;

		public static OpenXRRestarter Instance
		{
			get
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Expected O, but got Unknown
				if ((Object)(object)s_Instance == (Object)null)
				{
					GameObject val = GameObject.Find("~oxrestarter");
					if ((Object)(object)val == (Object)null)
					{
						val = new GameObject("~oxrestarter");
						((Object)val).hideFlags = (HideFlags)61;
						val.AddComponent<OpenXRRestarter>();
					}
					s_Instance = val.GetComponent<OpenXRRestarter>();
				}
				return s_Instance;
			}
		}

		static OpenXRRestarter()
		{
			TimeBetweenRestartAttempts = 5f;
		}

		public void ResetCallbacks()
		{
			onAfterRestart = null;
			onAfterSuccessfulRestart = null;
			onAfterShutdown = null;
			onAfterCoroutine = null;
			onQuit = null;
			m_pauseAndRestartAttempts = 0;
		}

		public void Shutdown()
		{
			if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null))
			{
				if (m_Coroutine != null)
				{
					Debug.LogError((object)"Only one shutdown or restart can be executed at a time");
				}
				else
				{
					m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: false, shouldShutdown: true));
				}
			}
		}

		public void ShutdownAndRestart()
		{
			if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null))
			{
				if (m_Coroutine != null)
				{
					Debug.LogError((object)"Only one shutdown or restart can be executed at a time");
				}
				else
				{
					m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: true, shouldShutdown: true));
				}
			}
		}

		public void PauseAndShutdownAndRestart()
		{
			if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null))
			{
				((MonoBehaviour)this).StartCoroutine(PauseAndShutdownAndRestartCoroutine(TimeBetweenRestartAttempts));
			}
		}

		public void PauseAndRetryInitialization()
		{
			if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null))
			{
				((MonoBehaviour)this).StartCoroutine(PauseAndRetryInitializationCoroutine(TimeBetweenRestartAttempts));
			}
		}

		public IEnumerator PauseAndShutdownAndRestartCoroutine(float pauseTimeInSeconds)
		{
			try
			{
				yield return (object)new WaitForSeconds(pauseTimeInSeconds);
				yield return new WaitForRestartFinish();
				m_pauseAndRestartAttempts++;
				m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: true, shouldShutdown: true));
			}
			finally
			{
				onAfterCoroutine?.Invoke();
			}
		}

		public IEnumerator PauseAndRetryInitializationCoroutine(float pauseTimeInSeconds)
		{
			try
			{
				yield return (object)new WaitForSeconds(pauseTimeInSeconds);
				yield return new WaitForRestartFinish();
				if (!((Object)(object)XRGeneralSettings.Instance.Manager.activeLoader != (Object)null))
				{
					m_pauseAndRestartAttempts++;
					m_Coroutine = ((MonoBehaviour)this).StartCoroutine(RestartCoroutine(shouldRestart: true, shouldShutdown: false));
				}
			}
			finally
			{
				onAfterCoroutine?.Invoke();
			}
		}

		private IEnumerator RestartCoroutine(bool shouldRestart, bool shouldShutdown)
		{
			try
			{
				if (shouldShutdown)
				{
					Debug.Log((object)"Shutting down OpenXR.");
					yield return null;
					XRGeneralSettings.Instance.Manager.DeinitializeLoader();
					yield return null;
					onAfterShutdown?.Invoke();
				}
				if (shouldRestart && OpenXRRuntime.ShouldRestart())
				{
					Debug.Log((object)"Initializing OpenXR.");
					yield return XRGeneralSettings.Instance.Manager.InitializeLoader();
					XRGeneralSettings.Instance.Manager.StartSubsystems();
					if ((Object)(object)XRGeneralSettings.Instance.Manager.activeLoader != (Object)null)
					{
						m_pauseAndRestartAttempts = 0;
						onAfterSuccessfulRestart?.Invoke();
					}
					onAfterRestart?.Invoke();
				}
				else if (OpenXRRuntime.ShouldQuit())
				{
					onQuit?.Invoke();
					Application.Quit();
				}
			}
			finally
			{
				OpenXRRestarter openXRRestarter = this;
				openXRRestarter.m_Coroutine = null;
				openXRRestarter.onAfterCoroutine?.Invoke();
			}
		}
	}
	public static class OpenXRRuntime
	{
		private const string LibraryName = "UnityOpenXR";

		public static string name
		{
			get
			{
				if (!Internal_GetRuntimeName(out var runtimeNamePtr))
				{
					return "";
				}
				return Marshal.PtrToStringAnsi(runtimeNamePtr);
			}
		}

		public static string version
		{
			get
			{
				if (!Internal_GetRuntimeVersion(out var major, out var minor, out var patch))
				{
					return "";
				}
				return $"{major}.{minor}.{patch}";
			}
		}

		public static string apiVersion
		{
			get
			{
				if (!Internal_GetAPIVersion(out var major, out var minor, out var patch))
				{
					return "";
				}
				return $"{major}.{minor}.{patch}";
			}
		}

		public static string pluginVersion
		{
			get
			{
				if (!Internal_GetPluginVersion(out var pluginVersionPtr))
				{
					return "";
				}
				return Marshal.PtrToStringAnsi(pluginVersionPtr);
			}
		}

		public static bool retryInitializationOnFormFactorErrors
		{
			get
			{
				return Internal_GetSoftRestartLoopAtInitialization();
			}
			set
			{
				Internal_SetSoftRestartLoopAtInitialization(value);
			}
		}

		public static event Func<bool> wantsToQuit;

		public static event Func<bool> wantsToRestart;

		public static bool IsExtensionEnabled(string extensionName)
		{
			return Internal_IsExtensionEnabled(extensionName);
		}

		public static uint GetExtensionVersion(string extensionName)
		{
			return Internal_GetExtensionVersion(extensionName);
		}

		public static string[] GetEnabledExtensions()
		{
			string[] array = new string[Internal_GetEnabledExtensionCount()];
			for (int i = 0; i < array.Length; i++)
			{
				Internal_GetEnabledExtensionName((uint)i, out var extensionName);
				array[i] = extensionName ?? "";
			}
			return array;
		}

		public static string[] GetAvailableExtensions()
		{
			string[] array = new string[Internal_GetAvailableExtensionCount()];
			for (int i = 0; i < array.Length; i++)
			{
				Internal_GetAvailableExtensionName((uint)i, out var extensionName);
				array[i] = extensionName ?? "";
			}
			return array;
		}

		private static bool InvokeEvent(Func<bool> func)
		{
			if (func == null)
			{
				return true;
			}
			Delegate[] invocationList = func.GetInvocationList();
			for (int i = 0; i < invocationList.Length; i++)
			{
				Func<bool> func2 = (Func<bool>)invocationList[i];
				try
				{
					if (!func2())
					{
						return false;
					}
				}
				catch (Exception ex)
				{
					Debug.LogException(ex);
				}
			}
			return true;
		}

		internal static bool ShouldQuit()
		{
			return InvokeEvent(OpenXRRuntime.wantsToQuit);
		}

		internal static bool ShouldRestart()
		{
			return InvokeEvent(OpenXRRuntime.wantsToRestart);
		}

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRuntimeName")]
		private static extern bool Internal_GetRuntimeName(out IntPtr runtimeNamePtr);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetRuntimeVersion")]
		private static extern bool Internal_GetRuntimeVersion(out ushort major, out ushort minor, out uint patch);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetAPIVersion")]
		private static extern bool Internal_GetAPIVersion(out ushort major, out ushort minor, out uint patch);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetPluginVersion")]
		private static extern bool Internal_GetPluginVersion(out IntPtr pluginVersionPtr);

		[DllImport("UnityOpenXR", EntryPoint = "unity_ext_IsExtensionEnabled")]
		private static extern bool Internal_IsExtensionEnabled(string extensionName);

		[DllImport("UnityOpenXR", EntryPoint = "unity_ext_GetExtensionVersion")]
		private static extern uint Internal_GetExtensionVersion(string extensionName);

		[DllImport("UnityOpenXR", EntryPoint = "unity_ext_GetEnabledExtensionCount")]
		private static extern uint Internal_GetEnabledExtensionCount();

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_GetEnabledExtensionName")]
		private static extern bool Internal_GetEnabledExtensionNamePtr(uint index, out IntPtr outName);

		[DllImport("UnityOpenXR", EntryPoint = "session_SetSoftRestartLoopAtInitialization")]
		private static extern void Internal_SetSoftRestartLoopAtInitialization(bool value);

		[DllImport("UnityOpenXR", EntryPoint = "session_GetSoftRestartLoopAtInitialization")]
		private static extern bool Internal_GetSoftRestartLoopAtInitialization();

		private static bool Internal_GetEnabledExtensionName(uint index, out string extensionName)
		{
			if (!Internal_GetEnabledExtensionNamePtr(index, out var outName))
			{
				extensionName = "";
				return false;
			}
			extensionName = Marshal.PtrToStringAnsi(outName);
			return true;
		}

		[DllImport("UnityOpenXR", EntryPoint = "unity_ext_GetAvailableExtensionCount")]
		private static extern uint Internal_GetAvailableExtensionCount();

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "unity_ext_GetAvailableExtensionName")]
		private static extern bool Internal_GetAvailableExtensionNamePtr(uint index, out IntPtr extensionName);

		private static bool Internal_GetAvailableExtensionName(uint index, out string extensionName)
		{
			if (!Internal_GetAvailableExtensionNamePtr(index, out var extensionName2))
			{
				extensionName = "";
				return false;
			}
			extensionName = Marshal.PtrToStringAnsi(extensionName2);
			return true;
		}

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "session_GetLastError")]
		private static extern bool Internal_GetLastError(out IntPtr error);

		internal static bool GetLastError(out string error)
		{
			if (!Internal_GetLastError(out var error2))
			{
				error = "";
				return false;
			}
			error = Marshal.PtrToStringAnsi(error2);
			return true;
		}

		internal static void LogLastError()
		{
			if (GetLastError(out var error))
			{
				Debug.LogError((object)error);
			}
		}
	}
	internal sealed class WaitForRestartFinish : CustomYieldInstruction
	{
		private float m_Timeout;

		public override bool keepWaiting
		{
			get
			{
				if (!OpenXRRestarter.Instance.isRunning)
				{
					return false;
				}
				if (Time.realtimeSinceStartup > m_Timeout)
				{
					Debug.LogError((object)"WaitForRestartFinish: Timeout");
					return false;
				}
				return true;
			}
		}

		public WaitForRestartFinish(float timeout = 5f)
		{
			m_Timeout = Time.realtimeSinceStartup + timeout;
		}
	}
}
namespace UnityEngine.XR.OpenXR.NativeTypes
{
	public enum XrEnvironmentBlendMode
	{
		Opaque = 1,
		Additive,
		AlphaBlend
	}
	internal enum XrResult
	{
		Success = 0,
		TimeoutExpored = 1,
		LossPending = 3,
		EventUnavailable = 4,
		SpaceBoundsUnavailable = 7,
		SessionNotFocused = 8,
		FrameDiscarded = 9,
		ValidationFailure = -1,
		RuntimeFailure = -2,
		OutOfMemory = -3,
		ApiVersionUnsupported = -4,
		InitializationFailed = -6,
		FunctionUnsupported = -7,
		FeatureUnsupported = -8,
		ExtensionNotPresent = -9,
		LimitReached = -10,
		SizeInsufficient = -11,
		HandleInvalid = -12,
		InstanceLOst = -13,
		SessionRunning = -14,
		SessionNotRunning = -16,
		SessionLost = -17,
		SystemInvalid = -18,
		PathInvalid = -19,
		PathCountExceeded = -20,
		PathFormatInvalid = -21,
		PathUnsupported = -22,
		LayerInvalid = -23,
		LayerLimitExceeded = -24,
		SpwachainRectInvalid = -25,
		SwapchainFormatUnsupported = -26,
		ActionTypeMismatch = -27,
		SessionNotReady = -28,
		SessionNotStopping = -29,
		TimeInvalid = -30,
		ReferenceSpaceUnsupported = -31,
		FileAccessError = -32,
		FileContentsInvalid = -33,
		FormFactorUnsupported = -34,
		FormFactorUnavailable = -35,
		ApiLayerNotPresent = -36,
		CallOrderInvalid = -37,
		GraphicsDeviceInvalid = -38,
		PoseInvalid = -39,
		IndexOutOfRange = -40,
		ViewConfigurationTypeUnsupported = -41,
		EnvironmentBlendModeUnsupported = -42,
		NameDuplicated = -44,
		NameInvalid = -45,
		ActionsetNotAttached = -46,
		ActionsetsAlreadyAttached = -47,
		LocalizedNameDuplicated = -48,
		LocalizedNameInvalid = -49,
		AndroidThreadSettingsIdInvalidKHR = -1000003000,
		AndroidThreadSettingsdFailureKHR = -1000003001,
		CreateSpatialAnchorFailedMSFT = -1000039001,
		SecondaryViewConfigurationTypeNotEnabledMSFT = -1000053000,
		MaxResult = int.MaxValue
	}
	internal enum XrViewConfigurationType
	{
		PrimaryMono = 1,
		PrimaryStereo = 2,
		PrimaryQuadVarjo = 1000037000,
		SecondaryMonoFirstPersonObserver = 1000054000,
		SecondaryMonoThirdPersonObserver = 1000145000
	}
	[Flags]
	internal enum XrSpaceLocationFlags
	{
		None = 0,
		OrientationValid = 1,
		PositionValid = 2,
		OrientationTracked = 4,
		PositionTracked = 8
	}
	[Flags]
	internal enum XrViewStateFlags
	{
		None = 0,
		OrientationValid = 1,
		PositionValid = 2,
		OrientationTracked = 4,
		PositionTracked = 8
	}
	[Flags]
	internal enum XrReferenceSpaceType
	{
		View = 1,
		Local = 2,
		Stage = 3,
		UnboundedMsft = 0x3B9B5E70,
		CombinedEyeVarjo = 0x3B9CA2A8
	}
	internal enum XrSessionState
	{
		Unknown,
		Idle,
		Ready,
		Synchronized,
		Visible,
		Focused,
		Stopping,
		LossPending,
		Exiting
	}
	internal struct XrVector2f
	{
		private float x;

		private float y;

		public XrVector2f(float x, float y)
		{
			this.x = x;
			this.y = y;
		}

		public XrVector2f(Vector2 value)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			x = value.x;
			y = value.y;
		}
	}
	internal struct XrVector3f
	{
		private float x;

		private float y;

		private float z;

		public XrVector3f(float x, float y, float z)
		{
			this.x = x;
			this.y = y;
			this.z = 0f - z;
		}

		public XrVector3f(Vector3 value)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			x = value.x;
			y = value.y;
			z = 0f - value.z;
		}
	}
	internal struct XrQuaternionf
	{
		private float x;

		private float y;

		private float z;

		private float w;

		public XrQuaternionf(float x, float y, float z, float w)
		{
			this.x = 0f - x;
			this.y = 0f - y;
			this.z = z;
			this.w = w;
		}

		public XrQuaternionf(Quaternion quaternion)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			x = 0f - quaternion.x;
			y = 0f - quaternion.y;
			z = quaternion.z;
			w = quaternion.w;
		}
	}
	internal struct XrPosef
	{
		private XrQuaternionf orientation;

		private XrVector3f position;

		public XrPosef(Vector3 vec3, Quaternion quaternion)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			position = new XrVector3f(vec3);
			orientation = new XrQuaternionf(quaternion);
		}
	}
}
namespace UnityEngine.XR.OpenXR.Input
{
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	public struct Haptic
	{
	}
	[Preserve]
	public class HapticControl : InputControl<Haptic>
	{
		public HapticControl()
		{
			((InputStateBlock)(ref ((InputControl)this).m_StateBlock)).sizeInBits = 1u;
			((InputStateBlock)(ref ((InputControl)this).m_StateBlock)).bitOffset = 0u;
			((InputStateBlock)(ref ((InputControl)this).m_StateBlock)).byteOffset = 0u;
		}

		public unsafe override Haptic ReadUnprocessedValueFromState(void* statePtr)
		{
			return default(Haptic);
		}
	}
	[Preserve]
	[InputControlLayout(displayName = "OpenXR Action Map")]
	public abstract class OpenXRDevice : InputDevice
	{
		protected override void FinishSetup()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			((InputControl)this).FinishSetup();
			InputDeviceDescription description = ((InputDevice)this).description;
			XRDeviceDescriptor val = XRDeviceDescriptor.FromJson(((InputDeviceDescription)(ref description)).capabilities);
			if (val != null)
			{
				if ((val.characteristics & 0x100) != 0)
				{
					InputSystem.SetDeviceUsage((InputDevice)(object)this, CommonUsages.LeftHand);
				}
				else if ((val.characteristics & 0x200) != 0)
				{
					InputSystem.SetDeviceUsage((InputDevice)(object)this, CommonUsages.RightHand);
				}
			}
		}
	}
	[Preserve]
	[InputControlLayout(displayName = "OpenXR HMD")]
	internal class OpenXRHmd : XRHMD
	{
		[Preserve]
		[InputControl]
		private ButtonControl userPresence { get; set; }

		protected override void FinishSetup()
		{
			((XRHMD)this).FinishSetup();
			userPresence = ((InputControl)this).GetChildControl<ButtonControl>("UserPresence");
		}
	}
	public static class OpenXRInput
	{
		[StructLayout(LayoutKind.Explicit)]
		private struct SerializedGuid
		{
			[FieldOffset(0)]
			public Guid guid;

			[FieldOffset(0)]
			public ulong ulong1;

			[FieldOffset(8)]
			public ulong ulong2;
		}

		internal struct SerializedBinding
		{
			public ulong actionId;

			public string path;
		}

		[Flags]
		public enum InputSourceNameFlags
		{
			UserPath = 1,
			InteractionProfile = 2,
			Component = 4,
			All = 7
		}

		[StructLayout(LayoutKind.Explicit, Size = 12)]
		private struct GetInternalDeviceIdCommand : IInputDeviceCommandInfo
		{
			private const int k_BaseCommandSizeSize = 8;

			private const int k_Size = 12;

			[FieldOffset(0)]
			private InputDeviceCommand baseCommand;

			[FieldOffset(8)]
			public readonly uint deviceId;

			private static FourCC Type => new FourCC('X', 'R', 'D', 'I');

			public FourCC typeStatic => Type;

			public static GetInternalDeviceIdCommand Create()
			{
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				GetInternalDeviceIdCommand result = default(GetInternalDeviceIdCommand);
				result.baseCommand = new InputDeviceCommand(Type, 12);
				return result;
			}
		}

		private static readonly Dictionary<string, OpenXRInteractionFeature.ActionType> ExpectedControlTypeToActionType = new Dictionary<string, OpenXRInteractionFeature.ActionType>
		{
			["Digital"] = OpenXRInteractionFeature.ActionType.Binary,
			["Button"] = OpenXRInteractionFeature.ActionType.Binary,
			["Axis"] = OpenXRInteractionFeature.ActionType.Axis1D,
			["Integer"] = OpenXRInteractionFeature.ActionType.Axis1D,
			["Analog"] = OpenXRInteractionFeature.ActionType.Axis1D,
			["Vector2"] = OpenXRInteractionFeature.ActionType.Axis2D,
			["Dpad"] = OpenXRInteractionFeature.ActionType.Axis2D,
			["Stick"] = OpenXRInteractionFeature.ActionType.Axis2D,
			["Pose"] = OpenXRInteractionFeature.ActionType.Pose,
			["Vector3"] = OpenXRInteractionFeature.ActionType.Pose,
			["Quaternion"] = OpenXRInteractionFeature.ActionType.Pose,
			["Haptic"] = OpenXRInteractionFeature.ActionType.Vibrate
		};

		private const string s_devicePoseActionName = "devicepose";

		private const string s_pointerActionName = "pointer";

		private static readonly Dictionary<string, string> kVirtualControlMap = new Dictionary<string, string>
		{
			["deviceposition"] = "devicepose",
			["devicerotation"] = "devicepose",
			["trackingstate"] = "devicepose",
			["istracked"] = "devicepose",
			["pointerposition"] = "pointer",
			["pointerrotation"] = "pointer"
		};

		private const string Library = "UnityOpenXR";

		internal static void RegisterLayouts()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			InputSystem.RegisterLayout<HapticControl>("Haptic", (InputDeviceMatcher?)null);
			InputSystem.RegisterLayout<OpenXRDevice>((string)null, (InputDeviceMatcher?)null);
			InputDeviceMatcher val = default(InputDeviceMatcher);
			val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true);
			val = ((InputDeviceMatcher)(ref val)).WithProduct("Head Tracking - OpenXR", true);
			InputSystem.RegisterLayout<OpenXRHmd>((string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithManufacturer("OpenXR", true));
			OpenXRInteractionFeature.RegisterLayouts();
		}

		private static bool ValidateActionMapConfig(OpenXRInteractionFeature interactionFeature, OpenXRInteractionFeature.ActionMapConfig actionMapConfig)
		{
			bool result = true;
			if (actionMapConfig.deviceInfos == null || actionMapConfig.deviceInfos.Count == 0)
			{
				Debug.LogError((object)$"ActionMapConfig contains no `deviceInfos` in InteractionFeature '{((object)interactionFeature).GetType()}'");
				result = false;
			}
			if (actionMapConfig.actions == null || actionMapConfig.actions.Count == 0)
			{
				Debug.LogError((object)$"ActionMapConfig contains no `actions` in InteractionFeature '{((object)interactionFeature).GetType()}'");
				result = false;
			}
			return result;
		}

		internal static void AttachActionSets()
		{
			List<OpenXRInteractionFeature.ActionMapConfig> list = new List<OpenXRInteractionFeature.ActionMapConfig>();
			List<OpenXRInteractionFeature.ActionMapConfig> list2 = new List<OpenXRInteractionFeature.ActionMapConfig>();
			foreach (OpenXRInteractionFeature item in from f in OpenXRSettings.Instance.features.OfType<OpenXRInteractionFeature>()
				where f.enabled && !f.IsAdditive
				select f)
			{
				int count = list.Count;
				item.CreateActionMaps(list);
				for (int num = list.Count - 1; num >= count; num--)
				{
					if (!ValidateActionMapConfig(item, list[num]))
					{
						list.RemoveAt(num);
					}
				}
			}
			if (!RegisterDevices(list, isAdditive: false))
			{
				return;
			}
			foreach (OpenXRInteractionFeature item2 in from f in OpenXRSettings.Instance.features.OfType<OpenXRInteractionFeature>()
				where f.enabled && f.IsAdditive
				select f)
			{
				item2.CreateActionMaps(list2);
				item2.AddAdditiveActions(list, list2[list2.Count - 1]);
			}
			Dictionary<string, List<SerializedBinding>> dictionary = new Dictionary<string, List<SerializedBinding>>();
			if (!CreateActions(list, dictionary))
			{
				return;
			}
			if (list2.Count > 0)
			{
				RegisterDevices(list2, isAdditive: true);
				CreateActions(list2, dictionary);
			}
			SetDpadBindingCustomValues();
			foreach (KeyValuePair<string, List<SerializedBinding>> item3 in dictionary)
			{
				if (!Internal_SuggestBindings(item3.Key, item3.Value.ToArray(), (uint)item3.Value.Count))
				{
					OpenXRRuntime.LogLastError();
				}
			}
			if (!Internal_AttachActionSets())
			{
				OpenXRRuntime.LogLastError();
			}
		}

		private static bool RegisterDevices(List<OpenXRInteractionFeature.ActionMapConfig> actionMaps, bool isAdditive)
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected I4, but got Unknown
			foreach (OpenXRInteractionFeature.ActionMapConfig actionMap in actionMaps)
			{
				foreach (OpenXRInteractionFeature.DeviceConfig deviceInfo in actionMap.deviceInfos)
				{
					string name = ((actionMap.desiredInteractionProfile == null) ? UserPathToDeviceName(deviceInfo.userPath) : actionMap.localizedName);
					if (Internal_RegisterDeviceDefinition(deviceInfo.userPath, actionMap.desiredInteractionProfile, isAdditive, (uint)(int)deviceInfo.characteristics, name, actionMap.manufacturer, actionMap.serialNumber) == 0L)
					{
						OpenXRRuntime.LogLastError();
						return false;
					}
				}
			}
			return true;
		}

		private static bool CreateActions(List<OpenXRInteractionFeature.ActionMapConfig> actionMaps, Dictionary<string, List<SerializedBinding>> interactionProfiles)
		{
			foreach (OpenXRInteractionFeature.ActionMapConfig actionMap in actionMaps)
			{
				string localizedName = SanitizeStringForOpenXRPath(actionMap.localizedName);
				ulong num = Internal_CreateActionSet(SanitizeStringForOpenXRPath(actionMap.name), localizedName, default(SerializedGuid));
				if (num == 0L)
				{
					OpenXRRuntime.LogLastError();
					return false;
				}
				List<string> list = actionMap.deviceInfos.Select((OpenXRInteractionFeature.DeviceConfig d) => d.userPath).ToList();
				foreach (OpenXRInteractionFeature.ActionConfig action in actionMap.actions)
				{
					string[] array = action.bindings.Where((OpenXRInteractionFeature.ActionBinding b) => b.userPaths != null).SelectMany((OpenXRInteractionFeature.ActionBinding b) => b.userPaths).Distinct()
						.ToList()
						.Union(list)
						.ToArray();
					ulong num2 = Internal_CreateAction(num, SanitizeStringForOpenXRPath(action.name), action.localizedName, (uint)action.type, default(SerializedGuid), array, (uint)array.Length, action.isAdditive, action.usages?.ToArray(), (uint)(action.usages?.Count ?? 0));
					if (num2 == 0L)
					{
						OpenXRRuntime.LogLastError();
						return false;
					}
					foreach (OpenXRInteractionFeature.ActionBinding binding in action.bindings)
					{
						foreach (string item in binding.userPaths ?? list)
						{
							string key = (action.isAdditive ? actionMap.desiredInteractionProfile : (binding.interactionProfileName ?? actionMap.desiredInteractionProfile));
							if (!interactionProfiles.TryGetValue(key, out var value))
							{
								value = (interactionProfiles[key] = new List<SerializedBinding>());
							}
							value.Add(new SerializedBinding
							{
								actionId = num2,
								path = item + binding.interactionPath
							});
						}
					}
				}
			}
			return true;
		}

		private static void SetDpadBindingCustomValues()
		{
			DPadInteraction feature = OpenXRSettings.Instance.GetFeature<DPadInteraction>();
			if ((Object)(object)feature != (Object)null && feature.enabled)
			{
				Internal_SetDpadBindingCustomValues(isLeft: true, feature.forceThresholdLeft, feature.forceThresholdReleaseLeft, feature.centerRegionLeft, feature.wedgeAngleLeft, feature.isStickyLeft);
				Internal_SetDpadBindingCustomValues(isLeft: false, feature.forceThresholdRight, feature.forceThresholdReleaseRight, feature.centerRegionRight, feature.wedgeAngleRight, feature.isStickyRight);
			}
		}

		private static char SanitizeCharForOpenXRPath(char c)
		{
			if (char.IsLower(c) || char.IsDigit(c))
			{
				return c;
			}
			if (char.IsUpper(c))
			{
				return char.ToLower(c);
			}
			if (c == '-' || c == '.' || c == '_' || c == '/')
			{
				return c;
			}
			return '\0';
		}

		private static string SanitizeStringForOpenXRPath(string input)
		{
			if (string.IsNullOrEmpty(input))
			{
				return "";
			}
			int i;
			for (i = 0; i < input.Length && SanitizeCharForOpenXRPath(input[i]) == input[i]; i++)
			{
			}
			if (i == input.Length)
			{
				return input;
			}
			StringBuilder stringBuilder = new StringBuilder(input, 0, i, input.Length);
			for (; i < input.Length; i++)
			{
				char c = SanitizeCharForOpenXRPath(input[i]);
				if (c != 0)
				{
					stringBuilder.Append(c);
				}
			}
			return stringBuilder.ToString();
		}

		private static string GetActionHandleName(InputControl control)
		{
			InputControl val = control;
			while (val.parent != null && val.parent.parent != null)
			{
				val = val.parent;
			}
			string text = SanitizeStringForOpenXRPath(val.name);
			if (kVirtualControlMap.TryGetValue(text, out var value))
			{
				return value;
			}
			return text;
		}

		public static void SendHapticImpulse(InputActionReference actionRef, float amplitude, float duration, InputDevice inputDevice = null)
		{
			SendHapticImpulse(actionRef, amplitude, 0f, duration, inputDevice);
		}

		public static void SendHapticImpulse(InputActionReference actionRef, float amplitude, float frequency, float duration, InputDevice inputDevice = null)
		{
			SendHapticImpulse(actionRef.action, amplitude, frequency, duration, inputDevice);
		}

		public static void SendHapticImpulse(InputAction action, float amplitude, float duration, InputDevice inputDevice = null)
		{
			SendHapticImpulse(action, amplitude, 0f, duration, inputDevice);
		}

		public static void SendHapticImpulse(InputAction action, float amplitude, float frequency, float duration, InputDevice inputDevice = null)
		{
			if (action != null)
			{
				ulong actionHandle = GetActionHandle(action, inputDevice);
				if (actionHandle != 0L)
				{
					amplitude = Mathf.Clamp(amplitude, 0f, 1f);
					duration = Mathf.Max(duration, 0f);
					Internal_SendHapticImpulse(GetDeviceId(inputDevice), actionHandle, amplitude, frequency, duration);
				}
			}
		}

		public static void StopHaptics(InputActionReference actionRef, InputDevice inputDevice = null)
		{
			if (!((Object)(object)actionRef == (Object)null))
			{
				StopHaptics(actionRef.action, inputDevice);
			}
		}

		public static void StopHaptics(InputAction inputAction, InputDevice inputDevice = null)
		{
			if (inputAction != null)
			{
				ulong actionHandle = GetActionHandle(inputAction, inputDevice);
				if (actionHandle != 0L)
				{
					Internal_StopHaptics(GetDeviceId(inputDevice), actionHandle);
				}
			}
		}

		public static bool TryGetInputSourceName(InputAction inputAction, int index, out string name, InputSourceNameFlags flags = InputSourceNameFlags.All, InputDevice inputDevice = null)
		{
			name = "";
			if (index < 0)
			{
				return false;
			}
			ulong actionHandle = GetActionHandle(inputAction, inputDevice);
			if (actionHandle == 0L)
			{
				return false;
			}
			return Internal_TryGetInputSourceName(GetDeviceId(inputDevice), actionHandle, (uint)index, (uint)flags, out name);
		}

		public static bool GetActionIsActive(InputAction inputAction)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			if (inputAction != null && inputAction.controls.Count > 0 && inputAction.controls[0].device != null)
			{
				for (int i = 0; i < inputAction.controls.Count; i++)
				{
					uint deviceId = GetDeviceId(inputAction.controls[i].device);
					if (deviceId != 0)
					{
						string actionHandleName = GetActionHandleName(inputAction.controls[i]);
						if (Internal_GetActionIsActive(deviceId, actionHandleName))
						{
							return true;
						}
					}
				}
			}
			return false;
		}

		public static ulong GetActionHandle(InputAction inputAction, InputDevice inputDevice = null)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			if (inputAction == null || inputAction.controls.Count == 0)
			{
				return 0uL;
			}
			Enumerator<InputControl> enumerator = inputAction.controls.GetEnumerator();
			try
			{
				while (enumerator.MoveNext())
				{
					InputControl current = enumerator.Current;
					if ((inputDevice != null && current.device != inputDevice) || current.device == null)
					{
						continue;
					}
					uint deviceId = GetDeviceId(current.device);
					if (deviceId != 0)
					{
						string actionHandleName = GetActionHandleName(current);
						ulong num = Internal_GetActionId(deviceId, actionHandleName);
						if (num != 0L)
						{
							return num;
						}
					}
				}
			}
			finally
			{
				((IDisposable)enumerator).Dispose();
			}
			return 0uL;
		}

		private static uint GetDeviceId(InputDevice inputDevice)
		{
			if (inputDevice == null)
			{
				return 0u;
			}
			GetInternalDeviceIdCommand getInternalDeviceIdCommand = GetInternalDeviceIdCommand.Create();
			if (inputDevice.ExecuteCommand<GetInternalDeviceIdCommand>(ref getInternalDeviceIdCommand) != 0L)
			{
				return getInternalDeviceIdCommand.deviceId;
			}
			return 0u;
		}

		private static string UserPathToDeviceName(string userPath)
		{
			string[] array = userPath.Split('/', '_');
			StringBuilder stringBuilder = new StringBuilder("OXR");
			string[] array2 = array;
			foreach (string text in array2)
			{
				if (text.Length != 0)
				{
					string text2 = SanitizeStringForOpenXRPath(text);
					stringBuilder.Append(char.ToUpper(text2[0]));
					stringBuilder.Append(text2.Substring(1));
				}
			}
			return stringBuilder.ToString();
		}

		[DllImport("UnityOpenXR", CallingConvention = CallingConvention.Cdecl, EntryPoint = "OpenXRInputProvider_SetDpadBindingCustomValues")]
		private static extern void Internal_SetDpadBindingCustomValues(bool isLeft, float forceThreshold, float forceThresholdReleased, float centerRegion, float wedgeAngle, bool isSticky);

		[DllImport("UnityOpenXR", CallingConvention = CallingConvention.Cdecl, EntryPoint = "OpenXRInputProvider_SendHapticImpulse")]
		private static extern void Internal_SendHapticImpulse(uint deviceId, ulong actionId, float amplitude, float frequency, float duration);

		[DllImport("UnityOpenXR", CallingConvention = CallingConvention.Cdecl, EntryPoint = "OpenXRInputProvider_StopHaptics")]
		private static extern void Internal_StopHaptics(uint deviceId, ulong actionId);

		[DllImport("UnityOpenXR", EntryPoint = "OpenXRInputProvider_GetActionIdByControl")]
		private static extern ulong Internal_GetActionId(uint deviceId, string name);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_TryGetInputSourceName")]
		[return: MarshalAs(UnmanagedType.U1)]
		private static extern bool Internal_TryGetInputSourceNamePtr(uint deviceId, ulong actionId, uint index, uint flags, out IntPtr outName);

		internal static bool Internal_TryGetInputSourceName(uint deviceId, ulong actionId, uint index, uint flags, out string outName)
		{
			if (!Internal_TryGetInputSourceNamePtr(deviceId, actionId, index, flags, out var outName2))
			{
				outName = "";
				return false;
			}
			outName = Marshal.PtrToStringAnsi(outName2);
			return true;
		}

		[DllImport("UnityOpenXR", EntryPoint = "OpenXRInputProvider_GetActionIsActive")]
		private static extern bool Internal_GetActionIsActive(uint deviceId, string name);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_RegisterDeviceDefinition")]
		private static extern ulong Internal_RegisterDeviceDefinition(string userPath, string interactionProfile, bool isAdditive, uint characteristics, string name, string manufacturer, string serialNumber);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_CreateActionSet")]
		private static extern ulong Internal_CreateActionSet(string name, string localizedName, SerializedGuid guid);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_CreateAction")]
		private static extern ulong Internal_CreateAction(ulong actionSetId, string name, string localizedName, uint actionType, SerializedGuid guid, string[] userPaths, uint userPathCount, bool isAdditive, string[] usages, uint usageCount);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_SuggestBindings")]
		[return: MarshalAs(UnmanagedType.U1)]
		internal static extern bool Internal_SuggestBindings(string interactionProfile, SerializedBinding[] serializedBindings, uint serializedBindingCount);

		[DllImport("UnityOpenXR", CharSet = CharSet.Ansi, EntryPoint = "OpenXRInputProvider_AttachActionSets")]
		[return: MarshalAs(UnmanagedType.U1)]
		internal static extern bool Internal_AttachActionSets();
	}
	[Obsolete("OpenXR.Input.Pose is deprecated, Please use UnityEngine.InputSystem.XR.PoseState instead", false)]
	public struct Pose
	{
		public bool isTracked { get; set; }

		public InputTrackingState trackingState { get; set; }

		public Vector3 position { get; set; }

		public Quaternion rotation { get; set; }

		public Vector3 velocity { get; set; }

		public Vector3 angularVelocity { get; set; }
	}
	[Obsolete("OpenXR.Input.PoseControl is deprecated. Please use UnityEngine.InputSystem.XR.PoseControl instead.", false)]
	public class PoseControl : InputControl<Pose>
	{
		[Preserve]
		[InputControl(offset = 0u)]
		public ButtonControl isTracked { get; private set; }

		[Preserve]
		[InputControl(offset = 4u)]
		public IntegerControl trackingState { get; private set; }

		[Preserve]
		[InputControl(offset = 8u, noisy = true)]
		public Vector3Control position { get; private set; }

		[Preserve]
		[InputControl(offset = 20u, noisy = true)]
		public QuaternionControl rotation { get; private set; }

		[Preserve]
		[InputControl(offset = 36u, noisy = true)]
		public Vector3Control velocity { get; private set; }

		[Preserve]
		[InputControl(offset = 48u, noisy = true)]
		public Vector3Control angularVelocity { get; private set; }

		protected override void FinishSetup()
		{
			isTracked = ((InputControl)this).GetChildControl<ButtonControl>("isTracked");
			trackingState = ((InputControl)this).GetChildControl<IntegerControl>("trackingState");
			position = ((InputControl)this).GetChildControl<Vector3Control>("position");
			rotation = ((InputControl)this).GetChildControl<QuaternionControl>("rotation");
			velocity = ((InputControl)this).GetChildControl<Vector3Control>("velocity");
			angularVelocity = ((InputControl)this).GetChildControl<Vector3Control>("angularVelocity");
			base.FinishSetup();
		}

		public unsafe override Pose ReadUnprocessedValueFromState(void* statePtr)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			Pose result = default(Pose);
			result.isTracked = ((InputControl<float>)(object)isTracked).ReadUnprocessedValueFromState(statePtr) > 0.5f;
			result.trackingState = (InputTrackingState)((InputControl<int>)(object)trackingState).ReadUnprocessedValueFromState(statePtr);
			result.position = ((InputControl<Vector3>)(object)position).ReadUnprocessedValueFromState(statePtr);
			result.rotation = ((InputControl<Quaternion>)(object)rotation).ReadUnprocessedValueFromState(statePtr);
			result.velocity = ((InputControl<Vector3>)(object)velocity).ReadUnprocessedValueFromState(statePtr);
			result.angularVelocity = ((InputControl<Vector3>)(object)angularVelocity).ReadUnprocessedValueFromState(statePtr);
			return result;
		}

		public unsafe override void WriteValueIntoState(Pose value, void* statePtr)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected I4, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			InputControlExtensions.WriteValueIntoState<bool>((InputControl)(object)isTracked, value.isTracked, statePtr);
			InputControlExtensions.WriteValueIntoState<uint>((InputControl)(object)trackingState, (uint)(int)value.trackingState, statePtr);
			((InputControl<Vector3>)(object)position).WriteValueIntoState(value.position, statePtr);
			((InputControl<Quaternion>)(object)rotation).WriteValueIntoState(value.rotation, statePtr);
			((InputControl<Vector3>)(object)velocity).WriteValueIntoState(value.velocity, statePtr);
			((InputControl<Vector3>)(object)angularVelocity).WriteValueIntoState(value.angularVelocity, statePtr);
		}
	}
}
namespace UnityEngine.XR.OpenXR.Features
{
	[Serializable]
	public abstract class OpenXRFeature : ScriptableObject
	{
		internal enum LoaderEvent
		{
			SubsystemCreate,
			SubsystemDestroy,
			SubsystemStart,
			SubsystemStop
		}

		internal enum NativeEvent
		{
			XrSetupConfigValues,
			XrSystemIdChanged,
			XrInstanceChanged,
			XrSessionChanged,
			XrBeginSession,
			XrSessionStateChanged,
			XrChangedSpaceApp,
			XrEndSession,
			XrDestroySession,
			XrDestroyInstance,
			XrIdle,
			XrReady,
			XrSynchronized,
			XrVisible,
			XrFocused,
			XrStopping,
			XrExiting,
			XrLossPending,
			XrInstanceLossPending,
			XrRestartRequested,
			XrRequestRestartLoop,
			XrRequestGetSystemLoop
		}

		[FormerlySerializedAs("enabled")]
		[HideInInspector]
		[SerializeField]
		private bool m_enabled;

		[HideInInspector]
		[SerializeField]
		internal string nameUi;

		[HideInInspector]
		[SerializeField]
		internal string version;

		[HideInInspector]
		[SerializeField]
		internal string featureIdInternal;

		[HideInInspector]
		[SerializeField]
		internal string openxrExtensionStrings;

		[HideInInspector]
		[SerializeField]
		internal string company;

		[HideInInspector]
		[SerializeField]
		internal int priority;

		[HideInInspector]
		[SerializeField]
		internal bool required;

		[NonSerialized]
		internal bool internalFieldsUpdated;

		private const string Library = "UnityOpenXR";

		internal bool failedInitialization { get; private set; }

		internal static bool requiredFeatureFailed { get; private set; }

		public bool enabled
		{
			get
			{
				if (m_enabled)
				{
					if (!((Object)(object)OpenXRLoaderBase.Instance == (Object)null))
					{
						return !failedInitialization;
					}
					return true;
				}
				return false;
			}
			set
			{
				if (enabled != value)
				{
					if ((Object)(object)OpenXRLoaderBase.Instance != (Object)null)
					{
						Debug.LogError((object)"OpenXRFeature.enabled cannot be changed while OpenXR is running");
						return;
					}
					m_enabled = value;
					OnEnabledChange();
				}
			}
		}

		protected static IntPtr xrGetInstanceProcAddr => Internal_GetProcAddressPtr(loaderDefault: false);

		protected internal virtual IntPtr HookGetInstanceProcAddr(IntPtr func)
		{
			return func;
		}

		protected internal virtual void OnSubsystemCreate()
		{
		}

		protected internal virtual void OnSubsystemStart()
		{
		}

		protected internal virtual void OnSubsystemStop()
		{
		}

		protected internal virtual void OnSubsystemDestroy()
		{
		}

		protected internal virtual bool OnInstanceCreate(ulong xrInstance)
		{
			return true;
		}

		protected internal virtual void OnSystemChange(ulong xrSystem)
		{
		}

		protected internal virtual void OnSessionCreate(ulong xrSession)
		{
		}

		protected internal virtual void OnAppSpaceChange(ulong xrSpace)
		{
		}

		protected internal virtual void OnSessionStateChange(int oldState, int newState)
		{
		}

		protected internal virtual void OnSessionBegin(ulong xrSession)
		{
		}

		protected internal virtual void OnSessionEnd(ulong xrSession)
		{
		}

		protected internal virtual void OnSessionExiting(ulong xrSession)
		{
		}

		protected internal virtual void OnSessionDestroy(ulong xrSession)
		{
		}

		protected internal virtual void OnInstanceDestroy(ulong xrInstance)
		{
		}

		protected internal virtual void OnSessionLossPending(ulong xrSession)
		{
		}

		protected internal virtual void OnInstanceLossPending(ulong xrInstance)
		{
		}

		protected internal virtual void OnFormFactorChange(int xrFormFactor)
		{
		}

		protected internal virtual void OnViewConfigurationTypeChange(int xrViewConfigurationType)
		{
		}

		protected internal virtual void OnEnvironmentBlendModeChange(XrEnvironmentBlendMode xrEnvironmentBlendMode)
		{
		}

		protected internal virtual void OnEnabledChange()
		{
		}

		protected static string PathToString(ulong path)
		{
			if (!Internal_PathToStringPtr(path, out var path2))
			{
				return null;
			}
			return Marshal.PtrToStringAnsi(path2);
		}

		protected static ulong StringToPath(string str)
		{
			if (!Internal_StringToPath(str, out var pathId))
			{
				return 0uL;
			}
			return pathId;
		}

		protected static ulong GetCurrentInteractionProfile(ulong userPath)
		{
			if (!Internal_GetCurrentInteractionProfile(userPath, out var interactionProfile))
			{
				return 0uL;
			}
			return interactionProfile;
		}

		protected static ulong GetCurrentInteractionProfile(string userPath)
		{
			return GetCurrentInteractionProfile(StringToPath(userPath));
		}

		protected static ulong GetCurrentAppSpace()
		{
			if (!Internal_GetAppSpace(out var appSpace))
			{
				return 0uL;
			}
			return appSpace;
		}

		protected static int GetViewConfigurationTypeForRenderPass(int renderPassIndex)
		{
			return Internal_GetViewTypeFromRenderIndex(renderPassIndex);
		}

		protected static void SetEnvironmentBlendMode(XrEnvironmentBlendMode xrEnvironmentBlendMode)
		{
			Internal_SetEnvironmentBlendMode(xrEnvironmentBlendMode);
		}

		protected static XrEnvironmentBlendMode GetEnvironmentBlendMode()
		{
			return Internal_GetEnvironmentBlendMode();
		}

		protected void CreateSubsystem<TDescriptor, TSubsystem>(List<TDescriptor> descriptors, string id) where TDescriptor : ISubsystemDescriptor where TSubsystem : ISubsystem
		{
			if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null)
			{
				Debug.LogError((object)"CreateSubsystem called before loader was initialized");
			}
			else
			{
				OpenXRLoaderBase.Instance.CreateSubsystem<TDescriptor, TSubsystem>(descriptors, id);
			}
		}

		protected void StartSubsystem<T>() where T : class, ISubsystem
		{
			if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null)
			{
				Debug.LogError((object)"StartSubsystem called before loader was initialized");
			}
			else
			{
				OpenXRLoaderBase.Instance.StartSubsystem<T>();
			}
		}

		protected void StopSubsystem<T>() where T : class, ISubsystem
		{
			if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null)
			{
				Debug.LogError((object)"StopSubsystem called before loader was initialized");
			}
			else
			{
				OpenXRLoaderBase.Instance.StopSubsystem<T>();
			}
		}

		protected void DestroySubsystem<T>() where T : class, ISubsystem
		{
			if ((Object)(object)OpenXRLoaderBase.Instance == (Object)null)
			{
				Debug.LogError((object)"DestroySubsystem called before loader was initialized");
			}
			else
			{
				OpenXRLoaderBase.Instance.DestroySubsystem<T>();
			}
		}

		protected virtual void OnEnable()
		{
		}

		protected virtual void OnDisable()
		{
		}

		protected virtual void Awake()
		{
		}

		internal static bool ReceiveLoaderEvent(OpenXRLoaderBase loader, LoaderEvent e)
		{
			OpenXRSettings instance = OpenXRSettings.Instance;
			if ((Object)(object)instance == (Object)null)
			{
				return true;
			}
			OpenXRFeature[] features = instance.features;
			foreach (OpenXRFeature openXRFeature in features)
			{
				if (!((Object)(object)openXRFeature == (Object)null) && openXRFeature.enabled)
				{
					switch (e)
					{
					case LoaderEvent.SubsystemCreate:
						openXRFeature.OnSubsystemCreate();
						break;
					case LoaderEvent.SubsystemDestroy:
						openXRFeature.OnSubsystemDestroy();
						break;
					case LoaderEvent.SubsystemStart:
						openXRFeature.OnSubsystemStart();
						break;
					case LoaderEvent.SubsystemStop:
						openXRFeature.OnSubsystemStop();
						break;
					default:
						throw new ArgumentOutOfRangeException("e", e, null);
					}
				}
			}
			return true;
		}

		internal static void ReceiveNativeEvent(NativeEvent e, ulong payload)
		{
			if ((Object)null == (Object)(object)OpenXRSettings.Instance)
			{
				return;
			}
			OpenXRFeature[] features = OpenXRSettings.Instance.features;
			foreach (OpenXRFeature openXRFeature in features)
			{
				if (!((Object)(object)openXRFeature == (Object)null) && openXRFeature.enabled)
				{
					switch (e)
					{
					case NativeEvent.XrSetupConfigValues:
						openXRFeature.OnFormFactorChange(Internal_GetFormFactor());
						openXRFeature.OnEnvironmentBlendModeChange(Internal_GetEnvironmentBlendMode());
						openXRFeature.OnViewConfigurationTypeChange(Internal_GetViewConfigurationType());
						break;
					case NativeEvent.XrSystemIdChanged:
						openXRFeature.OnSystemChange(payload);
						break;
					case NativeEvent.XrInstanceChanged:
						openXRFeature.failedInitialization = !openXRFeature.OnInstanceCreate(payload);
						requiredFeatureFailed |= openXRFeature.required && openXRFeature.failedInitialization;
						break;
					case NativeEvent.XrSessionChanged:
						openXRFeature.OnSessionCreate(payload);
						break;
					case NativeEvent.XrBeginSession:
						openXRFeature.OnSessionBegin(payload);
						break;
					case NativeEvent.XrChangedSpaceApp:
						openXRFeature.OnAppSpaceChange(payload);
						break;
					case NativeEvent.XrSessionStateChanged:
					{
						Internal_GetSessionState(out var oldState, out var newState);
						openXRFeature.OnSessionStateChange(oldState, newState);
						break;
					}
					case NativeEvent.XrEndSession:
						openXRFeature.OnSessionEnd(payload);
						break;
					case NativeEvent.XrExiting:
						openXRFeature.OnSessionExiting(payload);
						break;
					case NativeEvent.XrDestroySession:
						openXRFeature.OnSessionDestroy(payload);
						break;
					case NativeEvent.XrDestroyInstance:
						openXRFeature.OnInstanceDestroy(payload);
						break;
					case NativeEvent.XrLossPending:
						openXRFeature.OnSessionLossPending(payload);
						break;
					case NativeEvent.XrInstanceLossPending:
						openXRFeature.OnInstanceLossPending(payload);
						break;
					}
				}
			}
		}

		internal static void Initialize()
		{
			requiredFeatureFailed = false;
			OpenXRSettings instance = OpenXRSettings.Instance;
			if ((Object)(object)instance == (Object)null || instance.features == null)
			{
				return;
			}
			OpenXRFeature[] features = instance.features;
			foreach (OpenXRFeature openXRFeature in features)
			{
				if ((Object)(object)openXRFeature != (Object)null)
				{
					openXRFeature.failedInitialization = false;
				}
			}
		}

		internal static void HookGetInstanceProcAddr()
		{
			IntPtr func = Internal_GetProcAddressPtr(loaderDefault: true);
			OpenXRSettings instance = OpenXRSettings.Instance;
			if ((Object)(object)instance != (Object)null && instance.features != null)
			{
				for (int num = instance.features.Length - 1; num >= 0; num--)
				{
					OpenXRFeature openXRFeature = instance.features[num];
					if (!((Object)(object)openXRFeature == (Object)null) && openXRFeature.enabled)
					{
						func = openXRFeature.HookGetInstanceProcAddr(func);
					}
				}
			}
			Internal_SetProcAddressPtrAndLoadStage1(func);
		}

		protected ulong GetAction(InputAction inputAction)
		{
			return OpenXRInput.GetActionHandle(inputAction);
		}

		[DllImport("UnityOpenXR", EntryPoint = "Internal_PathToString")]
		private static extern bool Internal_PathToStringPtr(ulong pathId, out IntPtr path);

		[DllImport("UnityOpenXR")]
		private static extern bool Internal_StringToPath([MarshalAs(UnmanagedType.LPStr)] string str, out ulong pathId);

		[DllImport("UnityOpenXR")]
		private static extern bool Internal_GetCurrentInteractionProfile(ulong pathId, out ulong interactionProfile);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetFormFactor")]
		private static extern int Internal_GetFormFactor();

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetViewConfigurationType")]
		private static extern int Internal_GetViewConfigurationType();

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetViewTypeFromRenderIndex")]
		private static extern int Internal_GetViewTypeFromRenderIndex(int renderPassIndex);

		[DllImport("UnityOpenXR", EntryPoint = "session_GetSessionState")]
		private static extern void Internal_GetSessionState(out int oldState, out int newState);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetEnvironmentBlendMode")]
		private static extern XrEnvironmentBlendMode Internal_GetEnvironmentBlendMode();

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetEnvironmentBlendMode")]
		private static extern void Internal_SetEnvironmentBlendMode(XrEnvironmentBlendMode xrEnvironmentBlendMode);

		[DllImport("UnityOpenXR", EntryPoint = "OpenXRInputProvider_GetAppSpace")]
		private static extern bool Internal_GetAppSpace(out ulong appSpace);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_GetProcAddressPtr")]
		internal static extern IntPtr Internal_GetProcAddressPtr(bool loaderDefault);

		[DllImport("UnityOpenXR", EntryPoint = "NativeConfig_SetProcAddressPtrAndLoadStage1")]
		internal static extern void Internal_SetProcAddressPtrAndLoadStage1(IntPtr func);
	}
	[Serializable]
	public abstract class OpenXRInteractionFeature : OpenXRFeature
	{
		[Serializable]
		protected internal enum ActionType
		{
			Binary,
			Axis1D,
			Axis2D,
			Pose,
			Vibrate,
			Count
		}

		[Serializable]
		protected internal class ActionBinding
		{
			public string interactionProfileName;

			public string interactionPath;

			public List<string> userPaths;
		}

		[Serializable]
		protected internal class ActionConfig
		{
			public string name;

			public ActionType type;

			public string localizedName;

			public List<ActionBinding> bindings;

			public List<string> usages;

			public bool isAdditive;
		}

		protected internal class DeviceConfig
		{
			public InputDeviceCharacteristics characteristics;

			public string userPath;
		}

		[Serializable]
		protected internal class ActionMapConfig
		{
			public string name;

			public string localizedName;

			public List<DeviceConfig> deviceInfos;

			public List<ActionConfig> actions;

			public string desiredInteractionProfile;

			public string manufacturer;

			public string serialNumber;
		}

		public static class UserPaths
		{
			public const string leftHand = "/user/hand/left";

			public const string rightHand = "/user/hand/right";

			public const string head = "/user/head";

			public const string gamepad = "/user/gamepad";

			public const string treadmill = "/user/treadmill";
		}

		private static List<ActionMapConfig> m_CreatedActionMaps;

		internal virtual bool IsAdditive => false;

		protected virtual void RegisterDeviceLayout()
		{
		}

		protected virtual void UnregisterDeviceLayout()
		{
		}

		protected virtual void RegisterActionMapsWithRuntime()
		{
		}

		protected internal override bool OnInstanceCreate(ulong xrSession)
		{
			RegisterDeviceLayout();
			return true;
		}

		internal void CreateActionMaps(List<ActionMapConfig> configs)
		{
			m_CreatedActionMaps = configs;
			RegisterActionMapsWithRuntime();
			m_CreatedActionMaps = null;
		}

		protected void AddActionMap(ActionMapConfig map)
		{
			if (map == null)
			{
				throw new ArgumentNullException("map");
			}
			if (m_CreatedActionMaps == null)
			{
				throw new InvalidOperationException("ActionMap must be added from within the RegisterActionMapsWithRuntime method");
			}
			m_CreatedActionMaps.Add(map);
		}

		internal virtual void AddAdditiveActions(List<ActionMapConfig> actionMaps, ActionMapConfig additiveMap)
		{
		}

		protected internal override void OnEnabledChange()
		{
			base.OnEnabledChange();
		}

		internal static void RegisterLayouts()
		{
			OpenXRFeature[] features = OpenXRSettings.Instance.GetFeatures<OpenXRInteractionFeature>();
			foreach (OpenXRFeature openXRFeature in features)
			{
				if (openXRFeature.enabled)
				{
					((OpenXRInteractionFeature)openXRFeature).RegisterDeviceLayout();
				}
			}
		}
	}
}
namespace UnityEngine.XR.OpenXR.Features.Interactions
{
	public class DPadInteraction : OpenXRInteractionFeature
	{
		[Preserve]
		[InputControlLayout(displayName = "D-Pad Binding (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" })]
		public class DPad : XRController
		{
			[Preserve]
			[InputControl]
			public ButtonControl thumbstickDpadUp { get; private set; }

			[Preserve]
			[InputControl]
			public ButtonControl thumbstickDpadDown { get; private set; }

			[Preserve]
			[InputControl]
			public ButtonControl thumbstickDpadLeft { get; private set; }

			[Preserve]
			[InputControl]
			public ButtonControl thumbstickDpadRight { get; private set; }

			[Preserve]
			[InputControl]
			public ButtonControl trackpadDpadUp { get; private set; }

			[Preserve]
			[InputControl]
			public ButtonControl trackpadDpadDown { get; private set; }

			[Preserve]
			[InputControl]
			public ButtonControl trackpadDpadLeft { get; private set; }

			[Preserve]
			[InputControl]
			public ButtonControl trackpadDpadRight { get; private set; }

			[Preserve]
			[InputControl]
			public ButtonControl trackpadDpadCenter { get; private set; }

			protected override void FinishSetup()
			{
				((XRController)this).FinishSetup();
				thumbstickDpadUp = ((InputControl)this).GetChildControl<ButtonControl>("thumbstickDpadUp");
				thumbstickDpadDown = ((InputControl)this).GetChildControl<ButtonControl>("thumbstickDpadDown");
				thumbstickDpadLeft = ((InputControl)this).GetChildControl<ButtonControl>("thumbstickDpadLeft");
				thumbstickDpadRight = ((InputControl)this).GetChildControl<ButtonControl>("thumbstickDpadRight");
				trackpadDpadUp = ((InputControl)this).GetChildControl<ButtonControl>("trackpadDpadUp");
				trackpadDpadDown = ((InputControl)this).GetChildControl<ButtonControl>("trackpadDpadDown");
				trackpadDpadLeft = ((InputControl)this).GetChildControl<ButtonControl>("trackpadDpadLeft");
				trackpadDpadRight = ((InputControl)this).GetChildControl<ButtonControl>("trackpadDpadRight");
				trackpadDpadCenter = ((InputControl)this).GetChildControl<ButtonControl>("trackpadDpadCenter");
			}
		}

		public const string featureId = "com.unity.openxr.feature.input.dpadinteraction";

		public float forceThresholdLeft = 0.5f;

		public float forceThresholdReleaseLeft = 0.4f;

		public float centerRegionLeft = 0.5f;

		public float wedgeAngleLeft = (float)Math.PI / 2f;

		public bool isStickyLeft;

		public float forceThresholdRight = 0.5f;

		public float forceThresholdReleaseRight = 0.4f;

		public float centerRegionRight = 0.5f;

		public float wedgeAngleRight = (float)Math.PI / 2f;

		public bool isStickyRight;

		public const string thumbstickDpadUp = "/input/thumbstick/dpad_up";

		public const string thumbstickDpadDown = "/input/thumbstick/dpad_down";

		public const string thumbstickDpadLeft = "/input/thumbstick/dpad_left";

		public const string thumbstickDpadRight = "/input/thumbstick/dpad_right";

		public const string trackpadDpadUp = "/input/trackpad/dpad_up";

		public const string trackpadDpadDown = "/input/trackpad/dpad_down";

		public const string trackpadDpadLeft = "/input/trackpad/dpad_left";

		public const string trackpadDpadRight = "/input/trackpad/dpad_right";

		public const string trackpadDpadCenter = "/input/trackpad/dpad_center";

		public const string profile = "/interaction_profiles/unity/dpad";

		private const string kDeviceLocalizedName = "DPad Interaction OpenXR";

		public string[] extensionStrings = new string[2] { "XR_KHR_binding_modification", "XR_EXT_dpad_binding" };

		internal override bool IsAdditive => true;

		protected internal override bool OnInstanceCreate(ulong instance)
		{
			string[] array = extensionStrings;
			for (int i = 0; i < array.Length; i++)
			{
				if (!OpenXRRuntime.IsExtensionEnabled(array[i]))
				{
					return false;
				}
			}
			return base.OnInstanceCreate(instance);
		}

		protected override void RegisterDeviceLayout()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			Type typeFromHandle = typeof(DPad);
			InputDeviceMatcher val = default(InputDeviceMatcher);
			val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true);
			InputSystem.RegisterLayout(typeFromHandle, (string)null, (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("DPad Interaction OpenXR", true));
		}

		protected override void UnregisterDeviceLayout()
		{
			InputSystem.RemoveLayout("DPad");
		}

		protected override void RegisterActionMapsWithRuntime()
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			ActionMapConfig map = new ActionMapConfig
			{
				name = "dpadinteraction",
				localizedName = "DPad Interaction OpenXR",
				desiredInteractionProfile = "/interaction_profiles/unity/dpad",
				manufacturer = "",
				serialNumber = "",
				deviceInfos = new List<DeviceConfig>
				{
					new DeviceConfig
					{
						characteristics = (InputDeviceCharacteristics)356,
						userPath = "/user/hand/left"
					},
					new DeviceConfig
					{
						characteristics = (InputDeviceCharacteristics)612,
						userPath = "/user/hand/right"
					}
				},
				actions = new List<ActionConfig>
				{
					new ActionConfig
					{
						name = "thumbstickDpadUp",
						localizedName = " Thumbstick Dpad Up",
						type = ActionType.Binary,
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/thumbstick/dpad_up",
								interactionProfileName = "/interaction_profiles/unity/dpad"
							}
						},
						isAdditive = true
					},
					new ActionConfig
					{
						name = "thumbstickDpadDown",
						localizedName = "Thumbstick Dpad Down",
						type = ActionType.Binary,
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/thumbstick/dpad_down",
								interactionProfileName = "/interaction_profiles/unity/dpad"
							}
						},
						isAdditive = true
					},
					new ActionConfig
					{
						name = "thumbstickDpadLeft",
						localizedName = "Thumbstick Dpad Left",
						type = ActionType.Binary,
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/thumbstick/dpad_left",
								interactionProfileName = "/interaction_profiles/unity/dpad"
							}
						},
						isAdditive = true
					},
					new ActionConfig
					{
						name = "thumbstickDpadRight",
						localizedName = "Thumbstick Dpad Right",
						type = ActionType.Binary,
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/thumbstick/dpad_right",
								interactionProfileName = "/interaction_profiles/unity/dpad"
							}
						},
						isAdditive = true
					},
					new ActionConfig
					{
						name = "trackpadDpadUp",
						localizedName = "Trackpad Dpad Up",
						type = ActionType.Binary,
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/trackpad/dpad_up",
								interactionProfileName = "/interaction_profiles/unity/dpad"
							}
						},
						isAdditive = true
					},
					new ActionConfig
					{
						name = "trackpadDpadDown",
						localizedName = "Trackpad Dpad Down",
						type = ActionType.Binary,
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/trackpad/dpad_down",
								interactionProfileName = "/interaction_profiles/unity/dpad"
							}
						},
						isAdditive = true
					},
					new ActionConfig
					{
						name = "trackpadDpadLeft",
						localizedName = "Trackpad Dpad Left",
						type = ActionType.Binary,
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/trackpad/dpad_left",
								interactionProfileName = "/interaction_profiles/unity/dpad"
							}
						},
						isAdditive = true
					},
					new ActionConfig
					{
						name = "trackpadDpadRight",
						localizedName = "Trackpad Dpad Right",
						type = ActionType.Binary,
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/trackpad/dpad_right",
								interactionProfileName = "/interaction_profiles/unity/dpad"
							}
						},
						isAdditive = true
					},
					new ActionConfig
					{
						name = "trackpadDpadCenter",
						localizedName = "Trackpad Dpad Center",
						type = ActionType.Binary,
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/trackpad/dpad_center",
								interactionProfileName = "/interaction_profiles/unity/dpad"
							}
						},
						isAdditive = true
					}
				}
			};
			AddActionMap(map);
		}

		internal override void AddAdditiveActions(List<ActionMapConfig> actionMaps, ActionMapConfig additiveMap)
		{
			foreach (ActionMapConfig actionMap in actionMaps)
			{
				if (!actionMap.deviceInfos.Where((DeviceConfig d) => d.userPath != null && (string.CompareOrdinal(d.userPath, "/user/hand/left") == 0 || string.CompareOrdinal(d.userPath, "/user/hand/right") == 0)).Any())
				{
					break;
				}
				bool flag = false;
				bool flag2 = false;
				foreach (ActionConfig action in actionMap.actions)
				{
					if (!flag && action.bindings.FirstOrDefault((ActionBinding b) => b.interactionPath.Contains("trackpad")) != null)
					{
						flag = true;
					}
					if (!flag2 && action.bindings.FirstOrDefault((ActionBinding b) => b.interactionPath.Contains("thumbstick")) != null)
					{
						flag2 = true;
					}
				}
				foreach (ActionConfig item in additiveMap.actions.Where((ActionConfig a) => a.isAdditive))
				{
					if ((flag && item.name.StartsWith("trackpad")) || (flag2 && item.name.StartsWith("thumbstick")))
					{
						actionMap.actions.Add(item);
					}
				}
			}
		}
	}
	public class EyeGazeInteraction : OpenXRInteractionFeature
	{
		[Preserve]
		[InputControlLayout(displayName = "Eye Gaze (OpenXR)", isGenericTypeOfDevice = true)]
		public class EyeGazeDevice : OpenXRDevice
		{
			[Preserve]
			[InputControl(offset = 0u, usages = new string[] { "Device", "gaze" })]
			public PoseControl pose { get; private set; }

			protected override void FinishSetup()
			{
				base.FinishSetup();
				pose = ((InputControl)this).GetChildControl<PoseControl>("pose");
			}
		}

		public const string featureId = "com.unity.openxr.feature.input.eyetracking";

		private const string userPath = "/user/eyes_ext";

		private const string profile = "/interaction_profiles/ext/eye_gaze_interaction";

		private const string pose = "/input/gaze_ext/pose";

		private const string kDeviceLocalizedName = "Eye Tracking OpenXR";

		public const string extensionString = "XR_EXT_eye_gaze_interaction";

		protected internal override bool OnInstanceCreate(ulong instance)
		{
			if (!OpenXRRuntime.IsExtensionEnabled("XR_EXT_eye_gaze_interaction"))
			{
				return false;
			}
			return base.OnInstanceCreate(instance);
		}

		protected override void RegisterDeviceLayout()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			Type typeFromHandle = typeof(EyeGazeDevice);
			InputDeviceMatcher val = default(InputDeviceMatcher);
			val = ((InputDeviceMatcher)(ref val)).WithInterface("^(XRInput)", true);
			InputSystem.RegisterLayout(typeFromHandle, "EyeGaze", (InputDeviceMatcher?)((InputDeviceMatcher)(ref val)).WithProduct("Eye Tracking OpenXR", true));
		}

		protected override void UnregisterDeviceLayout()
		{
			InputSystem.RemoveLayout("EyeGaze");
		}

		protected override void RegisterActionMapsWithRuntime()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			ActionMapConfig map = new ActionMapConfig
			{
				name = "eyegaze",
				localizedName = "Eye Tracking OpenXR",
				desiredInteractionProfile = "/interaction_profiles/ext/eye_gaze_interaction",
				manufacturer = "",
				serialNumber = "",
				deviceInfos = new List<DeviceConfig>
				{
					new DeviceConfig
					{
						characteristics = (InputDeviceCharacteristics)49,
						userPath = "/user/eyes_ext"
					}
				},
				actions = new List<ActionConfig>
				{
					new ActionConfig
					{
						name = "pose",
						localizedName = "Pose",
						type = ActionType.Pose,
						usages = new List<string> { "Device", "gaze" },
						bindings = new List<ActionBinding>
						{
							new ActionBinding
							{
								interactionPath = "/input/gaze_ext/pose",
								interactionProfileName = "/interaction_profiles/ext/eye_gaze_interaction"
							}
						}
					}
				}
			};
			AddActionMap(map);
		}
	}
	public static class EyeTrackingUsages
	{
		public static InputFeatureUsage<Vector3> gazePosition = new InputFeatureUsage<Vector3>("gazePosition");

		public static InputFeatureUsage<Quaternion> gazeRotation = new InputFeatureUsage<Quaternion>("gazeRotation");
	}
	public class HandCommonPosesInteraction : OpenXRInteractionFeature
	{
		[Preserve]
		[InputControlLayout(displayName = "Hand Interaction Poses (OpenXR)", commonUsages = new string[] { "LeftHand", "RightHand" }, isGenericTypeOfDevice = true)]
		public class HandInteractionPoses : OpenXRDevice
		{
			[Preserve]
			[InputControl(offset = 0u, aliases = new string[] { "device", "gripPose" }, usage = "Device")]
			public PoseControl devicePose { get; private set; }

			[Preserve]
			[InputControl(offset = 0u, alias = "aimPose", usage = "Pointer")]
			public PoseControl pointer { get; private set; }

			[Preserve]
			[InputControl(offset = 0u)]
			public PoseControl pokePose { get; private set; }

			[Preserve]
			[InputControl(offset = 0u)]
			public PoseControl pinchPose { get; private set; }

			protected override void FinishSetup()
			{
				base.FinishSetup();
				devicePose = ((InputControl)this).GetChildControl<PoseControl>("devicePose");
				pointer = ((InputControl)this).GetChildControl<PoseControl>("pointer");
				pokePose = ((InputControl)this).GetChildControl<PoseControl>("pokePose");
				pinchPose = ((InputControl)this).GetChildControl<PoseControl>("pinchPose");
			}
		}

		public const string featureId = "com.unity.openxr.feature.input.handinteractionposes";

		public const string profile = "/interaction_profiles/unity/hand_interaction_poses";

		public const string grip = "/input/grip/pose";

		public const string aim = "/input/aim/pose";

		public const string poke = "/input/poke_ext/pose";

		public const string pinch = "/input/pinch_ext/pose";

		private const string kDeviceLocalizedName = "Hand Interaction Poses OpenXR";

		public const string extensionString = "XR_EXT_hand_interaction";

		internal override bool IsAdditive => true;

		protected internal override bool OnInstanceCreate(ulong instance)
		{
			if (!OpenXRRuntime.IsExtensionEnabled("XR_EXT_hand_interaction"))
			{
				return false;
			}
			return base.OnInstanceCreate(instance);
		}

		protected override void RegisterDeviceLayout()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
	

BepInEx\plugins\Cyberhead\UnityEngine.SpatialTracking.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using UnityEngine.Events;
using UnityEngine.Experimental.XR.Interaction;
using UnityEngine.SpatialTracking;
using UnityEngine.XR;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEditor.XR.SpatialTracking")]
[assembly: InternalsVisibleTo("UnityEditor.SpatialTracking")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace UnityEngine.SpatialTracking
{
	internal class TrackedPoseDriverDataDescription
	{
		internal struct PoseData
		{
			public List<string> PoseNames;

			public List<TrackedPoseDriver.TrackedPose> Poses;
		}

		internal static List<PoseData> DeviceData = new List<PoseData>
		{
			new PoseData
			{
				PoseNames = new List<string> { "Left Eye", "Right Eye", "Center Eye - HMD Reference", "Head", "Color Camera" },
				Poses = new List<TrackedPoseDriver.TrackedPose>
				{
					TrackedPoseDriver.TrackedPose.LeftEye,
					TrackedPoseDriver.TrackedPose.RightEye,
					TrackedPoseDriver.TrackedPose.Center,
					TrackedPoseDriver.TrackedPose.Head,
					TrackedPoseDriver.TrackedPose.ColorCamera
				}
			},
			new PoseData
			{
				PoseNames = new List<string> { "Left Controller", "Right Controller" },
				Poses = new List<TrackedPoseDriver.TrackedPose>
				{
					TrackedPoseDriver.TrackedPose.LeftPose,
					TrackedPoseDriver.TrackedPose.RightPose
				}
			},
			new PoseData
			{
				PoseNames = new List<string> { "Device Pose" },
				Poses = new List<TrackedPoseDriver.TrackedPose> { TrackedPoseDriver.TrackedPose.RemotePose }
			}
		};
	}
	[Flags]
	public enum PoseDataFlags
	{
		NoData = 0,
		Position = 1,
		Rotation = 2
	}
	public static class PoseDataSource
	{
		internal static List<XRNodeState> nodeStates = new List<XRNodeState>();

		internal static PoseDataFlags GetNodePoseData(XRNode node, out Pose resultPose)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			PoseDataFlags poseDataFlags = PoseDataFlags.NoData;
			InputTracking.GetNodeStates(nodeStates);
			foreach (XRNodeState nodeState in nodeStates)
			{
				XRNodeState current = nodeState;
				if (((XRNodeState)(ref current)).nodeType == node)
				{
					if (((XRNodeState)(ref current)).TryGetPosition(ref resultPose.position))
					{
						poseDataFlags |= PoseDataFlags.Position;
					}
					if (((XRNodeState)(ref current)).TryGetRotation(ref resultPose.rotation))
					{
						poseDataFlags |= PoseDataFlags.Rotation;
					}
					return poseDataFlags;
				}
			}
			resultPose = Pose.identity;
			return poseDataFlags;
		}

		public static bool TryGetDataFromSource(TrackedPoseDriver.TrackedPose poseSource, out Pose resultPose)
		{
			return GetDataFromSource(poseSource, out resultPose) == (PoseDataFlags.Position | PoseDataFlags.Rotation);
		}

		public static PoseDataFlags GetDataFromSource(TrackedPoseDriver.TrackedPose poseSource, out Pose resultPose)
		{
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			switch (poseSource)
			{
			case TrackedPoseDriver.TrackedPose.RemotePose:
			{
				PoseDataFlags nodePoseData = GetNodePoseData((XRNode)5, out resultPose);
				if (nodePoseData == PoseDataFlags.NoData)
				{
					return GetNodePoseData((XRNode)4, out resultPose);
				}
				return nodePoseData;
			}
			case TrackedPoseDriver.TrackedPose.LeftEye:
				return GetNodePoseData((XRNode)0, out resultPose);
			case TrackedPoseDriver.TrackedPose.RightEye:
				return GetNodePoseData((XRNode)1, out resultPose);
			case TrackedPoseDriver.TrackedPose.Head:
				return GetNodePoseData((XRNode)3, out resultPose);
			case TrackedPoseDriver.TrackedPose.Center:
				return GetNodePoseData((XRNode)2, out resultPose);
			case TrackedPoseDriver.TrackedPose.LeftPose:
				return GetNodePoseData((XRNode)4, out resultPose);
			case TrackedPoseDriver.TrackedPose.RightPose:
				return GetNodePoseData((XRNode)5, out resultPose);
			case TrackedPoseDriver.TrackedPose.ColorCamera:
				return GetNodePoseData((XRNode)2, out resultPose);
			default:
				Debug.LogWarningFormat("Unable to retrieve pose data for poseSource: {0}", new object[1] { poseSource.ToString() });
				resultPose = Pose.identity;
				return PoseDataFlags.NoData;
			}
		}
	}
	[Serializable]
	[DefaultExecutionOrder(-30000)]
	[AddComponentMenu("XR/Tracked Pose Driver")]
	[HelpURL("https://docs.unity3d.com/Packages/[email protected]/manual/index.html")]
	public class TrackedPoseDriver : MonoBehaviour
	{
		public enum DeviceType
		{
			GenericXRDevice,
			GenericXRController,
			GenericXRRemote
		}

		public enum TrackedPose
		{
			LeftEye,
			RightEye,
			Center,
			Head,
			LeftPose,
			RightPose,
			ColorCamera,
			DepthCameraDeprecated,
			FisheyeCameraDeprected,
			DeviceDeprecated,
			RemotePose
		}

		public enum TrackingType
		{
			RotationAndPosition,
			RotationOnly,
			PositionOnly
		}

		public enum UpdateType
		{
			UpdateAndBeforeRender,
			Update,
			BeforeRender
		}

		[SerializeField]
		private DeviceType m_Device;

		[SerializeField]
		private TrackedPose m_PoseSource = TrackedPose.Center;

		[SerializeField]
		private BasePoseProvider m_PoseProviderComponent;

		[SerializeField]
		private TrackingType m_TrackingType;

		[SerializeField]
		private UpdateType m_UpdateType;

		[SerializeField]
		private bool m_UseRelativeTransform;

		protected Pose m_OriginPose;

		public DeviceType deviceType
		{
			get
			{
				return m_Device;
			}
			internal set
			{
				m_Device = value;
			}
		}

		public TrackedPose poseSource
		{
			get
			{
				return m_PoseSource;
			}
			internal set
			{
				m_PoseSource = value;
			}
		}

		public BasePoseProvider poseProviderComponent
		{
			get
			{
				return m_PoseProviderComponent;
			}
			set
			{
				m_PoseProviderComponent = value;
			}
		}

		public TrackingType trackingType
		{
			get
			{
				return m_TrackingType;
			}
			set
			{
				m_TrackingType = value;
			}
		}

		public UpdateType updateType
		{
			get
			{
				return m_UpdateType;
			}
			set
			{
				m_UpdateType = value;
			}
		}

		public bool UseRelativeTransform
		{
			get
			{
				return m_UseRelativeTransform;
			}
			set
			{
				m_UseRelativeTransform = value;
			}
		}

		public Pose originPose
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_OriginPose;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_OriginPose = value;
			}
		}

		public bool SetPoseSource(DeviceType deviceType, TrackedPose pose)
		{
			if ((int)deviceType < TrackedPoseDriverDataDescription.DeviceData.Count)
			{
				TrackedPoseDriverDataDescription.PoseData poseData = TrackedPoseDriverDataDescription.DeviceData[(int)deviceType];
				for (int i = 0; i < poseData.Poses.Count; i++)
				{
					if (poseData.Poses[i] == pose)
					{
						this.deviceType = deviceType;
						poseSource = pose;
						return true;
					}
				}
			}
			return false;
		}

		private PoseDataFlags GetPoseData(DeviceType device, TrackedPose poseSource, out Pose resultPose)
		{
			if (!((Object)(object)m_PoseProviderComponent != (Object)null))
			{
				return PoseDataSource.GetDataFromSource(poseSource, out resultPose);
			}
			return m_PoseProviderComponent.GetPoseFromProvider(out resultPose);
		}

		private void CacheLocalPosition()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			m_OriginPose.position = ((Component)this).transform.localPosition;
			m_OriginPose.rotation = ((Component)this).transform.localRotation;
		}

		private void ResetToCachedLocalPosition()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			SetLocalTransform(m_OriginPose.position, m_OriginPose.rotation, PoseDataFlags.Position | PoseDataFlags.Rotation);
		}

		protected virtual void Awake()
		{
			CacheLocalPosition();
		}

		protected virtual void OnDestroy()
		{
		}

		protected virtual void OnEnable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			Application.onBeforeRender += new UnityAction(OnBeforeRender);
		}

		protected virtual void OnDisable()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			ResetToCachedLocalPosition();
			Application.onBeforeRender -= new UnityAction(OnBeforeRender);
		}

		protected virtual void FixedUpdate()
		{
			if (m_UpdateType == UpdateType.Update || m_UpdateType == UpdateType.UpdateAndBeforeRender)
			{
				PerformUpdate();
			}
		}

		protected virtual void Update()
		{
			if (m_UpdateType == UpdateType.Update || m_UpdateType == UpdateType.UpdateAndBeforeRender)
			{
				PerformUpdate();
			}
		}

		[BeforeRenderOrder(-30000)]
		protected virtual void OnBeforeRender()
		{
			if (m_UpdateType == UpdateType.BeforeRender || m_UpdateType == UpdateType.UpdateAndBeforeRender)
			{
				PerformUpdate();
			}
		}

		protected virtual void SetLocalTransform(Vector3 newPosition, Quaternion newRotation, PoseDataFlags poseFlags)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if ((m_TrackingType == TrackingType.RotationAndPosition || m_TrackingType == TrackingType.RotationOnly) && (poseFlags & PoseDataFlags.Rotation) > PoseDataFlags.NoData)
			{
				((Component)this).transform.localRotation = newRotation;
			}
			if ((m_TrackingType == TrackingType.RotationAndPosition || m_TrackingType == TrackingType.PositionOnly) && (poseFlags & PoseDataFlags.Position) > PoseDataFlags.NoData)
			{
				((Component)this).transform.localPosition = newPosition;
			}
		}

		protected Pose TransformPoseByOriginIfNeeded(Pose pose)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			if (m_UseRelativeTransform)
			{
				return ((Pose)(ref pose)).GetTransformedBy(m_OriginPose);
			}
			return pose;
		}

		private bool HasStereoCamera()
		{
			Camera component = ((Component)this).GetComponent<Camera>();
			if ((Object)(object)component != (Object)null)
			{
				return component.stereoEnabled;
			}
			return false;
		}

		protected virtual void PerformUpdate()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (((Behaviour)this).enabled)
			{
				Pose resultPose;
				PoseDataFlags poseData = GetPoseData(m_Device, m_PoseSource, out resultPose);
				if (poseData != 0)
				{
					Pose val = TransformPoseByOriginIfNeeded(resultPose);
					SetLocalTransform(val.position, val.rotation, poseData);
				}
			}
		}
	}
}
namespace UnityEngine.Experimental.XR.Interaction
{
	[Serializable]
	public abstract class BasePoseProvider : MonoBehaviour
	{
		public virtual PoseDataFlags GetPoseFromProvider(out Pose output)
		{
			if (TryGetPoseFromProvider(out output))
			{
				return PoseDataFlags.Position | PoseDataFlags.Rotation;
			}
			return PoseDataFlags.NoData;
		}

		[Obsolete("This function is provided for backwards compatibility with the BasePoseProvider found in com.unity.xr.legacyinputhelpers v1.3.X. Please do not implement this function, instead use the new API via GetPoseFromProvider", false)]
		public virtual bool TryGetPoseFromProvider(out Pose output)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			output = Pose.identity;
			return false;
		}
	}
}

BepInEx\plugins\Cyberhead\UnityEngine.XR.LegacyInputHelpers.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.Experimental.XR.Interaction;
using UnityEngine.SpatialTracking;
using UnityEngine.XR;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: InternalsVisibleTo("UnityEditor.XR.LegacyInputHelpers")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace UnityEditor.XR.LegacyInputHelpers
{
	public enum UserRequestedTrackingMode
	{
		Default,
		Device,
		Floor
	}
	[AddComponentMenu("XR/Camera Offset")]
	public class CameraOffset : MonoBehaviour
	{
		private const float k_DefaultCameraYOffset = 1.36144f;

		[SerializeField]
		[Tooltip("GameObject to move to desired height off the floor (defaults to this object if none provided).")]
		private GameObject m_CameraFloorOffsetObject;

		[SerializeField]
		[Tooltip("What the user wants the tracking origin mode to be")]
		private UserRequestedTrackingMode m_RequestedTrackingMode;

		[SerializeField]
		[Tooltip("Sets the type of tracking origin to use for this Rig. Tracking origins identify where 0,0,0 is in the world of tracking.")]
		private TrackingOriginModeFlags m_TrackingOriginMode;

		[SerializeField]
		[Tooltip("Set if the XR experience is Room Scale or Stationary.")]
		private TrackingSpaceType m_TrackingSpace;

		[SerializeField]
		[Tooltip("Camera Height to be used when in Device tracking space.")]
		private float m_CameraYOffset = 1.36144f;

		private bool m_CameraInitialized;

		private bool m_CameraInitializing;

		private static List<XRInputSubsystem> s_InputSubsystems = new List<XRInputSubsystem>();

		public GameObject cameraFloorOffsetObject
		{
			get
			{
				return m_CameraFloorOffsetObject;
			}
			set
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				m_CameraFloorOffsetObject = value;
				UpdateTrackingOrigin(m_TrackingOriginMode);
			}
		}

		public UserRequestedTrackingMode requestedTrackingMode
		{
			get
			{
				return m_RequestedTrackingMode;
			}
			set
			{
				m_RequestedTrackingMode = value;
				TryInitializeCamera();
			}
		}

		public TrackingOriginModeFlags TrackingOriginMode
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_TrackingOriginMode;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_TrackingOriginMode = value;
				TryInitializeCamera();
			}
		}

		[Obsolete("CameraOffset.trackingSpace is obsolete.  Please use CameraOffset.trackingOriginMode.")]
		public TrackingSpaceType trackingSpace
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_TrackingSpace;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_TrackingSpace = value;
				TryInitializeCamera();
			}
		}

		public float cameraYOffset
		{
			get
			{
				return m_CameraYOffset;
			}
			set
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				m_CameraYOffset = value;
				UpdateTrackingOrigin(m_TrackingOriginMode);
			}
		}

		private void UpgradeTrackingSpaceToTrackingOriginMode()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Invalid comparison between Unknown and I4
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if ((int)m_TrackingOriginMode != 0 || (int)m_TrackingSpace > 1)
			{
				return;
			}
			TrackingSpaceType val = m_TrackingSpace;
			if ((int)val != 0)
			{
				if ((int)val == 1)
				{
					m_TrackingOriginMode = (TrackingOriginModeFlags)2;
				}
			}
			else
			{
				m_TrackingOriginMode = (TrackingOriginModeFlags)1;
			}
			m_TrackingSpace = (TrackingSpaceType)3;
		}

		private void Awake()
		{
			if (!Object.op_Implicit((Object)(object)m_CameraFloorOffsetObject))
			{
				Debug.LogWarning((object)"No camera container specified for XR Rig, using attached GameObject");
				m_CameraFloorOffsetObject = ((Component)this).gameObject;
			}
		}

		private void Start()
		{
			TryInitializeCamera();
		}

		private void OnValidate()
		{
			UpgradeTrackingSpaceToTrackingOriginMode();
			TryInitializeCamera();
		}

		private void TryInitializeCamera()
		{
			m_CameraInitialized = SetupCamera();
			if (!m_CameraInitialized & !m_CameraInitializing)
			{
				((MonoBehaviour)this).StartCoroutine(RepeatInitializeCamera());
			}
		}

		private IEnumerator RepeatInitializeCamera()
		{
			m_CameraInitializing = true;
			yield return null;
			while (!m_CameraInitialized)
			{
				m_CameraInitialized = SetupCamera();
				yield return null;
			}
			m_CameraInitializing = false;
		}

		private bool SetupCamera()
		{
			SubsystemManager.GetInstances<XRInputSubsystem>(s_InputSubsystems);
			bool flag = true;
			if (s_InputSubsystems.Count != 0)
			{
				for (int i = 0; i < s_InputSubsystems.Count; i++)
				{
					bool flag2 = SetupCamera(s_InputSubsystems[i]);
					if (flag2)
					{
						s_InputSubsystems[i].trackingOriginUpdated -= OnTrackingOriginUpdated;
						s_InputSubsystems[i].trackingOriginUpdated += OnTrackingOriginUpdated;
					}
					flag = flag && flag2;
				}
			}
			else if (m_RequestedTrackingMode == UserRequestedTrackingMode.Floor)
			{
				SetupCameraLegacy((TrackingSpaceType)1);
			}
			else
			{
				SetupCameraLegacy((TrackingSpaceType)0);
			}
			return flag;
		}

		private bool SetupCamera(XRInputSubsystem subsystem)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Invalid comparison between Unknown and I4
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Invalid comparison between Unknown and I4
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			if (subsystem == null)
			{
				return false;
			}
			bool flag = false;
			TrackingOriginModeFlags trackingOriginMode = subsystem.GetTrackingOriginMode();
			TrackingOriginModeFlags supportedTrackingOriginModes = subsystem.GetSupportedTrackingOriginModes();
			TrackingOriginModeFlags val = (TrackingOriginModeFlags)0;
			if (m_RequestedTrackingMode == UserRequestedTrackingMode.Default)
			{
				val = trackingOriginMode;
			}
			else if (m_RequestedTrackingMode == UserRequestedTrackingMode.Device)
			{
				val = (TrackingOriginModeFlags)1;
			}
			else if (m_RequestedTrackingMode == UserRequestedTrackingMode.Floor)
			{
				val = (TrackingOriginModeFlags)2;
			}
			else
			{
				Debug.LogWarning((object)"Unknown Requested Tracking Mode");
			}
			if ((int)val == 2)
			{
				if ((supportedTrackingOriginModes & 2) == 0)
				{
					Debug.LogWarning((object)"CameraOffset.SetupCamera: Attempting to set the tracking space to Floor, but that is not supported by the SDK.");
				}
				else
				{
					flag = subsystem.TrySetTrackingOriginMode(val);
				}
			}
			else if ((int)val == 1)
			{
				if ((supportedTrackingOriginModes & 1) == 0)
				{
					Debug.LogWarning((object)"CameraOffset.SetupCamera: Attempting to set the tracking space to Device, but that is not supported by the SDK.");
				}
				else
				{
					flag = subsystem.TrySetTrackingOriginMode(val) && subsystem.TryRecenter();
				}
			}
			if (flag)
			{
				UpdateTrackingOrigin(subsystem.GetTrackingOriginMode());
			}
			return flag;
		}

		private void UpdateTrackingOrigin(TrackingOriginModeFlags trackingOriginModeFlags)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Invalid comparison between Unknown and I4
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			m_TrackingOriginMode = trackingOriginModeFlags;
			if ((Object)(object)m_CameraFloorOffsetObject != (Object)null)
			{
				m_CameraFloorOffsetObject.transform.localPosition = new Vector3(m_CameraFloorOffsetObject.transform.localPosition.x, ((int)m_TrackingOriginMode == 1) ? cameraYOffset : 0f, m_CameraFloorOffsetObject.transform.localPosition.z);
			}
		}

		private void OnTrackingOriginUpdated(XRInputSubsystem subsystem)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			UpdateTrackingOrigin(subsystem.GetTrackingOriginMode());
		}

		private void OnDestroy()
		{
			SubsystemManager.GetInstances<XRInputSubsystem>(s_InputSubsystems);
			foreach (XRInputSubsystem s_InputSubsystem in s_InputSubsystems)
			{
				s_InputSubsystem.trackingOriginUpdated -= OnTrackingOriginUpdated;
			}
		}

		private void SetupCameraLegacy(TrackingSpaceType trackingSpace)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Invalid comparison between Unknown and I4
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			float num = m_CameraYOffset;
			XRDevice.SetTrackingSpaceType(trackingSpace);
			if ((int)trackingSpace == 0)
			{
				InputTracking.Recenter();
			}
			else if ((int)trackingSpace == 1)
			{
				num = 0f;
			}
			m_TrackingSpace = trackingSpace;
			if (Object.op_Implicit((Object)(object)m_CameraFloorOffsetObject))
			{
				m_CameraFloorOffsetObject.transform.localPosition = new Vector3(m_CameraFloorOffsetObject.transform.localPosition.x, num, m_CameraFloorOffsetObject.transform.localPosition.z);
			}
		}
	}
}
namespace UnityEngine.XR.LegacyInputHelpers
{
	public class ArmModel : BasePoseProvider
	{
		private Pose m_FinalPose;

		[SerializeField]
		private XRNode m_PoseSource = (XRNode)4;

		[SerializeField]
		private XRNode m_HeadPoseSource = (XRNode)2;

		[SerializeField]
		private Vector3 m_ElbowRestPosition = DEFAULT_ELBOW_REST_POSITION;

		[SerializeField]
		private Vector3 m_WristRestPosition = DEFAULT_WRIST_REST_POSITION;

		[SerializeField]
		private Vector3 m_ControllerRestPosition = DEFAULT_CONTROLLER_REST_POSITION;

		[SerializeField]
		private Vector3 m_ArmExtensionOffset = DEFAULT_ARM_EXTENSION_OFFSET;

		[Range(0f, 1f)]
		[SerializeField]
		private float m_ElbowBendRatio = 0.6f;

		[SerializeField]
		private bool m_IsLockedToNeck = true;

		protected Vector3 m_NeckPosition;

		protected Vector3 m_ElbowPosition;

		protected Quaternion m_ElbowRotation;

		protected Vector3 m_WristPosition;

		protected Quaternion m_WristRotation;

		protected Vector3 m_ControllerPosition;

		protected Quaternion m_ControllerRotation;

		protected Vector3 m_HandedMultiplier;

		protected Vector3 m_TorsoDirection;

		protected Quaternion m_TorsoRotation;

		protected static readonly Vector3 DEFAULT_ELBOW_REST_POSITION = new Vector3(0.195f, -0.5f, 0.005f);

		protected static readonly Vector3 DEFAULT_WRIST_REST_POSITION = new Vector3(0f, 0f, 0.25f);

		protected static readonly Vector3 DEFAULT_CONTROLLER_REST_POSITION = new Vector3(0f, 0f, 0.05f);

		protected static readonly Vector3 DEFAULT_ARM_EXTENSION_OFFSET = new Vector3(-0.13f, 0.14f, 0.08f);

		protected const float DEFAULT_ELBOW_BEND_RATIO = 0.6f;

		protected const float EXTENSION_WEIGHT = 0.4f;

		protected static readonly Vector3 SHOULDER_POSITION = new Vector3(0.17f, -0.2f, -0.03f);

		protected static readonly Vector3 NECK_OFFSET = new Vector3(0f, 0.075f, 0.08f);

		protected const float MIN_EXTENSION_ANGLE = 7f;

		protected const float MAX_EXTENSION_ANGLE = 60f;

		private List<XRNodeState> xrNodeStateListOrientation = new List<XRNodeState>();

		private List<XRNodeState> xrNodeStateListPosition = new List<XRNodeState>();

		private List<XRNodeState> xrNodeStateListAngularAcceleration = new List<XRNodeState>();

		private List<XRNodeState> xrNodeStateListAngularVelocity = new List<XRNodeState>();

		public Pose finalPose
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_FinalPose;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_FinalPose = value;
			}
		}

		public XRNode poseSource
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_PoseSource;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_PoseSource = value;
			}
		}

		public XRNode headGameObject
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_HeadPoseSource;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_HeadPoseSource = value;
			}
		}

		public Vector3 elbowRestPosition
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_ElbowRestPosition;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_ElbowRestPosition = value;
			}
		}

		public Vector3 wristRestPosition
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_WristRestPosition;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_WristRestPosition = value;
			}
		}

		public Vector3 controllerRestPosition
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_ControllerRestPosition;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_ControllerRestPosition = value;
			}
		}

		public Vector3 armExtensionOffset
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return m_ArmExtensionOffset;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				m_ArmExtensionOffset = value;
			}
		}

		public float elbowBendRatio
		{
			get
			{
				return m_ElbowBendRatio;
			}
			set
			{
				m_ElbowBendRatio = value;
			}
		}

		public bool isLockedToNeck
		{
			get
			{
				return m_IsLockedToNeck;
			}
			set
			{
				m_IsLockedToNeck = value;
			}
		}

		public Vector3 neckPosition => m_NeckPosition;

		public Vector3 shoulderPosition => m_NeckPosition + m_TorsoRotation * Vector3.Scale(SHOULDER_POSITION, m_HandedMultiplier);

		public Quaternion shoulderRotation => m_TorsoRotation;

		public Vector3 elbowPosition => m_ElbowPosition;

		public Quaternion elbowRotation => m_ElbowRotation;

		public Vector3 wristPosition => m_WristPosition;

		public Quaternion wristRotation => m_WristRotation;

		public Vector3 controllerPosition => m_ControllerPosition;

		public Quaternion controllerRotation => m_ControllerRotation;

		public override PoseDataFlags GetPoseFromProvider(out Pose output)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			if (OnControllerInputUpdated())
			{
				output = finalPose;
				return (PoseDataFlags)3;
			}
			output = Pose.identity;
			return (PoseDataFlags)0;
		}

		protected virtual void OnEnable()
		{
			UpdateTorsoDirection(forceImmediate: true);
			OnControllerInputUpdated();
		}

		protected virtual void OnDisable()
		{
		}

		public virtual bool OnControllerInputUpdated()
		{
			UpdateHandedness();
			if (UpdateTorsoDirection(forceImmediate: false) && UpdateNeckPosition() && ApplyArmModel())
			{
				return true;
			}
			return false;
		}

		protected virtual void UpdateHandedness()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Invalid comparison between Unknown and I4
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Invalid comparison between Unknown and I4
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Invalid comparison between Unknown and I4
			((Vector3)(ref m_HandedMultiplier)).Set(0f, 1f, 1f);
			if ((int)m_PoseSource == 5 || (int)m_PoseSource == 7)
			{
				m_HandedMultiplier.x = 1f;
			}
			else if ((int)m_PoseSource == 4)
			{
				m_HandedMultiplier.x = -1f;
			}
		}

		protected virtual bool UpdateTorsoDirection(bool forceImmediate)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			Vector3 forward = default(Vector3);
			if (TryGetForwardVector(m_HeadPoseSource, out forward))
			{
				forward.y = 0f;
				((Vector3)(ref forward)).Normalize();
				Vector3 angularAccel;
				if (forceImmediate)
				{
					m_TorsoDirection = forward;
				}
				else if (TryGetAngularAcceleration(poseSource, out angularAccel))
				{
					float num = Mathf.Clamp((((Vector3)(ref angularAccel)).magnitude - 0.2f) / 45f, 0f, 0.1f);
					m_TorsoDirection = Vector3.Slerp(m_TorsoDirection, forward, num);
				}
				m_TorsoRotation = Quaternion.FromToRotation(Vector3.forward, m_TorsoDirection);
				return true;
			}
			return false;
		}

		protected virtual bool UpdateNeckPosition()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			if (m_IsLockedToNeck && TryGetPosition(m_HeadPoseSource, out m_NeckPosition))
			{
				return ApplyInverseNeckModel(m_NeckPosition, out m_NeckPosition);
			}
			m_NeckPosition = Vector3.zero;
			return true;
		}

		protected virtual bool ApplyArmModel()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			SetUntransformedJointPositions();
			if (GetControllerRotation(out var rotation, out var xyRotation, out var xAngle))
			{
				float extensionRatio = CalculateExtensionRatio(xAngle);
				ApplyExtensionOffset(extensionRatio);
				Quaternion lerpRotation = CalculateLerpRotation(xyRotation, extensionRatio);
				CalculateFinalJointRotations(rotation, xyRotation, lerpRotation);
				ApplyRotationToJoints();
				m_FinalPose.position = m_ControllerPosition;
				m_FinalPose.rotation = m_ControllerRotation;
				return true;
			}
			return false;
		}

		protected virtual void SetUntransformedJointPositions()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			m_ElbowPosition = Vector3.Scale(m_ElbowRestPosition, m_HandedMultiplier);
			m_WristPosition = Vector3.Scale(m_WristRestPosition, m_HandedMultiplier);
			m_ControllerPosition = Vector3.Scale(m_ControllerRestPosition, m_HandedMultiplier);
		}

		protected virtual float CalculateExtensionRatio(float xAngle)
		{
			return Mathf.Clamp((xAngle - 7f) / 53f, 0f, 1f);
		}

		protected virtual void ApplyExtensionOffset(float extensionRatio)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = Vector3.Scale(m_ArmExtensionOffset, m_HandedMultiplier);
			m_ElbowPosition += val * extensionRatio;
		}

		protected virtual Quaternion CalculateLerpRotation(Quaternion xyRotation, float extensionRatio)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			float num = Quaternion.Angle(xyRotation, Quaternion.identity);
			float num2 = 1f - Mathf.Pow(num / 180f, 6f);
			float num3 = 1f - m_ElbowBendRatio + m_ElbowBendRatio * extensionRatio * 0.4f;
			num3 *= num2;
			return Quaternion.Lerp(Quaternion.identity, xyRotation, num3);
		}

		protected virtual void CalculateFinalJointRotations(Quaternion controllerOrientation, Quaternion xyRotation, Quaternion lerpRotation)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			m_ElbowRotation = m_TorsoRotation * Quaternion.Inverse(lerpRotation) * xyRotation;
			m_WristRotation = m_ElbowRotation * lerpRotation;
			m_ControllerRotation = m_TorsoRotation * controllerOrientation;
		}

		protected virtual void ApplyRotationToJoints()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			m_ElbowPosition = m_NeckPosition + m_TorsoRotation * m_ElbowPosition;
			m_WristPosition = m_ElbowPosition + m_ElbowRotation * m_WristPosition;
			m_ControllerPosition = m_WristPosition + m_WristRotation * m_ControllerPosition;
		}

		protected virtual bool ApplyInverseNeckModel(Vector3 headPosition, out Vector3 calculatedPosition)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = default(Quaternion);
			if (TryGetRotation(m_HeadPoseSource, out rotation))
			{
				Vector3 val = rotation * NECK_OFFSET - NECK_OFFSET.y * Vector3.up;
				headPosition -= val;
				calculatedPosition = headPosition;
				return true;
			}
			calculatedPosition = Vector3.zero;
			return false;
		}

		protected bool TryGetForwardVector(XRNode node, out Vector3 forward)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			Pose val = default(Pose);
			if (TryGetRotation(node, out val.rotation) && TryGetPosition(node, out val.position))
			{
				forward = ((Pose)(ref val)).forward;
				return true;
			}
			forward = Vector3.zero;
			return false;
		}

		protected bool TryGetRotation(XRNode node, out Quaternion rotation)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			InputTracking.GetNodeStates(xrNodeStateListOrientation);
			int count = xrNodeStateListOrientation.Count;
			for (int i = 0; i < count; i++)
			{
				XRNodeState val = xrNodeStateListOrientation[i];
				if (((XRNodeState)(ref val)).nodeType == node && ((XRNodeState)(ref val)).TryGetRotation(ref rotation))
				{
					return true;
				}
			}
			rotation = Quaternion.identity;
			return false;
		}

		protected bool TryGetPosition(XRNode node, out Vector3 position)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			InputTracking.GetNodeStates(xrNodeStateListPosition);
			int count = xrNodeStateListPosition.Count;
			for (int i = 0; i < count; i++)
			{
				XRNodeState val = xrNodeStateListPosition[i];
				if (((XRNodeState)(ref val)).nodeType == node && ((XRNodeState)(ref val)).TryGetPosition(ref position))
				{
					return true;
				}
			}
			position = Vector3.zero;
			return false;
		}

		protected bool TryGetAngularAcceleration(XRNode node, out Vector3 angularAccel)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			InputTracking.GetNodeStates(xrNodeStateListAngularAcceleration);
			int count = xrNodeStateListAngularAcceleration.Count;
			for (int i = 0; i < count; i++)
			{
				XRNodeState val = xrNodeStateListAngularAcceleration[i];
				if (((XRNodeState)(ref val)).nodeType == node && ((XRNodeState)(ref val)).TryGetAngularAcceleration(ref angularAccel))
				{
					return true;
				}
			}
			angularAccel = Vector3.zero;
			return false;
		}

		protected bool TryGetAngularVelocity(XRNode node, out Vector3 angVel)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			InputTracking.GetNodeStates(xrNodeStateListAngularVelocity);
			int count = xrNodeStateListAngularVelocity.Count;
			for (int i = 0; i < count; i++)
			{
				XRNodeState val = xrNodeStateListAngularVelocity[i];
				if (((XRNodeState)(ref val)).nodeType == node && ((XRNodeState)(ref val)).TryGetAngularVelocity(ref angVel))
				{
					return true;
				}
			}
			angVel = Vector3.zero;
			return false;
		}

		protected bool GetControllerRotation(out Quaternion rotation, out Quaternion xyRotation, out float xAngle)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			if (TryGetRotation(poseSource, out rotation))
			{
				rotation = Quaternion.Inverse(m_TorsoRotation) * rotation;
				Vector3 val = rotation * Vector3.forward;
				xAngle = 90f - Vector3.Angle(val, Vector3.up);
				xyRotation = Quaternion.FromToRotation(Vector3.forward, val);
				return true;
			}
			rotation = Quaternion.identity;
			xyRotation = Quaternion.identity;
			xAngle = 0f;
			return false;
		}
	}
	public class SwingArmModel : ArmModel
	{
		[Tooltip("Portion of controller rotation applied to the shoulder joint.")]
		[SerializeField]
		[Range(0f, 1f)]
		private float m_ShoulderRotationRatio = 0.5f;

		[Tooltip("Portion of controller rotation applied to the elbow joint.")]
		[Range(0f, 1f)]
		[SerializeField]
		private float m_ElbowRotationRatio = 0.3f;

		[Tooltip("Portion of controller rotation applied to the wrist joint.")]
		[Range(0f, 1f)]
		[SerializeField]
		private float m_WristRotationRatio = 0.2f;

		[SerializeField]
		private Vector2 m_JointShiftAngle = new Vector2(160f, 180f);

		[Tooltip("Exponent applied to the joint shift ratio to control the curve of the shift.")]
		[Range(1f, 20f)]
		[SerializeField]
		private float m_JointShiftExponent = 6f;

		[Tooltip("Portion of controller rotation applied to the shoulder joint when the controller is backwards.")]
		[Range(0f, 1f)]
		[SerializeField]
		private float m_ShiftedShoulderRotationRatio = 0.1f;

		[Tooltip("Portion of controller rotation applied to the elbow joint when the controller is backwards.")]
		[Range(0f, 1f)]
		[SerializeField]
		private float m_ShiftedElbowRotationRatio = 0.4f;

		[Tooltip("Portion of controller rotation applied to the wrist joint when the controller is backwards.")]
		[Range(0f, 1f)]
		[SerializeField]
		private float m_ShiftedWristRotationRatio = 0.5f;

		public float shoulderRotationRatio
		{
			get
			{
				return m_ShoulderRotationRatio;
			}
			set
			{
				m_ShoulderRotationRatio = value;
			}
		}

		public float elbowRotationRatio
		{
			get
			{
				return m_ElbowRotationRatio;
			}
			set
			{
				m_ElbowRotationRatio = value;
			}
		}

		public float wristRotationRatio
		{
			get
			{
				return m_WristRotationRatio;
			}
			set
			{
				m_WristRotationRatio = value;
			}
		}

		public float minJointShiftAngle
		{
			get
			{
				return m_JointShiftAngle.x;
			}
			set
			{
				m_JointShiftAngle.x = value;
			}
		}

		public float maxJointShiftAngle
		{
			get
			{
				return m_JointShiftAngle.y;
			}
			set
			{
				m_JointShiftAngle.y = value;
			}
		}

		public float jointShiftExponent
		{
			get
			{
				return m_JointShiftExponent;
			}
			set
			{
				m_JointShiftExponent = value;
			}
		}

		public float shiftedShoulderRotationRatio
		{
			get
			{
				return m_ShiftedShoulderRotationRatio;
			}
			set
			{
				m_ShiftedShoulderRotationRatio = value;
			}
		}

		public float shiftedElbowRotationRatio
		{
			get
			{
				return m_ShiftedElbowRotationRatio;
			}
			set
			{
				m_ShiftedElbowRotationRatio = value;
			}
		}

		public float shiftedWristRotationRatio
		{
			get
			{
				return m_ShiftedWristRotationRatio;
			}
			set
			{
				m_ShiftedWristRotationRatio = value;
			}
		}

		protected override void CalculateFinalJointRotations(Quaternion controllerOrientation, Quaternion xyRotation, Quaternion lerpRotation)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			float num = Quaternion.Angle(xyRotation, Quaternion.identity);
			float num2 = maxJointShiftAngle - minJointShiftAngle;
			float num3 = Mathf.Pow(Mathf.Clamp01((num - minJointShiftAngle) / num2), m_JointShiftExponent);
			float num4 = Mathf.Lerp(m_ShoulderRotationRatio, m_ShiftedShoulderRotationRatio, num3);
			float num5 = Mathf.Lerp(m_ElbowRotationRatio, m_ShiftedElbowRotationRatio, num3);
			float num6 = Mathf.Lerp(m_WristRotationRatio, m_ShiftedWristRotationRatio, num3);
			Quaternion val = Quaternion.Lerp(Quaternion.identity, xyRotation, num4);
			Quaternion val2 = Quaternion.Lerp(Quaternion.identity, xyRotation, num5);
			Quaternion val3 = Quaternion.Lerp(Quaternion.identity, xyRotation, num6);
			Quaternion val4 = m_TorsoRotation * val;
			m_ElbowRotation = val4 * val2;
			m_WristRotation = base.elbowRotation * val3;
			m_ControllerRotation = m_TorsoRotation * controllerOrientation;
			m_TorsoRotation = val4;
		}
	}
	[Serializable]
	public class ArmModelTransition
	{
		[SerializeField]
		private string m_KeyName;

		[SerializeField]
		private ArmModel m_ArmModel;

		public string transitionKeyName
		{
			get
			{
				return m_KeyName;
			}
			set
			{
				m_KeyName = value;
			}
		}

		public ArmModel armModel
		{
			get
			{
				return m_ArmModel;
			}
			set
			{
				m_ArmModel = value;
			}
		}
	}
	public class TransitionArmModel : ArmModel
	{
		internal struct ArmModelBlendData
		{
			public ArmModel armModel;

			public float currentBlendAmount;
		}

		[SerializeField]
		private ArmModel m_CurrentArmModelComponent;

		[SerializeField]
		public List<ArmModelTransition> m_ArmModelTransitions = new List<ArmModelTransition>();

		private const int MAX_ACTIVE_TRANSITIONS = 10;

		private const float DROP_TRANSITION_THRESHOLD = 0.035f;

		private const float LERP_CLAMP_THRESHOLD = 0.95f;

		private const float MIN_ANGULAR_VELOCITY = 0.2f;

		private const float ANGULAR_VELOCITY_DIVISOR = 45f;

		internal List<ArmModelBlendData> armModelBlendData = new List<ArmModelBlendData>(10);

		private ArmModelBlendData currentBlendingArmModel;

		public ArmModel currentArmModelComponent
		{
			get
			{
				return m_CurrentArmModelComponent;
			}
			set
			{
				m_CurrentArmModelComponent = value;
			}
		}

		public bool Queue(string key)
		{
			foreach (ArmModelTransition armModelTransition in m_ArmModelTransitions)
			{
				if (armModelTransition.transitionKeyName == key)
				{
					Queue(armModelTransition.armModel);
					return true;
				}
			}
			return false;
		}

		public void Queue(ArmModel newArmModel)
		{
			if (!((Object)(object)newArmModel == (Object)null))
			{
				if ((Object)(object)m_CurrentArmModelComponent == (Object)null)
				{
					m_CurrentArmModelComponent = newArmModel;
				}
				RemoveJustStartingTransitions();
				if (armModelBlendData.Count == 10)
				{
					RemoveOldestTransition();
				}
				ArmModelBlendData item = default(ArmModelBlendData);
				item.armModel = newArmModel;
				item.currentBlendAmount = 0f;
				armModelBlendData.Add(item);
			}
		}

		private void RemoveJustStartingTransitions()
		{
			for (int i = 0; i < armModelBlendData.Count; i++)
			{
				if (armModelBlendData[i].currentBlendAmount < 0.035f)
				{
					armModelBlendData.RemoveAt(i);
				}
			}
		}

		private void RemoveOldestTransition()
		{
			armModelBlendData.RemoveAt(0);
		}

		public override PoseDataFlags GetPoseFromProvider(out Pose output)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			if (UpdateBlends())
			{
				output = base.finalPose;
				return (PoseDataFlags)3;
			}
			output = Pose.identity;
			return (PoseDataFlags)0;
		}

		private bool UpdateBlends()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)currentArmModelComponent == (Object)null)
			{
				return false;
			}
			if (m_CurrentArmModelComponent.OnControllerInputUpdated())
			{
				m_NeckPosition = m_CurrentArmModelComponent.neckPosition;
				m_ElbowPosition = m_CurrentArmModelComponent.elbowPosition;
				m_WristPosition = m_CurrentArmModelComponent.wristPosition;
				m_ControllerPosition = m_CurrentArmModelComponent.controllerPosition;
				m_ElbowRotation = m_CurrentArmModelComponent.elbowRotation;
				m_WristRotation = m_CurrentArmModelComponent.wristRotation;
				m_ControllerRotation = m_CurrentArmModelComponent.controllerRotation;
				if (TryGetAngularVelocity(base.poseSource, out var angVel) && armModelBlendData.Count > 0)
				{
					float num = Mathf.Clamp((((Vector3)(ref angVel)).magnitude - 0.2f) / 45f, 0f, 0.1f);
					for (int i = 0; i < armModelBlendData.Count; i++)
					{
						ArmModelBlendData value = armModelBlendData[i];
						value.currentBlendAmount = Mathf.Lerp(value.currentBlendAmount, 1f, num);
						if (value.currentBlendAmount > 0.95f)
						{
							value.currentBlendAmount = 1f;
						}
						else
						{
							value.armModel.OnControllerInputUpdated();
							m_NeckPosition = Vector3.Slerp(base.neckPosition, value.armModel.neckPosition, value.currentBlendAmount);
							m_ElbowPosition = Vector3.Slerp(base.elbowPosition, value.armModel.elbowPosition, value.currentBlendAmount);
							m_WristPosition = Vector3.Slerp(base.wristPosition, value.armModel.wristPosition, value.currentBlendAmount);
							m_ControllerPosition = Vector3.Slerp(base.controllerPosition, value.armModel.controllerPosition, value.currentBlendAmount);
							m_ElbowRotation = Quaternion.Slerp(base.elbowRotation, value.armModel.elbowRotation, value.currentBlendAmount);
							m_WristRotation = Quaternion.Slerp(base.wristRotation, value.armModel.wristRotation, value.currentBlendAmount);
							m_ControllerRotation = Quaternion.Slerp(base.controllerRotation, value.armModel.controllerRotation, value.currentBlendAmount);
						}
						armModelBlendData[i] = value;
						if (value.currentBlendAmount >= 1f)
						{
							m_CurrentArmModelComponent = value.armModel;
							armModelBlendData.RemoveRange(0, i + 1);
						}
					}
				}
				else if (armModelBlendData.Count > 0)
				{
					Debug.LogErrorFormat((Object)(object)((Component)this).gameObject, "Unable to get angular acceleration for node", Array.Empty<object>());
					return false;
				}
				base.finalPose = new Pose(base.controllerPosition, base.controllerRotation);
				return true;
			}
			return false;
		}
	}
}

BepInEx\plugins\Cyberhead\UnityEngine.XRModule.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Microsoft.CodeAnalysis;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Rendering;
using UnityEngine.Scripting;

[assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsNativeModule")]
[assembly: InternalsVisibleTo("UnityEngine.UIModule")]
[assembly: InternalsVisibleTo("UnityEngine.TilemapModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreTextEngineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextCoreFontEngineModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")]
[assembly: InternalsVisibleTo("UnityEngine.SubsystemsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UmbraModule")]
[assembly: InternalsVisibleTo("UnityEngine.StreamingModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")]
[assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")]
[assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")]
[assembly: InternalsVisibleTo("UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule")]
[assembly: InternalsVisibleTo("UnityEngine.TerrainModule")]
[assembly: InternalsVisibleTo("UnityEngine.UNETModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityCurlModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")]
[assembly: InternalsVisibleTo("UnityEngine.PS5VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.PS5Module")]
[assembly: InternalsVisibleTo("UnityEngine.PS4VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.PS4Module")]
[assembly: InternalsVisibleTo("UnityEngine.XboxOneModule")]
[assembly: InternalsVisibleTo("UnityEngine.SwitchModule")]
[assembly: InternalsVisibleTo("UnityEngine.WindModule")]
[assembly: InternalsVisibleTo("UnityEngine.VRModule")]
[assembly: InternalsVisibleTo("UnityEngine.XRModule")]
[assembly: InternalsVisibleTo("UnityEngine.VirtualTexturingModule")]
[assembly: InternalsVisibleTo("UnityEngine.VideoModule")]
[assembly: InternalsVisibleTo("UnityEngine.VFXModule")]
[assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")]
[assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")]
[assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")]
[assembly: InternalsVisibleTo("UnityEngine.Networking")]
[assembly: InternalsVisibleTo("UnityEngine.AudioModule")]
[assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")]
[assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")]
[assembly: InternalsVisibleTo("UnityEngine.ARModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputModule")]
[assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")]
[assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClothModule")]
[assembly: InternalsVisibleTo("UnityEngine.AnimationModule")]
[assembly: InternalsVisibleTo("UnityEngine.AIModule")]
[assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")]
[assembly: InternalsVisibleTo("UnityEngine.CoreModule")]
[assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")]
[assembly: InternalsVisibleTo("UnityEngine")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: InternalsVisibleTo("UnityEngine.AndroidJNIModule")]
[assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")]
[assembly: InternalsVisibleTo("UnityEngine.NVIDIAModule")]
[assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")]
[assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")]
[assembly: InternalsVisibleTo("UnityEngine.InputLegacyModule")]
[assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")]
[assembly: InternalsVisibleTo("UnityEngine.GridModule")]
[assembly: InternalsVisibleTo("UnityEngine.GIModule")]
[assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")]
[assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")]
[assembly: InternalsVisibleTo("UnityEngine.DSPGraphModule")]
[assembly: InternalsVisibleTo("UnityEngine.DirectorModule")]
[assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")]
[assembly: InternalsVisibleTo("UnityEngine.TLSModule")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsCommonModule")]
[assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud")]
[assembly: InternalsVisibleTo("Unity.Analytics")]
[assembly: CompilationRelaxations(8)]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")]
[assembly: InternalsVisibleTo("Unity.Core")]
[assembly: InternalsVisibleTo("Unity.Runtime")]
[assembly: InternalsVisibleTo("Unity.Collections")]
[assembly: InternalsVisibleTo("Unity.Entities.Tests")]
[assembly: InternalsVisibleTo("Unity.Entities")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")]
[assembly: InternalsVisibleTo("Unity.Subsystem.Registration")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")]
[assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")]
[assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")]
[assembly: InternalsVisibleTo("Unity.Services.QoS")]
[assembly: InternalsVisibleTo("Unity.Logging")]
[assembly: InternalsVisibleTo("Unity.Networking.Transport")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")]
[assembly: InternalsVisibleTo("Unity.IntegrationTests")]
[assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")]
[assembly: InternalsVisibleTo("Unity.Burst.Editor")]
[assembly: InternalsVisibleTo("Unity.Burst")]
[assembly: InternalsVisibleTo("Unity.Automation")]
[assembly: InternalsVisibleTo("UnityEngine.TestRunner")]
[assembly: InternalsVisibleTo("UnityEngine.Purchasing")]
[assembly: InternalsVisibleTo("UnityEngine.Advertisements")]
[assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsCommon")]
[assembly: InternalsVisibleTo("UnityEngine.Analytics")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")]
[assembly: InternalsVisibleTo("Unity.ucg.QoS")]
[assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")]
[assembly: InternalsVisibleTo("Unity.Timeline")]
[assembly: InternalsVisibleTo("UnityEngine.UI")]
[assembly: InternalsVisibleTo("Unity.UIElements.EditorTests")]
[assembly: InternalsVisibleTo("Unity.UIElements.PlayModeTests")]
[assembly: InternalsVisibleTo("Unity.UIElements.Editor")]
[assembly: InternalsVisibleTo("UnityEngine.UIElementsGameObjectsModule")]
[assembly: InternalsVisibleTo("Unity.UIElements")]
[assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")]
[assembly: InternalsVisibleTo("UnityEditor.UIBuilderModule")]
[assembly: InternalsVisibleTo("Unity.UI.Builder.EditorTests")]
[assembly: InternalsVisibleTo("Unity.2D.Sprite.EditorTests")]
[assembly: InternalsVisibleTo("Unity.2D.Sprite.Editor")]
[assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")]
[assembly: InternalsVisibleTo("GoogleAR.UnityNative")]
[assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")]
[assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")]
[assembly: InternalsVisibleTo("Assembly-CSharp-testable")]
[assembly: InternalsVisibleTo("Unity.UI.Builder.Editor")]
[assembly: UnityEngineModuleAssembly]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[Microsoft.CodeAnalysis.Embedded]
	[CompilerGenerated]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
}
namespace UnityEngine.XR
{
	[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputTrackingFacade.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[RequiredByNativeCode]
	[NativeConditional("ENABLE_VR")]
	public static class InputTracking
	{
		private enum TrackingStateEventType
		{
			NodeAdded,
			NodeRemoved,
			TrackingAcquired,
			TrackingLost
		}

		[Obsolete("This API is obsolete, and should no longer be used. Please use the TrackedPoseDriver in the Legacy Input Helpers package for controlling a camera in XR.")]
		[NativeConditional("ENABLE_VR")]
		public static extern bool disablePositionalTracking
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("GetPositionalTrackingDisabled")]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			[NativeName("SetPositionalTrackingDisabled")]
			set;
		}

		public static event Action<XRNodeState> trackingAcquired;

		public static event Action<XRNodeState> trackingLost;

		public static event Action<XRNodeState> nodeAdded;

		public static event Action<XRNodeState> nodeRemoved;

		[RequiredByNativeCode]
		private static void InvokeTrackingEvent(TrackingStateEventType eventType, XRNode nodeType, long uniqueID, bool tracked)
		{
			Action<XRNodeState> action = null;
			XRNodeState obj = default(XRNodeState);
			obj.uniqueID = (ulong)uniqueID;
			obj.nodeType = nodeType;
			obj.tracked = tracked;
			((Action<XRNodeState>)(eventType switch
			{
				TrackingStateEventType.TrackingAcquired => InputTracking.trackingAcquired, 
				TrackingStateEventType.TrackingLost => InputTracking.trackingLost, 
				TrackingStateEventType.NodeAdded => InputTracking.nodeAdded, 
				TrackingStateEventType.NodeRemoved => InputTracking.nodeRemoved, 
				_ => throw new ArgumentException("TrackingEventHandler - Invalid EventType: " + eventType), 
			}))?.Invoke(obj);
		}

		[Obsolete("This API is obsolete, and should no longer be used. Please use InputDevice.TryGetFeatureValue with the CommonUsages.devicePosition usage instead.")]
		[NativeConditional("ENABLE_VR", "Vector3f::zero")]
		public static Vector3 GetLocalPosition(XRNode node)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetLocalPosition_Injected(node, out var ret);
			return ret;
		}

		[Obsolete("This API is obsolete, and should no longer be used. Please use InputDevice.TryGetFeatureValue with the CommonUsages.deviceRotation usage instead.")]
		[NativeConditional("ENABLE_VR", "Quaternionf::identity()")]
		public static Quaternion GetLocalRotation(XRNode node)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			GetLocalRotation_Injected(node, out var ret);
			return ret;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[Obsolete("This API is obsolete, and should no longer be used. Please use XRInputSubsystem.TryRecenter() instead.")]
		[NativeConditional("ENABLE_VR")]
		public static extern void Recenter();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_VR")]
		[Obsolete("This API is obsolete, and should no longer be used. Please use InputDevice.name with the device associated with that tracking data instead.")]
		public static extern string GetNodeName(ulong uniqueId);

		public static void GetNodeStates(List<XRNodeState> nodeStates)
		{
			if (nodeStates == null)
			{
				throw new ArgumentNullException("nodeStates");
			}
			nodeStates.Clear();
			GetNodeStates_Internal(nodeStates);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_VR")]
		private static extern void GetNodeStates_Internal([NotNull("ArgumentNullException")] List<XRNodeState> nodeStates);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputTracking.h")]
		internal static extern ulong GetDeviceIdAtXRNode(XRNode node);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputTracking.h")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		internal static extern void GetDeviceIdsAtXRNode_Internal(XRNode node, [NotNull("ArgumentNullException")] List<ulong> deviceIds);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetLocalPosition_Injected(XRNode node, out Vector3 ret);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetLocalRotation_Injected(XRNode node, out Quaternion ret);
	}
	public enum XRNode
	{
		LeftEye,
		RightEye,
		CenterEye,
		Head,
		LeftHand,
		RightHand,
		GameController,
		TrackingReference,
		HardwareTracker
	}
	[Flags]
	internal enum AvailableTrackingData
	{
		None = 0,
		PositionAvailable = 1,
		RotationAvailable = 2,
		VelocityAvailable = 4,
		AngularVelocityAvailable = 8,
		AccelerationAvailable = 0x10,
		AngularAccelerationAvailable = 0x20
	}
	[UsedByNativeCode]
	public struct XRNodeState
	{
		private XRNode m_Type;

		private AvailableTrackingData m_AvailableFields;

		private Vector3 m_Position;

		private Quaternion m_Rotation;

		private Vector3 m_Velocity;

		private Vector3 m_AngularVelocity;

		private Vector3 m_Acceleration;

		private Vector3 m_AngularAcceleration;

		private int m_Tracked;

		private ulong m_UniqueID;

		public ulong uniqueID
		{
			get
			{
				return m_UniqueID;
			}
			set
			{
				m_UniqueID = value;
			}
		}

		public XRNode nodeType
		{
			get
			{
				return m_Type;
			}
			set
			{
				m_Type = value;
			}
		}

		public bool tracked
		{
			get
			{
				return m_Tracked == 1;
			}
			set
			{
				m_Tracked = (value ? 1 : 0);
			}
		}

		public Vector3 position
		{
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				m_Position = value;
				m_AvailableFields |= AvailableTrackingData.PositionAvailable;
			}
		}

		public Quaternion rotation
		{
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				m_Rotation = value;
				m_AvailableFields |= AvailableTrackingData.RotationAvailable;
			}
		}

		public Vector3 velocity
		{
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				m_Velocity = value;
				m_AvailableFields |= AvailableTrackingData.VelocityAvailable;
			}
		}

		public Vector3 angularVelocity
		{
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				m_AngularVelocity = value;
				m_AvailableFields |= AvailableTrackingData.AngularVelocityAvailable;
			}
		}

		public Vector3 acceleration
		{
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				m_Acceleration = value;
				m_AvailableFields |= AvailableTrackingData.AccelerationAvailable;
			}
		}

		public Vector3 angularAcceleration
		{
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				m_AngularAcceleration = value;
				m_AvailableFields |= AvailableTrackingData.AngularAccelerationAvailable;
			}
		}

		public bool TryGetPosition(out Vector3 position)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_Position, AvailableTrackingData.PositionAvailable, out position);
		}

		public bool TryGetRotation(out Quaternion rotation)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_Rotation, AvailableTrackingData.RotationAvailable, out rotation);
		}

		public bool TryGetVelocity(out Vector3 velocity)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_Velocity, AvailableTrackingData.VelocityAvailable, out velocity);
		}

		public bool TryGetAngularVelocity(out Vector3 angularVelocity)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_AngularVelocity, AvailableTrackingData.AngularVelocityAvailable, out angularVelocity);
		}

		public bool TryGetAcceleration(out Vector3 acceleration)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_Acceleration, AvailableTrackingData.AccelerationAvailable, out acceleration);
		}

		public bool TryGetAngularAcceleration(out Vector3 angularAcceleration)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			return TryGet(m_AngularAcceleration, AvailableTrackingData.AngularAccelerationAvailable, out angularAcceleration);
		}

		private bool TryGet(Vector3 inValue, AvailableTrackingData availabilityFlag, out Vector3 outValue)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			if ((m_AvailableFields & availabilityFlag) > AvailableTrackingData.None)
			{
				outValue = inValue;
				return true;
			}
			outValue = Vector3.zero;
			return false;
		}

		private bool TryGet(Quaternion inValue, AvailableTrackingData availabilityFlag, out Quaternion outValue)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			if ((m_AvailableFields & availabilityFlag) > AvailableTrackingData.None)
			{
				outValue = inValue;
				return true;
			}
			outValue = Quaternion.identity;
			return false;
		}
	}
	[NativeConditional("ENABLE_VR")]
	public struct HapticCapabilities : IEquatable<HapticCapabilities>
	{
		private uint m_NumChannels;

		private bool m_SupportsImpulse;

		private bool m_SupportsBuffer;

		private uint m_BufferFrequencyHz;

		private uint m_BufferMaxSize;

		private uint m_BufferOptimalSize;

		public uint numChannels
		{
			get
			{
				return m_NumChannels;
			}
			internal set
			{
				m_NumChannels = value;
			}
		}

		public bool supportsImpulse
		{
			get
			{
				return m_SupportsImpulse;
			}
			internal set
			{
				m_SupportsImpulse = value;
			}
		}

		public bool supportsBuffer
		{
			get
			{
				return m_SupportsBuffer;
			}
			internal set
			{
				m_SupportsBuffer = value;
			}
		}

		public uint bufferFrequencyHz
		{
			get
			{
				return m_BufferFrequencyHz;
			}
			internal set
			{
				m_BufferFrequencyHz = value;
			}
		}

		public uint bufferMaxSize
		{
			get
			{
				return m_BufferMaxSize;
			}
			internal set
			{
				m_BufferMaxSize = value;
			}
		}

		public uint bufferOptimalSize
		{
			get
			{
				return m_BufferOptimalSize;
			}
			internal set
			{
				m_BufferOptimalSize = value;
			}
		}

		public override bool Equals(object obj)
		{
			if (!(obj is HapticCapabilities))
			{
				return false;
			}
			return Equals((HapticCapabilities)obj);
		}

		public bool Equals(HapticCapabilities other)
		{
			return numChannels == other.numChannels && supportsImpulse == other.supportsImpulse && supportsBuffer == other.supportsBuffer && bufferFrequencyHz == other.bufferFrequencyHz && bufferMaxSize == other.bufferMaxSize && bufferOptimalSize == other.bufferOptimalSize;
		}

		public override int GetHashCode()
		{
			return numChannels.GetHashCode() ^ (supportsImpulse.GetHashCode() << 1) ^ (supportsBuffer.GetHashCode() >> 1) ^ (bufferFrequencyHz.GetHashCode() << 2) ^ (bufferMaxSize.GetHashCode() >> 2) ^ (bufferOptimalSize.GetHashCode() << 3);
		}

		public static bool operator ==(HapticCapabilities a, HapticCapabilities b)
		{
			return a.Equals(b);
		}

		public static bool operator !=(HapticCapabilities a, HapticCapabilities b)
		{
			return !(a == b);
		}
	}
	internal enum InputFeatureType : uint
	{
		Custom = 0u,
		Binary = 1u,
		DiscreteStates = 2u,
		Axis1D = 3u,
		Axis2D = 4u,
		Axis3D = 5u,
		Rotation = 6u,
		Hand = 7u,
		Bone = 8u,
		Eyes = 9u,
		kUnityXRInputFeatureTypeInvalid = uint.MaxValue
	}
	internal enum ConnectionChangeType : uint
	{
		Connected,
		Disconnected,
		ConfigChange
	}
	public enum InputDeviceRole : uint
	{
		Unknown,
		Generic,
		LeftHanded,
		RightHanded,
		GameController,
		TrackingReference,
		HardwareTracker,
		LegacyController
	}
	[Flags]
	public enum InputDeviceCharacteristics : uint
	{
		None = 0u,
		HeadMounted = 1u,
		Camera = 2u,
		HeldInHand = 4u,
		HandTracking = 8u,
		EyeTracking = 0x10u,
		TrackedDevice = 0x20u,
		Controller = 0x40u,
		TrackingReference = 0x80u,
		Left = 0x100u,
		Right = 0x200u,
		Simulated6DOF = 0x400u
	}
	[Flags]
	public enum InputTrackingState : uint
	{
		None = 0u,
		Position = 1u,
		Rotation = 2u,
		Velocity = 4u,
		AngularVelocity = 8u,
		Acceleration = 0x10u,
		AngularAcceleration = 0x20u,
		All = 0x3Fu
	}
	[NativeConditional("ENABLE_VR")]
	[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputDevices.h")]
	[RequiredByNativeCode]
	public struct InputFeatureUsage : IEquatable<InputFeatureUsage>
	{
		internal string m_Name;

		[NativeName("m_FeatureType")]
		internal InputFeatureType m_InternalType;

		public string name
		{
			get
			{
				return m_Name;
			}
			internal set
			{
				m_Name = value;
			}
		}

		internal InputFeatureType internalType
		{
			get
			{
				return m_InternalType;
			}
			set
			{
				m_InternalType = value;
			}
		}

		public Type type => m_InternalType switch
		{
			InputFeatureType.Custom => typeof(byte[]), 
			InputFeatureType.Binary => typeof(bool), 
			InputFeatureType.DiscreteStates => typeof(uint), 
			InputFeatureType.Axis1D => typeof(float), 
			InputFeatureType.Axis2D => typeof(Vector2), 
			InputFeatureType.Axis3D => typeof(Vector3), 
			InputFeatureType.Rotation => typeof(Quaternion), 
			InputFeatureType.Hand => typeof(Hand), 
			InputFeatureType.Bone => typeof(Bone), 
			InputFeatureType.Eyes => typeof(Eyes), 
			_ => throw new InvalidCastException("No valid managed type for unknown native type."), 
		};

		internal InputFeatureUsage(string name, InputFeatureType type)
		{
			m_Name = name;
			m_InternalType = type;
		}

		public override bool Equals(object obj)
		{
			if (!(obj is InputFeatureUsage))
			{
				return false;
			}
			return Equals((InputFeatureUsage)obj);
		}

		public bool Equals(InputFeatureUsage other)
		{
			return name == other.name && internalType == other.internalType;
		}

		public override int GetHashCode()
		{
			return name.GetHashCode() ^ (internalType.GetHashCode() << 1);
		}

		public static bool operator ==(InputFeatureUsage a, InputFeatureUsage b)
		{
			return a.Equals(b);
		}

		public static bool operator !=(InputFeatureUsage a, InputFeatureUsage b)
		{
			return !(a == b);
		}

		public InputFeatureUsage<T> As<T>()
		{
			if ((object)type != typeof(T))
			{
				throw new ArgumentException("InputFeatureUsage type does not match out variable type.");
			}
			return new InputFeatureUsage<T>(name);
		}
	}
	public struct InputFeatureUsage<T> : IEquatable<InputFeatureUsage<T>>
	{
		public string name { get; set; }

		private Type usageType => typeof(T);

		public InputFeatureUsage(string usageName)
		{
			name = usageName;
		}

		public override bool Equals(object obj)
		{
			if (!(obj is InputFeatureUsage<T>))
			{
				return false;
			}
			return Equals((InputFeatureUsage<T>)obj);
		}

		public bool Equals(InputFeatureUsage<T> other)
		{
			return name == other.name;
		}

		public override int GetHashCode()
		{
			return name.GetHashCode();
		}

		public static bool operator ==(InputFeatureUsage<T> a, InputFeatureUsage<T> b)
		{
			return a.Equals(b);
		}

		public static bool operator !=(InputFeatureUsage<T> a, InputFeatureUsage<T> b)
		{
			return !(a == b);
		}

		public static explicit operator InputFeatureUsage(InputFeatureUsage<T> self)
		{
			InputFeatureType inputFeatureType = InputFeatureType.kUnityXRInputFeatureTypeInvalid;
			Type type = self.usageType;
			if ((object)type == typeof(bool))
			{
				inputFeatureType = InputFeatureType.Binary;
			}
			else if ((object)type == typeof(uint))
			{
				inputFeatureType = InputFeatureType.DiscreteStates;
			}
			else if ((object)type == typeof(float))
			{
				inputFeatureType = InputFeatureType.Axis1D;
			}
			else if ((object)type == typeof(Vector2))
			{
				inputFeatureType = InputFeatureType.Axis2D;
			}
			else if ((object)type == typeof(Vector3))
			{
				inputFeatureType = InputFeatureType.Axis3D;
			}
			else if ((object)type == typeof(Quaternion))
			{
				inputFeatureType = InputFeatureType.Rotation;
			}
			else if ((object)type == typeof(Hand))
			{
				inputFeatureType = InputFeatureType.Hand;
			}
			else if ((object)type == typeof(Bone))
			{
				inputFeatureType = InputFeatureType.Bone;
			}
			else if ((object)type == typeof(Eyes))
			{
				inputFeatureType = InputFeatureType.Eyes;
			}
			else if ((object)type == typeof(byte[]))
			{
				inputFeatureType = InputFeatureType.Custom;
			}
			else if (type.IsEnum)
			{
				inputFeatureType = InputFeatureType.DiscreteStates;
			}
			if (inputFeatureType != InputFeatureType.kUnityXRInputFeatureTypeInvalid)
			{
				return new InputFeatureUsage(self.name, inputFeatureType);
			}
			throw new InvalidCastException("No valid InputFeatureType for " + self.name + ".");
		}
	}
	public static class CommonUsages
	{
		public static InputFeatureUsage<bool> isTracked = new InputFeatureUsage<bool>("IsTracked");

		public static InputFeatureUsage<bool> primaryButton = new InputFeatureUsage<bool>("PrimaryButton");

		public static InputFeatureUsage<bool> primaryTouch = new InputFeatureUsage<bool>("PrimaryTouch");

		public static InputFeatureUsage<bool> secondaryButton = new InputFeatureUsage<bool>("SecondaryButton");

		public static InputFeatureUsage<bool> secondaryTouch = new InputFeatureUsage<bool>("SecondaryTouch");

		public static InputFeatureUsage<bool> gripButton = new InputFeatureUsage<bool>("GripButton");

		public static InputFeatureUsage<bool> triggerButton = new InputFeatureUsage<bool>("TriggerButton");

		public static InputFeatureUsage<bool> menuButton = new InputFeatureUsage<bool>("MenuButton");

		public static InputFeatureUsage<bool> primary2DAxisClick = new InputFeatureUsage<bool>("Primary2DAxisClick");

		public static InputFeatureUsage<bool> primary2DAxisTouch = new InputFeatureUsage<bool>("Primary2DAxisTouch");

		public static InputFeatureUsage<bool> secondary2DAxisClick = new InputFeatureUsage<bool>("Secondary2DAxisClick");

		public static InputFeatureUsage<bool> secondary2DAxisTouch = new InputFeatureUsage<bool>("Secondary2DAxisTouch");

		public static InputFeatureUsage<bool> userPresence = new InputFeatureUsage<bool>("UserPresence");

		public static InputFeatureUsage<InputTrackingState> trackingState = new InputFeatureUsage<InputTrackingState>("TrackingState");

		public static InputFeatureUsage<float> batteryLevel = new InputFeatureUsage<float>("BatteryLevel");

		public static InputFeatureUsage<float> trigger = new InputFeatureUsage<float>("Trigger");

		public static InputFeatureUsage<float> grip = new InputFeatureUsage<float>("Grip");

		public static InputFeatureUsage<Vector2> primary2DAxis = new InputFeatureUsage<Vector2>("Primary2DAxis");

		public static InputFeatureUsage<Vector2> secondary2DAxis = new InputFeatureUsage<Vector2>("Secondary2DAxis");

		public static InputFeatureUsage<Vector3> devicePosition = new InputFeatureUsage<Vector3>("DevicePosition");

		public static InputFeatureUsage<Vector3> leftEyePosition = new InputFeatureUsage<Vector3>("LeftEyePosition");

		public static InputFeatureUsage<Vector3> rightEyePosition = new InputFeatureUsage<Vector3>("RightEyePosition");

		public static InputFeatureUsage<Vector3> centerEyePosition = new InputFeatureUsage<Vector3>("CenterEyePosition");

		public static InputFeatureUsage<Vector3> colorCameraPosition = new InputFeatureUsage<Vector3>("CameraPosition");

		public static InputFeatureUsage<Vector3> deviceVelocity = new InputFeatureUsage<Vector3>("DeviceVelocity");

		public static InputFeatureUsage<Vector3> deviceAngularVelocity = new InputFeatureUsage<Vector3>("DeviceAngularVelocity");

		public static InputFeatureUsage<Vector3> leftEyeVelocity = new InputFeatureUsage<Vector3>("LeftEyeVelocity");

		public static InputFeatureUsage<Vector3> leftEyeAngularVelocity = new InputFeatureUsage<Vector3>("LeftEyeAngularVelocity");

		public static InputFeatureUsage<Vector3> rightEyeVelocity = new InputFeatureUsage<Vector3>("RightEyeVelocity");

		public static InputFeatureUsage<Vector3> rightEyeAngularVelocity = new InputFeatureUsage<Vector3>("RightEyeAngularVelocity");

		public static InputFeatureUsage<Vector3> centerEyeVelocity = new InputFeatureUsage<Vector3>("CenterEyeVelocity");

		public static InputFeatureUsage<Vector3> centerEyeAngularVelocity = new InputFeatureUsage<Vector3>("CenterEyeAngularVelocity");

		public static InputFeatureUsage<Vector3> colorCameraVelocity = new InputFeatureUsage<Vector3>("CameraVelocity");

		public static InputFeatureUsage<Vector3> colorCameraAngularVelocity = new InputFeatureUsage<Vector3>("CameraAngularVelocity");

		public static InputFeatureUsage<Vector3> deviceAcceleration = new InputFeatureUsage<Vector3>("DeviceAcceleration");

		public static InputFeatureUsage<Vector3> deviceAngularAcceleration = new InputFeatureUsage<Vector3>("DeviceAngularAcceleration");

		public static InputFeatureUsage<Vector3> leftEyeAcceleration = new InputFeatureUsage<Vector3>("LeftEyeAcceleration");

		public static InputFeatureUsage<Vector3> leftEyeAngularAcceleration = new InputFeatureUsage<Vector3>("LeftEyeAngularAcceleration");

		public static InputFeatureUsage<Vector3> rightEyeAcceleration = new InputFeatureUsage<Vector3>("RightEyeAcceleration");

		public static InputFeatureUsage<Vector3> rightEyeAngularAcceleration = new InputFeatureUsage<Vector3>("RightEyeAngularAcceleration");

		public static InputFeatureUsage<Vector3> centerEyeAcceleration = new InputFeatureUsage<Vector3>("CenterEyeAcceleration");

		public static InputFeatureUsage<Vector3> centerEyeAngularAcceleration = new InputFeatureUsage<Vector3>("CenterEyeAngularAcceleration");

		public static InputFeatureUsage<Vector3> colorCameraAcceleration = new InputFeatureUsage<Vector3>("CameraAcceleration");

		public static InputFeatureUsage<Vector3> colorCameraAngularAcceleration = new InputFeatureUsage<Vector3>("CameraAngularAcceleration");

		public static InputFeatureUsage<Quaternion> deviceRotation = new InputFeatureUsage<Quaternion>("DeviceRotation");

		public static InputFeatureUsage<Quaternion> leftEyeRotation = new InputFeatureUsage<Quaternion>("LeftEyeRotation");

		public static InputFeatureUsage<Quaternion> rightEyeRotation = new InputFeatureUsage<Quaternion>("RightEyeRotation");

		public static InputFeatureUsage<Quaternion> centerEyeRotation = new InputFeatureUsage<Quaternion>("CenterEyeRotation");

		public static InputFeatureUsage<Quaternion> colorCameraRotation = new InputFeatureUsage<Quaternion>("CameraRotation");

		public static InputFeatureUsage<Hand> handData = new InputFeatureUsage<Hand>("HandData");

		public static InputFeatureUsage<Eyes> eyesData = new InputFeatureUsage<Eyes>("EyesData");

		[Obsolete("CommonUsages.dPad is not used by any XR platform and will be removed.")]
		public static InputFeatureUsage<Vector2> dPad = new InputFeatureUsage<Vector2>("DPad");

		[Obsolete("CommonUsages.indexFinger is not used by any XR platform and will be removed.")]
		public static InputFeatureUsage<float> indexFinger = new InputFeatureUsage<float>("IndexFinger");

		[Obsolete("CommonUsages.MiddleFinger is not used by any XR platform and will be removed.")]
		public static InputFeatureUsage<float> middleFinger = new InputFeatureUsage<float>("MiddleFinger");

		[Obsolete("CommonUsages.RingFinger is not used by any XR platform and will be removed.")]
		public static InputFeatureUsage<float> ringFinger = new InputFeatureUsage<float>("RingFinger");

		[Obsolete("CommonUsages.PinkyFinger is not used by any XR platform and will be removed.")]
		public static InputFeatureUsage<float> pinkyFinger = new InputFeatureUsage<float>("PinkyFinger");

		[Obsolete("CommonUsages.thumbrest is Oculus only, and is being moved to their package. Please use OculusUsages.thumbrest. These will still function until removed.")]
		public static InputFeatureUsage<bool> thumbrest = new InputFeatureUsage<bool>("Thumbrest");

		[Obsolete("CommonUsages.indexTouch is Oculus only, and is being moved to their package.  Please use OculusUsages.indexTouch. These will still function until removed.")]
		public static InputFeatureUsage<float> indexTouch = new InputFeatureUsage<float>("IndexTouch");

		[Obsolete("CommonUsages.thumbTouch is Oculus only, and is being moved to their package.  Please use OculusUsages.thumbTouch. These will still function until removed.")]
		public static InputFeatureUsage<float> thumbTouch = new InputFeatureUsage<float>("ThumbTouch");
	}
	[UsedByNativeCode]
	[NativeConditional("ENABLE_VR")]
	public struct InputDevice : IEquatable<InputDevice>
	{
		private static List<XRInputSubsystem> s_InputSubsystemCache;

		private ulong m_DeviceId;

		private bool m_Initialized;

		private ulong deviceId => m_Initialized ? m_DeviceId : ulong.MaxValue;

		public XRInputSubsystem subsystem
		{
			get
			{
				if (s_InputSubsystemCache == null)
				{
					s_InputSubsystemCache = new List<XRInputSubsystem>();
				}
				if (m_Initialized)
				{
					uint num = (uint)(m_DeviceId >> 32);
					SubsystemManager.GetSubsystems<XRInputSubsystem>(s_InputSubsystemCache);
					for (int i = 0; i < s_InputSubsystemCache.Count; i++)
					{
						if (num == s_InputSubsystemCache[i].GetIndex())
						{
							return s_InputSubsystemCache[i];
						}
					}
				}
				return null;
			}
		}

		public bool isValid => IsValidId() && InputDevices.IsDeviceValid(m_DeviceId);

		public string name => IsValidId() ? InputDevices.GetDeviceName(m_DeviceId) : null;

		[Obsolete("This API has been marked as deprecated and will be removed in future versions. Please use InputDevice.characteristics instead.")]
		public InputDeviceRole role => IsValidId() ? InputDevices.GetDeviceRole(m_DeviceId) : InputDeviceRole.Unknown;

		public string manufacturer => IsValidId() ? InputDevices.GetDeviceManufacturer(m_DeviceId) : null;

		public string serialNumber => IsValidId() ? InputDevices.GetDeviceSerialNumber(m_DeviceId) : null;

		public InputDeviceCharacteristics characteristics => IsValidId() ? InputDevices.GetDeviceCharacteristics(m_DeviceId) : InputDeviceCharacteristics.None;

		internal InputDevice(ulong deviceId)
		{
			m_DeviceId = deviceId;
			m_Initialized = true;
		}

		private bool IsValidId()
		{
			return deviceId != ulong.MaxValue;
		}

		public bool SendHapticImpulse(uint channel, float amplitude, float duration = 1f)
		{
			if (!IsValidId())
			{
				return false;
			}
			if (amplitude < 0f)
			{
				throw new ArgumentException("Amplitude of SendHapticImpulse cannot be negative.");
			}
			if (duration < 0f)
			{
				throw new ArgumentException("Duration of SendHapticImpulse cannot be negative.");
			}
			return InputDevices.SendHapticImpulse(m_DeviceId, channel, amplitude, duration);
		}

		public bool SendHapticBuffer(uint channel, byte[] buffer)
		{
			if (!IsValidId())
			{
				return false;
			}
			return InputDevices.SendHapticBuffer(m_DeviceId, channel, buffer);
		}

		public bool TryGetHapticCapabilities(out HapticCapabilities capabilities)
		{
			if (CheckValidAndSetDefault<HapticCapabilities>(out capabilities))
			{
				return InputDevices.TryGetHapticCapabilities(m_DeviceId, out capabilities);
			}
			return false;
		}

		public void StopHaptics()
		{
			if (IsValidId())
			{
				InputDevices.StopHaptics(m_DeviceId);
			}
		}

		public bool TryGetFeatureUsages(List<InputFeatureUsage> featureUsages)
		{
			if (IsValidId())
			{
				return InputDevices.TryGetFeatureUsages(m_DeviceId, featureUsages);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<bool> usage, out bool value)
		{
			if (CheckValidAndSetDefault<bool>(out value))
			{
				return InputDevices.TryGetFeatureValue_bool(m_DeviceId, usage.name, out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<uint> usage, out uint value)
		{
			if (CheckValidAndSetDefault<uint>(out value))
			{
				return InputDevices.TryGetFeatureValue_UInt32(m_DeviceId, usage.name, out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<float> usage, out float value)
		{
			if (CheckValidAndSetDefault<float>(out value))
			{
				return InputDevices.TryGetFeatureValue_float(m_DeviceId, usage.name, out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<Vector2> usage, out Vector2 value)
		{
			if (CheckValidAndSetDefault<Vector2>(out value))
			{
				return InputDevices.TryGetFeatureValue_Vector2f(m_DeviceId, usage.name, out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<Vector3> usage, out Vector3 value)
		{
			if (CheckValidAndSetDefault<Vector3>(out value))
			{
				return InputDevices.TryGetFeatureValue_Vector3f(m_DeviceId, usage.name, out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<Quaternion> usage, out Quaternion value)
		{
			if (CheckValidAndSetDefault<Quaternion>(out value))
			{
				return InputDevices.TryGetFeatureValue_Quaternionf(m_DeviceId, usage.name, out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<Hand> usage, out Hand value)
		{
			if (CheckValidAndSetDefault<Hand>(out value))
			{
				return InputDevices.TryGetFeatureValue_XRHand(m_DeviceId, usage.name, out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<Bone> usage, out Bone value)
		{
			if (CheckValidAndSetDefault<Bone>(out value))
			{
				return InputDevices.TryGetFeatureValue_XRBone(m_DeviceId, usage.name, out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<Eyes> usage, out Eyes value)
		{
			if (CheckValidAndSetDefault<Eyes>(out value))
			{
				return InputDevices.TryGetFeatureValue_XREyes(m_DeviceId, usage.name, out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<byte[]> usage, byte[] value)
		{
			if (IsValidId())
			{
				return InputDevices.TryGetFeatureValue_Custom(m_DeviceId, usage.name, value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<InputTrackingState> usage, out InputTrackingState value)
		{
			if (IsValidId())
			{
				uint value2 = 0u;
				if (InputDevices.TryGetFeatureValue_UInt32(m_DeviceId, usage.name, out value2))
				{
					value = (InputTrackingState)value2;
					return true;
				}
			}
			value = InputTrackingState.None;
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<bool> usage, DateTime time, out bool value)
		{
			if (CheckValidAndSetDefault<bool>(out value))
			{
				return InputDevices.TryGetFeatureValueAtTime_bool(m_DeviceId, usage.name, TimeConverter.LocalDateTimeToUnixTimeMilliseconds(time), out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<uint> usage, DateTime time, out uint value)
		{
			if (CheckValidAndSetDefault<uint>(out value))
			{
				return InputDevices.TryGetFeatureValueAtTime_UInt32(m_DeviceId, usage.name, TimeConverter.LocalDateTimeToUnixTimeMilliseconds(time), out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<float> usage, DateTime time, out float value)
		{
			if (CheckValidAndSetDefault<float>(out value))
			{
				return InputDevices.TryGetFeatureValueAtTime_float(m_DeviceId, usage.name, TimeConverter.LocalDateTimeToUnixTimeMilliseconds(time), out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<Vector2> usage, DateTime time, out Vector2 value)
		{
			if (CheckValidAndSetDefault<Vector2>(out value))
			{
				return InputDevices.TryGetFeatureValueAtTime_Vector2f(m_DeviceId, usage.name, TimeConverter.LocalDateTimeToUnixTimeMilliseconds(time), out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<Vector3> usage, DateTime time, out Vector3 value)
		{
			if (CheckValidAndSetDefault<Vector3>(out value))
			{
				return InputDevices.TryGetFeatureValueAtTime_Vector3f(m_DeviceId, usage.name, TimeConverter.LocalDateTimeToUnixTimeMilliseconds(time), out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<Quaternion> usage, DateTime time, out Quaternion value)
		{
			if (CheckValidAndSetDefault<Quaternion>(out value))
			{
				return InputDevices.TryGetFeatureValueAtTime_Quaternionf(m_DeviceId, usage.name, TimeConverter.LocalDateTimeToUnixTimeMilliseconds(time), out value);
			}
			return false;
		}

		public bool TryGetFeatureValue(InputFeatureUsage<InputTrackingState> usage, DateTime time, out InputTrackingState value)
		{
			if (IsValidId())
			{
				uint value2 = 0u;
				if (InputDevices.TryGetFeatureValueAtTime_UInt32(m_DeviceId, usage.name, TimeConverter.LocalDateTimeToUnixTimeMilliseconds(time), out value2))
				{
					value = (InputTrackingState)value2;
					return true;
				}
			}
			value = InputTrackingState.None;
			return false;
		}

		private bool CheckValidAndSetDefault<T>(out T value)
		{
			value = default(T);
			return IsValidId();
		}

		public override bool Equals(object obj)
		{
			if (!(obj is InputDevice))
			{
				return false;
			}
			return Equals((InputDevice)obj);
		}

		public bool Equals(InputDevice other)
		{
			return deviceId == other.deviceId;
		}

		public override int GetHashCode()
		{
			return deviceId.GetHashCode();
		}

		public static bool operator ==(InputDevice a, InputDevice b)
		{
			return a.Equals(b);
		}

		public static bool operator !=(InputDevice a, InputDevice b)
		{
			return !(a == b);
		}
	}
	internal static class TimeConverter
	{
		private static readonly DateTime s_Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

		public static DateTime now => DateTime.Now;

		public static long LocalDateTimeToUnixTimeMilliseconds(DateTime date)
		{
			return Convert.ToInt64((date.ToUniversalTime() - s_Epoch).TotalMilliseconds);
		}

		public static DateTime UnixTimeMillisecondsToLocalDateTime(long unixTimeInMilliseconds)
		{
			DateTime dateTime = s_Epoch;
			return dateTime.AddMilliseconds(unixTimeInMilliseconds).ToLocalTime();
		}
	}
	public enum HandFinger
	{
		Thumb,
		Index,
		Middle,
		Ring,
		Pinky
	}
	[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputDevices.h")]
	[NativeHeader("XRScriptingClasses.h")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeConditional("ENABLE_VR")]
	[RequiredByNativeCode]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public struct Hand : IEquatable<Hand>
	{
		private ulong m_DeviceId;

		private uint m_FeatureIndex;

		internal ulong deviceId => m_DeviceId;

		internal uint featureIndex => m_FeatureIndex;

		public bool TryGetRootBone(out Bone boneOut)
		{
			return Hand_TryGetRootBone(this, out boneOut);
		}

		private static bool Hand_TryGetRootBone(Hand hand, out Bone boneOut)
		{
			return Hand_TryGetRootBone_Injected(ref hand, out boneOut);
		}

		public bool TryGetFingerBones(HandFinger finger, List<Bone> bonesOut)
		{
			if (bonesOut == null)
			{
				throw new ArgumentNullException("bonesOut");
			}
			return Hand_TryGetFingerBonesAsList(this, finger, bonesOut);
		}

		private static bool Hand_TryGetFingerBonesAsList(Hand hand, HandFinger finger, [NotNull("ArgumentNullException")] List<Bone> bonesOut)
		{
			return Hand_TryGetFingerBonesAsList_Injected(ref hand, finger, bonesOut);
		}

		public override bool Equals(object obj)
		{
			if (!(obj is Hand))
			{
				return false;
			}
			return Equals((Hand)obj);
		}

		public bool Equals(Hand other)
		{
			return deviceId == other.deviceId && featureIndex == other.featureIndex;
		}

		public override int GetHashCode()
		{
			return deviceId.GetHashCode() ^ (featureIndex.GetHashCode() << 1);
		}

		public static bool operator ==(Hand a, Hand b)
		{
			return a.Equals(b);
		}

		public static bool operator !=(Hand a, Hand b)
		{
			return !(a == b);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Hand_TryGetRootBone_Injected(ref Hand hand, out Bone boneOut);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Hand_TryGetFingerBonesAsList_Injected(ref Hand hand, HandFinger finger, List<Bone> bonesOut);
	}
	internal enum EyeSide
	{
		Left,
		Right
	}
	[RequiredByNativeCode]
	[NativeHeader("XRScriptingClasses.h")]
	[NativeConditional("ENABLE_VR")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputDevices.h")]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	public struct Eyes : IEquatable<Eyes>
	{
		private ulong m_DeviceId;

		private uint m_FeatureIndex;

		internal ulong deviceId => m_DeviceId;

		internal uint featureIndex => m_FeatureIndex;

		public bool TryGetLeftEyePosition(out Vector3 position)
		{
			return Eyes_TryGetEyePosition(this, EyeSide.Left, out position);
		}

		public bool TryGetRightEyePosition(out Vector3 position)
		{
			return Eyes_TryGetEyePosition(this, EyeSide.Right, out position);
		}

		public bool TryGetLeftEyeRotation(out Quaternion rotation)
		{
			return Eyes_TryGetEyeRotation(this, EyeSide.Left, out rotation);
		}

		public bool TryGetRightEyeRotation(out Quaternion rotation)
		{
			return Eyes_TryGetEyeRotation(this, EyeSide.Right, out rotation);
		}

		private static bool Eyes_TryGetEyePosition(Eyes eyes, EyeSide chirality, out Vector3 position)
		{
			return Eyes_TryGetEyePosition_Injected(ref eyes, chirality, out position);
		}

		private static bool Eyes_TryGetEyeRotation(Eyes eyes, EyeSide chirality, out Quaternion rotation)
		{
			return Eyes_TryGetEyeRotation_Injected(ref eyes, chirality, out rotation);
		}

		public bool TryGetFixationPoint(out Vector3 fixationPoint)
		{
			return Eyes_TryGetFixationPoint(this, out fixationPoint);
		}

		private static bool Eyes_TryGetFixationPoint(Eyes eyes, out Vector3 fixationPoint)
		{
			return Eyes_TryGetFixationPoint_Injected(ref eyes, out fixationPoint);
		}

		public bool TryGetLeftEyeOpenAmount(out float openAmount)
		{
			return Eyes_TryGetEyeOpenAmount(this, EyeSide.Left, out openAmount);
		}

		public bool TryGetRightEyeOpenAmount(out float openAmount)
		{
			return Eyes_TryGetEyeOpenAmount(this, EyeSide.Right, out openAmount);
		}

		private static bool Eyes_TryGetEyeOpenAmount(Eyes eyes, EyeSide chirality, out float openAmount)
		{
			return Eyes_TryGetEyeOpenAmount_Injected(ref eyes, chirality, out openAmount);
		}

		public override bool Equals(object obj)
		{
			if (!(obj is Eyes))
			{
				return false;
			}
			return Equals((Eyes)obj);
		}

		public bool Equals(Eyes other)
		{
			return deviceId == other.deviceId && featureIndex == other.featureIndex;
		}

		public override int GetHashCode()
		{
			return deviceId.GetHashCode() ^ (featureIndex.GetHashCode() << 1);
		}

		public static bool operator ==(Eyes a, Eyes b)
		{
			return a.Equals(b);
		}

		public static bool operator !=(Eyes a, Eyes b)
		{
			return !(a == b);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Eyes_TryGetEyePosition_Injected(ref Eyes eyes, EyeSide chirality, out Vector3 position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Eyes_TryGetEyeRotation_Injected(ref Eyes eyes, EyeSide chirality, out Quaternion rotation);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Eyes_TryGetFixationPoint_Injected(ref Eyes eyes, out Vector3 fixationPoint);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Eyes_TryGetEyeOpenAmount_Injected(ref Eyes eyes, EyeSide chirality, out float openAmount);
	}
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeConditional("ENABLE_VR")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeHeader("XRScriptingClasses.h")]
	[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputDevices.h")]
	[RequiredByNativeCode]
	public struct Bone : IEquatable<Bone>
	{
		private ulong m_DeviceId;

		private uint m_FeatureIndex;

		internal ulong deviceId => m_DeviceId;

		internal uint featureIndex => m_FeatureIndex;

		public bool TryGetPosition(out Vector3 position)
		{
			return Bone_TryGetPosition(this, out position);
		}

		private static bool Bone_TryGetPosition(Bone bone, out Vector3 position)
		{
			return Bone_TryGetPosition_Injected(ref bone, out position);
		}

		public bool TryGetRotation(out Quaternion rotation)
		{
			return Bone_TryGetRotation(this, out rotation);
		}

		private static bool Bone_TryGetRotation(Bone bone, out Quaternion rotation)
		{
			return Bone_TryGetRotation_Injected(ref bone, out rotation);
		}

		public bool TryGetParentBone(out Bone parentBone)
		{
			return Bone_TryGetParentBone(this, out parentBone);
		}

		private static bool Bone_TryGetParentBone(Bone bone, out Bone parentBone)
		{
			return Bone_TryGetParentBone_Injected(ref bone, out parentBone);
		}

		public bool TryGetChildBones(List<Bone> childBones)
		{
			return Bone_TryGetChildBones(this, childBones);
		}

		private static bool Bone_TryGetChildBones(Bone bone, [NotNull("ArgumentNullException")] List<Bone> childBones)
		{
			return Bone_TryGetChildBones_Injected(ref bone, childBones);
		}

		public override bool Equals(object obj)
		{
			if (!(obj is Bone))
			{
				return false;
			}
			return Equals((Bone)obj);
		}

		public bool Equals(Bone other)
		{
			return deviceId == other.deviceId && featureIndex == other.featureIndex;
		}

		public override int GetHashCode()
		{
			return deviceId.GetHashCode() ^ (featureIndex.GetHashCode() << 1);
		}

		public static bool operator ==(Bone a, Bone b)
		{
			return a.Equals(b);
		}

		public static bool operator !=(Bone a, Bone b)
		{
			return !(a == b);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Bone_TryGetPosition_Injected(ref Bone bone, out Vector3 position);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Bone_TryGetRotation_Injected(ref Bone bone, out Quaternion rotation);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Bone_TryGetParentBone_Injected(ref Bone bone, out Bone parentBone);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern bool Bone_TryGetChildBones_Injected(ref Bone bone, List<Bone> childBones);
	}
	[StructLayout(LayoutKind.Sequential)]
	[NativeConditional("ENABLE_VR")]
	[UsedByNativeCode]
	[StaticAccessor(/*Could not decode attribute arguments.*/)]
	[NativeHeader("Modules/XR/Subsystems/Input/Public/XRInputDevices.h")]
	public class InputDevices
	{
		private static List<InputDevice> s_InputDeviceList;

		public static event Action<InputDevice> deviceConnected;

		public static event Action<InputDevice> deviceDisconnected;

		public static event Action<InputDevice> deviceConfigChanged;

		public static InputDevice GetDeviceAtXRNode(XRNode node)
		{
			ulong deviceIdAtXRNode = InputTracking.GetDeviceIdAtXRNode(node);
			return new InputDevice(deviceIdAtXRNode);
		}

		public static void GetDevicesAtXRNode(XRNode node, List<InputDevice> inputDevices)
		{
			if (inputDevices == null)
			{
				throw new ArgumentNullException("inputDevices");
			}
			List<ulong> list = new List<ulong>();
			InputTracking.GetDeviceIdsAtXRNode_Internal(node, list);
			inputDevices.Clear();
			foreach (ulong item2 in list)
			{
				InputDevice item = new InputDevice(item2);
				if (item.isValid)
				{
					inputDevices.Add(item);
				}
			}
		}

		public static void GetDevices(List<InputDevice> inputDevices)
		{
			if (inputDevices == null)
			{
				throw new ArgumentNullException("inputDevices");
			}
			inputDevices.Clear();
			GetDevices_Internal(inputDevices);
		}

		[Obsolete("This API has been marked as deprecated and will be removed in future versions. Please use InputDevices.GetDevicesWithCharacteristics instead.")]
		public static void GetDevicesWithRole(InputDeviceRole role, List<InputDevice> inputDevices)
		{
			if (inputDevices == null)
			{
				throw new ArgumentNullException("inputDevices");
			}
			if (s_InputDeviceList == null)
			{
				s_InputDeviceList = new List<InputDevice>();
			}
			GetDevices_Internal(s_InputDeviceList);
			inputDevices.Clear();
			foreach (InputDevice s_InputDevice in s_InputDeviceList)
			{
				if (s_InputDevice.role == role)
				{
					inputDevices.Add(s_InputDevice);
				}
			}
		}

		public static void GetDevicesWithCharacteristics(InputDeviceCharacteristics desiredCharacteristics, List<InputDevice> inputDevices)
		{
			if (inputDevices == null)
			{
				throw new ArgumentNullException("inputDevices");
			}
			if (s_InputDeviceList == null)
			{
				s_InputDeviceList = new List<InputDevice>();
			}
			GetDevices_Internal(s_InputDeviceList);
			inputDevices.Clear();
			foreach (InputDevice s_InputDevice in s_InputDeviceList)
			{
				if ((s_InputDevice.characteristics & desiredCharacteristics) == desiredCharacteristics)
				{
					inputDevices.Add(s_InputDevice);
				}
			}
		}

		[RequiredByNativeCode]
		private static void InvokeConnectionEvent(ulong deviceId, ConnectionChangeType change)
		{
			switch (change)
			{
			case ConnectionChangeType.Connected:
				if (InputDevices.deviceConnected != null)
				{
					InputDevices.deviceConnected(new InputDevice(deviceId));
				}
				break;
			case ConnectionChangeType.Disconnected:
				if (InputDevices.deviceDisconnected != null)
				{
					InputDevices.deviceDisconnected(new InputDevice(deviceId));
				}
				break;
			case ConnectionChangeType.ConfigChange:
				if (InputDevices.deviceConfigChanged != null)
				{
					InputDevices.deviceConfigChanged(new InputDevice(deviceId));
				}
				break;
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private static extern void GetDevices_Internal([NotNull("ArgumentNullException")] List<InputDevice> inputDevices);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool SendHapticImpulse(ulong deviceId, uint channel, float amplitude, float duration);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool SendHapticBuffer(ulong deviceId, uint channel, [NotNull("ArgumentNullException")] byte[] buffer);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetHapticCapabilities(ulong deviceId, out HapticCapabilities capabilities);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern void StopHaptics(ulong deviceId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureUsages(ulong deviceId, [NotNull("ArgumentNullException")] List<InputFeatureUsage> featureUsages);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_bool(ulong deviceId, string usage, out bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_UInt32(ulong deviceId, string usage, out uint value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_float(ulong deviceId, string usage, out float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_Vector2f(ulong deviceId, string usage, out Vector2 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_Vector3f(ulong deviceId, string usage, out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_Quaternionf(ulong deviceId, string usage, out Quaternion value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_Custom(ulong deviceId, string usage, [Out] byte[] value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValueAtTime_bool(ulong deviceId, string usage, long time, out bool value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValueAtTime_UInt32(ulong deviceId, string usage, long time, out uint value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValueAtTime_float(ulong deviceId, string usage, long time, out float value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValueAtTime_Vector2f(ulong deviceId, string usage, long time, out Vector2 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValueAtTime_Vector3f(ulong deviceId, string usage, long time, out Vector3 value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValueAtTime_Quaternionf(ulong deviceId, string usage, long time, out Quaternion value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_XRHand(ulong deviceId, string usage, out Hand value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_XRBone(ulong deviceId, string usage, out Bone value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool TryGetFeatureValue_XREyes(ulong deviceId, string usage, out Eyes value);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern bool IsDeviceValid(ulong deviceId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern string GetDeviceName(ulong deviceId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern string GetDeviceManufacturer(ulong deviceId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern string GetDeviceSerialNumber(ulong deviceId);

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal static extern InputDeviceCharacteristics GetDeviceCharacteristics(ulong deviceId);

		internal static InputDeviceRole GetDeviceRole(ulong deviceId)
		{
			InputDeviceCharacteristics deviceCharacteristics = GetDeviceCharacteristics(deviceId);
			if ((deviceCharacteristics & (InputDeviceCharacteristics.HeadMounted | InputDeviceCharacteristics.TrackedDevice)) == (InputDeviceCharacteristics.HeadMounted | InputDeviceCharacteristics.TrackedDevice))
			{
				return InputDeviceRole.Generic;
			}
			if ((deviceCharacteristics & (InputDeviceCharacteristics.HeldInHand | InputDeviceCharacteristics.TrackedDevice | InputDeviceCharacteristics.Left)) == (InputDeviceCharacteristics.HeldInHand | InputDeviceCharacteristics.TrackedDevice | InputDeviceCharacteristics.Left))
			{
				return InputDeviceRole.LeftHanded;
			}
			if ((deviceCharacteristics & (InputDeviceCharacteristics.HeldInHand | InputDeviceCharacteristics.TrackedDevice | InputDeviceCharacteristics.Right)) == (InputDeviceCharacteristics.HeldInHand | InputDeviceCharacteristics.TrackedDevice | InputDeviceCharacteristics.Right))
			{
				return InputDeviceRole.RightHanded;
			}
			if ((deviceCharacteristics & InputDeviceCharacteristics.Controller) == InputDeviceCharacteristics.Controller)
			{
				return InputDeviceRole.GameController;
			}
			if ((deviceCharacteristics & (InputDeviceCharacteristics.TrackedDevice | InputDeviceCharacteristics.TrackingReference)) == (InputDeviceCharacteristics.TrackedDevice | InputDeviceCharacteristics.TrackingReference))
			{
				return InputDeviceRole.TrackingReference;
			}
			if ((deviceCharacteristics & InputDeviceCharacteristics.TrackedDevice) == InputDeviceCharacteristics.TrackedDevice)
			{
				return InputDeviceRole.HardwareTracker;
			}
			return InputDeviceRole.Unknown;
		}
	}
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[UsedByNativeCode]
	[NativeType(Header = "Modules/XR/Subsystems/Display/XRDisplaySubsystem.h")]
	[NativeConditional("ENABLE_XR")]
	public class XRDisplaySubsystem : IntegratedSubsystem<XRDisplaySubsystemDescriptor>
	{
		public enum LateLatchNode
		{
			Head,
			LeftHand,
			RightHand
		}

		[Flags]
		public enum TextureLayout
		{
			Texture2DArray = 1,
			SingleTexture2D = 2,
			SeparateTexture2Ds = 4
		}

		public enum ReprojectionMode
		{
			Unspecified,
			PositionAndOrientation,
			OrientationOnly,
			None
		}

		[NativeHeader("Modules/XR/Subsystems/Display/XRDisplaySubsystem.bindings.h")]
		public struct XRRenderParameter
		{
			public Matrix4x4 view;

			public Matrix4x4 projection;

			public Rect viewport;

			public Mesh occlusionMesh;

			public int textureArraySlice;

			public Matrix4x4 previousView;

			public bool isPreviousViewValid;
		}

		[NativeHeader("Runtime/Graphics/RenderTextureDesc.h")]
		[NativeHeader("Modules/XR/Subsystems/Display/XRDisplaySubsystem.bindings.h")]
		[NativeHeader("Runtime/Graphics/CommandBuffer/RenderingCommandBuffer.h")]
		public struct XRRenderPass
		{
			private IntPtr displaySubsystemInstance;

			public int renderPassIndex;

			public RenderTargetIdentifier renderTarget;

			public RenderTextureDescriptor renderTargetDesc;

			public bool hasMotionVectorPass;

			public RenderTargetIdentifier motionVectorRenderTarget;

			public RenderTextureDescriptor motionVectorRenderTargetDesc;

			public bool shouldFillOutDepth;

			public int cullingPassIndex;

			[NativeMethod(Name = "XRRenderPassScriptApi::GetRenderParameter", IsFreeFunction = true, HasExplicitThis = true, ThrowsException = true)]
			[NativeConditional("ENABLE_XR")]
			public void GetRenderParameter(Camera camera, int renderParameterIndex, out XRRenderParameter renderParameter)
			{
				GetRenderParameter_Injected(ref this, camera, renderParameterIndex, out renderParameter);
			}

			[NativeMethod(Name = "XRRenderPassScriptApi::GetRenderParameterCount", IsFreeFunction = true, HasExplicitThis = true)]
			[NativeConditional("ENABLE_XR")]
			public int GetRenderParameterCount()
			{
				return GetRenderParameterCount_Injected(ref this);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			private static extern void GetRenderParameter_Injected(ref XRRenderPass _unity_self, Camera camera, int renderParameterIndex, out XRRenderParameter renderParameter);

			[MethodImpl(MethodImplOptions.InternalCall)]
			private static extern int GetRenderParameterCount_Injected(ref XRRenderPass _unity_self);
		}

		[NativeHeader("Runtime/Graphics/RenderTexture.h")]
		[NativeHeader("Modules/XR/Subsystems/Display/XRDisplaySubsystem.bindings.h")]
		public struct XRBlitParams
		{
			public RenderTexture srcTex;

			public int srcTexArraySlice;

			public Rect srcRect;

			public Rect destRect;
		}

		[NativeHeader("Modules/XR/Subsystems/Display/XRDisplaySubsystem.bindings.h")]
		public struct XRMirrorViewBlitDesc
		{
			private IntPtr displaySubsystemInstance;

			public bool nativeBlitAvailable;

			public bool nativeBlitInvalidStates;

			public int blitParamsCount;

			[NativeMethod(Name = "XRMirrorViewBlitDescScriptApi::GetBlitParameter", IsFreeFunction = true, HasExplicitThis = true)]
			[NativeConditional("ENABLE_XR")]
			public void GetBlitParameter(int blitParameterIndex, out XRBlitParams blitParameter)
			{
				GetBlitParameter_Injected(ref this, blitParameterIndex, out blitParameter);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			private static extern void GetBlitParameter_Injected(ref XRMirrorViewBlitDesc _unity_self, int blitParameterIndex, out XRBlitParams blitParameter);
		}

		[Obsolete("singlePassRenderingDisabled{get;set;} is deprecated. Use textureLayout and supportedTextureLayouts instead.", false)]
		public bool singlePassRenderingDisabled
		{
			get
			{
				return (textureLayout & TextureLayout.Texture2DArray) == 0;
			}
			set
			{
				if (value)
				{
					textureLayout = TextureLayout.SeparateTexture2Ds;
				}
				else if ((supportedTextureLayouts & TextureLayout.Texture2DArray) > (TextureLayout)0)
				{
					textureLayout = TextureLayout.Texture2DArray;
				}
			}
		}

		public extern bool displayOpaque
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern bool contentProtectionEnabled
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float scaleOfAllViewports
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float scaleOfAllRenderTargets
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float zNear
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float zFar
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool sRGB
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern float occlusionMaskScale
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern TextureLayout textureLayout
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern TextureLayout supportedTextureLayouts
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		public extern ReprojectionMode reprojectionMode
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public extern bool disableLegacyRenderer
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public event Action<bool> displayFocusChanged;

		[RequiredByNativeCode]
		private void InvokeDisplayFocusChanged(bool focus)
		{
			if (this.displayFocusChanged != null)
			{
				this.displayFocusChanged(focus);
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void MarkTransformLateLatched(Transform transform, LateLatchNode nodeType);

		public void SetFocusPlane(Vector3 point, Vector3 normal, Vector3 velocity)
		{
			SetFocusPlane_Injected(ref point, ref normal, ref velocity);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern void SetMSAALevel(int level);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern int GetRenderPassCount();

		public void GetRenderPass(int renderPassIndex, out XRRenderPass renderPass)
		{
			if (!Internal_TryGetRenderPass(renderPassIndex, out renderPass))
			{
				throw new IndexOutOfRangeException("renderPassIndex");
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryGetRenderPass")]
		private extern bool Internal_TryGetRenderPass(int renderPassIndex, out XRRenderPass renderPass);

		public void EndRecordingIfLateLatched(Camera camera)
		{
			if (!Internal_TryEndRecordingIfLateLatched(camera) && (Object)(object)camera == (Object)null)
			{
				throw new ArgumentNullException("camera");
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryEndRecordingIfLateLatched")]
		private extern bool Internal_TryEndRecordingIfLateLatched(Camera camera);

		public void BeginRecordingIfLateLatched(Camera camera)
		{
			if (!Internal_TryBeginRecordingIfLateLatched(camera) && (Object)(object)camera == (Object)null)
			{
				throw new ArgumentNullException("camera");
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryBeginRecordingIfLateLatched")]
		private extern bool Internal_TryBeginRecordingIfLateLatched(Camera camera);

		public void GetCullingParameters(Camera camera, int cullingPassIndex, out ScriptableCullingParameters scriptableCullingParameters)
		{
			if (!Internal_TryGetCullingParams(camera, cullingPassIndex, out scriptableCullingParameters))
			{
				if ((Object)(object)camera == (Object)null)
				{
					throw new ArgumentNullException("camera");
				}
				throw new IndexOutOfRangeException("cullingPassIndex");
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeHeader("Runtime/Graphics/ScriptableRenderLoop/ScriptableCulling.h")]
		[NativeMethod("TryGetCullingParams")]
		private extern bool Internal_TryGetCullingParams(Camera camera, int cullingPassIndex, out ScriptableCullingParameters scriptableCullingParameters);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryGetAppGPUTimeLastFrame")]
		public extern bool TryGetAppGPUTimeLastFrame(out float gpuTimeLastFrame);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryGetCompositorGPUTimeLastFrame")]
		public extern bool TryGetCompositorGPUTimeLastFrame(out float gpuTimeLastFrameCompositor);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryGetDroppedFrameCount")]
		public extern bool TryGetDroppedFrameCount(out int droppedFrameCount);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryGetFramePresentCount")]
		public extern bool TryGetFramePresentCount(out int framePresentCount);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryGetDisplayRefreshRate")]
		public extern bool TryGetDisplayRefreshRate(out float displayRefreshRate);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryGetMotionToPhoton")]
		public extern bool TryGetMotionToPhoton(out float motionToPhoton);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "GetTextureForRenderPass", IsThreadSafe = false)]
		[NativeConditional("ENABLE_XR")]
		public extern RenderTexture GetRenderTextureForRenderPass(int renderPass);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "GetSharedDepthTextureForRenderPass", IsThreadSafe = false)]
		[NativeConditional("ENABLE_XR")]
		public extern RenderTexture GetSharedDepthTextureForRenderPass(int renderPass);

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "GetPreferredMirrorViewBlitMode", IsThreadSafe = false)]
		[NativeConditional("ENABLE_XR")]
		public extern int GetPreferredMirrorBlitMode();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		[NativeMethod(Name = "SetPreferredMirrorViewBlitMode", IsThreadSafe = false)]
		public extern void SetPreferredMirrorBlitMode(int blitMode);

		[Obsolete("GetMirrorViewBlitDesc(RenderTexture, out XRMirrorViewBlitDesc) is deprecated. Use GetMirrorViewBlitDesc(RenderTexture, out XRMirrorViewBlitDesc, int) instead.", false)]
		public bool GetMirrorViewBlitDesc(RenderTexture mirrorRt, out XRMirrorViewBlitDesc outDesc)
		{
			return GetMirrorViewBlitDesc(mirrorRt, out outDesc, -1);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "QueryMirrorViewBlitDesc", IsThreadSafe = false)]
		[NativeConditional("ENABLE_XR")]
		public extern bool GetMirrorViewBlitDesc(RenderTexture mirrorRt, out XRMirrorViewBlitDesc outDesc, int mode);

		[Obsolete("AddGraphicsThreadMirrorViewBlit(CommandBuffer, bool) is deprecated. Use AddGraphicsThreadMirrorViewBlit(CommandBuffer, bool, int) instead.", false)]
		public bool AddGraphicsThreadMirrorViewBlit(CommandBuffer cmd, bool allowGraphicsStateInvalidate)
		{
			return AddGraphicsThreadMirrorViewBlit(cmd, allowGraphicsStateInvalidate, -1);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod(Name = "AddGraphicsThreadMirrorViewBlit", IsThreadSafe = false)]
		[NativeHeader("Runtime/Graphics/CommandBuffer/RenderingCommandBuffer.h")]
		[NativeConditional("ENABLE_XR")]
		public extern bool AddGraphicsThreadMirrorViewBlit(CommandBuffer cmd, bool allowGraphicsStateInvalidate, int mode);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void SetFocusPlane_Injected(ref Vector3 point, ref Vector3 normal, ref Vector3 velocity);
	}
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	public struct XRMirrorViewBlitMode
	{
		public const int Default = 0;

		public const int LeftEye = -1;

		public const int RightEye = -2;

		public const int SideBySide = -3;

		public const int SideBySideOcclusionMesh = -4;

		public const int Distort = -5;

		public const int None = -6;
	}
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeType(Header = "Modules/XR/Subsystems/Display/XRDisplaySubsystemDescriptor.h")]
	public struct XRMirrorViewBlitModeDesc
	{
		public int blitMode;

		public string blitModeDesc;
	}
	[UsedByNativeCode]
	[NativeType(Header = "Modules/XR/Subsystems/Display/XRDisplaySubsystemDescriptor.h")]
	public class XRDisplaySubsystemDescriptor : IntegratedSubsystemDescriptor<XRDisplaySubsystem>
	{
		[NativeConditional("ENABLE_XR")]
		public extern bool disablesLegacyVr
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[NativeConditional("ENABLE_XR")]
		public extern bool enableBackBufferMSAA
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeMethod("TryGetAvailableMirrorModeCount")]
		[NativeConditional("ENABLE_XR")]
		public extern int GetAvailableMirrorBlitModeCount();

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		[NativeMethod("TryGetMirrorModeByIndex")]
		public extern void GetMirrorBlitModeByIndex(int index, out XRMirrorViewBlitModeDesc mode);
	}
	public enum TrackingOriginModeFlags
	{
		Unknown = 0,
		Device = 1,
		Floor = 2,
		TrackingReference = 4,
		Unbounded = 8
	}
	[NativeType(Header = "Modules/XR/Subsystems/Input/XRInputSubsystem.h")]
	[NativeConditional("ENABLE_XR")]
	[UsedByNativeCode]
	public class XRInputSubsystem : IntegratedSubsystem<XRInputSubsystemDescriptor>
	{
		private List<ulong> m_DeviceIdsCache;

		public event Action<XRInputSubsystem> trackingOriginUpdated;

		public event Action<XRInputSubsystem> boundaryChanged;

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern uint GetIndex();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool TryRecenter();

		public bool TryGetInputDevices(List<InputDevice> devices)
		{
			if (devices == null)
			{
				throw new ArgumentNullException("devices");
			}
			devices.Clear();
			if (m_DeviceIdsCache == null)
			{
				m_DeviceIdsCache = new List<ulong>();
			}
			m_DeviceIdsCache.Clear();
			TryGetDeviceIds_AsList(m_DeviceIdsCache);
			for (int i = 0; i < m_DeviceIdsCache.Count; i++)
			{
				devices.Add(new InputDevice(m_DeviceIdsCache[i]));
			}
			return true;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern bool TrySetTrackingOriginMode(TrackingOriginModeFlags origin);

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern TrackingOriginModeFlags GetTrackingOriginMode();

		[MethodImpl(MethodImplOptions.InternalCall)]
		public extern TrackingOriginModeFlags GetSupportedTrackingOriginModes();

		public bool TryGetBoundaryPoints(List<Vector3> boundaryPoints)
		{
			if (boundaryPoints == null)
			{
				throw new ArgumentNullException("boundaryPoints");
			}
			return TryGetBoundaryPoints_AsList(boundaryPoints);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool TryGetBoundaryPoints_AsList(List<Vector3> boundaryPoints);

		[RequiredByNativeCode(GenerateProxy = true)]
		private static void InvokeTrackingOriginUpdatedEvent(IntPtr internalPtr)
		{
			IntegratedSubsystem integratedSubsystemByPtr = SubsystemManager.GetIntegratedSubsystemByPtr(internalPtr);
			if (integratedSubsystemByPtr is XRInputSubsystem xRInputSubsystem && xRInputSubsystem.trackingOriginUpdated != null)
			{
				xRInputSubsystem.trackingOriginUpdated(xRInputSubsystem);
			}
		}

		[RequiredByNativeCode(GenerateProxy = true)]
		private static void InvokeBoundaryChangedEvent(IntPtr internalPtr)
		{
			IntegratedSubsystem integratedSubsystemByPtr = SubsystemManager.GetIntegratedSubsystemByPtr(internalPtr);
			if (integratedSubsystemByPtr is XRInputSubsystem xRInputSubsystem && xRInputSubsystem.boundaryChanged != null)
			{
				xRInputSubsystem.boundaryChanged(xRInputSubsystem);
			}
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		internal extern void TryGetDeviceIds_AsList(List<ulong> deviceIds);
	}
	[UsedByNativeCode]
	[NativeConditional("ENABLE_XR")]
	[NativeType(Header = "Modules/XR/Subsystems/Input/XRInputSubsystemDescriptor.h")]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	public class XRInputSubsystemDescriptor : IntegratedSubsystemDescriptor<XRInputSubsystem>
	{
		[NativeConditional("ENABLE_XR")]
		public extern bool disablesLegacyInput
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
		}
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[UsedByNativeCode]
	public struct MeshId : IEquatable<MeshId>
	{
		private static MeshId s_InvalidId = default(MeshId);

		private ulong m_SubId1;

		private ulong m_SubId2;

		public static MeshId InvalidId => s_InvalidId;

		public override string ToString()
		{
			return string.Format("{0}-{1}", m_SubId1.ToString("X16"), m_SubId2.ToString("X16"));
		}

		public override int GetHashCode()
		{
			return m_SubId1.GetHashCode() ^ m_SubId2.GetHashCode();
		}

		public override bool Equals(object obj)
		{
			return obj is MeshId && Equals((MeshId)obj);
		}

		public bool Equals(MeshId other)
		{
			return m_SubId1 == other.m_SubId1 && m_SubId2 == other.m_SubId2;
		}

		public static bool operator ==(MeshId id1, MeshId id2)
		{
			return id1.m_SubId1 == id2.m_SubId1 && id1.m_SubId2 == id2.m_SubId2;
		}

		public static bool operator !=(MeshId id1, MeshId id2)
		{
			return id1.m_SubId1 != id2.m_SubId1 || id1.m_SubId2 != id2.m_SubId2;
		}
	}
	[RequiredByNativeCode]
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	public enum MeshGenerationStatus
	{
		Success,
		InvalidMeshId,
		GenerationAlreadyInProgress,
		Canceled,
		UnknownError
	}
	internal static class HashCodeHelper
	{
		private const int k_HashCodeMultiplier = 486187739;

		public static int Combine(int hash1, int hash2)
		{
			return hash1 * 486187739 + hash2;
		}

		public static int Combine(int hash1, int hash2, int hash3)
		{
			return Combine(Combine(hash1, hash2), hash3);
		}

		public static int Combine(int hash1, int hash2, int hash3, int hash4)
		{
			return Combine(Combine(hash1, hash2, hash3), hash4);
		}

		public static int Combine(int hash1, int hash2, int hash3, int hash4, int hash5)
		{
			return Combine(Combine(hash1, hash2, hash3, hash4), hash5);
		}

		public static int Combine(int hash1, int hash2, int hash3, int hash4, int hash5, int hash6)
		{
			return Combine(Combine(hash1, hash2, hash3, hash4, hash5), hash6);
		}

		public static int Combine(int hash1, int hash2, int hash3, int hash4, int hash5, int hash6, int hash7)
		{
			return Combine(Combine(hash1, hash2, hash3, hash4, hash5, hash6), hash7);
		}

		public static int Combine(int hash1, int hash2, int hash3, int hash4, int hash5, int hash6, int hash7, int hash8)
		{
			return Combine(Combine(hash1, hash2, hash3, hash4, hash5, hash6, hash7), hash8);
		}
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[RequiredByNativeCode]
	public struct MeshGenerationResult : IEquatable<MeshGenerationResult>
	{
		public MeshId MeshId { get; }

		public Mesh Mesh { get; }

		public MeshCollider MeshCollider { get; }

		public MeshGenerationStatus Status { get; }

		public MeshVertexAttributes Attributes { get; }

		public ulong Timestamp { get; }

		public Vector3 Position { get; }

		public Quaternion Rotation { get; }

		public Vector3 Scale { get; }

		public override bool Equals(object obj)
		{
			if (!(obj is MeshGenerationResult))
			{
				return false;
			}
			return Equals((MeshGenerationResult)obj);
		}

		public bool Equals(MeshGenerationResult other)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			int result;
			if (MeshId.Equals(other.MeshId) && ((object)Mesh).Equals((object?)other.Mesh) && ((object)MeshCollider).Equals((object?)other.MeshCollider) && Status == other.Status && Attributes == other.Attributes)
			{
				Vector3 val = Position;
				if (((Vector3)(ref val)).Equals(other.Position))
				{
					Quaternion rotation = Rotation;
					if (((Quaternion)(ref rotation)).Equals(other.Rotation))
					{
						val = Scale;
						result = (((Vector3)(ref val)).Equals(other.Scale) ? 1 : 0);
						goto IL_00a7;
					}
				}
			}
			result = 0;
			goto IL_00a7;
			IL_00a7:
			return (byte)result != 0;
		}

		public static bool operator ==(MeshGenerationResult lhs, MeshGenerationResult rhs)
		{
			return lhs.Equals(rhs);
		}

		public static bool operator !=(MeshGenerationResult lhs, MeshGenerationResult rhs)
		{
			return !lhs.Equals(rhs);
		}

		public override int GetHashCode()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			int hashCode = MeshId.GetHashCode();
			int hashCode2 = ((object)Mesh).GetHashCode();
			int hashCode3 = ((object)MeshCollider).GetHashCode();
			int hashCode4 = ((int)Status).GetHashCode();
			int hashCode5 = ((int)Attributes).GetHashCode();
			Vector3 val = Position;
			int hashCode6 = ((object)(Vector3)(ref val)).GetHashCode();
			Quaternion rotation = Rotation;
			int hashCode7 = ((object)(Quaternion)(ref rotation)).GetHashCode();
			val = Scale;
			return HashCodeHelper.Combine(hashCode, hashCode2, hashCode3, hashCode4, hashCode5, hashCode6, hashCode7, ((object)(Vector3)(ref val)).GetHashCode());
		}
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[UsedByNativeCode]
	[Flags]
	public enum MeshVertexAttributes
	{
		None = 0,
		Normals = 1,
		Tangents = 2,
		UVs = 4,
		Colors = 8
	}
	[Flags]
	[UsedByNativeCode]
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	public enum MeshGenerationOptions
	{
		None = 0,
		ConsumeTransform = 1
	}
	[UsedByNativeCode]
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	public enum MeshChangeState
	{
		Added,
		Updated,
		Removed,
		Unchanged
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[UsedByNativeCode]
	public struct MeshInfo : IEquatable<MeshInfo>
	{
		public MeshId MeshId { get; set; }

		public MeshChangeState ChangeState { get; set; }

		public int PriorityHint { get; set; }

		public override bool Equals(object obj)
		{
			if (!(obj is MeshInfo))
			{
				return false;
			}
			return Equals((MeshInfo)obj);
		}

		public bool Equals(MeshInfo other)
		{
			return MeshId.Equals(other.MeshId) && ChangeState.Equals(other.ChangeState) && PriorityHint.Equals(other.PriorityHint);
		}

		public static bool operator ==(MeshInfo lhs, MeshInfo rhs)
		{
			return lhs.Equals(rhs);
		}

		public static bool operator !=(MeshInfo lhs, MeshInfo rhs)
		{
			return !lhs.Equals(rhs);
		}

		public override int GetHashCode()
		{
			return HashCodeHelper.Combine(MeshId.GetHashCode(), ((int)ChangeState).GetHashCode(), PriorityHint.GetHashCode());
		}
	}
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshBindings.h")]
	[UsedByNativeCode]
	public readonly struct MeshTransform : IEquatable<MeshTransform>
	{
		public MeshId MeshId { get; }

		public ulong Timestamp { get; }

		public Vector3 Position { get; }

		public Quaternion Rotation { get; }

		public Vector3 Scale { get; }

		public MeshTransform(in MeshId meshId, ulong timestamp, in Vector3 position, in Quaternion rotation, in Vector3 scale)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			MeshId = meshId;
			Timestamp = timestamp;
			Position = position;
			Rotation = rotation;
			Scale = scale;
		}

		public override bool Equals(object obj)
		{
			return obj is MeshTransform other && Equals(other);
		}

		public bool Equals(MeshTransform other)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			int result;
			if (MeshId.Equals(other.MeshId) && Timestamp == other.Timestamp)
			{
				Vector3 val = Position;
				if (((Vector3)(ref val)).Equals(other.Position))
				{
					Quaternion rotation = Rotation;
					if (((Quaternion)(ref rotation)).Equals(other.Rotation))
					{
						val = Scale;
						result = (((Vector3)(ref val)).Equals(other.Scale) ? 1 : 0);
						goto IL_006c;
					}
				}
			}
			result = 0;
			goto IL_006c;
			IL_006c:
			return (byte)result != 0;
		}

		public static bool operator ==(MeshTransform lhs, MeshTransform rhs)
		{
			return lhs.Equals(rhs);
		}

		public static bool operator !=(MeshTransform lhs, MeshTransform rhs)
		{
			return !lhs.Equals(rhs);
		}

		public override int GetHashCode()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			int hashCode = MeshId.GetHashCode();
			int hashCode2 = Timestamp.GetHashCode();
			Vector3 val = Position;
			int hashCode3 = ((object)(Vector3)(ref val)).GetHashCode();
			Quaternion rotation = Rotation;
			int hashCode4 = ((object)(Quaternion)(ref rotation)).GetHashCode();
			val = Scale;
			return HashCodeHelper.Combine(hashCode, hashCode2, hashCode3, hashCode4, ((object)(Vector3)(ref val)).GetHashCode());
		}
	}
	[NativeConditional("ENABLE_XR")]
	[NativeHeader("Modules/XR/Subsystems/Meshing/XRMeshingSubsystem.h")]
	[UsedByNativeCode]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	public class XRMeshSubsystem : IntegratedSubsystem<XRMeshSubsystemDescriptor>
	{
		[NativeConditional("ENABLE_XR")]
		private readonly struct MeshTransformList : IDisposable
		{
			private readonly IntPtr m_Self;

			public int Count => GetLength(m_Self);

			public IntPtr Data => GetData(m_Self);

			public MeshTransformList(IntPtr self)
			{
				m_Self = self;
			}

			public void Dispose()
			{
				Dispose(m_Self);
			}

			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("UnityXRMeshTransformList_get_Length")]
			private static extern int GetLength(IntPtr self);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("UnityXRMeshTransformList_get_Data")]
			private static extern IntPtr GetData(IntPtr self);

			[MethodImpl(MethodImplOptions.InternalCall)]
			[FreeFunction("UnityXRMeshTransformList_Dispose")]
			private static extern void Dispose(IntPtr self);
		}

		public extern float meshDensity
		{
			[MethodImpl(MethodImplOptions.InternalCall)]
			get;
			[MethodImpl(MethodImplOptions.InternalCall)]
			set;
		}

		public bool TryGetMeshInfos(List<MeshInfo> meshInfosOut)
		{
			if (meshInfosOut == null)
			{
				throw new ArgumentNullException("meshInfosOut");
			}
			return GetMeshInfosAsList(meshInfosOut);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool GetMeshInfosAsList(List<MeshInfo> meshInfos);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern MeshInfo[] GetMeshInfosAsFixedArray();

		public void GenerateMeshAsync(MeshId meshId, Mesh mesh, MeshCollider meshCollider, MeshVertexAttributes attributes, Action<MeshGenerationResult> onMeshGenerationComplete)
		{
			GenerateMeshAsync(meshId, mesh, meshCollider, attributes, onMeshGenerationComplete, MeshGenerationOptions.None);
		}

		public void GenerateMeshAsync(MeshId meshId, Mesh mesh, MeshCollider meshCollider, MeshVertexAttributes attributes, Action<MeshGenerationResult> onMeshGenerationComplete, MeshGenerationOptions options)
		{
			GenerateMeshAsync_Injected(ref meshId, mesh, meshCollider, attributes, onMeshGenerationComplete, options);
		}

		[RequiredByNativeCode]
		private void InvokeMeshReadyDelegate(MeshGenerationResult result, Action<MeshGenerationResult> onMeshGenerationComplete)
		{
			onMeshGenerationComplete?.Invoke(result);
		}

		public bool SetBoundingVolume(Vector3 origin, Vector3 extents)
		{
			return SetBoundingVolume_Injected(ref origin, ref extents);
		}

		public unsafe NativeArray<MeshTransform> GetUpdatedMeshTransforms(Allocator allocator)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			using MeshTransformList meshTransformList = new MeshTransformList(GetUpdatedMeshTransforms());
			NativeArray<MeshTransform> val = new NativeArray<MeshTransform>(meshTransformList.Count, allocator, (NativeArrayOptions)0);
			UnsafeUtility.MemCpy(NativeArrayUnsafeUtility.GetUnsafePtr<MeshTransform>(val), meshTransformList.Data.ToPointer(), (long)(meshTransformList.Count * System.Runtime.CompilerServices.Unsafe.SizeOf<MeshTransform>()));
			return val;
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern IntPtr GetUpdatedMeshTransforms();

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern void GenerateMeshAsync_Injected(ref MeshId meshId, Mesh mesh, MeshCollider meshCollider, MeshVertexAttributes attributes, Action<MeshGenerationResult> onMeshGenerationComplete, MeshGenerationOptions options);

		[MethodImpl(MethodImplOptions.InternalCall)]
		private extern bool SetBoundingVolume_Injected(ref Vector3 origin, ref Vector3 extents);
	}
	[UsedByNativeCode]
	[NativeHeader("Modules/XR/XRPrefix.h")]
	[NativeType(Header = "Modules/XR/Subsystems/Planes/XRMeshSubsystemDescriptor.h")]
	public class XRMeshSubsystemDescriptor : IntegratedSubsystemDescriptor<XRMeshSubsystem>
	{
	}
}
namespace UnityEngine.XR.Provider
{
	public static class XRStats
	{
		public static bool TryGetStat(IntegratedSubsystem xrSubsystem, string tag, out float value)
		{
			return TryGetStat_Internal(xrSubsystem.m_Ptr, tag, out value);
		}

		[MethodImpl(MethodImplOptions.InternalCall)]
		[NativeConditional("ENABLE_XR")]
		[NativeHeader("Modules/XR/Stats/XRStats.h")]
		[NativeMethod("TryGetStatByName_Internal")]
		[StaticAccessor(/*Could not decode attribute arguments.*/)]
		private static extern bool TryGetStat_Internal(IntPtr ptr, string tag, out float value);
	}
}