iced_x86/formatter/
enums.rs

1// SPDX-License-Identifier: MIT
2// Copyright (C) 2018-present iced project and contributors
3
4use crate::formatter::iced_constants::IcedConstants;
5use crate::formatter::iced_error::IcedError;
6use core::iter::{ExactSizeIterator, FusedIterator, Iterator};
7use core::{fmt, mem};
8
9// GENERATOR-BEGIN: NumberBase
10// ⚠️This was generated by GENERATOR!🦹‍♂️
11/// Number base
12#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
13pub enum NumberBase {
14	/// Hex numbers (base 16)
15	Hexadecimal = 0,
16	/// Decimal numbers (base 10)
17	Decimal = 1,
18	/// Octal numbers (base 8)
19	Octal = 2,
20	/// Binary numbers (base 2)
21	Binary = 3,
22}
23#[rustfmt::skip]
24static GEN_DEBUG_NUMBER_BASE: [&str; 4] = [
25	"Hexadecimal",
26	"Decimal",
27	"Octal",
28	"Binary",
29];
30impl fmt::Debug for NumberBase {
31	#[inline]
32	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
33		write!(f, "{}", GEN_DEBUG_NUMBER_BASE[*self as usize])
34	}
35}
36impl Default for NumberBase {
37	#[must_use]
38	#[inline]
39	fn default() -> Self {
40		NumberBase::Hexadecimal
41	}
42}
43#[allow(non_camel_case_types)]
44#[allow(dead_code)]
45pub(crate) type NumberBaseUnderlyingType = u8;
46#[rustfmt::skip]
47impl NumberBase {
48	/// Iterates over all `NumberBase` enum values
49	#[inline]
50	pub fn values() -> impl Iterator<Item = NumberBase> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
51		// SAFETY: all values 0-max are valid enum values
52		(0..IcedConstants::NUMBER_BASE_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, NumberBase>(x as u8) })
53	}
54}
55#[test]
56#[rustfmt::skip]
57fn test_numberbase_values() {
58	let mut iter = NumberBase::values();
59	assert_eq!(iter.size_hint(), (IcedConstants::NUMBER_BASE_ENUM_COUNT, Some(IcedConstants::NUMBER_BASE_ENUM_COUNT)));
60	assert_eq!(iter.len(), IcedConstants::NUMBER_BASE_ENUM_COUNT);
61	assert!(iter.next().is_some());
62	assert_eq!(iter.size_hint(), (IcedConstants::NUMBER_BASE_ENUM_COUNT - 1, Some(IcedConstants::NUMBER_BASE_ENUM_COUNT - 1)));
63	assert_eq!(iter.len(), IcedConstants::NUMBER_BASE_ENUM_COUNT - 1);
64
65	let values: Vec<NumberBase> = NumberBase::values().collect();
66	assert_eq!(values.len(), IcedConstants::NUMBER_BASE_ENUM_COUNT);
67	for (i, value) in values.into_iter().enumerate() {
68		assert_eq!(i, value as usize);
69	}
70
71	let values1: Vec<NumberBase> = NumberBase::values().collect();
72	let mut values2: Vec<NumberBase> = NumberBase::values().rev().collect();
73	values2.reverse();
74	assert_eq!(values1, values2);
75}
76#[rustfmt::skip]
77impl TryFrom<usize> for NumberBase {
78	type Error = IcedError;
79	#[inline]
80	fn try_from(value: usize) -> Result<Self, Self::Error> {
81		if value < IcedConstants::NUMBER_BASE_ENUM_COUNT {
82			// SAFETY: all values 0-max are valid enum values
83			Ok(unsafe { mem::transmute(value as u8) })
84		} else {
85			Err(IcedError::new("Invalid NumberBase value"))
86		}
87	}
88}
89#[test]
90#[rustfmt::skip]
91fn test_numberbase_try_from_usize() {
92	for value in NumberBase::values() {
93		let converted = <NumberBase as TryFrom<usize>>::try_from(value as usize).unwrap();
94		assert_eq!(converted, value);
95	}
96	assert!(<NumberBase as TryFrom<usize>>::try_from(IcedConstants::NUMBER_BASE_ENUM_COUNT).is_err());
97	assert!(<NumberBase as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
98}
99#[cfg(feature = "serde")]
100#[rustfmt::skip]
101#[allow(clippy::zero_sized_map_values)]
102const _: () = {
103	use core::marker::PhantomData;
104	use serde::de;
105	use serde::{Deserialize, Deserializer, Serialize, Serializer};
106	type EnumType = NumberBase;
107	impl Serialize for EnumType {
108		#[inline]
109		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
110		where
111			S: Serializer,
112		{
113			serializer.serialize_u8(*self as u8)
114		}
115	}
116	impl<'de> Deserialize<'de> for EnumType {
117		#[inline]
118		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
119		where
120			D: Deserializer<'de>,
121		{
122			struct Visitor<'de> {
123				marker: PhantomData<EnumType>,
124				lifetime: PhantomData<&'de ()>,
125			}
126			impl<'de> de::Visitor<'de> for Visitor<'de> {
127				type Value = EnumType;
128				#[inline]
129				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
130					formatter.write_str("enum NumberBase")
131				}
132				#[inline]
133				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
134				where
135					E: de::Error,
136				{
137					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
138						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
139							return Ok(value);
140						}
141					}
142					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid NumberBase variant value"))
143				}
144			}
145			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
146		}
147	}
148};
149// GENERATOR-END: NumberBase
150
151// GENERATOR-BEGIN: FormatMnemonicOptions
152// ⚠️This was generated by GENERATOR!🦹‍♂️
153/// Format mnemonic options
154#[allow(missing_copy_implementations)]
155#[allow(missing_debug_implementations)]
156pub struct FormatMnemonicOptions;
157impl FormatMnemonicOptions {
158	/// No option is set
159	pub const NONE: u32 = 0x0000_0000;
160	/// Don't add any prefixes
161	pub const NO_PREFIXES: u32 = 0x0000_0001;
162	/// Don't add the mnemonic
163	pub const NO_MNEMONIC: u32 = 0x0000_0002;
164}
165// GENERATOR-END: FormatMnemonicOptions
166
167// GENERATOR-BEGIN: PrefixKind
168// ⚠️This was generated by GENERATOR!🦹‍♂️
169/// Prefix
170#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
171#[cfg_attr(not(feature = "exhaustive_enums"), non_exhaustive)]
172#[allow(missing_docs)]
173pub enum PrefixKind {
174	ES = 0,
175	CS = 1,
176	SS = 2,
177	DS = 3,
178	FS = 4,
179	GS = 5,
180	Lock = 6,
181	Rep = 7,
182	Repe = 8,
183	Repne = 9,
184	OperandSize = 10,
185	AddressSize = 11,
186	HintNotTaken = 12,
187	HintTaken = 13,
188	Bnd = 14,
189	Notrack = 15,
190	Xacquire = 16,
191	Xrelease = 17,
192}
193#[rustfmt::skip]
194static GEN_DEBUG_PREFIX_KIND: [&str; 18] = [
195	"ES",
196	"CS",
197	"SS",
198	"DS",
199	"FS",
200	"GS",
201	"Lock",
202	"Rep",
203	"Repe",
204	"Repne",
205	"OperandSize",
206	"AddressSize",
207	"HintNotTaken",
208	"HintTaken",
209	"Bnd",
210	"Notrack",
211	"Xacquire",
212	"Xrelease",
213];
214impl fmt::Debug for PrefixKind {
215	#[inline]
216	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
217		write!(f, "{}", GEN_DEBUG_PREFIX_KIND[*self as usize])
218	}
219}
220impl Default for PrefixKind {
221	#[must_use]
222	#[inline]
223	fn default() -> Self {
224		PrefixKind::ES
225	}
226}
227#[allow(non_camel_case_types)]
228#[allow(dead_code)]
229pub(crate) type PrefixKindUnderlyingType = u8;
230#[rustfmt::skip]
231impl PrefixKind {
232	/// Iterates over all `PrefixKind` enum values
233	#[inline]
234	pub fn values() -> impl Iterator<Item = PrefixKind> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
235		// SAFETY: all values 0-max are valid enum values
236		(0..IcedConstants::PREFIX_KIND_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, PrefixKind>(x as u8) })
237	}
238}
239#[test]
240#[rustfmt::skip]
241fn test_prefixkind_values() {
242	let mut iter = PrefixKind::values();
243	assert_eq!(iter.size_hint(), (IcedConstants::PREFIX_KIND_ENUM_COUNT, Some(IcedConstants::PREFIX_KIND_ENUM_COUNT)));
244	assert_eq!(iter.len(), IcedConstants::PREFIX_KIND_ENUM_COUNT);
245	assert!(iter.next().is_some());
246	assert_eq!(iter.size_hint(), (IcedConstants::PREFIX_KIND_ENUM_COUNT - 1, Some(IcedConstants::PREFIX_KIND_ENUM_COUNT - 1)));
247	assert_eq!(iter.len(), IcedConstants::PREFIX_KIND_ENUM_COUNT - 1);
248
249	let values: Vec<PrefixKind> = PrefixKind::values().collect();
250	assert_eq!(values.len(), IcedConstants::PREFIX_KIND_ENUM_COUNT);
251	for (i, value) in values.into_iter().enumerate() {
252		assert_eq!(i, value as usize);
253	}
254
255	let values1: Vec<PrefixKind> = PrefixKind::values().collect();
256	let mut values2: Vec<PrefixKind> = PrefixKind::values().rev().collect();
257	values2.reverse();
258	assert_eq!(values1, values2);
259}
260#[rustfmt::skip]
261impl TryFrom<usize> for PrefixKind {
262	type Error = IcedError;
263	#[inline]
264	fn try_from(value: usize) -> Result<Self, Self::Error> {
265		if value < IcedConstants::PREFIX_KIND_ENUM_COUNT {
266			// SAFETY: all values 0-max are valid enum values
267			Ok(unsafe { mem::transmute(value as u8) })
268		} else {
269			Err(IcedError::new("Invalid PrefixKind value"))
270		}
271	}
272}
273#[test]
274#[rustfmt::skip]
275fn test_prefixkind_try_from_usize() {
276	for value in PrefixKind::values() {
277		let converted = <PrefixKind as TryFrom<usize>>::try_from(value as usize).unwrap();
278		assert_eq!(converted, value);
279	}
280	assert!(<PrefixKind as TryFrom<usize>>::try_from(IcedConstants::PREFIX_KIND_ENUM_COUNT).is_err());
281	assert!(<PrefixKind as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
282}
283#[cfg(feature = "serde")]
284#[rustfmt::skip]
285#[allow(clippy::zero_sized_map_values)]
286const _: () = {
287	use core::marker::PhantomData;
288	use serde::de;
289	use serde::{Deserialize, Deserializer, Serialize, Serializer};
290	type EnumType = PrefixKind;
291	impl Serialize for EnumType {
292		#[inline]
293		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
294		where
295			S: Serializer,
296		{
297			serializer.serialize_u8(*self as u8)
298		}
299	}
300	impl<'de> Deserialize<'de> for EnumType {
301		#[inline]
302		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
303		where
304			D: Deserializer<'de>,
305		{
306			struct Visitor<'de> {
307				marker: PhantomData<EnumType>,
308				lifetime: PhantomData<&'de ()>,
309			}
310			impl<'de> de::Visitor<'de> for Visitor<'de> {
311				type Value = EnumType;
312				#[inline]
313				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
314					formatter.write_str("enum PrefixKind")
315				}
316				#[inline]
317				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
318				where
319					E: de::Error,
320				{
321					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
322						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
323							return Ok(value);
324						}
325					}
326					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid PrefixKind variant value"))
327				}
328			}
329			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
330		}
331	}
332};
333// GENERATOR-END: PrefixKind
334
335// GENERATOR-BEGIN: DecoratorKind
336// ⚠️This was generated by GENERATOR!🦹‍♂️
337/// Decorator
338#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
339#[cfg_attr(not(feature = "exhaustive_enums"), non_exhaustive)]
340pub enum DecoratorKind {
341	/// Broadcast decorator, eg. `{1to4}`
342	Broadcast = 0,
343	/// Rounding control, eg. `{rd-sae}`
344	RoundingControl = 1,
345	/// Suppress all exceptions: `{sae}`
346	SuppressAllExceptions = 2,
347	/// Zeroing masking: `{z}`
348	ZeroingMasking = 3,
349	/// MVEX swizzle or memory up/down conversion: `{dacb}` or `{sint16}`
350	SwizzleMemConv = 4,
351	/// MVEX eviction hint: `{eh}`
352	EvictionHint = 5,
353}
354#[rustfmt::skip]
355static GEN_DEBUG_DECORATOR_KIND: [&str; 6] = [
356	"Broadcast",
357	"RoundingControl",
358	"SuppressAllExceptions",
359	"ZeroingMasking",
360	"SwizzleMemConv",
361	"EvictionHint",
362];
363impl fmt::Debug for DecoratorKind {
364	#[inline]
365	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
366		write!(f, "{}", GEN_DEBUG_DECORATOR_KIND[*self as usize])
367	}
368}
369impl Default for DecoratorKind {
370	#[must_use]
371	#[inline]
372	fn default() -> Self {
373		DecoratorKind::Broadcast
374	}
375}
376#[allow(non_camel_case_types)]
377#[allow(dead_code)]
378pub(crate) type DecoratorKindUnderlyingType = u8;
379#[rustfmt::skip]
380impl DecoratorKind {
381	/// Iterates over all `DecoratorKind` enum values
382	#[inline]
383	pub fn values() -> impl Iterator<Item = DecoratorKind> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
384		// SAFETY: all values 0-max are valid enum values
385		(0..IcedConstants::DECORATOR_KIND_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, DecoratorKind>(x as u8) })
386	}
387}
388#[test]
389#[rustfmt::skip]
390fn test_decoratorkind_values() {
391	let mut iter = DecoratorKind::values();
392	assert_eq!(iter.size_hint(), (IcedConstants::DECORATOR_KIND_ENUM_COUNT, Some(IcedConstants::DECORATOR_KIND_ENUM_COUNT)));
393	assert_eq!(iter.len(), IcedConstants::DECORATOR_KIND_ENUM_COUNT);
394	assert!(iter.next().is_some());
395	assert_eq!(iter.size_hint(), (IcedConstants::DECORATOR_KIND_ENUM_COUNT - 1, Some(IcedConstants::DECORATOR_KIND_ENUM_COUNT - 1)));
396	assert_eq!(iter.len(), IcedConstants::DECORATOR_KIND_ENUM_COUNT - 1);
397
398	let values: Vec<DecoratorKind> = DecoratorKind::values().collect();
399	assert_eq!(values.len(), IcedConstants::DECORATOR_KIND_ENUM_COUNT);
400	for (i, value) in values.into_iter().enumerate() {
401		assert_eq!(i, value as usize);
402	}
403
404	let values1: Vec<DecoratorKind> = DecoratorKind::values().collect();
405	let mut values2: Vec<DecoratorKind> = DecoratorKind::values().rev().collect();
406	values2.reverse();
407	assert_eq!(values1, values2);
408}
409#[rustfmt::skip]
410impl TryFrom<usize> for DecoratorKind {
411	type Error = IcedError;
412	#[inline]
413	fn try_from(value: usize) -> Result<Self, Self::Error> {
414		if value < IcedConstants::DECORATOR_KIND_ENUM_COUNT {
415			// SAFETY: all values 0-max are valid enum values
416			Ok(unsafe { mem::transmute(value as u8) })
417		} else {
418			Err(IcedError::new("Invalid DecoratorKind value"))
419		}
420	}
421}
422#[test]
423#[rustfmt::skip]
424fn test_decoratorkind_try_from_usize() {
425	for value in DecoratorKind::values() {
426		let converted = <DecoratorKind as TryFrom<usize>>::try_from(value as usize).unwrap();
427		assert_eq!(converted, value);
428	}
429	assert!(<DecoratorKind as TryFrom<usize>>::try_from(IcedConstants::DECORATOR_KIND_ENUM_COUNT).is_err());
430	assert!(<DecoratorKind as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
431}
432#[cfg(feature = "serde")]
433#[rustfmt::skip]
434#[allow(clippy::zero_sized_map_values)]
435const _: () = {
436	use core::marker::PhantomData;
437	use serde::de;
438	use serde::{Deserialize, Deserializer, Serialize, Serializer};
439	type EnumType = DecoratorKind;
440	impl Serialize for EnumType {
441		#[inline]
442		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
443		where
444			S: Serializer,
445		{
446			serializer.serialize_u8(*self as u8)
447		}
448	}
449	impl<'de> Deserialize<'de> for EnumType {
450		#[inline]
451		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
452		where
453			D: Deserializer<'de>,
454		{
455			struct Visitor<'de> {
456				marker: PhantomData<EnumType>,
457				lifetime: PhantomData<&'de ()>,
458			}
459			impl<'de> de::Visitor<'de> for Visitor<'de> {
460				type Value = EnumType;
461				#[inline]
462				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
463					formatter.write_str("enum DecoratorKind")
464				}
465				#[inline]
466				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
467				where
468					E: de::Error,
469				{
470					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
471						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
472							return Ok(value);
473						}
474					}
475					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid DecoratorKind variant value"))
476				}
477			}
478			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
479		}
480	}
481};
482// GENERATOR-END: DecoratorKind
483
484// GENERATOR-BEGIN: NumberKind
485// ⚠️This was generated by GENERATOR!🦹‍♂️
486/// Number kind
487#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
488#[cfg_attr(not(feature = "exhaustive_enums"), non_exhaustive)]
489#[allow(missing_docs)]
490pub enum NumberKind {
491	Int8 = 0,
492	UInt8 = 1,
493	Int16 = 2,
494	UInt16 = 3,
495	Int32 = 4,
496	UInt32 = 5,
497	Int64 = 6,
498	UInt64 = 7,
499}
500#[rustfmt::skip]
501static GEN_DEBUG_NUMBER_KIND: [&str; 8] = [
502	"Int8",
503	"UInt8",
504	"Int16",
505	"UInt16",
506	"Int32",
507	"UInt32",
508	"Int64",
509	"UInt64",
510];
511impl fmt::Debug for NumberKind {
512	#[inline]
513	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
514		write!(f, "{}", GEN_DEBUG_NUMBER_KIND[*self as usize])
515	}
516}
517impl Default for NumberKind {
518	#[must_use]
519	#[inline]
520	fn default() -> Self {
521		NumberKind::Int8
522	}
523}
524#[allow(non_camel_case_types)]
525#[allow(dead_code)]
526pub(crate) type NumberKindUnderlyingType = u8;
527#[rustfmt::skip]
528impl NumberKind {
529	/// Iterates over all `NumberKind` enum values
530	#[inline]
531	pub fn values() -> impl Iterator<Item = NumberKind> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
532		// SAFETY: all values 0-max are valid enum values
533		(0..IcedConstants::NUMBER_KIND_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, NumberKind>(x as u8) })
534	}
535}
536#[test]
537#[rustfmt::skip]
538fn test_numberkind_values() {
539	let mut iter = NumberKind::values();
540	assert_eq!(iter.size_hint(), (IcedConstants::NUMBER_KIND_ENUM_COUNT, Some(IcedConstants::NUMBER_KIND_ENUM_COUNT)));
541	assert_eq!(iter.len(), IcedConstants::NUMBER_KIND_ENUM_COUNT);
542	assert!(iter.next().is_some());
543	assert_eq!(iter.size_hint(), (IcedConstants::NUMBER_KIND_ENUM_COUNT - 1, Some(IcedConstants::NUMBER_KIND_ENUM_COUNT - 1)));
544	assert_eq!(iter.len(), IcedConstants::NUMBER_KIND_ENUM_COUNT - 1);
545
546	let values: Vec<NumberKind> = NumberKind::values().collect();
547	assert_eq!(values.len(), IcedConstants::NUMBER_KIND_ENUM_COUNT);
548	for (i, value) in values.into_iter().enumerate() {
549		assert_eq!(i, value as usize);
550	}
551
552	let values1: Vec<NumberKind> = NumberKind::values().collect();
553	let mut values2: Vec<NumberKind> = NumberKind::values().rev().collect();
554	values2.reverse();
555	assert_eq!(values1, values2);
556}
557#[rustfmt::skip]
558impl TryFrom<usize> for NumberKind {
559	type Error = IcedError;
560	#[inline]
561	fn try_from(value: usize) -> Result<Self, Self::Error> {
562		if value < IcedConstants::NUMBER_KIND_ENUM_COUNT {
563			// SAFETY: all values 0-max are valid enum values
564			Ok(unsafe { mem::transmute(value as u8) })
565		} else {
566			Err(IcedError::new("Invalid NumberKind value"))
567		}
568	}
569}
570#[test]
571#[rustfmt::skip]
572fn test_numberkind_try_from_usize() {
573	for value in NumberKind::values() {
574		let converted = <NumberKind as TryFrom<usize>>::try_from(value as usize).unwrap();
575		assert_eq!(converted, value);
576	}
577	assert!(<NumberKind as TryFrom<usize>>::try_from(IcedConstants::NUMBER_KIND_ENUM_COUNT).is_err());
578	assert!(<NumberKind as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
579}
580#[cfg(feature = "serde")]
581#[rustfmt::skip]
582#[allow(clippy::zero_sized_map_values)]
583const _: () = {
584	use core::marker::PhantomData;
585	use serde::de;
586	use serde::{Deserialize, Deserializer, Serialize, Serializer};
587	type EnumType = NumberKind;
588	impl Serialize for EnumType {
589		#[inline]
590		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
591		where
592			S: Serializer,
593		{
594			serializer.serialize_u8(*self as u8)
595		}
596	}
597	impl<'de> Deserialize<'de> for EnumType {
598		#[inline]
599		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
600		where
601			D: Deserializer<'de>,
602		{
603			struct Visitor<'de> {
604				marker: PhantomData<EnumType>,
605				lifetime: PhantomData<&'de ()>,
606			}
607			impl<'de> de::Visitor<'de> for Visitor<'de> {
608				type Value = EnumType;
609				#[inline]
610				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
611					formatter.write_str("enum NumberKind")
612				}
613				#[inline]
614				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
615				where
616					E: de::Error,
617				{
618					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
619						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
620							return Ok(value);
621						}
622					}
623					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid NumberKind variant value"))
624				}
625			}
626			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
627		}
628	}
629};
630// GENERATOR-END: NumberKind
631
632// GENERATOR-BEGIN: FormatterFlowControl
633// ⚠️This was generated by GENERATOR!🦹‍♂️
634#[derive(Copy, Clone, Eq, PartialEq)]
635#[allow(dead_code)]
636pub(crate) enum FormatterFlowControl {
637	AlwaysShortBranch,
638	ShortBranch,
639	NearBranch,
640	NearCall,
641	FarBranch,
642	FarCall,
643	Xbegin,
644}
645#[rustfmt::skip]
646static GEN_DEBUG_FORMATTER_FLOW_CONTROL: [&str; 7] = [
647	"AlwaysShortBranch",
648	"ShortBranch",
649	"NearBranch",
650	"NearCall",
651	"FarBranch",
652	"FarCall",
653	"Xbegin",
654];
655impl fmt::Debug for FormatterFlowControl {
656	#[inline]
657	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
658		write!(f, "{}", GEN_DEBUG_FORMATTER_FLOW_CONTROL[*self as usize])
659	}
660}
661impl Default for FormatterFlowControl {
662	#[must_use]
663	#[inline]
664	fn default() -> Self {
665		FormatterFlowControl::AlwaysShortBranch
666	}
667}
668// GENERATOR-END: FormatterFlowControl
669
670// GENERATOR-BEGIN: CC_b
671// ⚠️This was generated by GENERATOR!🦹‍♂️
672/// Mnemonic condition code selector (eg. `JB` / `JC` / `JNAE`)
673#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
674#[allow(non_camel_case_types)]
675pub enum CC_b {
676	/// `JB`, `CMOVB`, `SETB`
677	b = 0,
678	/// `JC`, `CMOVC`, `SETC`
679	c = 1,
680	/// `JNAE`, `CMOVNAE`, `SETNAE`
681	nae = 2,
682}
683#[rustfmt::skip]
684static GEN_DEBUG_CC_B: [&str; 3] = [
685	"b",
686	"c",
687	"nae",
688];
689impl fmt::Debug for CC_b {
690	#[inline]
691	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
692		write!(f, "{}", GEN_DEBUG_CC_B[*self as usize])
693	}
694}
695impl Default for CC_b {
696	#[must_use]
697	#[inline]
698	fn default() -> Self {
699		CC_b::b
700	}
701}
702#[allow(non_camel_case_types)]
703#[allow(dead_code)]
704pub(crate) type CC_bUnderlyingType = u8;
705#[rustfmt::skip]
706impl CC_b {
707	/// Iterates over all `CC_b` enum values
708	#[inline]
709	pub fn values() -> impl Iterator<Item = CC_b> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
710		// SAFETY: all values 0-max are valid enum values
711		(0..IcedConstants::CC_B_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_b>(x as u8) })
712	}
713}
714#[test]
715#[rustfmt::skip]
716fn test_cc_b_values() {
717	let mut iter = CC_b::values();
718	assert_eq!(iter.size_hint(), (IcedConstants::CC_B_ENUM_COUNT, Some(IcedConstants::CC_B_ENUM_COUNT)));
719	assert_eq!(iter.len(), IcedConstants::CC_B_ENUM_COUNT);
720	assert!(iter.next().is_some());
721	assert_eq!(iter.size_hint(), (IcedConstants::CC_B_ENUM_COUNT - 1, Some(IcedConstants::CC_B_ENUM_COUNT - 1)));
722	assert_eq!(iter.len(), IcedConstants::CC_B_ENUM_COUNT - 1);
723
724	let values: Vec<CC_b> = CC_b::values().collect();
725	assert_eq!(values.len(), IcedConstants::CC_B_ENUM_COUNT);
726	for (i, value) in values.into_iter().enumerate() {
727		assert_eq!(i, value as usize);
728	}
729
730	let values1: Vec<CC_b> = CC_b::values().collect();
731	let mut values2: Vec<CC_b> = CC_b::values().rev().collect();
732	values2.reverse();
733	assert_eq!(values1, values2);
734}
735#[rustfmt::skip]
736impl TryFrom<usize> for CC_b {
737	type Error = IcedError;
738	#[inline]
739	fn try_from(value: usize) -> Result<Self, Self::Error> {
740		if value < IcedConstants::CC_B_ENUM_COUNT {
741			// SAFETY: all values 0-max are valid enum values
742			Ok(unsafe { mem::transmute(value as u8) })
743		} else {
744			Err(IcedError::new("Invalid CC_b value"))
745		}
746	}
747}
748#[test]
749#[rustfmt::skip]
750fn test_cc_b_try_from_usize() {
751	for value in CC_b::values() {
752		let converted = <CC_b as TryFrom<usize>>::try_from(value as usize).unwrap();
753		assert_eq!(converted, value);
754	}
755	assert!(<CC_b as TryFrom<usize>>::try_from(IcedConstants::CC_B_ENUM_COUNT).is_err());
756	assert!(<CC_b as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
757}
758#[cfg(feature = "serde")]
759#[rustfmt::skip]
760#[allow(clippy::zero_sized_map_values)]
761const _: () = {
762	use core::marker::PhantomData;
763	use serde::de;
764	use serde::{Deserialize, Deserializer, Serialize, Serializer};
765	type EnumType = CC_b;
766	impl Serialize for EnumType {
767		#[inline]
768		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
769		where
770			S: Serializer,
771		{
772			serializer.serialize_u8(*self as u8)
773		}
774	}
775	impl<'de> Deserialize<'de> for EnumType {
776		#[inline]
777		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
778		where
779			D: Deserializer<'de>,
780		{
781			struct Visitor<'de> {
782				marker: PhantomData<EnumType>,
783				lifetime: PhantomData<&'de ()>,
784			}
785			impl<'de> de::Visitor<'de> for Visitor<'de> {
786				type Value = EnumType;
787				#[inline]
788				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
789					formatter.write_str("enum CC_b")
790				}
791				#[inline]
792				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
793				where
794					E: de::Error,
795				{
796					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
797						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
798							return Ok(value);
799						}
800					}
801					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_b variant value"))
802				}
803			}
804			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
805		}
806	}
807};
808// GENERATOR-END: CC_b
809
810// GENERATOR-BEGIN: CC_ae
811// ⚠️This was generated by GENERATOR!🦹‍♂️
812/// Mnemonic condition code selector (eg. `JAE` / `JNB` / `JNC`)
813#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
814#[allow(non_camel_case_types)]
815pub enum CC_ae {
816	/// `JAE`, `CMOVAE`, `SETAE`
817	ae = 0,
818	/// `JNB`, `CMOVNB`, `SETNB`
819	nb = 1,
820	/// `JNC`, `CMOVNC`, `SETNC`
821	nc = 2,
822}
823#[rustfmt::skip]
824static GEN_DEBUG_CC_AE: [&str; 3] = [
825	"ae",
826	"nb",
827	"nc",
828];
829impl fmt::Debug for CC_ae {
830	#[inline]
831	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
832		write!(f, "{}", GEN_DEBUG_CC_AE[*self as usize])
833	}
834}
835impl Default for CC_ae {
836	#[must_use]
837	#[inline]
838	fn default() -> Self {
839		CC_ae::ae
840	}
841}
842#[allow(non_camel_case_types)]
843#[allow(dead_code)]
844pub(crate) type CC_aeUnderlyingType = u8;
845#[rustfmt::skip]
846impl CC_ae {
847	/// Iterates over all `CC_ae` enum values
848	#[inline]
849	pub fn values() -> impl Iterator<Item = CC_ae> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
850		// SAFETY: all values 0-max are valid enum values
851		(0..IcedConstants::CC_AE_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_ae>(x as u8) })
852	}
853}
854#[test]
855#[rustfmt::skip]
856fn test_cc_ae_values() {
857	let mut iter = CC_ae::values();
858	assert_eq!(iter.size_hint(), (IcedConstants::CC_AE_ENUM_COUNT, Some(IcedConstants::CC_AE_ENUM_COUNT)));
859	assert_eq!(iter.len(), IcedConstants::CC_AE_ENUM_COUNT);
860	assert!(iter.next().is_some());
861	assert_eq!(iter.size_hint(), (IcedConstants::CC_AE_ENUM_COUNT - 1, Some(IcedConstants::CC_AE_ENUM_COUNT - 1)));
862	assert_eq!(iter.len(), IcedConstants::CC_AE_ENUM_COUNT - 1);
863
864	let values: Vec<CC_ae> = CC_ae::values().collect();
865	assert_eq!(values.len(), IcedConstants::CC_AE_ENUM_COUNT);
866	for (i, value) in values.into_iter().enumerate() {
867		assert_eq!(i, value as usize);
868	}
869
870	let values1: Vec<CC_ae> = CC_ae::values().collect();
871	let mut values2: Vec<CC_ae> = CC_ae::values().rev().collect();
872	values2.reverse();
873	assert_eq!(values1, values2);
874}
875#[rustfmt::skip]
876impl TryFrom<usize> for CC_ae {
877	type Error = IcedError;
878	#[inline]
879	fn try_from(value: usize) -> Result<Self, Self::Error> {
880		if value < IcedConstants::CC_AE_ENUM_COUNT {
881			// SAFETY: all values 0-max are valid enum values
882			Ok(unsafe { mem::transmute(value as u8) })
883		} else {
884			Err(IcedError::new("Invalid CC_ae value"))
885		}
886	}
887}
888#[test]
889#[rustfmt::skip]
890fn test_cc_ae_try_from_usize() {
891	for value in CC_ae::values() {
892		let converted = <CC_ae as TryFrom<usize>>::try_from(value as usize).unwrap();
893		assert_eq!(converted, value);
894	}
895	assert!(<CC_ae as TryFrom<usize>>::try_from(IcedConstants::CC_AE_ENUM_COUNT).is_err());
896	assert!(<CC_ae as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
897}
898#[cfg(feature = "serde")]
899#[rustfmt::skip]
900#[allow(clippy::zero_sized_map_values)]
901const _: () = {
902	use core::marker::PhantomData;
903	use serde::de;
904	use serde::{Deserialize, Deserializer, Serialize, Serializer};
905	type EnumType = CC_ae;
906	impl Serialize for EnumType {
907		#[inline]
908		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
909		where
910			S: Serializer,
911		{
912			serializer.serialize_u8(*self as u8)
913		}
914	}
915	impl<'de> Deserialize<'de> for EnumType {
916		#[inline]
917		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
918		where
919			D: Deserializer<'de>,
920		{
921			struct Visitor<'de> {
922				marker: PhantomData<EnumType>,
923				lifetime: PhantomData<&'de ()>,
924			}
925			impl<'de> de::Visitor<'de> for Visitor<'de> {
926				type Value = EnumType;
927				#[inline]
928				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
929					formatter.write_str("enum CC_ae")
930				}
931				#[inline]
932				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
933				where
934					E: de::Error,
935				{
936					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
937						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
938							return Ok(value);
939						}
940					}
941					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_ae variant value"))
942				}
943			}
944			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
945		}
946	}
947};
948// GENERATOR-END: CC_ae
949
950// GENERATOR-BEGIN: CC_e
951// ⚠️This was generated by GENERATOR!🦹‍♂️
952/// Mnemonic condition code selector (eg. `JE` / `JZ`)
953#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
954#[allow(non_camel_case_types)]
955pub enum CC_e {
956	/// `JE`, `CMOVE`, `SETE`, `LOOPE`, `REPE`
957	e = 0,
958	/// `JZ`, `CMOVZ`, `SETZ`, `LOOPZ`, `REPZ`
959	z = 1,
960}
961#[rustfmt::skip]
962static GEN_DEBUG_CC_E: [&str; 2] = [
963	"e",
964	"z",
965];
966impl fmt::Debug for CC_e {
967	#[inline]
968	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
969		write!(f, "{}", GEN_DEBUG_CC_E[*self as usize])
970	}
971}
972impl Default for CC_e {
973	#[must_use]
974	#[inline]
975	fn default() -> Self {
976		CC_e::e
977	}
978}
979#[allow(non_camel_case_types)]
980#[allow(dead_code)]
981pub(crate) type CC_eUnderlyingType = u8;
982#[rustfmt::skip]
983impl CC_e {
984	/// Iterates over all `CC_e` enum values
985	#[inline]
986	pub fn values() -> impl Iterator<Item = CC_e> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
987		// SAFETY: all values 0-max are valid enum values
988		(0..IcedConstants::CC_E_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_e>(x as u8) })
989	}
990}
991#[test]
992#[rustfmt::skip]
993fn test_cc_e_values() {
994	let mut iter = CC_e::values();
995	assert_eq!(iter.size_hint(), (IcedConstants::CC_E_ENUM_COUNT, Some(IcedConstants::CC_E_ENUM_COUNT)));
996	assert_eq!(iter.len(), IcedConstants::CC_E_ENUM_COUNT);
997	assert!(iter.next().is_some());
998	assert_eq!(iter.size_hint(), (IcedConstants::CC_E_ENUM_COUNT - 1, Some(IcedConstants::CC_E_ENUM_COUNT - 1)));
999	assert_eq!(iter.len(), IcedConstants::CC_E_ENUM_COUNT - 1);
1000
1001	let values: Vec<CC_e> = CC_e::values().collect();
1002	assert_eq!(values.len(), IcedConstants::CC_E_ENUM_COUNT);
1003	for (i, value) in values.into_iter().enumerate() {
1004		assert_eq!(i, value as usize);
1005	}
1006
1007	let values1: Vec<CC_e> = CC_e::values().collect();
1008	let mut values2: Vec<CC_e> = CC_e::values().rev().collect();
1009	values2.reverse();
1010	assert_eq!(values1, values2);
1011}
1012#[rustfmt::skip]
1013impl TryFrom<usize> for CC_e {
1014	type Error = IcedError;
1015	#[inline]
1016	fn try_from(value: usize) -> Result<Self, Self::Error> {
1017		if value < IcedConstants::CC_E_ENUM_COUNT {
1018			// SAFETY: all values 0-max are valid enum values
1019			Ok(unsafe { mem::transmute(value as u8) })
1020		} else {
1021			Err(IcedError::new("Invalid CC_e value"))
1022		}
1023	}
1024}
1025#[test]
1026#[rustfmt::skip]
1027fn test_cc_e_try_from_usize() {
1028	for value in CC_e::values() {
1029		let converted = <CC_e as TryFrom<usize>>::try_from(value as usize).unwrap();
1030		assert_eq!(converted, value);
1031	}
1032	assert!(<CC_e as TryFrom<usize>>::try_from(IcedConstants::CC_E_ENUM_COUNT).is_err());
1033	assert!(<CC_e as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
1034}
1035#[cfg(feature = "serde")]
1036#[rustfmt::skip]
1037#[allow(clippy::zero_sized_map_values)]
1038const _: () = {
1039	use core::marker::PhantomData;
1040	use serde::de;
1041	use serde::{Deserialize, Deserializer, Serialize, Serializer};
1042	type EnumType = CC_e;
1043	impl Serialize for EnumType {
1044		#[inline]
1045		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1046		where
1047			S: Serializer,
1048		{
1049			serializer.serialize_u8(*self as u8)
1050		}
1051	}
1052	impl<'de> Deserialize<'de> for EnumType {
1053		#[inline]
1054		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1055		where
1056			D: Deserializer<'de>,
1057		{
1058			struct Visitor<'de> {
1059				marker: PhantomData<EnumType>,
1060				lifetime: PhantomData<&'de ()>,
1061			}
1062			impl<'de> de::Visitor<'de> for Visitor<'de> {
1063				type Value = EnumType;
1064				#[inline]
1065				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
1066					formatter.write_str("enum CC_e")
1067				}
1068				#[inline]
1069				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
1070				where
1071					E: de::Error,
1072				{
1073					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
1074						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
1075							return Ok(value);
1076						}
1077					}
1078					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_e variant value"))
1079				}
1080			}
1081			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
1082		}
1083	}
1084};
1085// GENERATOR-END: CC_e
1086
1087// GENERATOR-BEGIN: CC_ne
1088// ⚠️This was generated by GENERATOR!🦹‍♂️
1089/// Mnemonic condition code selector (eg. `JNE` / `JNZ`)
1090#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1091#[allow(non_camel_case_types)]
1092pub enum CC_ne {
1093	/// `JNE`, `CMOVNE`, `SETNE`, `LOOPNE`, `REPNE`
1094	ne = 0,
1095	/// `JNZ`, `CMOVNZ`, `SETNZ`, `LOOPNZ`, `REPNZ`
1096	nz = 1,
1097}
1098#[rustfmt::skip]
1099static GEN_DEBUG_CC_NE: [&str; 2] = [
1100	"ne",
1101	"nz",
1102];
1103impl fmt::Debug for CC_ne {
1104	#[inline]
1105	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1106		write!(f, "{}", GEN_DEBUG_CC_NE[*self as usize])
1107	}
1108}
1109impl Default for CC_ne {
1110	#[must_use]
1111	#[inline]
1112	fn default() -> Self {
1113		CC_ne::ne
1114	}
1115}
1116#[allow(non_camel_case_types)]
1117#[allow(dead_code)]
1118pub(crate) type CC_neUnderlyingType = u8;
1119#[rustfmt::skip]
1120impl CC_ne {
1121	/// Iterates over all `CC_ne` enum values
1122	#[inline]
1123	pub fn values() -> impl Iterator<Item = CC_ne> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
1124		// SAFETY: all values 0-max are valid enum values
1125		(0..IcedConstants::CC_NE_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_ne>(x as u8) })
1126	}
1127}
1128#[test]
1129#[rustfmt::skip]
1130fn test_cc_ne_values() {
1131	let mut iter = CC_ne::values();
1132	assert_eq!(iter.size_hint(), (IcedConstants::CC_NE_ENUM_COUNT, Some(IcedConstants::CC_NE_ENUM_COUNT)));
1133	assert_eq!(iter.len(), IcedConstants::CC_NE_ENUM_COUNT);
1134	assert!(iter.next().is_some());
1135	assert_eq!(iter.size_hint(), (IcedConstants::CC_NE_ENUM_COUNT - 1, Some(IcedConstants::CC_NE_ENUM_COUNT - 1)));
1136	assert_eq!(iter.len(), IcedConstants::CC_NE_ENUM_COUNT - 1);
1137
1138	let values: Vec<CC_ne> = CC_ne::values().collect();
1139	assert_eq!(values.len(), IcedConstants::CC_NE_ENUM_COUNT);
1140	for (i, value) in values.into_iter().enumerate() {
1141		assert_eq!(i, value as usize);
1142	}
1143
1144	let values1: Vec<CC_ne> = CC_ne::values().collect();
1145	let mut values2: Vec<CC_ne> = CC_ne::values().rev().collect();
1146	values2.reverse();
1147	assert_eq!(values1, values2);
1148}
1149#[rustfmt::skip]
1150impl TryFrom<usize> for CC_ne {
1151	type Error = IcedError;
1152	#[inline]
1153	fn try_from(value: usize) -> Result<Self, Self::Error> {
1154		if value < IcedConstants::CC_NE_ENUM_COUNT {
1155			// SAFETY: all values 0-max are valid enum values
1156			Ok(unsafe { mem::transmute(value as u8) })
1157		} else {
1158			Err(IcedError::new("Invalid CC_ne value"))
1159		}
1160	}
1161}
1162#[test]
1163#[rustfmt::skip]
1164fn test_cc_ne_try_from_usize() {
1165	for value in CC_ne::values() {
1166		let converted = <CC_ne as TryFrom<usize>>::try_from(value as usize).unwrap();
1167		assert_eq!(converted, value);
1168	}
1169	assert!(<CC_ne as TryFrom<usize>>::try_from(IcedConstants::CC_NE_ENUM_COUNT).is_err());
1170	assert!(<CC_ne as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
1171}
1172#[cfg(feature = "serde")]
1173#[rustfmt::skip]
1174#[allow(clippy::zero_sized_map_values)]
1175const _: () = {
1176	use core::marker::PhantomData;
1177	use serde::de;
1178	use serde::{Deserialize, Deserializer, Serialize, Serializer};
1179	type EnumType = CC_ne;
1180	impl Serialize for EnumType {
1181		#[inline]
1182		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1183		where
1184			S: Serializer,
1185		{
1186			serializer.serialize_u8(*self as u8)
1187		}
1188	}
1189	impl<'de> Deserialize<'de> for EnumType {
1190		#[inline]
1191		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1192		where
1193			D: Deserializer<'de>,
1194		{
1195			struct Visitor<'de> {
1196				marker: PhantomData<EnumType>,
1197				lifetime: PhantomData<&'de ()>,
1198			}
1199			impl<'de> de::Visitor<'de> for Visitor<'de> {
1200				type Value = EnumType;
1201				#[inline]
1202				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
1203					formatter.write_str("enum CC_ne")
1204				}
1205				#[inline]
1206				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
1207				where
1208					E: de::Error,
1209				{
1210					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
1211						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
1212							return Ok(value);
1213						}
1214					}
1215					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_ne variant value"))
1216				}
1217			}
1218			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
1219		}
1220	}
1221};
1222// GENERATOR-END: CC_ne
1223
1224// GENERATOR-BEGIN: CC_be
1225// ⚠️This was generated by GENERATOR!🦹‍♂️
1226/// Mnemonic condition code selector (eg. `JBE` / `JNA`)
1227#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1228#[allow(non_camel_case_types)]
1229pub enum CC_be {
1230	/// `JBE`, `CMOVBE`, `SETBE`
1231	be = 0,
1232	/// `JNA`, `CMOVNA`, `SETNA`
1233	na = 1,
1234}
1235#[rustfmt::skip]
1236static GEN_DEBUG_CC_BE: [&str; 2] = [
1237	"be",
1238	"na",
1239];
1240impl fmt::Debug for CC_be {
1241	#[inline]
1242	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1243		write!(f, "{}", GEN_DEBUG_CC_BE[*self as usize])
1244	}
1245}
1246impl Default for CC_be {
1247	#[must_use]
1248	#[inline]
1249	fn default() -> Self {
1250		CC_be::be
1251	}
1252}
1253#[allow(non_camel_case_types)]
1254#[allow(dead_code)]
1255pub(crate) type CC_beUnderlyingType = u8;
1256#[rustfmt::skip]
1257impl CC_be {
1258	/// Iterates over all `CC_be` enum values
1259	#[inline]
1260	pub fn values() -> impl Iterator<Item = CC_be> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
1261		// SAFETY: all values 0-max are valid enum values
1262		(0..IcedConstants::CC_BE_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_be>(x as u8) })
1263	}
1264}
1265#[test]
1266#[rustfmt::skip]
1267fn test_cc_be_values() {
1268	let mut iter = CC_be::values();
1269	assert_eq!(iter.size_hint(), (IcedConstants::CC_BE_ENUM_COUNT, Some(IcedConstants::CC_BE_ENUM_COUNT)));
1270	assert_eq!(iter.len(), IcedConstants::CC_BE_ENUM_COUNT);
1271	assert!(iter.next().is_some());
1272	assert_eq!(iter.size_hint(), (IcedConstants::CC_BE_ENUM_COUNT - 1, Some(IcedConstants::CC_BE_ENUM_COUNT - 1)));
1273	assert_eq!(iter.len(), IcedConstants::CC_BE_ENUM_COUNT - 1);
1274
1275	let values: Vec<CC_be> = CC_be::values().collect();
1276	assert_eq!(values.len(), IcedConstants::CC_BE_ENUM_COUNT);
1277	for (i, value) in values.into_iter().enumerate() {
1278		assert_eq!(i, value as usize);
1279	}
1280
1281	let values1: Vec<CC_be> = CC_be::values().collect();
1282	let mut values2: Vec<CC_be> = CC_be::values().rev().collect();
1283	values2.reverse();
1284	assert_eq!(values1, values2);
1285}
1286#[rustfmt::skip]
1287impl TryFrom<usize> for CC_be {
1288	type Error = IcedError;
1289	#[inline]
1290	fn try_from(value: usize) -> Result<Self, Self::Error> {
1291		if value < IcedConstants::CC_BE_ENUM_COUNT {
1292			// SAFETY: all values 0-max are valid enum values
1293			Ok(unsafe { mem::transmute(value as u8) })
1294		} else {
1295			Err(IcedError::new("Invalid CC_be value"))
1296		}
1297	}
1298}
1299#[test]
1300#[rustfmt::skip]
1301fn test_cc_be_try_from_usize() {
1302	for value in CC_be::values() {
1303		let converted = <CC_be as TryFrom<usize>>::try_from(value as usize).unwrap();
1304		assert_eq!(converted, value);
1305	}
1306	assert!(<CC_be as TryFrom<usize>>::try_from(IcedConstants::CC_BE_ENUM_COUNT).is_err());
1307	assert!(<CC_be as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
1308}
1309#[cfg(feature = "serde")]
1310#[rustfmt::skip]
1311#[allow(clippy::zero_sized_map_values)]
1312const _: () = {
1313	use core::marker::PhantomData;
1314	use serde::de;
1315	use serde::{Deserialize, Deserializer, Serialize, Serializer};
1316	type EnumType = CC_be;
1317	impl Serialize for EnumType {
1318		#[inline]
1319		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1320		where
1321			S: Serializer,
1322		{
1323			serializer.serialize_u8(*self as u8)
1324		}
1325	}
1326	impl<'de> Deserialize<'de> for EnumType {
1327		#[inline]
1328		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1329		where
1330			D: Deserializer<'de>,
1331		{
1332			struct Visitor<'de> {
1333				marker: PhantomData<EnumType>,
1334				lifetime: PhantomData<&'de ()>,
1335			}
1336			impl<'de> de::Visitor<'de> for Visitor<'de> {
1337				type Value = EnumType;
1338				#[inline]
1339				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
1340					formatter.write_str("enum CC_be")
1341				}
1342				#[inline]
1343				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
1344				where
1345					E: de::Error,
1346				{
1347					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
1348						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
1349							return Ok(value);
1350						}
1351					}
1352					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_be variant value"))
1353				}
1354			}
1355			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
1356		}
1357	}
1358};
1359// GENERATOR-END: CC_be
1360
1361// GENERATOR-BEGIN: CC_a
1362// ⚠️This was generated by GENERATOR!🦹‍♂️
1363/// Mnemonic condition code selector (eg. `JA` / `JNBE`)
1364#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1365#[allow(non_camel_case_types)]
1366pub enum CC_a {
1367	/// `JA`, `CMOVA`, `SETA`
1368	a = 0,
1369	/// `JNBE`, `CMOVNBE`, `SETNBE`
1370	nbe = 1,
1371}
1372#[rustfmt::skip]
1373static GEN_DEBUG_CC_A: [&str; 2] = [
1374	"a",
1375	"nbe",
1376];
1377impl fmt::Debug for CC_a {
1378	#[inline]
1379	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1380		write!(f, "{}", GEN_DEBUG_CC_A[*self as usize])
1381	}
1382}
1383impl Default for CC_a {
1384	#[must_use]
1385	#[inline]
1386	fn default() -> Self {
1387		CC_a::a
1388	}
1389}
1390#[allow(non_camel_case_types)]
1391#[allow(dead_code)]
1392pub(crate) type CC_aUnderlyingType = u8;
1393#[rustfmt::skip]
1394impl CC_a {
1395	/// Iterates over all `CC_a` enum values
1396	#[inline]
1397	pub fn values() -> impl Iterator<Item = CC_a> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
1398		// SAFETY: all values 0-max are valid enum values
1399		(0..IcedConstants::CC_A_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_a>(x as u8) })
1400	}
1401}
1402#[test]
1403#[rustfmt::skip]
1404fn test_cc_a_values() {
1405	let mut iter = CC_a::values();
1406	assert_eq!(iter.size_hint(), (IcedConstants::CC_A_ENUM_COUNT, Some(IcedConstants::CC_A_ENUM_COUNT)));
1407	assert_eq!(iter.len(), IcedConstants::CC_A_ENUM_COUNT);
1408	assert!(iter.next().is_some());
1409	assert_eq!(iter.size_hint(), (IcedConstants::CC_A_ENUM_COUNT - 1, Some(IcedConstants::CC_A_ENUM_COUNT - 1)));
1410	assert_eq!(iter.len(), IcedConstants::CC_A_ENUM_COUNT - 1);
1411
1412	let values: Vec<CC_a> = CC_a::values().collect();
1413	assert_eq!(values.len(), IcedConstants::CC_A_ENUM_COUNT);
1414	for (i, value) in values.into_iter().enumerate() {
1415		assert_eq!(i, value as usize);
1416	}
1417
1418	let values1: Vec<CC_a> = CC_a::values().collect();
1419	let mut values2: Vec<CC_a> = CC_a::values().rev().collect();
1420	values2.reverse();
1421	assert_eq!(values1, values2);
1422}
1423#[rustfmt::skip]
1424impl TryFrom<usize> for CC_a {
1425	type Error = IcedError;
1426	#[inline]
1427	fn try_from(value: usize) -> Result<Self, Self::Error> {
1428		if value < IcedConstants::CC_A_ENUM_COUNT {
1429			// SAFETY: all values 0-max are valid enum values
1430			Ok(unsafe { mem::transmute(value as u8) })
1431		} else {
1432			Err(IcedError::new("Invalid CC_a value"))
1433		}
1434	}
1435}
1436#[test]
1437#[rustfmt::skip]
1438fn test_cc_a_try_from_usize() {
1439	for value in CC_a::values() {
1440		let converted = <CC_a as TryFrom<usize>>::try_from(value as usize).unwrap();
1441		assert_eq!(converted, value);
1442	}
1443	assert!(<CC_a as TryFrom<usize>>::try_from(IcedConstants::CC_A_ENUM_COUNT).is_err());
1444	assert!(<CC_a as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
1445}
1446#[cfg(feature = "serde")]
1447#[rustfmt::skip]
1448#[allow(clippy::zero_sized_map_values)]
1449const _: () = {
1450	use core::marker::PhantomData;
1451	use serde::de;
1452	use serde::{Deserialize, Deserializer, Serialize, Serializer};
1453	type EnumType = CC_a;
1454	impl Serialize for EnumType {
1455		#[inline]
1456		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1457		where
1458			S: Serializer,
1459		{
1460			serializer.serialize_u8(*self as u8)
1461		}
1462	}
1463	impl<'de> Deserialize<'de> for EnumType {
1464		#[inline]
1465		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1466		where
1467			D: Deserializer<'de>,
1468		{
1469			struct Visitor<'de> {
1470				marker: PhantomData<EnumType>,
1471				lifetime: PhantomData<&'de ()>,
1472			}
1473			impl<'de> de::Visitor<'de> for Visitor<'de> {
1474				type Value = EnumType;
1475				#[inline]
1476				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
1477					formatter.write_str("enum CC_a")
1478				}
1479				#[inline]
1480				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
1481				where
1482					E: de::Error,
1483				{
1484					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
1485						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
1486							return Ok(value);
1487						}
1488					}
1489					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_a variant value"))
1490				}
1491			}
1492			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
1493		}
1494	}
1495};
1496// GENERATOR-END: CC_a
1497
1498// GENERATOR-BEGIN: CC_p
1499// ⚠️This was generated by GENERATOR!🦹‍♂️
1500/// Mnemonic condition code selector (eg. `JP` / `JPE`)
1501#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1502#[allow(non_camel_case_types)]
1503pub enum CC_p {
1504	/// `JP`, `CMOVP`, `SETP`
1505	p = 0,
1506	/// `JPE`, `CMOVPE`, `SETPE`
1507	pe = 1,
1508}
1509#[rustfmt::skip]
1510static GEN_DEBUG_CC_P: [&str; 2] = [
1511	"p",
1512	"pe",
1513];
1514impl fmt::Debug for CC_p {
1515	#[inline]
1516	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1517		write!(f, "{}", GEN_DEBUG_CC_P[*self as usize])
1518	}
1519}
1520impl Default for CC_p {
1521	#[must_use]
1522	#[inline]
1523	fn default() -> Self {
1524		CC_p::p
1525	}
1526}
1527#[allow(non_camel_case_types)]
1528#[allow(dead_code)]
1529pub(crate) type CC_pUnderlyingType = u8;
1530#[rustfmt::skip]
1531impl CC_p {
1532	/// Iterates over all `CC_p` enum values
1533	#[inline]
1534	pub fn values() -> impl Iterator<Item = CC_p> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
1535		// SAFETY: all values 0-max are valid enum values
1536		(0..IcedConstants::CC_P_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_p>(x as u8) })
1537	}
1538}
1539#[test]
1540#[rustfmt::skip]
1541fn test_cc_p_values() {
1542	let mut iter = CC_p::values();
1543	assert_eq!(iter.size_hint(), (IcedConstants::CC_P_ENUM_COUNT, Some(IcedConstants::CC_P_ENUM_COUNT)));
1544	assert_eq!(iter.len(), IcedConstants::CC_P_ENUM_COUNT);
1545	assert!(iter.next().is_some());
1546	assert_eq!(iter.size_hint(), (IcedConstants::CC_P_ENUM_COUNT - 1, Some(IcedConstants::CC_P_ENUM_COUNT - 1)));
1547	assert_eq!(iter.len(), IcedConstants::CC_P_ENUM_COUNT - 1);
1548
1549	let values: Vec<CC_p> = CC_p::values().collect();
1550	assert_eq!(values.len(), IcedConstants::CC_P_ENUM_COUNT);
1551	for (i, value) in values.into_iter().enumerate() {
1552		assert_eq!(i, value as usize);
1553	}
1554
1555	let values1: Vec<CC_p> = CC_p::values().collect();
1556	let mut values2: Vec<CC_p> = CC_p::values().rev().collect();
1557	values2.reverse();
1558	assert_eq!(values1, values2);
1559}
1560#[rustfmt::skip]
1561impl TryFrom<usize> for CC_p {
1562	type Error = IcedError;
1563	#[inline]
1564	fn try_from(value: usize) -> Result<Self, Self::Error> {
1565		if value < IcedConstants::CC_P_ENUM_COUNT {
1566			// SAFETY: all values 0-max are valid enum values
1567			Ok(unsafe { mem::transmute(value as u8) })
1568		} else {
1569			Err(IcedError::new("Invalid CC_p value"))
1570		}
1571	}
1572}
1573#[test]
1574#[rustfmt::skip]
1575fn test_cc_p_try_from_usize() {
1576	for value in CC_p::values() {
1577		let converted = <CC_p as TryFrom<usize>>::try_from(value as usize).unwrap();
1578		assert_eq!(converted, value);
1579	}
1580	assert!(<CC_p as TryFrom<usize>>::try_from(IcedConstants::CC_P_ENUM_COUNT).is_err());
1581	assert!(<CC_p as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
1582}
1583#[cfg(feature = "serde")]
1584#[rustfmt::skip]
1585#[allow(clippy::zero_sized_map_values)]
1586const _: () = {
1587	use core::marker::PhantomData;
1588	use serde::de;
1589	use serde::{Deserialize, Deserializer, Serialize, Serializer};
1590	type EnumType = CC_p;
1591	impl Serialize for EnumType {
1592		#[inline]
1593		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1594		where
1595			S: Serializer,
1596		{
1597			serializer.serialize_u8(*self as u8)
1598		}
1599	}
1600	impl<'de> Deserialize<'de> for EnumType {
1601		#[inline]
1602		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1603		where
1604			D: Deserializer<'de>,
1605		{
1606			struct Visitor<'de> {
1607				marker: PhantomData<EnumType>,
1608				lifetime: PhantomData<&'de ()>,
1609			}
1610			impl<'de> de::Visitor<'de> for Visitor<'de> {
1611				type Value = EnumType;
1612				#[inline]
1613				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
1614					formatter.write_str("enum CC_p")
1615				}
1616				#[inline]
1617				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
1618				where
1619					E: de::Error,
1620				{
1621					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
1622						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
1623							return Ok(value);
1624						}
1625					}
1626					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_p variant value"))
1627				}
1628			}
1629			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
1630		}
1631	}
1632};
1633// GENERATOR-END: CC_p
1634
1635// GENERATOR-BEGIN: CC_np
1636// ⚠️This was generated by GENERATOR!🦹‍♂️
1637/// Mnemonic condition code selector (eg. `JNP` / `JPO`)
1638#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1639#[allow(non_camel_case_types)]
1640pub enum CC_np {
1641	/// `JNP`, `CMOVNP`, `SETNP`
1642	np = 0,
1643	/// `JPO`, `CMOVPO`, `SETPO`
1644	po = 1,
1645}
1646#[rustfmt::skip]
1647static GEN_DEBUG_CC_NP: [&str; 2] = [
1648	"np",
1649	"po",
1650];
1651impl fmt::Debug for CC_np {
1652	#[inline]
1653	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1654		write!(f, "{}", GEN_DEBUG_CC_NP[*self as usize])
1655	}
1656}
1657impl Default for CC_np {
1658	#[must_use]
1659	#[inline]
1660	fn default() -> Self {
1661		CC_np::np
1662	}
1663}
1664#[allow(non_camel_case_types)]
1665#[allow(dead_code)]
1666pub(crate) type CC_npUnderlyingType = u8;
1667#[rustfmt::skip]
1668impl CC_np {
1669	/// Iterates over all `CC_np` enum values
1670	#[inline]
1671	pub fn values() -> impl Iterator<Item = CC_np> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
1672		// SAFETY: all values 0-max are valid enum values
1673		(0..IcedConstants::CC_NP_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_np>(x as u8) })
1674	}
1675}
1676#[test]
1677#[rustfmt::skip]
1678fn test_cc_np_values() {
1679	let mut iter = CC_np::values();
1680	assert_eq!(iter.size_hint(), (IcedConstants::CC_NP_ENUM_COUNT, Some(IcedConstants::CC_NP_ENUM_COUNT)));
1681	assert_eq!(iter.len(), IcedConstants::CC_NP_ENUM_COUNT);
1682	assert!(iter.next().is_some());
1683	assert_eq!(iter.size_hint(), (IcedConstants::CC_NP_ENUM_COUNT - 1, Some(IcedConstants::CC_NP_ENUM_COUNT - 1)));
1684	assert_eq!(iter.len(), IcedConstants::CC_NP_ENUM_COUNT - 1);
1685
1686	let values: Vec<CC_np> = CC_np::values().collect();
1687	assert_eq!(values.len(), IcedConstants::CC_NP_ENUM_COUNT);
1688	for (i, value) in values.into_iter().enumerate() {
1689		assert_eq!(i, value as usize);
1690	}
1691
1692	let values1: Vec<CC_np> = CC_np::values().collect();
1693	let mut values2: Vec<CC_np> = CC_np::values().rev().collect();
1694	values2.reverse();
1695	assert_eq!(values1, values2);
1696}
1697#[rustfmt::skip]
1698impl TryFrom<usize> for CC_np {
1699	type Error = IcedError;
1700	#[inline]
1701	fn try_from(value: usize) -> Result<Self, Self::Error> {
1702		if value < IcedConstants::CC_NP_ENUM_COUNT {
1703			// SAFETY: all values 0-max are valid enum values
1704			Ok(unsafe { mem::transmute(value as u8) })
1705		} else {
1706			Err(IcedError::new("Invalid CC_np value"))
1707		}
1708	}
1709}
1710#[test]
1711#[rustfmt::skip]
1712fn test_cc_np_try_from_usize() {
1713	for value in CC_np::values() {
1714		let converted = <CC_np as TryFrom<usize>>::try_from(value as usize).unwrap();
1715		assert_eq!(converted, value);
1716	}
1717	assert!(<CC_np as TryFrom<usize>>::try_from(IcedConstants::CC_NP_ENUM_COUNT).is_err());
1718	assert!(<CC_np as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
1719}
1720#[cfg(feature = "serde")]
1721#[rustfmt::skip]
1722#[allow(clippy::zero_sized_map_values)]
1723const _: () = {
1724	use core::marker::PhantomData;
1725	use serde::de;
1726	use serde::{Deserialize, Deserializer, Serialize, Serializer};
1727	type EnumType = CC_np;
1728	impl Serialize for EnumType {
1729		#[inline]
1730		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1731		where
1732			S: Serializer,
1733		{
1734			serializer.serialize_u8(*self as u8)
1735		}
1736	}
1737	impl<'de> Deserialize<'de> for EnumType {
1738		#[inline]
1739		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1740		where
1741			D: Deserializer<'de>,
1742		{
1743			struct Visitor<'de> {
1744				marker: PhantomData<EnumType>,
1745				lifetime: PhantomData<&'de ()>,
1746			}
1747			impl<'de> de::Visitor<'de> for Visitor<'de> {
1748				type Value = EnumType;
1749				#[inline]
1750				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
1751					formatter.write_str("enum CC_np")
1752				}
1753				#[inline]
1754				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
1755				where
1756					E: de::Error,
1757				{
1758					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
1759						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
1760							return Ok(value);
1761						}
1762					}
1763					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_np variant value"))
1764				}
1765			}
1766			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
1767		}
1768	}
1769};
1770// GENERATOR-END: CC_np
1771
1772// GENERATOR-BEGIN: CC_l
1773// ⚠️This was generated by GENERATOR!🦹‍♂️
1774/// Mnemonic condition code selector (eg. `JL` / `JNGE`)
1775#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1776#[allow(non_camel_case_types)]
1777pub enum CC_l {
1778	/// `JL`, `CMOVL`, `SETL`
1779	l = 0,
1780	/// `JNGE`, `CMOVNGE`, `SETNGE`
1781	nge = 1,
1782}
1783#[rustfmt::skip]
1784static GEN_DEBUG_CC_L: [&str; 2] = [
1785	"l",
1786	"nge",
1787];
1788impl fmt::Debug for CC_l {
1789	#[inline]
1790	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1791		write!(f, "{}", GEN_DEBUG_CC_L[*self as usize])
1792	}
1793}
1794impl Default for CC_l {
1795	#[must_use]
1796	#[inline]
1797	fn default() -> Self {
1798		CC_l::l
1799	}
1800}
1801#[allow(non_camel_case_types)]
1802#[allow(dead_code)]
1803pub(crate) type CC_lUnderlyingType = u8;
1804#[rustfmt::skip]
1805impl CC_l {
1806	/// Iterates over all `CC_l` enum values
1807	#[inline]
1808	pub fn values() -> impl Iterator<Item = CC_l> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
1809		// SAFETY: all values 0-max are valid enum values
1810		(0..IcedConstants::CC_L_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_l>(x as u8) })
1811	}
1812}
1813#[test]
1814#[rustfmt::skip]
1815fn test_cc_l_values() {
1816	let mut iter = CC_l::values();
1817	assert_eq!(iter.size_hint(), (IcedConstants::CC_L_ENUM_COUNT, Some(IcedConstants::CC_L_ENUM_COUNT)));
1818	assert_eq!(iter.len(), IcedConstants::CC_L_ENUM_COUNT);
1819	assert!(iter.next().is_some());
1820	assert_eq!(iter.size_hint(), (IcedConstants::CC_L_ENUM_COUNT - 1, Some(IcedConstants::CC_L_ENUM_COUNT - 1)));
1821	assert_eq!(iter.len(), IcedConstants::CC_L_ENUM_COUNT - 1);
1822
1823	let values: Vec<CC_l> = CC_l::values().collect();
1824	assert_eq!(values.len(), IcedConstants::CC_L_ENUM_COUNT);
1825	for (i, value) in values.into_iter().enumerate() {
1826		assert_eq!(i, value as usize);
1827	}
1828
1829	let values1: Vec<CC_l> = CC_l::values().collect();
1830	let mut values2: Vec<CC_l> = CC_l::values().rev().collect();
1831	values2.reverse();
1832	assert_eq!(values1, values2);
1833}
1834#[rustfmt::skip]
1835impl TryFrom<usize> for CC_l {
1836	type Error = IcedError;
1837	#[inline]
1838	fn try_from(value: usize) -> Result<Self, Self::Error> {
1839		if value < IcedConstants::CC_L_ENUM_COUNT {
1840			// SAFETY: all values 0-max are valid enum values
1841			Ok(unsafe { mem::transmute(value as u8) })
1842		} else {
1843			Err(IcedError::new("Invalid CC_l value"))
1844		}
1845	}
1846}
1847#[test]
1848#[rustfmt::skip]
1849fn test_cc_l_try_from_usize() {
1850	for value in CC_l::values() {
1851		let converted = <CC_l as TryFrom<usize>>::try_from(value as usize).unwrap();
1852		assert_eq!(converted, value);
1853	}
1854	assert!(<CC_l as TryFrom<usize>>::try_from(IcedConstants::CC_L_ENUM_COUNT).is_err());
1855	assert!(<CC_l as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
1856}
1857#[cfg(feature = "serde")]
1858#[rustfmt::skip]
1859#[allow(clippy::zero_sized_map_values)]
1860const _: () = {
1861	use core::marker::PhantomData;
1862	use serde::de;
1863	use serde::{Deserialize, Deserializer, Serialize, Serializer};
1864	type EnumType = CC_l;
1865	impl Serialize for EnumType {
1866		#[inline]
1867		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1868		where
1869			S: Serializer,
1870		{
1871			serializer.serialize_u8(*self as u8)
1872		}
1873	}
1874	impl<'de> Deserialize<'de> for EnumType {
1875		#[inline]
1876		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1877		where
1878			D: Deserializer<'de>,
1879		{
1880			struct Visitor<'de> {
1881				marker: PhantomData<EnumType>,
1882				lifetime: PhantomData<&'de ()>,
1883			}
1884			impl<'de> de::Visitor<'de> for Visitor<'de> {
1885				type Value = EnumType;
1886				#[inline]
1887				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
1888					formatter.write_str("enum CC_l")
1889				}
1890				#[inline]
1891				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
1892				where
1893					E: de::Error,
1894				{
1895					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
1896						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
1897							return Ok(value);
1898						}
1899					}
1900					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_l variant value"))
1901				}
1902			}
1903			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
1904		}
1905	}
1906};
1907// GENERATOR-END: CC_l
1908
1909// GENERATOR-BEGIN: CC_ge
1910// ⚠️This was generated by GENERATOR!🦹‍♂️
1911/// Mnemonic condition code selector (eg. `JGE` / `JNL`)
1912#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1913#[allow(non_camel_case_types)]
1914pub enum CC_ge {
1915	/// `JGE`, `CMOVGE`, `SETGE`
1916	ge = 0,
1917	/// `JNL`, `CMOVNL`, `SETNL`
1918	nl = 1,
1919}
1920#[rustfmt::skip]
1921static GEN_DEBUG_CC_GE: [&str; 2] = [
1922	"ge",
1923	"nl",
1924];
1925impl fmt::Debug for CC_ge {
1926	#[inline]
1927	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1928		write!(f, "{}", GEN_DEBUG_CC_GE[*self as usize])
1929	}
1930}
1931impl Default for CC_ge {
1932	#[must_use]
1933	#[inline]
1934	fn default() -> Self {
1935		CC_ge::ge
1936	}
1937}
1938#[allow(non_camel_case_types)]
1939#[allow(dead_code)]
1940pub(crate) type CC_geUnderlyingType = u8;
1941#[rustfmt::skip]
1942impl CC_ge {
1943	/// Iterates over all `CC_ge` enum values
1944	#[inline]
1945	pub fn values() -> impl Iterator<Item = CC_ge> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
1946		// SAFETY: all values 0-max are valid enum values
1947		(0..IcedConstants::CC_GE_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_ge>(x as u8) })
1948	}
1949}
1950#[test]
1951#[rustfmt::skip]
1952fn test_cc_ge_values() {
1953	let mut iter = CC_ge::values();
1954	assert_eq!(iter.size_hint(), (IcedConstants::CC_GE_ENUM_COUNT, Some(IcedConstants::CC_GE_ENUM_COUNT)));
1955	assert_eq!(iter.len(), IcedConstants::CC_GE_ENUM_COUNT);
1956	assert!(iter.next().is_some());
1957	assert_eq!(iter.size_hint(), (IcedConstants::CC_GE_ENUM_COUNT - 1, Some(IcedConstants::CC_GE_ENUM_COUNT - 1)));
1958	assert_eq!(iter.len(), IcedConstants::CC_GE_ENUM_COUNT - 1);
1959
1960	let values: Vec<CC_ge> = CC_ge::values().collect();
1961	assert_eq!(values.len(), IcedConstants::CC_GE_ENUM_COUNT);
1962	for (i, value) in values.into_iter().enumerate() {
1963		assert_eq!(i, value as usize);
1964	}
1965
1966	let values1: Vec<CC_ge> = CC_ge::values().collect();
1967	let mut values2: Vec<CC_ge> = CC_ge::values().rev().collect();
1968	values2.reverse();
1969	assert_eq!(values1, values2);
1970}
1971#[rustfmt::skip]
1972impl TryFrom<usize> for CC_ge {
1973	type Error = IcedError;
1974	#[inline]
1975	fn try_from(value: usize) -> Result<Self, Self::Error> {
1976		if value < IcedConstants::CC_GE_ENUM_COUNT {
1977			// SAFETY: all values 0-max are valid enum values
1978			Ok(unsafe { mem::transmute(value as u8) })
1979		} else {
1980			Err(IcedError::new("Invalid CC_ge value"))
1981		}
1982	}
1983}
1984#[test]
1985#[rustfmt::skip]
1986fn test_cc_ge_try_from_usize() {
1987	for value in CC_ge::values() {
1988		let converted = <CC_ge as TryFrom<usize>>::try_from(value as usize).unwrap();
1989		assert_eq!(converted, value);
1990	}
1991	assert!(<CC_ge as TryFrom<usize>>::try_from(IcedConstants::CC_GE_ENUM_COUNT).is_err());
1992	assert!(<CC_ge as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
1993}
1994#[cfg(feature = "serde")]
1995#[rustfmt::skip]
1996#[allow(clippy::zero_sized_map_values)]
1997const _: () = {
1998	use core::marker::PhantomData;
1999	use serde::de;
2000	use serde::{Deserialize, Deserializer, Serialize, Serializer};
2001	type EnumType = CC_ge;
2002	impl Serialize for EnumType {
2003		#[inline]
2004		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2005		where
2006			S: Serializer,
2007		{
2008			serializer.serialize_u8(*self as u8)
2009		}
2010	}
2011	impl<'de> Deserialize<'de> for EnumType {
2012		#[inline]
2013		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2014		where
2015			D: Deserializer<'de>,
2016		{
2017			struct Visitor<'de> {
2018				marker: PhantomData<EnumType>,
2019				lifetime: PhantomData<&'de ()>,
2020			}
2021			impl<'de> de::Visitor<'de> for Visitor<'de> {
2022				type Value = EnumType;
2023				#[inline]
2024				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
2025					formatter.write_str("enum CC_ge")
2026				}
2027				#[inline]
2028				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2029				where
2030					E: de::Error,
2031				{
2032					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
2033						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
2034							return Ok(value);
2035						}
2036					}
2037					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_ge variant value"))
2038				}
2039			}
2040			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
2041		}
2042	}
2043};
2044// GENERATOR-END: CC_ge
2045
2046// GENERATOR-BEGIN: CC_le
2047// ⚠️This was generated by GENERATOR!🦹‍♂️
2048/// Mnemonic condition code selector (eg. `JLE` / `JNG`)
2049#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2050#[allow(non_camel_case_types)]
2051pub enum CC_le {
2052	/// `JLE`, `CMOVLE`, `SETLE`
2053	le = 0,
2054	/// `JNG`, `CMOVNG`, `SETNG`
2055	ng = 1,
2056}
2057#[rustfmt::skip]
2058static GEN_DEBUG_CC_LE: [&str; 2] = [
2059	"le",
2060	"ng",
2061];
2062impl fmt::Debug for CC_le {
2063	#[inline]
2064	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2065		write!(f, "{}", GEN_DEBUG_CC_LE[*self as usize])
2066	}
2067}
2068impl Default for CC_le {
2069	#[must_use]
2070	#[inline]
2071	fn default() -> Self {
2072		CC_le::le
2073	}
2074}
2075#[allow(non_camel_case_types)]
2076#[allow(dead_code)]
2077pub(crate) type CC_leUnderlyingType = u8;
2078#[rustfmt::skip]
2079impl CC_le {
2080	/// Iterates over all `CC_le` enum values
2081	#[inline]
2082	pub fn values() -> impl Iterator<Item = CC_le> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
2083		// SAFETY: all values 0-max are valid enum values
2084		(0..IcedConstants::CC_LE_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_le>(x as u8) })
2085	}
2086}
2087#[test]
2088#[rustfmt::skip]
2089fn test_cc_le_values() {
2090	let mut iter = CC_le::values();
2091	assert_eq!(iter.size_hint(), (IcedConstants::CC_LE_ENUM_COUNT, Some(IcedConstants::CC_LE_ENUM_COUNT)));
2092	assert_eq!(iter.len(), IcedConstants::CC_LE_ENUM_COUNT);
2093	assert!(iter.next().is_some());
2094	assert_eq!(iter.size_hint(), (IcedConstants::CC_LE_ENUM_COUNT - 1, Some(IcedConstants::CC_LE_ENUM_COUNT - 1)));
2095	assert_eq!(iter.len(), IcedConstants::CC_LE_ENUM_COUNT - 1);
2096
2097	let values: Vec<CC_le> = CC_le::values().collect();
2098	assert_eq!(values.len(), IcedConstants::CC_LE_ENUM_COUNT);
2099	for (i, value) in values.into_iter().enumerate() {
2100		assert_eq!(i, value as usize);
2101	}
2102
2103	let values1: Vec<CC_le> = CC_le::values().collect();
2104	let mut values2: Vec<CC_le> = CC_le::values().rev().collect();
2105	values2.reverse();
2106	assert_eq!(values1, values2);
2107}
2108#[rustfmt::skip]
2109impl TryFrom<usize> for CC_le {
2110	type Error = IcedError;
2111	#[inline]
2112	fn try_from(value: usize) -> Result<Self, Self::Error> {
2113		if value < IcedConstants::CC_LE_ENUM_COUNT {
2114			// SAFETY: all values 0-max are valid enum values
2115			Ok(unsafe { mem::transmute(value as u8) })
2116		} else {
2117			Err(IcedError::new("Invalid CC_le value"))
2118		}
2119	}
2120}
2121#[test]
2122#[rustfmt::skip]
2123fn test_cc_le_try_from_usize() {
2124	for value in CC_le::values() {
2125		let converted = <CC_le as TryFrom<usize>>::try_from(value as usize).unwrap();
2126		assert_eq!(converted, value);
2127	}
2128	assert!(<CC_le as TryFrom<usize>>::try_from(IcedConstants::CC_LE_ENUM_COUNT).is_err());
2129	assert!(<CC_le as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
2130}
2131#[cfg(feature = "serde")]
2132#[rustfmt::skip]
2133#[allow(clippy::zero_sized_map_values)]
2134const _: () = {
2135	use core::marker::PhantomData;
2136	use serde::de;
2137	use serde::{Deserialize, Deserializer, Serialize, Serializer};
2138	type EnumType = CC_le;
2139	impl Serialize for EnumType {
2140		#[inline]
2141		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2142		where
2143			S: Serializer,
2144		{
2145			serializer.serialize_u8(*self as u8)
2146		}
2147	}
2148	impl<'de> Deserialize<'de> for EnumType {
2149		#[inline]
2150		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2151		where
2152			D: Deserializer<'de>,
2153		{
2154			struct Visitor<'de> {
2155				marker: PhantomData<EnumType>,
2156				lifetime: PhantomData<&'de ()>,
2157			}
2158			impl<'de> de::Visitor<'de> for Visitor<'de> {
2159				type Value = EnumType;
2160				#[inline]
2161				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
2162					formatter.write_str("enum CC_le")
2163				}
2164				#[inline]
2165				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2166				where
2167					E: de::Error,
2168				{
2169					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
2170						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
2171							return Ok(value);
2172						}
2173					}
2174					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_le variant value"))
2175				}
2176			}
2177			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
2178		}
2179	}
2180};
2181// GENERATOR-END: CC_le
2182
2183// GENERATOR-BEGIN: CC_g
2184// ⚠️This was generated by GENERATOR!🦹‍♂️
2185/// Mnemonic condition code selector (eg. `JG` / `JNLE`)
2186#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2187#[allow(non_camel_case_types)]
2188pub enum CC_g {
2189	/// `JG`, `CMOVG`, `SETG`
2190	g = 0,
2191	/// `JNLE`, `CMOVNLE`, `SETNLE`
2192	nle = 1,
2193}
2194#[rustfmt::skip]
2195static GEN_DEBUG_CC_G: [&str; 2] = [
2196	"g",
2197	"nle",
2198];
2199impl fmt::Debug for CC_g {
2200	#[inline]
2201	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2202		write!(f, "{}", GEN_DEBUG_CC_G[*self as usize])
2203	}
2204}
2205impl Default for CC_g {
2206	#[must_use]
2207	#[inline]
2208	fn default() -> Self {
2209		CC_g::g
2210	}
2211}
2212#[allow(non_camel_case_types)]
2213#[allow(dead_code)]
2214pub(crate) type CC_gUnderlyingType = u8;
2215#[rustfmt::skip]
2216impl CC_g {
2217	/// Iterates over all `CC_g` enum values
2218	#[inline]
2219	pub fn values() -> impl Iterator<Item = CC_g> + DoubleEndedIterator + ExactSizeIterator + FusedIterator {
2220		// SAFETY: all values 0-max are valid enum values
2221		(0..IcedConstants::CC_G_ENUM_COUNT).map(|x| unsafe { mem::transmute::<u8, CC_g>(x as u8) })
2222	}
2223}
2224#[test]
2225#[rustfmt::skip]
2226fn test_cc_g_values() {
2227	let mut iter = CC_g::values();
2228	assert_eq!(iter.size_hint(), (IcedConstants::CC_G_ENUM_COUNT, Some(IcedConstants::CC_G_ENUM_COUNT)));
2229	assert_eq!(iter.len(), IcedConstants::CC_G_ENUM_COUNT);
2230	assert!(iter.next().is_some());
2231	assert_eq!(iter.size_hint(), (IcedConstants::CC_G_ENUM_COUNT - 1, Some(IcedConstants::CC_G_ENUM_COUNT - 1)));
2232	assert_eq!(iter.len(), IcedConstants::CC_G_ENUM_COUNT - 1);
2233
2234	let values: Vec<CC_g> = CC_g::values().collect();
2235	assert_eq!(values.len(), IcedConstants::CC_G_ENUM_COUNT);
2236	for (i, value) in values.into_iter().enumerate() {
2237		assert_eq!(i, value as usize);
2238	}
2239
2240	let values1: Vec<CC_g> = CC_g::values().collect();
2241	let mut values2: Vec<CC_g> = CC_g::values().rev().collect();
2242	values2.reverse();
2243	assert_eq!(values1, values2);
2244}
2245#[rustfmt::skip]
2246impl TryFrom<usize> for CC_g {
2247	type Error = IcedError;
2248	#[inline]
2249	fn try_from(value: usize) -> Result<Self, Self::Error> {
2250		if value < IcedConstants::CC_G_ENUM_COUNT {
2251			// SAFETY: all values 0-max are valid enum values
2252			Ok(unsafe { mem::transmute(value as u8) })
2253		} else {
2254			Err(IcedError::new("Invalid CC_g value"))
2255		}
2256	}
2257}
2258#[test]
2259#[rustfmt::skip]
2260fn test_cc_g_try_from_usize() {
2261	for value in CC_g::values() {
2262		let converted = <CC_g as TryFrom<usize>>::try_from(value as usize).unwrap();
2263		assert_eq!(converted, value);
2264	}
2265	assert!(<CC_g as TryFrom<usize>>::try_from(IcedConstants::CC_G_ENUM_COUNT).is_err());
2266	assert!(<CC_g as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
2267}
2268#[cfg(feature = "serde")]
2269#[rustfmt::skip]
2270#[allow(clippy::zero_sized_map_values)]
2271const _: () = {
2272	use core::marker::PhantomData;
2273	use serde::de;
2274	use serde::{Deserialize, Deserializer, Serialize, Serializer};
2275	type EnumType = CC_g;
2276	impl Serialize for EnumType {
2277		#[inline]
2278		fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
2279		where
2280			S: Serializer,
2281		{
2282			serializer.serialize_u8(*self as u8)
2283		}
2284	}
2285	impl<'de> Deserialize<'de> for EnumType {
2286		#[inline]
2287		fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
2288		where
2289			D: Deserializer<'de>,
2290		{
2291			struct Visitor<'de> {
2292				marker: PhantomData<EnumType>,
2293				lifetime: PhantomData<&'de ()>,
2294			}
2295			impl<'de> de::Visitor<'de> for Visitor<'de> {
2296				type Value = EnumType;
2297				#[inline]
2298				fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
2299					formatter.write_str("enum CC_g")
2300				}
2301				#[inline]
2302				fn visit_u64<E>(self, v: u64) -> Result<Self::Value, E>
2303				where
2304					E: de::Error,
2305				{
2306					if let Ok(v) = <usize as TryFrom<_>>::try_from(v) {
2307						if let Ok(value) = <EnumType as TryFrom<_>>::try_from(v) {
2308							return Ok(value);
2309						}
2310					}
2311					Err(de::Error::invalid_value(de::Unexpected::Unsigned(v), &"a valid CC_g variant value"))
2312				}
2313			}
2314			deserializer.deserialize_u8(Visitor { marker: PhantomData::<EnumType>, lifetime: PhantomData })
2315		}
2316	}
2317};
2318// GENERATOR-END: CC_g