Decompiled source of StylePixelator v1.0.1
plugins/StylePixelator/MonoMod.Backports.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Buffers; 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.Numerics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Threading; using Microsoft.CodeAnalysis; using MonoMod; using MonoMod.Backports.ILHelpers; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: CLSCompliant(true)] [assembly: TargetFramework(".NETFramework,Version=v4.5.2", FrameworkDisplayName = ".NET Framework 4.5.2")] [assembly: AssemblyCompany("0x0ade, DaNike")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright 2024 0x0ade, DaNike")] [assembly: AssemblyDescription("A set of backports of new BCL features to all frameworks which MonoMod supports.")] [assembly: AssemblyFileVersion("1.1.2.0")] [assembly: AssemblyInformationalVersion("1.1.2+a1b82852b")] [assembly: AssemblyProduct("MonoMod.Backports")] [assembly: AssemblyTitle("MonoMod.Backports")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/MonoMod/MonoMod.git")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.2.0")] [assembly: TypeForwardedTo(typeof(ConcurrentBag<>))] [assembly: TypeForwardedTo(typeof(ConcurrentDictionary<, >))] [assembly: TypeForwardedTo(typeof(ConcurrentQueue<>))] [assembly: TypeForwardedTo(typeof(ConcurrentStack<>))] [assembly: TypeForwardedTo(typeof(EnumerablePartitionerOptions))] [assembly: TypeForwardedTo(typeof(IProducerConsumerCollection<>))] [assembly: TypeForwardedTo(typeof(OrderablePartitioner<>))] [assembly: TypeForwardedTo(typeof(Partitioner))] [assembly: TypeForwardedTo(typeof(Partitioner<>))] [assembly: TypeForwardedTo(typeof(IReadOnlyCollection<>))] [assembly: TypeForwardedTo(typeof(IReadOnlyList<>))] [assembly: TypeForwardedTo(typeof(IStructuralComparable))] [assembly: TypeForwardedTo(typeof(IStructuralEquatable))] [assembly: TypeForwardedTo(typeof(IntrospectionExtensions))] [assembly: TypeForwardedTo(typeof(IReflectableType))] [assembly: TypeForwardedTo(typeof(TypeDelegator))] [assembly: TypeForwardedTo(typeof(TypeInfo))] [assembly: TypeForwardedTo(typeof(CallerFilePathAttribute))] [assembly: TypeForwardedTo(typeof(CallerLineNumberAttribute))] [assembly: TypeForwardedTo(typeof(CallerMemberNameAttribute))] [assembly: TypeForwardedTo(typeof(ConditionalWeakTable<, >))] [assembly: TypeForwardedTo(typeof(TupleElementNamesAttribute))] [assembly: TypeForwardedTo(typeof(DefaultDllImportSearchPathsAttribute))] [assembly: TypeForwardedTo(typeof(DllImportSearchPath))] [assembly: TypeForwardedTo(typeof(SpinLock))] [assembly: TypeForwardedTo(typeof(SpinWait))] [assembly: TypeForwardedTo(typeof(ThreadLocal<>))] [assembly: TypeForwardedTo(typeof(Volatile))] [assembly: TypeForwardedTo(typeof(Tuple))] [assembly: TypeForwardedTo(typeof(Tuple<>))] [assembly: TypeForwardedTo(typeof(Tuple<, >))] [assembly: TypeForwardedTo(typeof(Tuple<, , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple))] [assembly: TypeForwardedTo(typeof(ValueTuple<>))] [assembly: TypeForwardedTo(typeof(ValueTuple<, >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , , , , >))] [assembly: TypeForwardedTo(typeof(WeakReference<>))] [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] 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.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; } } } internal static class AssemblyInfo { public const string AssemblyName = "MonoMod.Backports"; public const string AssemblyVersion = "1.1.2"; } namespace MonoMod.SourceGen.Attributes { [AttributeUsage(AttributeTargets.Class)] internal sealed class EmitILOverloadsAttribute : Attribute { public EmitILOverloadsAttribute(string filename, string kind) { } } internal static class ILOverloadKind { public const string Cursor = "ILCursor"; public const string Matcher = "ILMatcher"; } } namespace MonoMod.Backports { public static class MethodImplOptionsEx { public const MethodImplOptions Unmanaged = MethodImplOptions.Unmanaged; public const MethodImplOptions NoInlining = MethodImplOptions.NoInlining; public const MethodImplOptions ForwardRef = MethodImplOptions.ForwardRef; public const MethodImplOptions Synchronized = MethodImplOptions.Synchronized; public const MethodImplOptions NoOptimization = MethodImplOptions.NoOptimization; public const MethodImplOptions PreserveSig = MethodImplOptions.PreserveSig; public const MethodImplOptions AggressiveInlining = MethodImplOptions.AggressiveInlining; public const MethodImplOptions AggressiveOptimization = MethodImplOptions.AggressiveOptimization; public const MethodImplOptions InternalCall = MethodImplOptions.InternalCall; } } namespace System { public static class ArrayEx { private static class TypeHolder<T> { public static readonly T[] Empty = new T[0]; } public static int MaxLength => 1879048191; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T[] Empty<T>() { return TypeHolder<T>.Empty; } } 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 HashCode.Combine(_object, _integer); } } public static class EnvironmentEx { public static int CurrentManagedThreadId => Environment.CurrentManagedThreadId; } public sealed class Gen2GcCallback : CriticalFinalizerObject { private readonly Func<bool>? _callback0; private readonly Func<object, bool>? _callback1; private GCHandle _weakTargetObj; private Gen2GcCallback(Func<bool> callback) { _callback0 = callback; } private Gen2GcCallback(Func<object, bool> callback, object targetObj) { _callback1 = callback; _weakTargetObj = GCHandle.Alloc(targetObj, GCHandleType.Weak); } public static void Register(Func<bool> callback) { new Gen2GcCallback(callback); } public static void Register(Func<object, bool> callback, object targetObj) { new Gen2GcCallback(callback, targetObj); } ~Gen2GcCallback() { if (_weakTargetObj.IsAllocated) { object target = _weakTargetObj.Target; if (target == null) { _weakTargetObj.Free(); return; } try { if (!_callback1(target)) { _weakTargetObj.Free(); return; } } catch { } } else { try { if (!_callback0()) { return; } } catch { } } GC.ReRegisterForFinalize(this); } } public struct HashCode { private static readonly uint s_seed = GenerateGlobalSeed(); private const uint Prime1 = 2654435761u; private const uint Prime2 = 2246822519u; private const uint Prime3 = 3266489917u; private const uint Prime4 = 668265263u; private const uint Prime5 = 374761393u; private uint _v1; private uint _v2; private uint _v3; private uint _v4; private uint _queue1; private uint _queue2; private uint _queue3; private uint _length; private static uint GenerateGlobalSeed() { Span<byte> destination = stackalloc byte[4]; using (RandomNumberGenerator randomNumberGenerator = RandomNumberGenerator.Create()) { byte[] array = new byte[destination.Length]; randomNumberGenerator.GetBytes(array); MemoryExtensions.AsSpan(array).CopyTo(destination); } return Unsafe.ReadUnaligned<uint>(ref destination[0]); } public static int Combine<T1>(T1 value1) { uint queuedValue = (uint)(value1?.GetHashCode() ?? 0); return (int)MixFinal(QueueRound(MixEmptyState() + 4, queuedValue)); } public static int Combine<T1, T2>(T1 value1, T2 value2) { uint queuedValue = (uint)(value1?.GetHashCode() ?? 0); uint queuedValue2 = (uint)(value2?.GetHashCode() ?? 0); return (int)MixFinal(QueueRound(QueueRound(MixEmptyState() + 8, queuedValue), queuedValue2)); } public static int Combine<T1, T2, T3>(T1 value1, T2 value2, T3 value3) { uint queuedValue = (uint)(value1?.GetHashCode() ?? 0); uint queuedValue2 = (uint)(value2?.GetHashCode() ?? 0); uint queuedValue3 = (uint)(value3?.GetHashCode() ?? 0); return (int)MixFinal(QueueRound(QueueRound(QueueRound(MixEmptyState() + 12, queuedValue), queuedValue2), queuedValue3)); } public static int Combine<T1, T2, T3, T4>(T1 value1, T2 value2, T3 value3, T4 value4) { uint input = (uint)(value1?.GetHashCode() ?? 0); uint input2 = (uint)(value2?.GetHashCode() ?? 0); uint input3 = (uint)(value3?.GetHashCode() ?? 0); uint input4 = (uint)(value4?.GetHashCode() ?? 0); Initialize(out var v, out var v2, out var v3, out var v4); v = Round(v, input); v2 = Round(v2, input2); v3 = Round(v3, input3); v4 = Round(v4, input4); return (int)MixFinal(MixState(v, v2, v3, v4) + 16); } public static int Combine<T1, T2, T3, T4, T5>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) { uint input = (uint)(value1?.GetHashCode() ?? 0); uint input2 = (uint)(value2?.GetHashCode() ?? 0); uint input3 = (uint)(value3?.GetHashCode() ?? 0); uint input4 = (uint)(value4?.GetHashCode() ?? 0); uint queuedValue = (uint)(value5?.GetHashCode() ?? 0); Initialize(out var v, out var v2, out var v3, out var v4); v = Round(v, input); v2 = Round(v2, input2); v3 = Round(v3, input3); v4 = Round(v4, input4); return (int)MixFinal(QueueRound(MixState(v, v2, v3, v4) + 20, queuedValue)); } public static int Combine<T1, T2, T3, T4, T5, T6>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6) { uint input = (uint)(value1?.GetHashCode() ?? 0); uint input2 = (uint)(value2?.GetHashCode() ?? 0); uint input3 = (uint)(value3?.GetHashCode() ?? 0); uint input4 = (uint)(value4?.GetHashCode() ?? 0); uint queuedValue = (uint)(value5?.GetHashCode() ?? 0); uint queuedValue2 = (uint)(value6?.GetHashCode() ?? 0); Initialize(out var v, out var v2, out var v3, out var v4); v = Round(v, input); v2 = Round(v2, input2); v3 = Round(v3, input3); v4 = Round(v4, input4); return (int)MixFinal(QueueRound(QueueRound(MixState(v, v2, v3, v4) + 24, queuedValue), queuedValue2)); } public static int Combine<T1, T2, T3, T4, T5, T6, T7>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7) { uint input = (uint)(value1?.GetHashCode() ?? 0); uint input2 = (uint)(value2?.GetHashCode() ?? 0); uint input3 = (uint)(value3?.GetHashCode() ?? 0); uint input4 = (uint)(value4?.GetHashCode() ?? 0); uint queuedValue = (uint)(value5?.GetHashCode() ?? 0); uint queuedValue2 = (uint)(value6?.GetHashCode() ?? 0); uint queuedValue3 = (uint)(value7?.GetHashCode() ?? 0); Initialize(out var v, out var v2, out var v3, out var v4); v = Round(v, input); v2 = Round(v2, input2); v3 = Round(v3, input3); v4 = Round(v4, input4); return (int)MixFinal(QueueRound(QueueRound(QueueRound(MixState(v, v2, v3, v4) + 28, queuedValue), queuedValue2), queuedValue3)); } public static int Combine<T1, T2, T3, T4, T5, T6, T7, T8>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8) { uint input = (uint)(value1?.GetHashCode() ?? 0); uint input2 = (uint)(value2?.GetHashCode() ?? 0); uint input3 = (uint)(value3?.GetHashCode() ?? 0); uint input4 = (uint)(value4?.GetHashCode() ?? 0); uint input5 = (uint)(value5?.GetHashCode() ?? 0); uint input6 = (uint)(value6?.GetHashCode() ?? 0); uint input7 = (uint)(value7?.GetHashCode() ?? 0); uint input8 = (uint)(value8?.GetHashCode() ?? 0); Initialize(out var v, out var v2, out var v3, out var v4); v = Round(v, input); v2 = Round(v2, input2); v3 = Round(v3, input3); v4 = Round(v4, input4); v = Round(v, input5); v2 = Round(v2, input6); v3 = Round(v3, input7); v4 = Round(v4, input8); return (int)MixFinal(MixState(v, v2, v3, v4) + 32); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static void Initialize(out uint v1, out uint v2, out uint v3, out uint v4) { v1 = (uint)((int)s_seed + -1640531535 + -2048144777); v2 = s_seed + 2246822519u; v3 = s_seed; v4 = s_seed - 2654435761u; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static uint Round(uint hash, uint input) { return BitOperations.RotateLeft(hash + (uint)((int)input * -2048144777), 13) * 2654435761u; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static uint QueueRound(uint hash, uint queuedValue) { return BitOperations.RotateLeft(hash + (uint)((int)queuedValue * -1028477379), 17) * 668265263; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static uint MixState(uint v1, uint v2, uint v3, uint v4) { return BitOperations.RotateLeft(v1, 1) + BitOperations.RotateLeft(v2, 7) + BitOperations.RotateLeft(v3, 12) + BitOperations.RotateLeft(v4, 18); } private static uint MixEmptyState() { return s_seed + 374761393; } [MethodImpl(MethodImplOptions.AggressiveInlining)] private static uint MixFinal(uint hash) { hash ^= hash >> 15; hash *= 2246822519u; hash ^= hash >> 13; hash *= 3266489917u; hash ^= hash >> 16; return hash; } public void Add<T>(T value) { Add(value?.GetHashCode() ?? 0); } public void Add<T>(T value, IEqualityComparer<T>? comparer) { Add((value != null) ? (comparer?.GetHashCode(value) ?? value.GetHashCode()) : 0); } public void AddBytes(ReadOnlySpan<byte> value) { ref byte reference = ref MemoryMarshal.GetReference(value); ref byte reference2 = ref Unsafe.Add(ref reference, value.Length); while (Unsafe.ByteOffset(ref reference, ref reference2) >= 4) { Add(Unsafe.ReadUnaligned<int>(ref reference)); reference = ref Unsafe.Add(ref reference, 4); } while (Unsafe.IsAddressLessThan(ref reference, ref reference2)) { Add((int)reference); reference = ref Unsafe.Add(ref reference, 1); } } private void Add(int value) { uint num = _length++; switch (num % 4) { case 0u: _queue1 = (uint)value; return; case 1u: _queue2 = (uint)value; return; case 2u: _queue3 = (uint)value; return; } if (num == 3) { Initialize(out _v1, out _v2, out _v3, out _v4); } _v1 = Round(_v1, _queue1); _v2 = Round(_v2, _queue2); _v3 = Round(_v3, _queue3); _v4 = Round(_v4, (uint)value); } public int ToHashCode() { uint length = _length; uint num = length % 4; uint num2 = ((length < 4) ? MixEmptyState() : MixState(_v1, _v2, _v3, _v4)); num2 += length * 4; if (num != 0) { num2 = QueueRound(num2, _queue1); if (num > 1) { num2 = QueueRound(num2, _queue2); if (num > 2) { num2 = QueueRound(num2, _queue3); } } } return (int)MixFinal(num2); } [Obsolete("HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.", true)] [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() { throw new NotSupportedException("GetHashCode on HashCode is not supported"); } [Obsolete("HashCode is a mutable struct and should not be compared with other HashCodes.", true)] [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) { throw new NotSupportedException("Equals on HashCode is not supported"); } } public static class MathEx { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Clamp(byte value, byte min, byte max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Clamp(decimal value, decimal min, decimal max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Clamp(double value, double min, double max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Clamp(short value, short min, short max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Clamp(int value, int min, int max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Clamp(long value, long min, long max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static nint Clamp(nint value, nint min, nint max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static sbyte Clamp(sbyte value, sbyte min, sbyte max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Clamp(float value, float min, float max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ushort Clamp(ushort value, ushort min, ushort max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static uint Clamp(uint value, uint min, uint max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ulong Clamp(ulong value, ulong min, ulong max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static nuint Clamp(nuint value, nuint min, nuint max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [DoesNotReturn] private static void ThrowMinMaxException<T>(T min, T max) { throw new ArgumentException($"Minimum {min} is less than maximum {max}"); } } [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>(text, (IntPtr)RuntimeHelpers.OffsetToStringData, 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 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); return new MemoryHandle(Unsafe.Add<T>((void*)handle.AddrOfPinnedObject(), _index), handle); } if (_object is T[] array) { if (_length < 0) { return new MemoryHandle(Unsafe.Add<T>(Unsafe.AsPointer(ref MemoryMarshal.GetReference<T>(array)), _index)); } GCHandle handle2 = GCHandle.Alloc(array, GCHandleType.Pinned); return new MemoryHandle(Unsafe.Add<T>((void*)handle2.AddrOfPinnedObject(), _index), 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; } return HashCode.Combine(_object, _index, _length); } } 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 { 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value), span.Length); } if (typeof(T) == typeof(char)) { return System.SpanHelpers.IndexOf(ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value), span.Length); } if (typeof(T) == typeof(char)) { return System.SpanHelpers.LastIndexOf(ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), other.Length); } if (typeof(T) == typeof(char)) { return System.SpanHelpers.SequenceCompareTo(ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value), span.Length); } if (typeof(T) == typeof(char)) { return System.SpanHelpers.IndexOf(ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value), span.Length); } if (typeof(T) == typeof(char)) { return System.SpanHelpers.LastIndexOf(ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value0), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value0), Unsafe.As<T, byte>(ref value1), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value0), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value0), Unsafe.As<T, byte>(ref value1), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value0), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value0), Unsafe.As<T, byte>(ref value1), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value0), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), Unsafe.As<T, byte>(ref value0), Unsafe.As<T, byte>(ref value1), 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), span.Length, ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(other)), other.Length); } if (typeof(T) == typeof(char)) { return System.SpanHelpers.SequenceCompareTo(ref Unsafe.As<T, char>(ref MemoryMarshal.GetReference(span)), span.Length, ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), ref 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 Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(span)), ref 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 Unsafe.As<T, byte>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), length - length2)), ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), (nuint)length2 * size); } return false; } if (length2 <= length) { return System.SpanHelpers.SequenceEqual(ref Unsafe.Add(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 Unsafe.As<T, byte>(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), length - length2)), ref Unsafe.As<T, byte>(ref MemoryMarshal.GetReference(value)), (nuint)length2 * size); } return false; } if (length2 <= length) { return System.SpanHelpers.SequenceEqual(ref Unsafe.Add(ref MemoryMarshal.GetReference(span), length - length2), ref MemoryMarshal.GetReference(value), length2); } return false; } public static void Reverse<T>(this Span<T> span) { if (span.Length > 1) { ref T reference = ref MemoryMarshal.GetReference(span); ref T reference2 = ref Unsafe.Add(ref Unsafe.Add(ref reference, span.Length), -1); do { T val = reference; reference = reference2; reference2 = val; reference = ref Unsafe.Add(ref reference, 1); reference2 = ref Unsafe.Add(ref reference2, -1); } while (Unsafe.IsAddressLessThan(ref reference, ref reference2)); } } [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; } nint num = Unsafe.ByteOffset(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other)); if (Unsafe.SizeOf<IntPtr>() == 4) { if ((uint)(int)(IntPtr)num >= (uint)(span.Length * Unsafe.SizeOf<T>())) { return (uint)(int)(IntPtr)num > (uint)(-(other.Length * Unsafe.SizeOf<T>())); } return true; } if ((ulong)(long)(IntPtr)num >= (ulong)((long)span.Length * (long)Unsafe.SizeOf<T>())) { return (ulong)(long)(IntPtr)num > (ulong)(-((long)other.Length * (long)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; } nint num = Unsafe.ByteOffset(ref MemoryMarshal.GetReference(span), ref MemoryMarshal.GetReference(other)); if (Unsafe.SizeOf<IntPtr>() == 4) { if ((uint)(int)(IntPtr)num < (uint)(span.Length * Unsafe.SizeOf<T>()) || (uint)(int)(IntPtr)num > (uint)(-(other.Length * Unsafe.SizeOf<T>()))) { if ((int)(IntPtr)num % Unsafe.SizeOf<T>() != 0) { System.ThrowHelper.ThrowArgumentException_OverlapAlignmentMismatch(); } elementOffset = (int)(IntPtr)num / Unsafe.SizeOf<T>(); return true; } elementOffset = 0; return false; } if ((ulong)(long)(IntPtr)num < (ulong)((long)span.Length * (long)Unsafe.SizeOf<T>()) || (ulong)(long)(IntPtr)num > (ulong)(-((long)other.Length * (long)Unsafe.SizeOf<T>()))) { if ((long)(IntPtr)num % Unsafe.SizeOf<T>() != 0L) { System.ThrowHelper.ThrowArgumentException_OverlapAlignmentMismatch(); } elementOffset = (int)((long)(IntPtr)num / 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 = 1u; return true; } if (typeof(T) == typeof(char) || typeof(T) == typeof(short) || typeof(T) == typeof(ushort)) { size = 2u; return true; } if (typeof(T) == typeof(int) || typeof(T) == typeof(uint)) { size = 4u; return true; } if (typeof(T) == typeof(long) || typeof(T) == typeof(ulong)) { size = 8u; return true; } size = 0u; 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) { System.ThrowHelper.ThrowIfArgumentNull(culture, System.ExceptionArgument.culture); if (destination.Length < source.Length) { return -1; } string str = source.ToString(); AsSpan(culture.TextInfo.ToLower(str)).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) { System.ThrowHelper.ThrowIfArgumentNull(culture, System.ExceptionArgument.culture); if (destination.Length < source.Length) { return -1; } string str = source.ToString(); AsSpan(culture.TextInfo.ToUpper(str)).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>(text, (IntPtr)RuntimeHelpers.OffsetToStringData, 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>(text, (nint)RuntimeHelpers.OffsetToStringData + (nint)(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>(text, (nint)RuntimeHelpers.OffsetToStringData + (nint)(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); } } [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>(text, (IntPtr)RuntimeHelpers.OffsetToStringData, 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); return new MemoryHandle(Unsafe.Add<T>((void*)handle.AddrOfPinnedObject(), _index), handle); } if (_object is T[] array) { if (_length < 0) { return new MemoryHandle(Unsafe.Add<T>(Unsafe.AsPointer(ref MemoryMarshal.GetReference<T>(array)), _index)); } GCHandle handle2 = GCHandle.Alloc(array, GCHandleType.Pinned); return new MemoryHandle(Unsafe.Add<T>((void*)handle2.AddrOfPinnedObject(), _index), 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; } return HashCode.Combine(_object, _index, _length); } [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}")] 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 object? _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 ref readonly T this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { if ((uint)index >= (uint)_length) { System.ThrowHelper.ThrowIndexOutOfRangeException(); } return ref Unsafe.Add(ref DangerousGetPinnableReference(), index); } } internal object? 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("Cannot call Equals on Span"); } [Obsolete("GetHashCode() on ReadOnlySpan will always throw an exception.")] [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() { throw new NotSupportedException("Cannot call GetHashCodee on Span"); } 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 ?? throw new ArgumentNullException("segment"), 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 = 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 = 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(object? pinnable, IntPtr byteOffset, int length) { _length = length; _pinnable = pinnable; _byteOffset = byteOffset; } [EditorBrowsable(EditorBrowsableState.Never)] public unsafe ref readonly T GetPinnableReference() { if (_length != 0) { return ref DangerousGetPinnableReference(); } return ref Unsafe.AsRef<T>(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 Unsafe.AreSame(ref left.DangerousGetPinnableReference(), ref right.DangerousGetPinnableReference()); } return false; } public unsafe override string ToString() { if (typeof(T) == typeof(char)) { if (_byteOffset == (IntPtr)RuntimeHelpers.OffsetToStringData && Unsafe.As<object>(_pinnable) is string text && _length == text.Length) { return text; } fixed (char* value = &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)] internal ref T DangerousGetPinnableReference() { return ref Unsafe.AddByteOffset(ref ILHelpers.ObjectAsRef<T>(_pinnable), _byteOffset); } } [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 object? _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 ref T this[int index] { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { if ((uint)index >= (uint)_length) { System.ThrowHelper.ThrowIndexOutOfRangeException(); } return ref Unsafe.Add(ref DangerousGetPinnableReference(), index); } } internal object? 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("Cannot call Equals on Span"); } [Obsolete("GetHashCode() on Span will always throw an exception.")] [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() { throw new NotSupportedException("Cannot call GetHashCode on Span"); } 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 = 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>(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 = 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(object? pinnable, IntPtr byteOffset, int length) { _length = length; _pinnable = pinnable; _byteOffset = byteOffset; } [EditorBrowsable(EditorBrowsableState.Never)] public ref T GetPinnableReference() { if (_length != 0) { return ref DangerousGetPinnableReference(); } return ref Unsafe.NullRef<T>(); } public unsafe void Clear() { int length = _length; if (length == 0) { return; } nuint byteLength = (UIntPtr)(ulong)((uint)length * Unsafe.SizeOf<T>()); if ((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 Unsafe.As<T, byte>(ref DangerousGetPinnableReference()), byteLength); } } else if (System.SpanHelpers.IsReferenceOrContainsReferences<T>()) { nuint pointerSizeLength = (UIntPtr)(ulong)(length * Unsafe.SizeOf<T>() / sizeof(IntPtr)); System.SpanHelpers.ClearPointerSizedWithReferences(ref Unsafe.As<T, IntPtr>(ref DangerousGetPinnableReference()), pointerSizeLength); } else { System.SpanHelpers.ClearPointerSizedWithoutReferences(ref Unsafe.As<T, byte>(ref DangerousGetPinnableReference()), byteLength); } } public void Fill(T value) { int length = _length; if (length == 0) { return; } if (Unsafe.SizeOf<T>() == 1) { byte value2 = Unsafe.As<T, byte>(ref value); Unsafe.InitBlockUnaligned(ref Unsafe.As<T, byte>(ref DangerousGetPinnableReference()), value2, (uint)length); return; } ref T source = ref DangerousGetPinnableReference(); int i; for (i = 0; i < (length & -8); i += 8) { Unsafe.Add(ref source, i) = value; Unsafe.Add(ref source, i + 1) = value; Unsafe.Add(ref source, i + 2) = value; Unsafe.Add(ref source, i + 3) = value; Unsafe.Add(ref source, i + 4) = value; Unsafe.Add(ref source, i + 5) = value; Unsafe.Add(ref source, i + 6) = value; Unsafe.Add(ref source, i + 7) = value; } if (i < (length & -4)) { Unsafe.Add(ref source, i) = value; Unsafe.Add(ref source, i + 1) = value; Unsafe.Add(ref source, i + 2) = value; Unsafe.Add(ref source, i + 3) = value; i += 4; } for (; i < length; i++) { Unsafe.Add(ref source, 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 Unsafe.AreSame(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 = &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)] internal ref T DangerousGetPinnableReference() { return ref Unsafe.AddByteOffset(ref ILHelpers.ObjectAsRef<T>(_pinnable), _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 = ArrayEx.Empty<T>(); public static readonly IntPtr ArrayAdjustment = MeasureArrayAdjustment(); private static IntPtr MeasureArrayAdjustment() { T[] array = new T[1]; return Unsafe.ByteOffset(ref ILHelpers.ObjectAsRef<T>((object)array), ref array[0]); } } [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; ref TComparable reference = ref comparable; TComparable val = default(TComparable); if (val == null) { val = reference; reference = ref val; } int num4 = reference.CompareTo(Unsafe.Add(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 Unsafe.Add(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 Unsafe.Add(ref searchSpace, num2), value2, num3); if (num4 == -1) { break; } num2 += num4; if (SequenceEqual(ref Unsafe.Add(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, Unsafe.Add(ref value, i), searchSpaceLength); if ((uint)num2 < (uint)num) { num = num2; searchSpaceLength = num2; if (num == 0) { break; } } } return num; } public static int LastIndexOfAny(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 = LastIndexOf(ref searchSpace, Unsafe.Add(ref value, i), searchSpaceLength); if (num2 > num) { num = num2; } } return num; } public static int IndexOf(ref byte searchSpace, byte value, int length) { nint num = 0; nint num2 = length; while (true) { if ((nuint)num2 >= (nuint)8u) { num2 -= 8; if (value != Unsafe.AddByteOffset(ref searchSpace, num)) { if (value == Unsafe.AddByteOffset(ref searchSpace, num + 1)) { goto IL_0109; } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 2)) { goto IL_010f; } if (value != Unsafe.AddByteOffset(ref searchSpace, num + 3)) { if (value != Unsafe.AddByteOffset(ref searchSpace, num + 4)) { if (value != Unsafe.AddByteOffset(ref searchSpace, num + 5)) { if (value != Unsafe.AddByteOffset(ref searchSpace, num + 6)) { if (value == Unsafe.AddByteOffset(ref searchSpace, num + 7)) { break; } num += 8; continue; } return (int)(num + 6); } return (int)(num + 5); } return (int)(num + 4); } goto IL_0115; } } else { if ((nuint)num2 >= (nuint)4u) { num2 -= 4; if (value == Unsafe.AddByteOffset(ref searchSpace, num)) { goto IL_0106; } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 1)) { goto IL_0109; } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 2)) { goto IL_010f; } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 3)) { goto IL_0115; } num += 4; } while (true) { if (num2 != 0) { num2--; if (value == Unsafe.AddByteOffset(ref searchSpace, num)) { break; } num++; continue; } return -1; } } goto IL_0106; IL_010f: return (int)(num + 2); IL_0106: return (int)num; IL_0109: return (int)(num + 1); IL_0115: return (int)(num + 3); } return (int)(num + 7); } public static int LastIndexOf(ref byte searchSpace, int searchSpaceLength, ref byte value, int valueLength) { if (valueLength == 0) { return 0; } byte value2 = value; ref byte second = ref Unsafe.Add(ref value, 1); int num = valueLength - 1; int num2 = 0; while (true) { int num3 = searchSpaceLength - num2 - num; if (num3 <= 0) { break; } int num4 = LastIndexOf(ref searchSpace, value2, num3); if (num4 == -1) { break; } if (SequenceEqual(ref Unsafe.Add(ref searchSpace, num4 + 1), ref second, num)) { return num4; } num2 += num3 - num4; } return -1; } public static int LastIndexOf(ref byte searchSpace, byte value, int length) { nint num = length; nint num2 = length; while (true) { if ((nuint)num2 >= (nuint)8u) { num2 -= 8; num -= 8; if (value == Unsafe.AddByteOffset(ref searchSpace, num + 7)) { break; } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 6)) { return (int)(num + 6); } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 5)) { return (int)(num + 5); } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 4)) { return (int)(num + 4); } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 3)) { goto IL_010f; } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 2)) { goto IL_0109; } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 1)) { goto IL_0103; } if (value != Unsafe.AddByteOffset(ref searchSpace, num)) { continue; } } else { if ((nuint)num2 >= (nuint)4u) { num2 -= 4; num -= 4; if (value == Unsafe.AddByteOffset(ref searchSpace, num + 3)) { goto IL_010f; } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 2)) { goto IL_0109; } if (value == Unsafe.AddByteOffset(ref searchSpace, num + 1)) { goto IL_0103; } if (value == Unsafe.AddByteOffset(ref searchSpace, num)) { goto IL_0100; } } do { if (num2 != 0) { num2--; num--; continue; } return -1; } while (value != Unsafe.AddByteOffset(ref searchSpace, num)); } goto IL_0100; IL_0109: return (int)(num + 2); IL_010f: return (int)(num + 3); IL_0103: return (int)(num + 1); IL_0100: return (int)num; } return (int)(num + 7); } public static int IndexOfAny(ref byte searchSpace, byte value0, byte value1, int length) { nint num = 0; nint num2 = length; while (true) { if ((nuint)num2 >= (nuint)8u) { num2 -= 8; uint num3 = Unsafe.AddByteOffset(ref searchSpace, num); if (value0 != num3 && value1 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 1); if (value0 == num3 || value1 == num3) { goto IL_019b; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 2); if (value0 == num3 || value1 == num3) { goto IL_01a1; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 3); if (value0 != num3 && value1 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 4); if (value0 != num3 && value1 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 5); if (value0 != num3 && value1 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 6); if (value0 != num3 && value1 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 7); if (value0 == num3 || value1 == num3) { break; } num += 8; continue; } return (int)(num + 6); } return (int)(num + 5); } return (int)(num + 4); } goto IL_01a7; } } else { if ((nuint)num2 >= (nuint)4u) { num2 -= 4; uint num3 = Unsafe.AddByteOffset(ref searchSpace, num); if (value0 == num3 || value1 == num3) { goto IL_0198; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 1); if (value0 == num3 || value1 == num3) { goto IL_019b; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 2); if (value0 == num3 || value1 == num3) { goto IL_01a1; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 3); if (value0 == num3 || value1 == num3) { goto IL_01a7; } num += 4; } while (true) { if (num2 != 0) { num2--; uint num3 = Unsafe.AddByteOffset(ref searchSpace, num); if (value0 == num3 || value1 == num3) { break; } num++; continue; } return -1; } } goto IL_0198; IL_01a1: return (int)(num + 2); IL_019b: return (int)(num + 1); IL_01a7: return (int)(num + 3); IL_0198: return (int)num; } return (int)(num + 7); } public static int IndexOfAny(ref byte searchSpace, byte value0, byte value1, byte value2, int length) { nint num = 0; nint num2 = length; while (true) { if ((nuint)num2 >= (nuint)8u) { num2 -= 8; uint num3 = Unsafe.AddByteOffset(ref searchSpace, num); if (value0 != num3 && value1 != num3 && value2 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 1); if (value0 == num3 || value1 == num3 || value2 == num3) { goto IL_020a; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 2); if (value0 == num3 || value1 == num3 || value2 == num3) { goto IL_0210; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 3); if (value0 != num3 && value1 != num3 && value2 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 4); if (value0 != num3 && value1 != num3 && value2 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 5); if (value0 != num3 && value1 != num3 && value2 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 6); if (value0 != num3 && value1 != num3 && value2 != num3) { num3 = Unsafe.AddByteOffset(ref searchSpace, num + 7); if (value0 == num3 || value1 == num3 || value2 == num3) { break; } num += 8; continue; } return (int)(num + 6); } return (int)(num + 5); } return (int)(num + 4); } goto IL_0216; } } else { if ((nuint)num2 >= (nuint)4u) { num2 -= 4; uint num3 = Unsafe.AddByteOffset(ref searchSpace, num); if (value0 == num3 || value1 == num3 || value2 == num3) { goto IL_0207; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 1); if (value0 == num3 || value1 == num3 || value2 == num3) { goto IL_020a; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 2); if (value0 == num3 || value1 == num3 || value2 == num3) { goto IL_0210; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 3); if (value0 == num3 || value1 == num3 || value2 == num3) { goto IL_0216; } num += 4; } while (true) { if (num2 != 0) { num2--; uint num3 = Unsafe.AddByteOffset(ref searchSpace, num); if (value0 == num3 || value1 == num3 || value2 == num3) { break; } num++; continue; } return -1; } } goto IL_0207; IL_0207: return (int)num; IL_0210: return (int)(num + 2); IL_020a: return (int)(num + 1); IL_0216: return (int)(num + 3); } return (int)(num + 7); } public static int LastIndexOfAny(ref byte searchSpace, byte value0, byte value1, int length) { nint num = length; nint num2 = length; while (true) { if ((nuint)num2 >= (nuint)8u) { num2 -= 8; num -= 8; uint num3 = Unsafe.AddByteOffset(ref searchSpace, num + 7); if (value0 == num3 || value1 == num3) { break; } num3 = Unsafe.AddByteOffset(ref searchSpace, num + 6); if (value0 == num3 || value1 == nu
plugins/StylePixelator/MonoMod.Core.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Buffers; 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.Linq; using System.Net; using System.Numerics; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading; using Iced.Intel; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod; using MonoMod.Core.Interop; using MonoMod.Core.Interop.Attributes; using MonoMod.Core.Platforms; using MonoMod.Core.Platforms.Architectures; using MonoMod.Core.Platforms.Architectures.AltEntryFactories; using MonoMod.Core.Platforms.Memory; using MonoMod.Core.Platforms.Runtimes; using MonoMod.Core.Platforms.Systems; using MonoMod.Core.Utils; using MonoMod.Logs; using MonoMod.Utils; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)] [assembly: DisableRuntimeMarshalling] [assembly: CLSCompliant(false)] [assembly: TargetFramework(".NETFramework,Version=v4.5.2", FrameworkDisplayName = ".NET Framework 4.5.2")] [assembly: AssemblyCompany("0x0ade, DaNike")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright 2026 0x0ade, DaNike")] [assembly: AssemblyDescription("The code functionality for runtime detouring. Use `DetourFactory.Current` to get a DetourFactory capable of installing unique method detours.\n \n WARNING: THIS IS A LOW-LEVEL LIBRARY THAT IS DIFFICULT TO USE ON ITS OWN. If possible, use MonoMod.RuntimeDetour instead.")] [assembly: AssemblyFileVersion("1.3.4.0")] [assembly: AssemblyInformationalVersion("1.3.4+69fdc9deb")] [assembly: AssemblyProduct("MonoMod.Core")] [assembly: AssemblyTitle("MonoMod.Core")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/MonoMod/MonoMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.4.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { MMDbgLog.LogVersion(); } } [CompilerGenerated] internal unsafe delegate CoreCLR.CorJitResult <>f__AnonymousDelegate0(IntPtr arg1, IntPtr arg2, CoreCLR.V21.CORINFO_METHOD_INFO* arg3, uint arg4, byte** arg5, uint* arg6); [CompilerGenerated] internal unsafe delegate CoreCLR.CorJitResult <>f__AnonymousDelegate1(IntPtr arg1, IntPtr arg2, CoreCLR.V21.CORINFO_METHOD_INFO* arg3, uint arg4, byte** arg5, uint* arg6, CoreCLR.CorJitResult arg7, CoreCLR.V60.AllocMemArgs* arg8); [CompilerGenerated] internal unsafe delegate void <>f__AnonymousDelegate2(IntPtr arg1, CoreCLR.V60.AllocMemArgs* arg2); namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] internal sealed class IsReadOnlyAttribute : Attribute { } [CompilerGenerated] [Embedded] internal sealed class IsByRefLikeAttribute : Attribute { } [CompilerGenerated] [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] [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] [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] [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 MonoMod { internal static class MMDbgLog { [InterpolatedStringHandler] internal ref struct DebugLogSpamStringHandler { internal DebugLogInterpolatedStringHandler handler; public DebugLogSpamStringHandler(int literalLen, int formattedCount, out bool isEnabled) { //IL_0005: 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) handler = new DebugLogInterpolatedStringHandler(literalLen, formattedCount, (LogLevel)0, ref isEnabled); } public override string ToString() { return ((object)Unsafe.As<DebugLogInterpolatedStringHandler, DebugLogInterpolatedStringHandler>(ref handler)/*cast due to .constrained prefix*/).ToString(); } public string ToStringAndClear() { return ((DebugLogInterpolatedStringHandler)(ref handler)).ToStringAndClear(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendLiteral(string s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendLiteral(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment, format); } } [InterpolatedStringHandler] internal ref struct DebugLogTraceStringHandler { internal DebugLogInterpolatedStringHandler handler; public DebugLogTraceStringHandler(int literalLen, int formattedCount, out bool isEnabled) { //IL_0005: 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) handler = new DebugLogInterpolatedStringHandler(literalLen, formattedCount, (LogLevel)1, ref isEnabled); } public override string ToString() { return ((object)Unsafe.As<DebugLogInterpolatedStringHandler, DebugLogInterpolatedStringHandler>(ref handler)/*cast due to .constrained prefix*/).ToString(); } public string ToStringAndClear() { return ((DebugLogInterpolatedStringHandler)(ref handler)).ToStringAndClear(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendLiteral(string s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendLiteral(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment, format); } } [InterpolatedStringHandler] internal ref struct DebugLogInfoStringHandler { internal DebugLogInterpolatedStringHandler handler; public DebugLogInfoStringHandler(int literalLen, int formattedCount, out bool isEnabled) { //IL_0005: 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) handler = new DebugLogInterpolatedStringHandler(literalLen, formattedCount, (LogLevel)2, ref isEnabled); } public override string ToString() { return ((object)Unsafe.As<DebugLogInterpolatedStringHandler, DebugLogInterpolatedStringHandler>(ref handler)/*cast due to .constrained prefix*/).ToString(); } public string ToStringAndClear() { return ((DebugLogInterpolatedStringHandler)(ref handler)).ToStringAndClear(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendLiteral(string s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendLiteral(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment, format); } } [InterpolatedStringHandler] internal ref struct DebugLogWarningStringHandler { internal DebugLogInterpolatedStringHandler handler; public DebugLogWarningStringHandler(int literalLen, int formattedCount, out bool isEnabled) { //IL_0005: 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) handler = new DebugLogInterpolatedStringHandler(literalLen, formattedCount, (LogLevel)3, ref isEnabled); } public override string ToString() { return ((object)Unsafe.As<DebugLogInterpolatedStringHandler, DebugLogInterpolatedStringHandler>(ref handler)/*cast due to .constrained prefix*/).ToString(); } public string ToStringAndClear() { return ((DebugLogInterpolatedStringHandler)(ref handler)).ToStringAndClear(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendLiteral(string s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendLiteral(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment, format); } } [InterpolatedStringHandler] internal ref struct DebugLogErrorStringHandler { internal DebugLogInterpolatedStringHandler handler; public DebugLogErrorStringHandler(int literalLen, int formattedCount, out bool isEnabled) { //IL_0005: 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) handler = new DebugLogInterpolatedStringHandler(literalLen, formattedCount, (LogLevel)4, ref isEnabled); } public override string ToString() { return ((object)Unsafe.As<DebugLogInterpolatedStringHandler, DebugLogInterpolatedStringHandler>(ref handler)/*cast due to .constrained prefix*/).ToString(); } public string ToStringAndClear() { return ((DebugLogInterpolatedStringHandler)(ref handler)).ToStringAndClear(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendLiteral(string s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendLiteral(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(string? s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted(ReadOnlySpan<char> s, int alignment = 0, string? format = null) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted(s, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendFormatted<T>(T value, int alignment, string? format) { ((DebugLogInterpolatedStringHandler)(ref handler)).AppendFormatted<T>(value, alignment, format); } } public static bool IsWritingLog => DebugLog.IsWritingLog; [ModuleInitializer] internal static void LogVersion() { Info("Version 1.3.4"); } public static void Log(LogLevel level, string message) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) DebugLog.Log("MonoMod.Core", level, message); } public static void Log(LogLevel level, [InterpolatedStringHandlerArgument("level")] ref DebugLogInterpolatedStringHandler message) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) DebugLog.Log("MonoMod.Core", level, ref message); } public static void Spam(string message) { Log((LogLevel)0, message); } public static void Spam(ref DebugLogSpamStringHandler message) { Log((LogLevel)0, ref message.handler); } public static void Trace(string message) { Log((LogLevel)1, message); } public static void Trace(ref DebugLogTraceStringHandler message) { Log((LogLevel)1, ref message.handler); } public static void Info(string message) { Log((LogLevel)2, message); } public static void Info(ref DebugLogInfoStringHandler message) { Log((LogLevel)2, ref message.handler); } public static void Warning(string message) { Log((LogLevel)3, message); } public static void Warning(ref DebugLogWarningStringHandler message) { Log((LogLevel)3, ref message.handler); } public static void Error(string message) { Log((LogLevel)4, message); } public static void Error(ref DebugLogErrorStringHandler message) { Log((LogLevel)4, ref message.handler); } } internal static class MultiTargetShims { public static TypeReference GetConstraintType(this GenericParameterConstraint constraint) { return constraint.ConstraintType; } } } namespace MonoMod.SourceGen.Attributes { [AttributeUsage(AttributeTargets.Class)] internal sealed class EmitILOverloadsAttribute : Attribute { public EmitILOverloadsAttribute(string filename, string kind) { } } internal static class ILOverloadKind { public const string Cursor = "ILCursor"; public const string Matcher = "ILMatcher"; } } namespace MonoMod.Core { [CLSCompliant(true)] public interface ICoreDetour : ICoreDetourBase, IDisposable { MethodBase Source { get; } MethodBase Target { get; } } public interface ICoreDetourWithClone : ICoreDetour, ICoreDetourBase, IDisposable { MethodInfo? SourceMethodClone { get; } DynamicMethodDefinition? SourceMethodCloneIL { get; } } public interface ICoreDetourBase : IDisposable { bool IsApplied { get; } void Apply(); void Undo(); } public interface ICoreNativeDetour : ICoreDetourBase, IDisposable { IntPtr Source { get; } IntPtr Target { get; } bool HasOrigEntrypoint { get; } IntPtr OrigEntrypoint { get; } } [CLSCompliant(true)] public interface IDetourFactory { bool SupportsNativeDetourOrigEntrypoint { get; } ICoreDetour CreateDetour(CreateDetourRequest request); ICoreNativeDetour CreateNativeDetour(CreateNativeDetourRequest request); } [CLSCompliant(true)] public readonly record struct CreateDetourRequest { public MethodBase Source { get; init; } public MethodBase Target { get; init; } public bool ApplyByDefault { get; init; } public bool CreateSourceCloneIfNotILClone { get; init; } public CreateDetourRequest(MethodBase Source, MethodBase Target) { CreateSourceCloneIfNotILClone = false; this.Source = Source; this.Target = Target; ApplyByDefault = true; } [CompilerGenerated] public void Deconstruct(out MethodBase Source, out MethodBase Target) { Source = this.Source; Target = this.Target; } } [CLSCompliant(true)] public readonly record struct CreateNativeDetourRequest(IntPtr Source, IntPtr Target) { public bool ApplyByDefault { get; init; } = true; } [CLSCompliant(true)] public static class DetourFactory { private static object currentLock = new object(); private static IDetourFactory? lazyDefault; private static IDetourFactory? lazyCurrent; public unsafe static IDetourFactory Default => Helpers.GetOrInitWithLock<IDetourFactory>(ref lazyDefault, currentLock, (delegate*<IDetourFactory>)(&CreateDefault)); public unsafe static IDetourFactory Current => Helpers.GetOrInitWithLock<IDetourFactory>(ref lazyCurrent, currentLock, (delegate*<IDetourFactory>)(&CreateCurrent)); private static IDetourFactory CreateDefault() { return new PlatformTripleDetourFactory(PlatformTriple.Current); } private static IDetourFactory CreateCurrent() { return Default; } [EditorBrowsable(EditorBrowsableState.Never)] public static void SetCurrentFactory(Func<IDetourFactory, IDetourFactory> creator) { Helpers.ThrowIfArgumentNull<Func<IDetourFactory, IDetourFactory>>(creator, "creator"); lock (currentLock) { lazyCurrent = creator(Current); } } public static ICoreDetour CreateDetour(this IDetourFactory factory, MethodBase source, MethodBase target, bool applyByDefault = true) { Helpers.ThrowIfArgumentNull<IDetourFactory>(factory, "factory"); return factory.CreateDetour(new CreateDetourRequest(source, target) { ApplyByDefault = applyByDefault }); } public static ICoreNativeDetour CreateNativeDetour(this IDetourFactory factory, IntPtr source, IntPtr target, bool applyByDefault = true) { Helpers.ThrowIfArgumentNull<IDetourFactory>(factory, "factory"); return factory.CreateNativeDetour(new CreateNativeDetourRequest(source, target) { ApplyByDefault = applyByDefault }); } } internal static class AssemblyInfo { public const string AssemblyName = "MonoMod.Core"; public const string AssemblyVersion = "1.3.4"; } } namespace MonoMod.Core.Utils { [Flags] public enum AddressKind { Rel32 = 0, Rel64 = 2, Abs32 = 1, Abs64 = 3, PrecodeFixupThunkRel32 = 4, PrecodeFixupThunkRel64 = 6, PrecodeFixupThunkAbs32 = 5, PrecodeFixupThunkAbs64 = 7, Indirect = 8, ConstantAddr = 0x10 } public static class AddressKindExtensions { public const AddressKind IsAbsoluteField = AddressKind.Abs32; public const AddressKind Is64BitField = AddressKind.Rel64; public const AddressKind IsPrecodeFixupField = AddressKind.PrecodeFixupThunkRel32; public const AddressKind IsIndirectField = AddressKind.Indirect; public const AddressKind IsConstantField = AddressKind.ConstantAddr; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsRelative(this AddressKind value) { return (value & AddressKind.Abs32) == 0; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsAbsolute(this AddressKind value) { return !value.IsRelative(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Is32Bit(this AddressKind value) { return (value & AddressKind.Rel64) == 0; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Is64Bit(this AddressKind value) { return !value.Is32Bit(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsPrecodeFixup(this AddressKind value) { return (value & AddressKind.PrecodeFixupThunkRel32) != 0; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsIndirect(this AddressKind value) { return (value & AddressKind.Indirect) != 0; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsConstant(this AddressKind value) { return (value & AddressKind.ConstantAddr) != 0; } public static void Validate(this AddressKind value, [CallerArgumentExpression("value")] string argName = "") { if ((value & ~(AddressKind.PrecodeFixupThunkAbs64 | AddressKind.Indirect | AddressKind.ConstantAddr)) != AddressKind.Rel32) { throw new ArgumentOutOfRangeException(argName); } } public static string FastToString(this AddressKind value) { FormatInterpolatedStringHandler val = default(FormatInterpolatedStringHandler); ((FormatInterpolatedStringHandler)(ref val))..ctor(0, 4); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted(value.IsPrecodeFixup() ? "PrecodeFixupThunk" : ""); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted(value.IsRelative() ? "Rel" : "Abs"); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted(value.Is32Bit() ? "32" : "64"); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted(value.IsIndirect() ? "Indirect" : ""); return DebugFormatter.Format(ref val); } } public readonly struct AddressMeaning : IEquatable<AddressMeaning> { public AddressKind Kind { get; } public int RelativeToOffset { get; } public ulong ConstantValue { get; } public AddressMeaning(AddressKind kind) { ConstantValue = 0uL; kind.Validate("kind"); if (!kind.IsAbsolute()) { throw new ArgumentOutOfRangeException("kind"); } Kind = kind; RelativeToOffset = 0; } public AddressMeaning(AddressKind kind, int relativeOffset) { ConstantValue = 0uL; kind.Validate("kind"); if (!kind.IsRelative()) { throw new ArgumentOutOfRangeException("kind"); } if (relativeOffset < 0) { throw new ArgumentOutOfRangeException("relativeOffset"); } Kind = kind; RelativeToOffset = relativeOffset; } public AddressMeaning(AddressKind kind, int relativeOffset, ulong constantValue) { kind.Validate("kind"); if (!kind.IsRelative()) { throw new ArgumentOutOfRangeException("kind"); } if (relativeOffset < 0) { throw new ArgumentOutOfRangeException("relativeOffset"); } Kind = kind; RelativeToOffset = relativeOffset; ConstantValue = constantValue; } private unsafe static nint DoProcessAddress(AddressKind kind, nint basePtr, int offset, ulong constantValue, ulong address) { if (kind.IsConstant()) { address = constantValue; } nint num; if (kind.IsAbsolute()) { num = (nint)address; } else { long num2 = (kind.Is32Bit() ? Unsafe.As<ulong, int>(ref address) : Unsafe.As<ulong, long>(ref address)); num = (nint)(basePtr + offset + num2); } if (kind.IsIndirect()) { num = *(nint*)num; } return num; } public nint ProcessAddress(nint basePtr, int offset, ulong address) { return DoProcessAddress(Kind, basePtr, offset + RelativeToOffset, ConstantValue, address); } public override bool Equals(object? obj) { if (obj is AddressMeaning other) { return Equals(other); } return false; } public bool Equals(AddressMeaning other) { if (Kind == other.Kind && RelativeToOffset == other.RelativeToOffset) { return ConstantValue == other.ConstantValue; } return false; } public override string ToString() { FormatInterpolatedStringHandler val = default(FormatInterpolatedStringHandler); ((FormatInterpolatedStringHandler)(ref val))..ctor(38, 3); ((FormatInterpolatedStringHandler)(ref val)).AppendLiteral("AddressMeaning("); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted(Kind.FastToString()); ((FormatInterpolatedStringHandler)(ref val)).AppendLiteral(", offset: "); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted<int>(RelativeToOffset); ((FormatInterpolatedStringHandler)(ref val)).AppendLiteral(", constant: "); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted<ulong>(ConstantValue); ((FormatInterpolatedStringHandler)(ref val)).AppendLiteral(")"); return DebugFormatter.Format(ref val); } public override int GetHashCode() { return HashCode.Combine(Kind, RelativeToOffset, ConstantValue); } public static bool operator ==(AddressMeaning left, AddressMeaning right) { return left.Equals(right); } public static bool operator !=(AddressMeaning left, AddressMeaning right) { return !(left == right); } } public sealed class BytePattern { private enum SegmentKind { Literal, MaskedLiteral, Any, AnyRepeating, Address } private record struct PatternSegment(int Start, int Length, SegmentKind Kind) { public ReadOnlySpan<T> SliceOf<T>(ReadOnlySpan<T> span) { return span.Slice(Start, Length); } public ReadOnlyMemory<T> SliceOf<T>(ReadOnlyMemory<T> mem) { return mem.Slice(Start, Length); } } private readonly record struct ComputeSegmentsResult(PatternSegment[] Segments, int MinLen, int AddrBytes); private const ushort MaskMask = 65280; public const byte BAnyValue = 0; public const ushort SAnyValue = 65280; public const byte BAnyRepeatingValue = 1; public const ushort SAnyRepeatingValue = 65281; public const byte BAddressValue = 2; public const ushort SAddressValue = 65282; private readonly ReadOnlyMemory<byte> pattern; private readonly ReadOnlyMemory<byte> bitmask; private readonly PatternSegment[] segments; private (ReadOnlyMemory<byte> Bytes, int Offset)? lazyFirstLiteralSegment; public int AddressBytes { get; } public int MinLength { get; } public AddressMeaning AddressMeaning { get; } public bool MustMatchAtStart { get; } public (ReadOnlyMemory<byte> Bytes, int Offset) FirstLiteralSegment { get { (ReadOnlyMemory<byte>, int) valueOrDefault = lazyFirstLiteralSegment.GetValueOrDefault(); if (!lazyFirstLiteralSegment.HasValue) { valueOrDefault = GetFirstLiteralSegment(); lazyFirstLiteralSegment = valueOrDefault; return valueOrDefault; } return valueOrDefault; } } public BytePattern(AddressMeaning meaning, params ushort[] pattern) : this(meaning, mustMatchAtStart: false, pattern.AsMemory()) { } public BytePattern(AddressMeaning meaning, bool mustMatchAtStart, params ushort[] pattern) : this(meaning, mustMatchAtStart, pattern.AsMemory()) { } public BytePattern(AddressMeaning meaning, ReadOnlyMemory<ushort> pattern) : this(meaning, mustMatchAtStart: false, pattern) { } public BytePattern(AddressMeaning meaning, bool mustMatchAtStart, ReadOnlyMemory<ushort> pattern) { AddressMeaning = meaning; MustMatchAtStart = mustMatchAtStart; ComputeSegmentsFromShort(pattern).Deconstruct(out PatternSegment[] Segments, out int MinLen, out int AddrBytes); segments = Segments; MinLength = MinLen; AddressBytes = AddrBytes; Memory<byte> memory = new byte[pattern.Length * 2].AsMemory(); Memory<byte> memory2 = memory.Slice(0, pattern.Length); Memory<byte> memory3 = memory.Slice(pattern.Length); for (int i = 0; i < pattern.Length; i++) { ushort num = pattern.Span[i]; byte b = (byte)((num & 0xFF00) >> 8); byte b2 = (byte)(num & -65281); if ((b == 0 || b == byte.MaxValue) ? true : false) { b = (byte)(~b); } memory2.Span[i] = (byte)(b2 & b); memory3.Span[i] = b; } this.pattern = memory2; bitmask = memory3; } public BytePattern(AddressMeaning meaning, ReadOnlyMemory<byte> mask, ReadOnlyMemory<byte> pattern) : this(meaning, mustMatchAtStart: false, mask, pattern) { } public BytePattern(AddressMeaning meaning, bool mustMatchAtStart, ReadOnlyMemory<byte> mask, ReadOnlyMemory<byte> pattern) { AddressMeaning = meaning; MustMatchAtStart = mustMatchAtStart; ComputeSegmentsFromMaskPattern(mask, pattern).Deconstruct(out PatternSegment[] Segments, out int MinLen, out int AddrBytes); segments = Segments; MinLength = MinLen; AddressBytes = AddrBytes; this.pattern = pattern; bitmask = mask; } private unsafe static ComputeSegmentsResult ComputeSegmentsFromShort(ReadOnlyMemory<ushort> pattern) { return ComputeSegmentsCore((delegate*<ReadOnlyMemory<ushort>, int, SegmentKind>)(&KindForShort), pattern.Length, pattern); static SegmentKind KindForShort(ReadOnlyMemory<ushort> readOnlyMemory, int idx) { ushort num = readOnlyMemory.Span[idx]; switch (num & 0xFF00) { case 0: return SegmentKind.Literal; case 65280: { int num2 = num & 0xFF; return num2 switch { 0 => SegmentKind.Any, 1 => SegmentKind.AnyRepeating, 2 => SegmentKind.Address, _ => throw new ArgumentException($"Pattern contained unknown special value {num2:x2}", "pattern"), }; } default: return SegmentKind.MaskedLiteral; } } } private unsafe static ComputeSegmentsResult ComputeSegmentsFromMaskPattern(ReadOnlyMemory<byte> mask, ReadOnlyMemory<byte> pattern) { if (mask.Length < pattern.Length) { throw new ArgumentException("Mask buffer shorter than pattern", "mask"); } return ComputeSegmentsCore((delegate*<(ReadOnlyMemory<byte>, ReadOnlyMemory<byte>), int, SegmentKind>)(&KindForIdx), pattern.Length, (mask, pattern)); static SegmentKind KindForIdx((ReadOnlyMemory<byte> mask, ReadOnlyMemory<byte> pattern) t, int idx) { switch (t.mask.Span[idx]) { case 0: { byte b = t.pattern.Span[idx]; return b switch { 0 => SegmentKind.Any, 1 => SegmentKind.AnyRepeating, 2 => SegmentKind.Address, _ => throw new ArgumentException($"Pattern contained unknown special value {b:x2}", "pattern"), }; } case byte.MaxValue: return SegmentKind.Literal; default: return SegmentKind.MaskedLiteral; } } } private unsafe static ComputeSegmentsResult ComputeSegmentsCore<TPattern>(delegate*<TPattern, int, SegmentKind> kindForIdx, int patternLength, TPattern pattern) { if (patternLength == 0) { throw new ArgumentException("Pattern cannot be empty", "pattern"); } int num = 0; SegmentKind segmentKind = SegmentKind.AnyRepeating; int num2 = 0; int num3 = 0; int num4 = 0; int num5 = -1; for (int i = 0; i < patternLength; i++) { SegmentKind segmentKind2 = kindForIdx(pattern, i); int num6 = num4; num4 = num6 + segmentKind2 switch { SegmentKind.Literal => 1, SegmentKind.MaskedLiteral => 1, SegmentKind.Any => 1, SegmentKind.AnyRepeating => 0, SegmentKind.Address => 1, _ => 0, }; if (segmentKind2 != segmentKind) { if (num5 < 0) { num5 = i; } num++; num2 = 1; } else { num2++; } if (segmentKind2 == SegmentKind.Address) { num3++; } segmentKind = segmentKind2; } if (num > 0 && segmentKind == SegmentKind.AnyRepeating) { num--; } if (num == 0 || num4 <= 0) { throw new ArgumentException("Pattern has no meaningful segments", "pattern"); } PatternSegment[] array = new PatternSegment[num]; num = 0; segmentKind = SegmentKind.AnyRepeating; num2 = 0; for (int j = num5; j < patternLength; j++) { if (num > array.Length) { break; } SegmentKind num7 = kindForIdx(pattern, j); if (num7 != segmentKind) { if (num > 0) { array[num - 1] = new PatternSegment(j - num2, num2, segmentKind); if (num > 1 && segmentKind == SegmentKind.Any && array[num - 2].Kind == SegmentKind.AnyRepeating) { Helpers.Swap<PatternSegment>(ref array[num - 2], ref array[num - 1]); } } num++; num2 = 1; } else { num2++; } segmentKind = num7; } if (segmentKind != SegmentKind.AnyRepeating && num > 0) { array[num - 1] = new PatternSegment(patternLength - num2, num2, segmentKind); } return new ComputeSegmentsResult(array, num4, num3); } public bool TryMatchAt(ReadOnlySpan<byte> data, out ulong address, out int length) { if (data.Length < MinLength) { length = 0; address = 0uL; return false; } ReadOnlySpan<byte> span = pattern.Span; Span<byte> addrBuf = stackalloc byte[8]; bool result = TryMatchAtImpl(span, data, addrBuf, out length, 0); address = Unsafe.ReadUnaligned<ulong>(in addrBuf[0]); return result; } public bool TryMatchAt(ReadOnlySpan<byte> data, Span<byte> addrBuf, out int length) { if (data.Length < MinLength) { length = 0; return false; } ReadOnlySpan<byte> span = pattern.Span; return TryMatchAtImpl(span, data, addrBuf, out length, 0); } private bool TryMatchAtImpl(ReadOnlySpan<byte> patternSpan, ReadOnlySpan<byte> data, Span<byte> addrBuf, out int length, int startAtSegment) { int num = 0; int num2 = startAtSegment; while (true) { if (num2 < segments.Length) { PatternSegment patternSegment = segments[num2]; switch (patternSegment.Kind) { case SegmentKind.Literal: if (data.Length - num >= patternSegment.Length) { ReadOnlySpan<byte> span = patternSegment.SliceOf(patternSpan); if (span.SequenceEqual(data.Slice(num, span.Length))) { num += patternSegment.Length; goto IL_0192; } } break; case SegmentKind.MaskedLiteral: if (data.Length - num >= patternSegment.Length) { ReadOnlySpan<byte> readOnlySpan2 = patternSegment.SliceOf(patternSpan); ReadOnlySpan<byte> readOnlySpan3 = patternSegment.SliceOf(bitmask.Span); if (Helpers.MaskedSequenceEqual(readOnlySpan2, data.Slice(num, readOnlySpan2.Length), readOnlySpan3)) { num += patternSegment.Length; goto IL_0192; } } break; case SegmentKind.Any: if (data.Length - num >= patternSegment.Length) { num += patternSegment.Length; goto IL_0192; } break; case SegmentKind.Address: if (data.Length - num >= patternSegment.Length) { ReadOnlySpan<byte> readOnlySpan = data.Slice(num, Math.Min(patternSegment.Length, addrBuf.Length)); readOnlySpan.CopyTo(addrBuf); addrBuf = addrBuf.Slice(Math.Min(addrBuf.Length, readOnlySpan.Length)); num += patternSegment.Length; goto IL_0192; } break; case SegmentKind.AnyRepeating: { int offset; int length2; bool result = ScanForNextLiteral(patternSpan, data.Slice(num), addrBuf, out offset, out length2, num2); length = num + offset + length2; return result; } default: throw new InvalidOperationException(); } break; } length = num; return true; IL_0192: num2++; } length = 0; return false; } public bool TryFindMatch(ReadOnlySpan<byte> data, out ulong address, out int offset, out int length) { if (data.Length < MinLength) { length = (offset = 0); address = 0uL; return false; } ReadOnlySpan<byte> span = pattern.Span; Span<byte> addrBuf = stackalloc byte[8]; bool result; if (MustMatchAtStart) { offset = 0; result = TryMatchAtImpl(span, data, addrBuf, out length, 0); } else { result = ScanForNextLiteral(span, data, addrBuf, out offset, out length, 0); } address = Unsafe.ReadUnaligned<ulong>(in addrBuf[0]); return result; } public bool TryFindMatch(ReadOnlySpan<byte> data, Span<byte> addrBuf, out int offset, out int length) { if (data.Length < MinLength) { length = (offset = 0); return false; } ReadOnlySpan<byte> span = pattern.Span; if (MustMatchAtStart) { offset = 0; return TryMatchAtImpl(span, data, addrBuf, out length, 0); } return ScanForNextLiteral(span, data, addrBuf, out offset, out length, 0); } private bool ScanForNextLiteral(ReadOnlySpan<byte> patternSpan, ReadOnlySpan<byte> data, Span<byte> addrBuf, out int offset, out int length, int segmentIndex) { var (patternSegment, num) = GetNextLiteralSegment(segmentIndex); if (num + patternSegment.Length > data.Length) { offset = (length = 0); return false; } int num2 = 0; while (true) { int num3 = data.Slice(num + num2).IndexOf(patternSegment.SliceOf(patternSpan)); if (num3 < 0) { offset = (length = 0); return false; } if (TryMatchAtImpl(patternSpan, data.Slice(offset = num2 + num3), addrBuf, out length, segmentIndex)) { break; } num2 += num3 + 1; } return true; } private (ReadOnlyMemory<byte> Bytes, int Offset) GetFirstLiteralSegment() { var (patternSegment, item) = GetNextLiteralSegment(0); return (Bytes: patternSegment.SliceOf(pattern), Offset: item); } private (PatternSegment Segment, int LiteralOffset) GetNextLiteralSegment(int segmentIndexId) { if (segmentIndexId < 0 || segmentIndexId >= segments.Length) { throw new ArgumentOutOfRangeException("segmentIndexId"); } int num = 0; while (segmentIndexId < segments.Length) { PatternSegment item = segments[segmentIndexId]; if (item.Kind == SegmentKind.Literal) { return (Segment: item, LiteralOffset: num); } SegmentKind kind = item.Kind; if (((uint)(kind - 1) <= 1u || kind == SegmentKind.Address) ? true : false) { num += item.Length; } else if (item.Kind != SegmentKind.AnyRepeating) { throw new InvalidOperationException("Unknown segment kind"); } segmentIndexId++; } return (Segment: default(PatternSegment), LiteralOffset: num); } } public sealed class BytePatternCollection : IEnumerable<BytePattern>, IEnumerable { private struct HomogenousPatternCollection { public BytePattern[]?[] Lut; public readonly int Offset; public int MinLength; public HomogenousPatternCollection(int offs) { Offset = offs; Lut = null; MinLength = int.MaxValue; } public void AddFirstBytes(ref FirstByteCollection bytes) { for (int i = 0; i < Lut.Length; i++) { if (Lut[i] != null) { bytes.Add((byte)i); } } } } private ref struct FirstByteCollection { private Span<byte> firstByteStore; private Span<byte> byteIndicies; private int firstBytesRecorded; public const int SingleAllocationSize = 512; public ReadOnlySpan<byte> FirstBytes => firstByteStore.Slice(0, firstBytesRecorded); public FirstByteCollection(Span<byte> store) : this(store.Slice(0, 256), store.Slice(256, 256)) { } public FirstByteCollection(Span<byte> store, Span<byte> indicies) { firstByteStore = store; byteIndicies = indicies; firstBytesRecorded = 0; byteIndicies.Fill(byte.MaxValue); } public void Add(byte value) { ref byte reference = ref byteIndicies[value]; if (reference == byte.MaxValue) { reference = (byte)firstBytesRecorded; firstByteStore[reference] = value; firstBytesRecorded = Math.Min(firstBytesRecorded + 1, 256); } } } private readonly HomogenousPatternCollection[] patternCollections; private readonly BytePattern[]? emptyPatterns; private ReadOnlyMemory<byte>? lazyPossibleFirstBytes; public int MinLength { get; } public int MaxMinLength { get; } public int MaxAddressLength { get; } private ReadOnlyMemory<byte> PossibleFirstBytes { get { ReadOnlyMemory<byte> valueOrDefault = lazyPossibleFirstBytes.GetValueOrDefault(); if (!lazyPossibleFirstBytes.HasValue) { valueOrDefault = GetPossibleFirstBytes(); lazyPossibleFirstBytes = valueOrDefault; return valueOrDefault; } return valueOrDefault; } } public BytePatternCollection(ReadOnlyMemory<BytePattern?> patterns) { int minLength; int maxMinLength; int maxAddrLength; (HomogenousPatternCollection[], BytePattern[]) tuple = ComputeLut(patterns, out minLength, out maxMinLength, out maxAddrLength); patternCollections = tuple.Item1; emptyPatterns = tuple.Item2; MinLength = minLength; MaxMinLength = maxMinLength; MaxAddressLength = maxAddrLength; Helpers.Assert(MinLength > 0, (string)null, "MinLength > 0"); } public BytePatternCollection(params BytePattern?[] patterns) : this(patterns.AsMemory()) { } public IEnumerator<BytePattern> GetEnumerator() { for (int i = 0; i < patternCollections.Length; i++) { BytePattern[]?[] coll = patternCollections[i].Lut; for (int j = 0; j < coll.Length; j++) { if (coll[j] != null) { BytePattern[] array = coll[j]; for (int k = 0; k < array.Length; k++) { yield return array[k]; } } } } if (emptyPatterns != null) { BytePattern[] array = emptyPatterns; for (int i = 0; i < array.Length; i++) { yield return array[i]; } } } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } private static (HomogenousPatternCollection[], BytePattern[]?) ComputeLut(ReadOnlyMemory<BytePattern?> patterns, out int minLength, out int maxMinLength, out int maxAddrLength) { if (patterns.Length == 0) { minLength = 0; maxMinLength = 0; maxAddrLength = 0; return (ArrayEx.Empty<HomogenousPatternCollection>(), null); } Span<int> span = stackalloc int[256]; minLength = int.MaxValue; maxMinLength = int.MinValue; maxAddrLength = 0; int[][] array = null; int num = 0; int num2 = 0; for (int i = 0; i < patterns.Length; i++) { BytePattern bytePattern = patterns.Span[i]; if (bytePattern == null) { continue; } if (bytePattern.MinLength < minLength) { minLength = bytePattern.MinLength; } if (bytePattern.MinLength > maxMinLength) { maxMinLength = bytePattern.MinLength; } if (bytePattern.AddressBytes > maxAddrLength) { maxAddrLength = bytePattern.AddressBytes; } var (readOnlyMemory, num3) = bytePattern.FirstLiteralSegment; if (readOnlyMemory.Length == 0) { num++; continue; } num2 = 1; if (num3 == 0) { span[readOnlyMemory.Span[0]]++; continue; } if (array == null || array.Length < num3) { Array.Resize(ref array, num3); } ref int[] reference = ref array[num3 - 1]; if (reference == null) { reference = new int[256]; } reference[readOnlyMemory.Span[0]]++; } if (array != null) { int[][] array2 = array; for (int j = 0; j < array2.Length; j++) { if (array2[j] != null) { num2++; } } } BytePattern[] array3 = ((num > 0) ? new BytePattern[num] : null); int num4 = 0; HomogenousPatternCollection[] array4 = new HomogenousPatternCollection[num2]; int num5 = 1; array4[0] = new HomogenousPatternCollection(0); for (int k = 0; k < patterns.Length; k++) { BytePattern bytePattern2 = patterns.Span[k]; if (bytePattern2 == null) { continue; } var (readOnlyMemory2, num6) = bytePattern2.FirstLiteralSegment; if (readOnlyMemory2.Length == 0) { array3[num4++] = bytePattern2; continue; } int num7 = -1; for (int l = 0; l < array4.Length; l++) { if (array4[l].Offset == num6) { num7 = l; break; } } if (num7 == -1) { num7 = num5++; array4[num7] = new HomogenousPatternCollection(num6); } ReadOnlySpan<int> arrayCounts = ((num6 == 0) ? span : array[num6 - 1].AsSpan()); AddToPatternCollection(ref array4[num7], arrayCounts, bytePattern2); if (num7 > 0 && array4[num7 - 1].Offset > array4[num7].Offset) { Helpers.Swap<HomogenousPatternCollection>(ref array4[num7 - 1], ref array4[num7]); } } return (array4, array3); static void AddToPatternCollection(ref HomogenousPatternCollection collection, ReadOnlySpan<int> readOnlySpan, BytePattern pattern) { ReadOnlyMemory<byte> item = pattern.FirstLiteralSegment.Bytes; if (collection.Lut == null) { BytePattern[][] array5 = new BytePattern[256][]; for (int m = 0; m < readOnlySpan.Length; m++) { if (readOnlySpan[m] > 0) { array5[m] = new BytePattern[readOnlySpan[m]]; } } collection.Lut = array5; } BytePattern[]? obj = collection.Lut[item.Span[0]]; int num8 = Array.IndexOf(obj, null); obj[num8] = pattern; if (pattern.MinLength < collection.MinLength) { collection.MinLength = pattern.MinLength; } } } public bool TryMatchAt(ReadOnlySpan<byte> data, out ulong address, [MaybeNullWhen(false)] out BytePattern matchingPattern, out int length) { if (data.Length < MinLength) { length = 0; address = 0uL; matchingPattern = null; return false; } Span<byte> addrBuf = stackalloc byte[8]; bool result = TryMatchAt(data, addrBuf, out matchingPattern, out length); address = Unsafe.ReadUnaligned<ulong>(in addrBuf[0]); return result; } public bool TryMatchAt(ReadOnlySpan<byte> data, Span<byte> addrBuf, [MaybeNullWhen(false)] out BytePattern matchingPattern, out int length) { if (data.Length < MinLength) { length = 0; matchingPattern = null; return false; } for (int i = 0; i < patternCollections.Length; i++) { ref HomogenousPatternCollection reference = ref patternCollections[i]; if (data.Length < reference.Offset + reference.MinLength) { continue; } byte b = data[reference.Offset]; BytePattern[] array = reference.Lut[b]; if (array == null) { continue; } BytePattern[] array2 = array; foreach (BytePattern bytePattern in array2) { if (bytePattern.TryMatchAt(data, addrBuf, out length)) { matchingPattern = bytePattern; return true; } } } if (emptyPatterns != null) { BytePattern[] array2 = emptyPatterns; foreach (BytePattern bytePattern2 in array2) { if (bytePattern2.TryMatchAt(data, addrBuf, out length)) { matchingPattern = bytePattern2; return true; } } } matchingPattern = null; length = 0; return false; } public bool TryFindMatch(ReadOnlySpan<byte> data, out ulong address, [MaybeNullWhen(false)] out BytePattern matchingPattern, out int offset, out int length) { if (data.Length < MinLength) { length = (offset = 0); address = 0uL; matchingPattern = null; return false; } Span<byte> addrBuf = stackalloc byte[8]; bool result = TryFindMatch(data, addrBuf, out matchingPattern, out offset, out length); address = Unsafe.ReadUnaligned<ulong>(in addrBuf[0]); return result; } public bool TryFindMatch(ReadOnlySpan<byte> data, Span<byte> addrBuf, [MaybeNullWhen(false)] out BytePattern matchingPattern, out int offset, out int length) { if (data.Length < MinLength) { length = (offset = 0); matchingPattern = null; return false; } ReadOnlySpan<byte> span = PossibleFirstBytes.Span; int num = 0; while (true) { int num2 = data.Slice(num).IndexOfAny(span); if (num2 < 0) { break; } offset = num + num2; byte b = data[offset]; for (int i = 0; i < patternCollections.Length; i++) { ref HomogenousPatternCollection reference = ref patternCollections[i]; if (offset < reference.Offset || data.Length < offset + reference.MinLength) { continue; } BytePattern[] array = reference.Lut[b]; if (array == null) { continue; } BytePattern[] array2 = array; foreach (BytePattern bytePattern in array2) { if ((offset == 0 || !bytePattern.MustMatchAtStart) && bytePattern.TryMatchAt(data.Slice(offset - reference.Offset), addrBuf, out length)) { offset -= reference.Offset; matchingPattern = bytePattern; return true; } } } num = offset + 1; } if (emptyPatterns != null) { BytePattern[] array2 = emptyPatterns; foreach (BytePattern bytePattern2 in array2) { if (bytePattern2.TryFindMatch(data, addrBuf, out offset, out length)) { matchingPattern = bytePattern2; return true; } } } matchingPattern = null; offset = 0; length = 0; return false; } private ReadOnlyMemory<byte> GetPossibleFirstBytes() { Memory<byte> memory = new byte[512].AsMemory(); FirstByteCollection bytes = new FirstByteCollection(memory.Span); for (int i = 0; i < patternCollections.Length; i++) { patternCollections[i].AddFirstBytes(ref bytes); } return memory.Slice(0, bytes.FirstBytes.Length); } } internal static class IcedExtensions { [Obsolete("This method is not supported.", true)] public static string FormatInsns(this IList<Instruction> insns) { throw new NotSupportedException(); } [Obsolete("This method is not supported.", true)] public static string FormatInsns(this InstructionList insns) { throw new NotSupportedException(); } } public interface IInitialize { void Initialize(); } public interface IInitialize<T> { void Initialize(T value); } internal struct StringParser { internal delegate T ParseRawFunc<T>(string buffer, ref int startIndex, ref int endIndex); private readonly string _buffer; private readonly char _separator; private readonly bool _skipEmpty; private int _startIndex; private int _endIndex; public StringParser(string buffer, char separator, bool skipEmpty = false) { _buffer = Helpers.ThrowIfNull<string>(buffer, "buffer"); _separator = separator; _skipEmpty = skipEmpty; _startIndex = -1; _endIndex = -1; } public bool MoveNext() { if (_buffer == null) { throw new InvalidOperationException(); } do { if (_endIndex >= _buffer.Length) { _startIndex = _endIndex; return false; } int num = _buffer.IndexOf(_separator, _endIndex + 1); _startIndex = _endIndex + 1; _endIndex = ((num >= 0) ? num : _buffer.Length); } while (_skipEmpty && _endIndex < _startIndex + 1); return true; } public void MoveNextOrFail() { if (!MoveNext()) { ThrowForInvalidData(); } } public string MoveAndExtractNext() { MoveNextOrFail(); return _buffer.Substring(_startIndex, _endIndex - _startIndex); } public string MoveAndExtractNextInOuterParens() { MoveNextOrFail(); if (_buffer[_startIndex] != '(') { ThrowForInvalidData(); } int num = _buffer.LastIndexOf(')'); if (num == -1 || num < _startIndex) { ThrowForInvalidData(); } string result = _buffer.Substring(_startIndex + 1, num - _startIndex - 1); _endIndex = num + 1; return result; } public string ExtractCurrent() { if (_buffer == null || _startIndex == -1) { throw new InvalidOperationException(); } return _buffer.Substring(_startIndex, _endIndex - _startIndex); } public unsafe int ParseNextInt32() { MoveNextOrFail(); bool flag = false; int num = 0; fixed (char* ptr = _buffer.AsSpan()) { char* ptr2 = ptr + _startIndex; char* ptr3 = ptr + _endIndex; if (ptr2 == ptr3) { ThrowForInvalidData(); } if (*ptr2 == '-') { flag = true; ptr2++; if (ptr2 == ptr3) { ThrowForInvalidData(); } } for (; ptr2 != ptr3; ptr2++) { int num2 = *ptr2 - 48; if (num2 < 0 || num2 > 9) { ThrowForInvalidData(); } num = checked(flag ? (num * 10 - num2) : (num * 10 + num2)); } } return num; } public unsafe long ParseNextInt64() { MoveNextOrFail(); bool flag = false; long num = 0L; fixed (char* ptr = _buffer.AsSpan()) { char* ptr2 = ptr + _startIndex; char* ptr3 = ptr + _endIndex; if (ptr2 == ptr3) { ThrowForInvalidData(); } if (*ptr2 == '-') { flag = true; ptr2++; if (ptr2 == ptr3) { ThrowForInvalidData(); } } for (; ptr2 != ptr3; ptr2++) { int num2 = *ptr2 - 48; if (num2 < 0 || num2 > 9) { ThrowForInvalidData(); } num = checked(flag ? (num * 10 - num2) : (num * 10 + num2)); } } return num; } public unsafe uint ParseNextUInt32() { MoveNextOrFail(); if (_startIndex == _endIndex) { ThrowForInvalidData(); } uint num = 0u; fixed (char* ptr = _buffer.AsSpan()) { char* ptr2 = ptr + _startIndex; for (char* ptr3 = ptr + _endIndex; ptr2 != ptr3; ptr2++) { int num2 = *ptr2 - 48; if (num2 < 0 || num2 > 9) { ThrowForInvalidData(); } num = (uint)checked(num * 10 + num2); } } return num; } public unsafe ulong ParseNextUInt64() { MoveNextOrFail(); ulong num = 0uL; fixed (char* ptr = _buffer.AsSpan()) { char* ptr2 = ptr + _startIndex; for (char* ptr3 = ptr + _endIndex; ptr2 != ptr3; ptr2++) { int num2 = *ptr2 - 48; if (num2 < 0 || num2 > 9) { ThrowForInvalidData(); } num = checked(num * 10 + (ulong)num2); } } return num; } public char ParseNextChar() { MoveNextOrFail(); if (_endIndex - _startIndex != 1) { ThrowForInvalidData(); } return _buffer[_startIndex]; } internal T ParseRaw<T>(ParseRawFunc<T> selector) { MoveNextOrFail(); return selector(_buffer, ref _startIndex, ref _endIndex); } public string ExtractCurrentToEnd() { if (_buffer == null || _startIndex == -1) { throw new InvalidOperationException(); } return _buffer.Substring(_startIndex); } private static void ThrowForInvalidData() { throw new FormatException(); } } } namespace MonoMod.Core.Platforms { public enum TypeClassification { InRegister, ByReference, OnStack } public delegate TypeClassification Classifier(Type type, bool isReturn); public enum SpecialArgumentKind { ThisPointer, ReturnBuffer, GenericContext, UserArguments } public readonly record struct Abi(ReadOnlyMemory<SpecialArgumentKind> ArgumentOrder, Classifier Classifier, bool ReturnsReturnBuffer) { public TypeClassification Classify(Type type, bool isReturn) { Helpers.ThrowIfArgumentNull<Type>(type, "type"); if (type == typeof(void)) { return TypeClassification.InRegister; } if (!type.IsValueType) { return TypeClassification.InRegister; } if (type.IsPointer) { return TypeClassification.InRegister; } if (type.IsByRef) { return TypeClassification.InRegister; } return Classifier(type, isReturn); } } [Flags] public enum ArchitectureFeature { None = 0, FixedInstructionSize = 1, Immediate64 = 2, CreateAltEntryPoint = 4 } public readonly struct FeatureFlags : IEquatable<FeatureFlags> { public ArchitectureFeature Architecture { get; } public SystemFeature System { get; } public RuntimeFeature Runtime { get; } public FeatureFlags(ArchitectureFeature archFlags, SystemFeature sysFlags, RuntimeFeature runtimeFlags) { Runtime = runtimeFlags; Architecture = archFlags; System = sysFlags; } public bool Has(RuntimeFeature feature) { return (Runtime & feature) == feature; } public bool Has(ArchitectureFeature feature) { return (Architecture & feature) == feature; } public bool Has(SystemFeature feature) { return (System & feature) == feature; } public override bool Equals(object? obj) { if (obj is FeatureFlags other) { return Equals(other); } return false; } public bool Equals(FeatureFlags other) { if (Runtime == other.Runtime && Architecture == other.Architecture) { return System == other.System; } return false; } public override int GetHashCode() { return HashCode.Combine(Runtime, Architecture, System); } public override string ToString() { return $"({Architecture})({System})({Runtime})"; } public static bool operator ==(FeatureFlags left, FeatureFlags right) { return left.Equals(right); } public static bool operator !=(FeatureFlags left, FeatureFlags right) { return !(left == right); } } public interface IAltEntryFactory { IntPtr CreateAlternateEntrypoint(IntPtr entrypoint, int minLength, out IDisposable? handle); } public interface IArchitecture { ArchitectureKind Target { get; } ArchitectureFeature Features { get; } BytePatternCollection KnownMethodThunks { get; } IAltEntryFactory AltEntryFactory { get; } NativeDetourInfo ComputeDetourInfo(IntPtr from, IntPtr target, int maxSizeHint = -1); int GetDetourBytes(NativeDetourInfo info, Span<byte> buffer, out IDisposable? allocationHandle); NativeDetourInfo ComputeRetargetInfo(NativeDetourInfo detour, IntPtr target, int maxSizeHint = -1); int GetRetargetBytes(NativeDetourInfo original, NativeDetourInfo retarget, Span<byte> buffer, out IDisposable? allocationHandle, out bool needsRepatch, out bool disposeOldAlloc); ReadOnlyMemory<IAllocatedMemory> CreateNativeVtableProxyStubs(IntPtr vtableBase, int vtableSize); IAllocatedMemory CreateSpecialEntryStub(IntPtr target, IntPtr argument); } public interface INativeDetourKind { int Size { get; } } public readonly record struct NativeDetourInfo(IntPtr From, IntPtr To, INativeDetourKind InternalKind, IDisposable? InternalData) { public int Size => InternalKind.Size; } public interface IControlFlowGuard { bool IsSupported { get; } int TargetAlignmentRequirement { get; } unsafe void RegisterValidIndirectCallTargets(void* memoryRegionStart, nint memoryRegionLength, ReadOnlySpan<nint> validTargetsInMemoryRegion); } public interface IMemoryAllocator { int MaxSize { get; } bool TryAllocate(AllocationRequest request, [MaybeNullWhen(false)] out IAllocatedMemory allocated); bool TryAllocateInRange(PositionedAllocationRequest request, [MaybeNullWhen(false)] out IAllocatedMemory allocated); } public readonly record struct AllocationRequest { public int Size { get; init; } public int Alignment { get; init; } public bool Executable { get; init; } public AllocationRequest(int Size) { Executable = false; this.Size = Size; Alignment = 8; } [CompilerGenerated] public void Deconstruct(out int Size) { Size = this.Size; } } public readonly record struct PositionedAllocationRequest(IntPtr Target, IntPtr LowBound, IntPtr HighBound, AllocationRequest Base); public interface IAllocatedMemory : IDisposable { bool IsExecutable { get; } IntPtr BaseAddress { get; } int Size { get; } Span<byte> Memory { get; } } public interface INativeExceptionHelper { GetExceptionSlot GetExceptionSlot { get; } IntPtr CreateNativeToManagedHelper(IntPtr target, out IDisposable? handle); IntPtr CreateManagedToNativeHelper(IntPtr target, out IDisposable? handle); } public unsafe delegate IntPtr* GetExceptionSlot(); public interface IRuntime { RuntimeKind Target { get; } RuntimeFeature Features { get; } Abi Abi { get; } event OnMethodCompiledCallback? OnMethodCompiled; MethodBase GetIdentifiable(MethodBase method); RuntimeMethodHandle GetMethodHandle(MethodBase method); bool RequiresGenericContext(MethodBase method); void DisableInlining(MethodBase method); IDisposable? PinMethodIfNeeded(MethodBase method); IntPtr GetMethodEntryPoint(MethodBase method); void Compile(MethodBase method); } public delegate void OnMethodCompiledCallback(RuntimeMethodHandle methodHandle, MethodBase? method, IntPtr codeStart, IntPtr codeRw, ulong codeSize); public interface ISystem { OSKind Target { get; } SystemFeature Features { get; } Abi? DefaultAbi { get; } IMemoryAllocator MemoryAllocator { get; } INativeExceptionHelper? NativeExceptionHelper { get; } IEnumerable<LoadedModule> EnumerateLoadedModules(); IEnumerable<string?> EnumerateLoadedModuleFiles(); nint GetSizeOfReadableMemory(IntPtr start, nint guess); void PatchData(PatchTargetKind targetKind, IntPtr patchTarget, ReadOnlySpan<byte> data, Span<byte> backup); IntPtr GetNativeJitHookConfig(int runtimeMajMin); } public enum PatchTargetKind { Executable, ReadOnly } public readonly record struct LoadedModule(ulong? BaseAddress, string? FileName, ulong? Size); public sealed class PlatformTriple { public record struct NativeDetour(SimpleNativeDetour Simple, IntPtr AltEntry, IDisposable? AltHandle) { public bool HasAltEntry => AltEntry != IntPtr.Zero; } private static object lazyCurrentLock = new object(); private static PlatformTriple? lazyCurrent; private static readonly Func<PlatformTriple> createCurrentFunc = CreateCurrent; private IntPtr ThePreStub = IntPtr.Zero; public IArchitecture Architecture { get; } public ISystem System { get; } public IRuntime Runtime { get; } public static PlatformTriple Current => Helpers.GetOrInitWithLock<PlatformTriple>(ref lazyCurrent, lazyCurrentLock, createCurrentFunc); public (ArchitectureKind Arch, OSKind OS, RuntimeKind Runtime) HostTriple => (Arch: Architecture.Target, OS: System.Target, Runtime: Runtime.Target); public FeatureFlags SupportedFeatures { get; } public Abi Abi { get; } [EditorBrowsable(EditorBrowsableState.Advanced)] public static IRuntime CreateCurrentRuntime(ISystem system, IArchitecture arch) { //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_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) //IL_0030: Expected I4, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) Helpers.ThrowIfArgumentNull<ISystem>(system, "system"); Helpers.ThrowIfArgumentNull<IArchitecture>(arch, "arch"); RuntimeKind runtime = PlatformDetection.Runtime; return (runtime - 1) switch { 0 => FxBaseRuntime.CreateForVersion(PlatformDetection.RuntimeVersion, system), 1 => CoreBaseRuntime.CreateForVersion(PlatformDetection.RuntimeVersion, system, arch), 2 => new MonoRuntime(system), _ => throw new PlatformNotSupportedException($"Runtime kind {runtime} not supported"), }; } [EditorBrowsable(EditorBrowsableState.Advanced)] public static IArchitecture CreateCurrentArchitecture(ISystem system) { //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_0011: 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_0029: Expected I4, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) Helpers.ThrowIfArgumentNull<ISystem>(system, "system"); ArchitectureKind architecture = PlatformDetection.Architecture; return (architecture - 2) switch { 0 => new x86Arch(system), 1 => new x86_64Arch(system), 2 => throw new NotImplementedException(), 3 => new Arm64Arch(system), _ => throw new PlatformNotSupportedException($"Architecture kind {architecture} not supported"), }; } [EditorBrowsable(EditorBrowsableState.Advanced)] public static ISystem CreateCurrentSystem() { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Invalid comparison between Unknown and I4 //IL_000b: 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_0027: Expected I4, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_008c: 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: Invalid comparison between Unknown and I4 //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Invalid comparison between Unknown and I4 //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Invalid comparison between Unknown and I4 OSKind oS = PlatformDetection.OS; if ((int)oS <= 17) { switch (oS - 1) { case 0: throw new NotImplementedException(); case 4: return new MacOSSystem(); case 1: goto IL_006c; case 2: case 3: goto IL_0074; } if ((int)oS == 9) { return new LinuxSystem(); } if ((int)oS == 17) { throw new NotImplementedException(); } } else { if ((int)oS == 34) { goto IL_006c; } if ((int)oS == 37) { throw new NotImplementedException(); } if ((int)oS == 41) { throw new NotImplementedException(); } } goto IL_0074; IL_006c: return new WindowsSystem(); IL_0074: throw new PlatformNotSupportedException($"OS kind {oS} not supported"); } private static PlatformTriple CreateCurrent() { ISystem system = CreateCurrentSystem(); IArchitecture architecture = CreateCurrentArchitecture(system); IRuntime runtime = CreateCurrentRuntime(system, architecture); return new PlatformTriple(architecture, system, runtime); } [EditorBrowsable(EditorBrowsableState.Advanced)] public static void SetPlatformTriple(PlatformTriple triple) { Helpers.ThrowIfArgumentNull<PlatformTriple>(triple, "triple"); if (lazyCurrent != null) { ThrowTripleAlreadyExists(); } lock (lazyCurrentLock) { if (lazyCurrent != null) { ThrowTripleAlreadyExists(); } lazyCurrent = triple; } } [MethodImpl(MethodImplOptions.NoInlining)] private static void ThrowTripleAlreadyExists() { throw new InvalidOperationException("The platform triple has already been initialized; cannot set a new one"); } [EditorBrowsable(EditorBrowsableState.Advanced)] public PlatformTriple(IArchitecture architecture, ISystem system, IRuntime runtime) { Helpers.ThrowIfArgumentNull<IArchitecture>(architecture, "architecture"); Helpers.ThrowIfArgumentNull<ISystem>(system, "system"); Helpers.ThrowIfArgumentNull<IRuntime>(runtime, "runtime"); Architecture = architecture; System = system; Runtime = runtime; SupportedFeatures = new FeatureFlags(Architecture.Features, System.Features, Runtime.Features); InitIfNeeded(Architecture); InitIfNeeded(System); InitIfNeeded(Runtime); Abi = Runtime.Abi; } private void InitIfNeeded(object obj) { (obj as IInitialize<ISystem>)?.Initialize(System); (obj as IInitialize<IArchitecture>)?.Initialize(Architecture); (obj as IInitialize<IRuntime>)?.Initialize(Runtime); (obj as IInitialize<PlatformTriple>)?.Initialize(this); (obj as IInitialize)?.Initialize(); } public void Compile(MethodBase method) { Helpers.ThrowIfArgumentNull<MethodBase>(method, "method"); if (method.IsGenericMethodDefinition) { throw new ArgumentException("Cannot prepare generic method definition", "method"); } method = GetIdentifiable(method); if (SupportedFeatures.Has(RuntimeFeature.RequiresCustomMethodCompile)) { Runtime.Compile(method); return; } RuntimeMethodHandle methodHandle = Runtime.GetMethodHandle(method); if (method.IsGenericMethod) { Type[] genericArguments = method.GetGenericArguments(); RuntimeTypeHandle[] array = new RuntimeTypeHandle[genericArguments.Length]; for (int i = 0; i < genericArguments.Length; i++) { array[i] = genericArguments[i].TypeHandle; } RuntimeHelpers.PrepareMethod(methodHandle, array); } else { RuntimeHelpers.PrepareMethod(methodHandle); } } public MethodBase GetIdentifiable(MethodBase method) { //IL_009f: 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_016d: 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_0115: 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) Helpers.ThrowIfArgumentNull<MethodBase>(method, "method"); if (SupportedFeatures.Has(RuntimeFeature.RequiresMethodIdentification)) { method = Runtime.GetIdentifiable(method); } if (method.ReflectedType != method.DeclaringType) { ParameterInfo[] parameters = method.GetParameters(); Type[] array = new Type[parameters.Length]; for (int i = 0; i < parameters.Length; i++) { array[i] = parameters[i].ParameterType; } bool flag2 = default(bool); if ((object)method.DeclaringType == null) { MethodInfo? method2 = method.Module.GetMethod(method.Name, (BindingFlags)(-1), null, method.CallingConvention, array, null); bool flag = (object)method2 != null; bool num = flag; AssertionInterpolatedStringHandler val = new AssertionInterpolatedStringHandler(16, 2, flag, ref flag2); if (flag2) { ((AssertionInterpolatedStringHandler)(ref val)).AppendLiteral("orig: "); ((AssertionInterpolatedStringHandler)(ref val)).AppendFormatted<MethodBase>(method); ((AssertionInterpolatedStringHandler)(ref val)).AppendLiteral(", module: "); ((AssertionInterpolatedStringHandler)(ref val)).AppendFormatted<Module>(method.Module); } Helpers.Assert(num, ref val, "got is not null"); method = method2; } else if (method.IsConstructor) { ConstructorInfo? constructor = method.DeclaringType.GetConstructor((BindingFlags)(-1), null, method.CallingConvention, array, null); flag2 = (object)constructor != null; bool num2 = flag2; bool flag = default(bool); AssertionInterpolatedStringHandler val2 = new AssertionInterpolatedStringHandler(6, 1, flag2, ref flag); if (flag) { ((AssertionInterpolatedStringHandler)(ref val2)).AppendLiteral("orig: "); ((AssertionInterpolatedStringHandler)(ref val2)).AppendFormatted<MethodBase>(method); } Helpers.Assert(num2, ref val2, "got is not null"); method = constructor; } else { MethodInfo? method3 = method.DeclaringType.GetMethod(method.Name, (BindingFlags)(-1), null, method.CallingConvention, array, null); bool flag = (object)method3 != null; bool num3 = flag; AssertionInterpolatedStringHandler val3 = new AssertionInterpolatedStringHandler(6, 1, flag, ref flag2); if (flag2) { ((AssertionInterpolatedStringHandler)(ref val3)).AppendLiteral("orig: "); ((AssertionInterpolatedStringHandler)(ref val3)).AppendFormatted<MethodBase>(method); } Helpers.Assert(num3, ref val3, "got is not null"); method = method3; } } return method; } public IDisposable? PinMethodIfNeeded(MethodBase method) { if (SupportedFeatures.Has(RuntimeFeature.RequiresMethodPinning)) { return Runtime.PinMethodIfNeeded(method); } return null; } public bool TryDisableInlining(MethodBase method) { if (SupportedFeatures.Has(RuntimeFeature.DisableInlining)) { Runtime.DisableInlining(method); return true; } return false; } public SimpleNativeDetour CreateSimpleDetour(IntPtr from, IntPtr to, int detourMaxSize = -1, IntPtr fromRw = default(IntPtr)) { //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) if (fromRw == (IntPtr)0) { fromRw = from; } bool flag = from != to; bool isEnabled = default(bool); AssertionInterpolatedStringHandler val = new AssertionInterpolatedStringHandler(48, 2, flag, ref isEnabled); if (isEnabled) { ((AssertionInterpolatedStringHandler)(ref val)).AppendLiteral("Cannot detour a method to itself! (from: "); ((AssertionInterpolatedStringHandler)(ref val)).AppendFormatted<IntPtr>(from); ((AssertionInterpolatedStringHandler)(ref val)).AppendLiteral(", to: "); ((AssertionInterpolatedStringHandler)(ref val)).AppendFormatted<IntPtr>(to); ((AssertionInterpolatedStringHandler)(ref val)).AppendLiteral(")"); } Helpers.Assert(flag, ref val, "from != to"); MMDbgLog.DebugLogTraceStringHandler message = new MMDbgLog.DebugLogTraceStringHandler(31, 2, out isEnabled); if (isEnabled) { message.AppendLiteral("Creating simple detour 0x"); message.AppendFormatted(from, "x16"); message.AppendLiteral(" => 0x"); message.AppendFormatted(to, "x16"); } MMDbgLog.Trace(ref message); NativeDetourInfo nativeDetourInfo = Architecture.ComputeDetourInfo(from, to, detourMaxSize); Span<byte> span = stackalloc byte[nativeDetourInfo.Size]; Architecture.GetDetourBytes(nativeDetourInfo, span, out IDisposable allocationHandle); byte[] array = new byte[nativeDetourInfo.Size]; System.PatchData(PatchTargetKind.Executable, fromRw, span, array); return new SimpleNativeDetour(this, nativeDetourInfo, array, allocationHandle); } public NativeDetour CreateNativeDetour(IntPtr from, IntPtr to, int detourMaxSize = -1, IntPtr fromRw = default(IntPtr)) { //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) if (fromRw == (IntPtr)0) { fromRw = from; } bool flag = from != to; bool isEnabled = default(bool); AssertionInterpolatedStringHandler val = new AssertionInterpolatedStringHandler(48, 2, flag, ref isEnabled); if (isEnabled) { ((AssertionInterpolatedStringHandler)(ref val)).AppendLiteral("Cannot detour a method to itself! (from: "); ((AssertionInterpolatedStringHandler)(ref val)).AppendFormatted<IntPtr>(from); ((AssertionInterpolatedStringHandler)(ref val)).AppendLiteral(", to: "); ((AssertionInterpolatedStringHandler)(ref val)).AppendFormatted<IntPtr>(to); ((AssertionInterpolatedStringHandler)(ref val)).AppendLiteral(")"); } Helpers.Assert(flag, ref val, "from != to"); MMDbgLog.DebugLogTraceStringHandler message = new MMDbgLog.DebugLogTraceStringHandler(31, 2, out isEnabled); if (isEnabled) { message.AppendLiteral("Creating simple detour 0x"); message.AppendFormatted(from, "x16"); message.AppendLiteral(" => 0x"); message.AppendFormatted(to, "x16"); } MMDbgLog.Trace(ref message); NativeDetourInfo nativeDetourInfo = Architecture.ComputeDetourInfo(from, to, detourMaxSize); Span<byte> span = stackalloc byte[nativeDetourInfo.Size]; IDisposable allocationHandle; int detourBytes = Architecture.GetDetourBytes(nativeDetourInfo, span, out allocationHandle); IntPtr altEntry = IntPtr.Zero; IDisposable handle = null; if (SupportedFeatures.Has(ArchitectureFeature.CreateAltEntryPoint)) { altEntry = Architecture.AltEntryFactory.CreateAlternateEntrypoint(from, detourBytes, out handle); } else { MMDbgLog.DebugLogWarningStringHandler message2 = new MMDbgLog.DebugLogWarningStringHandler(67, 2, out isEnabled); if (isEnabled) { message2.AppendLiteral("Cannot create alternate entry point for native detour (from: "); message2.AppendFormatted(from, "x16"); message2.AppendLiteral(", to: "); message2.AppendFormatted(to, "x16"); } MMDbgLog.Warning(ref message2); } byte[] array = new byte[nativeDetourInfo.Size]; System.PatchData(PatchTargetKind.Executable, fromRw, span, array); return new NativeDetour(new SimpleNativeDetour(this, nativeDetourInfo, array, allocationHandle), altEntry, handle); } public IntPtr GetNativeMethodBody(MethodBase method) { if (SupportedFeatures.Has(RuntimeFeature.RequiresBodyThunkWalking)) { return GetNativeMethodBodyWalk(method, reloadPtr: true); } return GetNativeMethodBodyDirect(method); } private unsafe IntPtr GetNativeMethodBodyWalk(MethodBase method, bool reloadPtr) { bool flag = false; bool flag2 = false; int value = 0; BytePatternCollection knownMethodThunks = Architecture.KnownMethodThunks; bool isEnabled; MMDbgLog.DebugLogTraceStringHandler message = new MMDbgLog.DebugLogTraceStringHandler(32, 1, out isEnabled); if (isEnabled) { message.AppendLiteral("Performing method body walk for "); message.AppendFormatted(method); } MMDbgLog.Trace(ref message); nint num = -1; FormatInterpolatedStringHandler val = default(FormatInterpolatedStringHandler); while (true) { nint num2 = Runtime.GetMethodEntryPoint(method); MMDbgLog.DebugLogTraceStringHandler message2 = new MMDbgLog.DebugLogTraceStringHandler(25, 1, out isEnabled); if (isEnabled) { message2.AppendLiteral("Starting entry point = 0x"); message2.AppendFormatted(num2, "x16"); } MMDbgLog.Trace(ref message2); while (true) { if (value++ > 20) { MMDbgLog.DebugLogErrorStringHandler message3 = new MMDbgLog.DebugLogErrorStringHandler(70, 4, out isEnabled); if (isEnabled) { message3.AppendLiteral("Could not get entry point for "); message3.AppendFormatted(method); message3.AppendLiteral("! (tried "); message3.AppendFormatted(value); message3.AppendLiteral(" times) entry: 0x"); message3.AppendFormatted(num2, "x16"); message3.AppendLiteral(" prevEntry: 0x"); message3.AppendFormatted(num, "x16"); } MMDbgLog.Error(ref message3); ((FormatInterpolatedStringHandler)(ref val))..ctor(47, 1); ((FormatInterpolatedStringHandler)(ref val)).AppendLiteral("Could not get entrypoint for "); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted<MethodBase>(method); ((FormatInterpolatedStringHandler)(ref val)).AppendLiteral(" (stuck in a loop)"); throw new NotSupportedException(DebugFormatter.Format(ref val)); } if (flag2 || num != num2) { num = num2; nint sizeOfReadableMemory = System.GetSizeOfReadableMemory(num2, knownMethodThunks.MaxMinLength); if (sizeOfReadableMemory <= 0) { MMDbgLog.DebugLogWarningStringHandler message4 = new MMDbgLog.DebugLogWarningStringHandler(43, 2, out isEnabled); if (isEnabled) { message4.AppendLiteral("Got zero or negative readable length "); message4.AppendFormatted(sizeOfReadableMemory); message4.AppendLiteral(" at 0x"); message4.AppendFormatted(num2, "x16"); } MMDbgLog.Warning(ref message4); } ReadOnlySpan<byte> data = new ReadOnlySpan<byte>((void*)num2, Math.Min((int)sizeOfReadableMemory, knownMethodThunks.MaxMinLength)); if (knownMethodThunks.TryFindMatch(data, out ulong address, out BytePattern matchingPattern, out int offset, out int _)) { IntPtr ptrGot = num2; flag2 = false; AddressMeaning addressMeaning = matchingPattern.AddressMeaning; MMDbgLog.DebugLogTraceStringHandler message5 = new MMDbgLog.DebugLogTraceStringHandler(46, 4, out isEnabled); if (isEnabled) { message5.AppendLiteral("Matched thunk with "); message5.AppendFormatted(addressMeaning); message5.AppendLiteral(" at 0x"); message5.AppendFormatted(num2, "x16"); message5.AppendLiteral(" (addr: 0x"); message5.AppendFormatted(address, "x8"); message5.AppendLiteral(", offset: "); message5.AppendFormatted(offset); message5.AppendLiteral(")"); } MMDbgLog.Trace(ref message5); if (addressMeaning.Kind.IsPrecodeFixup() && !flag) { nint num3 = addressMeaning.ProcessAddress(num2, offset, address); if (reloadPtr) { MMDbgLog.DebugLogTraceStringHandler message6 = new MMDbgLog.DebugLogTraceStringHandler(56, 1, out isEnabled); if (isEnabled) { message6.AppendLiteral("Method thunk reset; regenerating (PrecodeFixupThunk: 0x"); message6.AppendFormatted(num3, "X16"); message6.AppendLiteral(")"); } MMDbgLog.Trace(ref message6); Compile(method); flag2 = true; break; } num2 = num3; } else { num2 = addressMeaning.ProcessAddress(num2, offset, address); } MMDbgLog.DebugLogTraceStringHandler message7 = new MMDbgLog.DebugLogTraceStringHandler(23, 1, out isEnabled); if (isEnabled) { message7.AppendLiteral("Got next entry point 0x"); message7.AppendFormatted(num2, "x16"); } MMDbgLog.Trace(ref message7); num2 = NotThePreStub(ptrGot, num2, out var wasPreStub); if (wasPreStub && reloadPtr) { MMDbgLog.Trace("Matched ThePreStub"); Compile(method); break; } continue; } } return num2; } } } private IntPtr GetNativeMethodBodyDirect(MethodBase method) { return Runtime.GetMethodEntryPoint(method); } private IntPtr NotThePreStub(IntPtr ptrGot, IntPtr ptrParsed, out bool wasPreStub) { if (ThePreStub == IntPtr.Zero) { ThePreStub = (IntPtr)(-2); IntPtr thePreStub = (from m in typeof(HttpWebRequest).Assembly.GetType("System.Net.Connection")?.GetMethods() group m by GetNativeMethodBodyWalk(m, reloadPtr: false)).First((IGrouping<IntPtr, MethodInfo> g) => g.Count() > 1).Key ?? ((IntPtr)(-1)); ThePreStub = thePreStub; bool isEnabled; MMDbgLog.DebugLogTraceStringHandler message = new MMDbgLog.DebugLogTraceStringHandler(14, 1, out isEnabled); if (isEnabled) { message.AppendLiteral("ThePreStub: 0x"); message.AppendFormatted(ThePreStub, "X16"); } MMDbgLog.Trace(ref message); } wasPreStub = ptrParsed == ThePreStub; if (!wasPreStub) { return ptrParsed; } return ptrGot; } public MethodBase GetRealDetourTarget(MethodBase from, MethodBase to) { //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Expected O, but got Unknown //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) Helpers.ThrowIfArgumentNull<MethodBase>(from, "from"); Helpers.ThrowIfArgumentNull<MethodBase>(to, "to"); to = GetIdentifiable(to); if (!(from is MethodInfo methodInfo) || !(to is MethodInfo methodInfo2)) { return to; } bool flag = false; ReadOnlyMemory<SpecialArgumentKind> argumentOrder = Abi.ArgumentOrder; ReadOnlySpan<SpecialArgumentKind> span = argumentOrder.Span; for (int i = 0; i < span.Length; i++) { if (span[i] == SpecialArgumentKind.ReturnBuffer) { flag = true; break; } } Type returnType = methodInfo.ReturnType; bool flag2 = Abi.Classify(returnType, isReturn: true) == TypeClassification.ByReference; bool flag3 = !methodInfo.IsStatic; bool num = flag3 && methodInfo2.IsStatic && flag2 && flag; bool flag4 = HasGenericContext(Abi) && Runtime.RequiresGenericContext(methodInfo); if (!num && !flag4) { return to; } Type type = (flag2 ? returnType.MakeByRefType() : returnType); Type type2 = ((flag2 && !Abi.ReturnsReturnBuffer) ? typeof(void) : type); int num2 = -1; int num3 = -1; int num4 = -1; ParameterInfo[] parameters = from.GetParameters(); List<Type> list = new List<Type>(parameters.Length + 3); argumentOrder = Abi.ArgumentOrder; ReadOnlySpan<SpecialArgumentKind> span2 = argumentOrder.Span; for (int j = 0; j < span2.Length; j++) { switch (span2[j]) { case SpecialArgumentKind.ThisPointer: if (flag3) { num2 = list.Count; list.Add(Extensions.GetThisParamType(from)); } break; case SpecialArgumentKind.ReturnBuffer: if (flag2) { num3 = list.Count; list.Add(type); } break; case SpecialArgumentKind.GenericContext: if (flag4) { list.Add(typeof(IntPtr)); } break; case SpecialArgumentKind.UserArguments: num4 = list.Count; list.AddRange(parameters.Select((ParameterInfo p) => p.ParameterType)); break; } } FormatInterpolatedStringHandler val = default(FormatInterpolatedStringHandler); ((FormatInterpolatedStringHandler)(ref val))..ctor(16, 2); ((FormatInterpolatedStringHandler)(ref val)).AppendLiteral("Glue:AbiFixup<"); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted<MethodBase>(from); ((FormatInterpolatedStringHandler)(ref val)).AppendLiteral(","); ((FormatInterpolatedStringHandler)(ref val)).AppendFormatted<MethodBase>(to); ((FormatInterpolatedStringHandler)(ref val)).AppendLiteral(">"); DynamicMethodDefinition val2 = new DynamicMethodDefinition(DebugFormatter.Format(ref val), type2, list.ToArray()); try { MethodDefinition definition = val2.Definition; definition.ImplAttributes = (MethodImplAttributes)(definition.ImplAttributes | 0x208); ILProcessor iLProcessor = val2.GetILProcessor(); if (flag2 && num3 >= 0) { iLProcessor.Emit(OpCodes.Ldarg, num3); } if (flag3) { iLProcessor.Emit(OpCodes.Ldarg, num2); } for (int num5 = 0; num5 < parameters.Length; num5++) { iLProcessor.Emit(OpCodes.Ldarg, num5 + num4); } iLProcessor.Emit(OpCodes.Call, ((MemberReference)iLProcessor.Body.Method).Module.ImportReference(to)); if (flag2 && num3 >= 0) { iLProcessor.Emit(OpCodes.Stobj, ((MemberReference)iLProcessor.Body.Method).Module.ImportReference(returnType)); } if (flag2 && Abi.ReturnsReturnBuffer) { iLProcessor.Emit(OpCodes.Ldarg, num3); } iLProcessor.Emit(OpCodes.Ret); return val2.Generate(); } finally { ((IDisposable)val2)?.Dispose(); } } private static bool HasGenericContext(Abi abi) { ReadOnlySpan<SpecialArgumentKind> span = abi.ArgumentOrder.Span; for (int i = 0; i < span.Length; i++) { if (span[i] == SpecialArgumentKind.GenericContext) { return true; } } return false; } } internal sealed class PlatformTripleDetourFactory : IDetourFactory { private abstract class DetourBase : ICoreDetourBase, IDisposable { protected abstract class DetourBoxBase { public SimpleNativeDetour? Detour; public readonly List<SimpleNativeDetour> OldDetours = new List<SimpleNativeDetour>(); protected readonly PlatformTriple Triple; protected readonly object Sync = new object(); private bool applyDetours; private bool isApplying; public bool IsApplied { get { return Volatile.Read(in applyDetours); } set { Volatile.Write(ref applyDetours, value); Thread.MemoryBarrier(); } } public bool IsApplying { get { return Volatile.Read(in isApplying); } set { Volatile.Write(ref isApplying, value); Thread.MemoryBarrier(); } } protected DetourBoxBase(PlatformTriple triple) { Triple = triple; applyDetours = false; isApplying = false; } public void ClearOldDetours() { foreach (SimpleNativeDetour oldDetour in OldDetours) { oldDetour.Dispose(); } OldDetours.Clear(); } } protected readonly PlatformTriple Triple; protected DetourBoxBase DetourBox; private bool disposedValue; public bool IsApplied => DetourBox.IsApplied; protected DetourBase(PlatformTriple triple) { Triple = triple; DetourBox = null; } protected TBox GetDetourBox<TBox>() where TBox : DetourBoxBase { return Unsafe.As<TBox>(DetourBox); } protected static void ReplaceDetourInLock(DetourBoxBase nativeDetour, SimpleNativeDetour? newDetour, out SimpleNativeDetour? oldDetour) { Thread.MemoryBarrier(); oldDetour = Interlocked.Exchange(ref nativeDetour.Detour, newDetour); if (oldDetour != null) { nativeDetour.OldDetours.Add(oldDetour); } } protected abstract SimpleNativeDetour CreateDetour(); public void Apply() { lock (DetourBox) { if (IsApplied) { throw new InvalidOperationException("Cannot apply a detour which is already applied"); } try { DetourBox.IsApplying = true; DetourBox.IsApplied = true; ReplaceDetourInLock(DetourBox, CreateDetour(), out SimpleNativeDetour _); } catch { DetourBox.IsApplied = false; throw; } finally { DetourBox.IsApplying = false; } } } protected abstract void BeforeUndo(); protected abstract void AfterUndo(); public void Undo() { lock (DetourBox) { if (!IsApplied) { throw new InvalidOperationException("Cannot undo a detour which is not applied"); } try { DetourBox.IsApplying = true; UndoCore(out SimpleNativeDetour _); DetourBox.ClearOldDetours(); } finally { DetourBox.IsApplying = false; } } } private void UndoCore(out SimpleNativeDetour? oldDetour) { BeforeUndo(); DetourBox.IsApplied = false; ReplaceDetourInLock(DetourBox, null, out oldDetour); AfterUndo(); } protected abstract void BeforeDispose(); private void Dispose(bool disposing) { if (!disposedValue) { BeforeDispose(); lock (DetourBox) { UndoCore(out SimpleNativeDetour _); DetourBox.ClearOldDetours(); } disposedValue = true; } } ~DetourBase() { Dispose(disposing: false); } public void Dispose() { Dispose(disposing: true); GC.SuppressFinalize(this); } } private sealed class Detour : DetourBase, ICoreDetour, ICoreDetourBase, IDisposable { private sealed class ManagedDetourBox : DetourBoxBase { private readonly MethodBase src; private readonly MethodBase target; public ManagedDetourBox(PlatformTriple triple, MethodBase src, MethodBase target) : base(triple) { this.src = src; this.target = target; Detour = null; } public void SubscribeCompileMethod() { AddRelatedDetour(src, this); } public void UnsubscribeCompileMethod() { RemoveRelatedDetour(src, this); } public void OnMethodCompiled(MethodBase method, IntPtr codeStart, IntPtr codeStartRw, ulong codeSize) { if (!base.IsApplied) { return; } method = Triple.GetIdentifiable(method); lock (Sync) { if (!base.IsApplied || base.IsApplying) { return; } bool isEnabled; MMDbgLog.DebugLogTraceStringHandler message = new MMDbgLog.DebugLogTraceStringHandler(43, 4, out isEnabled); if (isEnabled) { message.AppendLiteral("Updating detour from "); message.AppendFormatted(src); message.AppendLiteral(" to "); message.AppendFormatted(target); message.AppendLiteral(" (recompiled "); message.AppendFormatted(method); message.AppendLiteral(" to "); message.AppendFormatted(codeStart, "x16"); message.AppendLiteral(")"); } MMDbgLog.Trace(ref message); try { base.IsApplying = true; SimpleNativeDetour detour = Detour; IntPtr to; IntPtr intPtr; IntPtr fromRw; if (detour != null) { _ = detour.Source; to = detour.Destination; intPtr = codeStart; fromRw = codeStartRw; } else { intPtr = codeStart; fromRw = codeStartRw; to = Triple.Runtime.GetMethodHandle(target).GetFunctionPointer(); } SimpleNativeDetour newDetour = Triple.CreateSimpleDetour(intPtr, to, (int)codeSize, fromRw); DetourBase.ReplaceDetourInLock(this, newDetour, out SimpleNativeDetour _); } finally { base.IsApplying = false; } } } } private sealed class RelatedDetourBag { public readonly MethodBase Method; public readonly List<ManagedDetourBox> RelatedDetours = new List<ManagedDetourBox>(); public bool IsValid = true; public RelatedDetourBag(MethodBase method) { Method = method; } } private readonly MethodBase realTarget; private static readonly object subLock = new object(); private static bool hasSubscribed; private static readonly ConcurrentDictionary<MethodBase, RelatedDetourBag> relatedDetours = new ConcurrentDictionary<MethodBase, RelatedDetourBag>(); private IDisposable? srcPin; private IDisposable? dstPin; private new ManagedDetourBox DetourBox => GetDetourBox<ManagedDetourBox>(); public MethodBase Source { get; } public MethodBase Target { get; } public Detour(PlatformTriple triple, MethodBase src, MethodBase dst) : base(triple) { Source = triple.GetIdentifiable(src); Target = dst; realTarget = triple.GetRealDetourTarget(src, dst); base.DetourBox = new ManagedDetourBox(triple, Source, realTarget); if (triple.SupportedFeatures.Has(RuntimeFeature.CompileMethodHook)) { EnsureSubscribed(triple); DetourBox.SubscribeCompileMethod(); } } private static void EnsureSubscribed(PlatformTriple triple) { if (Volatile.Read(in hasSubscribed)) { return; } lock (subLock) { if (!Volatile.Read(in hasSubscribed)) { Volatile.Write(ref hasSubscribed, value: true); triple.Runtime.OnMethodCompiled += OnMethodCompiled; } } } private static void AddRelatedDetour(MethodBase m, ManagedDetourBox cmh) { while (true) { RelatedDetourBag orAdd = relatedDetours.GetOrAdd(m, (MethodBase method) => new RelatedDetourBag(method)); lock (orAdd) { if (!orAdd.IsValid) { continue; } orAdd.RelatedDetours.Add(cmh); if (orAdd.RelatedDetours.Count > 1) { bool isEnabled; MMDbgLog.DebugLogWarningStringHandler message = new MMDbgLog.DebugLogWarningStringHandler(115, 1, out isEnabled); if (isEnabled) { message.AppendLiteral("Multiple related detours for method "); message.AppendFormatted(m); message.AppendLiteral("! This means that the method has been detoured twice. Detour cleanup will fail."); } MMDbgLog.Warning(ref message); } break; } } } private static vo
plugins/StylePixelator/MonoMod.ILHelpers.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using Microsoft.CodeAnalysis; [assembly: AssemblyMetadata("IsTrimmable", "True")] [assembly: AssemblyCopyright("Copyright 2024 0x0ade, DaNike")] [assembly: CLSCompliant(false)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyTitle("MonoMod.ILHelpers")] [assembly: AssemblyCompany("0x0ade, DaNike")] [assembly: AssemblyDescription("Package Description")] [assembly: AssemblyMetadata(".NETFrameworkAssembly", "")] [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: AssemblyVersion("1.1.0.0")] [assembly: TypeForwardedTo(typeof(Unsafe))] 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 { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [Microsoft.CodeAnalysis.Embedded] [CompilerGenerated] [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[] A_0) { TransformFlags = A_0; } } [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 NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte A_0) { NullableFlags = new byte[1] { A_0 }; } public NullableAttribute(byte[] A_0) { NullableFlags = A_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte A_0) { Flag = A_0; } } } namespace MonoMod { public static class ILHelpers { [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe static T TailCallDelegatePtr<T>(IntPtr source) { return ((delegate*<T>)source)(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T TailCallFunc<T>(Func<T> func) { return func(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe static ref T ObjectAsRef<T>(object obj) { fixed (object obj2 = obj) { T** ptr = (T**)(&obj2); return ref *(*ptr); } } } } namespace MonoMod.Backports.ILHelpers { public static class UnsafeRaw { [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static T Read<T>(void* source) { return System.Runtime.CompilerServices.Unsafe.Read<T>(source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static T ReadUnaligned<T>(void* source) { return System.Runtime.CompilerServices.Unsafe.ReadUnaligned<T>(source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static T ReadUnaligned<T>(ref byte source) { return System.Runtime.CompilerServices.Unsafe.ReadUnaligned<T>(ref source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void Write<T>(void* destination, T value) { System.Runtime.CompilerServices.Unsafe.Write(destination, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void WriteUnaligned<T>(void* destination, T value) { System.Runtime.CompilerServices.Unsafe.WriteUnaligned(destination, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static void WriteUnaligned<T>(ref byte destination, T value) { System.Runtime.CompilerServices.Unsafe.WriteUnaligned(ref destination, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void Copy<T>(void* destination, ref T source) { System.Runtime.CompilerServices.Unsafe.Write(destination, source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void Copy<T>(ref T destination, void* source) { destination = System.Runtime.CompilerServices.Unsafe.Read<T>(source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void* AsPointer<T>(ref T value) { return System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.Unsafe.SizeOf<T>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void CopyBlock(void* destination, void* source, uint byteCount) { // IL cpblk instruction System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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)System.Runtime.CompilerServices.Unsafe.SizeOf<T>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Add<T>(ref T source, nint elementOffset) { return ref System.Runtime.CompilerServices.Unsafe.Add(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Add<T>(ref T source, nuint elementOffset) { return ref System.Runtime.CompilerServices.Unsafe.Add(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T AddByteOffset<T>(ref T source, nint byteOffset) { return ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T AddByteOffset<T>(ref T source, nuint byteOffset) { return ref System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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)System.Runtime.CompilerServices.Unsafe.SizeOf<T>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Subtract<T>(ref T source, nint elementOffset) { return ref System.Runtime.CompilerServices.Unsafe.Subtract(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Subtract<T>(ref T source, nuint elementOffset) { return ref System.Runtime.CompilerServices.Unsafe.Subtract(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T SubtractByteOffset<T>(ref T source, nint byteOffset) { return ref System.Runtime.CompilerServices.Unsafe.SubtractByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T SubtractByteOffset<T>(ref T source, nuint byteOffset) { return ref System.Runtime.CompilerServices.Unsafe.SubtractByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static nint ByteOffset<T>(ref T origin, ref T target) { return System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.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 System.Runtime.CompilerServices.Unsafe.IsAddressLessThan(ref left, ref right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static bool IsNullRef<T>(ref T source) { return System.Runtime.CompilerServices.Unsafe.AsPointer(ref source) == null; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static ref T NullRef<T>() { return ref *(T*)null; } } }
plugins/StylePixelator/MonoMod.Iced.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using Iced.Intel.BlockEncoderInternal; using Iced.Intel.DecoderInternal; using Iced.Intel.EncoderInternal; using Iced.Intel.Internal; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: InternalsVisibleTo("Iced.UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d94ac07d6edc1ac1f306b60544bb88927664f05037602c5e994ea52ca5b0aadc4a242d90522f46730c11af657acc3ff5aadfe19a3030e7dbd67b481635eecd7d738950a7de6a78c92715b797dde11e87d967109da659672957fabe3524cd5f90557cd8ab4927333a0dbd32e7e7246ee18a43327806c6721283fc619acca3f2cb")] [assembly: TargetFramework(".NETFramework,Version=v4.5.2", FrameworkDisplayName = ".NET Framework 4.5.2")] [assembly: AssemblyCompany("iced project and contributors <https://github.com/icedland>")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright (C) 2018-present iced project and contributors")] [assembly: AssemblyDescription("x86/x64 disassembler, assembler, instruction decoder")] [assembly: AssemblyFileVersion("1.21.0.0")] [assembly: AssemblyInformationalVersion("1.21.0+69fdc9deb")] [assembly: AssemblyProduct("Iced")] [assembly: AssemblyTitle("MonoMod.Iced")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/MonoMod/MonoMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.21.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NullablePublicOnly(true)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] internal sealed class IsReadOnlyAttribute : Attribute { } [CompilerGenerated] [Embedded] internal sealed class IsByRefLikeAttribute : Attribute { } [CompilerGenerated] [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] [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] [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] [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 MonoMod.SourceGen.Attributes { [AttributeUsage(AttributeTargets.Class)] internal sealed class EmitILOverloadsAttribute : Attribute { public EmitILOverloadsAttribute(string filename, string kind) { } } internal static class ILOverloadKind { public const string Cursor = "ILCursor"; public const string Matcher = "ILMatcher"; } } namespace iced { internal static class AssemblyInfo { public const string AssemblyName = "MonoMod.Iced"; public const string AssemblyVersion = "1.21.0"; } } namespace Iced.Intel { public enum RelocKind { Offset64 } public readonly struct RelocInfo { public readonly ulong Address; public readonly RelocKind Kind; public RelocInfo(RelocKind kind, ulong address) { Kind = kind; Address = address; } } public readonly struct InstructionBlock { public readonly CodeWriter CodeWriter; public readonly IList<Instruction> Instructions; public readonly ulong RIP; public InstructionBlock(CodeWriter codeWriter, IList<Instruction> instructions, ulong rip) { CodeWriter = codeWriter ?? throw new ArgumentNullException("codeWriter"); Instructions = instructions ?? throw new ArgumentNullException("instructions"); RIP = rip; } } public readonly struct BlockEncoderResult { public readonly ulong RIP; public readonly List<RelocInfo>? RelocInfos; public readonly uint[] NewInstructionOffsets; public readonly ConstantOffsets[] ConstantOffsets; internal BlockEncoderResult(ulong rip, List<RelocInfo>? relocInfos, uint[]? newInstructionOffsets, ConstantOffsets[]? constantOffsets) { RIP = rip; RelocInfos = relocInfos; NewInstructionOffsets = newInstructionOffsets ?? Array2.Empty<uint>(); ConstantOffsets = constantOffsets ?? Array2.Empty<ConstantOffsets>(); } } [Flags] public enum BlockEncoderOptions { None = 0, DontFixBranches = 1, ReturnRelocInfos = 2, ReturnNewInstructionOffsets = 4, ReturnConstantOffsets = 8 } public sealed class BlockEncoder { private sealed class NullCodeWriter : CodeWriter { public static readonly NullCodeWriter Instance = new NullCodeWriter(); private NullCodeWriter() { } public override void WriteByte(byte value) { } } private readonly int bitness; private readonly BlockEncoderOptions options; private readonly Block[] blocks; private readonly Encoder nullEncoder; private readonly Dictionary<ulong, Instr> toInstr; internal int Bitness => bitness; internal bool FixBranches => (options & BlockEncoderOptions.DontFixBranches) == 0; private bool ReturnRelocInfos => (options & BlockEncoderOptions.ReturnRelocInfos) != 0; private bool ReturnNewInstructionOffsets => (options & BlockEncoderOptions.ReturnNewInstructionOffsets) != 0; private bool ReturnConstantOffsets => (options & BlockEncoderOptions.ReturnConstantOffsets) != 0; private BlockEncoder(int bitness, InstructionBlock[] instrBlocks, BlockEncoderOptions options) { if (bitness != 16 && bitness != 32 && bitness != 64) { throw new ArgumentOutOfRangeException("bitness"); } if (instrBlocks == null) { throw new ArgumentNullException("instrBlocks"); } this.bitness = bitness; nullEncoder = Encoder.Create(bitness, NullCodeWriter.Instance); this.options = options; blocks = new Block[instrBlocks.Length]; int num = 0; for (int i = 0; i < instrBlocks.Length; i++) { IList<Instruction> instructions = instrBlocks[i].Instructions; if (instructions == null) { throw new ArgumentException(); } Block block = new Block(this, instrBlocks[i].CodeWriter, instrBlocks[i].RIP, ReturnRelocInfos ? new List<RelocInfo>() : null); blocks[i] = block; Instr[] array = new Instr[instructions.Count]; ulong num2 = instrBlocks[i].RIP; for (int j = 0; j < array.Length; j++) { Instr instr = Instr.Create(this, block, instructions[j]); instr.IP = num2; array[j] = instr; num++; num2 += instr.Size; } block.SetInstructions(array); } Array.Sort(blocks, delegate(Block a, Block b) { ulong rIP = a.RIP; return rIP.CompareTo(b.RIP); }); Dictionary<ulong, Instr> dictionary = (toInstr = new Dictionary<ulong, Instr>(num)); bool flag = false; Block[] array2 = blocks; for (int num3 = 0; num3 < array2.Length; num3++) { Instr[] instructions2 = array2[num3].Instructions; foreach (Instr instr2 in instructions2) { ulong origIP = instr2.OrigIP; if (dictionary.TryGetValue(origIP, out var _)) { if (origIP != 0L) { throw new ArgumentException($"Multiple instructions with the same IP: 0x{origIP:X}"); } flag = true; } else { dictionary[origIP] = instr2; } } } if (flag) { dictionary.Remove(0uL); } array2 = blocks; foreach (Block obj in array2) { ulong num5 = obj.RIP; Instr[] instructions2 = obj.Instructions; foreach (Instr instr3 in instructions2) { instr3.IP = num5; if (!instr3.Done) { instr3.Initialize(this); } num5 += instr3.Size; } } } public static bool TryEncode(int bitness, InstructionBlock block, [NotNullWhen(false)] out string? errorMessage, out BlockEncoderResult result, BlockEncoderOptions options = BlockEncoderOptions.None) { if (TryEncode(bitness, new InstructionBlock[1] { block }, out errorMessage, out BlockEncoderResult[] result2, options)) { result = result2[0]; return true; } result = default(BlockEncoderResult); return false; } public static bool TryEncode(int bitness, InstructionBlock[] blocks, [NotNullWhen(false)] out string? errorMessage, [NotNullWhen(true)] out BlockEncoderResult[]? result, BlockEncoderOptions options = BlockEncoderOptions.None) { return new BlockEncoder(bitness, blocks, options).Encode(out errorMessage, out result); } private bool Encode([NotNullWhen(false)] out string errorMessage, [NotNullWhen(true)] out BlockEncoderResult[] result) { Block[] array; for (int i = 0; i < 5; i++) { bool flag = false; array = blocks; foreach (Block obj in array) { ulong num = obj.RIP; ulong num2 = 0uL; Instr[] instructions = obj.Instructions; foreach (Instr instr in instructions) { instr.IP = num; if (!instr.Done) { uint size = instr.Size; if (instr.Optimize(num2)) { if (instr.Size > size) { errorMessage = "Internal error: new size > old size"; result = null; return false; } if (instr.Size < size) { num2 += size - instr.Size; flag = true; } } else if (instr.Size != size) { errorMessage = "Internal error: new size != old size"; result = null; return false; } } num += instr.Size; } } if (!flag) { break; } } array = blocks; for (int j = 0; j < array.Length; j++) { array[j].InitializeData(); } BlockEncoderResult[] array2 = new BlockEncoderResult[blocks.Length]; for (int l = 0; l < blocks.Length; l++) { Block block = blocks[l]; Encoder encoder = Encoder.Create(bitness, block.CodeWriter); ulong num3 = block.RIP; uint[] array3 = (ReturnNewInstructionOffsets ? new uint[block.Instructions.Length] : null); ConstantOffsets[] array4 = (ReturnConstantOffsets ? new ConstantOffsets[block.Instructions.Length] : null); Instr[] instructions2 = block.Instructions; for (int m = 0; m < instructions2.Length; m++) { Instr instr2 = instructions2[m]; uint bytesWritten = block.CodeWriter.BytesWritten; bool isOriginalInstruction; if (array4 != null) { errorMessage = instr2.TryEncode(encoder, out array4[m], out isOriginalInstruction); } else { errorMessage = instr2.TryEncode(encoder, out var _, out isOriginalInstruction); } if (errorMessage != null) { result = null; return false; } uint num4 = block.CodeWriter.BytesWritten - bytesWritten; if (num4 != instr2.Size) { errorMessage = "Internal error: didn't write all bytes"; result = null; return false; } if (array3 != null) { if (isOriginalInstruction) { array3[m] = (uint)(num3 - block.RIP); } else { array3[m] = uint.MaxValue; } } num3 += num4; } array2[l] = new BlockEncoderResult(block.RIP, block.relocInfos, array3, array4); block.WriteData(); } errorMessage = null; result = array2; return true; } internal TargetInstr GetTarget(ulong address) { if (toInstr.TryGetValue(address, out var value)) { return new TargetInstr(value); } return new TargetInstr(address); } internal uint GetInstructionSize(in Instruction instruction, ulong ip) { if (!nullEncoder.TryEncode(in instruction, ip, out uint encodedLength, out string _)) { return 15u; } return encodedLength; } } public sealed class ByteArrayCodeReader : CodeReader { private readonly byte[] data; private int currentPosition; private readonly int startPosition; private readonly int endPosition; public int Position { get { return currentPosition - startPosition; } set { if ((uint)value > (uint)Count) { ThrowHelper.ThrowArgumentOutOfRangeException_value(); } currentPosition = startPosition + value; } } public int Count => endPosition - startPosition; public bool CanReadByte => currentPosition < endPosition; public ByteArrayCodeReader(string hexData) : this(HexUtils.ToByteArray(hexData)) { } public ByteArrayCodeReader(byte[] data) { if (data == null) { ThrowHelper.ThrowArgumentNullException_data(); } this.data = data; currentPosition = 0; startPosition = 0; endPosition = data.Length; } public ByteArrayCodeReader(byte[] data, int index, int count) { if (data == null) { ThrowHelper.ThrowArgumentNullException_data(); } this.data = data; if (index < 0) { ThrowHelper.ThrowArgumentOutOfRangeException_index(); } if (count < 0) { ThrowHelper.ThrowArgumentOutOfRangeException_count(); } if ((uint)(index + count) > (uint)data.Length) { ThrowHelper.ThrowArgumentOutOfRangeException_count(); } currentPosition = index; startPosition = index; endPosition = index + count; } public ByteArrayCodeReader(ArraySegment<byte> data) { if (data.Array == null) { ThrowHelper.ThrowArgumentException(); } this.data = data.Array; endPosition = (startPosition = (currentPosition = data.Offset)) + data.Count; } public override int ReadByte() { if (currentPosition >= endPosition) { return -1; } return data[currentPosition++]; } } public enum Code { INVALID, DeclareByte, DeclareWord, DeclareDword, DeclareQword, Add_rm8_r8, Add_rm16_r16, Add_rm32_r32, Add_rm64_r64, Add_r8_rm8, Add_r16_rm16, Add_r32_rm32, Add_r64_rm64, Add_AL_imm8, Add_AX_imm16, Add_EAX_imm32, Add_RAX_imm32, Pushw_ES, Pushd_ES, Popw_ES, Popd_ES, Or_rm8_r8, Or_rm16_r16, Or_rm32_r32, Or_rm64_r64, Or_r8_rm8, Or_r16_rm16, Or_r32_rm32, Or_r64_rm64, Or_AL_imm8, Or_AX_imm16, Or_EAX_imm32, Or_RAX_imm32, Pushw_CS, Pushd_CS, Popw_CS, Adc_rm8_r8, Adc_rm16_r16, Adc_rm32_r32, Adc_rm64_r64, Adc_r8_rm8, Adc_r16_rm16, Adc_r32_rm32, Adc_r64_rm64, Adc_AL_imm8, Adc_AX_imm16, Adc_EAX_imm32, Adc_RAX_imm32, Pushw_SS, Pushd_SS, Popw_SS, Popd_SS, Sbb_rm8_r8, Sbb_rm16_r16, Sbb_rm32_r32, Sbb_rm64_r64, Sbb_r8_rm8, Sbb_r16_rm16, Sbb_r32_rm32, Sbb_r64_rm64, Sbb_AL_imm8, Sbb_AX_imm16, Sbb_EAX_imm32, Sbb_RAX_imm32, Pushw_DS, Pushd_DS, Popw_DS, Popd_DS, And_rm8_r8, And_rm16_r16, And_rm32_r32, And_rm64_r64, And_r8_rm8, And_r16_rm16, And_r32_rm32, And_r64_rm64, And_AL_imm8, And_AX_imm16, And_EAX_imm32, And_RAX_imm32, Daa, Sub_rm8_r8, Sub_rm16_r16, Sub_rm32_r32, Sub_rm64_r64, Sub_r8_rm8, Sub_r16_rm16, Sub_r32_rm32, Sub_r64_rm64, Sub_AL_imm8, Sub_AX_imm16, Sub_EAX_imm32, Sub_RAX_imm32, Das, Xor_rm8_r8, Xor_rm16_r16, Xor_rm32_r32, Xor_rm64_r64, Xor_r8_rm8, Xor_r16_rm16, Xor_r32_rm32, Xor_r64_rm64, Xor_AL_imm8, Xor_AX_imm16, Xor_EAX_imm32, Xor_RAX_imm32, Aaa, Cmp_rm8_r8, Cmp_rm16_r16, Cmp_rm32_r32, Cmp_rm64_r64, Cmp_r8_rm8, Cmp_r16_rm16, Cmp_r32_rm32, Cmp_r64_rm64, Cmp_AL_imm8, Cmp_AX_imm16, Cmp_EAX_imm32, Cmp_RAX_imm32, Aas, Inc_r16, Inc_r32, Dec_r16, Dec_r32, Push_r16, Push_r32, Push_r64, Pop_r16, Pop_r32, Pop_r64, Pushaw, Pushad, Popaw, Popad, Bound_r16_m1616, Bound_r32_m3232, Arpl_rm16_r16, Arpl_r32m16_r32, Movsxd_r16_rm16, Movsxd_r32_rm32, Movsxd_r64_rm32, Push_imm16, Pushd_imm32, Pushq_imm32, Imul_r16_rm16_imm16, Imul_r32_rm32_imm32, Imul_r64_rm64_imm32, Pushw_imm8, Pushd_imm8, Pushq_imm8, Imul_r16_rm16_imm8, Imul_r32_rm32_imm8, Imul_r64_rm64_imm8, Insb_m8_DX, Insw_m16_DX, Insd_m32_DX, Outsb_DX_m8, Outsw_DX_m16, Outsd_DX_m32, Jo_rel8_16, Jo_rel8_32, Jo_rel8_64, Jno_rel8_16, Jno_rel8_32, Jno_rel8_64, Jb_rel8_16, Jb_rel8_32, Jb_rel8_64, Jae_rel8_16, Jae_rel8_32, Jae_rel8_64, Je_rel8_16, Je_rel8_32, Je_rel8_64, Jne_rel8_16, Jne_rel8_32, Jne_rel8_64, Jbe_rel8_16, Jbe_rel8_32, Jbe_rel8_64, Ja_rel8_16, Ja_rel8_32, Ja_rel8_64, Js_rel8_16, Js_rel8_32, Js_rel8_64, Jns_rel8_16, Jns_rel8_32, Jns_rel8_64, Jp_rel8_16, Jp_rel8_32, Jp_rel8_64, Jnp_rel8_16, Jnp_rel8_32, Jnp_rel8_64, Jl_rel8_16, Jl_rel8_32, Jl_rel8_64, Jge_rel8_16, Jge_rel8_32, Jge_rel8_64, Jle_rel8_16, Jle_rel8_32, Jle_rel8_64, Jg_rel8_16, Jg_rel8_32, Jg_rel8_64, Add_rm8_imm8, Or_rm8_imm8, Adc_rm8_imm8, Sbb_rm8_imm8, And_rm8_imm8, Sub_rm8_imm8, Xor_rm8_imm8, Cmp_rm8_imm8, Add_rm16_imm16, Add_rm32_imm32, Add_rm64_imm32, Or_rm16_imm16, Or_rm32_imm32, Or_rm64_imm32, Adc_rm16_imm16, Adc_rm32_imm32, Adc_rm64_imm32, Sbb_rm16_imm16, Sbb_rm32_imm32, Sbb_rm64_imm32, And_rm16_imm16, And_rm32_imm32, And_rm64_imm32, Sub_rm16_imm16, Sub_rm32_imm32, Sub_rm64_imm32, Xor_rm16_imm16, Xor_rm32_imm32, Xor_rm64_imm32, Cmp_rm16_imm16, Cmp_rm32_imm32, Cmp_rm64_imm32, Add_rm8_imm8_82, Or_rm8_imm8_82, Adc_rm8_imm8_82, Sbb_rm8_imm8_82, And_rm8_imm8_82, Sub_rm8_imm8_82, Xor_rm8_imm8_82, Cmp_rm8_imm8_82, Add_rm16_imm8, Add_rm32_imm8, Add_rm64_imm8, Or_rm16_imm8, Or_rm32_imm8, Or_rm64_imm8, Adc_rm16_imm8, Adc_rm32_imm8, Adc_rm64_imm8, Sbb_rm16_imm8, Sbb_rm32_imm8, Sbb_rm64_imm8, And_rm16_imm8, And_rm32_imm8, And_rm64_imm8, Sub_rm16_imm8, Sub_rm32_imm8, Sub_rm64_imm8, Xor_rm16_imm8, Xor_rm32_imm8, Xor_rm64_imm8, Cmp_rm16_imm8, Cmp_rm32_imm8, Cmp_rm64_imm8, Test_rm8_r8, Test_rm16_r16, Test_rm32_r32, Test_rm64_r64, Xchg_rm8_r8, Xchg_rm16_r16, Xchg_rm32_r32, Xchg_rm64_r64, Mov_rm8_r8, Mov_rm16_r16, Mov_rm32_r32, Mov_rm64_r64, Mov_r8_rm8, Mov_r16_rm16, Mov_r32_rm32, Mov_r64_rm64, Mov_rm16_Sreg, Mov_r32m16_Sreg, Mov_r64m16_Sreg, Lea_r16_m, Lea_r32_m, Lea_r64_m, Mov_Sreg_rm16, Mov_Sreg_r32m16, Mov_Sreg_r64m16, Pop_rm16, Pop_rm32, Pop_rm64, Nopw, Nopd, Nopq, Xchg_r16_AX, Xchg_r32_EAX, Xchg_r64_RAX, Pause, Cbw, Cwde, Cdqe, Cwd, Cdq, Cqo, Call_ptr1616, Call_ptr1632, Wait, Pushfw, Pushfd, Pushfq, Popfw, Popfd, Popfq, Sahf, Lahf, Mov_AL_moffs8, Mov_AX_moffs16, Mov_EAX_moffs32, Mov_RAX_moffs64, Mov_moffs8_AL, Mov_moffs16_AX, Mov_moffs32_EAX, Mov_moffs64_RAX, Movsb_m8_m8, Movsw_m16_m16, Movsd_m32_m32, Movsq_m64_m64, Cmpsb_m8_m8, Cmpsw_m16_m16, Cmpsd_m32_m32, Cmpsq_m64_m64, Test_AL_imm8, Test_AX_imm16, Test_EAX_imm32, Test_RAX_imm32, Stosb_m8_AL, Stosw_m16_AX, Stosd_m32_EAX, Stosq_m64_RAX, Lodsb_AL_m8, Lodsw_AX_m16, Lodsd_EAX_m32, Lodsq_RAX_m64, Scasb_AL_m8, Scasw_AX_m16, Scasd_EAX_m32, Scasq_RAX_m64, Mov_r8_imm8, Mov_r16_imm16, Mov_r32_imm32, Mov_r64_imm64, Rol_rm8_imm8, Ror_rm8_imm8, Rcl_rm8_imm8, Rcr_rm8_imm8, Shl_rm8_imm8, Shr_rm8_imm8, Sal_rm8_imm8, Sar_rm8_imm8, Rol_rm16_imm8, Rol_rm32_imm8, Rol_rm64_imm8, Ror_rm16_imm8, Ror_rm32_imm8, Ror_rm64_imm8, Rcl_rm16_imm8, Rcl_rm32_imm8, Rcl_rm64_imm8, Rcr_rm16_imm8, Rcr_rm32_imm8, Rcr_rm64_imm8, Shl_rm16_imm8, Shl_rm32_imm8, Shl_rm64_imm8, Shr_rm16_imm8, Shr_rm32_imm8, Shr_rm64_imm8, Sal_rm16_imm8, Sal_rm32_imm8, Sal_rm64_imm8, Sar_rm16_imm8, Sar_rm32_imm8, Sar_rm64_imm8, Retnw_imm16, Retnd_imm16, Retnq_imm16, Retnw, Retnd, Retnq, Les_r16_m1616, Les_r32_m1632, Lds_r16_m1616, Lds_r32_m1632, Mov_rm8_imm8, Xabort_imm8, Mov_rm16_imm16, Mov_rm32_imm32, Mov_rm64_imm32, Xbegin_rel16, Xbegin_rel32, Enterw_imm16_imm8, Enterd_imm16_imm8, Enterq_imm16_imm8, Leavew, Leaved, Leaveq, Retfw_imm16, Retfd_imm16, Retfq_imm16, Retfw, Retfd, Retfq, Int3, Int_imm8, Into, Iretw, Iretd, Iretq, Rol_rm8_1, Ror_rm8_1, Rcl_rm8_1, Rcr_rm8_1, Shl_rm8_1, Shr_rm8_1, Sal_rm8_1, Sar_rm8_1, Rol_rm16_1, Rol_rm32_1, Rol_rm64_1, Ror_rm16_1, Ror_rm32_1, Ror_rm64_1, Rcl_rm16_1, Rcl_rm32_1, Rcl_rm64_1, Rcr_rm16_1, Rcr_rm32_1, Rcr_rm64_1, Shl_rm16_1, Shl_rm32_1, Shl_rm64_1, Shr_rm16_1, Shr_rm32_1, Shr_rm64_1, Sal_rm16_1, Sal_rm32_1, Sal_rm64_1, Sar_rm16_1, Sar_rm32_1, Sar_rm64_1, Rol_rm8_CL, Ror_rm8_CL, Rcl_rm8_CL, Rcr_rm8_CL, Shl_rm8_CL, Shr_rm8_CL, Sal_rm8_CL, Sar_rm8_CL, Rol_rm16_CL, Rol_rm32_CL, Rol_rm64_CL, Ror_rm16_CL, Ror_rm32_CL, Ror_rm64_CL, Rcl_rm16_CL, Rcl_rm32_CL, Rcl_rm64_CL, Rcr_rm16_CL, Rcr_rm32_CL, Rcr_rm64_CL, Shl_rm16_CL, Shl_rm32_CL, Shl_rm64_CL, Shr_rm16_CL, Shr_rm32_CL, Shr_rm64_CL, Sal_rm16_CL, Sal_rm32_CL, Sal_rm64_CL, Sar_rm16_CL, Sar_rm32_CL, Sar_rm64_CL, Aam_imm8, Aad_imm8, Salc, Xlat_m8, Fadd_m32fp, Fmul_m32fp, Fcom_m32fp, Fcomp_m32fp, Fsub_m32fp, Fsubr_m32fp, Fdiv_m32fp, Fdivr_m32fp, Fadd_st0_sti, Fmul_st0_sti, Fcom_st0_sti, Fcomp_st0_sti, Fsub_st0_sti, Fsubr_st0_sti, Fdiv_st0_sti, Fdivr_st0_sti, Fld_m32fp, Fst_m32fp, Fstp_m32fp, Fldenv_m14byte, Fldenv_m28byte, Fldcw_m2byte, Fnstenv_m14byte, Fstenv_m14byte, Fnstenv_m28byte, Fstenv_m28byte, Fnstcw_m2byte, Fstcw_m2byte, Fld_sti, Fxch_st0_sti, Fnop, Fstpnce_sti, Fchs, Fabs, Ftst, Fxam, Fld1, Fldl2t, Fldl2e, Fldpi, Fldlg2, Fldln2, Fldz, F2xm1, Fyl2x, Fptan, Fpatan, Fxtract, Fprem1, Fdecstp, Fincstp, Fprem, Fyl2xp1, Fsqrt, Fsincos, Frndint, Fscale, Fsin, Fcos, Fiadd_m32int, Fimul_m32int, Ficom_m32int, Ficomp_m32int, Fisub_m32int, Fisubr_m32int, Fidiv_m32int, Fidivr_m32int, Fcmovb_st0_sti, Fcmove_st0_sti, Fcmovbe_st0_sti, Fcmovu_st0_sti, Fucompp, Fild_m32int, Fisttp_m32int, Fist_m32int, Fistp_m32int, Fld_m80fp, Fstp_m80fp, Fcmovnb_st0_sti, Fcmovne_st0_sti, Fcmovnbe_st0_sti, Fcmovnu_st0_sti, Fneni, Feni, Fndisi, Fdisi, Fnclex, Fclex, Fninit, Finit, Fnsetpm, Fsetpm, Frstpm, Fucomi_st0_sti, Fcomi_st0_sti, Fadd_m64fp, Fmul_m64fp, Fcom_m64fp, Fcomp_m64fp, Fsub_m64fp, Fsubr_m64fp, Fdiv_m64fp, Fdivr_m64fp, Fadd_sti_st0, Fmul_sti_st0, Fcom_st0_sti_DCD0, Fcomp_st0_sti_DCD8, Fsubr_sti_st0, Fsub_sti_st0, Fdivr_sti_st0, Fdiv_sti_st0, Fld_m64fp, Fisttp_m64int, Fst_m64fp, Fstp_m64fp, Frstor_m94byte, Frstor_m108byte, Fnsave_m94byte, Fsave_m94byte, Fnsave_m108byte, Fsave_m108byte, Fnstsw_m2byte, Fstsw_m2byte, Ffree_sti, Fxch_st0_sti_DDC8, Fst_sti, Fstp_sti, Fucom_st0_sti, Fucomp_st0_sti, Fiadd_m16int, Fimul_m16int, Ficom_m16int, Ficomp_m16int, Fisub_m16int, Fisubr_m16int, Fidiv_m16int, Fidivr_m16int, Faddp_sti_st0, Fmulp_sti_st0, Fcomp_st0_sti_DED0, Fcompp, Fsubrp_sti_st0, Fsubp_sti_st0, Fdivrp_sti_st0, Fdivp_sti_st0, Fild_m16int, Fisttp_m16int, Fist_m16int, Fistp_m16int, Fbld_m80bcd, Fild_m64int, Fbstp_m80bcd, Fistp_m64int, Ffreep_sti, Fxch_st0_sti_DFC8, Fstp_sti_DFD0, Fstp_sti_DFD8, Fnstsw_AX, Fstsw_AX, Fstdw_AX, Fstsg_AX, Fucomip_st0_sti, Fcomip_st0_sti, Loopne_rel8_16_CX, Loopne_rel8_32_CX, Loopne_rel8_16_ECX, Loopne_rel8_32_ECX, Loopne_rel8_64_ECX, Loopne_rel8_16_RCX, Loopne_rel8_64_RCX, Loope_rel8_16_CX, Loope_rel8_32_CX, Loope_rel8_16_ECX, Loope_rel8_32_ECX, Loope_rel8_64_ECX, Loope_rel8_16_RCX, Loope_rel8_64_RCX, Loop_rel8_16_CX, Loop_rel8_32_CX, Loop_rel8_16_ECX, Loop_rel8_32_ECX, Loop_rel8_64_ECX, Loop_rel8_16_RCX, Loop_rel8_64_RCX, Jcxz_rel8_16, Jcxz_rel8_32, Jecxz_rel8_16, Jecxz_rel8_32, Jecxz_rel8_64, Jrcxz_rel8_16, Jrcxz_rel8_64, In_AL_imm8, In_AX_imm8, In_EAX_imm8, Out_imm8_AL, Out_imm8_AX, Out_imm8_EAX, Call_rel16, Call_rel32_32, Call_rel32_64, Jmp_rel16, Jmp_rel32_32, Jmp_rel32_64, Jmp_ptr1616, Jmp_ptr1632, Jmp_rel8_16, Jmp_rel8_32, Jmp_rel8_64, In_AL_DX, In_AX_DX, In_EAX_DX, Out_DX_AL, Out_DX_AX, Out_DX_EAX, Int1, Hlt, Cmc, Test_rm8_imm8, Test_rm8_imm8_F6r1, Not_rm8, Neg_rm8, Mul_rm8, Imul_rm8, Div_rm8, Idiv_rm8, Test_rm16_imm16, Test_rm32_imm32, Test_rm64_imm32, Test_rm16_imm16_F7r1, Test_rm32_imm32_F7r1, Test_rm64_imm32_F7r1, Not_rm16, Not_rm32, Not_rm64, Neg_rm16, Neg_rm32, Neg_rm64, Mul_rm16, Mul_rm32, Mul_rm64, Imul_rm16, Imul_rm32, Imul_rm64, Div_rm16, Div_rm32, Div_rm64, Idiv_rm16, Idiv_rm32, Idiv_rm64, Clc, Stc, Cli, Sti, Cld, Std, Inc_rm8, Dec_rm8, Inc_rm16, Inc_rm32, Inc_rm64, Dec_rm16, Dec_rm32, Dec_rm64, Call_rm16, Call_rm32, Call_rm64, Call_m1616, Call_m1632, Call_m1664, Jmp_rm16, Jmp_rm32, Jmp_rm64, Jmp_m1616, Jmp_m1632, Jmp_m1664, Push_rm16, Push_rm32, Push_rm64, Sldt_rm16, Sldt_r32m16, Sldt_r64m16, Str_rm16, Str_r32m16, Str_r64m16, Lldt_rm16, Lldt_r32m16, Lldt_r64m16, Ltr_rm16, Ltr_r32m16, Ltr_r64m16, Verr_rm16, Verr_r32m16, Verr_r64m16, Verw_rm16, Verw_r32m16, Verw_r64m16, Jmpe_rm16, Jmpe_rm32, Sgdt_m1632_16, Sgdt_m1632, Sgdt_m1664, Sidt_m1632_16, Sidt_m1632, Sidt_m1664, Lgdt_m1632_16, Lgdt_m1632, Lgdt_m1664, Lidt_m1632_16, Lidt_m1632, Lidt_m1664, Smsw_rm16, Smsw_r32m16, Smsw_r64m16, Rstorssp_m64, Lmsw_rm16, Lmsw_r32m16, Lmsw_r64m16, Invlpg_m, Enclv, Vmcall, Vmlaunch, Vmresume, Vmxoff, Pconfig, Monitorw, Monitord, Monitorq, Mwait, Clac, Stac, Encls, Xgetbv, Xsetbv, Vmfunc, Xend, Xtest, Enclu, Vmrunw, Vmrund, Vmrunq, Vmmcall, Vmloadw, Vmloadd, Vmloadq, Vmsavew, Vmsaved, Vmsaveq, Stgi, Clgi, Skinit, Invlpgaw, Invlpgad, Invlpgaq, Setssbsy, Saveprevssp, Rdpkru, Wrpkru, Swapgs, Rdtscp, Monitorxw, Monitorxd, Monitorxq, Mcommit, Mwaitx, Clzerow, Clzerod, Clzeroq, Rdpru, Lar_r16_rm16, Lar_r32_r32m16, Lar_r64_r64m16, Lsl_r16_rm16, Lsl_r32_r32m16, Lsl_r64_r64m16, Storeall, Loadall286, Syscall, Clts, Loadall386, Sysretd, Sysretq, Invd, Wbinvd, Wbnoinvd, Cl1invmb, Ud2, Reservednop_rm16_r16_0F0D, Reservednop_rm32_r32_0F0D, Reservednop_rm64_r64_0F0D, Prefetch_m8, Prefetchw_m8, Prefetchwt1_m8, Femms, Umov_rm8_r8, Umov_rm16_r16, Umov_rm32_r32, Umov_r8_rm8, Umov_r16_rm16, Umov_r32_rm32, Movups_xmm_xmmm128, VEX_Vmovups_xmm_xmmm128, VEX_Vmovups_ymm_ymmm256, EVEX_Vmovups_xmm_k1z_xmmm128, EVEX_Vmovups_ymm_k1z_ymmm256, EVEX_Vmovups_zmm_k1z_zmmm512, Movupd_xmm_xmmm128, VEX_Vmovupd_xmm_xmmm128, VEX_Vmovupd_ymm_ymmm256, EVEX_Vmovupd_xmm_k1z_xmmm128, EVEX_Vmovupd_ymm_k1z_ymmm256, EVEX_Vmovupd_zmm_k1z_zmmm512, Movss_xmm_xmmm32, VEX_Vmovss_xmm_xmm_xmm, VEX_Vmovss_xmm_m32, EVEX_Vmovss_xmm_k1z_xmm_xmm, EVEX_Vmovss_xmm_k1z_m32, Movsd_xmm_xmmm64, VEX_Vmovsd_xmm_xmm_xmm, VEX_Vmovsd_xmm_m64, EVEX_Vmovsd_xmm_k1z_xmm_xmm, EVEX_Vmovsd_xmm_k1z_m64, Movups_xmmm128_xmm, VEX_Vmovups_xmmm128_xmm, VEX_Vmovups_ymmm256_ymm, EVEX_Vmovups_xmmm128_k1z_xmm, EVEX_Vmovups_ymmm256_k1z_ymm, EVEX_Vmovups_zmmm512_k1z_zmm, Movupd_xmmm128_xmm, VEX_Vmovupd_xmmm128_xmm, VEX_Vmovupd_ymmm256_ymm, EVEX_Vmovupd_xmmm128_k1z_xmm, EVEX_Vmovupd_ymmm256_k1z_ymm, EVEX_Vmovupd_zmmm512_k1z_zmm, Movss_xmmm32_xmm, VEX_Vmovss_xmm_xmm_xmm_0F11, VEX_Vmovss_m32_xmm, EVEX_Vmovss_xmm_k1z_xmm_xmm_0F11, EVEX_Vmovss_m32_k1_xmm, Movsd_xmmm64_xmm, VEX_Vmovsd_xmm_xmm_xmm_0F11, VEX_Vmovsd_m64_xmm, EVEX_Vmovsd_xmm_k1z_xmm_xmm_0F11, EVEX_Vmovsd_m64_k1_xmm, Movhlps_xmm_xmm, Movlps_xmm_m64, VEX_Vmovhlps_xmm_xmm_xmm, VEX_Vmovlps_xmm_xmm_m64, EVEX_Vmovhlps_xmm_xmm_xmm, EVEX_Vmovlps_xmm_xmm_m64, Movlpd_xmm_m64, VEX_Vmovlpd_xmm_xmm_m64, EVEX_Vmovlpd_xmm_xmm_m64, Movsldup_xmm_xmmm128, VEX_Vmovsldup_xmm_xmmm128, VEX_Vmovsldup_ymm_ymmm256, EVEX_Vmovsldup_xmm_k1z_xmmm128, EVEX_Vmovsldup_ymm_k1z_ymmm256, EVEX_Vmovsldup_zmm_k1z_zmmm512, Movddup_xmm_xmmm64, VEX_Vmovddup_xmm_xmmm64, VEX_Vmovddup_ymm_ymmm256, EVEX_Vmovddup_xmm_k1z_xmmm64, EVEX_Vmovddup_ymm_k1z_ymmm256, EVEX_Vmovddup_zmm_k1z_zmmm512, Movlps_m64_xmm, VEX_Vmovlps_m64_xmm, EVEX_Vmovlps_m64_xmm, Movlpd_m64_xmm, VEX_Vmovlpd_m64_xmm, EVEX_Vmovlpd_m64_xmm, Unpcklps_xmm_xmmm128, VEX_Vunpcklps_xmm_xmm_xmmm128, VEX_Vunpcklps_ymm_ymm_ymmm256, EVEX_Vunpcklps_xmm_k1z_xmm_xmmm128b32, EVEX_Vunpcklps_ymm_k1z_ymm_ymmm256b32, EVEX_Vunpcklps_zmm_k1z_zmm_zmmm512b32, Unpcklpd_xmm_xmmm128, VEX_Vunpcklpd_xmm_xmm_xmmm128, VEX_Vunpcklpd_ymm_ymm_ymmm256, EVEX_Vunpcklpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vunpcklpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vunpcklpd_zmm_k1z_zmm_zmmm512b64, Unpckhps_xmm_xmmm128, VEX_Vunpckhps_xmm_xmm_xmmm128, VEX_Vunpckhps_ymm_ymm_ymmm256, EVEX_Vunpckhps_xmm_k1z_xmm_xmmm128b32, EVEX_Vunpckhps_ymm_k1z_ymm_ymmm256b32, EVEX_Vunpckhps_zmm_k1z_zmm_zmmm512b32, Unpckhpd_xmm_xmmm128, VEX_Vunpckhpd_xmm_xmm_xmmm128, VEX_Vunpckhpd_ymm_ymm_ymmm256, EVEX_Vunpckhpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vunpckhpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vunpckhpd_zmm_k1z_zmm_zmmm512b64, Movlhps_xmm_xmm, VEX_Vmovlhps_xmm_xmm_xmm, EVEX_Vmovlhps_xmm_xmm_xmm, Movhps_xmm_m64, VEX_Vmovhps_xmm_xmm_m64, EVEX_Vmovhps_xmm_xmm_m64, Movhpd_xmm_m64, VEX_Vmovhpd_xmm_xmm_m64, EVEX_Vmovhpd_xmm_xmm_m64, Movshdup_xmm_xmmm128, VEX_Vmovshdup_xmm_xmmm128, VEX_Vmovshdup_ymm_ymmm256, EVEX_Vmovshdup_xmm_k1z_xmmm128, EVEX_Vmovshdup_ymm_k1z_ymmm256, EVEX_Vmovshdup_zmm_k1z_zmmm512, Movhps_m64_xmm, VEX_Vmovhps_m64_xmm, EVEX_Vmovhps_m64_xmm, Movhpd_m64_xmm, VEX_Vmovhpd_m64_xmm, EVEX_Vmovhpd_m64_xmm, Reservednop_rm16_r16_0F18, Reservednop_rm32_r32_0F18, Reservednop_rm64_r64_0F18, Reservednop_rm16_r16_0F19, Reservednop_rm32_r32_0F19, Reservednop_rm64_r64_0F19, Reservednop_rm16_r16_0F1A, Reservednop_rm32_r32_0F1A, Reservednop_rm64_r64_0F1A, Reservednop_rm16_r16_0F1B, Reservednop_rm32_r32_0F1B, Reservednop_rm64_r64_0F1B, Reservednop_rm16_r16_0F1C, Reservednop_rm32_r32_0F1C, Reservednop_rm64_r64_0F1C, Reservednop_rm16_r16_0F1D, Reservednop_rm32_r32_0F1D, Reservednop_rm64_r64_0F1D, Reservednop_rm16_r16_0F1E, Reservednop_rm32_r32_0F1E, Reservednop_rm64_r64_0F1E, Reservednop_rm16_r16_0F1F, Reservednop_rm32_r32_0F1F, Reservednop_rm64_r64_0F1F, Prefetchnta_m8, Prefetcht0_m8, Prefetcht1_m8, Prefetcht2_m8, Bndldx_bnd_mib, Bndmov_bnd_bndm64, Bndmov_bnd_bndm128, Bndcl_bnd_rm32, Bndcl_bnd_rm64, Bndcu_bnd_rm32, Bndcu_bnd_rm64, Bndstx_mib_bnd, Bndmov_bndm64_bnd, Bndmov_bndm128_bnd, Bndmk_bnd_m32, Bndmk_bnd_m64, Bndcn_bnd_rm32, Bndcn_bnd_rm64, Cldemote_m8, Rdsspd_r32, Rdsspq_r64, Endbr64, Endbr32, Nop_rm16, Nop_rm32, Nop_rm64, Mov_r32_cr, Mov_r64_cr, Mov_r32_dr, Mov_r64_dr, Mov_cr_r32, Mov_cr_r64, Mov_dr_r32, Mov_dr_r64, Mov_r32_tr, Mov_tr_r32, Movaps_xmm_xmmm128, VEX_Vmovaps_xmm_xmmm128, VEX_Vmovaps_ymm_ymmm256, EVEX_Vmovaps_xmm_k1z_xmmm128, EVEX_Vmovaps_ymm_k1z_ymmm256, EVEX_Vmovaps_zmm_k1z_zmmm512, Movapd_xmm_xmmm128, VEX_Vmovapd_xmm_xmmm128, VEX_Vmovapd_ymm_ymmm256, EVEX_Vmovapd_xmm_k1z_xmmm128, EVEX_Vmovapd_ymm_k1z_ymmm256, EVEX_Vmovapd_zmm_k1z_zmmm512, Movaps_xmmm128_xmm, VEX_Vmovaps_xmmm128_xmm, VEX_Vmovaps_ymmm256_ymm, EVEX_Vmovaps_xmmm128_k1z_xmm, EVEX_Vmovaps_ymmm256_k1z_ymm, EVEX_Vmovaps_zmmm512_k1z_zmm, Movapd_xmmm128_xmm, VEX_Vmovapd_xmmm128_xmm, VEX_Vmovapd_ymmm256_ymm, EVEX_Vmovapd_xmmm128_k1z_xmm, EVEX_Vmovapd_ymmm256_k1z_ymm, EVEX_Vmovapd_zmmm512_k1z_zmm, Cvtpi2ps_xmm_mmm64, Cvtpi2pd_xmm_mmm64, Cvtsi2ss_xmm_rm32, Cvtsi2ss_xmm_rm64, VEX_Vcvtsi2ss_xmm_xmm_rm32, VEX_Vcvtsi2ss_xmm_xmm_rm64, EVEX_Vcvtsi2ss_xmm_xmm_rm32_er, EVEX_Vcvtsi2ss_xmm_xmm_rm64_er, Cvtsi2sd_xmm_rm32, Cvtsi2sd_xmm_rm64, VEX_Vcvtsi2sd_xmm_xmm_rm32, VEX_Vcvtsi2sd_xmm_xmm_rm64, EVEX_Vcvtsi2sd_xmm_xmm_rm32_er, EVEX_Vcvtsi2sd_xmm_xmm_rm64_er, Movntps_m128_xmm, VEX_Vmovntps_m128_xmm, VEX_Vmovntps_m256_ymm, EVEX_Vmovntps_m128_xmm, EVEX_Vmovntps_m256_ymm, EVEX_Vmovntps_m512_zmm, Movntpd_m128_xmm, VEX_Vmovntpd_m128_xmm, VEX_Vmovntpd_m256_ymm, EVEX_Vmovntpd_m128_xmm, EVEX_Vmovntpd_m256_ymm, EVEX_Vmovntpd_m512_zmm, Movntss_m32_xmm, Movntsd_m64_xmm, Cvttps2pi_mm_xmmm64, Cvttpd2pi_mm_xmmm128, Cvttss2si_r32_xmmm32, Cvttss2si_r64_xmmm32, VEX_Vcvttss2si_r32_xmmm32, VEX_Vcvttss2si_r64_xmmm32, EVEX_Vcvttss2si_r32_xmmm32_sae, EVEX_Vcvttss2si_r64_xmmm32_sae, Cvttsd2si_r32_xmmm64, Cvttsd2si_r64_xmmm64, VEX_Vcvttsd2si_r32_xmmm64, VEX_Vcvttsd2si_r64_xmmm64, EVEX_Vcvttsd2si_r32_xmmm64_sae, EVEX_Vcvttsd2si_r64_xmmm64_sae, Cvtps2pi_mm_xmmm64, Cvtpd2pi_mm_xmmm128, Cvtss2si_r32_xmmm32, Cvtss2si_r64_xmmm32, VEX_Vcvtss2si_r32_xmmm32, VEX_Vcvtss2si_r64_xmmm32, EVEX_Vcvtss2si_r32_xmmm32_er, EVEX_Vcvtss2si_r64_xmmm32_er, Cvtsd2si_r32_xmmm64, Cvtsd2si_r64_xmmm64, VEX_Vcvtsd2si_r32_xmmm64, VEX_Vcvtsd2si_r64_xmmm64, EVEX_Vcvtsd2si_r32_xmmm64_er, EVEX_Vcvtsd2si_r64_xmmm64_er, Ucomiss_xmm_xmmm32, VEX_Vucomiss_xmm_xmmm32, EVEX_Vucomiss_xmm_xmmm32_sae, Ucomisd_xmm_xmmm64, VEX_Vucomisd_xmm_xmmm64, EVEX_Vucomisd_xmm_xmmm64_sae, Comiss_xmm_xmmm32, Comisd_xmm_xmmm64, VEX_Vcomiss_xmm_xmmm32, VEX_Vcomisd_xmm_xmmm64, EVEX_Vcomiss_xmm_xmmm32_sae, EVEX_Vcomisd_xmm_xmmm64_sae, Wrmsr, Rdtsc, Rdmsr, Rdpmc, Sysenter, Sysexitd, Sysexitq, Getsecd, Cmovo_r16_rm16, Cmovo_r32_rm32, Cmovo_r64_rm64, Cmovno_r16_rm16, Cmovno_r32_rm32, Cmovno_r64_rm64, Cmovb_r16_rm16, Cmovb_r32_rm32, Cmovb_r64_rm64, Cmovae_r16_rm16, Cmovae_r32_rm32, Cmovae_r64_rm64, Cmove_r16_rm16, Cmove_r32_rm32, Cmove_r64_rm64, Cmovne_r16_rm16, Cmovne_r32_rm32, Cmovne_r64_rm64, Cmovbe_r16_rm16, Cmovbe_r32_rm32, Cmovbe_r64_rm64, Cmova_r16_rm16, Cmova_r32_rm32, Cmova_r64_rm64, Cmovs_r16_rm16, Cmovs_r32_rm32, Cmovs_r64_rm64, Cmovns_r16_rm16, Cmovns_r32_rm32, Cmovns_r64_rm64, Cmovp_r16_rm16, Cmovp_r32_rm32, Cmovp_r64_rm64, Cmovnp_r16_rm16, Cmovnp_r32_rm32, Cmovnp_r64_rm64, Cmovl_r16_rm16, Cmovl_r32_rm32, Cmovl_r64_rm64, Cmovge_r16_rm16, Cmovge_r32_rm32, Cmovge_r64_rm64, Cmovle_r16_rm16, Cmovle_r32_rm32, Cmovle_r64_rm64, Cmovg_r16_rm16, Cmovg_r32_rm32, Cmovg_r64_rm64, VEX_Kandw_kr_kr_kr, VEX_Kandq_kr_kr_kr, VEX_Kandb_kr_kr_kr, VEX_Kandd_kr_kr_kr, VEX_Kandnw_kr_kr_kr, VEX_Kandnq_kr_kr_kr, VEX_Kandnb_kr_kr_kr, VEX_Kandnd_kr_kr_kr, VEX_Knotw_kr_kr, VEX_Knotq_kr_kr, VEX_Knotb_kr_kr, VEX_Knotd_kr_kr, VEX_Korw_kr_kr_kr, VEX_Korq_kr_kr_kr, VEX_Korb_kr_kr_kr, VEX_Kord_kr_kr_kr, VEX_Kxnorw_kr_kr_kr, VEX_Kxnorq_kr_kr_kr, VEX_Kxnorb_kr_kr_kr, VEX_Kxnord_kr_kr_kr, VEX_Kxorw_kr_kr_kr, VEX_Kxorq_kr_kr_kr, VEX_Kxorb_kr_kr_kr, VEX_Kxord_kr_kr_kr, VEX_Kaddw_kr_kr_kr, VEX_Kaddq_kr_kr_kr, VEX_Kaddb_kr_kr_kr, VEX_Kaddd_kr_kr_kr, VEX_Kunpckwd_kr_kr_kr, VEX_Kunpckdq_kr_kr_kr, VEX_Kunpckbw_kr_kr_kr, Movmskps_r32_xmm, Movmskps_r64_xmm, VEX_Vmovmskps_r32_xmm, VEX_Vmovmskps_r64_xmm, VEX_Vmovmskps_r32_ymm, VEX_Vmovmskps_r64_ymm, Movmskpd_r32_xmm, Movmskpd_r64_xmm, VEX_Vmovmskpd_r32_xmm, VEX_Vmovmskpd_r64_xmm, VEX_Vmovmskpd_r32_ymm, VEX_Vmovmskpd_r64_ymm, Sqrtps_xmm_xmmm128, VEX_Vsqrtps_xmm_xmmm128, VEX_Vsqrtps_ymm_ymmm256, EVEX_Vsqrtps_xmm_k1z_xmmm128b32, EVEX_Vsqrtps_ymm_k1z_ymmm256b32, EVEX_Vsqrtps_zmm_k1z_zmmm512b32_er, Sqrtpd_xmm_xmmm128, VEX_Vsqrtpd_xmm_xmmm128, VEX_Vsqrtpd_ymm_ymmm256, EVEX_Vsqrtpd_xmm_k1z_xmmm128b64, EVEX_Vsqrtpd_ymm_k1z_ymmm256b64, EVEX_Vsqrtpd_zmm_k1z_zmmm512b64_er, Sqrtss_xmm_xmmm32, VEX_Vsqrtss_xmm_xmm_xmmm32, EVEX_Vsqrtss_xmm_k1z_xmm_xmmm32_er, Sqrtsd_xmm_xmmm64, VEX_Vsqrtsd_xmm_xmm_xmmm64, EVEX_Vsqrtsd_xmm_k1z_xmm_xmmm64_er, Rsqrtps_xmm_xmmm128, VEX_Vrsqrtps_xmm_xmmm128, VEX_Vrsqrtps_ymm_ymmm256, Rsqrtss_xmm_xmmm32, VEX_Vrsqrtss_xmm_xmm_xmmm32, Rcpps_xmm_xmmm128, VEX_Vrcpps_xmm_xmmm128, VEX_Vrcpps_ymm_ymmm256, Rcpss_xmm_xmmm32, VEX_Vrcpss_xmm_xmm_xmmm32, Andps_xmm_xmmm128, VEX_Vandps_xmm_xmm_xmmm128, VEX_Vandps_ymm_ymm_ymmm256, EVEX_Vandps_xmm_k1z_xmm_xmmm128b32, EVEX_Vandps_ymm_k1z_ymm_ymmm256b32, EVEX_Vandps_zmm_k1z_zmm_zmmm512b32, Andpd_xmm_xmmm128, VEX_Vandpd_xmm_xmm_xmmm128, VEX_Vandpd_ymm_ymm_ymmm256, EVEX_Vandpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vandpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vandpd_zmm_k1z_zmm_zmmm512b64, Andnps_xmm_xmmm128, VEX_Vandnps_xmm_xmm_xmmm128, VEX_Vandnps_ymm_ymm_ymmm256, EVEX_Vandnps_xmm_k1z_xmm_xmmm128b32, EVEX_Vandnps_ymm_k1z_ymm_ymmm256b32, EVEX_Vandnps_zmm_k1z_zmm_zmmm512b32, Andnpd_xmm_xmmm128, VEX_Vandnpd_xmm_xmm_xmmm128, VEX_Vandnpd_ymm_ymm_ymmm256, EVEX_Vandnpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vandnpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vandnpd_zmm_k1z_zmm_zmmm512b64, Orps_xmm_xmmm128, VEX_Vorps_xmm_xmm_xmmm128, VEX_Vorps_ymm_ymm_ymmm256, EVEX_Vorps_xmm_k1z_xmm_xmmm128b32, EVEX_Vorps_ymm_k1z_ymm_ymmm256b32, EVEX_Vorps_zmm_k1z_zmm_zmmm512b32, Orpd_xmm_xmmm128, VEX_Vorpd_xmm_xmm_xmmm128, VEX_Vorpd_ymm_ymm_ymmm256, EVEX_Vorpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vorpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vorpd_zmm_k1z_zmm_zmmm512b64, Xorps_xmm_xmmm128, VEX_Vxorps_xmm_xmm_xmmm128, VEX_Vxorps_ymm_ymm_ymmm256, EVEX_Vxorps_xmm_k1z_xmm_xmmm128b32, EVEX_Vxorps_ymm_k1z_ymm_ymmm256b32, EVEX_Vxorps_zmm_k1z_zmm_zmmm512b32, Xorpd_xmm_xmmm128, VEX_Vxorpd_xmm_xmm_xmmm128, VEX_Vxorpd_ymm_ymm_ymmm256, EVEX_Vxorpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vxorpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vxorpd_zmm_k1z_zmm_zmmm512b64, Addps_xmm_xmmm128, VEX_Vaddps_xmm_xmm_xmmm128, VEX_Vaddps_ymm_ymm_ymmm256, EVEX_Vaddps_xmm_k1z_xmm_xmmm128b32, EVEX_Vaddps_ymm_k1z_ymm_ymmm256b32, EVEX_Vaddps_zmm_k1z_zmm_zmmm512b32_er, Addpd_xmm_xmmm128, VEX_Vaddpd_xmm_xmm_xmmm128, VEX_Vaddpd_ymm_ymm_ymmm256, EVEX_Vaddpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vaddpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vaddpd_zmm_k1z_zmm_zmmm512b64_er, Addss_xmm_xmmm32, VEX_Vaddss_xmm_xmm_xmmm32, EVEX_Vaddss_xmm_k1z_xmm_xmmm32_er, Addsd_xmm_xmmm64, VEX_Vaddsd_xmm_xmm_xmmm64, EVEX_Vaddsd_xmm_k1z_xmm_xmmm64_er, Mulps_xmm_xmmm128, VEX_Vmulps_xmm_xmm_xmmm128, VEX_Vmulps_ymm_ymm_ymmm256, EVEX_Vmulps_xmm_k1z_xmm_xmmm128b32, EVEX_Vmulps_ymm_k1z_ymm_ymmm256b32, EVEX_Vmulps_zmm_k1z_zmm_zmmm512b32_er, Mulpd_xmm_xmmm128, VEX_Vmulpd_xmm_xmm_xmmm128, VEX_Vmulpd_ymm_ymm_ymmm256, EVEX_Vmulpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vmulpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vmulpd_zmm_k1z_zmm_zmmm512b64_er, Mulss_xmm_xmmm32, VEX_Vmulss_xmm_xmm_xmmm32, EVEX_Vmulss_xmm_k1z_xmm_xmmm32_er, Mulsd_xmm_xmmm64, VEX_Vmulsd_xmm_xmm_xmmm64, EVEX_Vmulsd_xmm_k1z_xmm_xmmm64_er, Cvtps2pd_xmm_xmmm64, VEX_Vcvtps2pd_xmm_xmmm64, VEX_Vcvtps2pd_ymm_xmmm128, EVEX_Vcvtps2pd_xmm_k1z_xmmm64b32, EVEX_Vcvtps2pd_ymm_k1z_xmmm128b32, EVEX_Vcvtps2pd_zmm_k1z_ymmm256b32_sae, Cvtpd2ps_xmm_xmmm128, VEX_Vcvtpd2ps_xmm_xmmm128, VEX_Vcvtpd2ps_xmm_ymmm256, EVEX_Vcvtpd2ps_xmm_k1z_xmmm128b64, EVEX_Vcvtpd2ps_xmm_k1z_ymmm256b64, EVEX_Vcvtpd2ps_ymm_k1z_zmmm512b64_er, Cvtss2sd_xmm_xmmm32, VEX_Vcvtss2sd_xmm_xmm_xmmm32, EVEX_Vcvtss2sd_xmm_k1z_xmm_xmmm32_sae, Cvtsd2ss_xmm_xmmm64, VEX_Vcvtsd2ss_xmm_xmm_xmmm64, EVEX_Vcvtsd2ss_xmm_k1z_xmm_xmmm64_er, Cvtdq2ps_xmm_xmmm128, VEX_Vcvtdq2ps_xmm_xmmm128, VEX_Vcvtdq2ps_ymm_ymmm256, EVEX_Vcvtdq2ps_xmm_k1z_xmmm128b32, EVEX_Vcvtdq2ps_ymm_k1z_ymmm256b32, EVEX_Vcvtdq2ps_zmm_k1z_zmmm512b32_er, EVEX_Vcvtqq2ps_xmm_k1z_xmmm128b64, EVEX_Vcvtqq2ps_xmm_k1z_ymmm256b64, EVEX_Vcvtqq2ps_ymm_k1z_zmmm512b64_er, Cvtps2dq_xmm_xmmm128, VEX_Vcvtps2dq_xmm_xmmm128, VEX_Vcvtps2dq_ymm_ymmm256, EVEX_Vcvtps2dq_xmm_k1z_xmmm128b32, EVEX_Vcvtps2dq_ymm_k1z_ymmm256b32, EVEX_Vcvtps2dq_zmm_k1z_zmmm512b32_er, Cvttps2dq_xmm_xmmm128, VEX_Vcvttps2dq_xmm_xmmm128, VEX_Vcvttps2dq_ymm_ymmm256, EVEX_Vcvttps2dq_xmm_k1z_xmmm128b32, EVEX_Vcvttps2dq_ymm_k1z_ymmm256b32, EVEX_Vcvttps2dq_zmm_k1z_zmmm512b32_sae, Subps_xmm_xmmm128, VEX_Vsubps_xmm_xmm_xmmm128, VEX_Vsubps_ymm_ymm_ymmm256, EVEX_Vsubps_xmm_k1z_xmm_xmmm128b32, EVEX_Vsubps_ymm_k1z_ymm_ymmm256b32, EVEX_Vsubps_zmm_k1z_zmm_zmmm512b32_er, Subpd_xmm_xmmm128, VEX_Vsubpd_xmm_xmm_xmmm128, VEX_Vsubpd_ymm_ymm_ymmm256, EVEX_Vsubpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vsubpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vsubpd_zmm_k1z_zmm_zmmm512b64_er, Subss_xmm_xmmm32, VEX_Vsubss_xmm_xmm_xmmm32, EVEX_Vsubss_xmm_k1z_xmm_xmmm32_er, Subsd_xmm_xmmm64, VEX_Vsubsd_xmm_xmm_xmmm64, EVEX_Vsubsd_xmm_k1z_xmm_xmmm64_er, Minps_xmm_xmmm128, VEX_Vminps_xmm_xmm_xmmm128, VEX_Vminps_ymm_ymm_ymmm256, EVEX_Vminps_xmm_k1z_xmm_xmmm128b32, EVEX_Vminps_ymm_k1z_ymm_ymmm256b32, EVEX_Vminps_zmm_k1z_zmm_zmmm512b32_sae, Minpd_xmm_xmmm128, VEX_Vminpd_xmm_xmm_xmmm128, VEX_Vminpd_ymm_ymm_ymmm256, EVEX_Vminpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vminpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vminpd_zmm_k1z_zmm_zmmm512b64_sae, Minss_xmm_xmmm32, VEX_Vminss_xmm_xmm_xmmm32, EVEX_Vminss_xmm_k1z_xmm_xmmm32_sae, Minsd_xmm_xmmm64, VEX_Vminsd_xmm_xmm_xmmm64, EVEX_Vminsd_xmm_k1z_xmm_xmmm64_sae, Divps_xmm_xmmm128, VEX_Vdivps_xmm_xmm_xmmm128, VEX_Vdivps_ymm_ymm_ymmm256, EVEX_Vdivps_xmm_k1z_xmm_xmmm128b32, EVEX_Vdivps_ymm_k1z_ymm_ymmm256b32, EVEX_Vdivps_zmm_k1z_zmm_zmmm512b32_er, Divpd_xmm_xmmm128, VEX_Vdivpd_xmm_xmm_xmmm128, VEX_Vdivpd_ymm_ymm_ymmm256, EVEX_Vdivpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vdivpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vdivpd_zmm_k1z_zmm_zmmm512b64_er, Divss_xmm_xmmm32, VEX_Vdivss_xmm_xmm_xmmm32, EVEX_Vdivss_xmm_k1z_xmm_xmmm32_er, Divsd_xmm_xmmm64, VEX_Vdivsd_xmm_xmm_xmmm64, EVEX_Vdivsd_xmm_k1z_xmm_xmmm64_er, Maxps_xmm_xmmm128, VEX_Vmaxps_xmm_xmm_xmmm128, VEX_Vmaxps_ymm_ymm_ymmm256, EVEX_Vmaxps_xmm_k1z_xmm_xmmm128b32, EVEX_Vmaxps_ymm_k1z_ymm_ymmm256b32, EVEX_Vmaxps_zmm_k1z_zmm_zmmm512b32_sae, Maxpd_xmm_xmmm128, VEX_Vmaxpd_xmm_xmm_xmmm128, VEX_Vmaxpd_ymm_ymm_ymmm256, EVEX_Vmaxpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vmaxpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vmaxpd_zmm_k1z_zmm_zmmm512b64_sae, Maxss_xmm_xmmm32, VEX_Vmaxss_xmm_xmm_xmmm32, EVEX_Vmaxss_xmm_k1z_xmm_xmmm32_sae, Maxsd_xmm_xmmm64, VEX_Vmaxsd_xmm_xmm_xmmm64, EVEX_Vmaxsd_xmm_k1z_xmm_xmmm64_sae, Punpcklbw_mm_mmm32, Punpcklbw_xmm_xmmm128, VEX_Vpunpcklbw_xmm_xmm_xmmm128, VEX_Vpunpcklbw_ymm_ymm_ymmm256, EVEX_Vpunpcklbw_xmm_k1z_xmm_xmmm128, EVEX_Vpunpcklbw_ymm_k1z_ymm_ymmm256, EVEX_Vpunpcklbw_zmm_k1z_zmm_zmmm512, Punpcklwd_mm_mmm32, Punpcklwd_xmm_xmmm128, VEX_Vpunpcklwd_xmm_xmm_xmmm128, VEX_Vpunpcklwd_ymm_ymm_ymmm256, EVEX_Vpunpcklwd_xmm_k1z_xmm_xmmm128, EVEX_Vpunpcklwd_ymm_k1z_ymm_ymmm256, EVEX_Vpunpcklwd_zmm_k1z_zmm_zmmm512, Punpckldq_mm_mmm32, Punpckldq_xmm_xmmm128, VEX_Vpunpckldq_xmm_xmm_xmmm128, VEX_Vpunpckldq_ymm_ymm_ymmm256, EVEX_Vpunpckldq_xmm_k1z_xmm_xmmm128b32, EVEX_Vpunpckldq_ymm_k1z_ymm_ymmm256b32, EVEX_Vpunpckldq_zmm_k1z_zmm_zmmm512b32, Packsswb_mm_mmm64, Packsswb_xmm_xmmm128, VEX_Vpacksswb_xmm_xmm_xmmm128, VEX_Vpacksswb_ymm_ymm_ymmm256, EVEX_Vpacksswb_xmm_k1z_xmm_xmmm128, EVEX_Vpacksswb_ymm_k1z_ymm_ymmm256, EVEX_Vpacksswb_zmm_k1z_zmm_zmmm512, Pcmpgtb_mm_mmm64, Pcmpgtb_xmm_xmmm128, VEX_Vpcmpgtb_xmm_xmm_xmmm128, VEX_Vpcmpgtb_ymm_ymm_ymmm256, EVEX_Vpcmpgtb_kr_k1_xmm_xmmm128, EVEX_Vpcmpgtb_kr_k1_ymm_ymmm256, EVEX_Vpcmpgtb_kr_k1_zmm_zmmm512, Pcmpgtw_mm_mmm64, Pcmpgtw_xmm_xmmm128, VEX_Vpcmpgtw_xmm_xmm_xmmm128, VEX_Vpcmpgtw_ymm_ymm_ymmm256, EVEX_Vpcmpgtw_kr_k1_xmm_xmmm128, EVEX_Vpcmpgtw_kr_k1_ymm_ymmm256, EVEX_Vpcmpgtw_kr_k1_zmm_zmmm512, Pcmpgtd_mm_mmm64, Pcmpgtd_xmm_xmmm128, VEX_Vpcmpgtd_xmm_xmm_xmmm128, VEX_Vpcmpgtd_ymm_ymm_ymmm256, EVEX_Vpcmpgtd_kr_k1_xmm_xmmm128b32, EVEX_Vpcmpgtd_kr_k1_ymm_ymmm256b32, EVEX_Vpcmpgtd_kr_k1_zmm_zmmm512b32, Packuswb_mm_mmm64, Packuswb_xmm_xmmm128, VEX_Vpackuswb_xmm_xmm_xmmm128, VEX_Vpackuswb_ymm_ymm_ymmm256, EVEX_Vpackuswb_xmm_k1z_xmm_xmmm128, EVEX_Vpackuswb_ymm_k1z_ymm_ymmm256, EVEX_Vpackuswb_zmm_k1z_zmm_zmmm512, Punpckhbw_mm_mmm64, Punpckhbw_xmm_xmmm128, VEX_Vpunpckhbw_xmm_xmm_xmmm128, VEX_Vpunpckhbw_ymm_ymm_ymmm256, EVEX_Vpunpckhbw_xmm_k1z_xmm_xmmm128, EVEX_Vpunpckhbw_ymm_k1z_ymm_ymmm256, EVEX_Vpunpckhbw_zmm_k1z_zmm_zmmm512, Punpckhwd_mm_mmm64, Punpckhwd_xmm_xmmm128, VEX_Vpunpckhwd_xmm_xmm_xmmm128, VEX_Vpunpckhwd_ymm_ymm_ymmm256, EVEX_Vpunpckhwd_xmm_k1z_xmm_xmmm128, EVEX_Vpunpckhwd_ymm_k1z_ymm_ymmm256, EVEX_Vpunpckhwd_zmm_k1z_zmm_zmmm512, Punpckhdq_mm_mmm64, Punpckhdq_xmm_xmmm128, VEX_Vpunpckhdq_xmm_xmm_xmmm128, VEX_Vpunpckhdq_ymm_ymm_ymmm256, EVEX_Vpunpckhdq_xmm_k1z_xmm_xmmm128b32, EVEX_Vpunpckhdq_ymm_k1z_ymm_ymmm256b32, EVEX_Vpunpckhdq_zmm_k1z_zmm_zmmm512b32, Packssdw_mm_mmm64, Packssdw_xmm_xmmm128, VEX_Vpackssdw_xmm_xmm_xmmm128, VEX_Vpackssdw_ymm_ymm_ymmm256, EVEX_Vpackssdw_xmm_k1z_xmm_xmmm128b32, EVEX_Vpackssdw_ymm_k1z_ymm_ymmm256b32, EVEX_Vpackssdw_zmm_k1z_zmm_zmmm512b32, Punpcklqdq_xmm_xmmm128, VEX_Vpunpcklqdq_xmm_xmm_xmmm128, VEX_Vpunpcklqdq_ymm_ymm_ymmm256, EVEX_Vpunpcklqdq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpunpcklqdq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpunpcklqdq_zmm_k1z_zmm_zmmm512b64, Punpckhqdq_xmm_xmmm128, VEX_Vpunpckhqdq_xmm_xmm_xmmm128, VEX_Vpunpckhqdq_ymm_ymm_ymmm256, EVEX_Vpunpckhqdq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpunpckhqdq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpunpckhqdq_zmm_k1z_zmm_zmmm512b64, Movd_mm_rm32, Movq_mm_rm64, Movd_xmm_rm32, Movq_xmm_rm64, VEX_Vmovd_xmm_rm32, VEX_Vmovq_xmm_rm64, EVEX_Vmovd_xmm_rm32, EVEX_Vmovq_xmm_rm64, Movq_mm_mmm64, Movdqa_xmm_xmmm128, VEX_Vmovdqa_xmm_xmmm128, VEX_Vmovdqa_ymm_ymmm256, EVEX_Vmovdqa32_xmm_k1z_xmmm128, EVEX_Vmovdqa32_ymm_k1z_ymmm256, EVEX_Vmovdqa32_zmm_k1z_zmmm512, EVEX_Vmovdqa64_xmm_k1z_xmmm128, EVEX_Vmovdqa64_ymm_k1z_ymmm256, EVEX_Vmovdqa64_zmm_k1z_zmmm512, Movdqu_xmm_xmmm128, VEX_Vmovdqu_xmm_xmmm128, VEX_Vmovdqu_ymm_ymmm256, EVEX_Vmovdqu32_xmm_k1z_xmmm128, EVEX_Vmovdqu32_ymm_k1z_ymmm256, EVEX_Vmovdqu32_zmm_k1z_zmmm512, EVEX_Vmovdqu64_xmm_k1z_xmmm128, EVEX_Vmovdqu64_ymm_k1z_ymmm256, EVEX_Vmovdqu64_zmm_k1z_zmmm512, EVEX_Vmovdqu8_xmm_k1z_xmmm128, EVEX_Vmovdqu8_ymm_k1z_ymmm256, EVEX_Vmovdqu8_zmm_k1z_zmmm512, EVEX_Vmovdqu16_xmm_k1z_xmmm128, EVEX_Vmovdqu16_ymm_k1z_ymmm256, EVEX_Vmovdqu16_zmm_k1z_zmmm512, Pshufw_mm_mmm64_imm8, Pshufd_xmm_xmmm128_imm8, VEX_Vpshufd_xmm_xmmm128_imm8, VEX_Vpshufd_ymm_ymmm256_imm8, EVEX_Vpshufd_xmm_k1z_xmmm128b32_imm8, EVEX_Vpshufd_ymm_k1z_ymmm256b32_imm8, EVEX_Vpshufd_zmm_k1z_zmmm512b32_imm8, Pshufhw_xmm_xmmm128_imm8, VEX_Vpshufhw_xmm_xmmm128_imm8, VEX_Vpshufhw_ymm_ymmm256_imm8, EVEX_Vpshufhw_xmm_k1z_xmmm128_imm8, EVEX_Vpshufhw_ymm_k1z_ymmm256_imm8, EVEX_Vpshufhw_zmm_k1z_zmmm512_imm8, Pshuflw_xmm_xmmm128_imm8, VEX_Vpshuflw_xmm_xmmm128_imm8, VEX_Vpshuflw_ymm_ymmm256_imm8, EVEX_Vpshuflw_xmm_k1z_xmmm128_imm8, EVEX_Vpshuflw_ymm_k1z_ymmm256_imm8, EVEX_Vpshuflw_zmm_k1z_zmmm512_imm8, Psrlw_mm_imm8, Psrlw_xmm_imm8, VEX_Vpsrlw_xmm_xmm_imm8, VEX_Vpsrlw_ymm_ymm_imm8, EVEX_Vpsrlw_xmm_k1z_xmmm128_imm8, EVEX_Vpsrlw_ymm_k1z_ymmm256_imm8, EVEX_Vpsrlw_zmm_k1z_zmmm512_imm8, Psraw_mm_imm8, Psraw_xmm_imm8, VEX_Vpsraw_xmm_xmm_imm8, VEX_Vpsraw_ymm_ymm_imm8, EVEX_Vpsraw_xmm_k1z_xmmm128_imm8, EVEX_Vpsraw_ymm_k1z_ymmm256_imm8, EVEX_Vpsraw_zmm_k1z_zmmm512_imm8, Psllw_mm_imm8, Psllw_xmm_imm8, VEX_Vpsllw_xmm_xmm_imm8, VEX_Vpsllw_ymm_ymm_imm8, EVEX_Vpsllw_xmm_k1z_xmmm128_imm8, EVEX_Vpsllw_ymm_k1z_ymmm256_imm8, EVEX_Vpsllw_zmm_k1z_zmmm512_imm8, EVEX_Vprord_xmm_k1z_xmmm128b32_imm8, EVEX_Vprord_ymm_k1z_ymmm256b32_imm8, EVEX_Vprord_zmm_k1z_zmmm512b32_imm8, EVEX_Vprorq_xmm_k1z_xmmm128b64_imm8, EVEX_Vprorq_ymm_k1z_ymmm256b64_imm8, EVEX_Vprorq_zmm_k1z_zmmm512b64_imm8, EVEX_Vprold_xmm_k1z_xmmm128b32_imm8, EVEX_Vprold_ymm_k1z_ymmm256b32_imm8, EVEX_Vprold_zmm_k1z_zmmm512b32_imm8, EVEX_Vprolq_xmm_k1z_xmmm128b64_imm8, EVEX_Vprolq_ymm_k1z_ymmm256b64_imm8, EVEX_Vprolq_zmm_k1z_zmmm512b64_imm8, Psrld_mm_imm8, Psrld_xmm_imm8, VEX_Vpsrld_xmm_xmm_imm8, VEX_Vpsrld_ymm_ymm_imm8, EVEX_Vpsrld_xmm_k1z_xmmm128b32_imm8, EVEX_Vpsrld_ymm_k1z_ymmm256b32_imm8, EVEX_Vpsrld_zmm_k1z_zmmm512b32_imm8, Psrad_mm_imm8, Psrad_xmm_imm8, VEX_Vpsrad_xmm_xmm_imm8, VEX_Vpsrad_ymm_ymm_imm8, EVEX_Vpsrad_xmm_k1z_xmmm128b32_imm8, EVEX_Vpsrad_ymm_k1z_ymmm256b32_imm8, EVEX_Vpsrad_zmm_k1z_zmmm512b32_imm8, EVEX_Vpsraq_xmm_k1z_xmmm128b64_imm8, EVEX_Vpsraq_ymm_k1z_ymmm256b64_imm8, EVEX_Vpsraq_zmm_k1z_zmmm512b64_imm8, Pslld_mm_imm8, Pslld_xmm_imm8, VEX_Vpslld_xmm_xmm_imm8, VEX_Vpslld_ymm_ymm_imm8, EVEX_Vpslld_xmm_k1z_xmmm128b32_imm8, EVEX_Vpslld_ymm_k1z_ymmm256b32_imm8, EVEX_Vpslld_zmm_k1z_zmmm512b32_imm8, Psrlq_mm_imm8, Psrlq_xmm_imm8, VEX_Vpsrlq_xmm_xmm_imm8, VEX_Vpsrlq_ymm_ymm_imm8, EVEX_Vpsrlq_xmm_k1z_xmmm128b64_imm8, EVEX_Vpsrlq_ymm_k1z_ymmm256b64_imm8, EVEX_Vpsrlq_zmm_k1z_zmmm512b64_imm8, Psrldq_xmm_imm8, VEX_Vpsrldq_xmm_xmm_imm8, VEX_Vpsrldq_ymm_ymm_imm8, EVEX_Vpsrldq_xmm_xmmm128_imm8, EVEX_Vpsrldq_ymm_ymmm256_imm8, EVEX_Vpsrldq_zmm_zmmm512_imm8, Psllq_mm_imm8, Psllq_xmm_imm8, VEX_Vpsllq_xmm_xmm_imm8, VEX_Vpsllq_ymm_ymm_imm8, EVEX_Vpsllq_xmm_k1z_xmmm128b64_imm8, EVEX_Vpsllq_ymm_k1z_ymmm256b64_imm8, EVEX_Vpsllq_zmm_k1z_zmmm512b64_imm8, Pslldq_xmm_imm8, VEX_Vpslldq_xmm_xmm_imm8, VEX_Vpslldq_ymm_ymm_imm8, EVEX_Vpslldq_xmm_xmmm128_imm8, EVEX_Vpslldq_ymm_ymmm256_imm8, EVEX_Vpslldq_zmm_zmmm512_imm8, Pcmpeqb_mm_mmm64, Pcmpeqb_xmm_xmmm128, VEX_Vpcmpeqb_xmm_xmm_xmmm128, VEX_Vpcmpeqb_ymm_ymm_ymmm256, EVEX_Vpcmpeqb_kr_k1_xmm_xmmm128, EVEX_Vpcmpeqb_kr_k1_ymm_ymmm256, EVEX_Vpcmpeqb_kr_k1_zmm_zmmm512, Pcmpeqw_mm_mmm64, Pcmpeqw_xmm_xmmm128, VEX_Vpcmpeqw_xmm_xmm_xmmm128, VEX_Vpcmpeqw_ymm_ymm_ymmm256, EVEX_Vpcmpeqw_kr_k1_xmm_xmmm128, EVEX_Vpcmpeqw_kr_k1_ymm_ymmm256, EVEX_Vpcmpeqw_kr_k1_zmm_zmmm512, Pcmpeqd_mm_mmm64, Pcmpeqd_xmm_xmmm128, VEX_Vpcmpeqd_xmm_xmm_xmmm128, VEX_Vpcmpeqd_ymm_ymm_ymmm256, EVEX_Vpcmpeqd_kr_k1_xmm_xmmm128b32, EVEX_Vpcmpeqd_kr_k1_ymm_ymmm256b32, EVEX_Vpcmpeqd_kr_k1_zmm_zmmm512b32, Emms, VEX_Vzeroupper, VEX_Vzeroall, Vmread_rm32_r32, Vmread_rm64_r64, EVEX_Vcvttps2udq_xmm_k1z_xmmm128b32, EVEX_Vcvttps2udq_ymm_k1z_ymmm256b32, EVEX_Vcvttps2udq_zmm_k1z_zmmm512b32_sae, EVEX_Vcvttpd2udq_xmm_k1z_xmmm128b64, EVEX_Vcvttpd2udq_xmm_k1z_ymmm256b64, EVEX_Vcvttpd2udq_ymm_k1z_zmmm512b64_sae, Extrq_xmm_imm8_imm8, EVEX_Vcvttps2uqq_xmm_k1z_xmmm64b32, EVEX_Vcvttps2uqq_ymm_k1z_xmmm128b32, EVEX_Vcvttps2uqq_zmm_k1z_ymmm256b32_sae, EVEX_Vcvttpd2uqq_xmm_k1z_xmmm128b64, EVEX_Vcvttpd2uqq_ymm_k1z_ymmm256b64, EVEX_Vcvttpd2uqq_zmm_k1z_zmmm512b64_sae, EVEX_Vcvttss2usi_r32_xmmm32_sae, EVEX_Vcvttss2usi_r64_xmmm32_sae, Insertq_xmm_xmm_imm8_imm8, EVEX_Vcvttsd2usi_r32_xmmm64_sae, EVEX_Vcvttsd2usi_r64_xmmm64_sae, Vmwrite_r32_rm32, Vmwrite_r64_rm64, EVEX_Vcvtps2udq_xmm_k1z_xmmm128b32, EVEX_Vcvtps2udq_ymm_k1z_ymmm256b32, EVEX_Vcvtps2udq_zmm_k1z_zmmm512b32_er, EVEX_Vcvtpd2udq_xmm_k1z_xmmm128b64, EVEX_Vcvtpd2udq_xmm_k1z_ymmm256b64, EVEX_Vcvtpd2udq_ymm_k1z_zmmm512b64_er, Extrq_xmm_xmm, EVEX_Vcvtps2uqq_xmm_k1z_xmmm64b32, EVEX_Vcvtps2uqq_ymm_k1z_xmmm128b32, EVEX_Vcvtps2uqq_zmm_k1z_ymmm256b32_er, EVEX_Vcvtpd2uqq_xmm_k1z_xmmm128b64, EVEX_Vcvtpd2uqq_ymm_k1z_ymmm256b64, EVEX_Vcvtpd2uqq_zmm_k1z_zmmm512b64_er, EVEX_Vcvtss2usi_r32_xmmm32_er, EVEX_Vcvtss2usi_r64_xmmm32_er, Insertq_xmm_xmm, EVEX_Vcvtsd2usi_r32_xmmm64_er, EVEX_Vcvtsd2usi_r64_xmmm64_er, EVEX_Vcvttps2qq_xmm_k1z_xmmm64b32, EVEX_Vcvttps2qq_ymm_k1z_xmmm128b32, EVEX_Vcvttps2qq_zmm_k1z_ymmm256b32_sae, EVEX_Vcvttpd2qq_xmm_k1z_xmmm128b64, EVEX_Vcvttpd2qq_ymm_k1z_ymmm256b64, EVEX_Vcvttpd2qq_zmm_k1z_zmmm512b64_sae, EVEX_Vcvtudq2pd_xmm_k1z_xmmm64b32, EVEX_Vcvtudq2pd_ymm_k1z_xmmm128b32, EVEX_Vcvtudq2pd_zmm_k1z_ymmm256b32_er, EVEX_Vcvtuqq2pd_xmm_k1z_xmmm128b64, EVEX_Vcvtuqq2pd_ymm_k1z_ymmm256b64, EVEX_Vcvtuqq2pd_zmm_k1z_zmmm512b64_er, EVEX_Vcvtudq2ps_xmm_k1z_xmmm128b32, EVEX_Vcvtudq2ps_ymm_k1z_ymmm256b32, EVEX_Vcvtudq2ps_zmm_k1z_zmmm512b32_er, EVEX_Vcvtuqq2ps_xmm_k1z_xmmm128b64, EVEX_Vcvtuqq2ps_xmm_k1z_ymmm256b64, EVEX_Vcvtuqq2ps_ymm_k1z_zmmm512b64_er, EVEX_Vcvtps2qq_xmm_k1z_xmmm64b32, EVEX_Vcvtps2qq_ymm_k1z_xmmm128b32, EVEX_Vcvtps2qq_zmm_k1z_ymmm256b32_er, EVEX_Vcvtpd2qq_xmm_k1z_xmmm128b64, EVEX_Vcvtpd2qq_ymm_k1z_ymmm256b64, EVEX_Vcvtpd2qq_zmm_k1z_zmmm512b64_er, EVEX_Vcvtusi2ss_xmm_xmm_rm32_er, EVEX_Vcvtusi2ss_xmm_xmm_rm64_er, EVEX_Vcvtusi2sd_xmm_xmm_rm32_er, EVEX_Vcvtusi2sd_xmm_xmm_rm64_er, Haddpd_xmm_xmmm128, VEX_Vhaddpd_xmm_xmm_xmmm128, VEX_Vhaddpd_ymm_ymm_ymmm256, Haddps_xmm_xmmm128, VEX_Vhaddps_xmm_xmm_xmmm128, VEX_Vhaddps_ymm_ymm_ymmm256, Hsubpd_xmm_xmmm128, VEX_Vhsubpd_xmm_xmm_xmmm128, VEX_Vhsubpd_ymm_ymm_ymmm256, Hsubps_xmm_xmmm128, VEX_Vhsubps_xmm_xmm_xmmm128, VEX_Vhsubps_ymm_ymm_ymmm256, Movd_rm32_mm, Movq_rm64_mm, Movd_rm32_xmm, Movq_rm64_xmm, VEX_Vmovd_rm32_xmm, VEX_Vmovq_rm64_xmm, EVEX_Vmovd_rm32_xmm, EVEX_Vmovq_rm64_xmm, Movq_xmm_xmmm64, VEX_Vmovq_xmm_xmmm64, EVEX_Vmovq_xmm_xmmm64, Movq_mmm64_mm, Movdqa_xmmm128_xmm, VEX_Vmovdqa_xmmm128_xmm, VEX_Vmovdqa_ymmm256_ymm, EVEX_Vmovdqa32_xmmm128_k1z_xmm, EVEX_Vmovdqa32_ymmm256_k1z_ymm, EVEX_Vmovdqa32_zmmm512_k1z_zmm, EVEX_Vmovdqa64_xmmm128_k1z_xmm, EVEX_Vmovdqa64_ymmm256_k1z_ymm, EVEX_Vmovdqa64_zmmm512_k1z_zmm, Movdqu_xmmm128_xmm, VEX_Vmovdqu_xmmm128_xmm, VEX_Vmovdqu_ymmm256_ymm, EVEX_Vmovdqu32_xmmm128_k1z_xmm, EVEX_Vmovdqu32_ymmm256_k1z_ymm, EVEX_Vmovdqu32_zmmm512_k1z_zmm, EVEX_Vmovdqu64_xmmm128_k1z_xmm, EVEX_Vmovdqu64_ymmm256_k1z_ymm, EVEX_Vmovdqu64_zmmm512_k1z_zmm, EVEX_Vmovdqu8_xmmm128_k1z_xmm, EVEX_Vmovdqu8_ymmm256_k1z_ymm, EVEX_Vmovdqu8_zmmm512_k1z_zmm, EVEX_Vmovdqu16_xmmm128_k1z_xmm, EVEX_Vmovdqu16_ymmm256_k1z_ymm, EVEX_Vmovdqu16_zmmm512_k1z_zmm, Jo_rel16, Jo_rel32_32, Jo_rel32_64, Jno_rel16, Jno_rel32_32, Jno_rel32_64, Jb_rel16, Jb_rel32_32, Jb_rel32_64, Jae_rel16, Jae_rel32_32, Jae_rel32_64, Je_rel16, Je_rel32_32, Je_rel32_64, Jne_rel16, Jne_rel32_32, Jne_rel32_64, Jbe_rel16, Jbe_rel32_32, Jbe_rel32_64, Ja_rel16, Ja_rel32_32, Ja_rel32_64, Js_rel16, Js_rel32_32, Js_rel32_64, Jns_rel16, Jns_rel32_32, Jns_rel32_64, Jp_rel16, Jp_rel32_32, Jp_rel32_64, Jnp_rel16, Jnp_rel32_32, Jnp_rel32_64, Jl_rel16, Jl_rel32_32, Jl_rel32_64, Jge_rel16, Jge_rel32_32, Jge_rel32_64, Jle_rel16, Jle_rel32_32, Jle_rel32_64, Jg_rel16, Jg_rel32_32, Jg_rel32_64, Seto_rm8, Setno_rm8, Setb_rm8, Setae_rm8, Sete_rm8, Setne_rm8, Setbe_rm8, Seta_rm8, Sets_rm8, Setns_rm8, Setp_rm8, Setnp_rm8, Setl_rm8, Setge_rm8, Setle_rm8, Setg_rm8, VEX_Kmovw_kr_km16, VEX_Kmovq_kr_km64, VEX_Kmovb_kr_km8, VEX_Kmovd_kr_km32, VEX_Kmovw_m16_kr, VEX_Kmovq_m64_kr, VEX_Kmovb_m8_kr, VEX_Kmovd_m32_kr, VEX_Kmovw_kr_r32, VEX_Kmovb_kr_r32, VEX_Kmovd_kr_r32, VEX_Kmovq_kr_r64, VEX_Kmovw_r32_kr, VEX_Kmovb_r32_kr, VEX_Kmovd_r32_kr, VEX_Kmovq_r64_kr, VEX_Kortestw_kr_kr, VEX_Kortestq_kr_kr, VEX_Kortestb_kr_kr, VEX_Kortestd_kr_kr, VEX_Ktestw_kr_kr, VEX_Ktestq_kr_kr, VEX_Ktestb_kr_kr, VEX_Ktestd_kr_kr, Pushw_FS, Pushd_FS, Pushq_FS, Popw_FS, Popd_FS, Popq_FS, Cpuid, Bt_rm16_r16, Bt_rm32_r32, Bt_rm64_r64, Shld_rm16_r16_imm8, Shld_rm32_r32_imm8, Shld_rm64_r64_imm8, Shld_rm16_r16_CL, Shld_rm32_r32_CL, Shld_rm64_r64_CL, Montmul_16, Montmul_32, Montmul_64, Xsha1_16, Xsha1_32, Xsha1_64, Xsha256_16, Xsha256_32, Xsha256_64, Xbts_r16_rm16, Xbts_r32_rm32, Xstore_16, Xstore_32, Xstore_64, Xcryptecb_16, Xcryptecb_32, Xcryptecb_64, Xcryptcbc_16, Xcryptcbc_32, Xcryptcbc_64, Xcryptctr_16, Xcryptctr_32, Xcryptctr_64, Xcryptcfb_16, Xcryptcfb_32, Xcryptcfb_64, Xcryptofb_16, Xcryptofb_32, Xcryptofb_64, Ibts_rm16_r16, Ibts_rm32_r32, Cmpxchg486_rm8_r8, Cmpxchg486_rm16_r16, Cmpxchg486_rm32_r32, Pushw_GS, Pushd_GS, Pushq_GS, Popw_GS, Popd_GS, Popq_GS, Rsm, Bts_rm16_r16, Bts_rm32_r32, Bts_rm64_r64, Shrd_rm16_r16_imm8, Shrd_rm32_r32_imm8, Shrd_rm64_r64_imm8, Shrd_rm16_r16_CL, Shrd_rm32_r32_CL, Shrd_rm64_r64_CL, Fxsave_m512byte, Fxsave64_m512byte, Rdfsbase_r32, Rdfsbase_r64, Fxrstor_m512byte, Fxrstor64_m512byte, Rdgsbase_r32, Rdgsbase_r64, Ldmxcsr_m32, Wrfsbase_r32, Wrfsbase_r64, VEX_Vldmxcsr_m32, Stmxcsr_m32, Wrgsbase_r32, Wrgsbase_r64, VEX_Vstmxcsr_m32, Xsave_mem, Xsave64_mem, Ptwrite_rm32, Ptwrite_rm64, Xrstor_mem, Xrstor64_mem, Incsspd_r32, Incsspq_r64, Xsaveopt_mem, Xsaveopt64_mem, Clwb_m8, Tpause_r32, Tpause_r64, Clrssbsy_m64, Umonitor_r16, Umonitor_r32, Umonitor_r64, Umwait_r32, Umwait_r64, Clflush_m8, Clflushopt_m8, Lfence, Lfence_E9, Lfence_EA, Lfence_EB, Lfence_EC, Lfence_ED, Lfence_EE, Lfence_EF, Mfence, Mfence_F1, Mfence_F2, Mfence_F3, Mfence_F4, Mfence_F5, Mfence_F6, Mfence_F7, Sfence, Sfence_F9, Sfence_FA, Sfence_FB, Sfence_FC, Sfence_FD, Sfence_FE, Sfence_FF, Pcommit, Imul_r16_rm16, Imul_r32_rm32, Imul_r64_rm64, Cmpxchg_rm8_r8, Cmpxchg_rm16_r16, Cmpxchg_rm32_r32, Cmpxchg_rm64_r64, Lss_r16_m1616, Lss_r32_m1632, Lss_r64_m1664, Btr_rm16_r16, Btr_rm32_r32, Btr_rm64_r64, Lfs_r16_m1616, Lfs_r32_m1632, Lfs_r64_m1664, Lgs_r16_m1616, Lgs_r32_m1632, Lgs_r64_m1664, Movzx_r16_rm8, Movzx_r32_rm8, Movzx_r64_rm8, Movzx_r16_rm16, Movzx_r32_rm16, Movzx_r64_rm16, Jmpe_disp16, Jmpe_disp32, Popcnt_r16_rm16, Popcnt_r32_rm32, Popcnt_r64_rm64, Ud1_r16_rm16, Ud1_r32_rm32, Ud1_r64_rm64, Bt_rm16_imm8, Bt_rm32_imm8, Bt_rm64_imm8, Bts_rm16_imm8, Bts_rm32_imm8, Bts_rm64_imm8, Btr_rm16_imm8, Btr_rm32_imm8, Btr_rm64_imm8, Btc_rm16_imm8, Btc_rm32_imm8, Btc_rm64_imm8, Btc_rm16_r16, Btc_rm32_r32, Btc_rm64_r64, Bsf_r16_rm16, Bsf_r32_rm32, Bsf_r64_rm64, Tzcnt_r16_rm16, Tzcnt_r32_rm32, Tzcnt_r64_rm64, Bsr_r16_rm16, Bsr_r32_rm32, Bsr_r64_rm64, Lzcnt_r16_rm16, Lzcnt_r32_rm32, Lzcnt_r64_rm64, Movsx_r16_rm8, Movsx_r32_rm8, Movsx_r64_rm8, Movsx_r16_rm16, Movsx_r32_rm16, Movsx_r64_rm16, Xadd_rm8_r8, Xadd_rm16_r16, Xadd_rm32_r32, Xadd_rm64_r64, Cmpps_xmm_xmmm128_imm8, VEX_Vcmpps_xmm_xmm_xmmm128_imm8, VEX_Vcmpps_ymm_ymm_ymmm256_imm8, EVEX_Vcmpps_kr_k1_xmm_xmmm128b32_imm8, EVEX_Vcmpps_kr_k1_ymm_ymmm256b32_imm8, EVEX_Vcmpps_kr_k1_zmm_zmmm512b32_imm8_sae, Cmppd_xmm_xmmm128_imm8, VEX_Vcmppd_xmm_xmm_xmmm128_imm8, VEX_Vcmppd_ymm_ymm_ymmm256_imm8, EVEX_Vcmppd_kr_k1_xmm_xmmm128b64_imm8, EVEX_Vcmppd_kr_k1_ymm_ymmm256b64_imm8, EVEX_Vcmppd_kr_k1_zmm_zmmm512b64_imm8_sae, Cmpss_xmm_xmmm32_imm8, VEX_Vcmpss_xmm_xmm_xmmm32_imm8, EVEX_Vcmpss_kr_k1_xmm_xmmm32_imm8_sae, Cmpsd_xmm_xmmm64_imm8, VEX_Vcmpsd_xmm_xmm_xmmm64_imm8, EVEX_Vcmpsd_kr_k1_xmm_xmmm64_imm8_sae, Movnti_m32_r32, Movnti_m64_r64, Pinsrw_mm_r32m16_imm8, Pinsrw_mm_r64m16_imm8, Pinsrw_xmm_r32m16_imm8, Pinsrw_xmm_r64m16_imm8, VEX_Vpinsrw_xmm_xmm_r32m16_imm8, VEX_Vpinsrw_xmm_xmm_r64m16_imm8, EVEX_Vpinsrw_xmm_xmm_r32m16_imm8, EVEX_Vpinsrw_xmm_xmm_r64m16_imm8, Pextrw_r32_mm_imm8, Pextrw_r64_mm_imm8, Pextrw_r32_xmm_imm8, Pextrw_r64_xmm_imm8, VEX_Vpextrw_r32_xmm_imm8, VEX_Vpextrw_r64_xmm_imm8, EVEX_Vpextrw_r32_xmm_imm8, EVEX_Vpextrw_r64_xmm_imm8, Shufps_xmm_xmmm128_imm8, VEX_Vshufps_xmm_xmm_xmmm128_imm8, VEX_Vshufps_ymm_ymm_ymmm256_imm8, EVEX_Vshufps_xmm_k1z_xmm_xmmm128b32_imm8, EVEX_Vshufps_ymm_k1z_ymm_ymmm256b32_imm8, EVEX_Vshufps_zmm_k1z_zmm_zmmm512b32_imm8, Shufpd_xmm_xmmm128_imm8, VEX_Vshufpd_xmm_xmm_xmmm128_imm8, VEX_Vshufpd_ymm_ymm_ymmm256_imm8, EVEX_Vshufpd_xmm_k1z_xmm_xmmm128b64_imm8, EVEX_Vshufpd_ymm_k1z_ymm_ymmm256b64_imm8, EVEX_Vshufpd_zmm_k1z_zmm_zmmm512b64_imm8, Cmpxchg8b_m64, Cmpxchg16b_m128, Xrstors_mem, Xrstors64_mem, Xsavec_mem, Xsavec64_mem, Xsaves_mem, Xsaves64_mem, Vmptrld_m64, Vmclear_m64, Vmxon_m64, Rdrand_r16, Rdrand_r32, Rdrand_r64, Vmptrst_m64, Rdseed_r16, Rdseed_r32, Rdseed_r64, Rdpid_r32, Rdpid_r64, Bswap_r16, Bswap_r32, Bswap_r64, Addsubpd_xmm_xmmm128, VEX_Vaddsubpd_xmm_xmm_xmmm128, VEX_Vaddsubpd_ymm_ymm_ymmm256, Addsubps_xmm_xmmm128, VEX_Vaddsubps_xmm_xmm_xmmm128, VEX_Vaddsubps_ymm_ymm_ymmm256, Psrlw_mm_mmm64, Psrlw_xmm_xmmm128, VEX_Vpsrlw_xmm_xmm_xmmm128, VEX_Vpsrlw_ymm_ymm_xmmm128, EVEX_Vpsrlw_xmm_k1z_xmm_xmmm128, EVEX_Vpsrlw_ymm_k1z_ymm_xmmm128, EVEX_Vpsrlw_zmm_k1z_zmm_xmmm128, Psrld_mm_mmm64, Psrld_xmm_xmmm128, VEX_Vpsrld_xmm_xmm_xmmm128, VEX_Vpsrld_ymm_ymm_xmmm128, EVEX_Vpsrld_xmm_k1z_xmm_xmmm128, EVEX_Vpsrld_ymm_k1z_ymm_xmmm128, EVEX_Vpsrld_zmm_k1z_zmm_xmmm128, Psrlq_mm_mmm64, Psrlq_xmm_xmmm128, VEX_Vpsrlq_xmm_xmm_xmmm128, VEX_Vpsrlq_ymm_ymm_xmmm128, EVEX_Vpsrlq_xmm_k1z_xmm_xmmm128, EVEX_Vpsrlq_ymm_k1z_ymm_xmmm128, EVEX_Vpsrlq_zmm_k1z_zmm_xmmm128, Paddq_mm_mmm64, Paddq_xmm_xmmm128, VEX_Vpaddq_xmm_xmm_xmmm128, VEX_Vpaddq_ymm_ymm_ymmm256, EVEX_Vpaddq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpaddq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpaddq_zmm_k1z_zmm_zmmm512b64, Pmullw_mm_mmm64, Pmullw_xmm_xmmm128, VEX_Vpmullw_xmm_xmm_xmmm128, VEX_Vpmullw_ymm_ymm_ymmm256, EVEX_Vpmullw_xmm_k1z_xmm_xmmm128, EVEX_Vpmullw_ymm_k1z_ymm_ymmm256, EVEX_Vpmullw_zmm_k1z_zmm_zmmm512, Movq_xmmm64_xmm, VEX_Vmovq_xmmm64_xmm, EVEX_Vmovq_xmmm64_xmm, Movq2dq_xmm_mm, Movdq2q_mm_xmm, Pmovmskb_r32_mm, Pmovmskb_r64_mm, Pmovmskb_r32_xmm, Pmovmskb_r64_xmm, VEX_Vpmovmskb_r32_xmm, VEX_Vpmovmskb_r64_xmm, VEX_Vpmovmskb_r32_ymm, VEX_Vpmovmskb_r64_ymm, Psubusb_mm_mmm64, Psubusb_xmm_xmmm128, VEX_Vpsubusb_xmm_xmm_xmmm128, VEX_Vpsubusb_ymm_ymm_ymmm256, EVEX_Vpsubusb_xmm_k1z_xmm_xmmm128, EVEX_Vpsubusb_ymm_k1z_ymm_ymmm256, EVEX_Vpsubusb_zmm_k1z_zmm_zmmm512, Psubusw_mm_mmm64, Psubusw_xmm_xmmm128, VEX_Vpsubusw_xmm_xmm_xmmm128, VEX_Vpsubusw_ymm_ymm_ymmm256, EVEX_Vpsubusw_xmm_k1z_xmm_xmmm128, EVEX_Vpsubusw_ymm_k1z_ymm_ymmm256, EVEX_Vpsubusw_zmm_k1z_zmm_zmmm512, Pminub_mm_mmm64, Pminub_xmm_xmmm128, VEX_Vpminub_xmm_xmm_xmmm128, VEX_Vpminub_ymm_ymm_ymmm256, EVEX_Vpminub_xmm_k1z_xmm_xmmm128, EVEX_Vpminub_ymm_k1z_ymm_ymmm256, EVEX_Vpminub_zmm_k1z_zmm_zmmm512, Pand_mm_mmm64, Pand_xmm_xmmm128, VEX_Vpand_xmm_xmm_xmmm128, VEX_Vpand_ymm_ymm_ymmm256, EVEX_Vpandd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpandd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpandd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpandq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpandq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpandq_zmm_k1z_zmm_zmmm512b64, Paddusb_mm_mmm64, Paddusb_xmm_xmmm128, VEX_Vpaddusb_xmm_xmm_xmmm128, VEX_Vpaddusb_ymm_ymm_ymmm256, EVEX_Vpaddusb_xmm_k1z_xmm_xmmm128, EVEX_Vpaddusb_ymm_k1z_ymm_ymmm256, EVEX_Vpaddusb_zmm_k1z_zmm_zmmm512, Paddusw_mm_mmm64, Paddusw_xmm_xmmm128, VEX_Vpaddusw_xmm_xmm_xmmm128, VEX_Vpaddusw_ymm_ymm_ymmm256, EVEX_Vpaddusw_xmm_k1z_xmm_xmmm128, EVEX_Vpaddusw_ymm_k1z_ymm_ymmm256, EVEX_Vpaddusw_zmm_k1z_zmm_zmmm512, Pmaxub_mm_mmm64, Pmaxub_xmm_xmmm128, VEX_Vpmaxub_xmm_xmm_xmmm128, VEX_Vpmaxub_ymm_ymm_ymmm256, EVEX_Vpmaxub_xmm_k1z_xmm_xmmm128, EVEX_Vpmaxub_ymm_k1z_ymm_ymmm256, EVEX_Vpmaxub_zmm_k1z_zmm_zmmm512, Pandn_mm_mmm64, Pandn_xmm_xmmm128, VEX_Vpandn_xmm_xmm_xmmm128, VEX_Vpandn_ymm_ymm_ymmm256, EVEX_Vpandnd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpandnd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpandnd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpandnq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpandnq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpandnq_zmm_k1z_zmm_zmmm512b64, Pavgb_mm_mmm64, Pavgb_xmm_xmmm128, VEX_Vpavgb_xmm_xmm_xmmm128, VEX_Vpavgb_ymm_ymm_ymmm256, EVEX_Vpavgb_xmm_k1z_xmm_xmmm128, EVEX_Vpavgb_ymm_k1z_ymm_ymmm256, EVEX_Vpavgb_zmm_k1z_zmm_zmmm512, Psraw_mm_mmm64, Psraw_xmm_xmmm128, VEX_Vpsraw_xmm_xmm_xmmm128, VEX_Vpsraw_ymm_ymm_xmmm128, EVEX_Vpsraw_xmm_k1z_xmm_xmmm128, EVEX_Vpsraw_ymm_k1z_ymm_xmmm128, EVEX_Vpsraw_zmm_k1z_zmm_xmmm128, Psrad_mm_mmm64, Psrad_xmm_xmmm128, VEX_Vpsrad_xmm_xmm_xmmm128, VEX_Vpsrad_ymm_ymm_xmmm128, EVEX_Vpsrad_xmm_k1z_xmm_xmmm128, EVEX_Vpsrad_ymm_k1z_ymm_xmmm128, EVEX_Vpsrad_zmm_k1z_zmm_xmmm128, EVEX_Vpsraq_xmm_k1z_xmm_xmmm128, EVEX_Vpsraq_ymm_k1z_ymm_xmmm128, EVEX_Vpsraq_zmm_k1z_zmm_xmmm128, Pavgw_mm_mmm64, Pavgw_xmm_xmmm128, VEX_Vpavgw_xmm_xmm_xmmm128, VEX_Vpavgw_ymm_ymm_ymmm256, EVEX_Vpavgw_xmm_k1z_xmm_xmmm128, EVEX_Vpavgw_ymm_k1z_ymm_ymmm256, EVEX_Vpavgw_zmm_k1z_zmm_zmmm512, Pmulhuw_mm_mmm64, Pmulhuw_xmm_xmmm128, VEX_Vpmulhuw_xmm_xmm_xmmm128, VEX_Vpmulhuw_ymm_ymm_ymmm256, EVEX_Vpmulhuw_xmm_k1z_xmm_xmmm128, EVEX_Vpmulhuw_ymm_k1z_ymm_ymmm256, EVEX_Vpmulhuw_zmm_k1z_zmm_zmmm512, Pmulhw_mm_mmm64, Pmulhw_xmm_xmmm128, VEX_Vpmulhw_xmm_xmm_xmmm128, VEX_Vpmulhw_ymm_ymm_ymmm256, EVEX_Vpmulhw_xmm_k1z_xmm_xmmm128, EVEX_Vpmulhw_ymm_k1z_ymm_ymmm256, EVEX_Vpmulhw_zmm_k1z_zmm_zmmm512, Cvttpd2dq_xmm_xmmm128, VEX_Vcvttpd2dq_xmm_xmmm128, VEX_Vcvttpd2dq_xmm_ymmm256, EVEX_Vcvttpd2dq_xmm_k1z_xmmm128b64, EVEX_Vcvttpd2dq_xmm_k1z_ymmm256b64, EVEX_Vcvttpd2dq_ymm_k1z_zmmm512b64_sae, Cvtdq2pd_xmm_xmmm64, VEX_Vcvtdq2pd_xmm_xmmm64, VEX_Vcvtdq2pd_ymm_xmmm128, EVEX_Vcvtdq2pd_xmm_k1z_xmmm64b32, EVEX_Vcvtdq2pd_ymm_k1z_xmmm128b32, EVEX_Vcvtdq2pd_zmm_k1z_ymmm256b32_er, EVEX_Vcvtqq2pd_xmm_k1z_xmmm128b64, EVEX_Vcvtqq2pd_ymm_k1z_ymmm256b64, EVEX_Vcvtqq2pd_zmm_k1z_zmmm512b64_er, Cvtpd2dq_xmm_xmmm128, VEX_Vcvtpd2dq_xmm_xmmm128, VEX_Vcvtpd2dq_xmm_ymmm256, EVEX_Vcvtpd2dq_xmm_k1z_xmmm128b64, EVEX_Vcvtpd2dq_xmm_k1z_ymmm256b64, EVEX_Vcvtpd2dq_ymm_k1z_zmmm512b64_er, Movntq_m64_mm, Movntdq_m128_xmm, VEX_Vmovntdq_m128_xmm, VEX_Vmovntdq_m256_ymm, EVEX_Vmovntdq_m128_xmm, EVEX_Vmovntdq_m256_ymm, EVEX_Vmovntdq_m512_zmm, Psubsb_mm_mmm64, Psubsb_xmm_xmmm128, VEX_Vpsubsb_xmm_xmm_xmmm128, VEX_Vpsubsb_ymm_ymm_ymmm256, EVEX_Vpsubsb_xmm_k1z_xmm_xmmm128, EVEX_Vpsubsb_ymm_k1z_ymm_ymmm256, EVEX_Vpsubsb_zmm_k1z_zmm_zmmm512, Psubsw_mm_mmm64, Psubsw_xmm_xmmm128, VEX_Vpsubsw_xmm_xmm_xmmm128, VEX_Vpsubsw_ymm_ymm_ymmm256, EVEX_Vpsubsw_xmm_k1z_xmm_xmmm128, EVEX_Vpsubsw_ymm_k1z_ymm_ymmm256, EVEX_Vpsubsw_zmm_k1z_zmm_zmmm512, Pminsw_mm_mmm64, Pminsw_xmm_xmmm128, VEX_Vpminsw_xmm_xmm_xmmm128, VEX_Vpminsw_ymm_ymm_ymmm256, EVEX_Vpminsw_xmm_k1z_xmm_xmmm128, EVEX_Vpminsw_ymm_k1z_ymm_ymmm256, EVEX_Vpminsw_zmm_k1z_zmm_zmmm512, Por_mm_mmm64, Por_xmm_xmmm128, VEX_Vpor_xmm_xmm_xmmm128, VEX_Vpor_ymm_ymm_ymmm256, EVEX_Vpord_xmm_k1z_xmm_xmmm128b32, EVEX_Vpord_ymm_k1z_ymm_ymmm256b32, EVEX_Vpord_zmm_k1z_zmm_zmmm512b32, EVEX_Vporq_xmm_k1z_xmm_xmmm128b64, EVEX_Vporq_ymm_k1z_ymm_ymmm256b64, EVEX_Vporq_zmm_k1z_zmm_zmmm512b64, Paddsb_mm_mmm64, Paddsb_xmm_xmmm128, VEX_Vpaddsb_xmm_xmm_xmmm128, VEX_Vpaddsb_ymm_ymm_ymmm256, EVEX_Vpaddsb_xmm_k1z_xmm_xmmm128, EVEX_Vpaddsb_ymm_k1z_ymm_ymmm256, EVEX_Vpaddsb_zmm_k1z_zmm_zmmm512, Paddsw_mm_mmm64, Paddsw_xmm_xmmm128, VEX_Vpaddsw_xmm_xmm_xmmm128, VEX_Vpaddsw_ymm_ymm_ymmm256, EVEX_Vpaddsw_xmm_k1z_xmm_xmmm128, EVEX_Vpaddsw_ymm_k1z_ymm_ymmm256, EVEX_Vpaddsw_zmm_k1z_zmm_zmmm512, Pmaxsw_mm_mmm64, Pmaxsw_xmm_xmmm128, VEX_Vpmaxsw_xmm_xmm_xmmm128, VEX_Vpmaxsw_ymm_ymm_ymmm256, EVEX_Vpmaxsw_xmm_k1z_xmm_xmmm128, EVEX_Vpmaxsw_ymm_k1z_ymm_ymmm256, EVEX_Vpmaxsw_zmm_k1z_zmm_zmmm512, Pxor_mm_mmm64, Pxor_xmm_xmmm128, VEX_Vpxor_xmm_xmm_xmmm128, VEX_Vpxor_ymm_ymm_ymmm256, EVEX_Vpxord_xmm_k1z_xmm_xmmm128b32, EVEX_Vpxord_ymm_k1z_ymm_ymmm256b32, EVEX_Vpxord_zmm_k1z_zmm_zmmm512b32, EVEX_Vpxorq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpxorq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpxorq_zmm_k1z_zmm_zmmm512b64, Lddqu_xmm_m128, VEX_Vlddqu_xmm_m128, VEX_Vlddqu_ymm_m256, Psllw_mm_mmm64, Psllw_xmm_xmmm128, VEX_Vpsllw_xmm_xmm_xmmm128, VEX_Vpsllw_ymm_ymm_xmmm128, EVEX_Vpsllw_xmm_k1z_xmm_xmmm128, EVEX_Vpsllw_ymm_k1z_ymm_xmmm128, EVEX_Vpsllw_zmm_k1z_zmm_xmmm128, Pslld_mm_mmm64, Pslld_xmm_xmmm128, VEX_Vpslld_xmm_xmm_xmmm128, VEX_Vpslld_ymm_ymm_xmmm128, EVEX_Vpslld_xmm_k1z_xmm_xmmm128, EVEX_Vpslld_ymm_k1z_ymm_xmmm128, EVEX_Vpslld_zmm_k1z_zmm_xmmm128, Psllq_mm_mmm64, Psllq_xmm_xmmm128, VEX_Vpsllq_xmm_xmm_xmmm128, VEX_Vpsllq_ymm_ymm_xmmm128, EVEX_Vpsllq_xmm_k1z_xmm_xmmm128, EVEX_Vpsllq_ymm_k1z_ymm_xmmm128, EVEX_Vpsllq_zmm_k1z_zmm_xmmm128, Pmuludq_mm_mmm64, Pmuludq_xmm_xmmm128, VEX_Vpmuludq_xmm_xmm_xmmm128, VEX_Vpmuludq_ymm_ymm_ymmm256, EVEX_Vpmuludq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpmuludq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpmuludq_zmm_k1z_zmm_zmmm512b64, Pmaddwd_mm_mmm64, Pmaddwd_xmm_xmmm128, VEX_Vpmaddwd_xmm_xmm_xmmm128, VEX_Vpmaddwd_ymm_ymm_ymmm256, EVEX_Vpmaddwd_xmm_k1z_xmm_xmmm128, EVEX_Vpmaddwd_ymm_k1z_ymm_ymmm256, EVEX_Vpmaddwd_zmm_k1z_zmm_zmmm512, Psadbw_mm_mmm64, Psadbw_xmm_xmmm128, VEX_Vpsadbw_xmm_xmm_xmmm128, VEX_Vpsadbw_ymm_ymm_ymmm256, EVEX_Vpsadbw_xmm_xmm_xmmm128, EVEX_Vpsadbw_ymm_ymm_ymmm256, EVEX_Vpsadbw_zmm_zmm_zmmm512, Maskmovq_rDI_mm_mm, Maskmovdqu_rDI_xmm_xmm, VEX_Vmaskmovdqu_rDI_xmm_xmm, Psubb_mm_mmm64, Psubb_xmm_xmmm128, VEX_Vpsubb_xmm_xmm_xmmm128, VEX_Vpsubb_ymm_ymm_ymmm256, EVEX_Vpsubb_xmm_k1z_xmm_xmmm128, EVEX_Vpsubb_ymm_k1z_ymm_ymmm256, EVEX_Vpsubb_zmm_k1z_zmm_zmmm512, Psubw_mm_mmm64, Psubw_xmm_xmmm128, VEX_Vpsubw_xmm_xmm_xmmm128, VEX_Vpsubw_ymm_ymm_ymmm256, EVEX_Vpsubw_xmm_k1z_xmm_xmmm128, EVEX_Vpsubw_ymm_k1z_ymm_ymmm256, EVEX_Vpsubw_zmm_k1z_zmm_zmmm512, Psubd_mm_mmm64, Psubd_xmm_xmmm128, VEX_Vpsubd_xmm_xmm_xmmm128, VEX_Vpsubd_ymm_ymm_ymmm256, EVEX_Vpsubd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpsubd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpsubd_zmm_k1z_zmm_zmmm512b32, Psubq_mm_mmm64, Psubq_xmm_xmmm128, VEX_Vpsubq_xmm_xmm_xmmm128, VEX_Vpsubq_ymm_ymm_ymmm256, EVEX_Vpsubq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpsubq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpsubq_zmm_k1z_zmm_zmmm512b64, Paddb_mm_mmm64, Paddb_xmm_xmmm128, VEX_Vpaddb_xmm_xmm_xmmm128, VEX_Vpaddb_ymm_ymm_ymmm256, EVEX_Vpaddb_xmm_k1z_xmm_xmmm128, EVEX_Vpaddb_ymm_k1z_ymm_ymmm256, EVEX_Vpaddb_zmm_k1z_zmm_zmmm512, Paddw_mm_mmm64, Paddw_xmm_xmmm128, VEX_Vpaddw_xmm_xmm_xmmm128, VEX_Vpaddw_ymm_ymm_ymmm256, EVEX_Vpaddw_xmm_k1z_xmm_xmmm128, EVEX_Vpaddw_ymm_k1z_ymm_ymmm256, EVEX_Vpaddw_zmm_k1z_zmm_zmmm512, Paddd_mm_mmm64, Paddd_xmm_xmmm128, VEX_Vpaddd_xmm_xmm_xmmm128, VEX_Vpaddd_ymm_ymm_ymmm256, EVEX_Vpaddd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpaddd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpaddd_zmm_k1z_zmm_zmmm512b32, Ud0_r16_rm16, Ud0_r32_rm32, Ud0_r64_rm64, Pshufb_mm_mmm64, Pshufb_xmm_xmmm128, VEX_Vpshufb_xmm_xmm_xmmm128, VEX_Vpshufb_ymm_ymm_ymmm256, EVEX_Vpshufb_xmm_k1z_xmm_xmmm128, EVEX_Vpshufb_ymm_k1z_ymm_ymmm256, EVEX_Vpshufb_zmm_k1z_zmm_zmmm512, Phaddw_mm_mmm64, Phaddw_xmm_xmmm128, VEX_Vphaddw_xmm_xmm_xmmm128, VEX_Vphaddw_ymm_ymm_ymmm256, Phaddd_mm_mmm64, Phaddd_xmm_xmmm128, VEX_Vphaddd_xmm_xmm_xmmm128, VEX_Vphaddd_ymm_ymm_ymmm256, Phaddsw_mm_mmm64, Phaddsw_xmm_xmmm128, VEX_Vphaddsw_xmm_xmm_xmmm128, VEX_Vphaddsw_ymm_ymm_ymmm256, Pmaddubsw_mm_mmm64, Pmaddubsw_xmm_xmmm128, VEX_Vpmaddubsw_xmm_xmm_xmmm128, VEX_Vpmaddubsw_ymm_ymm_ymmm256, EVEX_Vpmaddubsw_xmm_k1z_xmm_xmmm128, EVEX_Vpmaddubsw_ymm_k1z_ymm_ymmm256, EVEX_Vpmaddubsw_zmm_k1z_zmm_zmmm512, Phsubw_mm_mmm64, Phsubw_xmm_xmmm128, VEX_Vphsubw_xmm_xmm_xmmm128, VEX_Vphsubw_ymm_ymm_ymmm256, Phsubd_mm_mmm64, Phsubd_xmm_xmmm128, VEX_Vphsubd_xmm_xmm_xmmm128, VEX_Vphsubd_ymm_ymm_ymmm256, Phsubsw_mm_mmm64, Phsubsw_xmm_xmmm128, VEX_Vphsubsw_xmm_xmm_xmmm128, VEX_Vphsubsw_ymm_ymm_ymmm256, Psignb_mm_mmm64, Psignb_xmm_xmmm128, VEX_Vpsignb_xmm_xmm_xmmm128, VEX_Vpsignb_ymm_ymm_ymmm256, Psignw_mm_mmm64, Psignw_xmm_xmmm128, VEX_Vpsignw_xmm_xmm_xmmm128, VEX_Vpsignw_ymm_ymm_ymmm256, Psignd_mm_mmm64, Psignd_xmm_xmmm128, VEX_Vpsignd_xmm_xmm_xmmm128, VEX_Vpsignd_ymm_ymm_ymmm256, Pmulhrsw_mm_mmm64, Pmulhrsw_xmm_xmmm128, VEX_Vpmulhrsw_xmm_xmm_xmmm128, VEX_Vpmulhrsw_ymm_ymm_ymmm256, EVEX_Vpmulhrsw_xmm_k1z_xmm_xmmm128, EVEX_Vpmulhrsw_ymm_k1z_ymm_ymmm256, EVEX_Vpmulhrsw_zmm_k1z_zmm_zmmm512, VEX_Vpermilps_xmm_xmm_xmmm128, VEX_Vpermilps_ymm_ymm_ymmm256, EVEX_Vpermilps_xmm_k1z_xmm_xmmm128b32, EVEX_Vpermilps_ymm_k1z_ymm_ymmm256b32, EVEX_Vpermilps_zmm_k1z_zmm_zmmm512b32, VEX_Vpermilpd_xmm_xmm_xmmm128, VEX_Vpermilpd_ymm_ymm_ymmm256, EVEX_Vpermilpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vpermilpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vpermilpd_zmm_k1z_zmm_zmmm512b64, VEX_Vtestps_xmm_xmmm128, VEX_Vtestps_ymm_ymmm256, VEX_Vtestpd_xmm_xmmm128, VEX_Vtestpd_ymm_ymmm256, Pblendvb_xmm_xmmm128, EVEX_Vpsrlvw_xmm_k1z_xmm_xmmm128, EVEX_Vpsrlvw_ymm_k1z_ymm_ymmm256, EVEX_Vpsrlvw_zmm_k1z_zmm_zmmm512, EVEX_Vpmovuswb_xmmm64_k1z_xmm, EVEX_Vpmovuswb_xmmm128_k1z_ymm, EVEX_Vpmovuswb_ymmm256_k1z_zmm, EVEX_Vpsravw_xmm_k1z_xmm_xmmm128, EVEX_Vpsravw_ymm_k1z_ymm_ymmm256, EVEX_Vpsravw_zmm_k1z_zmm_zmmm512, EVEX_Vpmovusdb_xmmm32_k1z_xmm, EVEX_Vpmovusdb_xmmm64_k1z_ymm, EVEX_Vpmovusdb_xmmm128_k1z_zmm, EVEX_Vpsllvw_xmm_k1z_xmm_xmmm128, EVEX_Vpsllvw_ymm_k1z_ymm_ymmm256, EVEX_Vpsllvw_zmm_k1z_zmm_zmmm512, EVEX_Vpmovusqb_xmmm16_k1z_xmm, EVEX_Vpmovusqb_xmmm32_k1z_ymm, EVEX_Vpmovusqb_xmmm64_k1z_zmm, VEX_Vcvtph2ps_xmm_xmmm64, VEX_Vcvtph2ps_ymm_xmmm128, EVEX_Vcvtph2ps_xmm_k1z_xmmm64, EVEX_Vcvtph2ps_ymm_k1z_xmmm128, EVEX_Vcvtph2ps_zmm_k1z_ymmm256_sae, EVEX_Vpmovusdw_xmmm64_k1z_xmm, EVEX_Vpmovusdw_xmmm128_k1z_ymm, EVEX_Vpmovusdw_ymmm256_k1z_zmm, Blendvps_xmm_xmmm128, EVEX_Vprorvd_xmm_k1z_xmm_xmmm128b32, EVEX_Vprorvd_ymm_k1z_ymm_ymmm256b32, EVEX_Vprorvd_zmm_k1z_zmm_zmmm512b32, EVEX_Vprorvq_xmm_k1z_xmm_xmmm128b64, EVEX_Vprorvq_ymm_k1z_ymm_ymmm256b64, EVEX_Vprorvq_zmm_k1z_zmm_zmmm512b64, EVEX_Vpmovusqw_xmmm32_k1z_xmm, EVEX_Vpmovusqw_xmmm64_k1z_ymm, EVEX_Vpmovusqw_xmmm128_k1z_zmm, Blendvpd_xmm_xmmm128, EVEX_Vprolvd_xmm_k1z_xmm_xmmm128b32, EVEX_Vprolvd_ymm_k1z_ymm_ymmm256b32, EVEX_Vprolvd_zmm_k1z_zmm_zmmm512b32, EVEX_Vprolvq_xmm_k1z_xmm_xmmm128b64, EVEX_Vprolvq_ymm_k1z_ymm_ymmm256b64, EVEX_Vprolvq_zmm_k1z_zmm_zmmm512b64, EVEX_Vpmovusqd_xmmm64_k1z_xmm, EVEX_Vpmovusqd_xmmm128_k1z_ymm, EVEX_Vpmovusqd_ymmm256_k1z_zmm, VEX_Vpermps_ymm_ymm_ymmm256, EVEX_Vpermps_ymm_k1z_ymm_ymmm256b32, EVEX_Vpermps_zmm_k1z_zmm_zmmm512b32, EVEX_Vpermpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vpermpd_zmm_k1z_zmm_zmmm512b64, Ptest_xmm_xmmm128, VEX_Vptest_xmm_xmmm128, VEX_Vptest_ymm_ymmm256, VEX_Vbroadcastss_xmm_m32, VEX_Vbroadcastss_ymm_m32, EVEX_Vbroadcastss_xmm_k1z_xmmm32, EVEX_Vbroadcastss_ymm_k1z_xmmm32, EVEX_Vbroadcastss_zmm_k1z_xmmm32, VEX_Vbroadcastsd_ymm_m64, EVEX_Vbroadcastf32x2_ymm_k1z_xmmm64, EVEX_Vbroadcastf32x2_zmm_k1z_xmmm64, EVEX_Vbroadcastsd_ymm_k1z_xmmm64, EVEX_Vbroadcastsd_zmm_k1z_xmmm64, VEX_Vbroadcastf128_ymm_m128, EVEX_Vbroadcastf32x4_ymm_k1z_m128, EVEX_Vbroadcastf32x4_zmm_k1z_m128, EVEX_Vbroadcastf64x2_ymm_k1z_m128, EVEX_Vbroadcastf64x2_zmm_k1z_m128, EVEX_Vbroadcastf32x8_zmm_k1z_m256, EVEX_Vbroadcastf64x4_zmm_k1z_m256, Pabsb_mm_mmm64, Pabsb_xmm_xmmm128, VEX_Vpabsb_xmm_xmmm128, VEX_Vpabsb_ymm_ymmm256, EVEX_Vpabsb_xmm_k1z_xmmm128, EVEX_Vpabsb_ymm_k1z_ymmm256, EVEX_Vpabsb_zmm_k1z_zmmm512, Pabsw_mm_mmm64, Pabsw_xmm_xmmm128, VEX_Vpabsw_xmm_xmmm128, VEX_Vpabsw_ymm_ymmm256, EVEX_Vpabsw_xmm_k1z_xmmm128, EVEX_Vpabsw_ymm_k1z_ymmm256, EVEX_Vpabsw_zmm_k1z_zmmm512, Pabsd_mm_mmm64, Pabsd_xmm_xmmm128, VEX_Vpabsd_xmm_xmmm128, VEX_Vpabsd_ymm_ymmm256, EVEX_Vpabsd_xmm_k1z_xmmm128b32, EVEX_Vpabsd_ymm_k1z_ymmm256b32, EVEX_Vpabsd_zmm_k1z_zmmm512b32, EVEX_Vpabsq_xmm_k1z_xmmm128b64, EVEX_Vpabsq_ymm_k1z_ymmm256b64, EVEX_Vpabsq_zmm_k1z_zmmm512b64, Pmovsxbw_xmm_xmmm64, VEX_Vpmovsxbw_xmm_xmmm64, VEX_Vpmovsxbw_ymm_xmmm128, EVEX_Vpmovsxbw_xmm_k1z_xmmm64, EVEX_Vpmovsxbw_ymm_k1z_xmmm128, EVEX_Vpmovsxbw_zmm_k1z_ymmm256, EVEX_Vpmovswb_xmmm64_k1z_xmm, EVEX_Vpmovswb_xmmm128_k1z_ymm, EVEX_Vpmovswb_ymmm256_k1z_zmm, Pmovsxbd_xmm_xmmm32, VEX_Vpmovsxbd_xmm_xmmm32, VEX_Vpmovsxbd_ymm_xmmm64, EVEX_Vpmovsxbd_xmm_k1z_xmmm32, EVEX_Vpmovsxbd_ymm_k1z_xmmm64, EVEX_Vpmovsxbd_zmm_k1z_xmmm128, EVEX_Vpmovsdb_xmmm32_k1z_xmm, EVEX_Vpmovsdb_xmmm64_k1z_ymm, EVEX_Vpmovsdb_xmmm128_k1z_zmm, Pmovsxbq_xmm_xmmm16, VEX_Vpmovsxbq_xmm_xmmm16, VEX_Vpmovsxbq_ymm_xmmm32, EVEX_Vpmovsxbq_xmm_k1z_xmmm16, EVEX_Vpmovsxbq_ymm_k1z_xmmm32, EVEX_Vpmovsxbq_zmm_k1z_xmmm64, EVEX_Vpmovsqb_xmmm16_k1z_xmm, EVEX_Vpmovsqb_xmmm32_k1z_ymm, EVEX_Vpmovsqb_xmmm64_k1z_zmm, Pmovsxwd_xmm_xmmm64, VEX_Vpmovsxwd_xmm_xmmm64, VEX_Vpmovsxwd_ymm_xmmm128, EVEX_Vpmovsxwd_xmm_k1z_xmmm64, EVEX_Vpmovsxwd_ymm_k1z_xmmm128, EVEX_Vpmovsxwd_zmm_k1z_ymmm256, EVEX_Vpmovsdw_xmmm64_k1z_xmm, EVEX_Vpmovsdw_xmmm128_k1z_ymm, EVEX_Vpmovsdw_ymmm256_k1z_zmm, Pmovsxwq_xmm_xmmm32, VEX_Vpmovsxwq_xmm_xmmm32, VEX_Vpmovsxwq_ymm_xmmm64, EVEX_Vpmovsxwq_xmm_k1z_xmmm32, EVEX_Vpmovsxwq_ymm_k1z_xmmm64, EVEX_Vpmovsxwq_zmm_k1z_xmmm128, EVEX_Vpmovsqw_xmmm32_k1z_xmm, EVEX_Vpmovsqw_xmmm64_k1z_ymm, EVEX_Vpmovsqw_xmmm128_k1z_zmm, Pmovsxdq_xmm_xmmm64, VEX_Vpmovsxdq_xmm_xmmm64, VEX_Vpmovsxdq_ymm_xmmm128, EVEX_Vpmovsxdq_xmm_k1z_xmmm64, EVEX_Vpmovsxdq_ymm_k1z_xmmm128, EVEX_Vpmovsxdq_zmm_k1z_ymmm256, EVEX_Vpmovsqd_xmmm64_k1z_xmm, EVEX_Vpmovsqd_xmmm128_k1z_ymm, EVEX_Vpmovsqd_ymmm256_k1z_zmm, EVEX_Vptestmb_kr_k1_xmm_xmmm128, EVEX_Vptestmb_kr_k1_ymm_ymmm256, EVEX_Vptestmb_kr_k1_zmm_zmmm512, EVEX_Vptestmw_kr_k1_xmm_xmmm128, EVEX_Vptestmw_kr_k1_ymm_ymmm256, EVEX_Vptestmw_kr_k1_zmm_zmmm512, EVEX_Vptestnmb_kr_k1_xmm_xmmm128, EVEX_Vptestnmb_kr_k1_ymm_ymmm256, EVEX_Vptestnmb_kr_k1_zmm_zmmm512, EVEX_Vptestnmw_kr_k1_xmm_xmmm128, EVEX_Vptestnmw_kr_k1_ymm_ymmm256, EVEX_Vptestnmw_kr_k1_zmm_zmmm512, EVEX_Vptestmd_kr_k1_xmm_xmmm128b32, EVEX_Vptestmd_kr_k1_ymm_ymmm256b32, EVEX_Vptestmd_kr_k1_zmm_zmmm512b32, EVEX_Vptestmq_kr_k1_xmm_xmmm128b64, EVEX_Vptestmq_kr_k1_ymm_ymmm256b64, EVEX_Vptestmq_kr_k1_zmm_zmmm512b64, EVEX_Vptestnmd_kr_k1_xmm_xmmm128b32, EVEX_Vptestnmd_kr_k1_ymm_ymmm256b32, EVEX_Vptestnmd_kr_k1_zmm_zmmm512b32, EVEX_Vptestnmq_kr_k1_xmm_xmmm128b64, EVEX_Vptestnmq_kr_k1_ymm_ymmm256b64, EVEX_Vptestnmq_kr_k1_zmm_zmmm512b64, Pmuldq_xmm_xmmm128, VEX_Vpmuldq_xmm_xmm_xmmm128, VEX_Vpmuldq_ymm_ymm_ymmm256, EVEX_Vpmuldq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpmuldq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpmuldq_zmm_k1z_zmm_zmmm512b64, EVEX_Vpmovm2b_xmm_kr, EVEX_Vpmovm2b_ymm_kr, EVEX_Vpmovm2b_zmm_kr, EVEX_Vpmovm2w_xmm_kr, EVEX_Vpmovm2w_ymm_kr, EVEX_Vpmovm2w_zmm_kr, Pcmpeqq_xmm_xmmm128, VEX_Vpcmpeqq_xmm_xmm_xmmm128, VEX_Vpcmpeqq_ymm_ymm_ymmm256, EVEX_Vpcmpeqq_kr_k1_xmm_xmmm128b64, EVEX_Vpcmpeqq_kr_k1_ymm_ymmm256b64, EVEX_Vpcmpeqq_kr_k1_zmm_zmmm512b64, EVEX_Vpmovb2m_kr_xmm, EVEX_Vpmovb2m_kr_ymm, EVEX_Vpmovb2m_kr_zmm, EVEX_Vpmovw2m_kr_xmm, EVEX_Vpmovw2m_kr_ymm, EVEX_Vpmovw2m_kr_zmm, Movntdqa_xmm_m128, VEX_Vmovntdqa_xmm_m128, VEX_Vmovntdqa_ymm_m256, EVEX_Vmovntdqa_xmm_m128, EVEX_Vmovntdqa_ymm_m256, EVEX_Vmovntdqa_zmm_m512, EVEX_Vpbroadcastmb2q_xmm_kr, EVEX_Vpbroadcastmb2q_ymm_kr, EVEX_Vpbroadcastmb2q_zmm_kr, Packusdw_xmm_xmmm128, VEX_Vpackusdw_xmm_xmm_xmmm128, VEX_Vpackusdw_ymm_ymm_ymmm256, EVEX_Vpackusdw_xmm_k1z_xmm_xmmm128b32, EVEX_Vpackusdw_ymm_k1z_ymm_ymmm256b32, EVEX_Vpackusdw_zmm_k1z_zmm_zmmm512b32, VEX_Vmaskmovps_xmm_xmm_m128, VEX_Vmaskmovps_ymm_ymm_m256, EVEX_Vscalefps_xmm_k1z_xmm_xmmm128b32, EVEX_Vscalefps_ymm_k1z_ymm_ymmm256b32, EVEX_Vscalefps_zmm_k1z_zmm_zmmm512b32_er, EVEX_Vscalefpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vscalefpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vscalefpd_zmm_k1z_zmm_zmmm512b64_er, VEX_Vmaskmovpd_xmm_xmm_m128, VEX_Vmaskmovpd_ymm_ymm_m256, EVEX_Vscalefss_xmm_k1z_xmm_xmmm32_er, EVEX_Vscalefsd_xmm_k1z_xmm_xmmm64_er, VEX_Vmaskmovps_m128_xmm_xmm, VEX_Vmaskmovps_m256_ymm_ymm, VEX_Vmaskmovpd_m128_xmm_xmm, VEX_Vmaskmovpd_m256_ymm_ymm, Pmovzxbw_xmm_xmmm64, VEX_Vpmovzxbw_xmm_xmmm64, VEX_Vpmovzxbw_ymm_xmmm128, EVEX_Vpmovzxbw_xmm_k1z_xmmm64, EVEX_Vpmovzxbw_ymm_k1z_xmmm128, EVEX_Vpmovzxbw_zmm_k1z_ymmm256, EVEX_Vpmovwb_xmmm64_k1z_xmm, EVEX_Vpmovwb_xmmm128_k1z_ymm, EVEX_Vpmovwb_ymmm256_k1z_zmm, Pmovzxbd_xmm_xmmm32, VEX_Vpmovzxbd_xmm_xmmm32, VEX_Vpmovzxbd_ymm_xmmm64, EVEX_Vpmovzxbd_xmm_k1z_xmmm32, EVEX_Vpmovzxbd_ymm_k1z_xmmm64, EVEX_Vpmovzxbd_zmm_k1z_xmmm128, EVEX_Vpmovdb_xmmm32_k1z_xmm, EVEX_Vpmovdb_xmmm64_k1z_ymm, EVEX_Vpmovdb_xmmm128_k1z_zmm, Pmovzxbq_xmm_xmmm16, VEX_Vpmovzxbq_xmm_xmmm16, VEX_Vpmovzxbq_ymm_xmmm32, EVEX_Vpmovzxbq_xmm_k1z_xmmm16, EVEX_Vpmovzxbq_ymm_k1z_xmmm32, EVEX_Vpmovzxbq_zmm_k1z_xmmm64, EVEX_Vpmovqb_xmmm16_k1z_xmm, EVEX_Vpmovqb_xmmm32_k1z_ymm, EVEX_Vpmovqb_xmmm64_k1z_zmm, Pmovzxwd_xmm_xmmm64, VEX_Vpmovzxwd_xmm_xmmm64, VEX_Vpmovzxwd_ymm_xmmm128, EVEX_Vpmovzxwd_xmm_k1z_xmmm64, EVEX_Vpmovzxwd_ymm_k1z_xmmm128, EVEX_Vpmovzxwd_zmm_k1z_ymmm256, EVEX_Vpmovdw_xmmm64_k1z_xmm, EVEX_Vpmovdw_xmmm128_k1z_ymm, EVEX_Vpmovdw_ymmm256_k1z_zmm, Pmovzxwq_xmm_xmmm32, VEX_Vpmovzxwq_xmm_xmmm32, VEX_Vpmovzxwq_ymm_xmmm64, EVEX_Vpmovzxwq_xmm_k1z_xmmm32, EVEX_Vpmovzxwq_ymm_k1z_xmmm64, EVEX_Vpmovzxwq_zmm_k1z_xmmm128, EVEX_Vpmovqw_xmmm32_k1z_xmm, EVEX_Vpmovqw_xmmm64_k1z_ymm, EVEX_Vpmovqw_xmmm128_k1z_zmm, Pmovzxdq_xmm_xmmm64, VEX_Vpmovzxdq_xmm_xmmm64, VEX_Vpmovzxdq_ymm_xmmm128, EVEX_Vpmovzxdq_xmm_k1z_xmmm64, EVEX_Vpmovzxdq_ymm_k1z_xmmm128, EVEX_Vpmovzxdq_zmm_k1z_ymmm256, EVEX_Vpmovqd_xmmm64_k1z_xmm, EVEX_Vpmovqd_xmmm128_k1z_ymm, EVEX_Vpmovqd_ymmm256_k1z_zmm, VEX_Vpermd_ymm_ymm_ymmm256, EVEX_Vpermd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpermd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpermq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpermq_zmm_k1z_zmm_zmmm512b64, Pcmpgtq_xmm_xmmm128, VEX_Vpcmpgtq_xmm_xmm_xmmm128, VEX_Vpcmpgtq_ymm_ymm_ymmm256, EVEX_Vpcmpgtq_kr_k1_xmm_xmmm128b64, EVEX_Vpcmpgtq_kr_k1_ymm_ymmm256b64, EVEX_Vpcmpgtq_kr_k1_zmm_zmmm512b64, Pminsb_xmm_xmmm128, VEX_Vpminsb_xmm_xmm_xmmm128, VEX_Vpminsb_ymm_ymm_ymmm256, EVEX_Vpminsb_xmm_k1z_xmm_xmmm128, EVEX_Vpminsb_ymm_k1z_ymm_ymmm256, EVEX_Vpminsb_zmm_k1z_zmm_zmmm512, EVEX_Vpmovm2d_xmm_kr, EVEX_Vpmovm2d_ymm_kr, EVEX_Vpmovm2d_zmm_kr, EVEX_Vpmovm2q_xmm_kr, EVEX_Vpmovm2q_ymm_kr, EVEX_Vpmovm2q_zmm_kr, Pminsd_xmm_xmmm128, VEX_Vpminsd_xmm_xmm_xmmm128, VEX_Vpminsd_ymm_ymm_ymmm256, EVEX_Vpminsd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpminsd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpminsd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpminsq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpminsq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpminsq_zmm_k1z_zmm_zmmm512b64, EVEX_Vpmovd2m_kr_xmm, EVEX_Vpmovd2m_kr_ymm, EVEX_Vpmovd2m_kr_zmm, EVEX_Vpmovq2m_kr_xmm, EVEX_Vpmovq2m_kr_ymm, EVEX_Vpmovq2m_kr_zmm, Pminuw_xmm_xmmm128, VEX_Vpminuw_xmm_xmm_xmmm128, VEX_Vpminuw_ymm_ymm_ymmm256, EVEX_Vpminuw_xmm_k1z_xmm_xmmm128, EVEX_Vpminuw_ymm_k1z_ymm_ymmm256, EVEX_Vpminuw_zmm_k1z_zmm_zmmm512, EVEX_Vpbroadcastmw2d_xmm_kr, EVEX_Vpbroadcastmw2d_ymm_kr, EVEX_Vpbroadcastmw2d_zmm_kr, Pminud_xmm_xmmm128, VEX_Vpminud_xmm_xmm_xmmm128, VEX_Vpminud_ymm_ymm_ymmm256, EVEX_Vpminud_xmm_k1z_xmm_xmmm128b32, EVEX_Vpminud_ymm_k1z_ymm_ymmm256b32, EVEX_Vpminud_zmm_k1z_zmm_zmmm512b32, EVEX_Vpminuq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpminuq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpminuq_zmm_k1z_zmm_zmmm512b64, Pmaxsb_xmm_xmmm128, VEX_Vpmaxsb_xmm_xmm_xmmm128, VEX_Vpmaxsb_ymm_ymm_ymmm256, EVEX_Vpmaxsb_xmm_k1z_xmm_xmmm128, EVEX_Vpmaxsb_ymm_k1z_ymm_ymmm256, EVEX_Vpmaxsb_zmm_k1z_zmm_zmmm512, Pmaxsd_xmm_xmmm128, VEX_Vpmaxsd_xmm_xmm_xmmm128, VEX_Vpmaxsd_ymm_ymm_ymmm256, EVEX_Vpmaxsd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpmaxsd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpmaxsd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpmaxsq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpmaxsq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpmaxsq_zmm_k1z_zmm_zmmm512b64, Pmaxuw_xmm_xmmm128, VEX_Vpmaxuw_xmm_xmm_xmmm128, VEX_Vpmaxuw_ymm_ymm_ymmm256, EVEX_Vpmaxuw_xmm_k1z_xmm_xmmm128, EVEX_Vpmaxuw_ymm_k1z_ymm_ymmm256, EVEX_Vpmaxuw_zmm_k1z_zmm_zmmm512, Pmaxud_xmm_xmmm128, VEX_Vpmaxud_xmm_xmm_xmmm128, VEX_Vpmaxud_ymm_ymm_ymmm256, EVEX_Vpmaxud_xmm_k1z_xmm_xmmm128b32, EVEX_Vpmaxud_ymm_k1z_ymm_ymmm256b32, EVEX_Vpmaxud_zmm_k1z_zmm_zmmm512b32, EVEX_Vpmaxuq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpmaxuq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpmaxuq_zmm_k1z_zmm_zmmm512b64, Pmulld_xmm_xmmm128, VEX_Vpmulld_xmm_xmm_xmmm128, VEX_Vpmulld_ymm_ymm_ymmm256, EVEX_Vpmulld_xmm_k1z_xmm_xmmm128b32, EVEX_Vpmulld_ymm_k1z_ymm_ymmm256b32, EVEX_Vpmulld_zmm_k1z_zmm_zmmm512b32, EVEX_Vpmullq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpmullq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpmullq_zmm_k1z_zmm_zmmm512b64, Phminposuw_xmm_xmmm128, VEX_Vphminposuw_xmm_xmmm128, EVEX_Vgetexpps_xmm_k1z_xmmm128b32, EVEX_Vgetexpps_ymm_k1z_ymmm256b32, EVEX_Vgetexpps_zmm_k1z_zmmm512b32_sae, EVEX_Vgetexppd_xmm_k1z_xmmm128b64, EVEX_Vgetexppd_ymm_k1z_ymmm256b64, EVEX_Vgetexppd_zmm_k1z_zmmm512b64_sae, EVEX_Vgetexpss_xmm_k1z_xmm_xmmm32_sae, EVEX_Vgetexpsd_xmm_k1z_xmm_xmmm64_sae, EVEX_Vplzcntd_xmm_k1z_xmmm128b32, EVEX_Vplzcntd_ymm_k1z_ymmm256b32, EVEX_Vplzcntd_zmm_k1z_zmmm512b32, EVEX_Vplzcntq_xmm_k1z_xmmm128b64, EVEX_Vplzcntq_ymm_k1z_ymmm256b64, EVEX_Vplzcntq_zmm_k1z_zmmm512b64, VEX_Vpsrlvd_xmm_xmm_xmmm128, VEX_Vpsrlvd_ymm_ymm_ymmm256, VEX_Vpsrlvq_xmm_xmm_xmmm128, VEX_Vpsrlvq_ymm_ymm_ymmm256, EVEX_Vpsrlvd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpsrlvd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpsrlvd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpsrlvq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpsrlvq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpsrlvq_zmm_k1z_zmm_zmmm512b64, VEX_Vpsravd_xmm_xmm_xmmm128, VEX_Vpsravd_ymm_ymm_ymmm256, EVEX_Vpsravd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpsravd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpsravd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpsravq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpsravq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpsravq_zmm_k1z_zmm_zmmm512b64, VEX_Vpsllvd_xmm_xmm_xmmm128, VEX_Vpsllvd_ymm_ymm_ymmm256, VEX_Vpsllvq_xmm_xmm_xmmm128, VEX_Vpsllvq_ymm_ymm_ymmm256, EVEX_Vpsllvd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpsllvd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpsllvd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpsllvq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpsllvq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpsllvq_zmm_k1z_zmm_zmmm512b64, EVEX_Vrcp14ps_xmm_k1z_xmmm128b32, EVEX_Vrcp14ps_ymm_k1z_ymmm256b32, EVEX_Vrcp14ps_zmm_k1z_zmmm512b32, EVEX_Vrcp14pd_xmm_k1z_xmmm128b64, EVEX_Vrcp14pd_ymm_k1z_ymmm256b64, EVEX_Vrcp14pd_zmm_k1z_zmmm512b64, EVEX_Vrcp14ss_xmm_k1z_xmm_xmmm32, EVEX_Vrcp14sd_xmm_k1z_xmm_xmmm64, EVEX_Vrsqrt14ps_xmm_k1z_xmmm128b32, EVEX_Vrsqrt14ps_ymm_k1z_ymmm256b32, EVEX_Vrsqrt14ps_zmm_k1z_zmmm512b32, EVEX_Vrsqrt14pd_xmm_k1z_xmmm128b64, EVEX_Vrsqrt14pd_ymm_k1z_ymmm256b64, EVEX_Vrsqrt14pd_zmm_k1z_zmmm512b64, EVEX_Vrsqrt14ss_xmm_k1z_xmm_xmmm32, EVEX_Vrsqrt14sd_xmm_k1z_xmm_xmmm64, EVEX_Vpdpbusd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpdpbusd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpdpbusd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpdpbusds_xmm_k1z_xmm_xmmm128b32, EVEX_Vpdpbusds_ymm_k1z_ymm_ymmm256b32, EVEX_Vpdpbusds_zmm_k1z_zmm_zmmm512b32, EVEX_Vpdpwssd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpdpwssd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpdpwssd_zmm_k1z_zmm_zmmm512b32, EVEX_Vdpbf16ps_xmm_k1z_xmm_xmmm128b32, EVEX_Vdpbf16ps_ymm_k1z_ymm_ymmm256b32, EVEX_Vdpbf16ps_zmm_k1z_zmm_zmmm512b32, EVEX_Vp4dpwssd_zmm_k1z_zmmp3_m128, EVEX_Vpdpwssds_xmm_k1z_xmm_xmmm128b32, EVEX_Vpdpwssds_ymm_k1z_ymm_ymmm256b32, EVEX_Vpdpwssds_zmm_k1z_zmm_zmmm512b32, EVEX_Vp4dpwssds_zmm_k1z_zmmp3_m128, EVEX_Vpopcntb_xmm_k1z_xmmm128, EVEX_Vpopcntb_ymm_k1z_ymmm256, EVEX_Vpopcntb_zmm_k1z_zmmm512, EVEX_Vpopcntw_xmm_k1z_xmmm128, EVEX_Vpopcntw_ymm_k1z_ymmm256, EVEX_Vpopcntw_zmm_k1z_zmmm512, EVEX_Vpopcntd_xmm_k1z_xmmm128b32, EVEX_Vpopcntd_ymm_k1z_ymmm256b32, EVEX_Vpopcntd_zmm_k1z_zmmm512b32, EVEX_Vpopcntq_xmm_k1z_xmmm128b64, EVEX_Vpopcntq_ymm_k1z_ymmm256b64, EVEX_Vpopcntq_zmm_k1z_zmmm512b64, VEX_Vpbroadcastd_xmm_xmmm32, VEX_Vpbroadcastd_ymm_xmmm32, EVEX_Vpbroadcastd_xmm_k1z_xmmm32, EVEX_Vpbroadcastd_ymm_k1z_xmmm32, EVEX_Vpbroadcastd_zmm_k1z_xmmm32, VEX_Vpbroadcastq_xmm_xmmm64, VEX_Vpbroadcastq_ymm_xmmm64, EVEX_Vbroadcasti32x2_xmm_k1z_xmmm64, EVEX_Vbroadcasti32x2_ymm_k1z_xmmm64, EVEX_Vbroadcasti32x2_zmm_k1z_xmmm64, EVEX_Vpbroadcastq_xmm_k1z_xmmm64, EVEX_Vpbroadcastq_ymm_k1z_xmmm64, EVEX_Vpbroadcastq_zmm_k1z_xmmm64, VEX_Vbroadcasti128_ymm_m128, EVEX_Vbroadcasti32x4_ymm_k1z_m128, EVEX_Vbroadcasti32x4_zmm_k1z_m128, EVEX_Vbroadcasti64x2_ymm_k1z_m128, EVEX_Vbroadcasti64x2_zmm_k1z_m128, EVEX_Vbroadcasti32x8_zmm_k1z_m256, EVEX_Vbroadcasti64x4_zmm_k1z_m256, EVEX_Vpexpandb_xmm_k1z_xmmm128, EVEX_Vpexpandb_ymm_k1z_ymmm256, EVEX_Vpexpandb_zmm_k1z_zmmm512, EVEX_Vpexpandw_xmm_k1z_xmmm128, EVEX_Vpexpandw_ymm_k1z_ymmm256, EVEX_Vpexpandw_zmm_k1z_zmmm512, EVEX_Vpcompressb_xmmm128_k1z_xmm, EVEX_Vpcompressb_ymmm256_k1z_ymm, EVEX_Vpcompressb_zmmm512_k1z_zmm, EVEX_Vpcompressw_xmmm128_k1z_xmm, EVEX_Vpcompressw_ymmm256_k1z_ymm, EVEX_Vpcompressw_zmmm512_k1z_zmm, EVEX_Vpblendmd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpblendmd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpblendmd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpblendmq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpblendmq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpblendmq_zmm_k1z_zmm_zmmm512b64, EVEX_Vblendmps_xmm_k1z_xmm_xmmm128b32, EVEX_Vblendmps_ymm_k1z_ymm_ymmm256b32, EVEX_Vblendmps_zmm_k1z_zmm_zmmm512b32, EVEX_Vblendmpd_xmm_k1z_xmm_xmmm128b64, EVEX_Vblendmpd_ymm_k1z_ymm_ymmm256b64, EVEX_Vblendmpd_zmm_k1z_zmm_zmmm512b64, EVEX_Vpblendmb_xmm_k1z_xmm_xmmm128, EVEX_Vpblendmb_ymm_k1z_ymm_ymmm256, EVEX_Vpblendmb_zmm_k1z_zmm_zmmm512, EVEX_Vpblendmw_xmm_k1z_xmm_xmmm128, EVEX_Vpblendmw_ymm_k1z_ymm_ymmm256, EVEX_Vpblendmw_zmm_k1z_zmm_zmmm512, EVEX_Vp2intersectd_kp1_xmm_xmmm128b32, EVEX_Vp2intersectd_kp1_ymm_ymmm256b32, EVEX_Vp2intersectd_kp1_zmm_zmmm512b32, EVEX_Vp2intersectq_kp1_xmm_xmmm128b64, EVEX_Vp2intersectq_kp1_ymm_ymmm256b64, EVEX_Vp2intersectq_kp1_zmm_zmmm512b64, EVEX_Vpshldvw_xmm_k1z_xmm_xmmm128, EVEX_Vpshldvw_ymm_k1z_ymm_ymmm256, EVEX_Vpshldvw_zmm_k1z_zmm_zmmm512, EVEX_Vpshldvd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpshldvd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpshldvd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpshldvq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpshldvq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpshldvq_zmm_k1z_zmm_zmmm512b64, EVEX_Vpshrdvw_xmm_k1z_xmm_xmmm128, EVEX_Vpshrdvw_ymm_k1z_ymm_ymmm256, EVEX_Vpshrdvw_zmm_k1z_zmm_zmmm512, EVEX_Vcvtneps2bf16_xmm_k1z_xmmm128b32, EVEX_Vcvtneps2bf16_xmm_k1z_ymmm256b32, EVEX_Vcvtneps2bf16_ymm_k1z_zmmm512b32, EVEX_Vcvtne2ps2bf16_xmm_k1z_xmm_xmmm128b32, EVEX_Vcvtne2ps2bf16_ymm_k1z_ymm_ymmm256b32, EVEX_Vcvtne2ps2bf16_zmm_k1z_zmm_zmmm512b32, EVEX_Vpshrdvd_xmm_k1z_xmm_xmmm128b32, EVEX_Vpshrdvd_ymm_k1z_ymm_ymmm256b32, EVEX_Vpshrdvd_zmm_k1z_zmm_zmmm512b32, EVEX_Vpshrdvq_xmm_k1z_xmm_xmmm128b64, EVEX_Vpshrdvq_ymm_k1z_ymm_ymmm256b64, EVEX_Vpshrdvq_zmm_k1z_zmm_zmmm512b64, EVEX_Vpermi2b_xmm_k1z_xmm_xmmm128, EVEX_Vpermi2b_ymm_k1z_ymm_ymmm256, EVEX_Vpermi2b_zmm_k1z_zmm_zmmm512, EVEX_Vpermi2w_xmm_k1z_xmm_xmmm128, EVEX_Vpermi2w_ymm_k1z_ymm_ymmm256, EVEX_Vpermi2w_zmm_k1z_zmm_zmmm512, EVEX_Vpermi2d_xmm_k1z_xmm_xmmm128b32, EVEX_Vpermi2d_ymm_k1z_ymm_ymmm256b32, EVEX_Vpermi2d_zmm_k1z_zmm_zmmm512b32, EVEX_Vpermi2q_xmm_k1z_xmm_xmmm128b64, EVEX_Vpermi2q_ymm_k1z_ymm_ymmm256b64, EVEX_Vpermi2q_zmm_k1z_zmm_zmmm512b64, EVEX_Vpermi2ps_xmm_k1z_xmm_xmmm128b32, EVEX_Vpermi2ps_ymm_k1z_ymm_ymmm256b32, EVEX_Vpermi2ps_zmm_k1z_zmm_zmmm512b32, EVEX_Vpermi2pd_xmm_k1z_xmm_xmmm128b64, EVEX_Vpermi2pd_ymm_k1z_ymm_ymmm256b64, EVEX_Vpermi2pd_zmm_k1z_zmm_zmmm512b64, VEX_Vpbroadcastb_xmm_xmmm8, VEX_Vpbroadcastb_ymm_xmmm8, EVEX_Vpbroadcastb_xmm_k1z_xmmm8, EVEX_Vpbroadcastb_ymm_k1z_xmmm8, EVEX_Vpbroadcastb_zmm_k1z_xmmm8, VEX_Vpbroadcastw_xmm_xmmm16, VEX_Vpbroadcastw_ymm_xmmm16, EVEX_Vpbroadcastw_xmm_k1z_xmmm16, EVEX_Vpbroadcastw_ymm_k1z_xmmm16, EVEX_Vpbroadcastw_zmm_k1z_xmmm16, EVEX_Vpbroadcastb_xmm_k1z_r32, EVEX_Vpbroadcastb_ymm_k1z_r32, EVEX_Vpbroadcastb_zmm_k1z_r32, EVEX_Vpbroadcastw_xmm_k1z_r32, EVEX_Vpbroadcastw_ymm_k1z_r32, EVEX_Vpbroadcastw_zmm_k1z_r32, EVEX_Vpbroadcastd_xmm_k1z_r32, EVEX_Vpbroadcastd_ymm_k1z_r32, EVEX_Vpbroadcastd_zmm_k1z_r32, EVEX_Vpbroadcastq_xmm_k1z_r64, EVEX_Vpbroadcastq_ymm_k1z_r64, EVEX_Vpbroadcastq_zmm_k1z_r64, EVEX_Vpermt2b_xmm_k1z_xmm_xmmm128, EVEX_Vpermt2b_ymm_k1z_ymm_ymmm256, EVEX_Vpermt2b_zmm_k1z_zmm_zmmm512, EVEX_Vpermt2w_xmm_k1z_xmm_xmmm128, EVEX_Vpermt2w_ymm_k1z_ymm_ymmm256, EVEX_Vpermt2w_zmm_k1z_zmm_zmmm512, EVEX_Vpermt2d_xmm_k1z_xmm_xmmm128b32, EVEX_Vpermt2d_ymm_k1z_ymm_ymmm256b32, EVEX_Vpermt2d_zmm_k1z_zmm_zmmm512b32, EVEX_Vpermt2q_xmm_k1z_xmm_xmmm128b64, EVEX_Vpermt2q_ymm_k1z_ymm_ymmm256b64, EVEX_Vpermt2q_zmm_k1z_zmm_zmmm512b64, EVEX_Vpermt2ps_xmm_k1z_xmm_xmmm128b32, EVEX_Vpermt2ps_ymm_k1z_ymm_ymmm256b32, EVEX_Vpermt2ps_zmm_k1z_zmm_zmmm512b32, EVEX_Vpermt2pd_xmm_k1z_xmm_xmmm128b64, EVEX_Vpermt2pd_ymm_k1z_ymm_ymmm256b64, EVEX_Vpermt2pd_zmm_k1z_zmm_zmmm512b64, Invept_r32_m128, Invept_r64_m128, Invvpid_r32_m128, Invvpid_r64_m128, Invpcid_r32_m128, Invpcid_r64_m128, EVEX_Vpmultishiftqb_xmm_k1z_xmm_xmmm128b64, EVEX_Vpmultishiftqb_ymm_k1z_ymm_ymmm256b64, EVEX_Vpmultishiftqb_zmm_k1z_zmm_zmmm512b64, EVEX_Vexpandps_xmm_k1z_xmmm128, EVEX_Vexpandps_ymm_k1z_ymmm256, EVEX_Vexpandps_zmm_k1z_zmmm512, EVEX_Vexpandpd_xmm_k1z_xmmm128, EVEX_Vexpandpd_ymm_k1z_ymmm256, EVEX_Vexpandpd_zmm_k1z_zmmm512, EVEX_Vpexpandd_xmm_k1z_xmmm128, EVEX_Vpexpandd_ymm_k1z_ymmm256, EVEX_Vpexpandd_zmm_k1z_zmmm512, EVEX_Vpexpandq_xmm_k1z_xmmm128, EVEX_Vpexpandq_ymm_k1z_ymmm256, EVEX_Vpexpandq_zmm_k1z_zmmm512, EVEX_Vcompressps_xmmm128_k1z_xmm, EVEX_Vcompressps_ymmm256_k1z_ymm, EVEX_Vcompressps_zmmm512_k1z_zmm, EVEX_Vcompresspd_xmmm128_k1z_xmm, EVEX_Vcompresspd_ymmm256_k1z_ymm, EVEX_Vcompresspd_zmmm512_k1z_zmm, EVEX_Vpcompressd_xmmm128_k1z_xmm, EVEX_Vpcompressd_ymmm256_k1z_ymm, EVEX_Vpcompressd_zmmm512_k1z_zmm, EVEX_Vpcompressq_xmmm128_k1z_xmm, EVEX_Vpcompressq_ymmm256_k1z_ymm, EVEX_Vpcompressq_zmmm512_k1z_zmm, VEX_Vpmaskmovd_xmm_xmm_m128, VEX_Vpmaskmovd_ymm_ymm_m256, VEX_Vpmaskmovq_xmm_xmm_m128, VEX_Vpmaskmovq_ymm_ymm_m256, EVEX_Vpermb_xmm_k1z_xmm_xmmm128, EVEX_Vpermb_ymm_k1z_ymm_ymmm256, EVEX_Vpermb_zmm_k1z_zmm_zmmm512, EVEX_Vpermw_xmm_k1z_xmm_xmmm128, EVEX_Vpermw_ymm_k1z_ymm_ymmm256, EVEX_Vpermw_zmm_k1z_zmm_zmmm512, VEX_Vpmaskmovd_m128_xmm_xmm, VEX_Vpmaskmovd_m256_ymm_ymm, VEX_Vpmaskmovq_m128_xmm_xmm, VEX_Vpmaskmovq_m256_ymm_ymm, EVEX_Vpshufbitqmb_kr_k1_xmm_xmmm128, EVEX_Vpshufbitqmb_kr_k1_ymm_ymmm256, EVEX_Vpshufbitqmb_kr_k1_zmm_zmmm512, VEX_Vpgatherdd_xmm_vm32x_xmm, VEX_Vpgatherdd_ymm_vm32y_ymm, VEX_Vpgatherdq_xmm_vm32x_xmm, VEX_Vpgatherdq_ymm_vm32x_ymm, EVEX_Vpgatherdd_xmm_k1_vm32x, EVEX_Vpgatherdd_ymm_k1_vm32y, EVEX_Vpgatherdd_zmm_k1_vm32z, EVEX_Vpgatherdq_xmm_k1_vm32x, EVEX_Vpgatherdq_ymm_k1_vm32x, EVEX_Vpgatherdq_zmm_k1_vm32y, VEX_Vpgatherqd_xmm_vm64x_xmm, VEX_Vpgatherqd_xmm_vm64y_xmm, VEX_Vpgatherqq_xmm_vm64x_xmm, VEX_Vpgatherqq_ymm_vm64y_ymm, EVEX_Vpgatherqd_xmm_k1_vm64x, EVEX_Vpgatherqd_xmm_k1_vm64y, EVEX_Vpgatherqd_ymm_k1_vm64z, EVEX_Vpgatherqq_xmm_k1_vm64x, EVEX_Vpgatherqq_ymm_k1_vm64y, EVEX_Vpgatherqq_zmm_k1_vm64z, VEX_Vgatherdps_xmm_vm32x_xmm, VEX_Vgatherdps_ymm_vm32y_ymm, VEX_Vgatherdpd_xmm_vm32x_xmm, VEX_Vgatherdpd_ymm_vm32x_ymm, EVEX_Vgatherdps_xmm_k1_vm32x, EVEX_Vgatherdps_ymm_k1_vm32y, EVEX_Vgatherdps_zmm_k1_vm32z, EVEX_Vgatherdpd_xmm_k1_vm32x, EVEX_Vgatherdpd_ymm_k1_vm32x, EVEX_Vgatherdpd_zmm_k1_vm32y, VEX_Vgatherqps_xmm_vm64x_xmm, VEX_Vgatherqps_xmm_vm64y_xmm, VEX_Vgatherqpd_xmm_vm64x_xmm, VEX_Vgatherqpd_ymm_vm64y_ymm, EVEX_Vgatherqps_xmm_k1_vm64x, EVEX_Vgatherqps_xmm_k1_vm64y, EVEX_Vgatherqps_ymm_k1_vm64z, EVEX_Vgatherqpd_xmm_k1_vm64x, EVEX_Vgatherqpd_ymm_k1_vm64y, EVEX_Vgatherqpd_zmm_k1_vm64z, VEX_Vfmaddsub132ps_xmm_xmm_xmmm128, VEX_Vfmaddsub132ps_ymm_ymm_ymmm256, VEX_Vfmaddsub132pd_xmm_xmm_xmmm128, VEX_Vfmaddsub132pd_ymm_ymm_ymmm256, EVEX_Vfmaddsub132ps_xmm_k1z_xmm_xmmm128b32, EVEX_Vfmaddsub132ps_ymm_k1z_ymm_ymmm256b32, EVEX_Vfmaddsub132ps_zmm_k1z_zmm_zmmm512b32_er, EVEX_Vfmaddsub132pd_xmm_k1z_xmm_xmmm128b64, EVEX_Vfmaddsub132pd_ymm_k1z_ymm_ymmm256b64, EVEX_Vfmaddsub132pd_zmm_k1z_zmm_zmmm512b64_er, VEX_Vfmsubadd132ps_xmm_xmm_xmmm128, VEX_Vfmsubadd132ps_ymm_ymm_ymmm256, VEX_Vfmsubadd132pd_xmm_xmm_xmmm128, VEX_Vfmsubadd132pd_ymm_ymm_ymmm256, EVEX_Vfmsubadd132ps_xmm_k1z_xmm_xmmm128b32, EVEX_Vfmsubadd132ps_ymm_k1z_ymm_ymmm256b32, EVEX_Vfmsubadd132ps_zmm_k1z_zmm_zmmm512b32_er, EVEX_Vfmsubadd132pd_xmm_k1z_xmm_xmmm128b64, EVEX_Vfmsubadd132pd_ymm_k1z_ymm_ymmm256b64, EVEX_Vfmsubadd132pd_zmm_k1z_zmm_zmmm512b64_er, VEX_Vfmadd132ps_xmm_xmm_xmmm128, VEX_Vfmadd132ps_ymm_ymm_ymmm256, VEX_Vfmadd132pd_xmm_xmm_xmmm128, VEX_Vfmadd132pd_ymm_ymm_ymmm256, EVEX_Vfmadd132ps_xmm_k1z_xmm_xmmm128b32, EVEX_Vfmadd132ps_ymm_k1z_ymm_ymmm256b32, EVEX_Vfmadd132ps_zmm_k1z_zmm_zmmm512b32_er, EVEX_Vfmadd132pd_xmm_k1z_xmm_xmmm128b64, EVEX_Vfmadd132pd_ymm_k1z_ymm_ymmm256b64, EVEX_Vfmadd132pd_zmm_k1z_zmm_zmmm512b64_er, VEX_Vfmadd132ss_xmm_xmm_xmmm32, VEX_Vfmadd132sd_xmm_xmm_xmmm64, EVEX_Vfmadd132ss_xmm_k1z_xmm_xmmm32_er, EVEX_Vfmadd132sd_xmm_k1z_xmm_xmmm64_er, VEX_Vfmsub132ps_xmm_xmm_xmmm128, VEX_Vfmsub132ps_ymm_ymm_ymmm256, VEX_Vfmsub132pd_xmm_xmm_xmmm128, VEX_Vfmsub132pd_ymm_ymm_ymmm256, EVEX_Vfmsub132ps_xmm_k1z_xmm_xmmm128b32, EVEX_Vfmsub132ps_ymm_k1z_ymm_ymmm256b32, EVEX_Vfmsub132ps_zmm_k1z_zmm_zmmm512b32_er, EVEX_Vfmsub132pd_xmm_k1z_xmm_xmmm128b64, EVEX_Vfmsub132pd_ymm_k1z_ymm_ymmm256b64, EVEX_Vfmsub132pd_zmm_k1z_zmm_zmmm512b64_er, EVEX_V4fmaddps_zmm_k1z_zmmp3_m128, VEX_Vfmsub132ss_xmm_xmm_xmmm32, VEX_Vfmsub132sd_xmm_xmm_xmmm64, EVEX_Vfmsub132ss_xmm_k1z_xmm_xmmm32_er, EVEX_Vfmsub132sd_xmm_k1z_xmm_xmmm64_er, EVEX_V4fmaddss_xmm_k1z_xmmp3_m128, VEX_Vfnmadd132ps_xmm_xmm_xmmm128, VEX_Vfnmadd132ps_ymm_ymm_ymmm256, VEX_Vfnmadd132pd_xmm_xmm_xmmm128, VEX_Vfnmadd132pd_ymm_ymm_ymmm256, EVEX_Vfnmadd132ps_xmm_k1z_xmm_xmmm128b32, EVEX_Vfnmadd132ps_ymm_k1z_ymm_ymmm256b32, EVEX_Vfnmadd132ps_zmm_k1z_zmm_zmmm512b32_er, EVEX_Vfnmadd132pd_xmm_k1z_xmm_xmmm128b64, EVEX_Vfnmadd132pd_ymm_k1z_ymm_ymmm256b64, EVEX_Vfnmadd132pd_zmm_k1z_zmm_zmmm512b64_er, VEX_Vfnmadd132ss_xmm_xmm_xmmm32, VEX_Vfnmadd132sd_xmm_xmm_xmmm64, EVEX_Vfnmadd132ss_xmm_k1z_xmm_xmmm32_er, EVEX_Vfnmadd132sd_xmm_k1z_xmm_xmmm64_er, VEX_Vfnmsub132ps_xmm_xmm_xmmm128, VEX_Vfnmsub132ps_ymm_ymm_ymmm256, VEX_Vfnmsub132pd_xmm_xmm_xmmm128, VEX_Vfnmsub132pd_ymm_ymm_ymmm256, EVEX_Vfnmsub132ps_xmm_k1z_xmm_xmmm128b32, EVEX_Vfnmsub132ps_ymm_k1z_ymm_ymmm256b32, EVEX_Vfnmsub132ps_zmm_k1z_zmm_zmmm512b32_er, EVEX_Vfnmsub132pd_xmm_k1z_xmm_xmmm128b64, EVEX_Vfnmsub132pd_ymm_k1z_ymm_ymmm256b64, EVEX_Vfnmsub132pd_zmm_k1z_zmm_zmmm512b64_er, VEX_Vfnmsub132ss_xmm_xmm_xmmm32, VEX_Vfnmsub132sd_xmm_xmm_xmmm64, EVEX_Vfnmsub132ss_xmm_k1z_xmm_xmmm32_er, EVEX_Vfnmsub132sd_xmm_k1z_xmm_xmmm64_er, EVEX_Vpscatterdd_vm32x_k1_xmm, EVEX_Vpscatterdd_vm32y_k1_ymm, EVEX_Vpscatterdd_vm32z_k1_zmm, EVEX_Vpscatterdq_vm32x_k1_xmm, EVEX_Vpscatterdq_vm32x_k1_ymm, EVEX_Vpscatterdq_vm32y_k1_zmm, EVEX_Vpscatterqd_vm64x_k1_xmm, EVEX_Vpscatterqd_vm64y_k1_xmm, EVEX_Vpscatterqd_vm64z_k1_ymm, EVEX_Vpscatterqq_vm64x_k1_xmm, EVEX_Vpscatterqq_vm64y_k1_ymm, EVEX_Vpscatterqq_vm64z_k1_zmm, EVEX_Vscatterdps_vm32x_k1_xmm, EVEX_Vscatterdps_vm32y_k1_ymm, EVEX_Vscatterdps_vm32z_k1_zmm, EVEX_Vscatterdpd_vm32x_k1_xmm, EVEX_Vscatterdpd_vm32x_k1_ymm, EVEX_Vscatterdpd_vm32y_k1_zmm, EVEX_Vscatterqps_vm64x_k1_xmm, EVEX_Vscatterqps_vm64y_k1_xmm, EVEX_V
plugins/StylePixelator/StylePixelator.dll
Decompiled a day agousing 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 BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using PluginConfig.API; using PluginConfig.API.Fields; using StylePixelator.patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("StylePixelator")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("StylePixelator")] [assembly: AssemblyTitle("StylePixelator")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 StylePixelator { public enum Difficulty { Easy, Normal, Hard, Extreme, ScreenMustDie } public enum Style { D, C, B, A, S, SS, SSS, ULTRAKILL } public enum PixelationLevel { OhGod = 6, ReallyHeavy = 5, Heavy = 4, Mid = 3, LessMid = 2, Lean = 1, NoPixelation = 0 } public static class DifficultyTable { public static readonly Dictionary<Difficulty, Dictionary<Style, PixelationLevel>> Table = new Dictionary<Difficulty, Dictionary<Style, PixelationLevel>> { { Difficulty.Easy, new Dictionary<Style, PixelationLevel> { { Style.D, PixelationLevel.ReallyHeavy }, { Style.C, PixelationLevel.Heavy }, { Style.B, PixelationLevel.Mid }, { Style.A, PixelationLevel.LessMid }, { Style.S, PixelationLevel.LessMid }, { Style.SS, PixelationLevel.Lean }, { Style.SSS, PixelationLevel.NoPixelation }, { Style.ULTRAKILL, PixelationLevel.NoPixelation } } }, { Difficulty.Normal, new Dictionary<Style, PixelationLevel> { { Style.D, PixelationLevel.OhGod }, { Style.C, PixelationLevel.ReallyHeavy }, { Style.B, PixelationLevel.Heavy }, { Style.A, PixelationLevel.Heavy }, { Style.S, PixelationLevel.Mid }, { Style.SS, PixelationLevel.LessMid }, { Style.SSS, PixelationLevel.Lean }, { Style.ULTRAKILL, PixelationLevel.NoPixelation } } }, { Difficulty.Hard, new Dictionary<Style, PixelationLevel> { { Style.D, PixelationLevel.OhGod }, { Style.C, PixelationLevel.OhGod }, { Style.B, PixelationLevel.ReallyHeavy }, { Style.A, PixelationLevel.Heavy }, { Style.S, PixelationLevel.Heavy }, { Style.SS, PixelationLevel.Mid }, { Style.SSS, PixelationLevel.LessMid }, { Style.ULTRAKILL, PixelationLevel.Lean } } }, { Difficulty.Extreme, new Dictionary<Style, PixelationLevel> { { Style.D, PixelationLevel.OhGod }, { Style.C, PixelationLevel.OhGod }, { Style.B, PixelationLevel.OhGod }, { Style.A, PixelationLevel.ReallyHeavy }, { Style.S, PixelationLevel.ReallyHeavy }, { Style.SS, PixelationLevel.Heavy }, { Style.SSS, PixelationLevel.Mid }, { Style.ULTRAKILL, PixelationLevel.LessMid } } }, { Difficulty.ScreenMustDie, new Dictionary<Style, PixelationLevel> { { Style.D, PixelationLevel.OhGod }, { Style.C, PixelationLevel.OhGod }, { Style.B, PixelationLevel.OhGod }, { Style.A, PixelationLevel.OhGod }, { Style.S, PixelationLevel.OhGod }, { Style.SS, PixelationLevel.OhGod }, { Style.SSS, PixelationLevel.ReallyHeavy }, { Style.ULTRAKILL, PixelationLevel.LessMid } } } }; } [BepInPlugin("com.d4navi0.StylePixelator", "Style Pixelator", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class StylePixelator : BaseUnityPlugin { internal class StylePixelatorInfo { internal const string NAME = "Style Pixelator"; internal const string GUID = "com.d4navi0.StylePixelator"; internal const string VERSION = "1.0.0"; } internal static ManualLogSource Logger; private readonly Harmony harmony = new Harmony("com.d4navi0.StylePixelator"); internal static PluginConfigurator config; private void Awake() { //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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0093: 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) Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"youre gonna have a bad time"); harmony.PatchAll(); config = PluginConfigurator.Create("Style Pixelator", "com.d4navi0.StylePixelator"); string path = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "hesD.png"); if (File.Exists(path)) { byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2); if (ImageConversion.LoadImage(val, array)) { Sprite image = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); config.image = image; } } BoolField val2 = new BoolField(config.rootPanel, "Mod enabled", "enabled", true); StyleHUD_Update_Patch.enabled = val2.value; ConfigDivision mainPanel = new ConfigDivision(config.rootPanel, "division"); val2.onValueChange += (BoolValueChangeEventDelegate)delegate(BoolValueChangeEvent e) { ((ConfigField)mainPanel).interactable = e.value; StyleHUD_Update_Patch.enabled = e.value; }; EnumField<Difficulty> obj = new EnumField<Difficulty>(config.rootPanel, "Difficulty", "difficulty", Difficulty.Normal); obj.SetEnumDisplayName(Difficulty.Extreme, "i wouldnt pick this if i were you"); obj.SetEnumDisplayName(Difficulty.ScreenMustDie, "Screen Resolution Must Die"); StyleHUD_Update_Patch.difficulty = obj.value; obj.onValueChange += delegate(EnumValueChangeEvent<Difficulty> e) { StyleHUD_Update_Patch.difficulty = e.value; }; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "StylePixelator"; public const string PLUGIN_NAME = "StylePixelator"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace StylePixelator.patches { [HarmonyPatch(typeof(StyleHUD), "Update")] public class StyleHUD_Update_Patch { private static int lastRank = -1; public static Difficulty difficulty = Difficulty.ScreenMustDie; public static bool enabled = false; private static bool lastEnabled = false; [HarmonyPostfix] private static void Postfix(StyleHUD __instance) { if ((Object)(object)__instance == (Object)null) { return; } if (!enabled) { if (!lastEnabled) { return; } lastEnabled = enabled; int num = MonoSingleton<PrefsManager>.Instance.GetInt("pixelization", 0); Traverse.Create((object)MonoSingleton<PostProcessV2_Handler>.Instance).Method("SetPixelization", new object[1] { num }).GetValue(); } lastEnabled = enabled; ApplyDynamicDownscale(__instance.rankIndex); } private static void ApplyDynamicDownscale(int rank) { PixelationLevel pixelationLevel = DifficultyTable.Table[difficulty][(Style)rank]; Traverse.Create((object)MonoSingleton<PostProcessV2_Handler>.Instance).Method("SetPixelization", new object[1] { (int)pixelationLevel }).GetValue(); } } }
plugins/StylePixelator/System.ValueTuple.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using FxResources.System.ValueTuple; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [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")] [assembly: TypeForwardedTo(typeof(TupleElementNamesAttribute))] [assembly: TypeForwardedTo(typeof(TupleExtensions))] [assembly: TypeForwardedTo(typeof(ValueTuple))] [assembly: TypeForwardedTo(typeof(ValueTuple<>))] [assembly: TypeForwardedTo(typeof(ValueTuple<, >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , , , , >))] namespace FxResources.System.ValueTuple { 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_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); } } }