blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
140
path
stringlengths
5
183
src_encoding
stringclasses
6 values
length_bytes
int64
12
5.32M
score
float64
2.52
4.94
int_score
int64
3
5
detected_licenses
listlengths
0
47
license_type
stringclasses
2 values
text
stringlengths
12
5.32M
download_success
bool
1 class
378e53001f470a2ab4056799ec347256081ba050
Rust
tlinford/raytracer-challenge-rs
/raytracer/src/geometry/shape/test_shape.rs
UTF-8
4,102
3.3125
3
[]
no_license
use std::{any::Any, sync::RwLock}; use crate::{ bounding_box::BoundingBox, geometry::{intersection::Intersection, BaseShape, Shape}, point::Point, ray::Ray, vector::Vector, }; #[derive(Debug)] pub struct TestShape { base: BaseShape, pub saved_ray: RwLock<Ray>, } impl Default for TestShape { fn default() -> Self { Self { base: BaseShape { bounding_box: BoundingBox::new(Point::new(-1, -1, -1), Point::new(1, 1, 1)), ..Default::default() }, saved_ray: RwLock::new(Ray::new(Point::origin(), Vector::new(0, 0, 0))), } } } impl Shape for TestShape { fn get_base(&self) -> &BaseShape { &self.base } fn get_base_mut(&mut self) -> &mut BaseShape { &mut self.base } fn as_any(&self) -> &dyn Any { self } fn equals(&self, other: &dyn Shape) -> bool { self.get_base() == other.get_base() } fn local_intersect(&self, ray: &Ray) -> Vec<Intersection> { *self.saved_ray.write().unwrap() = Ray::new(ray.origin(), ray.direction()); vec![] } fn local_normal_at(&self, point: Point, _intersection: &Intersection) -> Vector { Vector::new(point.x, point.y, point.z) } } #[cfg(test)] mod tests { use std::{f32::consts::FRAC_1_SQRT_2, f64::consts::PI}; use crate::{ material::Material, matrix::Matrix, transform::{rotation_y, scaling, translation}, }; use super::*; #[test] fn default_transformation() { let s = TestShape::default(); assert_eq!(s.transform(), &Matrix::identity(4, 4)); } #[test] fn assign_transformation() { let mut s = TestShape::default(); let t = translation(2, 3, 4); s.set_transform(t.clone()); assert_eq!(s.transform(), &t); } #[test] fn default_material() { let s = TestShape::default(); assert_eq!(s.material(), &Material::default()); } #[test] fn assign_material() { let mut s = TestShape::default(); let mut m = Material::default(); m.ambient = 1.0; s.set_material(m); let mut m = Material::default(); m.ambient = 1.0; assert_eq!(s.material(), &m); } #[test] fn intersect_scaled_shape_with_ray() { let r = Ray::new(Point::new(0, 0, -5), Vector::new(0, 0, 1)); let mut s = TestShape::default(); s.set_transform(scaling(2, 2, 2)); s.intersect(&r); let r = s.saved_ray.read().unwrap(); assert_eq!(r.origin(), Point::new(0.0, 0.0, -2.5)); assert_eq!(r.direction(), Vector::new(0.0, 0.0, 0.5)); } #[test] fn intersect_translated_shape_with_ray() { let r = Ray::new(Point::new(0, 0, -5), Vector::new(0, 0, 1)); let mut s = TestShape::default(); s.set_transform(translation(5, 0, 0)); s.intersect(&r); let r = s.saved_ray.read().unwrap(); assert_eq!(r.origin(), Point::new(-5, 0, -5)); assert_eq!(r.direction(), Vector::new(0, 0, 1)); } #[test] fn normal_translated_shape() { let mut s = TestShape::default(); s.set_transform(translation(0, 1, 0)); let n = s.normal_at( Point::new(0.0, 1.70711, -FRAC_1_SQRT_2), &Intersection::new(-100.0, &s), ); assert_eq!(n, Vector::new(0.0, FRAC_1_SQRT_2, -FRAC_1_SQRT_2)); } #[test] fn normal_transformed_shape() { let mut s = TestShape::default(); s.set_transform(&scaling(1.0, 0.5, 1.0) * &rotation_y(PI / 5.0)); let n = s.normal_at( Point::new(0.0, 2.0f64.sqrt() / 2.0, -(2.0f64.sqrt() / 2.0)), &Intersection::new(-100.0, &s), ); assert_eq!(n, Vector::new(0.0, 0.97014, -0.24254)); } #[test] fn test_shape_bounds() { let s = TestShape::default(); let bb = s.get_bounds(); assert_eq!(bb.get_min(), Point::new(-1, -1, -1)); assert_eq!(bb.get_max(), Point::new(1, 1, 1)); } }
true
3b97a2d7bfd8c19eb4a260d35e9f5460af288728
Rust
IThawk/rust-project
/rust-master/src/test/ui/borrowck/borrowck-move-mut-base-ptr.rs
UTF-8
415
2.90625
3
[ "MIT", "LicenseRef-scancode-other-permissive", "Apache-2.0", "BSD-3-Clause", "BSD-2-Clause", "NCSA" ]
permissive
// Test that attempt to move `&mut` pointer while pointee is borrowed // yields an error. // // Example from src/librustc_borrowck/borrowck/README.md fn foo(t0: &mut isize) { let p: &isize = &*t0; // Freezes `*t0` let t1 = t0; //~ ERROR cannot move out of `t0` *t1 = 22; p.use_ref(); } fn main() { } trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } } impl<T> Fake for T { }
true
6d8861afb4e7c92ecc6df024c4de4ae7a2680814
Rust
JoNil/loka-n64
/n64-alloc/src/lib.rs
UTF-8
22,715
2.515625
3
[]
no_license
#![no_std] #![allow(clippy::declare_interior_mutable_const)] #![allow(clippy::cast_ptr_alignment)] #![allow(clippy::needless_lifetimes)] extern crate alloc; mod const_init; mod imp_static_array; mod neighbors; mod size_classes; use const_init::ConstInit; use core::alloc::{GlobalAlloc, Layout}; use core::cell::Cell; use core::cmp; use core::marker::Sync; use core::ptr::{self, NonNull}; use core::sync::atomic::{AtomicI32, Ordering}; use imp_static_array as imp; use memory_units::{size_of, ByteSize, Bytes, Pages, RoundUpTo, Words}; use neighbors::Neighbors; pub(crate) struct AllocErr; #[inline] fn checked_round_up_to<T>(b: Bytes) -> Option<T> where T: ByteSize, Bytes: RoundUpTo<T>, { if b.0.checked_add(T::BYTE_SIZE.0).is_none() { None } else { Some(b.round_up_to()) } } #[repr(C)] #[derive(Default, Debug)] struct CellHeader<'a> { neighbors: Neighbors<'a, CellHeader<'a>>, } impl<'a> AsRef<Neighbors<'a, CellHeader<'a>>> for CellHeader<'a> { fn as_ref(&self) -> &Neighbors<'a, CellHeader<'a>> { &self.neighbors } } unsafe impl<'a> neighbors::HasNeighbors<'a, CellHeader<'a>> for CellHeader<'a> { #[inline] unsafe fn next_checked( neighbors: &Neighbors<'a, CellHeader<'a>>, next: *const CellHeader<'a>, ) -> Option<&'a CellHeader<'a>> { if next.is_null() || CellHeader::next_cell_is_invalid(neighbors) { None } else { Some(&*next) } } #[inline] unsafe fn prev_checked( _neighbors: &Neighbors<'a, CellHeader<'a>>, prev: *const CellHeader<'a>, ) -> Option<&'a CellHeader<'a>> { if prev.is_null() { None } else { Some(&*prev) } } } #[repr(C)] #[derive(Debug)] struct AllocatedCell<'a> { header: CellHeader<'a>, } #[test] fn allocated_cell_layout() { assert_eq!( size_of::<CellHeader>(), size_of::<AllocatedCell>(), "Safety and correctness depends on AllocatedCell being the same as CellHeader" ); assert_eq!( core::mem::align_of::<CellHeader>(), core::mem::align_of::<AllocatedCell>() ); } #[repr(C)] #[derive(Debug)] struct FreeCell<'a> { header: CellHeader<'a>, next_free_raw: Cell<*const FreeCell<'a>>, } #[test] fn free_cell_layout() { assert_eq!( size_of::<CellHeader>() + Words(1), size_of::<FreeCell>(), "Safety and correctness depends on FreeCell being only one word larger than CellHeader" ); assert_eq!( core::mem::align_of::<CellHeader>(), core::mem::align_of::<AllocatedCell>() ); } impl<'a> CellHeader<'a> { // ### Semantics of Low Bits in Neighbors Pointers // // If `self.neighbors.next_bit_1` is set, then the cell is allocated, and // should never be in the free list. If the bit is not set, then this cell // is free, and must be in the free list (or is in the process of being // added to the free list). // // The `self.neighbors.next` pointer always points to the byte just *after* // this cell. If the `self.neighbors.next_bit_2` bit is not set, then it // points to the next cell. If that bit is set, then it points to the // invalid memory that follows this cell. fn is_allocated(&self) -> bool { self.neighbors.get_next_bit_1() } fn is_free(&self) -> bool { !self.is_allocated() } fn set_allocated(neighbors: &Neighbors<'a, Self>) { neighbors.set_next_bit_1(); } fn set_free(neighbors: &Neighbors<'a, Self>) { neighbors.clear_next_bit_1(); } fn next_cell_is_invalid(neighbors: &Neighbors<'a, Self>) -> bool { neighbors.get_next_bit_2() } fn set_next_cell_is_invalid(neighbors: &Neighbors<'a, Self>) { neighbors.set_next_bit_2(); } fn clear_next_cell_is_invalid(neighbors: &Neighbors<'a, Self>) { neighbors.clear_next_bit_2(); } fn size(&self) -> Bytes { let data = unsafe { (self as *const CellHeader<'a>).offset(1) }; let data = data as usize; let next = self.neighbors.next_unchecked(); let next = next as usize; Bytes(next - data) } fn as_free_cell(&self) -> Option<&FreeCell<'a>> { if self.is_free() { Some(unsafe { &*(self as *const CellHeader as *const FreeCell) }) } else { None } } // Get a pointer to this cell's data without regard to whether this cell is // allocated or free. unsafe fn unchecked_data(&self) -> *const u8 { (self as *const CellHeader).offset(1) as *const u8 } // Is this cell aligned to the given power-of-2 alignment? fn is_aligned_to<B: Into<Bytes>>(&self, align: B) -> bool { let align = align.into(); let data = unsafe { self.unchecked_data() } as usize; data & (align.0 - 1) == 0 } } impl<'a> FreeCell<'a> { // Low bits in `FreeCell::next_free_raw`. // // If `NEXT_FREE_CELL_CAN_MERGE` is set, then the following invariants hold // true: // // * `FreeCell::next_free_raw` (and'd with the mask) is not null. // * `FreeCell::next_free_raw` is the adjacent `CellHeader::prev_cell_raw`. // // Therefore, this free cell can be merged into a single, larger, contiguous // free cell with its previous neighbor, which is also the next cell in the // free list. const NEXT_FREE_CELL_CAN_MERGE: usize = 0b01; const _RESERVED: usize = 0b10; const MASK: usize = !0b11; fn next_free_can_merge(&self) -> bool { self.next_free_raw.get() as usize & Self::NEXT_FREE_CELL_CAN_MERGE != 0 } fn set_next_free_can_merge(&self) { let next_free = self.next_free_raw.get() as usize; let next_free = next_free | Self::NEXT_FREE_CELL_CAN_MERGE; self.next_free_raw.set(next_free as *const FreeCell); } fn clear_next_free_can_merge(&self) { let next_free = self.next_free_raw.get() as usize; let next_free = next_free & !Self::NEXT_FREE_CELL_CAN_MERGE; self.next_free_raw.set(next_free as *const FreeCell); } fn next_free(&self) -> *const FreeCell<'a> { let next_free = self.next_free_raw.get() as usize & Self::MASK; next_free as *const FreeCell<'a> } unsafe fn from_uninitialized( raw: NonNull<u8>, _size: Bytes, next_free: Option<*const FreeCell<'a>>, _policy: &dyn AllocPolicy<'a>, ) -> *const FreeCell<'a> { let next_free = next_free.unwrap_or(ptr::null_mut()); let raw = raw.as_ptr() as *mut FreeCell; ptr::write( raw, FreeCell { header: CellHeader::default(), next_free_raw: Cell::new(next_free), }, ); raw } fn as_allocated_cell(&self, _policy: &dyn AllocPolicy<'a>) -> &AllocatedCell<'a> { CellHeader::set_allocated(&self.header.neighbors); unsafe { &*(self as *const FreeCell as *const AllocatedCell) } } // Try and satisfy the given allocation request with this cell. fn try_alloc<'b>( &'b self, previous: &'b Cell<*const FreeCell<'a>>, alloc_size: Words, align: Bytes, policy: &dyn AllocPolicy<'a>, ) -> Option<&'b AllocatedCell<'a>> { // First, do a quick check that this cell can hold an allocation of the // requested size. let size: Bytes = alloc_size.into(); if self.header.size() < size { return None; } // Next, try and allocate by splitting this cell in two, and returning // the second half. // // We allocate from the end of this cell, rather than the beginning, // because it allows us to satisfy alignment requests. Since we can // choose to split at some alignment and return the aligned cell at the // end. let next = self.header.neighbors.next_unchecked() as usize; let split_and_aligned = (next - size.0) & !(align.0 - 1); let data = unsafe { self.header.unchecked_data() } as usize; let min_cell_size: Bytes = policy.min_cell_size(alloc_size).into(); if data + size_of::<CellHeader>().0 + min_cell_size.0 <= split_and_aligned { let split_cell_head = split_and_aligned - size_of::<CellHeader>().0; let split_cell = unsafe { &*FreeCell::from_uninitialized( unchecked_unwrap(NonNull::new(split_cell_head as *mut u8)), Bytes(next - split_cell_head) - size_of::<CellHeader>(), None, policy, ) }; Neighbors::append(&self.header, &split_cell.header); self.clear_next_free_can_merge(); if CellHeader::next_cell_is_invalid(&self.header.neighbors) { CellHeader::clear_next_cell_is_invalid(&self.header.neighbors); CellHeader::set_next_cell_is_invalid(&split_cell.header.neighbors); } return Some(split_cell.as_allocated_cell(policy)); } // There isn't enough room to split this cell and still satisfy the // requested allocation. Because of the early check, we know this cell // is large enough to fit the requested size, but is the cell's data // properly aligned? if self.header.is_aligned_to(align) { previous.set(self.next_free()); let allocated = self.as_allocated_cell(policy); return Some(allocated); } None } fn insert_into_free_list<'b>( &'b self, head: &'b Cell<*const FreeCell<'a>>, _policy: &dyn AllocPolicy<'a>, ) -> &'b Cell<*const FreeCell<'a>> { self.next_free_raw.set(head.get()); head.set(self); head } } impl<'a> AllocatedCell<'a> { unsafe fn as_free_cell(&self, _policy: &dyn AllocPolicy<'a>) -> &FreeCell<'a> { CellHeader::set_free(&self.header.neighbors); let free: &FreeCell = &*(self as *const AllocatedCell as *const FreeCell); free.next_free_raw.set(ptr::null_mut()); free } fn data(&self) -> *const u8 { let cell = &self.header as *const CellHeader; unsafe { cell.offset(1) as *const u8 } } } trait AllocPolicy<'a> { unsafe fn new_cell_for_free_list( &self, size: Words, align: Bytes, ) -> Result<*const FreeCell<'a>, AllocErr>; fn min_cell_size(&self, alloc_size: Words) -> Words; fn should_merge_adjacent_free_cells(&self) -> bool; } struct LargeAllocPolicy; static LARGE_ALLOC_POLICY: LargeAllocPolicy = LargeAllocPolicy; impl LargeAllocPolicy { const MIN_CELL_SIZE: Words = Words(size_classes::SizeClasses::NUM_SIZE_CLASSES * 2); } impl<'a> AllocPolicy<'a> for LargeAllocPolicy { unsafe fn new_cell_for_free_list( &self, size: Words, align: Bytes, ) -> Result<*const FreeCell<'a>, AllocErr> { // To assure that an allocation will always succeed after refilling the // free list with this new cell, make sure that we allocate enough to // fulfill the requested alignment, and still have the minimum cell size // left over. let size: Bytes = cmp::max(size.into(), (align + Self::MIN_CELL_SIZE) * Words(2)); let pages: Pages = (size + size_of::<CellHeader>()).round_up_to(); let new_pages = imp::alloc_pages(pages)?; let allocated_size: Bytes = pages.into(); let free_cell = &*FreeCell::from_uninitialized( new_pages, allocated_size - size_of::<CellHeader>(), None, self as &dyn AllocPolicy<'a>, ); let next_cell = (new_pages.as_ptr() as *const u8).add(allocated_size.0); free_cell .header .neighbors .set_next(next_cell as *const CellHeader); CellHeader::set_next_cell_is_invalid(&free_cell.header.neighbors); Ok(free_cell) } fn min_cell_size(&self, _alloc_size: Words) -> Words { Self::MIN_CELL_SIZE } fn should_merge_adjacent_free_cells(&self) -> bool { true } } #[inline] unsafe fn unchecked_unwrap<T>(o: Option<T>) -> T { match o { Some(t) => t, None => core::hint::unreachable_unchecked(), } } unsafe fn walk_free_list<'a, F, T>( head: &Cell<*const FreeCell<'a>>, _policy: &dyn AllocPolicy<'a>, mut f: F, ) -> Result<T, AllocErr> where F: FnMut(&Cell<*const FreeCell<'a>>, &FreeCell<'a>) -> Option<T>, { // The previous cell in the free list (not to be confused with the current // cell's previously _adjacent_ cell). let previous_free = head; loop { let current_free = previous_free.get(); if current_free.is_null() { return Err(AllocErr); } let current_free = Cell::new(current_free); // Now check if this cell can merge with the next cell in the free // list. // // We don't re-check `policy.should_merge_adjacent_free_cells()` because // the `NEXT_FREE_CELL_CAN_MERGE` bit only gets set after checking with // the policy. while (*current_free.get()).next_free_can_merge() { let current = &*current_free.get(); current.clear_next_free_can_merge(); let prev_neighbor = unchecked_unwrap( current .header .neighbors .prev() .and_then(|p| p.as_free_cell()), ); current.header.neighbors.remove(); if CellHeader::next_cell_is_invalid(&current.header.neighbors) { CellHeader::set_next_cell_is_invalid(&prev_neighbor.header.neighbors); } previous_free.set(prev_neighbor); current_free.set(prev_neighbor); } if let Some(result) = f(previous_free, &*current_free.get()) { return Ok(result); } previous_free.set(&*(*current_free.get()).next_free_raw.get()); } } /// Do a first-fit allocation from the given free list. unsafe fn alloc_first_fit<'a>( size: Words, align: Bytes, head: &Cell<*const FreeCell<'a>>, policy: &dyn AllocPolicy<'a>, ) -> Result<NonNull<u8>, AllocErr> { walk_free_list(head, policy, |previous, current| { if let Some(allocated) = current.try_alloc(previous, size, align, policy) { return Some(unchecked_unwrap(NonNull::new(allocated.data() as *mut u8))); } None }) } unsafe fn alloc_with_refill<'a, 'b>( size: Words, align: Bytes, head: &'b Cell<*const FreeCell<'a>>, policy: &dyn AllocPolicy<'a>, ) -> Result<NonNull<u8>, AllocErr> { if let Ok(result) = alloc_first_fit(size, align, head, policy) { return Ok(result); } let cell = policy.new_cell_for_free_list(size, align)?; let head = (*cell).insert_into_free_list(head, policy); alloc_first_fit(size, align, head, policy) } /// A n64 allocator. /// /// # Safety /// /// When used in unix environments, cannot move in memory. Typically not an /// issue if you're just using this as a `static` global allocator. pub struct N64Alloc<'a> { head: imp::Exclusive<*const FreeCell<'a>>, size_classes: size_classes::SizeClasses<'a>, } unsafe impl<'a> Sync for N64Alloc<'a> {} impl<'a> ConstInit for N64Alloc<'a> { const INIT: N64Alloc<'a> = N64Alloc { head: imp::Exclusive::INIT, size_classes: size_classes::SizeClasses::INIT, }; } impl<'a> N64Alloc<'a> { /// An initial `const` default construction of a `N64Alloc` allocator. /// /// This is usable for initializing `static`s that get set as the global /// allocator. pub const INIT: Self = <Self as ConstInit>::INIT; unsafe fn with_free_list_and_policy_for_size<F, T>(&self, size: Words, align: Bytes, f: F) -> T where F: for<'b> FnOnce(&'b Cell<*const FreeCell<'a>>, &'b dyn AllocPolicy<'a>) -> T, { if align <= size_of::<usize>() { if let Some(head) = self.size_classes.get(size) { let policy = size_classes::SizeClassAllocPolicy(&self.head); let policy = &policy as &dyn AllocPolicy<'a>; return head.with_exclusive_access(|head| { let head_cell = Cell::new(*head); let result = f(&head_cell, policy); *head = head_cell.get(); result }); } } let policy = &LARGE_ALLOC_POLICY as &dyn AllocPolicy<'a>; self.head.with_exclusive_access(|head| { let head_cell = Cell::new(*head); let result = f(&head_cell, policy); *head = head_cell.get(); result }) } unsafe fn alloc_impl(&self, layout: Layout) -> Result<NonNull<u8>, AllocErr> { let size = Bytes(layout.size()); let align = if layout.align() == 0 { Bytes(1) } else { Bytes(layout.align()) }; if size.0 == 0 { // Ensure that our made up pointer is properly aligned by using the // alignment as the pointer. return Ok(NonNull::new_unchecked(align.0 as *mut u8)); } let word_size: Words = checked_round_up_to(size).ok_or(AllocErr)?; self.with_free_list_and_policy_for_size(word_size, align, |head, policy| { alloc_with_refill(word_size, align, head, policy) }) } unsafe fn dealloc_impl(&self, ptr: NonNull<u8>, layout: Layout) { let size = Bytes(layout.size()); if size.0 == 0 { return; } let size: Words = size.round_up_to(); let align = Bytes(layout.align()); self.with_free_list_and_policy_for_size(size, align, |head, policy| { let cell = (ptr.as_ptr() as *mut CellHeader<'a> as *const CellHeader<'a>).offset(-1); let cell = &*cell; let cell: &AllocatedCell<'a> = &*(cell as *const CellHeader as *const AllocatedCell); let free = cell.as_free_cell(policy); if policy.should_merge_adjacent_free_cells() { // Merging with the _previous_ adjacent cell is easy: it is // already in the free list, so folding this cell into it is all // that needs to be done. The free list can be left alone. // // Merging with the _next_ adjacent cell is a little harder. It // is already in the free list, but we need to splice it out // from the free list, since its header will become invalid // after consolidation, and it is *this* cell's header that // needs to be in the free list. But we don't have access to the // pointer pointing to the soon-to-be-invalid header, and // therefore can't adjust that pointer. So we have a delayed // consolidation scheme. We insert this cell just after the next // adjacent cell in the free list, and set the next adjacent // cell's `NEXT_FREE_CAN_MERGE` bit. The next time that we walk // the free list for allocation, the bit will be checked and the // consolidation will happen at that time. // // If _both_ the previous and next adjacent cells are free, we // are faced with a dilemma. We cannot merge all previous, // current, and next cells together because our singly-linked // free list doesn't allow for that kind of arbitrary appending // and splicing. There are a few different kinds of tricks we // could pull here, but they would increase implementation // complexity and code size. Instead, we use a heuristic to // choose whether to merge with the previous or next adjacent // cell. We could choose to merge with whichever neighbor cell // is smaller or larger, but we don't. We prefer the previous // adjacent cell because we can greedily consolidate with it // immediately, whereas the consolidating with the next adjacent // cell must be delayed, as explained above. if let Some(prev) = free .header .neighbors .prev() .and_then(|p| (*p).as_free_cell()) { free.header.neighbors.remove(); if CellHeader::next_cell_is_invalid(&free.header.neighbors) { CellHeader::set_next_cell_is_invalid(&prev.header.neighbors); } return; } if let Some(next) = free .header .neighbors .next() .and_then(|n| (*n).as_free_cell()) { free.next_free_raw.set(next.next_free()); next.next_free_raw.set(free); next.set_next_free_can_merge(); return; } } // Either we don't want to merge cells for the current policy, or we // didn't have the opportunity to do any merging with our adjacent // neighbors. In either case, push this cell onto the front of the // free list. let _head = free.insert_into_free_list(head, policy); }); } } pub static ALLOC_BYTES_LEFT: AtomicI32 = AtomicI32::new(imp::SCRATCH_LEN_BYTES as i32); pub static ALLOC_BYTES_USED: AtomicI32 = AtomicI32::new(0); pub use imp::OFFSET as ALLOC_PAGE_OFFSET; unsafe impl GlobalAlloc for N64Alloc<'static> { unsafe fn alloc(&self, layout: Layout) -> *mut u8 { ALLOC_BYTES_LEFT.fetch_sub(layout.size() as i32, Ordering::SeqCst); ALLOC_BYTES_USED.fetch_add(layout.size() as i32, Ordering::SeqCst); match self.alloc_impl(layout) { Ok(ptr) => ptr.as_ptr(), Err(AllocErr) => ptr::null_mut(), } } unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { ALLOC_BYTES_LEFT.fetch_add(layout.size() as i32, Ordering::SeqCst); ALLOC_BYTES_USED.fetch_sub(layout.size() as i32, Ordering::SeqCst); if let Some(ptr) = NonNull::new(ptr) { self.dealloc_impl(ptr, layout); } } }
true
44f34970a76bfa8e4b1ca3802f1c2a71a62c9339
Rust
dpjungmin/cmdx
/src/bin/ls.rs
UTF-8
3,107
3.203125
3
[]
no_license
use cmdx::fs::dir::Dir; use cmdx::fs::file::File; use std::convert::TryFrom; use std::env; use std::ffi::OsStr; use std::io::{self, Stdout, Write}; use std::path::PathBuf; use std::process; struct Ls<'args> { writer: Stdout, paths: Vec<&'args OsStr>, } impl<'args> Ls<'args> { pub fn new(writer: Stdout, paths: Vec<&'args OsStr>) -> Self { Ls { writer, paths } } pub fn run(&self) -> io::Result<()> { let mut files = Vec::new(); let mut dirs = Vec::new(); for path in &self.paths { match File::try_from(PathBuf::from(path)) { Ok(file) => { if file.is_dir() { match Dir::try_from(file) { Ok(dir) => dirs.push(dir), Err(e) => eprintln!("{:?}: {}", path, e), } } else { files.push(file); } } Err(e) => { eprintln!("{:?}: {}", path, e); } }; } self.display_files(&files)?; self.display_dirs(&dirs, !files.is_empty())?; Ok(()) } fn display_files(&self, files: &[File]) -> io::Result<()> { if files.is_empty() { return Ok(()); } for (idx, file) in files.iter().enumerate() { if idx < files.len() - 1 { writeln!(&self.writer, "{} ", file.name)?; } else { write!(&self.writer, "{}", file.name)?; } } Ok(()) } fn display_dirs(&self, dirs: &[Dir], displayed_files: bool) -> io::Result<()> { if displayed_files { write!(&self.writer, "\n\n")?; } let multiple_displays = displayed_files || dirs.len() > 1; for (idx, dir) in dirs.iter().enumerate() { if multiple_displays { if idx == 0 { writeln!(&self.writer, "{}: ", dir.name)?; } else { writeln!(&self.writer, "\n\n{}: ", dir.name)?; } } for file in &dir.contents { // @todo: display dotfiles if -a flag is set if file.is_dotfile() { continue; } write!(&self.writer, "{} ", file.name)?; } } writeln!(&self.writer)?; Ok(()) } } fn main() { // Assuming only paths are passed in from the command line argument (no options) // @todo: add support for options let args = env::args_os().skip(1).collect::<Vec<_>>(); let mut paths = args.iter().map(|s| s.as_os_str()).collect::<Vec<_>>(); // If no path is passed in, use the current directory as the default if paths.is_empty() { paths = vec![OsStr::new(".")]; } let ls = Ls::new(io::stdout(), paths); match ls.run() { Ok(_) => process::exit(0), Err(e) => { eprintln!("{}", e); process::exit(1); } } }
true
814dd6b6e1a198b6f72fb46149f519120329648b
Rust
TtTRz/RustLib
/code/Mutex/src/main.rs
UTF-8
1,272
3.640625
4
[]
no_license
use std::sync::{Arc, Mutex}; use std::thread; // fn main() { // let counter = Mutex::new(0); // let mut handles = vec![]; // for _ in 0..10 { // let handle = thread::spawn(move || { // let mut num = counter.lock().unwrap(); // counter is moved // *num += 1; // }); // handles.push(handle); // } // for handle in handles { // handle.join().unwrap(); // } // println!("{}", *counter.lock().unwrap()); // } // ARC fn main() { let counter = Arc::new(Mutex::new(0)); let mut handles = vec![]; for _ in 0..10 { let counter = Arc::clone(&counter); let handle = thread::spawn(move || { let mut num = counter.lock().unwrap(); // counter is moved *num += 1; }); handles.push(handle); } for handle in handles { handle.join().unwrap(); } println!("{}", *counter.lock().unwrap()); } //实施了std::marker下的send的类型叫做send, 实施了sync的叫做sync //send可以在线程间转移所有权,sync引用可以被线程共享,T是sync, 则&T is send //大部分类型是send and sync //Rc<T>, RefCell<T>, Cell<T>不是send也不是sync, //Mutex是sync, 所以引用可以被线程共享
true
aee9f9f44f063a842726291fca106a17a18af5df
Rust
swerdloj/jitter
/src/frontend/validate/mod.rs
UTF-8
13,233
3.125
3
[ "BSD-3-Clause" ]
permissive
pub mod context; pub mod types; ///////////////////// Validation Helpers ///////////////////// use std::collections::HashMap; use crate::frontend::validate::types::Type; use crate::frontend::parse::ast; ///////////////////// TYPES ///////////////////// // NOTE: Offsets are i32 for Cranelift /// Stores struct definitions struct StructDefinition { /// Map of field_name -> (type, byte offset) fields: HashMap<String, StructField>, } pub struct StructField { pub ty: Type, pub offset: i32, pub is_public: bool, } pub struct TypeTableEntry { /// Size of type in bytes pub size: usize, /// Alignment of type in bytes alignment: usize, // TODO: Store fields and their offsets here too // field_offets: HashMap<?>, } impl TypeTableEntry { fn new(size: usize, alignment: usize) -> Self { Self { size, alignment } } } /// Stores type sizes and alignments pub struct TypeTable { /// Map of field_name -> (size, alignment) in bytes data: HashMap<Type, TypeTableEntry> } impl TypeTable { // TODO: Accept word size here and adjust table accordingly // TODO: Support `isize` and `usize` fn new() -> Self { let mut data = HashMap::new(); // FIXME: This could be looked up via `match`, but this is more consistent // FIXME: Only 64-bit architectures are supported by the below values data.insert(Type::u8, TypeTableEntry::new(1, 1)); data.insert(Type::u16, TypeTableEntry::new(2, 2)); data.insert(Type::u32, TypeTableEntry::new(4, 4)); data.insert(Type::u64, TypeTableEntry::new(8, 8)); data.insert(Type::u128, TypeTableEntry::new(16, 8)); data.insert(Type::i8, TypeTableEntry::new(1, 1)); data.insert(Type::i16, TypeTableEntry::new(2, 2)); data.insert(Type::i32, TypeTableEntry::new(4, 4)); data.insert(Type::i64, TypeTableEntry::new(8, 8)); data.insert(Type::i128, TypeTableEntry::new(16, 8)); data.insert(Type::f32, TypeTableEntry::new(4, 4)); data.insert(Type::f64, TypeTableEntry::new(8, 8)); data.insert(Type::bool, TypeTableEntry::new(1, 1)); data.insert(Type::Unit, TypeTableEntry::new(0, 1)); Self { data } } fn insert(&mut self, t: &Type, entry: TypeTableEntry) -> Result<(), String> { match self.data.insert(t.clone(), entry) { Some(_) => Err(format!("Type {} already exists", t.clone())), None => Ok(()), } } fn assert_valid(&self, t: &Type) -> Result<(), String> { match t { // Strip away references to check the underlying type Type::Reference { ty, .. } => Ok(self.assert_valid(ty)?), // Check all contained types Type::Tuple(types) => { // TODO: All types can be checked (rather than stopping at first error) // Just store all errors, then build an error string for ty in types { let result = self.assert_valid(ty); if result.is_err() { return result; } } Ok(()) } // Base types _ => { if self.data.contains_key(t) { Ok(()) } else { Err(format!("Type `{}` is not valid", t)) } } } } /// Returns alignment of the type in bytes fn alignment_of(&self, t: &Type) -> usize { match t { // TODO: Alignment should be same as pointer type Type::Reference { ty, .. } => todo!("need pointer type stuff"), // TODO: Tuples should align same as structs Type::Tuple(types) => todo!("tuple alignment"), _ => self.data.get(t).expect("alignment_of").alignment, } } /// Returns the size of the type in bytes pub fn size_of(&self, t: &Type) -> usize { self.data.get(t).unwrap().size } } ///////////////////// SCOPES + VARIABLES ///////////////////// #[derive(Debug)] pub enum MemoryUsage { /// The variable is new -> requires allocation /// e.g.: `let x: u32 = 7;` StackSlot, /// The variable is a struct being returned /// e.g.: `return Type {...};` StructReturn, /// Aliases an existing variable -> use its allocation /// e.g.: `let x: u32 = y;` Alias(String), /// The variable is allocated elsewhere before being passed as a param /// e.g.: `function(12, x);` FunctionParam, // TODO: References an existing variable -> ?? // e.g.: `let x: &u32 = &y;` // Borrow(&'input str), // TODO: Aliases a field of an existing variable -> ?? // e.g.: `let x: u32 = y.a;` // FieldAlias(), } pub struct AllocationTable { // Map of ((function_name, variable name) -> variable's usage) pub allocations: HashMap<(String, String), MemoryUsage>, } impl AllocationTable { pub fn new() -> Self { Self { allocations: HashMap::new(), } } pub fn insert(&mut self, function: String, variable: String, usage: MemoryUsage) -> Result<(), String> { if let Some(_existing) = self.allocations.insert((function.clone(), variable.clone()), usage) { return Err(format!("Variable {} is already defined in function {}", variable, function)); } Ok(()) } pub fn get_usage(&mut self, function: &str, variable: &str) -> &MemoryUsage { // NOTE: This should always be valid self.allocations.get(&(function.to_owned(), variable.to_owned())).expect("get_usage") } } struct VariableData { /// Type of the variable pub ty: Type, /// What allocation this variable needs pub memory_usage: MemoryUsage, /// Is the variable mutable pub mutable: bool, } impl VariableData { fn new(ty: Type, memory_usage: MemoryUsage, mutable: bool) -> Self { Self { ty, memory_usage, mutable } } } struct Scope { /// **This scope's** map of (variable name -> data) variables: HashMap<String, VariableData>, } impl Scope { fn new() -> Self { Self { variables: HashMap::new(), } } fn get_var_data(&self, var: &str) -> &VariableData { // NOTE: This operation should always succeed self.variables.get(var).expect("get_var_data") } fn get_var_data_mut(&mut self, var: &str) -> &mut VariableData { // NOTE: This operation should always succeed self.variables.get_mut(var).expect("get_var_data_mut") } fn insert_var_data(&mut self, name: String, var: VariableData) { // NOTE: This operation should never overwrite existing self.variables.insert(name, var); } } /// Uses alias analysis to determine stack slot allocations and struct return slot usage struct Scopes { /// Each element represents a subsequently nested scope scopes: Vec<Scope>, /// Map of (variable name -> its scope) all_variables: HashMap<String, usize>, num_scopes: usize, } impl Scopes { fn new() -> Self { Self { scopes: Vec::new(), all_variables: HashMap::new(), num_scopes: 0, } } fn push_scope(&mut self) { self.scopes.push(Scope::new()); self.num_scopes += 1; } fn pop_scope(&mut self) -> Scope { // NOTE: These operations should always succeed let removed_scope = self.scopes.pop().expect("pop_scope"); for key in removed_scope.variables.keys() { self.all_variables.remove(key); } self.num_scopes -= 1; removed_scope } fn current_index(&self) -> usize { self.num_scopes - 1 } fn current_scope(&mut self) -> &mut Scope { let i = self.current_index(); &mut self.scopes[i] } // TODO: Field aliasing // TODO: Handle shadowing fn add_var_to_scope(&mut self, name: String, mutable: bool, ty: Type, memory_usage: MemoryUsage) -> Result<(), String> { // if name exists already if let Some(scope_index) = self.all_variables.insert(name.clone(), self.current_index()) { // Name exists in the current scope if scope_index == self.current_index() { return Err(format!("Variable `{}` is already defined in this scope", name)); } else { // TODO: This todo!("Nested scope shadowing") } } self.current_scope().insert_var_data(name, VariableData::new(ty, memory_usage, mutable)); Ok(()) } // TODO: Handle shadowing fn get_variable(&self, name: &str) -> Result<&VariableData, String> { if let Some(&index) = self.all_variables.get(name) { return Ok(self.scopes[index].get_var_data(name)); } Err(format!("No variable `{}` in scope", name)) } fn get_variable_mut(&mut self, name: &str) -> Result<&mut VariableData, String> { if let Some(&index) = self.all_variables.get(name) { return Ok(self.scopes[index].get_var_data_mut(name)); } Err(format!("No variable `{}` in scope", name)) } // NOTE: Program is valid at this point. No safety checks needed /// Uses aliases to convert the return variable's generic allocation to struct-return allocation /// Target variable is always in the current scope. fn signal_return_variable(&mut self, mut target: String) { let mut current; // Traverse the alias graph to find the true variable being returned. loop { current = self.current_scope().get_var_data_mut(&target); match &current.memory_usage { // keep looking for root MemoryUsage::Alias(next) => target = next.clone(), // TODO: I don't know if this is correct // returning what was input -> use it instead of an allocation MemoryUsage::FunctionParam => { current.memory_usage = MemoryUsage::Alias(target); break; } // Found the root MemoryUsage::StackSlot | MemoryUsage::StructReturn => { current.memory_usage = MemoryUsage::StructReturn; break; } } } } } ///////////////////// FUNCTIONS ///////////////////// pub struct FunctionDefinition { /// Function parameters (field_name, field_type, mutable) in order pub parameters: Vec<(String, Type, bool)>, pub return_type: Type, pub is_extern: bool, pub is_validated: bool, } pub struct FunctionTable { // Map of (name -> data) pub functions: HashMap<String, FunctionDefinition> } impl FunctionTable { fn new() -> Self { Self { functions: HashMap::new(), } } // FIXME: A few copies and clones, but nothing bad fn forward_declare_function(&mut self, validated_prototype: &ast::FunctionPrototype, is_extern: bool) -> Result<(), String> { if self.functions.contains_key(&validated_prototype.name) { return Err(format!("Function `{}` already exists", validated_prototype.name)); } let parameters = validated_prototype.parameters.iter().map(|param| { (param.name.clone(), param.ty.clone(), param.mutable) }).collect(); let definition = FunctionDefinition { parameters, return_type: validated_prototype.return_type.clone(), is_extern, is_validated: false, }; self.functions.insert(validated_prototype.name.clone(), definition); Ok(()) } fn __get_mut(&mut self, name: &str) -> Result<&mut FunctionDefinition, String> { self.functions.get_mut(name) .ok_or(format!("Could not find function `{}`", name)) } fn __get(&self, name: &str) -> Result<&FunctionDefinition, String> { self.functions.get(name) .ok_or(format!("Could not find function `{}`", name)) } // TODO: This and `get_validated_function_definition` may not ever be used // (this functionality exists in finalized JIT product) fn mark_function_validated(&mut self, name: &str) -> Result<(), String> { self.__get_mut(name)? .is_validated = true; Ok(()) } // TODO: Will this ever be used? // fn get_validated_function_definition(&mut self, name: &str) -> Result<&FunctionDefinition<'input>, String> { // let function = self.__get(name)?; // if !function.is_validated { // // FIXME: This should not be possible // Err(format!("Function `{}` was not validated", name)) // } else { // Ok(function) // } // } /// Returns a `FunctionDefinition` that is not guarenteed to have been /// successfully validated fn get_unchecked_function_definition(&mut self, name: &str) -> Result<&FunctionDefinition, String> { self.__get(name) } }
true
179f25aa1039fbe760717013a726349b61de9b96
Rust
Busy-Bob/rust_leetcode
/code_0845/src/lib.rs
UTF-8
1,875
3.015625
3
[]
no_license
struct Solution; use std::cmp::max; impl Solution { pub fn longest_mountain(a: Vec<i32>) -> i32 { if a.len() < 3 { return 0; } let mut last_num: i32 = a[0]; let mut increase_flag: bool = false; let mut decrease_flag: bool = false; let mut mountain_start: usize = 0; let mut max_length: u32 = 0; // for (index, &now_num) in a.iter().enumerate() { // 上升 if now_num > last_num { match (increase_flag, decrease_flag) { (_, true) => { //开始是下降,后面变成了上升, max_length = max(max_length, (index - mountain_start) as u32); mountain_start = index - 1; decrease_flag = false; increase_flag = true; } (false, false) => { mountain_start = index - 1; increase_flag = true; } _ => {} } } // 下降 else if now_num < last_num { if increase_flag { decrease_flag = true; increase_flag = false; } } // 平 else { if decrease_flag { max_length = max(max_length, (index - mountain_start) as u32); decrease_flag = false; } else if increase_flag { increase_flag = false; } } // last_num = now_num; } // if decrease_flag { max_length = max(max_length, (a.len() - mountain_start) as u32) } max_length as i32 } }
true
2474da71ce40574b7d323336005fc66b1e55b746
Rust
tomtau/tendermint-rs
/tendermint/tests/integration.rs
UTF-8
2,832
2.578125
3
[ "Apache-2.0" ]
permissive
//! Integration tests /// RPC integration tests. /// /// These are all ignored by default, since they test against running /// `tendermint node --proxy_app=kvstore`. They can be run using: /// /// ``` /// cargo test -- --ignored /// ``` mod rpc { use tendermint::rpc::Client; /// Get the address of the local node pub fn localhost_rpc_client() -> Client { Client::new(&"tcp://127.0.0.1:26657".parse().unwrap()).unwrap() } /// `/abci_info` endpoint #[test] #[ignore] fn abci_info() { let abci_info = localhost_rpc_client().abci_info().unwrap(); assert_eq!(&abci_info.data, "GaiaApp"); } /// `/abci_query` endpoint #[test] #[ignore] fn abci_query() { let key = "unpopulated_key".parse().unwrap(); let abci_query = localhost_rpc_client() .abci_query(Some(key), vec![], None, false) .unwrap(); assert_eq!(abci_query.key.as_ref().unwrap(), &Vec::<u8>::new()); assert_eq!(abci_query.value.as_ref(), None); } /// `/block` endpoint #[test] #[ignore] fn block() { let height = 1u64; let block_info = localhost_rpc_client().block(height).unwrap(); assert_eq!(block_info.block_meta.header.height.value(), height); } /// `/block_results` endpoint #[test] #[ignore] fn block_results() { let height = 1u64; let block_results = localhost_rpc_client().block_results(height).unwrap(); assert_eq!(block_results.height.value(), height); } /// `/blockchain` endpoint #[test] #[ignore] fn blockchain() { let blockchain_info = localhost_rpc_client().blockchain(1u64, 10u64).unwrap(); assert_eq!(blockchain_info.block_metas.len(), 10); } /// `/commit` endpoint #[test] #[ignore] fn commit() { let height = 1u64; let commit_info = localhost_rpc_client().block(height).unwrap(); assert_eq!(commit_info.block_meta.header.height.value(), height); } /// `/genesis` endpoint #[test] #[ignore] fn genesis() { let genesis = localhost_rpc_client().genesis().unwrap(); assert_eq!( genesis.consensus_params.validator.pub_key_types[0].to_string(), "ed25519" ); } /// `/net_info` endpoint integration test #[test] #[ignore] fn net_info() { let net_info = localhost_rpc_client().net_info().unwrap(); assert!(net_info.listening); } /// `/status` endpoint integration test #[test] #[ignore] fn status_integration() { let status = localhost_rpc_client().status().unwrap(); // For lack of better things to test assert_eq!( status.validator_info.voting_power.value(), 10 ); } }
true
b758143892a1a994c949020e4f3dd2bd911f2e8f
Rust
sutetako/rust_learning
/src/main.rs
UTF-8
51,147
3.15625
3
[]
no_license
fn main() {} #[test] fn overflow() { let big_val = std::i32::MAX; // let x = big_val + 1; // panic let _x = big_val.wrapping_add(1); // ok } #[test] fn float_test() { assert_eq!(5f32.sqrt() * 5f32.sqrt(), 5.); assert_eq!((-1.01f64).floor(), -2.0); assert!((-1. / std::f32::INFINITY).is_sign_negative()); } #[test] fn char_test() { assert_eq!('*'.is_alphabetic(), false); assert_eq!('β'.is_alphabetic(), true); assert_eq!('8'.to_digit(10), Some(8)); assert_eq!('\u{CA0}'.len_utf8(), 3); assert_eq!(std::char::from_digit(2, 10), Some('2')); } #[test] fn tuple_test() { let text = "I see the eigenvalue in thine eye"; let (head, tail) = text.split_at(21); assert_eq!(head, "I see the eigenvalue "); assert_eq!(tail, "in thine eye"); } #[test] fn array_test() { let lazy_caterer: [u32; 6] = [1, 2, 4, 7, 11, 16]; let taxonomy = ["Animalia", "arthropoda", "Insecta"]; assert_eq!(lazy_caterer[3], 7); assert_eq!(taxonomy.len(), 3); let mut sieve = [true; 10000]; for i in 2..100 { if sieve[i] { let mut j = i * i; while j < 10000 { sieve[j] = false; j += i; } } } assert!(sieve[211]); assert!(!sieve[9876]); let mut chaos = [3, 5, 4, 1, 2]; chaos.sort(); assert_eq!(chaos, [1, 2, 3, 4, 5]); } #[test] fn vector_test() { { fn build_vector() -> Vec<i16> { let mut v: Vec<i16> = Vec::<i16>::new(); v.push(10i16); v.push(20i16); v } fn build_vector_2() -> Vec<i16> { let mut v = Vec::new(); v.push(10); v.push(20); v } let v1 = build_vector(); let v2 = build_vector_2(); assert_eq!(v1, v2); } let mut v1 = vec![2, 3, 5, 7]; assert_eq!(v1.iter().fold(1, |a, b| a * b), 210); v1.push(11); v1.push(13); assert_eq!(v1.iter().fold(1, |a, b| a * b), 30030); let mut v2 = Vec::new(); v2.push("step"); v2.push("on"); v2.push("no"); v2.push("pets"); assert_eq!(v2, vec!["step", "on", "no", "pets"]); let v3: Vec<i32> = (0..5).collect(); assert_eq!(v3, [0, 1, 2, 3, 4]); let mut v4 = vec!["a man", "a plan", "a canal", "panama"]; v4.reverse(); assert_eq!(v4, vec!["panama", "a canal", "a plan", "a man"]); let mut v5 = Vec::with_capacity(2); assert_eq!(v5.len(), 0); assert_eq!(v5.capacity(), 2); v5.push(1); v5.push(2); assert_eq!(v5.len(), 2); assert_eq!(v5.capacity(), 2); v5.push(3); assert_eq!(v5.len(), 3); assert_eq!(v5.capacity(), 4); let mut v6 = vec![10, 20, 30, 40, 50]; v6.insert(3, 35); assert_eq!(v6, [10, 20, 30, 35, 40, 50]); v6.remove(1); assert_eq!(v6, [10, 30, 35, 40, 50]); let mut v7 = vec!["carmen", "miranda"]; assert_eq!(v7.pop(), Some("miranda")); assert_eq!(v7.pop(), Some("carmen")); assert_eq!(v7.pop(), None); // let languages: Vec<String> = std::env::args().skip(1).collect(); let languages = vec!["Lisp", "Scheme", "C", "C++", "Fortran"]; let mut v8 = Vec::new(); for l in languages { if l.len() % 2 == 0 { v8.push("functional"); } else { v8.push("imperative"); } } assert_eq!( v8, [ "functional", "functional", "imperative", "imperative", "imperative" ] ); // slice let v9: Vec<f64> = vec![0.0, 0.707, 1.0, 0.707]; let a9: [f64; 4] = [0.0, 0.707, 1.0, 0.707]; let sv: &[f64] = &v9; let sa: &[f64] = &a9; assert_eq!(sv[0..2], [0.0, 0.707]); assert_eq!(sa[2..], [1.0, 0.707]); assert_eq!(&sv[1..3], [0.707, 1.0]); } #[test] fn string_test() { // literal let speech = "\"Ouch!\" said the well.\n"; println!("{}", speech); println!( "In the room the women come and go, Singing of Mount Abora" ); println!( "It was a bright, cold day in Aplil, and \ there were four of us \ more or less." ); let default_win_install_path = r"C:\Program Files\Gorillas"; println!("{}", default_win_install_path); // let pattern = Regex::new(r"\d(\.\d+)*"); println!( r###" This raw string started with 'r###"'. Therefore it does not end until we reach a quote mark ('"') followed immediately by three pound signs ('###'): "### ); // byte strings let method = b"GET"; assert_eq!(method, &[b'G', b'E', b'T']); let noodles = "noodles".to_string(); let oodles = &noodles[1..]; let poodles = "\u{CA0}_\u{CA0}"; assert_eq!(oodles.len(), 6); assert_eq!(poodles.len(), 7); assert_eq!(poodles.chars().count(), 3); // let mut s = "hello"; // s[0] = 'c'; error: tye thpe 'str' cannot be mutably indexed // s.push('\n'); error: no method named `push` found for type `&str` assert_eq!( format!("{}° {:02}’ {:02}” N", 24, 5, 23), "24° 05’ 23” N".to_string() ); let bits = vec!["veni", "vidi", "vici"]; assert_eq!(bits.concat(), "venividivici"); assert_eq!(bits.join(","), "veni,vidi,vici"); assert!("ONE".to_lowercase() == "one"); assert!("peanut".contains("nut")); assert_eq!("\u{CA0}_\u{CA0}".replace("\u{CA0}", "■"), "■_■"); assert_eq!(" clean\n".trim(), "clean"); for word in "veni, vidi, vici".split(", ") { assert!(word.starts_with("v")); } } #[test] fn ownership_test() { let mut v = Vec::new(); for i in 101..106 { v.push(i.to_string()); } let fifth = v.pop().unwrap(); assert_eq!(fifth, "105"); let second = v.swap_remove(1); assert_eq!(second, "102"); let third = std::mem::replace(&mut v[2], "substitute".to_string()); assert_eq!(third, "103"); assert_eq!(v, vec!["101", "104", "substitute"]); struct Person { name: Option<String>, birth: Option<i32>, }; let mut composers = Vec::new(); composers.push(Person { name: Some("Palestrina".to_string()), birth: Some(1525), }); // let first_name = composers[0].name // error let first_name = std::mem::replace(&mut composers[0].name, None); assert_eq!(first_name, Some("Palestrina".to_string())); assert_eq!(composers[0].name, None); let birth = composers[0].birth.take(); assert_eq!(birth, Some(1525)); assert_eq!(composers[0].birth, None); } #[test] fn copy_test() { { /* struct Label { number: u32, } fn print(l: Label) { println!("STAMP: {}", l.number); } let l = Label { number: 3 }; print(l); println!("My label number is: {}", l.number); // error */ #[derive(Copy, Clone)] struct Label { number: u32, } fn print(l: Label) { println!("STAMP: {}", l.number); } let l = Label { number: 3 }; print(l); println!("My label number is: {}", l.number); /* #[derive(Copy, Clone)] struct StringLabel { name: String, } */ } } #[test] fn rc_test() { use std::rc::Rc; let s: Rc<String> = Rc::new("shirataki".to_string()); let t: Rc<String> = s.clone(); let u: Rc<String> = s.clone(); assert!(s.contains("shira")); assert_eq!(t.find("taki"), Some(5)); println!("{} are quite chewy, almost bouncy, but lack flavor", u); // s.push_str(" noodles"); // error } #[test] fn reference_test() { use std::collections::HashMap; type Table = HashMap<String, Vec<String>>; let mut table = Table::new(); table.insert( "Gesualdo".to_string(), vec![ "many madrigals".to_string(), "Tenebrae Responsoria".to_string(), ], ); table.insert( "Caravaggio".to_string(), vec![ "The Musicians".to_string(), "The Calling of St. Matthew".to_string(), ], ); table.insert( "Cellini".to_string(), vec![ "Perseus with the head of Medusa".to_string(), "a salt cellar".to_string(), ], ); fn show(table: Table) { for (artist, works) in table { println!("works by {}", artist); for work in works { println!(" {}", work); } } } fn show_with_ref(table: &Table) { for (artist, works) in table { println!("works by {}", artist); for work in works { println!(" {}", work); } } } fn sort_works(table: &mut Table) { for (_artist, works) in table { works.sort(); } } show_with_ref(&table); assert_eq!(table["Gesualdo"][0], "many madrigals"); // OK sort_works(&mut table); assert_eq!(table["Gesualdo"][1], "many madrigals"); // OK show(table); // assert_eq!(table["Cellini"][0], "a salt cellar"); // error, use of moved value // implicitily borrows struct Anime { name: &'static str, bechdel_pass: bool, }; let aria = Anime { name: "Aria: The Animation", bechdel_pass: true, }; let anime_ref = &aria; assert_eq!(anime_ref.name, "Aria: The Animation"); assert_eq!((*anime_ref).name, "Aria: The Animation"); assert_eq!((*anime_ref).bechdel_pass, true); let mut v = vec![1973, 1968]; v.sort(); (&mut v).sort(); let mut x = 10; let mut y = 20; let mut r = &x; let b = true; if b { r = &y; } assert!(*r == 20); struct Point { x: i32, y: i32, } let point = Point { x: 1000, y: 729 }; let r: &Point = &point; let rr: &&Point = &r; let rrr: &&&Point = &rr; assert_eq!(rrr.x, 1000); assert_eq!(rrr.y, 729); x = 10; y = 10; let rx = &x; let ry = &y; let rrx = &rx; let rry = &ry; // assert!(rrx <= rry); assert!(rrx == rry); assert!(!std::ptr::eq(rrx, rry)); fn factorial(n: usize) -> usize { (1..n + 1).fold(1, |a, b| a * b) } let f = &factorial(6); assert_eq!(f + &1009, 1729); { let r; { let x = 1; r = &x; assert_eq!(*r, 1); // OK } // assert_eq!(*r, 1); // error; } static mut STASH: &i32 = &128; // fn test_func(p: &i32) { // error // fn test_func<'a>(p: &'a &i32) { // error too, this is the same as the above definition fn test_func(p: &'static i32) { // OK unsafe { STASH = p; } } static WORTH_POINTING_AT: i32 = 1000; test_func(&WORTH_POINTING_AT); unsafe { assert_eq!(STASH, &1000); } fn smallest(v: &[i32]) -> &i32 { let mut s = &v[0]; for r in &v[1..] { if *r < *s { s = r; } } s } { let parabola = [9, 4, 1, 0, 1, 4, 9]; let s = smallest(&parabola); assert_eq!(*s, 0); } /* struct S { r: &i32, } let s; { let x = 10; s = S { r: &x }; } */ // assert_eq!(*s, 10); // error /* struct S<'a, 'b> { x: &'a i32, y: &'b i32, } // fn sum_r_xy<'a, 'b, 'c>(r: &'a &i32, s: S<'b, 'c>) -> i32 { fn sum_r_xy(r: &i32, s: S) -> i32 { r + s.x + s.y } // fn first_third<'a>(point: &'a &[i32; 3]) -> (&'a i32, &'a i32) { fn first_third(point: &[i32; 3]) -> (&i32, &i32) { (&point[0], &point[2]) } struct StringTable { elements: Vec<String>, } impl StringTable { // fn find_by_prefix<'a, 'b>(&'a self, prefix: &'b str) -> Option<&'a String> { fn find_by_prefix(&self, prefix: &str) -> Option<&String> { for i in 0..self.elements.len() { if self.elements[i].starts_with(prefix) { return Some(&self.elements[i]); } } None } } */ { /* let v = vec![4, 8, 19, 27, 34, 10]; let r = &v; let aside = v; r[0]; // error */ let v = vec![4, 8, 19, 27, 34, 10]; { let r = &v; r[0]; } let aside = v; assert_eq!(aside[0], 4); } { fn extend(vec: &mut Vec<f64>, slice: &[f64]) { for elt in slice { vec.push(*elt); } } let mut wave = Vec::new(); let head = vec![0.0, 1.0]; let tail = [0.0, -1.0]; extend(&mut wave, &head); extend(&mut wave, &tail); assert_eq!(wave, vec![0.0, 1.0, 0.0, -1.0]); // extend(&mut wave, &wave); // error } { let mut x = 10; { let r1 = &x; let r2 = &x; assert_eq!(r1, r2); // x += 10; // error, it is borrowed } x += 10; assert_eq!(x, 20); // let m = &mut x; // error, it is also borrowed as immutable let mut y = 20; let m1 = &mut y; // let m2 = &mut y; // error, cannot borrow as mutable more than once // let z = y; // error, cannot use 'y' because it was mutably borrowed assert_eq!(&20, m1); { let mut w = (107, 109); w.0 = 108; let r = &w; let r0 = &r.0; // let m1 = &mut r.1; // error: can't reborrow shared as mutable assert_eq!(r0, &108); assert_eq!(w, (108, 109)); } } } #[test] fn test_expression() { // 6.1 // expression // 5 * (fahr-32) / 9; /* statement for (; begin != end; ++begin) { if (*begin == target) break; } */ /* pixels[r * bounds.0 + c] = match escapes(Complex { re: point.0, im: point.1 }, 255) { None => 0, Some(count) => 255 - count as u8 }; */ /* let status = if cpu.temperature <= MAX_TEMP { HttpStatus::Ok } else { HttpStatus::ServerError }; */ /* println!("Inside the vat, you see {}.", match vat.contents { Some(brain) => brain.desc(), None => "nothing of interest" }); */ // 6.2 /* let display_name = match post.author() { Some(author) => author.name(), None => { let network_info = post.get_network_metadata()?; let ip = network_info.client_address(); ip.to_string() } }; */ /* let msg = { // let-declaration: semicolon is always required let dandelion_control = puffball.open(); // expression + semicolon: method is called, return value dropped dandelion_control.release_all_seeds(launch_codes); // expression with no semicolon: method is called, // return value stored in `msg` dandelion_control.get_status() } */ // 6.3 /* loop { work(); play(); ; // <-- empty statement } */ /* * let name: type = expr; */ /* let name; if user.has_nickname() { name = user.nickname(); } else { name = generate_unique_name(); user.register(&name); } */ /* use std::io; use std::cmp::Ordering; fn show_files() -> io::Result<()> { let mut v = vec![]; ... fn cmp_by_timestamp_then_name(a: &FileInfo, b: &FileInfo) -> Ordering { a.timestamp.cmp(&b.timestamp) .reverse() .then(a.path.cmp(&b.path)) } v.sort_by(cmp_by_timestamp_then_name); } */ // 6.4 /* if condition1 { block1 } else if condition2 { block2 } else { block_n } */ /* match value { pattern => expr, ... } */ let code = 2; match code { 0 => println!("OK"), 1 => println!("Wires Tangled"), 2 => println!("User Asleep"), _ => println!("Unrecognized Error {}", code), } /* match params.get("name") { Some(name) => println!("Hello, {}!", name), None => println!("Greetings, stranger.") } */ /* let score = match card.rank { Jack => 10, Queen = > 10, Ace = 11 }; // error: nonexhaustive patterns */ /* let suggested_pet = if with_wings { Pet::Buzzard } else { Pet::Hyena }; //ok let favorite_number = if user.is_hobbit() { "eleventy-one" } else { 9 }; //error let best_sports_team = if is_hockey_season() { "Predators" }; // error */ /* let suggested_per = match favotites.elements { Fire => Pet::RedPanda, Air => Pet::Buffalo, Water => Pet::Orca, _ => None // error: incompatible types } */ // 6.4.1 /* if let pattern = expr { block1 } else { block2 } match expr { pattern => { block1 } _ => { block2 } */ /* if let Some(cookie) = request.session_cookie { return restore_session(cookie); } if let Err(err) = present_cheesy_anti_robot_task() { log_robot_attempt(err); politely_accuse_user_of_being_a_robot(); } else { session.mark_as_human(); } */ // 6.5 loop /* while condition { block } while let pattern = expr { block } loop { block } for pattern in collection { block } */ for i in 0..20 { println!("{}", i); } /* let strings: Vec<String> = error_messages(); for s in strings { // each String is moved into s here println!("{}", s); } // ...and dropped here println("{} error(s)", strings.len()); // error: use of moved value */ /* for rs in &strings { println!("String {:?} is at address {:p}.", *rs, rs); // ok } */ /* for rs in &mut strings { // tye type of rs is &mut String rs.push('\n'); // add a newline to each string } */ /* for line in input_lines { let trimmed = trim_comments_and_whitespac(line); if trimmed.is_empty() { continue; } ... } */ /* 'seach: for room in apartment { for stop in room.hiding_spots() { if spot.contains(keys) { println!("Your keys are {} in the {}.", spot, room); break 'search; } } } */ // 6.6 return fn f() { // return type omitted: default to () return; // return value comitted: default to () } assert_eq!(f(), ()); /* let output = File::create(filename)?; let output = match File::create(filename) { Ok(f) => f, Err(err) => return Err(err) }; */ // 6.7 /* fn wait_for_process(process: &mut Process) -> i32 { while true { if process.wait() { return process.exit_code(); } } } // error: not all control paths return a value */ /* fn serve_forever(socket: ServerSocket, handler: ServerHandler) -> ! { socket.listen(); loop { let s = socket.accept(); handler.handle(s); } } */ // 6.8 /* let x = gcd(1302, 462); // function call let room = player.location(); // method call let mut numbers = Vec::new(); // static method call Iron::new(router).http("localhost:3000").unwrap(); return Vec<i32>::with_capacity(1000); // error: something about chanined comparisons let ramp = (0 .. n).collect<Vec<i32>>(); // same error return Vec::<i32>::with_capacity(1000); // ok, using ::< let ramp = (0 .. n).collect::<Vec<i32>>(); // ok, using ::< return Vec::with_capacity(10); // ok, if the fn return type is Vec<i32> let ramp: Vec<i32> = (0 .. n).collect(); // ok, variable's type is given */ // 6.9 /* game.black_pawns // struct field coords.1 // tuple element pieces[i] // array element, they are lvalue fn quicksort<T: Ord>(slice: &mut [T]) { if slice.len() <= 1 { return; // Nothing to sort. } // Partition the slice into two parts, front and back. let pivot_index = partition(slice); // Recursively sort the front half of `slice`. quicksort(&mut slice[.. pivot_index]); // And the back half. quicksort(&mut slice[pivot_index + 1 ..]); } */ // 6.10 /* let padovan: Vec<u64> = compute_padovan_sequence(n); for elem in &padovan { draw_triangle(turtle, *elem); } */ // 6.11 /* println!("{}", -100); // -100 println!("{}", -100u32); // error: can't apply unary '-' to type 'u32' println!("{}", +100); // error: expected expression, found '+' let x = 1234.567 % 10.0; // approximetely 4.567 let hi: u8 = 0xe0; let lo = !hi; // 0x1f */ // 6.12 /* total += item.price; // rust does not have increment operator and decrement operator. */ // 6.13 /* let x = 17; // x is type i32 let index = x as usize; // convert to usize */ // 6.14 /* let is_even = |x| x % 2 == 0; let is_evan = |x: u64| -> bool x % 2 == 0; // error */ let is_even = |x: u64| -> bool { x % 2 == 0 }; // ok assert_eq!(is_even(14), true); } #[test] fn error_test() { // 7.1.1 // fn pirate_share(total: u64, crew_size: usize) -> u64 { // let half = total / 2; // half / crew_size as u64 // } // pirate_share(100, 0); // 7.2 Result // fn get_weather(location: LatLng) -> Result<WeatherReport, io::Error> // 7.2.1 // match get_weather(hometown) { // Ok(report) => { // display_weather(hometown, &report); // } // Err(err) => { // println!("error querying the weather: {}", err); // schedule_weather_retry(); // } // } // A fairly safe prediction for Southern California. // const THE_USEAL: WeatherReport = WeatherReport::Sunny(72); // // result.is_ok() // result.is_err() // // result.ok() // result.err() // // Get a real weather report, if possible. // If not, fail back on the usual. // let report = get_weather(los_angels).unwrap_or(THE_USEAL); // display_weather(los_angels, &report); // // let report = // get_weather(hometown) // .unwrap_or_else(|_err| vague_prediction(hometown)); // // result.unwrap() // result.expect(message) // result.as_ref() // result.as_mut() // // 7.2.2 // fn remove_file(path: &Path) -> Result<()> // pub type Result<T> = result::Result<T, Error>; // // 7.2.3 // println!("error querying the weather: {}", err); // println!("error: {}", err); // println!("error: {:?}", err); // err.description() // err.cause() // use std::error::Error; // use std::io::{stderr, Write}; // /// Dump an error message to `stderr`. // /// // /// If another error happens while building the error message or // /// writing to `stderr`, it is ignored. // fn print_error(mut err: &Error) { // let _ = writeln!(stderr(), "error: {}", err); // while let Some(cause) = err.cause() { // let _ = writeln!(stderr(), "caused by: {}", cause); // err = cause; // } // } // // 7.2.4 // // let weather = get_weather(hometown)?; // // let weather = match get_weather(hometown) { // Ok(success_value) => success_value, // Err(err) = > return Err(err) // }; // // use std::fs; // use std::io; // use std::path::Path; // // fn move_all(src: &Path, dst: &Path) -> io::Result<()> { // for entry_result in src.read_dir()? { // opening dir could fail // let entry = entry_result?; // reading dir could fail // let dst_file = dst.join(entry.file_name()); // fs::rename(entry.path(), dst_file)?; // renaming could fail // } // Ok(()) // } // // 7.2.5 // // use std::io::{self, BufRead}; // // /// Read integers from a text file. // /// The file sould have one number on each line. // fn read_numbers(file: &mut BufRead) -> Result<Vec<i64>, io::Error> { // let mut numbers = vec![]; // for line_result in file.lines() { // let line = line_result?; // reading lines can fail // numbers.push(line.parse()?); // parsing integers can fail // } // Ok(numbers) // } // // type GenError = Box<std::error:Error>; // type GenResult<T> = Result<T, GenError>; // // let io_error = io::Error::new{ // make our own io::Error // io::ErrorKind::Other, "timed out"}; // return Err(GenError::from(io_error)); // manually convert to GenError // // 7.2.7 // let _ = writeln!(stderr(), "error: {}", err); // // 7.2.8 // // fn main() { // if let Err(err) = calculate_tides() { // print_error(&err); // std::process::exit(1); // } // } } #[test] fn struct_test() { // 9.1 /// A rectangle of eight-bit grayscale pixels struct GrayscaleMap { pixels: Vec<u8>, size: (usize, usize), } let width = 1024; let height = 576; // let image = GrayscaleMap { // pixels: vec![0; width * height], // size: (width, height), // }; fn new_map(size: (usize, usize), pixels: Vec<u8>) -> GrayscaleMap { assert_eq!(pixels.len(), size.0 * size.1); GrayscaleMap { pixels, size } } let image = new_map((width, height), vec![0; width * height]); assert_eq!(image.size, (1024, 576)); assert_eq!(image.pixels.len(), 1024 * 576); // pub struct GrayscaleMap { // pub pixels: Vec<u8>, // pub size: (usize, usize) // } // pub struct GrayscaleMap { // pixels: Vec<u8>, // size: (usize, usize) // } // struct Broom { name: String, height: u32, health: u32, position: (f32, f32, f32), intent: BroomIntent, } /// Two possitble alternatives for what a ~Broom` could be working on. #[derive(Copy, Clone)] enum BroomIntent { FetchWater, DumpWater, } // Receive the input Broom by value, taking ownership. fn chop(b: Broom) -> (Broom, Broom) { // Initialize `broom1` mostly from `b`, changing only `height`, Since // `String` is not `Copy`, `broom1` takes ownership of `b`'s name. let mut broom1 = Broom { height: b.height / 2, ..b }; // Initialize `broom2` mostly from `broom1`. Since `String` is not // `Copy`, we must clone `name` explicitly. let mut broom2 = Broom { name: broom1.name.clone(), ..broom1 }; broom1.name.push_str(" I"); broom2.name.push_str(" II"); (broom1, broom2) } let hokey = Broom { name: "Hokey".to_string(), height: 60, health: 100, position: (100.0, 200.0, 0.0), intent: BroomIntent::FetchWater, }; let (hokey1, hokey2) = chop(hokey); assert_eq!(hokey1.name, "Hokey I"); assert_eq!(hokey1.health, 100); assert_eq!(hokey2.name, "Hokey II"); assert_eq!(hokey2.health, 100); // 9.2 struct Bounds(usize, usize); let image_bounds = Bounds(1024, 768); assert_eq!(image_bounds.0 * image_bounds.1, 786432); // pub struct Bounds(pub usize, pub usize); // 9.3 // struct Onesuch; // let o = Onesuch; // 9.4 // 9.5 /// A first-in, first-out queue of characters. pub struct Queue { older: Vec<char>, // older elements, eldest last. younger: Vec<char>, // younger elements, youngest last. } impl Queue { /// Push a character onto the back of a queue. pub fn push(&mut self, c: char) { self.younger.push(c); } /// Pop a character off the front of a queue. Return `Some(c)` if there /// was a character to pop, or `None` if the queue was empty. pub fn pop(&mut self) -> Option<char> { if self.older.is_empty() { if self.younger.is_empty() { return None; } // Bring the elements in younger over to older, and put them in // the promised order. use std::mem::swap; swap(&mut self.older, &mut self.younger); self.older.reverse(); } // Now older is guaranteed to have something,. Vec's pop method // already returns an Option, so we're set. self.older.pop() } pub fn is_empty(&self) -> bool { self.older.is_empty() && self.younger.is_empty() } pub fn split(self) -> (Vec<char>, Vec<char>) { (self.older, self.younger) } pub fn new() -> Queue { Queue { older: Vec::new(), younger: Vec::new(), } } } let mut q = Queue::new(); // let mut q = Queue { // older: Vec::new(), // younger: Vec::new(), // }; q.push('0'); q.push('1'); assert_eq!(q.pop(), Some('0')); q.push('∞'); assert_eq!(q.pop(), Some('1')); assert_eq!(q.pop(), Some('∞')); assert_eq!(q.pop(), None); assert!(q.is_empty()); q.push('⦿'); assert!(!q.is_empty()); q.pop(); q.push('P'); q.push('D'); assert_eq!(q.pop(), Some('P')); q.push('X'); let (older, younger) = q.split(); // q is now uninitialized. assert_eq!(older, vec!['D']); assert_eq!(younger, vec!['X']); // 9.6 pub struct QueueT<T> { older: Vec<T>, younger: Vec<T>, } impl<T> QueueT<T> { pub fn new() -> Self { QueueT { older: Vec::new(), younger: Vec::new(), } } pub fn push(&mut self, t: T) { self.younger.push(t); } pub fn is_empty(&self) -> bool { self.older.is_empty() && self.younger.is_empty() } } // let mut qt = QueueT::<char>::new(); let mut qt = QueueT::new(); let mut rt = QueueT::new(); qt.push("CAD"); // apparently a Queue<&'static str> rt.push(0.74); // apparently a Queue<f64> qt.push("BTC"); // Bitcoins per USD, 2017-5 rt.push(2737.7); // Rust fails to detect ittational exuberance // 9.7 struct Extrema<'elt> { greatest: &'elt i32, least: &'elt i32, } fn find_extrema<'s>(slice: &'s [i32]) -> Extrema<'s> { let mut greatest = &slice[0]; let mut least = &slice[0]; for i in 1..slice.len() { if slice[i] < *least { least = &slice[i]; } if slice[i] > *greatest { greatest = &slice[i]; } } Extrema { greatest, least } } let a = [0, -3, 0, 15, 48]; let e = find_extrema(&a); assert_eq!(*e.least, -3); assert_eq!(*e.greatest, 48); // 9.8 // #[derive(Copy, Clone, Debug, PartialEq)] // struct Point { // x: f64, // y: f64, // } // 9.9 // pub struct SpiderRobot { // species: String, // web_enabled: bool, // log_device: [fd::FileDesc; 8], // ... // } // use std::rc::Rc; // pub struct SpiderSenses { // robot: Rc<SpiderRobot>, /// <-- pointer to settings and I/O // eyes: [Camera; 32], // motion: Accelerometer, // ... // } use std::cell::Cell; use std::cell::RefCell; use std::fs::File; pub struct SpiderRobot { hardware_error_count: Cell<u32>, log_file: RefCell<File>, } impl SpiderRobot { /// Increase the error count by 1. pub fn add_hardware_error(&self) { let n = self.hardware_error_count.get(); self.hardware_error_count.set(n + 1); } /// True if any hardware errors have been reported. pub fn has_hardware_errors(&self) -> bool { self.hardware_error_count.get() > 0 } /// Write a line to the log file. pub fn log(&self, message: &str) { let mut file = self.log_file.borrow_mut(); // writeln!(file, "{}", message).unwrap(); } } let ref_cell: RefCell<String> = RefCell::new("hello".to_string()); let r = ref_cell.borrow(); // ok, return a Ref<String> let count = r.len(); // ok, returns "hello".len() assert_eq!(count, 5); // let mut w = ref_cell.borrow_mut(); // panic: already borrowed // w.push_str(" world"); } #[test] fn enum_test() { // enum Ordering { // Less, // Equal, // Greater / 2.0 // } use std::cmp::Ordering; fn compare(n: i32, m: i32) -> Ordering { if n < m { Ordering::Less } else if n > m { Ordering::Greater } else { Ordering::Equal } } // use std::cmp::Ordering::*; // fn compare(n: i32, m: i32) -> Ordering { // if n < m { // Less // } else if n > m { // Greater // } else { // Equal // } // } // enum Pet { // Orca, // Giraffe, // } // use self::Pet::*; #[derive(Debug, PartialEq)] enum HttpStatus { Ok = 200, NotModified = 304, NotFound = 404, } use std::mem::size_of; assert_eq!(size_of::<Ordering>(), 1); assert_eq!(size_of::<HttpStatus>(), 2); // 404 doesn't fit in a u8 assert_eq!(HttpStatus::Ok as i32, 200); fn http_status_from_u32(n: u32) -> Option<HttpStatus> { match n { 200 => Some(HttpStatus::Ok), 304 => Some(HttpStatus::NotModified), 404 => Some(HttpStatus::NotFound), _ => None, } } let status = http_status_from_u32(404).unwrap(); // assert_eq!(status as i32, 404); assert_eq!(status, HttpStatus::NotFound); #[derive(Copy, Clone, Debug, PartialEq)] enum TimeUnit { Seconds, Minutes, Hours, Days, Months, Years, } impl TimeUnit { /// Return the plural noun for this time unit. fn plural(self) -> &'static str { match self { TimeUnit::Seconds => "seconds", TimeUnit::Minutes => "minutes", TimeUnit::Hours => "hours", TimeUnit::Days => "days", TimeUnit::Months => "months", TimeUnit::Years => "years", } } /// Return the singular noun for this time unit. fn singular(self) -> &'static str { self.plural().trim_right_matches('s') } } /// A timestamp that has been deliberately rounded off, so our program /// says "6 monthes ago" instead of "February 9, 2016, at 9:49 AM". #[derive(Copy, Clone, Debug, PartialEq)] enum RoughTime { InThePast(TimeUnit, u32), JustNow, InTheFuture(TimeUnit, u32), } let four_score_and_seven_years_ago = RoughTime::InThePast(TimeUnit::Years, 4 * 20 + 7); let three_hours_from_now = RoughTime::InTheFuture(TimeUnit::Hours, 3); struct Point3d(u32, u32, u32); enum Shape { Sphere { center: Point3d, radius: f32 }, Cubold { corner1: Point3d, corner2: Point3d }, } let unit_sphere = Shape::Sphere { center: Point3d(0, 0, 0), radius: 1.0, }; // enum RelationshipStatus { // Single, // InARelationship, // ItsComplicated(Option<String>), // ItsExtremelyComplicated { // car: DifferentialEquation, // cdr: EarlyModernistPoem // } // } // use std::collections::HashMap; enum Json { Null, Boolean(bool), Number(f64), String(String), Array(Vec<Json>), Object(Box<HashMap<String, Json>>), } // An ordered collection of `T`s enum BinaryTree<T> { Empty, NonEmpty(Box<TreeNode<T>>), } // A part of a BinaryTree. struct TreeNode<T> { element: T, left: BinaryTree<T>, right: BinaryTree<T>, } let jupiter_tree = BinaryTree::NonEmpty(Box::new(TreeNode { element: "Jupiter", left: BinaryTree::Empty, right: BinaryTree::Empty, })); let mercury_tree = BinaryTree::NonEmpty(Box::new(TreeNode { element: "Mercury", left: BinaryTree::Empty, right: BinaryTree::Empty, })); let uranus_tree = BinaryTree::NonEmpty(Box::new(TreeNode { element: "Uranus", left: BinaryTree::Empty, right: BinaryTree::Empty, })); let mars_tree = BinaryTree::NonEmpty(Box::new(TreeNode { element: "Mars", left: jupiter_tree, right: mercury_tree, })); let tree = BinaryTree::NonEmpty(Box::new(TreeNode { element: "Saturn", left: mars_tree, right: uranus_tree, })); // let mut tree = BinaryTree::Empty; // for planet in planets { // tree.add(planet); // } // 10.2 fn rough_time_to_english(rt: RoughTime) -> String { match rt { RoughTime::InThePast(units, count) => format!("{}, {} ago", count, units.plural()), RoughTime::JustNow => format!("just now"), RoughTime::InTheFuture(units, 1) => format!("a {} from now", units.plural()), RoughTime::InTheFuture(units, count) => { format!("{}, {} from now", count, units.plural()) } } } rough_time_to_english(four_score_and_seven_years_ago); // 10.2.1 // match meadow.count_rabbits() { // 0 => {} // nothing to say // 1 => println!("A rabbit is nosing around inthe clover."), // n => println!("There are {} rabbits hopping about in the meadow", n) // } // // let calendar = // match settings.get_string("calendar") { // "gregorian" => Calendar::Gregorian, // "chinese" => Calendar::Chinese, // "ethiopian" => Calendar::Ethiopian, // other => return parse_error("calendar", other) // }; // let caption = // match photo.tagged_pet() { // Pet::Tyrannosaur => "RRRRAAAAAHHHHH", // Pet::Samoyed => "*dog thoughts*", // _ => "I'm cute, love me" // generic caption, works for any pet // } // // there are many Shapes, but we only support "selecting" // // either some text, or everything in a rectangular area. // // You can't select an ellipse or trapezoid. // match document.selection() { // Shape::TextSpan(start, end) => paint_text_selection(start, end), // Shape::Rectangle(rect) => paint_rect_selection(rect), // _ => panic!("unexpected selection type") // } // // fn check_move(current_hex: Hex, click: Point) -> game::Result<Hex> { // match point_to_hex(click) { // None => // Err("That's not a game space."), // Some(current_hex) => // try to match if user clicked the current_hex // // (if doesn't work) // Err("You are already there! You must click somewhere else."), // Some(other_hex) => // Ok(other_hex) // } // } // // fn check_move(current_hex: Hex, click: Point) -> game::Result<Hex> { // match point_to_hex(click) { // None => // Err("That's not a game space."), // Some(hex) => // if hex == current_hex { // Err("You are already there! You must click somewhere else."), // } else { // Ok(hex) // } // Some(other_hex) => // Ok(other_hex) // } // } // // fn describe_point(x: i32, y: i32) -> &'static str { // use std::cmp::Ordering::*; // match (x.cmp(&0), y.cmp(&0) { // (Equal, Equal) -> "at the origin", // (_, Equal) => "on the x axis", // (Equal, _) => "on the y axis", // (Greater, Greater) => "in the first quadrant", // (Less, Grater) => "in the second quadrant", // _ => "somewhere else" // } // } // // match balloon.location { // Point { x: 0, y: height } => // println!("straight up {} meters", height), // Point { x: x, y: y } => // println!("at ({}m, {}m)", x, y); // } // // match get_acount(id) { // Some(Account { name, language, .. {) => // language.show_custom_greeting(name) // } // // 10.2.3 // // match account { // Account { name, language, .. } => { // ui.greet(&name, &language); // ui.show_settigs(&account); // error: use of moved value `account` // } // } // match account { // Account { ref name, ref language, .. } => { // ui.greet(name, language); // ui.show_settings(&account); // ok // } // } // // match line_result { // Err(ref err) => log_error(err), // `err` is &Error (shared ref) // Ok(ref mut line) -> { // `line` is &mut String (mut ref) // trim_comments(line); // modify the String in place // handle(line); // } // } // // match sphere.center() { // &Point3d { x, y, z } => ... // } // // match friend.borrow_car() { // Some(&Car { engine, .. }) => // error: can't move out of borrow // ... // None -> {} // } // // Some(&Car {ref engine, .. }) => // ok, engine is a reference // // match chars.peek() { // Some(&c) -> println!("coming up: {:?}", c), // None =-> println!("end of chars") // } // // 10.2.4 // // let at_end = // match chars.peek() { // Some(&'\r') | Some(&'\n') | None => true, // _ => false // }; // match next_char { // '0' ... '9' => // self.read_number(), // 'a' ... 'z' | 'A' ... 'Z' => // self.read_word(), // ' ' | '\t' | '\n' => // self.skip_whitespace(), // _ => // self.handle_punctuation() // } // // 10.2.5 // // match robot.last_known_location() { // Some(point) if self.distance_to(point) < 10 => // short_distance_strategy(point), // Some(point) -> // long_distance_strategy(point), // None -> // searching_strategy() // } // // 10.2.6 // // match self.get_selection() { // Shape::Rect(top_left, bottom_right) -> // optimized_paint(&Shape::Rect(top_left, bottom_right)), // other_shape => // paint_outline(other_shape.get_outline()), // } // // rect @ Shape::Rect(..) -> optimized_paint(&rect) // // match chars.next() { // Some(digit @ '0' ... '9') => read_number(disit, chars), // } // // 10.2.7 // // // ...unpack a struct into three new local variables // let Track { album, track_number, title, ..} = song; // // // ...unpack a function argument that's a tuple // fn distance_to((x,y): (f64, f64)) -> f64 { ... } // // // ...iterate over keys and values of a HashMap // for (id, document) in &cache_map { // println!("Document #{}: {}", id, document.title); // } // // // ...automatically dereference an argument to a closure // // (handy because sometimes other code passes you a reference // // when you'd rather have a copy) // let sum = numbers.fold(0, |a, &num| a + num); // // // ...handle just one enum variant specially // if let RoughTime::InTheFuture(_, _) = user.date_of_birth() { // user.set_time_traveler(true); // } // // // ...run some code only if a table lookup succeeds // if let Some(document) = cache_map.get(&id) { // return send_cached_response(document); // } // // // ...repeatedly try something until it succeeds // while let Err(err) = present_cheesy_anti_robot_task() { // log_robot_attempt(err); // // let the user try again (it might still be a human) // } // // // ...manually loop over an iterator // while let Some(_) = lines.peek() { // read_paragraph(&mut lines); // } // // 10.2.8 impl<T: Ord> BinaryTree<T> { fn add(&mut self, value: T) { match *self { BinaryTree::Empty => { *self = BinaryTree::NonEmpty(Box::new(TreeNode { element: value, left: BinaryTree::Empty, right: BinaryTree::Empty, })) } BinaryTree::NonEmpty(ref mut node) => { if value <= node.element { node.left.add(value); } else { node.right.add(value); } } } } } let mut add_tree = BinaryTree::Empty; add_tree.add("Mercury"); add_tree.add("Venus"); } #[test] fn trait_test() { { use std::io::Write; fn say_hello(out: &mut Write) -> std::io::Result<()> { out.write_all(b"hello world\n")?; out.flush() } // use std::fs::File; // let mut local_file = File::create("hello.txt"); // say_hello(&mut local_file).expect("error"); // could not work, now let mut bytes = vec![]; say_hello(&mut bytes).expect("error"); // works assert_eq!(bytes, b"hello world\n"); // 11.1 let mut buf: Vec<u8> = vec![]; buf.write_all(b"hello").expect("error"); } // 11.1.1 { use std::io::Write; let mut buf: Vec<u8> = vec![]; // let writer: Write = buf; // error: `Write` does not have a constant size let writer: &mut Write = &mut buf; // ok writer.write_all(b"hello").expect("error"); assert_eq!(buf, b"hello"); } // 11.1.3 { use std::io::Write; fn say_hello<W: Write>(out: &mut W) -> std::io::Result<()> { out.write_all(b"hello world\n")?; out.flush() } let mut buf: Vec<u8> = vec![]; buf.write_all(b"hello").expect("error"); buf::<Vec>.write_all(b"hello").expect("error"); // let v1 = (0 .. 1000).collect(); // error: can't infer type let v2 = (0..1000).collect::<Vec<i32>>(); // ok // /// Run a query on large, partitioned data set. // /// See <http://research.google.com/archive/mapreduce.html>. // fn run_query<M: Mapper + Serialize, R: Reducer + Serialize>(data: &dataSet, map: M, reduce: R) -> Results { // } // // fun run_query<M, R>(data: &Dataset, map: M, reduce: R) -> Results // where M: Mapper + Serialize, // R: Reducer + Serialize // {} // fn nearest<'t, 'c, P>(target: &'t P, candidates: &'c [P]) -> &'c P // where P: MeasureDistance // {} // // impl PancakeStack { // fn Push<:T Topping>(&mut self, goop: T) - PancakeResult<()> { // } // } // type PancakeResult<T> = Result<T, PancakeError>; } { // struct Broom { // name: String, // height: u32, // health: u32, // position: (f32, f32, f32), // intent: BroomIntent, // } // impl Broom { // fn boomstick_range(&self) -> Range<i32> { // self.y - self.height - 1 .. self.y // } // } // trait Visible { // fn draw(&self, canvas: &mut Canvas); // fn hit_test(&self, x: i32, y: i32) -> bool; // } // impl Visible for Broom { // fn draw(&self, canvas: &mut Canvas) { // //for y in self.y - self.height - 1 .. self.y { // for y in self.broomstick_range() { // canvas.write_at(self.x, y, '|'); // } // canvas.write_at(self.x, y, 'M'); // } // } // fn hit_test(&self, x: i32, y:i32) -> bool { // self.x == x // && self.y - self.height - 1 <= y // && y <- self.y // } } { // 11.2.1 /// A writer that ignores whatever data you write to it. pub struct Sink; use std::io::{Result, Write}; impl Write for Sink { fn write(&mut self, buf: &[u8]) -> Result<usize> { Ok(buf.len()) } fn flush(&mut self) -> Result<()> { Ok(()) } } } { // 11.2.2 trait IsEmoji { fn is_emoji(&self) -> bool; } impl IsEmoji for char { fn is_emoji(&self) -> bool { return false; } } assert_eq!('$'.is_emoji(), false); use std::io::{self, Write}; struct HtmlDocument; trait WriteHtml { fn write_html(&mut self, html: &HtmlDocument) -> std::io::Result<()>; } impl<W: Write> WriteHtml for W { fn write_html(&mut self, html: &HtmlDocument) -> io::Result<()> { Ok(()) } } extern crate serde; use serde::Serialize; use serde_json; use std::collections::HashMap; use std::fs::File; pub fn save_configuration(config: &HashMap<String, String>) -> std::io::Result<()> { let writer = File::create("test.json").expect("error"); let mut serializer = serde_json::Serializer::new(writer); config.serialize(&mut serializer).expect("error"); Ok(()) } { // 11.2.3 } } }
true
7b5d0a89563425910397b73621e48fbbab334995
Rust
azriel91/builder_macro
/src/parse_struct.rs
UTF-8
13,149
2.8125
3
[ "MIT" ]
permissive
#[doc(hidden)] #[macro_export] macro_rules! parse_struct { // The way we determine visibility of the generated builder and struct is based on the pattern // in: https://github.com/rust-lang-nursery/lazy-static.rs/blob/v0.2.1/src/lib.rs // Loop through each meta item in SPEC, extract it and prepend it to ITEM_META ( purpose: $PURPOSE:ident, meta: [ $( #[$ITEM_META:meta] )* ], spec: #[$NEXT_META:meta] $( $SPEC:tt )+ ) => { parse_struct! { purpose: $PURPOSE, meta: [ $( #[$ITEM_META] )* #[$NEXT_META] ], spec: $( $SPEC )+ } }; // When we reach here, we have parsed all of the meta items for the struct. // Next we have to extract the tokens for each field into a block, then parse the meta items for // each field. We have to do this because the rust compiler does not allow us to use a macro // within the struct body: // // struct Something { // parse_fields!( $( $FIELD_SPEC )* ); // compilation failure // } // // It also does not allow us to call a macro as part of another macro: // // // fails because it doesn't attempt to evaluate parse_struct! // a_macro!($something, parse_struct!($another_thing)); // // This macro adds additional blocks to make parsing easier // We match on 'pub' in case the struct and builder should be public ( purpose: $PURPOSE:ident, meta: [ $( #[$ITEM_META:meta] )* ], spec: pub $BUILDER:ident $MODE:tt $STRUCT:ident { $( $FIELD_SPEC:tt )* } $(, assertions: { $( $ASSERTION:expr; )* } )* ) => { parse_struct! { purpose: $PURPOSE, vis: [ pub ], meta: [ $( #[$ITEM_META] )* ], spec: $BUILDER $MODE $STRUCT, fields: {}, field_wip: { meta: [] }, parser_wip: { $( $FIELD_SPEC )* } $(, assertions: { $( $ASSERTION; )* } )* } }; // We must have the private scope match happen after the rule for pub scope. // This is because if we have it the other way around, the following happens: // // * $BUILDER:ident matches `pub` // * $MODE:tt matches the builder name // * $STRUCT:ident attempts to match the -> or => arrow and fails ( purpose: $PURPOSE:ident, meta: [ $( #[$ITEM_META:meta] )* ], spec: $BUILDER:ident $MODE:tt $STRUCT:ident { $( $FIELD_SPEC:tt )* } $(, assertions: { $( $ASSERTION:expr; )* } )* ) => { parse_struct! { purpose: $PURPOSE, vis: [], meta: [ $( #[$ITEM_META] )* ], spec: $BUILDER $MODE $STRUCT, fields: {}, field_wip: { meta: [] }, parser_wip: { $( $FIELD_SPEC )* } $(, assertions: { $( $ASSERTION; )* } )* } }; // Now we have to attempt to wrap each field inside braces {} // This macro looks for meta tokens and extracts them into field_wip ( purpose: $PURPOSE:ident, vis: [ $( $VIS:ident )* ], meta: [ $( #[$ITEM_META:meta] )* ], spec: $BUILDER:ident $MODE:tt $STRUCT:ident, fields: { $( { req: $FIELD_REQ:ident, vis: [ $( $FIELD_VIS:ident )* ], meta: [ $( #[$FIELD_META:meta] )* ], default: $FIELD_DEFAULT:expr, spec: $( $FIELD_SPEC:tt )+ }, )* }, field_wip: { meta: [ $( #[$FIELD_WIP_META:meta] )* ] }, parser_wip: { #[$FIELD_WIP_NEXT_META:meta] $( $SPEC_TAIL:tt )+ } $(, assertions: { $( $ASSERTION:expr; )* } )* ) => { parse_struct! { purpose: $PURPOSE, vis: [ $( $VIS )* ], meta: [ $( #[$ITEM_META] )* ], spec: $BUILDER $MODE $STRUCT, fields: { $( { req: $FIELD_REQ, vis: [ $( $FIELD_VIS )* ], meta: [ $( #[$FIELD_META] )* ], default: $FIELD_DEFAULT, spec: $( $FIELD_SPEC )+ }, )* }, field_wip: { meta: [ $( #[$FIELD_WIP_META] )* #[$FIELD_WIP_NEXT_META] ] }, parser_wip: { $( $SPEC_TAIL )+ } $(, assertions: { $( $ASSERTION; )* } )* } }; // When we reach here, the meta tokens for field_wip should have all been parsed // Therefore we should be able to match on the [pub] field_name: Type = Some(default), pattern // Mandatory field ( purpose: $PURPOSE:ident, vis: [ $( $VIS:ident )* ], meta: [ $( #[$ITEM_META:meta] )* ], spec: $BUILDER:ident $MODE:tt $STRUCT:ident, fields: { $( { req: $FIELD_REQ:ident, vis: [ $( $FIELD_VIS:ident )* ], meta: [ $( #[$FIELD_META:meta] )* ], default: $FIELD_DEFAULT:expr, spec: $( $FIELD_SPEC:tt )+ }, )* }, field_wip: { meta: [ $( #[$FIELD_WIP_META:meta] )* ] }, parser_wip: { $F_NAME:ident: $F_TY:ty, $( $SPEC_TAIL:tt )* } $(, assertions: { $( $ASSERTION:expr; )* } )* ) => { parse_struct! { purpose: $PURPOSE, vis: [ $( $VIS )* ], meta: [ $( #[$ITEM_META] )* ], spec: $BUILDER $MODE $STRUCT, fields: { $( { req: $FIELD_REQ, vis: [ $( $FIELD_VIS )* ], meta: [ $( #[$FIELD_META] )* ], default: $FIELD_DEFAULT, spec: $( $FIELD_SPEC )+ }, )* { req: true, vis: [], meta: [ $( #[$FIELD_WIP_META] )* ], default: None, spec: $F_NAME: $F_TY }, }, field_wip: { meta: [] }, parser_wip: { $( $SPEC_TAIL )* } $(, assertions: { $( $ASSERTION; )* } )* } }; // Optional field ( purpose: $PURPOSE:ident, vis: [ $( $VIS:ident )* ], meta: [ $( #[$ITEM_META:meta] )* ], spec: $BUILDER:ident $MODE:tt $STRUCT:ident, fields: { $( { req: $FIELD_REQ:ident, vis: [ $( $FIELD_VIS:ident )* ], meta: [ $( #[$FIELD_META:meta] )* ], default: $FIELD_DEFAULT:expr, spec: $( $FIELD_SPEC:tt )+ }, )* }, field_wip: { meta: [ $( #[$FIELD_WIP_META:meta] )* ] }, parser_wip: { $F_NAME:ident: $F_TY:ty = $F_DEFAULT:expr, $( $SPEC_TAIL:tt )* } $(, assertions: { $( $ASSERTION:expr; )* } )* ) => { parse_struct! { purpose: $PURPOSE, vis: [ $( $VIS )* ], meta: [ $( #[$ITEM_META] )* ], spec: $BUILDER $MODE $STRUCT, fields: { $( { req: $FIELD_REQ, vis: [ $( $FIELD_VIS )* ], meta: [ $( #[$FIELD_META] )* ], default: $FIELD_DEFAULT, spec: $( $FIELD_SPEC )+ }, )* { req: false, vis: [], meta: [ $( #[$FIELD_WIP_META] )* ], default: $F_DEFAULT, spec: $F_NAME: $F_TY }, }, field_wip: { meta: [] }, parser_wip: { $( $SPEC_TAIL )* } $(, assertions: { $( $ASSERTION; )* } )* } }; // public mandatory field ( purpose: $PURPOSE:ident, vis: [ $( $VIS:ident )* ], meta: [ $( #[$ITEM_META:meta] )* ], spec: $BUILDER:ident $MODE:tt $STRUCT:ident, fields: { $( { req: $FIELD_REQ:ident, vis: [ $( $FIELD_VIS:ident )* ], meta: [ $( #[$FIELD_META:meta] )* ], default: $FIELD_DEFAULT:expr, spec: $( $FIELD_SPEC:tt )+ }, )* }, field_wip: { meta: [ $( #[$FIELD_WIP_META:meta] )* ] }, parser_wip: { pub $F_NAME:ident: $F_TY:ty, $( $SPEC_TAIL:tt )* } $(, assertions: { $( $ASSERTION:expr; )* } )* ) => { parse_struct! { purpose: $PURPOSE, vis: [ $( $VIS )* ], meta: [ $( #[$ITEM_META] )* ], spec: $BUILDER $MODE $STRUCT, fields: { $( { req: $FIELD_REQ, vis: [ $( $FIELD_VIS )* ], meta: [ $( #[$FIELD_META] )* ], default: $FIELD_DEFAULT, spec: $( $FIELD_SPEC )+ }, )* { req: true, vis: [ pub ], meta: [ $( #[$FIELD_WIP_META] )* ], default: None, spec: $F_NAME: $F_TY }, }, field_wip: { meta: [] }, parser_wip: { $( $SPEC_TAIL )* } $(, assertions: { $( $ASSERTION; )* } )* } }; // public optional field ( purpose: $PURPOSE:ident, vis: [ $( $VIS:ident )* ], meta: [ $( #[$ITEM_META:meta] )* ], spec: $BUILDER:ident $MODE:tt $STRUCT:ident, fields: { $( { req: $FIELD_REQ:ident, vis: [ $( $FIELD_VIS:ident )* ], meta: [ $( #[$FIELD_META:meta] )* ], default: $FIELD_DEFAULT:expr, spec: $( $FIELD_SPEC:tt )+ }, )* }, field_wip: { meta: [ $( #[$FIELD_WIP_META:meta] )* ] }, parser_wip: { pub $F_NAME:ident: $F_TY:ty = $F_DEFAULT:expr, $( $SPEC_TAIL:tt )* } $(, assertions: { $( $ASSERTION:expr; )* } )* ) => { parse_struct! { purpose: $PURPOSE, vis: [ $( $VIS )* ], meta: [ $( #[$ITEM_META] )* ], spec: $BUILDER $MODE $STRUCT, fields: { $( { req: $FIELD_REQ, vis: [ $( $FIELD_VIS )* ], meta: [ $( #[$FIELD_META] )* ], default: $FIELD_DEFAULT, spec: $( $FIELD_SPEC )+ }, )* { req: false, vis: [ pub ], meta: [ $( #[$FIELD_WIP_META] )* ], default: $F_DEFAULT, spec: $F_NAME: $F_TY }, }, field_wip: { meta: [] }, parser_wip: { $( $SPEC_TAIL )* } $(, assertions: { $( $ASSERTION; )* } )* } }; ( purpose: $PURPOSE:ident, vis: [ $( $VIS:ident )* ], meta: [ $( #[$ITEM_META:meta] )* ], spec: $BUILDER:ident $MODE:tt $STRUCT:ident, fields: { $( { req: $FIELD_REQ:ident, vis: [ $( $FIELD_VIS:ident )* ], meta: [ $( #[$FIELD_META:meta] )* ], default: $FIELD_DEFAULT:expr, spec: $( $FIELD_SPEC:tt )+ }, )* }, field_wip: { meta: [] }, parser_wip: {} $(, assertions: { $( $ASSERTION:expr; )* } )* ) => { impl_struct_and_builder! { purpose: $PURPOSE, vis: [ $( $VIS )* ], meta: [ $( #[$ITEM_META] )* ], spec: $BUILDER $MODE $STRUCT, fields: { $( { req: $FIELD_REQ, vis: [ $( $FIELD_VIS )* ], meta: [ $( #[$FIELD_META] )* ], default: $FIELD_DEFAULT, spec: $( $FIELD_SPEC )+ }, )* } $(, assertions: { $( $ASSERTION; )* } )* } }; }
true
54f5669769e40dab3e6163cdc6654a100263c69a
Rust
actix/actix-website
/examples/server/src/keep_alive.rs
UTF-8
840
2.515625
3
[ "Apache-2.0", "MIT" ]
permissive
use actix_web::{ body::MessageBody, dev::{ServiceFactory, ServiceRequest, ServiceResponse}, App, Error, }; #[allow(dead_code)] fn app() -> App< impl ServiceFactory< ServiceRequest, Response = ServiceResponse<impl MessageBody>, Config = (), InitError = (), Error = Error, >, > { App::new() } // <keep-alive> use actix_web::{http::KeepAlive, HttpServer}; use std::time::Duration; #[actix_web::main] async fn main() -> std::io::Result<()> { // Set keep-alive to 75 seconds let _one = HttpServer::new(app).keep_alive(Duration::from_secs(75)); // Use OS's keep-alive (usually quite long) let _two = HttpServer::new(app).keep_alive(KeepAlive::Os); // Disable keep-alive let _three = HttpServer::new(app).keep_alive(None); Ok(()) } // </keep-alive>
true
4a7e27b121f5d5f11b09f015f16fda7eda92c334
Rust
tiffany352/tiffbot-2
/irc.rs
UTF-8
8,645
3.265625
3
[]
no_license
use parse::*; #[deriving(Clone)] pub struct Prefix { nick: ~str, user: ~str, host: ~str } impl ToStr for Prefix { fn to_str(&self) -> ~str { match (self.nick.clone(), self.user.clone(), self.host.clone()) { (~"", ~"", ~"") => ~"", (nick, ~"", ~"") => nick, (nick, ~"", host) => nick + "@" + host, (nick, user, host) => nick + "!" + user + "@" + host } } } #[deriving(Clone)] pub struct Message { prefix: Option<Prefix>, command: ~str, params: ~[~str] } impl ToStr for Message { fn to_str(&self) -> ~str { let prefixstr = match self.prefix { Some(ref x) => ":" + x.to_str() + " ", None => ~"" }; match self.params.last().iter().any(|x| x.is_whitespace()) { true => fmt!("%s%s %s:%s", prefixstr, self.command, self.params.init().map(|s| s.clone() + " ").concat(), self.params.last().clone()), false => fmt!("%s%s %s%s", prefixstr, self.command, self.params.init().map(|s| s.clone() + " ").concat(), self.params.last().clone()) } } } #[deriving(Clone)] pub enum IRCToken { Sequence(~[IRCToken]), Unparsed(~str), PrefixT(Prefix), Params(~[~str]), MessageT(Message), Ignored } impl TokenCreator for IRCToken { fn sequence(arr: ~[Token<IRCToken>]) -> IRCToken { Sequence(arr.map(|x| x.value.clone())) } fn raw(s: ~str) -> IRCToken { Unparsed(s) } } fn build_unparsed(s: ~str) -> Result<IRCToken, ~str> { Ok(Unparsed(s)) } fn map_ignored(_: IRCToken) -> Result<IRCToken, ~str> { Ok(Ignored) } fn map_params(tok: IRCToken) -> Result<IRCToken, ~str> { // Sequence(~[Sequence(~[Sequence(~[Ignored, Unparsed(~"##codelab")])]), Sequence(~[Sequence(~[Ignored, Unparsed(~":"), Unparsed(~"hi")])])]) match tok { Sequence(args) => Ok(Params(args.map(|arg| { match arg.clone() { Sequence([Sequence([Ignored, Unparsed(param)])]) => param, Sequence([Sequence([Ignored, Unparsed(~":"), Unparsed(param)])]) => param, _ => ~"" } }))), _ => Err(~"Malformed parameters") } } fn map_message(tok: IRCToken) -> Result<IRCToken, ~str> { // Sequence(~[Sequence(~[Sequence(~[Unparsed(~":"), PrefixT(irc::Prefix{nick: ~"tiffany", user: ~"lymia", host: ~"hugs"}), Ignored])]), Unparsed(~"PRIVMSG"), Sequence(~[Params(~[~"##codelab", ~"hi"])])]) match tok { Sequence([Sequence([Sequence([Unparsed(~":"), PrefixT(prefix), Ignored])]), Unparsed(cmd), Sequence([Params(params)])]) => Ok(MessageT(Message {prefix: Some(prefix), command: cmd, params: params})), Sequence([Sequence([]), Unparsed(cmd), Sequence([Params(params)])]) => Ok(MessageT(Message {prefix: None, command: cmd, params: params})), _ => Err(fmt!("Malformed message: %?", tok)) } } fn map_prefix(tok: IRCToken) -> Result<IRCToken, ~str> { match tok { Sequence([Unparsed(nick), Sequence([rest])]) => match rest { Sequence([Sequence([rest]), Unparsed(~"@"), Unparsed(host)]) => match rest { Sequence([Unparsed(~"!"), Unparsed(user)]) => Ok(PrefixT(Prefix {nick: nick, user: user, host: host})), _ => Ok(PrefixT(Prefix {nick: nick, user: ~"", host: host})), }, _ => Ok(PrefixT(Prefix {nick: nick, user: ~"", host: ~""})), }, _ => Err(~"Malformed prefix") } } fn build_serverprefix(s: ~str) -> Result<IRCToken, ~str> { Ok(PrefixT(Prefix {nick: s, user: ~"", host: ~""})) } pub fn grammar() -> ParseContext<IRCToken> { let mut ctx = ParseContext::new(); /* message = [ ":" prefix SPACE ] command [ params ] crlf prefix = servername / ( nickname [ [ "!" user ] "@" host ] ) command = 1*letter / 3digit params = *14( SPACE middle ) [ SPACE ":" trailing ] =/ 14( SPACE middle ) [ SPACE [ ":" ] trailing ] nospcrlfcl = %x01-09 / %x0B-0C / %x0E-1F / %x21-39 / %x3B-FF ; any octet except NUL, CR, LF, " " and ":" middle = nospcrlfcl *( ":" / nospcrlfcl ) trailing = *( ":" / " " / nospcrlfcl ) SPACE = %x20 ; space character crlf = %x0D %x0A ; "carriage return" "linefeed" */ ctx.rule("message", ~Map(~LessThan(1, ~Literal(":") * ~Rule("prefix") * ~Rule("SPACE")) * ~Rule("command") * ~LessThan(1, ~Rule("params")), map_message)); ctx.rule("prefix", ~Map(~Rule("nickname") * ~LessThan(1, ~LessThan(1, ~Literal("!") * ~Rule("user")) * ~Literal("@") * ~Rule("host")), map_prefix) + ~Build(~Rule("servername"), build_serverprefix)); ctx.rule("command", ~Build(~MoreThan(1, ~Rule("letter")) + ~Exactly(3, ~Rule("digit")), build_unparsed)); ctx.rule("params", ~Map(~More(~Rule("SPACE") * ~Rule("middle")) * ~LessThan(1, ~Rule("SPACE") * ~Literal(":") * ~Rule("trailing")) + ~More(~Rule("SPACE") * ~Rule("middle")) * ~LessThan(1, ~Rule("SPACE") * ~LessThan(1, ~Literal(":")) * ~Rule("trailing")), map_params)); ctx.rule("nospcrlfcl", ~Diff(~Chars(1), ~Set("\x00\r\n :".iter().collect()))); ctx.rule("middle", ~Build(~Rule("nospcrlfcl") * ~More(~Literal(":") + ~Rule("nospcrlfcl")), build_unparsed)); ctx.rule("trailing", ~Build(~More(~Literal(":") + ~Literal(" ") + ~Rule("nospcrlfcl")), build_unparsed)); ctx.rule("SPACE", ~Map(~Literal(" "), map_ignored)); ctx.rule("crlf", ~Literal("\r\n")); /* target = nickname / server msgtarget = msgto *( "," msgto ) msgto = channel / ( user [ "%" host ] "@" servername ) msgto =/ ( user "%" host ) / targetmask msgto =/ nickname / ( nickname "!" user "@" host ) channel = ( "#" / "+" / ( "!" channelid ) / "&" ) chanstring [ ":" chanstring ] servername = hostname host = hostname / hostaddr hostname = shortname *( "." shortname ) shortname = ( letter / digit ) *( letter / digit / "-" ) *( letter / digit ) ; as specified in RFC 1123 [HNAME] hostaddr = ip4addr / ip6addr ip4addr = 1*3digit "." 1*3digit "." 1*3digit "." 1*3digit ip6addr = 1*hexdigit 7( ":" 1*hexdigit ) ip6addr =/ "0:0:0:0:0:" ( "0" / "FFFF" ) ":" ip4addr nickname = ( letter / special ) *8( letter / digit / special / "-" ) targetmask = ( "$" / "#" ) mask ; see details on allowed masks in section 3.3.1 chanstring = %x01-07 / %x08-09 / %x0B-0C / %x0E-1F / %x21-2B chanstring =/ %x2D-39 / %x3B-FF ; any octet except NUL, BELL, CR, LF, " ", "," and ":" channelid = 5( %x41-5A / digit ) ; 5( A-Z / 0-9 ) */ ctx.rule("servername", ~Rule("hostname")); ctx.rule("host", ~Build(~Rule("hostname") + ~Rule("hostaddr"), build_unparsed)); ctx.rule("hostname", ~Rule("shortname") * ~More(~Literal(".") * ~Rule("shortname"))); ctx.rule("shortname", (~Rule("letter") + ~Rule("digit")) * ~More(~Rule("letter") + ~Rule("digit") + ~Literal("-"))); ctx.rule("hostaddr", ~Rule("ip4addr") + ~Rule("ip6addr")); ctx.rule("ip4addr", ~Exactly(3, ~Rule("digit")) * ~Exactly(3, ~Exactly(3, ~Literal(".") * ~Rule("digit")))); ctx.rule("ip6addr", ~Rule("hexdigit") * ~Exactly(7, ~Literal(":") * ~Rule("hexdigit")) + ~Literal("0:0:0:0:0:") * (~Literal("0") + ~Literal("FFFF")) * ~Literal(":") * ~Rule("ip4addr")); ctx.rule("nickname", ~Build((~Rule("letter") + ~Rule("special")) * ~More(~Rule("letter") + ~Rule("digit") + ~Rule("special") + ~Literal("-")), build_unparsed)); /* user = 1*( %x01-09 / %x0B-0C / %x0E-1F / %x21-3F / %x41-FF ) ; any octet except NUL, CR, LF, " " and "@" key = 1*23( %x01-05 / %x07-08 / %x0C / %x0E-1F / %x21-7F ) ; any 7-bit US_ASCII character, ; except NUL, CR, LF, FF, h/v TABs, and " " letter = %x41-5A / %x61-7A ; A-Z / a-z digit = %x30-39 ; 0-9 hexdigit = digit / "A" / "B" / "C" / "D" / "E" / "F" special = %x5B-60 / %x7B-7D ; "[", "]", "\", "`", "_", "^", "{", "|", "}" */ ctx.rule("user", ~Build(~MoreThan(1, ~Diff(~Chars(1), ~Set("\x00\r\n @".iter().collect()))), build_unparsed)); ctx.rule("letter", ~Range('a','z') + ~Range('A','Z')); ctx.rule("digit", ~Range('0','9')); ctx.rule("hexdigit", ~Rule("digit") + ~Range('A','F')); ctx.rule("special", ~Set("[]\\`_^{|}".iter().collect())); ctx }
true
cffec2d5396c808b41efe766d1892dfe78d6acf8
Rust
escape209/chum-world
/libchum/src/macros.rs
UTF-8
42,890
2.640625
3
[ "MIT" ]
permissive
#[allow(unused_macros)] macro_rules! chum_path_element { ( [$x:expr] ) => { ChumPathElement::Index($x) }; ( $x:expr ) => { ChumPathElement::Member(&stringify!($x)) }; } #[macro_export] macro_rules! chum_path { ( $( $x:tt). * ) => { &[ $( chum_path_element!( $x ), )* ] }; } /// Get the actual data type for the given type information. macro_rules! chum_struct_get_type { // special override rules ([ignore $type:tt $default:expr]) => {()}; ([ custom_structure $type:tt structure: $structure:expr; destructure: $destructure:expr; ]) => {chum_struct_get_type!($type)}; ([ custom_binary $type:tt read: $structure:expr; write: $destructure:expr; ]) => {chum_struct_get_type!($type)}; ([option $type:tt $default:expr]) => {Option<chum_struct_get_type!($type)>}; // regular rules ([void]) => {()}; ([u8]) => {::std::primitive::u8}; ([i8]) => {::std::primitive::i8}; ([u16]) => {::std::primitive::u16}; ([i16]) => {::std::primitive::i16}; ([u32]) => {::std::primitive::u32}; ([i32]) => {::std::primitive::i32}; ([enum [$repr:tt] $name:ty]) => {$name}; ([flags [$repr:tt] {$($_name:ident),*}]) => {$repr}; ([int_custom [$repr:tt] $_min:expr, $_max:expr]) => {$repr}; ([f32]) => {::std::primitive::f32}; ([Transform3D]) => {$crate::common::Transform3D}; ([Transform2D]) => {$crate::common::Transform2D}; ([Vector2]) => {$crate::common::Vector2}; ([Vector3]) => {$crate::common::Vector3}; ([Vector3 rgb]) => {$crate::common::Vector3}; ([Color]) => {$crate::common::ColorRGBA}; ([Quaternion]) => {$crate::common::Quaternion}; ([reference]) => {::std::primitive::i32}; ([reference $typename:ident]) => {::std::primitive::i32}; ([fixed array $type:tt $len:literal]) => {[chum_struct_get_type!($type);$len]}; ([dynamic array [$lentype:tt] $type:tt $_default:expr]) => {Vec<chum_struct_get_type!($type)>}; ([struct $t:ty]) => {$t} } /// Determines how to structure each type macro_rules! chum_struct_structure { ([u8],$value:expr) => {Integer($value as ::std::primitive::i64, U8)}; ([i8],$value:expr) => {Integer($value as ::std::primitive::i64, I8)}; ([u16],$value:expr) => {Integer($value as ::std::primitive::i64, U16)}; ([i16],$value:expr) => {Integer($value as ::std::primitive::i64, I16)}; ([u32],$value:expr) => {Integer($value as ::std::primitive::i64, U32)}; ([i32],$value:expr) => {Integer($value as ::std::primitive::i64, I32)}; ([enum [$repr:tt] $name:ty],$value:expr) => { Integer($crate::structure::ChumEnum::to_u32(&$value) as i64, Enum( $crate::structure::ChumEnum::get_names(&$value) )) }; ([flags [$repr:tt] {$($name:ident),*}],$value:expr) => { Integer($value as ::std::primitive::i64, Flags( vec![ $( stringify!($name).to_owned(), )* ] )) }; ([int_custom [$repr:tt] $min:expr, $max:expr],$value:expr) => { Integer($value as ::std::primitive::i64, Custom($min,$max)) }; ([f32],$value:expr) => {Float($value)}; ([Transform3D],$value:expr) => {Transform3D($value)}; ([Transform2D],$value:expr) => {Transform2D($value)}; ([Vector2],$value:expr) => {Vec2($value)}; ([Vector3],$value:expr) => {Vec3($value)}; ([Vector3 rgb],$value:expr) => { Color( $crate::common::ColorRGBA { r: $value.x, g: $value.y, b: $value.z, a: 1.0f32 }, ColorInfo { has_alpha: false } ) }; ([Color],$value:expr) => {Color($value, ColorInfo{has_alpha: true})}; ([Quaternion],$value:expr) => { { Vec3($crate::common::quat_to_euler($value)) } }; ([reference],$value:expr) => {Reference($value,None)}; ([reference $typename:ident],$value:expr) => { Reference($value,Some(stringify!($typename).to_owned())) }; ([fixed array $type:tt $len:literal],$value:expr) => { Array(ArrayData{ can_resize: false, data: $value .iter() .map(|x| chum_struct_structure!($type, *x)) .collect(), // some random default value that won't be used anyways default_value: || {Integer(0,U8)}, }) }; ([dynamic array [$lentype:tt] $type:tt $default:expr],$value:expr) => { { let x: &Vec<chum_struct_get_type!($type)> = &$value; Array(ArrayData{ can_resize: true, data: x .iter() .map(|x| chum_struct_structure!($type, *x)) .collect(), default_value: || {chum_struct_structure!($type, $default)}, }) } }; ([struct $t:ty],$value:expr) => { $value.structure() }; ([option $type:tt $default:expr],$value:expr) => { Optional { value: $value .as_ref() .map(|x: &chum_struct_get_type!($type)| { Box::new(chum_struct_structure!($type,*x)) }), default_value: || {chum_struct_structure!($type, $default)} } }; } /// Determines how to destructure each type. macro_rules! chum_struct_destructure { ([u8],$value:expr) => { $value.get_i64().unwrap() as ::std::primitive::u8 }; ([i8],$value:expr) => { $value.get_i64().unwrap() as ::std::primitive::i8 }; ([u16],$value:expr) => { $value.get_i64().unwrap() as ::std::primitive::u16 }; ([i16],$value:expr) => { $value.get_i64().unwrap() as ::std::primitive::i16 }; ([u32],$value:expr) => { $value.get_i64().unwrap() as ::std::primitive::u32 }; ([i32],$value:expr) => { $value.get_i64().unwrap() as ::std::primitive::i32 }; ([enum [$repr:tt] $name:ty],$value:expr) => {{ use $crate::structure::ChumEnum; <$name>::from_u32($value.get_i64().unwrap() as u32).unwrap() }}; ([flags [$repr:tt] {$($name:ident),*}],$value:expr) => { $value.get_i64().unwrap() as $repr }; ([int_custom [$repr:tt] $min:expr, $max:expr],$value:expr) => { $value.get_i64().unwrap() as $repr }; ([f32],$value:expr) => { $value.get_f32().unwrap() }; ([Transform3D],$value:expr) => { *$value.get_transform3d().unwrap() }; ([Transform2D],$value:expr) => { *$value.get_transform2d().unwrap() }; ([Vector2],$value:expr) => { *$value.get_vec2().unwrap() }; ([Vector3],$value:expr) => { *$value.get_vec3().unwrap() }; ([Vector3 rgb],$value:expr) => {{ let col = $value.get_color().unwrap(); $crate::common::Vector3::new(col.r, col.g, col.b) }}; ([Color],$value:expr) => { *$value.get_color().unwrap() }; ([Quaternion],$value:expr) => {{ let vec = *$value.get_vec3().unwrap(); $crate::common::Quaternion::from_euler(vec) }}; ([reference],$value:expr) => { $value.get_reference_id().unwrap() }; ([reference $typename:ident],$value:expr) => { $value.get_reference_id().unwrap() }; ([fixed array $type:tt $len:literal],$value:expr) => {{ use ::std::mem::{self, MaybeUninit}; unsafe { let mut arr: [MaybeUninit<chum_struct_get_type!($type)>; $len] = { MaybeUninit::uninit().assume_init() }; for i in 0..$len { arr[i] = MaybeUninit::new(chum_struct_destructure!( $type, $value.get_array_item(i).unwrap() )); } mem::transmute::<_, [chum_struct_get_type!($type); $len]>(arr) } }}; ([dynamic array [$lentype:tt] $type:tt $default:expr],$value:expr) => { $value .get_array() .unwrap() .iter() .map(|x| chum_struct_destructure!($type, x)) .collect() }; ([struct $t:ty],$value:expr) => {{ $crate::structure::ChumStruct::destructure($value).unwrap() }}; ([option $type:tt $default:expr],$value:expr) => { $value .get_optional_value() .unwrap() .map(|x| chum_struct_destructure!($type, x)) }; } /// Process a structure function. /// Results in `None` if the value is ignored. macro_rules! process_structure { ($name:ident,[void],$value:expr,$self:expr) => { None }; ($name:ident,[ignore $type:tt $default:expr],$value:expr,$self:expr) => { None }; ($name:ident,[ custom_structure $type:tt structure: $structure:expr; destructure: $destructure:expr; ],$value:expr,$self:expr) => { $structure($self) }; ($name:ident,[ custom_binary $type:tt read: $structure:expr; write: $destructure:expr; ],$value:expr,$self:expr) => { process_structure!($name, $type, $value, $self) }; ($name:ident,$type:tt,$value:expr,$self:expr) => { Some(( stringify!($name).to_owned(), chum_struct_structure!($type, $value), )) }; } /// Process a destructure function. /// Results in `()` if the value is ignored. macro_rules! process_destructure { ($name:ident,$data:expr,[void]) => { () }; ($name:ident,$data:expr,[ignore $type:tt $default:expr]) => { () }; ($name:ident,$data:expr,[ custom_structure $type:tt structure: $structure:expr; destructure: $destructure:expr; ]) => { $destructure($data) }; ($name:ident,$data:expr,[ custom_binary $type:tt read: $structure:expr; write: $destructure:expr; ]) => { process_destructure!($name, $data, $type) }; ($name:ident,$data:expr,$type:tt) => { chum_struct_destructure!($type, $data.get_struct_item(stringify!($name)).unwrap()) }; } /// Automatically generate ChumStruct trait for the given type. /// This does a lot of stuff under the hood, so the type system is drastically changed to accomidate. /// In addition, to comply with `chum_struct_generate_readwrite!`, these types also have to have /// specific sizes for binary serialization. So, these types heavily reflect that. /// Supported types: /// * [void]: empty type that doesn't consume any bytes /// * [u8], [i8], [u16], [i16], [u32], [i32]: integers /// * [f32]: floats /// * [enum [repr] EnumName]: enums generated by `chum_enum!` /// [repr] is the integer representation, e.g. [u16]. /// [repr] does nothing without `chum_struct_generate_readwrite` /// * [flags [repr] {A, B, C, ...}]: flag integers /// [repr] is the integer representation, e.g. [u16]. /// * [int_custom [repr] min max]: int_custom integer in [min, max] range /// [repr] is the integer representation, e.g. [u16]. /// * [Transform3D]: common::Transform3D /// * [Transform2D]: common::Transform2D /// * [Quaternion]: common::Quaternion /// * [Vector2]: common::Vector2 /// * [Vector3]: common::Vector3 /// * [Vector3 rbg]: common::Vector3 /// gets converted to and from Color instead. /// * [Color]: common::Color /// * [reference <type>]: reference to another file. /// Actual type is [i32]. /// <type> is an optional reference type, e.g. 'BITMAP' /// * [fixed array [type] len]: Fixed length array. /// Gets converted into [type; len]. /// * [dynamic array [lentype] [type] default]: Dynamically sized array. /// [lentype] is the type of the length. The length must come directly before the data in the binary. /// [lentype] does nothing without `chum_struct_generate_readwrite` /// Gets converted into Vec<type>. /// Adding new elements through the editor will add an instance of `default`. /// * [struct type]: A structure generated by `chum_struct`. /// This type will refer to the `type` struct. /// * [option [type] default]: An optional value. /// `default` is the value that will be given if it is empty, then given a value. /// * [ignore [type] value]: A value that will be ignored and not shown in the structure editor. /// When writing to a file, `value` will be used. /// * [custom_structure [type] /// structure: |value: &Self| -> Option<ChumStructVariant>; /// destructure: |data: &ChumStructVariant| -> [type];] /// A custom structure/destructure function. /// Return `None` from structure for it to not appear in the structure editor. /// * [custom_binary [type] /// read: |value: &Self, file: &mut Write, fmt: TotemFormat| -> StructUnpackResult<[type]>; /// write: |data: &[type], file: &mut Read, fmt: TotemFormat| -> io::Result<()>;] /// A custom binary read/write function. /// The type &Self is actually a special version of Self where each property is Option<property type>. /// This is necessary for data to be safely read from the struct at run time. #[macro_export] macro_rules! chum_struct { ( $( #[$a:meta] )* pub struct $structname:ident { $( pub $name:ident : $type:tt ),* $(,)? // this is just so that the last comma is optional } ) => { $( #[$a] )* pub struct $structname { $( pub $name : chum_struct_get_type!($type), )* } chum_struct_impl! { impl ChumStruct for $structname { $( $name: $type ),* } } }; } /// Special macro that just implements ChumStruct instead of also defining the struct. /// Useful for Generic types. #[macro_export] macro_rules! chum_struct_impl { ( impl ChumStruct for $structname:ty { $( $name:ident : $type:tt ),* $(,)? // this is just so that the last comma is optional } ) => { impl $crate::structure::ChumStruct for $structname { fn structure(&self) -> $crate::structure::ChumStructVariant { #![allow(unused_imports)] use $crate::structure::ChumStructVariant::*; use $crate::structure::IntType::*; use $crate::structure::ArrayData; use $crate::structure::ColorInfo; Struct(vec![ $( { process_structure!($name,$type,self.$name,self) }, )* ].into_iter().filter_map(|e|e).collect()) } fn destructure(data: &$crate::structure::ChumStructVariant) -> Result<Self, $crate::error::DestructureError> { Ok( Self { $( $name: process_destructure!($name,data,$type), )* } ) } } }; } macro_rules! one { ($x: ident) => { 1u32 }; } macro_rules! get_index { ($($y:ident),*) => { { let mut x = 0u32; $( x += one!($y); )* x } } } /// Generate an enumeration to use with ChumStruct. /// Essentially a C-style enum that counts up from 0. #[macro_export] macro_rules! chum_enum { ( $( #[$a:meta] )* pub enum $enumname:ident { $( $name:ident ),* $(,)? // this is just so that the last comma is optional } ) => { $( #[$a] )* #[repr(u32)] pub enum $enumname { $( $name, )* } impl $crate::structure::ChumEnum for $enumname { fn to_u32(&self) -> u32 { return *self as u32 } fn from_u32(value: u32) -> Option<Self> { if value >= get_index!($($name),*) { None } else { unsafe { ::std::option::Option::Some(::std::mem::transmute::<u32,Self>(value)) } } } fn get_names(&self) -> Vec<String> { vec![ $( stringify!($name).to_owned() ),* ] } } }; } // welcome to repretition hell #[macro_export] macro_rules! chum_struct_binary_read { ([ignore $type:tt $default:expr],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { chum_struct_binary_read!($type, $file, $fmt, $struct, $path, $self).map(|_| ()) }; ([void],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { Ok(()) }; ([ custom_structure $type:tt structure: $structure:expr; destructure: $destructure:expr; ],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { chum_struct_binary_read!($type, $file, $fmt, $struct, $path, $self) }; ([ custom_binary $type:tt read: $read:expr; write: $write:expr; ],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $read($self, $file, $fmt) }; ([u8],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $fmt.read_u8($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([i8],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $fmt.read_i8($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([u16],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $fmt.read_u16($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([i16],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $fmt.read_i16($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([u32],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $fmt.read_u32($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([i32],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $fmt.read_i32($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([enum [$repr:tt] $name:ty],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => {{ use $crate::structure::ChumEnum; chum_struct_binary_read!([$repr], $file, $fmt, $struct, $path, $self).and_then(|x| { <$name>::from_u32(x as u32).ok_or_else(|| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: $crate::error::UnpackError::InvalidEnumeration { enum_name: stringify!($name).to_owned(), value: x as i64, }, }) }) }}; ([flags [$repr:tt] {$($name:ident),*}],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { chum_struct_binary_read!([$repr], $file, $fmt, $struct, $path, $self) }; ([int_custom [$repr:tt] $min:expr, $max:expr],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { chum_struct_binary_read!([$repr], $file, $fmt, $struct, $path, $self) }; ([f32],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $fmt.read_f32($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([Transform3D],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $crate::common::read_transform3d($file, $fmt).map_err(|e| { $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), } }) }; ([Transform2D],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $crate::common::read_transform2d($file, $fmt).map_err(|e| { $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), } }) }; ([Vector2],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $crate::common::read_vec2($file, $fmt).map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([Vector3],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $crate::common::read_vec3($file, $fmt).map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([Vector3 rgb],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $crate::common::read_vec3($file, $fmt).map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([Color],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $crate::common::read_color_rgba($file, $fmt).map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([Quaternion],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $crate::common::read_quat($file, $fmt).map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([reference],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $fmt.read_i32($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([reference $typename:ident],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { $fmt.read_i32($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), }) }; ([fixed array $type:tt $len:literal],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => {{ use ::std::mem::{self, MaybeUninit}; unsafe { let mut arr: [MaybeUninit<chum_struct_get_type!($type)>; $len] = { MaybeUninit::uninit().assume_init() }; for i in 0..$len { arr[i] = MaybeUninit::new(chum_struct_binary_read!( $type, $file, $fmt, $struct, format!("{}[{}]", $path, i), $self )?); } Ok(mem::transmute::<_, [chum_struct_get_type!($type); $len]>( arr, )) } }}; ([dynamic array [$lentype:tt] $type:tt $default:expr],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => {{ chum_struct_binary_read!([$lentype], $file, $fmt, $struct, $path, $self).and_then(|size| { let mut vec = Vec::with_capacity((size as usize).min($crate::common::SAFE_CAPACITY_BIG)); for i in 0..size { vec.push(chum_struct_binary_read!( $type, $file, $fmt, $struct, format!("{}[{}]", $path, i), $self )?) } Ok(vec) }) }}; ([struct $t:ty],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => { match <$t>::read_from($file, $fmt) { Ok(value) => Ok(value), Err(e) => Err(e.structuralize($struct, &$path)), } }; ([option $type:tt $default:expr],$file:expr,$fmt:expr,$struct:expr,$path:expr,$self:expr) => {{ let has_value = $fmt .read_u8($file) .map_err(|e| $crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: e.into(), })?; match has_value { 0 => Ok(None), 1 => Ok(Some(chum_struct_binary_read!( $type, $file, $fmt, $struct, $path, $self )?)), o => Err($crate::error::StructUnpackError { structname: $struct.to_owned(), structpath: $path.to_owned(), error: $crate::error::UnpackError::InvalidEnumeration { enum_name: "Optional".to_string(), value: o as i64, }, }), } }}; } #[macro_export] macro_rules! chum_struct_binary_write { ([ignore $type:tt $default:expr],$file:expr,$fmt:expr,$value:expr,$this:expr) => { chum_struct_binary_write!($type, $file, $fmt, &$default, $this) }; ([void],$file:expr,$fmt:expr,$value:expr,$this:expr) => { ::std::io::Result::<()>::Ok(()) }; ([ custom_structure $type:tt structure: $structure:expr; destructure: $destructure:expr; ],$file:expr,$fmt:expr,$value:expr,$this:expr) => { chum_struct_binary_write!($type, $file, $fmt, $value, $this) }; ([ custom_binary $type:tt read: $read:expr; write: $write:expr; ],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $write($value, $file, $fmt) }; ([u8],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $fmt.write_u8($file, *$value) }; ([i8],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $fmt.write_i8($file, *$value) }; ([u16],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $fmt.write_u16($file, *$value) }; ([i16],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $fmt.write_i16($file, *$value) }; ([u32],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $fmt.write_u32($file, *$value) }; ([i32],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $fmt.write_i32($file, *$value) }; ([enum [$repr:tt] $name:ty],$file:expr,$fmt:expr,$value:expr,$this:expr) => {{ let ivalue = $crate::structure::ChumEnum::to_u32($value) as $repr; chum_struct_binary_write!([$repr], $file, $fmt, &ivalue, $this) }}; ([flags [$repr:tt] {$($name:ident),*}],$file:expr,$fmt:expr,$value:expr,$this:expr) => { chum_struct_binary_write!([$repr], $file, $fmt, $value, $this) }; ([int_custom [$repr:tt] $min:expr, $max:expr],$file:expr,$fmt:expr,$value:expr,$this:expr) => { chum_struct_binary_write!([$repr], $file, $fmt, $value, $this) }; ([f32],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $fmt.write_f32($file, *$value) }; ([Transform3D],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $crate::common::write_transform3d($value, $file, $fmt) }; ([Transform2D],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $crate::common::write_transform2d($value, $file, $fmt) }; ([Vector2],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $crate::common::write_vec2($value, $file, $fmt) }; ([Vector3],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $crate::common::write_vec3($value, $file, $fmt) }; ([Vector3 rgb],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $crate::common::write_vec3($value, $file, $fmt) }; ([Color],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $crate::common::write_color_rgba($value, $file, $fmt) }; ([Quaternion],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $crate::common::write_quat($value, $file, $fmt) }; ([reference],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $fmt.write_i32($file, *$value) }; ([reference $typename:ident],$file:expr,$fmt:expr,$value:expr,$this:expr) => { $fmt.write_i32($file, *$value) }; ([fixed array $type:tt $len:literal],$file:expr,$fmt:expr,$value:expr,$this:expr) => {{ for i in 0..$len { chum_struct_binary_write!($type, $file, $fmt, &$value[i], $this)?; } // fun cheat ::std::io::Result::<()>::Ok(()) }}; ([dynamic array [$lentype:tt] $type:tt $default:expr],$file:expr,$fmt:expr,$value:expr,$this:expr) => {{ let lenval = $value.len() as $lentype; chum_struct_binary_write!([$lentype], $file, $fmt, &lenval, $this)?; for value in $value.iter() { chum_struct_binary_write!($type, $file, $fmt, value, $this)?; } // fun cheat again ::std::io::Result::<()>::Ok(()) }}; ([struct $t:ty],$file:expr,$fmt:expr,$value:expr,$this:expr) => { <$t as $crate::binary::ChumBinary>::write_to($value, $file, $fmt) }; ([option $type:tt $default:expr],$file:expr,$fmt:expr,$value:expr,$this:expr) => {{ match $value { Some(ref x) => { $fmt.write_u8($file, 1)?; chum_struct_binary_write!($type, $file, $fmt, x, $this) } None => $fmt.write_u8($file, 0), } }}; } /// Generate a struct with the ability to read from/write to /// binary files using the ChumBinary trait. #[macro_export] macro_rules! chum_binary { ( $( #[$a:meta] )* pub struct $structname:ident { $( pub $name:ident : $type:tt ),* $(,)? // this is just so that the last comma is optional } ) => { $( #[$a] )* pub struct $structname { $( pub $name : chum_struct_get_type!($type), )* } chum_binary_impl! { impl ChumBinary for $structname { $( $name: $type ),* } } } } /// Generate a ChumStruct with the ability to read from/write to /// binary files using the ChumBinary trait. #[macro_export] macro_rules! chum_struct_binary { ( $( #[$a:meta] )* pub struct $structname:ident { $( pub $name:ident : $type:tt ),* $(,)? // this is just so that the last comma is optional } ) => { chum_struct! { $( #[$a] )* pub struct $structname { $( pub $name : $type, )* } } chum_binary_impl! { impl ChumBinary for $structname { $( $name: $type ),* } } } } /// ONLY implements ChumBinary. #[macro_export] macro_rules! chum_binary_impl { ( impl ChumBinary for $structname:ty { $( $name:ident : $type:tt ),* $(,)? // this is just so that the last comma is optional } ) => { impl $crate::binary::ChumBinary for $structname { fn read_from(file: &mut dyn ::std::io::Read, fmt: $crate::format::TotemFormat) -> $crate::error::StructUnpackResult<Self> { // well this is stupid :) // Declaring another struct with the same name, purely so that // chum_binary can access data before the entire structure has been read. // It's all Option so it's not exactly zero-cost, but it should be fast enough. pub struct Inner { $( $name: Option<chum_struct_get_type!($type)> ),* } let mut value = Inner { $( $name: None ),* }; $( value.$name = Some( chum_struct_binary_read!($type, file, fmt, stringify!($structname), stringify!($name), &value)? ); )* Ok(Self { $( $name: value.$name.unwrap() ),* }) } fn write_to(&self, writer: &mut dyn ::std::io::Write, fmt: $crate::format::TotemFormat) -> ::std::io::Result<()> { $( chum_struct_binary_write!($type, writer, fmt, &self.$name, self)?; )* Ok(()) } } }; } /// Special macro that just implements ChumStruct and ChumBinary instead of also defining the struct. /// Useful for Generic types. #[macro_export] macro_rules! chum_struct_binary_impl { ( impl ChumBinary for $structname:ty { $( $name:ident : $type:tt ),* $(,)? // this is just so that the last comma is optional } ) => { chum_struct_impl! { impl ChumStruct for $structname { $( $name: $type ),* } } chum_binary_impl! { impl ChumBinary for $structname { $( $name: $type ),* } } }; } /// Special macro that implements ChumBinary and ChumStruct for enumerated types #[macro_export] macro_rules! chum_struct_binary_enum { ( $( #[$a:meta] )* pub enum $enumname:ident $enumtype:tt { $( $variantname:ident: $variantpattern:tt => { $( $name:ident : $type:tt = $default:expr ),* $(,)? } ),* $(,)? } ) => { $( #[$a] )* pub enum $enumname { $( $variantname { $( $name: chum_struct_get_type!($type) ),* } ),* } impl $crate::structure::ChumStruct for $enumname { fn structure(&self) -> $crate::structure::ChumStructVariant { #![allow(unused_imports)] use $crate::structure::ChumStructVariant::*; use $crate::structure::IntType::*; use $crate::structure::ArrayData; use $crate::structure::ColorInfo; use $crate::structure::VariantOption; let optionvec: Vec<VariantOption> = vec! [ $( VariantOption { name: stringify!($variantname).to_owned(), default_value: || { Struct(vec![ $( { process_structure!($name,$type,($default),self) }, )* ].into_iter().filter_map(|e|e).collect()) } } ),* ]; match self { $( $enumname::$variantname { $( ref $name ),* } => { Variant { current: stringify!($variantname).to_owned(), options: optionvec, value: Box::new( Struct(vec![ $( { process_structure!($name,$type,*$name,self) }, )* ].into_iter().filter_map(|e|e).collect()) ) } } ),* } } fn destructure(data: &$crate::structure::ChumStructVariant) -> Result<Self, $crate::error::DestructureError> { // unimplemented!() let inner_name = data.get_variant_name().unwrap(); let inner_data = data.get_variant_data().unwrap(); match inner_name { $( stringify!($variantname) => { Ok( $enumname::$variantname { $( $name: process_destructure!($name,inner_data,$type) ),* } ) }, )* o => { Err( $crate::error::DestructureError::InvalidVariant { expected: vec![ $( stringify!($variantname).to_owned() ),* ], value: o.to_owned() } ) } } } } impl $crate::binary::ChumBinary for $enumname { fn read_from(file: &mut dyn ::std::io::Read, fmt: $crate::format::TotemFormat) -> $crate::error::StructUnpackResult<Self> { let invariant = chum_struct_binary_read!($enumtype,file,fmt,stringify!($enumname),"",())?; Ok(match invariant { $( $variantpattern => { pub struct Inner { $( $name: Option<chum_struct_get_type!($type)> ),* } #[allow(unused_mut,unused_variables)] let mut value = Inner { $( $name: None ),* }; $( value.$name = Some( chum_struct_binary_read!($type, file, fmt, stringify!($structname), stringify!($name), &value)? ); )* $enumname::$variantname { $( $name: value.$name.unwrap() ),* } } ),* _ => panic!() }) } fn write_to(&self, writer: &mut dyn ::std::io::Write, fmt: $crate::format::TotemFormat) -> ::std::io::Result<()> { match self { $( $enumname::$variantname { $( $name ),* } => { chum_struct_binary_write!($enumtype,writer,fmt,&($variantpattern),self)?; $( chum_struct_binary_write!($type,writer,fmt,$name,self)?; )* } ),* } Ok(()) } } }; } /* chum_enum! { #[derive(Copy, Clone, Debug)] pub enum MyEnum { Zero, One, Two } } chum_struct_generate_readwrite! { pub struct Foobar { pub v_enum: [enum [u8] MyEnum] } } chum_struct_generate_readwrite! { pub struct Example { pub v_u8: [u8], pub v_junk: [ignore [u8] 0], pub v_i8: [i8], pub v_custom: [int_custom [i32] 0, 100], pub b: [enum [u8] MyEnum], pub c: [flags [u8] {A, B, C}], pub v_reference1: [reference], pub v_reference2: [reference MATERIAL], pub v_struct: [struct Foobar], pub v_array_struct: [dynamic array [u32] [struct Foobar] Foobar{v_enum: MyEnum::Zero}], pub v_array_u8: [fixed array [u8] 100], pub v_vec_u8: [dynamic array [u32] [u8] 100u8], pub v_array_custom: [fixed array [int_custom [i32] 0, 100] 100], } } chum_struct_generate_readwrite! { pub struct Example2 { pub x: [option [u8] 0], pub y: [option [u8] 0], pub z: [ option [ dynamic array [u32] [struct Foobar] Foobar { v_enum: MyEnum::Zero } ] Vec::new() ], pub t: [option [struct Foobar] Foobar{v_enum: MyEnum::Zero}], pub w: [option [fixed array [int_custom [i32] 0, 100] 100] [0i32; 100]], pub q: [ option [ option [ option [ fixed array [u8] 100 ] [0u8; 100] ] None ] None ] } } */
true
d91ad2c77008847391443fdbdb90193a298063f9
Rust
FroVolod/cli_dialoguer_strum_2
/src/main.rs
UTF-8
1,550
2.53125
3
[]
no_license
use structopt::StructOpt; pub(crate) mod common; pub(crate) mod utils_subcommand; mod consts; mod command; use command::{ CliCommand, ArgsCommand, }; #[derive(Debug)] struct Args { subcommand: ArgsCommand, } #[derive(Debug, Default, StructOpt)] struct CliArgs { #[structopt(subcommand)] subcommand: Option<CliCommand>, } impl From<CliArgs> for Args { fn from(item: CliArgs) -> Self { let subcommand = match item.subcommand { Some(cli_subcommand) => ArgsCommand::from(cli_subcommand), None => ArgsCommand::choose_command(), }; Self { subcommand, } } } impl Args { async fn process(self) -> String { match self.subcommand { ArgsCommand::ConstructTransactionCommand(mode) => { let unsigned_transaction = near_primitives::transaction::Transaction { signer_id: "".to_string(), public_key: near_crypto::PublicKey::empty(near_crypto::KeyType::ED25519), nonce: 0, receiver_id: "".to_string(), block_hash: Default::default(), actions: vec![], }; mode.process(unsigned_transaction).await; }, _ => unreachable!("Error") }; "Ok".to_string() } } fn main() { let cli = CliArgs::from_args(); let args = Args::from(cli); actix::System::builder() .build() .block_on(async move { args.process().await }); }
true
b98750f41f8a9a20a8a2345ddae3a33b2612fc03
Rust
HerringtonDarkholme/leetcode
/src/1372_longest_zig_zag.rs
UTF-8
977
3.234375
3
[]
no_license
// Definition for a binary tree node. // #[derive(Debug, PartialEq, Eq)] // pub struct TreeNode { // pub val: i32, // pub left: Option<Rc<RefCell<TreeNode>>>, // pub right: Option<Rc<RefCell<TreeNode>>>, // } // // impl TreeNode { // #[inline] // pub fn new(val: i32) -> Self { // TreeNode { // val, // left: None, // right: None // } // } // } use std::rc::Rc; use std::cell::RefCell; impl Solution { pub fn longest_zig_zag(root: Option<Rc<RefCell<TreeNode>>>) -> i32 { zig_zag(root, true).1 - 1 } } fn zig_zag(root: Option<Rc<RefCell<TreeNode>>>, left: bool) -> (i32, i32) { if root.is_none() { return (0, 1) } let mut root = root.unwrap(); let mut rt = root.borrow_mut(); let (lr, lmax) = zig_zag(rt.left.take(), true); let (rl, rmax) = zig_zag(rt.right.take(), false); let (l, r) = (1 + lr, 1 + rl); let max = l.max(r).max(lmax).max(rmax); (if left { r } else { l }, max) }
true
10f4c1df8234ec147a09f1bd0042a37405fed780
Rust
nikgaevoy/nimber
/src/derive.rs
UTF-8
1,960
3.1875
3
[]
no_license
use super::Nimber; use std::cmp::Ordering; use std::fmt::{Debug, Formatter}; use std::hash::{Hash, Hasher}; impl<T: Clone> Clone for Nimber<T> { #[inline] fn clone(&self) -> Self { Self { x: self.x.clone() } } #[inline] fn clone_from(&mut self, source: &Self) { self.x.clone_from(&source.x) } } impl<T: Copy> Copy for Nimber<T> {} impl<T: Debug> Debug for Nimber<T> { #[inline] fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { f.debug_struct("Nimber").field("x", &self.x).finish() } } impl<T: Default> Default for Nimber<T> { #[inline] fn default() -> Self { Nimber { x: T::default() } } } impl<T> From<T> for Nimber<T> { #[inline] fn from(x: T) -> Self { Self { x } } } impl<T> Nimber<T> { /// Converts to the inner type #[inline] pub fn unwrap(self) -> T { self.x } } impl<T: Hash> Hash for Nimber<T> { #[inline] fn hash<H: Hasher>(&self, state: &mut H) { self.x.hash(state) } } impl<T: PartialEq> PartialEq for Nimber<T> { #[inline] fn eq(&self, other: &Self) -> bool { self.x == other.x } #[inline] fn ne(&self, other: &Self) -> bool { self.x != other.x } } impl<T: Eq> Eq for Nimber<T> {} impl<T: PartialOrd> PartialOrd for Nimber<T> { #[inline] fn partial_cmp(&self, other: &Self) -> Option<Ordering> { self.x.partial_cmp(&other.x) } #[inline] fn lt(&self, other: &Self) -> bool { self.x.lt(&other.x) } #[inline] fn le(&self, other: &Self) -> bool { self.x.le(&other.x) } #[inline] fn gt(&self, other: &Self) -> bool { self.x.gt(&other.x) } #[inline] fn ge(&self, other: &Self) -> bool { self.x.ge(&other.x) } } impl<T: Ord> Ord for Nimber<T> { #[inline] fn cmp(&self, other: &Self) -> Ordering { self.x.cmp(&other.x) } }
true
d7c98f60cc77ed69e5467aa6901d68c2d001083c
Rust
rhyadav/byte_buffer
/byte_buffer/src/lock.rs
UTF-8
741
2.90625
3
[ "MIT" ]
permissive
use std::io::ErrorKind; use std::sync::atomic::{self, AtomicBool, Ordering}; const LOCK_TIMEOUT: usize = 64; static LOCK: AtomicBool = AtomicBool::new(false); pub(crate) fn lock() -> Result<(), ErrorKind> { let mut count = 1; loop { if let Ok(true) = LOCK.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed) { break; } if count > LOCK_TIMEOUT { return Err(ErrorKind::TimedOut); } cpu_relax(count); count += 1; } Ok(()) } #[inline] pub(crate) fn unlock() { LOCK.store(false, Ordering::SeqCst); } #[inline(always)] pub(crate) fn cpu_relax(count: usize) { for _ in 0..(1 << count) { atomic::spin_loop_hint() } }
true
b49a0dbaf1623e8e89ffe0ba2594d4095b6c9828
Rust
g-cl/sit
/sit/tests/command_reduce.rs
UTF-8
5,266
2.828125
3
[ "MIT", "Apache-2.0" ]
permissive
extern crate cli_test_dir; extern crate sit_core; extern crate serde_json; use sit_core::{Repository, Item}; use cli_test_dir::*; include!("includes/config.rs"); /// Should fail if there is no item to reduce #[test] fn no_item() { let dir = TestDir::new("sit", "no_item"); dir.cmd() .arg("init") .expect_success(); dir.cmd().args(&["reduce", "some-item"]).expect_failure(); } /// Should return the entire reduced item #[test] fn item() { let dir = TestDir::new("sit", "item"); dir.cmd() .arg("init") .expect_success(); dir.create_file(".sit/reducers/test.js",r#" module.exports = function(state, record) { return Object.assign(state, {value: "hello"}); } "#); let id = String::from_utf8(dir.cmd().arg("item").expect_success().stdout).unwrap(); // create a record Repository::open(dir.path(".sit")).unwrap().item(id.trim()).unwrap().new_record(vec![("test", &b""[..])].into_iter(), true).unwrap(); let output = String::from_utf8(dir.cmd().args(&["reduce", id.trim()]).expect_success().stdout).unwrap(); use serde_json::Map; let mut expect = Map::new(); expect.insert("id".into(), serde_json::Value::String(id.trim().into())); expect.insert("value".into(), serde_json::Value::String("hello".into())); assert_eq!(serde_json::from_str::<serde_json::Value>(output.trim()).unwrap(), serde_json::Value::Object(expect)); } /// Should apply query #[test] fn item_query() { let dir = TestDir::new("sit", "query"); dir.cmd() .arg("init") .expect_success(); dir.create_file(".sit/reducers/test.js",r#" module.exports = function(state, record) { return Object.assign(state, {value: "hello"}); } "#); let id = String::from_utf8(dir.cmd().arg("item").expect_success().stdout).unwrap(); // create a record Repository::open(dir.path(".sit")).unwrap().item(id.trim()).unwrap().new_record(vec![("test", &b""[..])].into_iter(), true).unwrap(); let output = String::from_utf8(dir.cmd().args(&["reduce", id.trim(), "-q", "join(' ', ['item', id, value])"]).expect_success().stdout).unwrap(); assert_eq!(output.trim(), format!("item {} hello", id.trim())); } /// Should apply named query #[test] fn item_named_query() { let dir = TestDir::new("sit", "named_query"); dir.cmd() .arg("init") .expect_success(); dir.create_file(".sit/reducers/test.js",r#" module.exports = function(state, record) { return Object.assign(state, {value: "hello"}); } "#); let id = String::from_utf8(dir.cmd().arg("item").expect_success().stdout).unwrap(); // create a record Repository::open(dir.path(".sit")).unwrap().item(id.trim()).unwrap().new_record(vec![("test", &b""[..])].into_iter(), true).unwrap(); dir.create_file(".sit/.items/queries/q1", "join(' ', ['item', id, value])"); let output = String::from_utf8(dir.cmd().args(&["reduce", id.trim(), "-Q", "q1"]).expect_success().stdout).unwrap(); assert_eq!(output.trim(), format!("item {} hello", id.trim())); } /// Should apply named user query #[test] fn item_named_user_query() { let dir = TestDir::new("sit", "named_user_query"); dir.cmd() .arg("init") .expect_success(); dir.create_file(".sit/reducers/test.js",r#" module.exports = function(state, record) { return Object.assign(state, {value: "hello"}); } "#); let id = String::from_utf8(dir.cmd().arg("item").expect_success().stdout).unwrap(); // create a record Repository::open(dir.path(".sit")).unwrap().item(id.trim()).unwrap().new_record(vec![("test", &b""[..])].into_iter(), true).unwrap(); let cfg = r#"{"items": {"queries": {"q1": "join(' ', ['item', id, value])"}}}"#; user_config(&dir, cfg); let output = String::from_utf8(dir.cmd() .env("HOME", dir.path(".").to_str().unwrap()) .env("USERPROFILE", dir.path(".").to_str().unwrap()) .args(&["reduce", id.trim(), "-Q", "q1"]).expect_success().stdout).unwrap(); assert_eq!(output.trim(), format!("item {} hello", id.trim())); } /// Should prefer repo named query over user user named query #[test] fn item_repo_over_named_user_query() { let dir = TestDir::new("sit", "repo_over_named_user_query"); dir.cmd() .arg("init") .expect_success(); dir.create_file(".sit/reducers/test.js",r#" module.exports = function(state, record) { return Object.assign(state, {value: "hello"}); } "#); let id = String::from_utf8(dir.cmd().arg("item").expect_success().stdout).unwrap(); // create a record Repository::open(dir.path(".sit")).unwrap().item(id.trim()).unwrap().new_record(vec![("test", &b""[..])].into_iter(), true).unwrap(); let cfg = r#"{"items": {"queries": {"q1": "join(' ', ['item', id])"}}}"#; user_config(&dir, cfg); dir.create_file(".sit/.items/queries/q1", "join(' ', ['item', id, value])"); let output = String::from_utf8(dir.cmd() .env("HOME", dir.path(".").to_str().unwrap()) .env("USERPROFILE", dir.path(".").to_str().unwrap()) .args(&["reduce", id.trim(), "-Q", "q1"]).expect_success().stdout).unwrap(); assert_eq!(output.trim(), format!("item {} hello", id.trim())); }
true
ec91255412f66b59dc4d774c3430389da4c70920
Rust
trentearl/news
/src/main.rs
UTF-8
3,045
2.796875
3
[]
no_license
extern crate ncurses; extern crate redis; extern crate reqwest; extern crate term_size; extern crate termion; mod net; mod news; use rss::Channel; use std::io::BufReader; use std::io::{stdin, stdout, Write}; use crate::net::get_and_cache_url; use crate::news::print_headlines; use crate::news::print_article; use termion::raw::IntoRawMode; use termion::input::TermRead; const NYT_RSS: &str = "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml"; fn main() { let (x, y) = term_size::dimensions().unwrap(); let mut current: Option<String> = None; loop { match run((x, y - 2), current) { Some(n) => { current = Some(n) }, None => current = None } } } fn run (size: (usize, usize), current: Option<String>) -> Option<String> { match current { Some(n) => { article_show(n, size); None }, None => { match article_select(size) { Some(s) => Some(s), None => None } } } } fn article_show(url: String, dimensions: (usize, usize)) -> Option<String> { let data = get_and_cache_url(&url, &(60 * 60 * 60)); let mut c = 0; let mut _stdout = stdout().into_raw_mode().unwrap(); let mut stdin = stdin().keys(); loop { print_article(&data, &dimensions, c); let input = stdin.next(); match input.unwrap().unwrap() { termion::event::Key::Char('j') => c += 1, termion::event::Key::Char('k') => c -= 1, termion::event::Key::Char('q') => { std::process::exit(0); }, _ => { break; } } } return None; } fn article_select(dimensions: (usize, usize)) -> Option<String> { let t = get_rss(NYT_RSS); let mut c = 0; let mut stdout = stdout().into_raw_mode().unwrap(); let mut stdin = stdin().keys(); loop { print!(" {}\n\r", termion::clear::All); print_headlines(&t, &dimensions, c); stdout.flush().unwrap(); let input = stdin.next(); match input.unwrap().unwrap() { termion::event::Key::Char('g') => { c = 0 }, termion::event::Key::Char('j') => { c += 1 }, termion::event::Key::Char('k') => { if c != 0 { c -= 1 } }, termion::event::Key::Char('q') => { std::process::exit(0); }, termion::event::Key::Char('o') => { let item = t.items().get(c).unwrap(); let link = Some(String::from(item.link().unwrap())); return link; }, _ => { break; } } } return None; } fn get_rss(url: &str) -> Channel { let data = get_and_cache_url(url, &(60 * 60)); let channel = Channel::read_from( BufReader::new(data.as_bytes()) ).unwrap(); channel }
true
8a318e67829f608c17dc13f566774351d50e0cb0
Rust
HeroicKatora/rust-aliasable
/src/vec.rs
UTF-8
5,163
3.421875
3
[ "MIT" ]
permissive
//! Aliasable `Vec`. use core::ops::{Deref, DerefMut}; use core::pin::Pin; use core::ptr::NonNull; use core::{fmt, mem, slice}; pub use alloc::vec::Vec as UniqueVec; /// Basic aliasable (non `core::ptr::Unique`) alternative to /// [`alloc::vec::Vec`]. pub struct AliasableVec<T> { ptr: NonNull<T>, len: usize, cap: usize, } impl<T> AliasableVec<T> { /// Construct an `AliasableVec` from a [`UniqueVec`]. pub fn from_unique(mut vec: UniqueVec<T>) -> Self { let ptr = vec.as_mut_ptr(); let len = vec.len(); let cap = vec.capacity(); mem::forget(vec); let ptr = unsafe { NonNull::new_unchecked(ptr) }; Self { ptr, len, cap } } /// Consumes the [`AliasableVec`] and converts it back into a /// non-aliasable [`UniqueVec`]. #[inline] pub fn into_unique(mut vec: AliasableVec<T>) -> UniqueVec<T> { // SAFETY: As we are consuming the `Vec` structure we can safely assume // any aliasing has ended and convert the aliasable `Vec` back to into // an unaliasable `UniqueVec`. let unique = unsafe { vec.reclaim_as_unique_vec() }; // Forget the aliasable `Vec` so the allocation behind the `UniqueVec` // is not deallocated. mem::forget(vec); // Return the `UniqueVec`. unique } /// Convert a pinned [`AliasableVec`] to a `core::ptr::Unique` backed pinned /// [`UniqueVec`]. pub fn into_unique_pin(pin: Pin<AliasableVec<T>>) -> Pin<UniqueVec<T>> { // SAFETY: The pointer is not changed, just the container. unsafe { let aliasable = Pin::into_inner_unchecked(pin); Pin::new_unchecked(AliasableVec::into_unique(aliasable)) } } /// Convert a pinned `core::ptr::Unique` backed [`UniqueVec`] to a /// pinned [`AliasableVec`]. pub fn from_unique_pin(pin: Pin<UniqueVec<T>>) -> Pin<AliasableVec<T>> { unsafe { let unique = Pin::into_inner_unchecked(pin); Pin::new_unchecked(AliasableVec::from(unique)) } } #[inline] unsafe fn reclaim_as_unique_vec(&mut self) -> UniqueVec<T> { UniqueVec::from_raw_parts(self.ptr.as_mut(), self.len, self.cap) } } impl<T> From<UniqueVec<T>> for AliasableVec<T> { #[inline] fn from(vec: UniqueVec<T>) -> Self { Self::from_unique(vec) } } impl<T> From<AliasableVec<T>> for UniqueVec<T> { #[inline] fn from(vec: AliasableVec<T>) -> Self { AliasableVec::into_unique(vec) } } impl<T> Drop for AliasableVec<T> { fn drop(&mut self) { // As the `Vec` structure is being dropped we can safely assume any // aliasing has ended and convert the aliasable `Vec` back to into an // unaliasable `UniqueVec` to handle the deallocation. let _ = unsafe { self.reclaim_as_unique_vec() }; } } impl<T> Deref for AliasableVec<T> { type Target = [T]; #[inline] fn deref(&self) -> &[T] { // SAFETY: We own the data, so we can return a reference to it. unsafe { slice::from_raw_parts(self.ptr.as_ptr(), self.len) } } } impl<T> DerefMut for AliasableVec<T> { #[inline] fn deref_mut(&mut self) -> &mut [T] { // SAFETY: We own the data, so we can return a reference to it. unsafe { slice::from_raw_parts_mut(self.ptr.as_ptr(), self.len) } } } impl<T> AsRef<[T]> for AliasableVec<T> { fn as_ref(&self) -> &[T] { &*self } } impl<T> AsMut<[T]> for AliasableVec<T> { fn as_mut(&mut self) -> &mut [T] { &mut *self } } impl<T> fmt::Debug for AliasableVec<T> where T: fmt::Debug, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Debug::fmt(self.as_ref(), f) } } unsafe impl<T> Send for AliasableVec<T> where T: Send {} unsafe impl<T> Sync for AliasableVec<T> where T: Sync {} #[cfg(feature = "traits")] unsafe impl<T> crate::StableDeref for AliasableVec<T> {} #[cfg(feature = "traits")] unsafe impl<T> crate::AliasableDeref for AliasableVec<T> {} #[cfg(test)] mod tests { use super::AliasableVec; use alloc::{format, vec}; use core::pin::Pin; #[test] fn test_new() { let aliasable = AliasableVec::from_unique(vec![10]); assert_eq!(&*aliasable, &[10]); let unique = AliasableVec::into_unique(aliasable); assert_eq!(&*unique, &[10]); } #[test] fn test_new_pin() { let aliasable = AliasableVec::from_unique_pin(Pin::new(vec![10])); assert_eq!(&*aliasable, &[10]); let unique = AliasableVec::into_unique_pin(aliasable); assert_eq!(&*unique, &[10]); } #[test] fn test_refs() { let mut aliasable = AliasableVec::from_unique(vec![10]); let ptr: *const [u8] = &*aliasable; let as_mut_ptr: *const [u8] = aliasable.as_mut(); let as_ref_ptr: *const [u8] = aliasable.as_ref(); assert_eq!(ptr, as_mut_ptr); assert_eq!(ptr, as_ref_ptr); } #[test] fn test_debug() { let aliasable = AliasableVec::from_unique(vec![10]); assert_eq!(format!("{:?}", aliasable), "[10]"); } }
true
0296e65dc395c5dbf1f6c743fd7a62a369dbc0e8
Rust
toshuno/solved_problems
/atcoder/ABC/016C.rs
UTF-8
2,265
3.03125
3
[]
no_license
fn main() { let mut sc = Scanner::new(); let n: usize = sc.read(); let m: usize = sc.read(); let mut connect: Vec<Vec<usize>> = vec![vec![]; n]; for _ in 0..m { let a: usize = sc.read(); let b: usize = sc.read(); connect[a - 1].push(b - 1); connect[b - 1].push(a - 1); } for i in 0..n { let mut count = 0; let mut valid: Vec<bool> = vec![true; n]; valid[i] = false; for &j in connect[i].iter() { valid[j] = false; } for &j in connect[i].iter() { for &k in connect[j].iter() { if valid[k] { count += 1; valid[k] = false } } } println!("{}", count); } } struct Scanner { ptr: usize, length: usize, buf: Vec<u8>, small_cache: Vec<u8>, } impl Scanner { fn new() -> Scanner { Scanner { ptr: 0, length: 0, buf: vec![0; 1024], small_cache: vec![0; 1024] } } fn load(&mut self) { use std::io::Read; let mut s = std::io::stdin(); self.length = s.read(&mut self.buf).unwrap(); } fn byte(&mut self) -> u8 { if self.ptr >= self.length { self.ptr = 0; self.load(); if self.length == 0 { self.buf[0] = b'\n'; self.length = 1; } } self.ptr += 1; return self.buf[self.ptr - 1]; } fn is_space(b: u8) -> bool { b == b'\n' || b == b'\r' || b == b'\t' || b == b' ' } fn read<T>(&mut self) -> T where T: std::str::FromStr, T::Err: std::fmt::Debug, { let mut b = self.byte(); while Scanner::is_space(b) { b = self.byte(); } for pos in 0..self.small_cache.len() { self.small_cache[pos] = b; b = self.byte(); if Scanner::is_space(b) { return String::from_utf8_lossy(&self.small_cache[0..(pos + 1)]).parse().unwrap(); } } let mut v = self.small_cache.clone(); while !Scanner::is_space(b) { v.push(b); b = self.byte(); } return String::from_utf8_lossy(&v).parse().unwrap(); } }
true
5ccc9c8963cfcfc3e0a95214e3e5ac8b18a01938
Rust
mvolkmann/rust-parallel-options
/src/main.rs
UTF-8
1,925
2.78125
3
[]
no_license
use std::error::Error; /* mod std_demo; use std_demo::{concurrent, parallel_tasks, parallel_threads, serial}; fn main() -> Result<(), Box<dyn Error>> { let (sum1, sum2) = serial()?; println!("serial: sum1 = {:?}, sum2 = {:?}", sum1, sum2); let (sum1, sum2) = concurrent()?; println!("concurrent: sum1 = {:?}, sum2 = {:?}", sum1, sum2); let (sum1, sum2) = parallel_threads()?; println!("threads: sum1 = {:?}, sum2 = {:?}", sum1, sum2); let (sum1, sum2) = parallel_tasks()?; println!("tasks: sum1 = {:?}, sum2 = {:?}", sum1, sum2); Ok(()) } */ /* mod async_std_demo; use async_std_demo::{concurrent, parallel_threads, parallel_tasks, serial}; #[async_std::main] async fn main() -> Result<(), Box<dyn Error>> { let (sum1, sum2) = serial()?; println!("serial: sum1 = {:?}, sum2 = {:?}", sum1, sum2); //let (sum1, sum2) = concurrent()?; let (sum1, sum2) = concurrent().await?; println!("concurrent: sum1 = {:?}, sum2 = {:?}", sum1, sum2); //let (sum1, sum2) = parallel_threads()?; let (sum1, sum2) = parallel_threads().await?; println!("threads: sum1 = {:?}, sum2 = {:?}", sum1, sum2); //let (sum1, sum2) = parallel_tasks()?; let (sum1, sum2) = parallel_tasks().await?; println!("tasks: sum1 = {:?}, sum2 = {:?}", sum1, sum2); Ok(()) } */ mod tokio_demo; use tokio_demo::{concurrent, parallel_tasks, parallel_threads, serial}; #[tokio::main] async fn main() -> Result<(), Box<dyn Error>> { let (sum1, sum2) = serial()?; println!("serial: sum1 = {:?}, sum2 = {:?}", sum1, sum2); let (sum1, sum2) = concurrent().await?; println!("concurrent: sum1 = {:?}, sum2 = {:?}", sum1, sum2); let (sum1, sum2) = parallel_threads().await?; println!("threads: sum1 = {:?}, sum2 = {:?}", sum1, sum2); let (sum1, sum2) = parallel_tasks().await?; println!("tasks: sum1 = {:?}, sum2 = {:?}", sum1, sum2); Ok(()) }
true
44b8bd650ebb8214bb4034f702c8018600031ba5
Rust
pkage/focusd
/src/main.rs
UTF-8
4,669
2.921875
3
[]
no_license
use colored::*; use clap::Parser; mod hosts; mod time; mod config; mod client; mod messages; mod common; mod server; #[derive(Parser)] #[clap(version="0.0.2", author="Patrick Kage ([email protected])", about="Automatically manage /etc/hosts to lock out distracting websites for a finite period.")] struct Opts { #[clap(short='c', long="config", default_value="~/.config/focusd/focus.toml", about="The config file to use.")] config: String, #[clap(subcommand)] subcmd: SubCommand } #[derive(Parser)] enum SubCommand { #[clap(name="daemon", about="Run the focusd daemon")] Daemon, #[clap(name="cleanup", about="Clean up the sockets")] Cleanup, #[clap(name="debug", about="debug")] Debug, #[clap(name="ping", about="Check if the daemon is running")] Ping, #[clap(name="remaining", about="Check if the daemon is running")] Remaining(ClientCommandRemaining), #[clap(name="start", about="Start blocking the files.")] Start(ClientCommandStart), #[clap(name="halt", about="Halt the server")] Halt, } #[derive(Parser)] struct ClientCommandStart { #[clap(name="length", about="Length of time to run the block (e.g. 1h25m30s)")] length: String, } #[derive(Parser)] struct ClientCommandRemaining { #[clap(long="raw", short='r', about="Leave the time in seconds")] raw: bool, #[clap(long="nodistract", short='n', about="Omit the seconds from the count")] no_distract: bool, } fn get_client(config: &config::FocusConfig) -> client::FocusClient { let client = match client::FocusClient::new(&config) { Ok(c) => c, Err(e) => { match e { // client::FocusClientError::TimedOut => println!("{}", "server timed out!"), // client::FocusClientError::ServerError => println!("{}", "server errored out!".red()), client::FocusClientError::NoConnection => println!("{}", "not running".red()), } std::process::exit(0); } }; return client; } fn main() { let opts: Opts = Opts::parse(); // validate configuration let config = match config::read_config(&opts.config) { Ok(cfg) => cfg, Err(err) => { match err { config::FocusConfigError::ConfigMissing => println!("{}", "config file missing!".red()), config::FocusConfigError::ConfigInvalid => println!("{}", "config file invalid!") } return; } }; match opts.subcmd { SubCommand::Daemon => { server::FocusServer::cleanup(&config); let mut daemon = match server::FocusServer::new(&config) { Ok(d) => d, Err(e) => { match e { server::FocusServerError::AlreadyRunning => println!("{}", "server already running!".red()), // server::FocusServerError::NoPermissions => println!("{}", "server should be run as root".red()) } return; } }; daemon.listen(); server::FocusServer::cleanup(&config); }, SubCommand::Ping => get_client(&config).ping(), SubCommand::Halt => get_client(&config).halt(), SubCommand::Remaining(r) => { get_client(&config).remaining(r.raw, r.no_distract); }, SubCommand::Start(s) => { get_client(&config).start(s.length); }, SubCommand::Cleanup => { common::file_remove_if_exists(&format!("{}.in", config.socket_file)); common::file_remove_if_exists(&format!("{}.out", config.socket_file)); }, SubCommand::Debug => { // let out = common::hosts_remove(&"hosts".to_string()).unwrap(); // println!("{}", out); // println!("config: {:?}", config.blocked); // time::parse_time_string(&"1h30m25s".to_string()).unwrap(); // time::parse_time_string(&"1h30m".to_string()).unwrap(); // time::parse_time_string(&"30m".to_string()).unwrap(); // time::parse_time_string(&"30s".to_string()).unwrap(); // let out = hosts::hosts_add(&"hosts".to_string(), &config.blocked).unwrap(); // println!("{}", out); time::parse_time_string(&"1h30m25s".to_string()).unwrap(); time::create_time_string(5425); time::parse_time_string(&"30m".to_string()).unwrap(); time::create_time_string(1800); time::parse_time_string(&"30s".to_string()).unwrap(); time::create_time_string(30); } } }
true
b49140afbd5bd3bb803eae3fad6eeab4a3c87606
Rust
miker1423/signalr-rs
/serializer_test/src/main.rs
UTF-8
5,587
2.921875
3
[]
no_license
use serde::{Serialize, Deserialize}; use serde_json::Value; #[derive(Debug)] enum MessageVariants { Invocation(InvocationFields), //type = 1 StreamItem(StreamItemFields), // type = 2 Completion(CompletionFields),//type = 3 StreamInvocation(StreamInvocationFields), //type = 4 CancelInvokation(CancelInvokationFields), //type = 5 Ping, //type = 6 Close(CloseFields), } #[derive(Serialize, Deserialize, Debug)] struct InvocationFields { #[serde(skip_serializing_if = "Option::is_none")] invocation_id: Option<String>, target: String, arguments: serde_json::Value } #[derive(Serialize, Deserialize, Debug)] struct StreamItemFields { #[serde(skip_serializing_if = "Option::is_none")] invocation_id: Option<String>, item: serde_json::Value } #[derive(Serialize, Deserialize, Debug)] struct CompletionFields { #[serde(skip_serializing_if = "Option::is_none")] invocation_id: Option<String>, #[serde(skip_serializing_if = "Option::is_none")] error: Option<String>, result: serde_json::Value } #[derive(Serialize, Deserialize, Debug)] struct StreamInvocationFields { #[serde(skip_serializing_if = "Option::is_none")] invocation_id: Option<String>, target: String, arguments: serde_json::Value } #[derive(Serialize, Deserialize, Debug)] struct CancelInvokationFields { #[serde(skip_serializing_if = "Option::is_none")] invocation_id: Option<String> } #[derive(Serialize, Deserialize, Debug)] struct CloseFields { #[serde(skip_serializing_if = "Option::is_none")] error: Option<String> } // Taken from https://stackoverflow.com/questions/65575385/deserialization-of-json-with-serde-by-a-numerical-value-as-type-identifier/65576570#65576570 impl Serialize for MessageVariants { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer, { #[derive(Serialize)] #[serde(untagged)] enum MessageVariants_<'a> { Invocation(&'a InvocationFields), //type = 1 StreamItem(&'a StreamItemFields), // type = 2 Completion(&'a CompletionFields),//type = 3 StreamInvocation(&'a StreamInvocationFields), //type = 4 CancelInvokation(&'a CancelInvokationFields), //type = 5 #[allow(dead_code)] Ping, //type = 6, not used to serialize but here for parity with outer type. Close(&'a CloseFields), } #[derive(Serialize)] struct TypedMessage<'a> { #[serde(rename = "type")] t: u64, #[serde(flatten, skip_serializing_if = "Option::is_none")] msg: Option<MessageVariants_<'a>>, } let msg = match self { MessageVariants::Invocation(fields) => TypedMessage { t: 1, msg: Some(MessageVariants_::Invocation(fields)) }, MessageVariants::StreamItem(fields) => TypedMessage { t: 2, msg: Some(MessageVariants_::StreamItem(fields)) }, MessageVariants::Completion(fields) => TypedMessage { t: 3, msg: Some(MessageVariants_::Completion(fields)) }, MessageVariants::StreamInvocation(fields) => TypedMessage { t: 4, msg: Some(MessageVariants_::StreamInvocation(fields)) }, MessageVariants::CancelInvokation(fields) => TypedMessage { t: 5, msg: Some(MessageVariants_::CancelInvokation(fields)) }, MessageVariants::Ping => TypedMessage { t: 6, msg: None }, MessageVariants::Close(fields) => TypedMessage { t: 7, msg: Some(MessageVariants_::Close(fields)) }, }; msg.serialize(serializer) } } impl<'de> serde::Deserialize<'de> for MessageVariants { fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: serde::Deserializer<'de> { let value = Value::deserialize(deserializer)?; Ok(match value.get("type").and_then(Value::as_u64).unwrap() { 1 => MessageVariants::Invocation(InvocationFields::deserialize(value).unwrap()), 2 => MessageVariants::StreamItem(StreamItemFields::deserialize(value).unwrap()), 3 => MessageVariants::Completion(CompletionFields::deserialize(value).unwrap()), 4 => MessageVariants::StreamInvocation(StreamInvocationFields::deserialize(value).unwrap()), 5 => MessageVariants::CancelInvokation(CancelInvokationFields::deserialize(value).unwrap()), 6 => MessageVariants::Ping, 7 => MessageVariants::Close(CloseFields::deserialize(value).unwrap()), type_ => panic!("Unsupported type {:?}", type_), }) } } fn main() { let fields = InvocationFields { invocation_id: Some("1".to_owned()), target: "SendMessage".to_owned(), arguments: Value::Null }; let invoke = MessageVariants::Invocation(fields); let json = serde_json::json!(invoke).to_string(); println!("JSON: {}", json); let json = serde_json::json!(MessageVariants::Ping).to_string(); println!("JSON: {}", json); let test_json = "{\"type\":1,\"target\":\"ReceiveMessage\",\"arguments\":[\"Hello\"]}"; let obj = serde_json::from_str::<MessageVariants>(test_json); if let Ok(message) = obj { println!("OBJ {:?}", message); } else { println!("Error! {}", obj.unwrap_err()); } let test_json = "{\"type\": 6}"; let obj = serde_json::from_str::<MessageVariants>(test_json); if let Ok(message) = obj { println!("OBJ {:?}", message); } else { println!("Error! {}", obj.unwrap_err()); } }
true
6279a66b99c2860d9dd96535856bbdc274f6e8f5
Rust
INDAPlus21/dpeilitz-task-2
/avstand_till_kanten/src/main.rs
UTF-8
1,656
3.109375
3
[]
no_license
/*** * Template to a Kattis solution. * See: https://open.kattis.com/help/rust * Author: Viola Söderlund <[email protected]> */ // HEAVILY INSPIRED BY FELIX MURNION'S SOLUTION use std::io; use std::io::prelude::*; use std::char; // Kattis calls main function to run your solution. fn main() { // get standard input stream let input = io::stdin(); // get input lines as strings // see: https://doc.rust-lang.org/std/io/trait.BufRead.html let numbers: Vec<usize> = input .lock() .lines() .next() .unwrap() .ok() .unwrap() .split_whitespace() .map(|_number| _number.parse::<usize>().ok().unwrap()) .collect(); let rows: usize = numbers[0]; let columns: usize = numbers[1]; let mut output = String::with_capacity((rows) * (columns + 1)); for x in 1..=rows { for y in 1..=columns { //skriv avstånd upp ned sida och sida och genom let ... let dist_top = x; let dist_left = y; let dist_bot = (rows+1) - dist_top; //add one to measure the distance OUTSIDE of the box let dist_right = (columns+1) - dist_left; //find out the shortest distance let min = dist_left.min(dist_right).min(dist_top).min(dist_bot); if min < 10 { //convert to char by getting the asci value, converting to u8 then to char output.push(char::from_digit(min as u32, 10).unwrap()); } else{ output.push('.'); } } output.push_str("\n") } println!("{}", output); }
true
dbadcaf2efcb449eff66fa82ff12bed7a5ef9a8a
Rust
johnae/persway
/src/node_ext.rs
UTF-8
5,830
3.03125
3
[ "MIT" ]
permissive
use anyhow::{anyhow, Result}; use async_trait::async_trait; use swayipc_async::{Connection, Node, NodeLayout, NodeType, Workspace}; pub enum RefinedNodeType { Root, Output, Workspace, Container, // doesn't directly contain an application FloatingContainer, // doesn't directly contain an application FloatingWindow, // directly contains an application Window, // directly contains an application } #[derive(Clone)] pub struct LinearNodeIterator<'a> { stack: Vec<&'a Node>, } impl<'a> LinearNodeIterator<'a> { fn new(root: &'a Node) -> LinearNodeIterator<'a> { let mut stack = Vec::with_capacity(100); stack.push(root); LinearNodeIterator { stack } } } impl<'a> Iterator for LinearNodeIterator<'a> { type Item = &'a Node; fn next(&mut self) -> Option<Self::Item> { let node = self.stack.pop()?; for entry in &node.floating_nodes { self.stack.push(entry); } for entry in &node.nodes { self.stack.push(entry); } Some(node) } } #[async_trait] pub trait NodeExt { async fn get_workspace(&self) -> Result<Workspace>; fn get_refined_node_type(&self) -> RefinedNodeType; async fn get_parent(&self) -> Result<Node>; fn iter(&self) -> LinearNodeIterator; fn is_root(&self) -> bool; fn is_output(&self) -> bool; fn is_workspace(&self) -> bool; fn is_container(&self) -> bool; fn is_floating_container(&self) -> bool; fn is_window(&self) -> bool; fn is_floating_window(&self) -> bool; fn is_full_screen(&self) -> bool; async fn is_stacked(&self) -> Result<bool>; async fn is_tabbed(&self) -> Result<bool>; } #[async_trait] impl NodeExt for Node { fn iter(&self) -> LinearNodeIterator { LinearNodeIterator::new(self) } async fn get_workspace(&self) -> Result<Workspace> { let mut connection = Connection::new().await?; let tree = connection.get_tree().await?; let workspaces = connection.get_workspaces().await?; let wsnode = tree .find(|n| n.is_workspace() && n.iter().any(|n| n.id == self.id)) .ok_or(anyhow!(format!( "no workspace found for node with id {}", self.id )))?; workspaces .iter() .find(|w| w.id == wsnode.id) .ok_or(anyhow!(format!( "hmm no workspace found with id {}", wsnode.id ))) .cloned() } async fn get_parent(&self) -> Result<Node> { let mut connection = Connection::new().await?; let tree = connection.get_tree().await?; tree.find(|n| n.nodes.iter().any(|n| n.id == self.id)) .ok_or_else(|| anyhow!(format!("couldn't find parent of node id: {}", self.id))) } fn is_root(&self) -> bool { matches!(self.get_refined_node_type(), RefinedNodeType::Root) } fn is_output(&self) -> bool { matches!(self.get_refined_node_type(), RefinedNodeType::Output) } fn is_workspace(&self) -> bool { matches!(self.get_refined_node_type(), RefinedNodeType::Workspace) } fn is_container(&self) -> bool { matches!(self.get_refined_node_type(), RefinedNodeType::Container) } fn is_floating_container(&self) -> bool { matches!( self.get_refined_node_type(), RefinedNodeType::FloatingContainer ) } fn is_window(&self) -> bool { matches!(self.get_refined_node_type(), RefinedNodeType::Window) } fn is_floating_window(&self) -> bool { matches!( self.get_refined_node_type(), RefinedNodeType::FloatingWindow ) } fn is_full_screen(&self) -> bool { self.percent.unwrap_or(1.0) > 1.0 } async fn is_stacked(&self) -> Result<bool> { let parent = self.get_parent().await?; Ok(parent.layout == NodeLayout::Stacked) } async fn is_tabbed(&self) -> Result<bool> { let parent = self.get_parent().await?; Ok(parent.layout == NodeLayout::Tabbed) } fn get_refined_node_type(&self) -> RefinedNodeType { match self.node_type { NodeType::Root => RefinedNodeType::Root, NodeType::Output => RefinedNodeType::Output, NodeType::Workspace => RefinedNodeType::Workspace, _ => { if self.node_type == NodeType::Con && self.name.is_none() && self.app_id.is_none() && self.pid.is_none() && self.shell.is_none() && self.window_properties.is_none() && self.layout != NodeLayout::None { RefinedNodeType::Container } else if self.node_type == NodeType::FloatingCon && self.name.is_none() && self.app_id.is_none() && self.pid.is_none() && self.shell.is_none() && self.window_properties.is_none() && self.layout != NodeLayout::None { RefinedNodeType::FloatingContainer } else if self.node_type == NodeType::Con && self.pid.is_some() { RefinedNodeType::Window } else if self.node_type == NodeType::FloatingCon && self.pid.is_some() { RefinedNodeType::FloatingWindow } else { panic!( "Boom, don't know what type of node this is:\nid: {}\nnode_type: {:?}\n{:?}", self.id, self.node_type, self ) } } } } }
true
b91cd2ca119dab2425b85145ae607d7a755dc1f4
Rust
mcbunkus/Orbital
/hw5/src/body.rs
UTF-8
10,893
3.234375
3
[]
no_license
#![allow(dead_code)] #![allow(unused_doc_comments)] /** * body.rs contains the Body struct and implements methods for it. A body struct contains only the * position and velocity vectors of the body, other parameters are calculated using methods. A body * is instantiated using using the Body::new() method, which also determines the type of orbit the * body has at the same time. orbit_type does not have to be given manually. */ use nalgebra::{Matrix3, Vector3}; use std::f64::consts::PI; use colored::*; const DAYTOSEC: f64 = 24.0 * 3600.0; const SOLARGM: f64 = 1.328905188132376e11; const PI2: f64 = 2.0 * PI; /** * OrbitType is used to abstract away some of the functions that depend on * the type of orbit the body is in, like kepler's equation. That way, you * can call one function and it will return the correct value */ #[derive(Debug)] pub enum OrbitType { Circular, Elliptic, Parabolic, Hyperbolic, } impl OrbitType { /// Return the orbit type given the eccentricity, Body::new /// uses this function to set the orbit type when an instance /// is constructed pub fn new(eccentricity: f64) -> OrbitType { if eccentricity == 0.0 { return OrbitType::Circular; } else if eccentricity < 1.0 && eccentricity > 0.0 { return OrbitType::Elliptic; } else if eccentricity == 1.0 { return OrbitType::Parabolic; } else { return OrbitType::Hyperbolic; } } } #[derive(Debug)] pub struct Body { pub position: Vector3<f64>, pub velocity: Vector3<f64>, pub orbit_type: OrbitType, } /* Adds methods to Body struct */ impl Body { pub fn new(position: Vector3<f64>, velocity: Vector3<f64>) -> Body { // h and e are used for determining what kind of orbit the body is currently in let h = position.cross(&velocity); let e = ((velocity.cross(&h) / SOLARGM) - position.normalize()).norm(); Body { position: position, velocity: velocity, orbit_type: OrbitType::new(e), } } pub fn radial_velocity(&self) -> Vector3<f64> { (self.velocity.dot(&self.position) / self.position.norm_squared()) * self.position } pub fn tangential_velocity(&self) -> Vector3<f64> { self.omega().cross(&self.position) } pub fn true_anomaly(&self) -> f64 { let e_vec = self.eccentricity_vector(); let posit = self.position.normalize(); let val = e_vec.dot(&posit) / (e_vec.norm() * posit.norm()); if posit.dot(&self.velocity.normalize()) < 0.0 { return 2.0 * PI - val.acos(); } else { return val.acos(); } } /* points from focus to perigee if I'm not mistaken */ pub fn eccentricity_vector(&self) -> Vector3<f64> { let veloc = self.velocity; let posit = self.position; let h = self.angular_momentum(); (veloc.cross(&h) / SOLARGM) - posit.normalize() } pub fn angular_momentum(&self) -> Vector3<f64> { self.position.cross(&self.velocity) } pub fn total_energy(&self) -> f64 { let posit = self.position.norm(); let veloc = self.velocity.norm(); 0.5 * veloc.powi(2) - (SOLARGM / posit) } pub fn omega(&self) -> Vector3<f64> { self.angular_momentum() / self.position.norm_squared() } pub fn frame_rotation_rate(&self) -> f64 { self.omega().norm() } pub fn position_at_angle(&self, angle: f64) -> Vector3<f64> { let e = self.eccentricity(); let numer = self.angular_momentum().norm_squared() / SOLARGM; let denom = 1_f64 + (e * (angle).cos()); let radius = numer / denom; Vector3::new(radius, 0.0, 0.0) } pub fn velocity_at_angle(&self, angle: f64) -> Vector3<f64> { let p = self.orbital_parameter(); let e = self.eccentricity(); let h = self.angular_momentum().norm_squared(); Vector3::new( (h / p) * e * angle.sin(), (h / p) * (1_f64 + e * angle.cos()), 0.0, ) } pub fn position_and_velocity(&self, angle: f64) -> (Vector3<f64>, Vector3<f64>) { let r = self.position_at_angle(angle); let v = self.velocity_at_angle(angle); let tht = angle - self.true_anomaly(); let trans = Matrix3::from_rows(&[ Vector3::new(tht.cos(), -tht.sin(), 0.0).transpose(), Vector3::new(tht.sin(), tht.cos(), 0.0).transpose(), Vector3::new(0.0, 0.0, 1.0).transpose(), ]); (trans * r, trans * v) } // Angle to other body, keep getting the wrong thing anyway, tried everything pub fn angle_to(&self, other: &Body) -> f64 { (self.position.dot(&other.position) / (self.position.norm() * other.position.norm())).acos() } /* Return a transformation matrix constructed from body's orbit in inertial frame */ pub fn make_frame(&self) -> Matrix3<f64> { let e_r = self.position.normalize(); let e_h = self.angular_momentum().normalize(); let e_tht = e_h.cross(&e_r); Matrix3::from_rows(&[e_r.transpose(), e_tht.transpose(), e_h.transpose()]) } pub fn semi_major_axis(&self) -> f64 { let ang_moment = self.angular_momentum().norm(); let e = self.eccentricity(); ang_moment.powi(2) / (SOLARGM * (1_f64 - e.powi(2))) } pub fn orbital_period(&self) -> f64 { 2_f64 * PI * (self.semi_major_axis().powi(3) / SOLARGM).sqrt() } pub fn orbital_parameter(&self) -> f64 { let e = self.eccentricity(); self.semi_major_axis() * (1.0 - e.powi(2)) } pub fn eccentric_anomaly(&self) -> f64 { let e = self.eccentricity(); let theta = self.true_anomaly(); 2.0 * ((theta / 2.0).tan() / ((1.0 + e) / (1.0 - e)).sqrt()).atan() } pub fn time_since_periapsis(&self) -> f64 { let t_anom = self.true_anomaly(); let e_anom = self.true_to_eccentric(t_anom); let a = self.semi_major_axis(); let e = self.eccentricity(); (a.powi(3) / SOLARGM).sqrt() * (e_anom - e * e_anom.sin()) } pub fn eccentricity(&self) -> f64 { self.eccentricity_vector().norm() } pub fn inclination(&self) -> f64 { let h = self.angular_momentum(); (h[2] / h.norm()).acos() // h[2] is the z component of the vector } pub fn ascending_node(&self) -> Vector3<f64> { let k = Vector3::new(0.0, 0.0, 1.0); k.cross(&self.angular_momentum()) } pub fn argument_of_periapsis(&self) -> f64 { let n = self.ascending_node(); let e = self.eccentricity_vector(); let omega = (n.dot(&e) / (n.norm() * e.norm())).acos(); if e[2] < 0.0 { PI2 - omega } else { omega } } pub fn argument_of_ascending_node(&self) -> f64 { let n = self.ascending_node(); let n_x = n[0]; let n_y = n[1]; if n_y >= 0.0 { (n_x / n.norm()).acos() } else { PI2 - (n_x / n.norm()).acos() } } pub fn true_to_eccentric(&self, t_anom: f64) -> f64 { let a = self.semi_major_axis(); let e = self.eccentricity(); let b = a * (1.0 - e.powi(2)).sqrt(); let p = self.orbital_parameter(); let r = p / (1.0 + e * t_anom.cos()); let c = (a * e + r * t_anom.cos()) / a; let s = (r / b) * t_anom.sin(); return s.atan2(c); } pub fn true_anomaly_at_time(&self, time: f64) -> f64 { let t_peri = self.time_since_periapsis(); let m_anom = self.mean_anomaly((time * DAYTOSEC) + t_peri); let angle = self.eccentric_from_mean(m_anom); return PI2 - self.eccentric_to_true_anomaly(angle); } /// The eccentric anomaly at a certain time pub fn eccentric_from_mean(&self, m_anom: f64) -> f64 { match self.kepler(m_anom) { Ok(num) => num, Err(e) => { eprintln!("{}: {}\n", "Invalid Orbit".red(), e); return std::f64::NAN; } } } /// Return the eccentric anomaly using the appropriate Kepler equation pub fn kepler(&self, m_anom: f64) -> Result<f64, &str> { let e = self.eccentricity(); match &self.orbit_type { OrbitType::Elliptic => Ok(elliptic_kepler(m_anom, e)), OrbitType::Hyperbolic => Ok(hyper_kepler(m_anom, e)), OrbitType::Circular => Err("cannot use Keler's equation with a circular orbit."), OrbitType::Parabolic => Err("cannot use Kepler's equation with a parabolic orbit."), } } pub fn eccentric_to_true_anomaly(&self, e_anom: f64) -> f64 { let e = self.eccentricity(); // let sqrt_val = ((1.0 + e) / (1.0 - e)).sqrt(); // 2.0 * (sqrt_val * (e_anom / 2.0).tan()).atan() + PI2 ((e_anom.cos() - e) / (1.0 - e * e_anom.cos())).acos() } /// Return the mean anomaly at a certain time from current position pub fn mean_anomaly(&self, t: f64) -> f64 { let n = (SOLARGM / self.semi_major_axis().powi(3)).sqrt(); n * t } } /** * Some of the kepler functions below. Body matches on its orbit type * and uses the correct function to return the correct eccentric anomaly */ fn elliptic_kepler(nt: f64, eccen: f64) -> f64 { let tolerance = 1e-200; let kep = |e: f64| e - eccen * e.sin() - nt; let kep_d = |e: f64| 1.0 - eccen * e.cos(); let mut e_0 = 0.0; let mut e = e_0 - (kep(e_0) / kep_d(e_0)); while (e - e_0).abs() > tolerance { e_0 = e; e = e_0 - (kep(e_0) / kep_d(e_0)); } return e; } fn hyper_kepler(nt: f64, eccen: f64) -> f64 { let tolerance = 1e-100; let kep = |e: f64| eccen * e.sinh() - nt - e; let kep_d = |e: f64| eccen * e.cosh() - 1.0; let mut e_0 = nt; let mut e = e_0 - kep(e_0) / kep_d(e_0); while (e - e_0).abs() > tolerance { e_0 = e; e = e_0 - kep(e_0) / kep_d(e_0); } return e; } pub fn three_one_three_transform( arg_of_peri: f64, inclination: f64, arg_of_AN: f64, ) -> Matrix3<f64> { let omega = arg_of_peri; let inc = inclination; let tht = arg_of_AN; let m_c = Matrix3::new( omega.cos(), omega.sin(), 0.0, -omega.sin(), omega.cos(), 0.0, 0.0, 0.0, 1.0, ); let m_b = Matrix3::new( 1.0, 0.0, 0.0, 0.0, inc.cos(), inc.sin(), 0.0, -inc.sin(), inc.cos(), ); let m_a = Matrix3::new( tht.cos(), tht.sin(), 0.0, -tht.sin(), tht.cos(), 0.0, 0.0, 0.0, 1.0, ); return m_c * m_b * m_a; }
true
b24853edb83ad9aab5c808aa0d8281ba9d7d3957
Rust
azula-lang/azula
/typecheck/src/typecheck.rs
UTF-8
53,036
2.84375
3
[ "MIT" ]
permissive
use std::{collections::HashMap, ops::Deref, rc::Rc}; use azula_ast::prelude::*; use azula_error::prelude::*; use azula_type::prelude::AzulaType; pub struct Typechecker<'a> { ast: Statement<'a>, functions: HashMap<&'a str, FunctionDefinition<'a>>, globals: HashMap<String, VariableDefinition<'a>>, structs: HashMap<String, StructDefinition<'a>>, pub errors: Vec<AzulaError>, } struct FunctionDefinition<'a> { name: &'a str, args: Vec<(AzulaType<'a>, &'a str)>, varargs: bool, returns: AzulaType<'a>, } struct StructDefinition<'a> { name: &'a str, attrs: Vec<(AzulaType<'a>, &'a str)>, } #[derive(Debug)] pub struct VariableDefinition<'a> { name: String, mutable: bool, typ: AzulaType<'a>, } pub struct Environment<'a> { variable_definitions: HashMap<String, VariableDefinition<'a>>, } impl<'a> Environment<'a> { pub fn new() -> Self { Self { variable_definitions: HashMap::new(), } } pub fn add_variable(&mut self, name: String, def: VariableDefinition<'a>) { self.variable_definitions.insert(name, def); } } impl<'a> Typechecker<'a> { pub fn new(root: Statement<'a>) -> Self { Typechecker { ast: root, functions: HashMap::new(), globals: HashMap::new(), structs: HashMap::new(), errors: vec![], } } pub fn typecheck(&mut self) -> Result<Statement<'a>, String> { if let Statement::Root(mut x) = self.ast.clone() { for stmt in x.iter_mut() { match stmt { Statement::Function { name, args, returns, .. } => { let args_converted: Vec<_> = args .iter() .map(|(typ, name)| (AzulaType::from(typ.clone()), *name)) .collect(); let returns_converted: AzulaType = returns.clone().into(); self.functions.insert( name, FunctionDefinition { name, varargs: true, args: args_converted.clone(), returns: returns_converted.clone(), }, ); } Statement::ExternFunction { name, varargs, args, returns, .. } => { let args_converted: Vec<_> = args.iter().map(|typ| (typ.clone(), "xyz")).collect(); let returns_converted: AzulaType = returns.clone().into(); self.functions.insert( name, FunctionDefinition { name, varargs: false, args: args_converted.clone(), returns: returns_converted.clone(), }, ); } _ => {} } } } else { return Err("Not a root node".to_string()); } if let Statement::Root(mut x) = self.ast.clone() { for stmt in x.iter_mut() { *stmt = match self.typecheck_top_level_statement(stmt.clone()) { Ok(stmt) => stmt, Err(e) => return Err(e), }; } Ok(Statement::Root(x)) } else { Err("Not a root node".to_string()) } } pub fn typecheck_top_level_statement( &mut self, stmt: Statement<'a>, ) -> Result<Statement<'a>, String> { match stmt { Statement::Function { .. } => self.typecheck_function(stmt), Statement::ExternFunction { .. } => Ok(stmt), Statement::Assign(..) => self.typecheck_global_assign(stmt), Statement::Struct { name, attributes, span, } => { self.structs.insert( name.to_string(), StructDefinition { name, attrs: attributes.clone(), }, ); Ok(Statement::Struct { name: name, attributes: attributes, span: span, }) } _ => unreachable!(), } } pub fn typecheck_statement( &mut self, stmt: Statement<'a>, env: &mut Environment<'a>, ) -> Result<(Statement<'a>, AzulaType<'a>), String> { match stmt { Statement::Assign(..) => self.typecheck_assign(stmt, env), Statement::Return(..) => self.typecheck_return(stmt, env), Statement::ExpressionStatement(expr, span) => { let result = match self.typecheck_expression(expr, env) { Ok((expr, _)) => expr, Err(e) => return Err(e), }; Ok(( Statement::ExpressionStatement(result, span), AzulaType::Void, )) } Statement::If(..) => self.typecheck_if(stmt, env), Statement::While(..) => self.typecheck_while(stmt, env), Statement::Reassign(..) => self.typecheck_reassign(stmt, env), _ => unreachable!("{:?}", stmt), } } fn typecheck_function(&mut self, stmt: Statement<'a>) -> Result<Statement<'a>, String> { if let Statement::Function { name, args, returns, body, span, } = stmt.clone() { let args_converted: Vec<_> = args .iter() .map(|(typ, name)| (AzulaType::from(typ.clone()), *name)) .collect(); let mut environment = Environment::new(); for (typ, name) in &args_converted { environment.add_variable( name.to_string(), VariableDefinition { name: name.to_string(), mutable: false, typ: typ.clone(), }, ) } let mut statements = vec![]; if let Statement::Block(mut stmts) = body.deref().clone() { for stmt in stmts.iter_mut() { statements.push( match self.typecheck_statement(stmt.clone(), &mut environment) { Ok((stmt, _)) => stmt, Err(e) => return Err(e), }, ); } } return Ok(Statement::Function { name, args, returns, body: Rc::new(Statement::Block(statements)), span, }); } unreachable!() } fn typecheck_global_assign(&mut self, expr: Statement<'a>) -> Result<Statement<'a>, String> { if let Statement::Assign(mutable, name, type_annotation, value, span) = expr { if mutable { self.errors.push(AzulaError::new( ErrorType::NonGlobalConstant, span.start, span.end, )); return Err("Non constant at top-level".to_string()); } // let (expr, typ) = match self.typecheck_expression(value, &Environment::new()) { // Ok((expr, value)) => (expr, value), // Err(e) => return Err(e), // }; let typ = match value.expression.clone() { Expression::Integer(_) => AzulaType::Int, Expression::Float(_) => AzulaType::Float, Expression::Boolean(_) => AzulaType::Bool, Expression::String(_) => AzulaType::Pointer(Rc::new(AzulaType::Str)), Expression::Array(val) => { AzulaType::Array(Rc::new(val[0].typed.clone()), Some(val.len())) } _ => { self.errors.push(AzulaError::new( ErrorType::NonGlobalConstant, span.start, span.end, )); return Err("Non constant at top-level".to_string()); } }; if type_annotation.is_some() { let type_annotation = type_annotation.clone().unwrap(); if type_annotation != typ { self.errors.push(AzulaError::new( ErrorType::MismatchedAssignTypes( format!("{:?}", type_annotation), format!("{:?}", typ), ), span.start, value.span.end, )); return Err("mismatched types in assign".to_string()); } } self.globals.insert( name.clone(), VariableDefinition { name: name.clone(), mutable, typ, }, ); Ok(Statement::Assign( mutable, name, type_annotation, value, span, )) } else { unreachable!() } } fn typecheck_assign( &mut self, expr: Statement<'a>, env: &mut Environment<'a>, ) -> Result<(Statement<'a>, AzulaType<'a>), String> { if let Statement::Assign(mutable, name, type_annotation, value, span) = expr { let (expr, typ) = match self.typecheck_expression(value, env) { Ok((expr, value)) => (expr, value), Err(e) => return Err(e), }; if type_annotation.is_some() { let mut type_annotation = type_annotation.clone().unwrap(); if let AzulaType::Array(arr_typ, size) = typ.clone() { if let AzulaType::Array(inner_type, inner_size) = type_annotation.clone() { if arr_typ != inner_type { self.errors.push(AzulaError::new( ErrorType::MismatchedAssignTypes( format!("{:?}", type_annotation), format!("{:?}", typ), ), span.start, expr.span.end, )); return Err("mismatched types in assign".to_string()); } if size.is_some() && inner_size.is_some() { if size.unwrap() != inner_size.unwrap() { self.errors.push(AzulaError::new( ErrorType::MismatchedAssignTypes( format!("{:?}", type_annotation), format!("{:?}", typ), ), span.start, expr.span.end, )); return Err("mismatched types in assign".to_string()); } } type_annotation = AzulaType::Array(arr_typ, size); } } if type_annotation != typ { self.errors.push(AzulaError::new( ErrorType::MismatchedAssignTypes( format!("{:?}", type_annotation), format!("{:?}", typ), ), span.start, expr.span.end, )); return Err("mismatched types in assign".to_string()); } } env.add_variable( name.clone(), VariableDefinition { name: name.clone(), mutable, typ: typ, }, ); Ok(( Statement::Assign(mutable, name, type_annotation, expr, span), AzulaType::Void, )) } else { unreachable!() } } fn typecheck_reassign( &mut self, expr: Statement<'a>, env: &mut Environment<'a>, ) -> Result<(Statement<'a>, AzulaType<'a>), String> { if let Statement::Reassign(var, val, span) = expr { let (val, typ) = match self.typecheck_expression(val, env) { Ok((expr, value)) => (expr, value), Err(e) => return Err(e), }; let mut mutable = true; match var.expression { Expression::Identifier(ref v) => match env.variable_definitions.get(v) { Some(var) => { mutable = var.mutable; } _ => { self.errors.push(AzulaError::new( ErrorType::UnknownVariable(v.clone()), var.span.start, var.span.end, )); return Err("unknown variable".to_string()); } }, Expression::ArrayAccess(..) => {} Expression::StructAccess(..) => {} _ => { unreachable!("{:?}", var.expression) } } if !mutable { self.errors.push(AzulaError::new( ErrorType::ConstantAssign, var.span.start, var.span.end, )); return Err("constant assign".to_string()); } let (variable, var_type) = match self.typecheck_expression(var, env) { Ok((expr, value)) => (expr, value), Err(e) => return Err(e), }; if var_type != typ { self.errors.push(AzulaError::new( ErrorType::MismatchedAssignTypes( format!("{:?}", var_type), format!("{:?}", typ), ), span.start, val.span.end, )); return Err("mismatched types in assign".to_string()); } Ok((Statement::Reassign(variable, val, span), AzulaType::Void)) } else { unreachable!() } } fn typecheck_return( &mut self, expr: Statement<'a>, env: &mut Environment<'a>, ) -> Result<(Statement<'a>, AzulaType<'a>), String> { if let Statement::Return(ref value, ref span) = expr { if value.is_none() { return Ok((expr.clone(), AzulaType::Void)); } let value = value.as_ref().unwrap(); let (expr, typ) = match self.typecheck_expression(value.clone(), env) { Ok((expr, value)) => (expr, value), Err(e) => return Err(e), }; Ok((Statement::Return(Some(expr.clone()), span.clone()), typ)) } else { unreachable!() } } fn typecheck_if( &mut self, stmt: Statement<'a>, env: &mut Environment<'a>, ) -> Result<(Statement<'a>, AzulaType<'a>), String> { if let Statement::If(ref expr, ref body, ref span) = stmt { let (expr, typ) = match self.typecheck_expression(expr.clone(), env) { Ok((expr, value)) => (expr, value), Err(e) => return Err(e), }; if typ != AzulaType::Bool { self.errors.push(AzulaError::new( ErrorType::NonBoolCondition(format!("{:?}", typ)), expr.span.start, expr.span.end, )); return Err("Non boolean condition".to_string()); } let mut stmts = vec![]; for stmt in body { match self.typecheck_statement(stmt.clone(), env) { Ok((stmt, _)) => stmts.push(stmt), Err(e) => return Err(e), }; } Ok((Statement::If(expr, stmts, span.clone()), AzulaType::Void)) } else { unreachable!() } } fn typecheck_while( &mut self, stmt: Statement<'a>, env: &mut Environment<'a>, ) -> Result<(Statement<'a>, AzulaType<'a>), String> { if let Statement::While(ref expr, ref body, ref span) = stmt { let (expr, typ) = match self.typecheck_expression(expr.clone(), env) { Ok((expr, value)) => (expr, value), Err(e) => return Err(e), }; if typ != AzulaType::Bool { self.errors.push(AzulaError::new( ErrorType::NonBoolCondition(format!("{:?}", typ)), expr.span.start, expr.span.end, )); return Err("Non boolean condition".to_string()); } let mut stmts = vec![]; for stmt in body { match self.typecheck_statement(stmt.clone(), env) { Ok((stmt, _)) => stmts.push(stmt), Err(e) => return Err(e), }; } Ok((Statement::While(expr, stmts, span.clone()), AzulaType::Void)) } else { unreachable!() } } fn typecheck_expression( &mut self, mut expr: ExpressionNode<'a>, env: &Environment<'a>, ) -> Result<(ExpressionNode<'a>, AzulaType<'a>), String> { match expr.expression { Expression::Infix(..) => self.typecheck_infix_expression(expr, env), Expression::Integer(_) => { expr.typed = AzulaType::Int; Ok((expr.clone(), AzulaType::Int)) } Expression::Float(_) => { expr.typed = AzulaType::Float; Ok((expr.clone(), AzulaType::Float)) } Expression::Boolean(_) => { expr.typed = AzulaType::Bool; Ok((expr.clone(), AzulaType::Bool)) } Expression::String(_) => { expr.typed = AzulaType::Pointer(Rc::new(AzulaType::Str)); Ok((expr.clone(), AzulaType::Pointer(Rc::new(AzulaType::Str)))) } Expression::Identifier(ref name) => { if name == "nil" { return Ok((expr.clone(), AzulaType::Void)); } if let Some(variable) = env.variable_definitions.get(name) { expr.typed = variable.typ.clone().into(); Ok((expr.clone(), variable.typ.clone())) } else if let Some(variable) = self.globals.get(name) { expr.typed = variable.typ.clone().into(); Ok((expr.clone(), variable.typ.clone())) } else { self.errors.push(AzulaError::new( ErrorType::UnknownVariable(name.clone()), expr.span.start, expr.span.end, )); return Err("Unknown variable".to_string()); } } Expression::FunctionCall { function, args } => { let return_type = match &function.expression { Expression::Identifier(i) => match self.functions.get(&i.as_str()) { Some(f) => &f.returns, None => { if i == "printf" || i == "sprintf" || i == "puts" { &AzulaType::Void } else { self.errors.push(AzulaError::new( ErrorType::FunctionNotFound(i.to_string()), function.span.start, function.span.end, )); return Err("Function not found".to_string()); } } }, _ => todo!(), } .clone(); let mut new_args = vec![]; for arg in args.clone() { let (arg, _) = match self.typecheck_expression(arg, env) { Ok((arg, typ)) => (arg, typ), Err(e) => return Err(e), }; new_args.push(arg); } return Ok(( ExpressionNode { expression: Expression::FunctionCall { function: function.clone(), args: new_args, }, typed: return_type.clone(), span: expr.span, }, return_type.clone(), )); } Expression::Not(exp) => { let (node, typ) = match self.typecheck_expression(exp.deref().clone(), env) { Ok((node, typ)) => (node, typ), Err(e) => return Err(e), }; if typ != AzulaType::Bool { self.errors.push(AzulaError::new( ErrorType::NonBoolCondition(format!("{:?}", typ)), expr.span.start, expr.span.end, )); return Err("Non-bool in condition".to_string()); } return Ok(( ExpressionNode { expression: Expression::Not(Rc::new(node)), typed: typ, span: expr.span, }, AzulaType::Bool, )); } Expression::Pointer(exp) => { let (node, typ) = match self.typecheck_expression(exp.deref().clone(), env) { Ok((node, typ)) => (node, typ), Err(e) => return Err(e), }; return Ok(( ExpressionNode { expression: Expression::Pointer(Rc::new(node)), typed: AzulaType::Pointer(Rc::new(typ.clone())), span: expr.span, }, AzulaType::Pointer(Rc::new(typ)), )); } Expression::Array(items) => { let typs = items .iter() .map(|v| self.typecheck_expression(v.clone(), env)) .collect::<Vec<_>>(); if typs.is_empty() { return Ok(( ExpressionNode { expression: Expression::Array(vec![]), typed: AzulaType::Array(Rc::new(AzulaType::Infer), Some(0)), span: expr.span, }, AzulaType::Array(Rc::new(AzulaType::Infer), Some(0)), )); } let first_typ = &typs[0].as_ref().unwrap().1; for val in typs.clone() { let (node, typ) = match val { Ok((node, typ)) => (node, typ), Err(_) => continue, }; if typ != first_typ.clone() { self.errors.push(AzulaError::new( ErrorType::MismatchedTypes( format!("{:?}", typ), format!("{:?}", first_typ), ), node.span.start, node.span.end, )); } } Ok(( ExpressionNode { expression: Expression::Array( typs.clone() .iter() .map(|s| s.as_ref().unwrap().clone()) .map(|(node, _)| node) .collect(), ), typed: AzulaType::Array(Rc::new(first_typ.clone()), Some(typs.len())), span: expr.span, }, AzulaType::Array(Rc::new(first_typ.clone()), Some(typs.len())), )) } Expression::ArrayAccess(array, index) => { let (array, array_typ) = self .typecheck_expression(array.deref().clone(), env) .unwrap(); let (index, typ) = self .typecheck_expression(index.deref().clone(), env) .unwrap(); if typ != AzulaType::Int { self.errors.push(AzulaError::new( ErrorType::NonIntIndex(format!("{:?}", typ)), array.span.start, index.span.end, )); return Err("Non int index".to_string()); } let return_typ = if array_typ.is_indexable() { match array_typ { AzulaType::Array(nested, _) => nested.deref().clone(), AzulaType::Pointer(nested) => match nested.deref().clone() { AzulaType::Str => AzulaType::SizedSignedInt(8), _ => nested.deref().clone(), }, _ => unreachable!(), } } else { self.errors.push(AzulaError::new( ErrorType::NonArrayInIndex(format!("{:?}", array_typ)), array.span.start, array.span.end, )); return Err("non-array in index".to_string()); }; return Ok(( ExpressionNode { expression: Expression::ArrayAccess(Rc::new(array), Rc::new(index)), typed: return_typ.clone(), span: expr.span, }, return_typ, )); } Expression::StructInitialisation(struc, attrs) => { let name = match &struc.clone().expression { Expression::Identifier(s) => s.clone(), _ => unreachable!(), }; let mut attrs_new = vec![]; for (name, attr) in attrs.iter() { let expr = match self.typecheck_expression(attr.clone(), env) { Ok((expr, _)) => expr, Err(e) => return Err(e), }; attrs_new.push((*name, expr)); } return Ok(( ExpressionNode { expression: Expression::StructInitialisation(struc, attrs_new), typed: AzulaType::Named(name.clone()), span: expr.span, }, AzulaType::Named(name.clone()), )); } Expression::StructAccess(struc, access) => { let (struc, struc_type) = match self.typecheck_expression(struc.deref().clone(), env) { Ok(x) => x, Err(e) => return Err(e), }; let struc_name = match struc_type { AzulaType::Named(s) => s, AzulaType::Pointer(nested) => match nested.deref().clone() { AzulaType::Named(s) => s, _ => { self.errors.push(AzulaError::new( ErrorType::AccessNonStruct, struc.span.start, struc.span.end, )); return Err("accessing non-struct".to_string()); } }, _ => { self.errors.push(AzulaError::new( ErrorType::AccessNonStruct, struc.span.start, struc.span.end, )); return Err("accessing non-struct".to_string()); } }; let struct_type = if let Some(struct_type) = self.structs.get(&struc_name) { struct_type } else { self.errors.push(AzulaError::new( ErrorType::UnknownStruct(struc_name), struc.span.start, struc.span.end, )); return Err("Struct not found".to_string()); }; let member_name = match &access.expression { Expression::Identifier(s) => s, _ => { self.errors.push(AzulaError::new( ErrorType::AccessNonStruct, access.span.start, access.span.end, )); return Err("accessing non-struct".to_string()); } }; let typ = match struct_type .attrs .iter() .find(|(_, name)| name.to_string() == member_name.clone()) { Some((typ, _)) => typ, _ => { self.errors.push(AzulaError::new( ErrorType::UnknownStructMember(member_name.clone(), struc_name), access.span.start, access.span.end, )); return Err("unknown struct member".to_string()); } }; return Ok(( ExpressionNode { expression: Expression::StructAccess(Rc::new(struc), access), typed: typ.clone(), span: expr.span, }, typ.clone(), )); } } } fn typecheck_infix_expression( &mut self, mut expr: ExpressionNode<'a>, env: &Environment<'a>, ) -> Result<(ExpressionNode<'a>, AzulaType<'a>), String> { if let Expression::Infix(ref left, ref operator, ref right) = expr.expression { let (left, left_typ) = match self.typecheck_expression(left.deref().clone(), env) { Ok((left, typ)) => (left, typ), Err(e) => return Err(e), }; let (right, right_typ) = match self.typecheck_expression(right.deref().clone(), env) { Ok((right, typ)) => (right, typ), Err(e) => return Err(e), }; let allowed = hashmap! { Operator::Add => vec![AzulaType::Int, AzulaType::Float], Operator::Sub => vec![AzulaType::Int, AzulaType::Float], Operator::Mul => vec![AzulaType::Int, AzulaType::Float], Operator::Div => vec![AzulaType::Int, AzulaType::Float], Operator::Mod => vec![AzulaType::Int, AzulaType::Float], Operator::Power => vec![AzulaType::Int, AzulaType::Float], Operator::Or => vec![AzulaType::Bool], Operator::And => vec![AzulaType::Bool], Operator::Eq => vec![AzulaType::Int, AzulaType::Float, AzulaType::Bool], Operator::Neq => vec![AzulaType::Int, AzulaType::Float, AzulaType::Bool], Operator::Lt => vec![AzulaType::Int, AzulaType::Float], Operator::Lte => vec![AzulaType::Int, AzulaType::Float], Operator::Gt => vec![AzulaType::Int, AzulaType::Float], Operator::Gte => vec![AzulaType::Int, AzulaType::Float], }; let allowed = allowed.get(operator).unwrap(); if !allowed.contains(&left_typ) { self.errors.push(AzulaError::new( ErrorType::NonOperatorType( format!("{:?}", left_typ), format!("{:?}", operator), ), left.span.start, left.span.end, )); return Err("cannot use operator with type".to_string()); } if !allowed.contains(&right_typ) { self.errors.push(AzulaError::new( ErrorType::NonOperatorType( format!("{:?}", right_typ), format!("{:?}", operator), ), right.span.start, right.span.end, )); return Err("cannot use operator with type".to_string()); } match operator { Operator::Add => { if left_typ != right_typ { self.errors.push(AzulaError::new( ErrorType::MismatchedTypes( format!("{:?}", left_typ), format!("{:?}", right_typ), ), left.span.start, right.span.end, )); return Err("mismatched types in infix".to_string()); } expr.typed = left.clone().typed; Ok(( ExpressionNode { expression: Expression::Infix( Rc::new(left), operator.clone(), Rc::new(right), ), typed: left_typ.clone().into(), span: expr.span, }, left_typ, )) } Operator::Sub => { if left_typ != right_typ { self.errors.push(AzulaError::new( ErrorType::MismatchedTypes( format!("{:?}", left_typ), format!("{:?}", right_typ), ), left.span.start, right.span.end, )); return Err("mismatched types in infix".to_string()); } expr.typed = left.clone().typed; Ok(( ExpressionNode { expression: Expression::Infix( Rc::new(left), operator.clone(), Rc::new(right), ), typed: left_typ.clone().into(), span: expr.span, }, left_typ, )) } Operator::Mul => { if left_typ != right_typ { self.errors.push(AzulaError::new( ErrorType::MismatchedTypes( format!("{:?}", left_typ), format!("{:?}", right_typ), ), left.span.start, right.span.end, )); return Err("mismatched types in infix".to_string()); } expr.typed = left.clone().typed; Ok(( ExpressionNode { expression: Expression::Infix( Rc::new(left), operator.clone(), Rc::new(right), ), typed: left_typ.clone().into(), span: expr.span, }, left_typ, )) } Operator::Div => { if left_typ != right_typ { self.errors.push(AzulaError::new( ErrorType::MismatchedTypes( format!("{:?}", left_typ), format!("{:?}", right_typ), ), left.span.start, right.span.end, )); return Err("mismatched types in infix".to_string()); } expr.typed = left.clone().typed; Ok(( ExpressionNode { expression: Expression::Infix( Rc::new(left), operator.clone(), Rc::new(right), ), typed: left_typ.clone().into(), span: expr.span, }, left_typ, )) } Operator::Mod => { if left_typ != right_typ { self.errors.push(AzulaError::new( ErrorType::MismatchedTypes( format!("{:?}", left_typ), format!("{:?}", right_typ), ), left.span.start, right.span.end, )); return Err("mismatched types in infix".to_string()); } expr.typed = left.clone().typed; Ok(( ExpressionNode { expression: Expression::Infix( Rc::new(left), operator.clone(), Rc::new(right), ), typed: left_typ.clone().into(), span: expr.span, }, left_typ, )) } Operator::Power => { if left_typ != right_typ { self.errors.push(AzulaError::new( ErrorType::MismatchedTypes( format!("{:?}", left_typ), format!("{:?}", right_typ), ), left.span.start, right.span.end, )); return Err("mismatched types in infix".to_string()); } expr.typed = left.clone().typed; Ok(( ExpressionNode { expression: Expression::Infix( Rc::new(left), operator.clone(), Rc::new(right), ), typed: left_typ.clone().into(), span: expr.span, }, left_typ, )) } Operator::Or | Operator::And | Operator::Eq | Operator::Neq | Operator::Lt | Operator::Lte | Operator::Gt | Operator::Gte => { expr.typed = AzulaType::Bool; Ok(( ExpressionNode { expression: Expression::Infix( Rc::new(left), operator.clone(), Rc::new(right), ), typed: AzulaType::Bool, span: expr.span, }, AzulaType::Bool, )) } } } else { unreachable!() } } } #[cfg(test)] mod tests { use super::*; use azula_ast::prelude::Span; use std::rc::Rc; #[test] fn test_function() { let root = Statement::Root(vec![Statement::Function { name: "main", args: vec![(AzulaType::Int, "x")], returns: AzulaType::Bool, body: Rc::new(Statement::Block(vec![])), span: Span { start: 0, end: 1 }, }]); let mut typechecker = Typechecker::new(root); typechecker.typecheck().unwrap(); } #[test] fn test_assign() { let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); typechecker.typecheck_assign( Statement::Assign( true, "test".to_string(), None, ExpressionNode { expression: Expression::Integer(5), typed: AzulaType::Infer, span: Span { start: 0, end: 1 }, }, Span { start: 0, end: 1 }, ), &mut environment, ); let var = environment .variable_definitions .get(&"test".to_string()) .unwrap(); assert_eq!(var.name, "test"); assert_eq!(var.typ, AzulaType::Int); } #[test] fn test_return() { // Return value let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); let (_, typ) = typechecker .typecheck_return( Statement::Return( Some(ExpressionNode { expression: Expression::Integer(5), typed: AzulaType::Infer, span: Span { start: 0, end: 1 }, }), Span { start: 0, end: 1 }, ), &mut environment, ) .unwrap(); assert_eq!(typ, AzulaType::Int); // Return none let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); let (_, typ) = typechecker .typecheck_return( Statement::Return(None, Span { start: 0, end: 1 }), &mut environment, ) .unwrap(); assert_eq!(typ, AzulaType::Void); } #[test] fn test_integer_expression() { let integer_node = ExpressionNode { expression: Expression::Integer(5), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }; let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); let (expr, typ) = typechecker .typecheck_expression(integer_node, &environment) .unwrap(); assert_eq!(typ, AzulaType::Int); assert_eq!(expr.typed, AzulaType::Int); } #[test] fn test_identifier_expression() { // Integer let identifier_node = ExpressionNode { expression: Expression::Identifier("test".to_string()), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }; let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); environment.add_variable( "test".to_string(), VariableDefinition { name: "test".to_string(), mutable: true, typ: AzulaType::Int, }, ); let (expr, typ) = typechecker .typecheck_expression(identifier_node, &environment) .unwrap(); assert_eq!(typ, AzulaType::Int); assert_eq!(expr.typed, AzulaType::Int); // Pointer let identifier_node = ExpressionNode { expression: Expression::Identifier("test".to_string()), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }; let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); environment.add_variable( "test".to_string(), VariableDefinition { typ: AzulaType::Pointer(Rc::new(AzulaType::Str)), name: "test".to_string(), mutable: true, }, ); let (expr, typ) = typechecker .typecheck_expression(identifier_node, &environment) .unwrap(); assert_eq!(typ, AzulaType::Pointer(Rc::new(AzulaType::Str))); assert_eq!(expr.typed, AzulaType::Pointer(Rc::new(AzulaType::Str))); } #[test] fn test_infix_expression() { // Int let infix_node = ExpressionNode { expression: Expression::Infix( Rc::new(ExpressionNode { expression: Expression::Integer(5), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }), Operator::Add, Rc::new(ExpressionNode { expression: Expression::Integer(20), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }), ), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }; let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); let (expr, typ) = typechecker .typecheck_expression(infix_node, &environment) .unwrap(); assert_eq!(typ, AzulaType::Int); assert_eq!(expr.typed, AzulaType::Int); // Non operator type let infix_node = ExpressionNode { expression: Expression::Infix( Rc::new(ExpressionNode { expression: Expression::Integer(5), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }), Operator::Add, Rc::new(ExpressionNode { expression: Expression::Identifier("test".to_string()), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }), ), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }; let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); environment.add_variable( "test".to_string(), VariableDefinition { name: "test".to_string(), typ: AzulaType::Bool, mutable: true, }, ); typechecker.typecheck_expression(infix_node, &environment); assert_eq!(typechecker.errors.len(), 1); assert!(matches!( typechecker.errors[0].error_type, ErrorType::NonOperatorType(..) )); } #[test] fn test_array_expression() { // Int let array = ExpressionNode { expression: Expression::Array(vec![ ExpressionNode { expression: Expression::Integer(1), typed: AzulaType::Int, span: Span { start: 0, end: 1 }, }, ExpressionNode { expression: Expression::Integer(2), typed: AzulaType::Int, span: Span { start: 0, end: 1 }, }, ]), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }; let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); let (expr, typ) = typechecker .typecheck_expression(array, &environment) .unwrap(); assert_eq!(typ, AzulaType::Array(Rc::new(AzulaType::Int), Some(2))); assert_eq!( expr.typed, AzulaType::Array(Rc::new(AzulaType::Int), Some(2)) ); // Different types let array = ExpressionNode { expression: Expression::Array(vec![ ExpressionNode { expression: Expression::Integer(1), typed: AzulaType::Int, span: Span { start: 0, end: 1 }, }, ExpressionNode { expression: Expression::Boolean(false), typed: AzulaType::Bool, span: Span { start: 0, end: 1 }, }, ]), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }; let mut typechecker = Typechecker::new(Statement::Root(vec![])); let mut environment = Environment::new(); let (expr, typ) = typechecker .typecheck_expression(array, &environment) .unwrap(); assert_eq!(typechecker.errors.len(), 1); assert!(matches!( typechecker.errors[0].error_type, ErrorType::MismatchedTypes(..) )); } #[test] fn test_struct_access_expression() { // Int let array = ExpressionNode { expression: Expression::StructAccess( Rc::new(ExpressionNode { expression: Expression::Identifier("x".to_string()), typed: AzulaType::Infer, span: Span { start: 0, end: 1 }, }), Rc::new(ExpressionNode { expression: Expression::Identifier("test".to_string()), typed: AzulaType::Infer, span: Span { start: 0, end: 1 }, }), ), typed: AzulaType::Infer, span: Span { start: 0, end: 0 }, }; let mut typechecker = Typechecker::new(Statement::Root(vec![])); typechecker.structs.insert( "Test".to_string(), StructDefinition { name: "Test", attrs: vec![(AzulaType::Int, "test")], }, ); let mut environment = Environment::new(); environment.add_variable( "x".to_string(), VariableDefinition { name: "x".to_string(), mutable: false, typ: AzulaType::Named("Test".to_string()), }, ); let (expr, typ) = typechecker .typecheck_expression(array, &environment) .unwrap(); assert_eq!(typ, AzulaType::Int); assert_eq!(expr.typed, AzulaType::Int); } }
true
e1d3086bf8b79d0d6cfbc3e8c3dc66cf1cf9fc4c
Rust
rodrimati1992/core_extensions
/src_core_extensions/phantom.rs
UTF-8
8,523
3.5
4
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "MIT" ]
permissive
//! `PhantomData`-related items. //! use std_::{ cell::Cell, marker::PhantomData, }; /// Type alias for a variant `PhantomData` with drop check. /// /// # Example /// /// ```rust /// use core_extensions::VariantDropPhantom; /// use std::marker::PhantomData; /// /// let _: VariantDropPhantom<u32> = PhantomData; /// /// ``` /// pub type VariantDropPhantom<T> = PhantomData<T>; /// Type alias for a variant `PhantomData`, without drop check. /// /// # Example /// /// ```rust /// use core_extensions::{AsPhantomData, CovariantPhantom}; /// /// let _: CovariantPhantom<u32> = u32::PHANTOM_COVARIANT; /// /// ``` /// pub type CovariantPhantom<T> = PhantomData<fn() -> T>; /// Type alias for a contravariant `PhantomData`, without drop check. /// /// # Example /// /// ```rust /// use core_extensions::{ContraVariantPhantom, AsPhantomData}; /// /// let _: ContraVariantPhantom<u32> = u32::PHANTOM_CONTRA; /// /// ``` /// pub type ContraVariantPhantom<T> = PhantomData<fn(T)>; /// Type alias for an invariant `PhantomData`. /// /// # Example /// /// ```rust /// use core_extensions::{InvariantPhantom, AsPhantomData}; /// /// let _: InvariantPhantom<u32> = u32::PHANTOM_INVARIANT; /// /// ``` /// pub type InvariantPhantom<T> = PhantomData<fn(T) -> T>; /// Type alias for an `PhantomData` with an invariant lifetime. /// /// # Example /// /// ```rust /// use core_extensions::InvariantRefPhantom; /// use std::marker::PhantomData; /// /// let _: InvariantRefPhantom<u32> = PhantomData; /// /// ``` /// pub type InvariantRefPhantom<'a, T> = PhantomData<Cell<&'a T>>; /////////////////////////////////////////////////////////////////////////// /// For getting a `PhantomData<Self>` with a variety of lifetime variances. pub trait AsPhantomData { #[doc(hidden)] const PHANTOM_QFEO7CXJP2HJSGYWRZFRBHDTHU: PhantomData<Self> = PhantomData; /// Gets a `PhantomData<Self>`. /// /// # Example /// /// ```rust /// use core_extensions::AsPhantomData; /// /// use std::marker::PhantomData; /// /// fn get_default<T: Default>(_type: PhantomData<T>) -> T { /// Default::default() /// } /// /// let string = String::new(); /// let vector = vec![0u8]; /// /// assert_eq!(get_default(string.as_phantom()), ""); /// assert_eq!(get_default(vector.as_phantom()), vec![]); /// /// ``` #[inline(always)] fn as_phantom(&self) -> PhantomData<Self> { PhantomData } /// Gets a `PhantomData<fn() -> Self>`, a covariant `PhantomData`. #[inline(always)] fn as_phantom_covariant(&self) -> PhantomData<fn() -> Self> { PhantomData } /// Gets a `PhantomData<fn(Self)>`, a contravariant `PhantomData`. #[inline(always)] fn as_phantom_contra(&self) -> PhantomData<fn(Self)> { PhantomData } /// Gets a `PhantomData<fn(Self) -> Self>`, an invariant `PhantomData`. #[inline(always)] fn as_phantom_invariant(&self) -> PhantomData<fn(Self) -> Self> { PhantomData } /// Gets a `PhantomData<Self>`. /// /// # Example /// /// ```rust /// use core_extensions::AsPhantomData; /// /// use std::marker::PhantomData; /// /// fn get_default<T: Default>(_type: PhantomData<T>) -> T { /// Default::default() /// } /// /// assert_eq!(get_default(String::PHANTOM), ""); /// assert_eq!(get_default(Vec::<()>::PHANTOM), vec![]); /// /// ``` const PHANTOM: PhantomData<Self> = PhantomData; /// Constructs a `PhantomData<fn() -> T>`, a covariant `PhantomData`. /// /// # Example /// /// ```rust /// use core_extensions::{AsPhantomData, CovariantPhantom}; /// /// struct WithGhost<T> { /// value: T, /// _ghost: CovariantPhantom<T>, /// } /// /// impl<T> WithGhost<T> { /// const fn new(value: T) -> Self { /// Self { /// value, /// _ghost: T::PHANTOM_COVARIANT, /// } /// } /// } /// ``` /// const PHANTOM_COVARIANT: PhantomData<fn() -> Self> = PhantomData; /// Gets a `PhantomData<fn(Self)>`, a contravariant `PhantomData`. /// /// # Example /// /// ```rust /// use core_extensions::{AsPhantomData, ContraVariantPhantom}; /// /// struct WithGhost<T> { /// value: T, /// _ghost: ContraVariantPhantom<T>, /// } /// /// impl<T> WithGhost<T> { /// const fn new(value: T) -> Self { /// Self { /// value, /// _ghost: T::PHANTOM_CONTRA, /// } /// } /// } /// ``` /// const PHANTOM_CONTRA: PhantomData<fn(Self)> = PhantomData; /// Gets a `PhantomData<fn(Self) -> Self>`, an invariant `PhantomData`. /// /// # Example /// /// ```rust /// use core_extensions::{AsPhantomData, InvariantPhantom}; /// /// struct WithGhost<T> { /// value: T, /// _ghost: InvariantPhantom<T>, /// } /// /// impl<T> WithGhost<T> { /// const fn new(value: T) -> Self { /// Self { /// value, /// _ghost: T::PHANTOM_INVARIANT, /// } /// } /// } /// ``` /// const PHANTOM_INVARIANT: PhantomData<fn(Self) -> Self> = PhantomData; } impl<T: ?Sized> AsPhantomData for T {} /////////////////////////////////////////////////////////////////////////// /// Gets the `PhantomData` of the passed in type. /// /// # Example /// /// ```rust /// use core_extensions::as_phantom; /// /// use std::marker::PhantomData; /// /// fn get_default<T: Default>(_type: PhantomData<T>) -> T { /// Default::default() /// } /// /// let string = String::new(); /// let vector = vec![0u8]; /// /// assert_eq!(get_default(as_phantom(&string)), "".to_string()); /// assert_eq!(get_default(as_phantom(&vector)), vec![]); /// /// ``` #[inline(always)] pub const fn as_phantom<T: ?Sized>(_: &T) -> PhantomData<T> { PhantomData } /////////////////////////////////////////////////////////////////////////// /// Contains `PhantomData<fn() -> T>`, /// required to return a `PhantomData<fn() -> T>` from the /// [`as_covariant_phantom`] const function. /// /// [`as_covariant_phantom`]: ./fn.as_covariant_phantom.html /// #[must_use = "unwrap this into a PhantomData with .0"] pub struct CovariantPhantomData<T: ?Sized>(pub PhantomData<fn() -> T>); impl<T: ?Sized> CovariantPhantomData<T> { /// Constructs a `CovariantPhantomData<T>` pub const NEW: Self = Self(PhantomData); } /// Gets the `PhantomData<fn() -> T>` of the passed in `T`. /// /// # Example /// #[cfg_attr(feature = "const_default", doc = " ```rust")] #[cfg_attr(not(feature = "const_default"), doc = " ```ignore")] /// use core_extensions::{AndPhantomCov, ConstDefault, as_covariant_phantom}; /// /// const SLICE: &[u8] = { /// let array = [0, 1, 2]; /// /// // phantom is a PhantomData<fn() -> [i32; 3]>; /// let phantom = as_covariant_phantom(&array).0; /// /// &AndPhantomCov(phantom, ConstDefault::DEFAULT).1 /// }; /// /// /// assert_eq!(SLICE, [0, 0, 0]); /// /// ``` /// pub const fn as_covariant_phantom<T: ?Sized>(_: &T) -> CovariantPhantomData<T> { CovariantPhantomData::NEW } /////////////////////////////////////////////////////////////////////////// /// A pair of `PhantomData<T>` and `T`. /// useful for infering the type of the value from a `PhantomData`. /// /// # Example /// /// ```rust /// use core_extensions::{AndPhantom, AsPhantomData}; /// /// use std::marker::PhantomData; /// /// let foo = vec![0, 1, 2]; /// /// let mut bar = AndPhantom(foo.as_phantom(), Default::default()).1; /// /// bar.push(3); /// bar.push(4); /// /// assert_eq!(bar[..], [3, 4]); /// /// ``` #[repr(transparent)] pub struct AndPhantom<T>(pub PhantomData<T>, pub T); /// A pair of `PhantomData<fn() -> T>` and `T`. /// useful for infering the type of the value from a `PhantomData`. /// /// # Example /// /// ```rust /// use core_extensions::{AndPhantomCov, AsPhantomData}; /// /// use std::marker::PhantomData; /// /// let foo = [0, 1, 2]; /// /// let mut bar = AndPhantomCov(foo.as_phantom_covariant(), Default::default()).1; /// /// bar[0] = 3; /// bar[1] = 5; /// bar[2] = 8; /// /// assert_eq!(bar[..], [3, 5, 8]); /// /// ``` #[repr(transparent)] pub struct AndPhantomCov<T>(pub PhantomData<fn() -> T>, pub T);
true
469df8f0f65b460738995cd7d99cc462176fb70e
Rust
erazor-de/ppatch
/src/searcher.rs
UTF-8
1,961
3.03125
3
[ "MIT" ]
permissive
use crate::{Pattern, PatternSearchType}; use std::fmt; use std::mem; use std::ops; pub struct Searcher<'a, T> { pattern: &'a Pattern<T>, matched: bool, data: Vec<T>, taken: usize, } impl<'a, T> Searcher<'a, T> where T: From<u8> + fmt::Binary + num::PrimInt + num::Unsigned + Default + ops::ShlAssign<u32> + PartialEq + num::PrimInt<FromStrRadixErr = std::num::ParseIntError> + ops::BitOrAssign + ops::BitAndAssign, { pub fn new(pattern: &'a Pattern<T>) -> Self { let capacity = pattern.len(); Self { pattern, matched: false, data: Vec::with_capacity(capacity), taken: 0, } } // Handles remaining data of a partial match pub fn handle_existing_data(&mut self) -> Option<PatternSearchType<T>> { if !self.data.is_empty() { let byte = self.data.remove(0); return Some(PatternSearchType::NonMatch(byte)); } None } // Handles next input byte. Needs to be called after handle_existing_data returns None and // returns None if byte is eaten as part of a possible match pub fn handle_next(&mut self, byte: T) -> Option<PatternSearchType<T>> { self.taken += 1; self.data.push(byte); if self.pattern.get(self.data.len() - 1).unwrap().matches(byte) { if self.data.len() == self.pattern.len() { self.matched = true; let mut other = Vec::with_capacity(self.pattern.len()); mem::swap(&mut other, &mut self.data); return Some(PatternSearchType::Match { data: other, index: self.taken - self.pattern.len(), }); } None } else { let byte = self.data.remove(0); Some(PatternSearchType::NonMatch(byte)) } } }
true
c2e82a8f09d984663533598839471ec5db9eed9d
Rust
MinaProtocol/mina
/src/lib/crypto/kimchi_bindings/stubs/src/arkworks/pasta_fq.rs
UTF-8
8,353
2.5625
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
use crate::arkworks::CamlBigInteger256; use crate::caml::caml_bytes_string::CamlBytesString; use ark_ff::ToBytes; use ark_ff::{FftField, Field, FpParameters, One, PrimeField, SquareRootField, UniformRand, Zero}; use ark_poly::{EvaluationDomain, Radix2EvaluationDomain as Domain}; use mina_curves::pasta::{fields::fq::FqParameters as Fq_params, Fq}; use num_bigint::BigUint; use rand::rngs::StdRng; use std::{ cmp::Ordering::{Equal, Greater, Less}, convert::{TryFrom, TryInto}, ops::Deref, }; // // Fq <-> CamlFq // #[derive(Clone, Copy, ocaml_gen::CustomType)] /// A wrapper type for [Pasta Fq](mina_curves::pasta::fq::Fq) pub struct CamlFq(pub Fq); unsafe impl<'a> ocaml::FromValue<'a> for CamlFq { fn from_value(value: ocaml::Value) -> Self { let x: ocaml::Pointer<Self> = ocaml::FromValue::from_value(value); *x.as_ref() } } impl CamlFq { unsafe extern "C" fn caml_pointer_finalize(v: ocaml::Raw) { let ptr = v.as_pointer::<Self>(); ptr.drop_in_place() } unsafe extern "C" fn ocaml_compare(x: ocaml::Raw, y: ocaml::Raw) -> i32 { let x = x.as_pointer::<Self>(); let y = y.as_pointer::<Self>(); match x.as_ref().0.cmp(&y.as_ref().0) { core::cmp::Ordering::Less => -1, core::cmp::Ordering::Equal => 0, core::cmp::Ordering::Greater => 1, } } } ocaml::custom!(CamlFq { finalize: CamlFq::caml_pointer_finalize, compare: CamlFq::ocaml_compare, }); // // Handy implementations // impl Deref for CamlFq { type Target = Fq; fn deref(&self) -> &Self::Target { &self.0 } } impl From<Fq> for CamlFq { fn from(x: Fq) -> Self { CamlFq(x) } } impl From<&Fq> for CamlFq { fn from(x: &Fq) -> Self { CamlFq(*x) } } impl From<CamlFq> for Fq { fn from(camlfq: CamlFq) -> Fq { camlfq.0 } } impl From<&CamlFq> for Fq { fn from(camlfq: &CamlFq) -> Fq { camlfq.0 } } impl TryFrom<CamlBigInteger256> for CamlFq { type Error = ocaml::Error; fn try_from(x: CamlBigInteger256) -> Result<Self, Self::Error> { Fq::from_repr(x.0) .map(Into::into) .ok_or(ocaml::Error::Message( "TryFrom<CamlBigInteger256>: integer is larger than order", )) } } // // Helpers // #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_size_in_bits() -> ocaml::Int { Fq_params::MODULUS_BITS as isize } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_size() -> CamlBigInteger256 { Fq_params::MODULUS.into() } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_add(x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) -> CamlFq { CamlFq(x.as_ref().0 + y.as_ref().0) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_sub(x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) -> CamlFq { CamlFq(x.as_ref().0 - y.as_ref().0) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_negate(x: ocaml::Pointer<CamlFq>) -> CamlFq { CamlFq(-x.as_ref().0) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_mul(x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) -> CamlFq { CamlFq(x.as_ref().0 * y.as_ref().0) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_div(x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) -> CamlFq { CamlFq(x.as_ref().0 / y.as_ref().0) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_inv(x: ocaml::Pointer<CamlFq>) -> Option<CamlFq> { x.as_ref().0.inverse().map(CamlFq) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_square(x: ocaml::Pointer<CamlFq>) -> CamlFq { CamlFq(x.as_ref().0.square()) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_is_square(x: ocaml::Pointer<CamlFq>) -> bool { let s = x.as_ref().0.pow(Fq_params::MODULUS_MINUS_ONE_DIV_TWO); s.is_zero() || s.is_one() } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_sqrt(x: ocaml::Pointer<CamlFq>) -> Option<CamlFq> { x.as_ref().0.sqrt().map(CamlFq) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_of_int(i: ocaml::Int) -> CamlFq { CamlFq(Fq::from(i as u64)) } // // Conversion methods // #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_to_string(x: ocaml::Pointer<CamlFq>) -> String { CamlBigInteger256(x.as_ref().into_repr()).to_string() } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_of_string(s: CamlBytesString) -> Result<CamlFq, ocaml::Error> { let biguint = BigUint::parse_bytes(s.0, 10).ok_or(ocaml::Error::Message( "caml_pasta_fq_of_string: couldn't parse input", ))?; let camlbigint: CamlBigInteger256 = biguint .try_into() .map_err(|_| ocaml::Error::Message("caml_pasta_fq_of_string: Biguint is too large"))?; CamlFq::try_from(camlbigint).map_err(|_| ocaml::Error::Message("caml_pasta_fq_of_string")) } // // Data methods // #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_print(x: ocaml::Pointer<CamlFq>) { println!( "{}", CamlBigInteger256(x.as_ref().0.into_repr()).to_string() ); } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_copy(mut x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) { *x.as_mut() = *y.as_ref() } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_mut_add(mut x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) { x.as_mut().0 += y.as_ref().0; } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_mut_sub(mut x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) { x.as_mut().0 -= y.as_ref().0; } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_mut_mul(mut x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) { x.as_mut().0 *= y.as_ref().0; } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_mut_square(mut x: ocaml::Pointer<CamlFq>) { x.as_mut().0.square_in_place(); } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_compare(x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) -> ocaml::Int { match x.as_ref().0.cmp(&y.as_ref().0) { Less => -1, Equal => 0, Greater => 1, } } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_equal(x: ocaml::Pointer<CamlFq>, y: ocaml::Pointer<CamlFq>) -> bool { x.as_ref().0 == y.as_ref().0 } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_random() -> CamlFq { let fq: Fq = UniformRand::rand(&mut rand::thread_rng()); CamlFq(fq) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_rng(i: ocaml::Int) -> CamlFq { // We only care about entropy here, so we force a conversion i32 -> u32. let i: u64 = (i as u32).into(); let mut rng: StdRng = rand::SeedableRng::seed_from_u64(i); let fq: Fq = UniformRand::rand(&mut rng); CamlFq(fq) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_to_bigint(x: ocaml::Pointer<CamlFq>) -> CamlBigInteger256 { CamlBigInteger256(x.as_ref().0.into_repr()) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_of_bigint(x: CamlBigInteger256) -> Result<CamlFq, ocaml::Error> { Fq::from_repr(x.0).map(CamlFq).ok_or_else(|| { let err = format!( "caml_pasta_fq_of_bigint was given an invalid CamlBigInteger256: {}", x.0 ); ocaml::Error::Error(err.into()) }) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_two_adic_root_of_unity() -> CamlFq { let res: Fq = FftField::two_adic_root_of_unity(); CamlFq(res) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_domain_generator(log2_size: ocaml::Int) -> Result<CamlFq, ocaml::Error> { Domain::new(1 << log2_size) .map(|x| CamlFq(x.group_gen)) .ok_or(ocaml::Error::Message("caml_pasta_fq_domain_generator")) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_to_bytes(x: ocaml::Pointer<CamlFq>) -> [u8; std::mem::size_of::<Fq>()] { let mut res = [0u8; std::mem::size_of::<Fq>()]; x.as_ref().0.write(&mut res[..]).unwrap(); res } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_of_bytes(x: &[u8]) -> Result<CamlFq, ocaml::Error> { let len = std::mem::size_of::<CamlFq>(); if x.len() != len { ocaml::Error::failwith("caml_pasta_fq_of_bytes")?; }; let x = unsafe { *(x.as_ptr() as *const CamlFq) }; Ok(x) } #[ocaml_gen::func] #[ocaml::func] pub fn caml_pasta_fq_deep_copy(x: CamlFq) -> CamlFq { x }
true
e5deea234b818d035e5914e490d3c5a4c4ba88c9
Rust
jimblandy/swgl-replay
/gl-replay/src/pixels.rs
UTF-8
6,669
3.21875
3
[]
no_license
//! Serializing and deserializing blocks of pixels. //! //! This module's `Pixels` type represents a rectangular block of pixels in //! memory (up to three dimensions), with an associated OpenGL format and pixel //! type. It can either borrow or own the pixels. //! //! A `Pixels` value can be serialized and deserialized using the `var` module's //! traits. Its serialized form is `PixelsForm`. use crate::{rle, var}; use gleam::gl; use image::{DynamicImage, ImageBuffer, Bgra, Rgba}; use std::borrow::Cow; use std::{io, mem, path}; /// A deserialized block of pixels. pub struct Pixels<'a> { /// Width of block, in pixels. pub width: usize, /// Height of the block, in pixels. pub height: usize, /// Depth of the block, in pixels. pub depth: usize, /// The format of the pixel data. /// /// This is interpreted the same way as the `format` argument to the OpenGL /// `glReadPixels` function, and must meet the same constraints. pub format: gl::GLenum, /// The type of the data. /// /// This is interpreted the same way as the `pixel_type` argument to the /// OpenGL `glReadPixels` function, and must meet the same constraints. pub pixel_type: gl::GLenum, /// The actual pixel content, as bytes. pub bytes: Cow<'a, [u8]>, } /// The serialization form for `Pixels`. /// /// The serialized form of a `Pixels` value must be four-byte aligned. It starts /// with `width`, `height`, `depth`, `format`, `pixel_type`, and the length of /// the compressed pixel data in bytes, all as unsigned LEB128 numbers, in that /// order, without padding. This is followed by the compressed pixel data /// itself. /// /// The exact serialization form for the pixels depends on their `format` and /// `pixel_type` values. /// /// - If each pixel is a single byte, then data is written as with /// `rle::write_rle_u8`. /// /// - If each pixel is a four-byte value, the stream is padded to a four-byte /// alignment boundary, and then written as by `rle::write_rle_u32`. The /// padding is not included in the compressed length. /// /// Other formats aren't yet supported, since we don't use them, but the `rle` /// module has generic functions that should make it easy. pub struct PixelsForm; impl var::Serialize for Pixels<'_> { type Form = PixelsForm; fn serialize<S: var::MarkedWrite>(&self, stream: &mut S) -> io::Result<usize> { stream.align_for::<u32>()?; let mark = stream.mark(); leb128::write::unsigned(stream, self.width as u64)?; leb128::write::unsigned(stream, self.height as u64)?; leb128::write::unsigned(stream, self.depth as u64)?; leb128::write::unsigned(stream, self.format as u64)?; leb128::write::unsigned(stream, self.pixel_type as u64)?; let bytes_per_pixel = gl::calculate_bytes_per_pixel(self.format, self.pixel_type); assert_eq!( bytes_per_pixel * self.width * self.height * self.depth, self.bytes.len() ); let mut compressed: Vec<u8> = Vec::new(); match bytes_per_pixel { 1 => { rle::write_u8(&mut compressed, &self.bytes)?; } 4 => { assert!(self.bytes.len() % mem::align_of::<u32>() == 0); let slice = unsafe { std::slice::from_raw_parts( self.bytes.as_ptr() as *const u32, self.bytes.len() / mem::size_of::<u32>(), ) }; rle::write_u32(&mut compressed, slice)?; } _ => todo!(), } leb128::write::unsigned(stream, compressed.len() as u64)?; if bytes_per_pixel == 4 { stream.align_for::<u32>()?; } stream.write_all(&compressed)?; Ok(mark) } } impl<'b> var::DeserializeAs<'b, Pixels<'static>> for PixelsForm { fn deserialize(buf: &mut &'b [u8]) -> Result<Pixels<'static>, var::DeserializeError> { let width = leb128::read::unsigned(buf)? as usize; let height = leb128::read::unsigned(buf)? as usize; let depth = leb128::read::unsigned(buf)? as usize; let format = leb128::read::unsigned(buf)? as gl::GLenum; let pixel_type = leb128::read::unsigned(buf)? as gl::GLenum; let compressed_length = leb128::read::unsigned(buf)? as usize; let bytes_per_pixel = gl::calculate_bytes_per_pixel(format, pixel_type); assert_eq!(compressed_length % bytes_per_pixel, 0); let bytes = match bytes_per_pixel { 1 => rle::read_u8(buf)?, 4 => { let mut words: &[u32] = var::borrow_aligned_slice(buf, compressed_length / 4)?; rle::read_u32(&mut words)? } _ => todo!(), }; assert_eq!(bytes.len(), bytes_per_pixel * width * height * depth); Ok(Pixels { width, height, depth, format, pixel_type, bytes: bytes.into(), }) } } impl Pixels<'_> { pub fn write_image<P: AsRef<path::Path>>(&self, path: P) { if self.depth != 1 { eprintln!("Warning: skipping deep image '{}'", path.as_ref().display()); return; } let image = match (self.format, self.pixel_type) { (gl::RGBA, gl::UNSIGNED_BYTE) => { let image = ImageBuffer::<Rgba<u8>, Vec<u8>>::from_raw(self.width as u32, self.height as u32, self.bytes.as_ref().to_owned()) .expect("failed to construct image"); DynamicImage::ImageRgba8(image) } (gl::BGRA, gl::UNSIGNED_BYTE) => { let image = ImageBuffer::<Bgra<u8>, Vec<u8>>::from_raw(self.width as u32, self.height as u32, self.bytes.as_ref().to_owned()) .expect("failed to construct image"); DynamicImage::ImageBgra8(image) } _ => panic!( "gl-replay: Pixels::write_image: \ unsupported format/pixel type combination: 0x{:x}, 0x{:x}", self.format, self.pixel_type ), }; let image = image.into_rgba(); image.save(path) .expect("gl-replay: write_image: error creating file"); } }
true
00332591018b1e5d74136211fc532718ca99fce3
Rust
alvaro7rlz/rust-cql
/src/error.rs
UTF-8
1,142
2.546875
3
[]
no_license
extern crate std; use std::net::{Ipv4Addr,Ipv6Addr,SocketAddr,IpAddr}; use uuid::Uuid; use std::borrow::Cow; use std::ops::Deref; use std::error::Error; use def::CowStr; #[derive(Debug,Clone)] pub enum RCErrorType { ReadError, WriteError, SerializeError, ConnectionError, NoDataError, GenericError, IOError, EventLoopError, ClusterError } #[derive(Debug,Clone)] pub struct RCError { pub kind: RCErrorType, pub desc: CowStr, } impl RCError { pub fn new<S: Into<CowStr>>(msg: S, kind: RCErrorType) -> RCError { RCError { kind: kind, desc: msg.into() } } pub fn description(&self) -> &str { return self.desc.deref(); } } impl std::error::Error for RCError { fn description(&self) -> &str { return self.desc.deref(); } fn cause(&self) -> Option<&std::error::Error> { return None; } } impl std::fmt::Display for RCError { fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { write!(f, "Error: {}", self.desc) } } pub type RCResult<T> = Result<T, RCError>;
true
373b10bd10b4cc678661e3e77b7500138f11eaae
Rust
fabiojmendes/rust-game
/src/main.rs
UTF-8
3,025
3.03125
3
[]
no_license
use std::thread; use std::time::{Duration, Instant}; use sdl2::event::Event; use sdl2::keyboard::Keycode; use sdl2::pixels::Color; use sdl2::render::{Texture, WindowCanvas}; // "self" imports the "image" module itself as well as everything else we listed use sdl2::image::{self, InitFlag, LoadTexture}; use sdl2::rect::{Point, Rect}; #[derive(Debug)] struct Player { position: Point, sprite: Rect, } impl Player { const FRAMES: i32 = 4; const ANIMATION_TIME: i32 = 120; fn update(&mut self, ticks: Duration) { println!("Ticks: {:?}", ticks); let col: i32 = (ticks.as_millis() as i32 / Player::ANIMATION_TIME % Player::FRAMES) * 64; self.sprite = Rect::new(col, 0, 64, 64); } } fn render( canvas: &mut WindowCanvas, color: Color, texture: &Texture, player: &Player, ) -> Result<(), String> { canvas.set_draw_color(color); canvas.clear(); let (width, height) = canvas.output_size()?; // Treat the center of the screen as the (0, 0) coordinate let screen_position = player.position + Point::new(width as i32 / 2, height as i32 / 2); let screen_rect = Rect::from_center( screen_position, player.sprite.width(), player.sprite.height(), ); canvas.copy(texture, player.sprite, screen_rect)?; canvas.present(); Ok(()) } fn main() -> Result<(), String> { let sdl_context = sdl2::init()?; let video_subsystem = sdl_context.video()?; // Leading "_" tells Rust that this is an unused variable that we don't care about. It has to // stay unused because if we don't have any variable at all then Rust will treat it as a // temporary value and drop it right away! let _image_context = image::init(InitFlag::PNG | InitFlag::JPG)?; let window = video_subsystem .window("game tutorial", 800, 600) .position_centered() .build() .expect("could not build video subsystem"); let mut canvas = window .into_canvas() .build() .expect("could not build canvas 2"); let texture_creator = canvas.texture_creator(); let texture = texture_creator.load_texture("assets/jeff-sprite.png")?; let mut player = Player { position: Point::new(0, 0), sprite: Rect::new(0, 0, 64, 64), }; let start = Instant::now(); let mut event_pump = sdl_context.event_pump()?; let mut i = 0; 'running: loop { for event in event_pump.poll_iter() { match event { Event::Quit { .. } | Event::KeyDown { keycode: Some(Keycode::Escape), .. } => break 'running, _ => {} } } // Update i = (i + 1) % 255; player.update(start.elapsed()); // Render render(&mut canvas, Color::RGB(i, 64, 255 - i), &texture, &player)?; // Time Mgmt thread::sleep(Duration::new(0, 1_000_000_000u32 / 60)); } Ok(()) }
true
317bf1de16467fbeae40dccf3617a08ba64d33c6
Rust
AlexHart/rust-book
/slices/src/main.rs
UTF-8
1,241
4.09375
4
[]
no_license
fn main() { let s = String::from("Lorem ipsum dolor sit amet"); let hello = &s[0..5]; let world = &s[6..11]; println!("{} {}", hello, world); let fw = first_word(&s); println!("First word: {}", fw); let sw = second_word(&s); println!("Second word: {}", sw); // Vec slices examples let nums: Vec<i32> = vec!(1, 2, 3, 45, 234, 123); let nums_slice = &nums[2..4]; print_nums_slice(nums_slice); let nums_slice = &nums[3..]; print_nums_slice(nums_slice); let nums_slice = &nums[..5]; print_nums_slice(nums_slice); } fn print_nums_slice(nums_slice: &[i32]){ println!("--------------------------------"); println!("Print slice of numbers with length: {}", nums_slice.len()); for num in nums_slice { println!("Num in slice: {}", num); } } fn first_word(s: &str) -> &str { let bytes = s.as_bytes(); for (i, &item) in bytes.iter().enumerate() { if item == b' ' { return &s[0..i]; } } &s[..] } fn second_word(s: &str) -> &str { let bytes = s.as_bytes(); for (i, &item) in bytes.iter().enumerate() { if item == b' ' { return first_word(&s[i + 1..]); } } &s[..] }
true
b84e701208911963c56d11958662b555830f46ff
Rust
bbqsrc/export
/export_test/src/lib.rs
UTF-8
517
3.0625
3
[]
no_license
#[export::unstable] /// Have some docs /// /// Have some anger fn lolwut() { println!("yes"); } #[must_use] pub fn lolwut2() { println!("yes"); } #[export::unstable] fn lolwut3() { println!("yes"); } #[export::unstable] /// If I document this /// /// Is it happy? mod lolmod { #[export::unstable] fn lolwut4() {} } #[export::unstable] /// They see my struct, they hatin' pub(crate) struct Foo {} impl Foo { #[export::unstable] /// A dangerous function with no plan. fn bar() {} }
true
4036a9f7fd555c94ca9aba913bdf4a02b6a43faf
Rust
oc-soft/glrs
/src/geom/d2.rs
UTF-8
6,806
2.75
3
[]
no_license
use crate::geom; use crate::geom::GeomError; use crate::Segment; pub struct D2 {} impl D2 { /// move each points offset along to line(p1 p2) normal vector pub fn offset_points_0( offset: f64, p1: &[f64], p2: &[f64], tolerance: f64, ) -> Result<[Vec<f64>; 2], GeomError> { if p1.len() > 1 && p2.len() > 1 { let p1_d2 = vec![p1[0], p1[1]]; let p2_d2 = vec![p2[0], p2[1]]; let d = geom::minus(&p2_d2, &p1_d2).unwrap(); let d_len = geom::length(&d).unwrap(); if d_len > tolerance { let n_vec = vec![-d[1] / d_len, d[0] / d_len]; let disp = geom::scale(offset, &n_vec); let result = [ geom::plus(&p1_d2, &disp).unwrap(), geom::plus(&p2_d2, &disp).unwrap(), ]; Ok(result) } else { Err(GeomError) } } else { Err(GeomError) } } /// move each points offset along to line(p1 p2) normal vector pub fn offset_points( offset: f64, p1: &[f64], p2: &[f64], ) -> Result<[Vec<f64>; 2], GeomError> { Self::offset_points_0(offset, p1, p2, 0.0) } /// move all of points with offset displacement pub fn offset_points_vec_0( offset: f64, points: &[Vec<f64>], close: bool, tolerance: f64, ) -> Result<Vec<Vec<f64>>, GeomError> { if points.len() > 1 { let end_idx; let mut state; if close { end_idx = points.len(); } else { end_idx = points.len() - 1; } let res_0; res_0 = Self::offset_points_0( offset, &points[0], &points[1], tolerance, ); state = true; let mut end_pt_ref: Option<Vec<f64>> = None; let mut offset_points: Vec<Vec<f64>> = Vec::with_capacity(points.len()); if let Ok(pts) = res_0 { offset_points.push(Self::dup_vec(&pts[0])); end_pt_ref = Some(Self::dup_vec(&pts[1])); } else { state = false; } if state { let mut first_seg_ref: Option<Segment> = None; let mut last_pts: Option<[Vec<f64>; 2]>; { let end_pt = end_pt_ref.unwrap(); last_pts = Some([ Self::dup_vec(&offset_points[0]), Self::dup_vec(&end_pt), ]); end_pt_ref = Some(end_pt); } for idx in 1..end_idx { let res_1 = Self::offset_points_0( offset, &points[(idx) % points.len()], &points[(idx + 1) % points.len()], tolerance, ); if let Ok(pts_1) = res_1 { let pts_0 = last_pts.unwrap(); let seg_res_0 = Segment::create_1(&pts_0[0], &pts_0[1]); let seg_res_1 = Segment::create_1(&pts_1[0], &pts_1[1]); last_pts = Some(pts_1); match (seg_res_0, seg_res_1) { (Ok(seg_0), Ok(seg_1)) => { let cross_res = seg_0 .cross_point_parameter_2d_0( &seg_1, tolerance, ); if let Some(pt_params) = cross_res { offset_points .push(seg_0.point_on_t(pt_params[0])) } else { offset_points .push(Self::dup_vec(&pts_0[1])); } if idx == 1 { first_seg_ref = Some(seg_0); } if idx == end_idx - 1 { if close { let first_seg = first_seg_ref.unwrap(); let cross_res = seg_1 .cross_point_parameter_2d_0( &first_seg, tolerance, ); first_seg_ref = Some(first_seg); if let Some(pt_params) = cross_res { end_pt_ref = Some( seg_1.point_on_t(pt_params[0]), ); } else { state = false; break; } } else { let pts_1 = last_pts.unwrap(); end_pt_ref = Some(Self::dup_vec(&pts_1[1])); last_pts = Some(pts_1); } } } _ => { state = false; break; } } } } } if state { if let Some(pt) = end_pt_ref { if close { offset_points[0] = pt; } else { offset_points.push(pt); } } } if state { Ok(offset_points) } else { Err(GeomError) } } else { Err(GeomError) } } /// move all of points with offset displacement pub fn offset_points_vec( offset: f64, points: &[Vec<f64>], close: bool, ) -> Result<Vec<Vec<f64>>, GeomError> { Self::offset_points_vec_0(offset, points, close, 0.0) } fn dup_vec(source: &[f64]) -> Vec<f64> { let mut result = Vec::with_capacity(source.len()); result.extend_from_slice(source); result } } // vi: se ts=4 sw=4 et:
true
a2950bb88bf8385099e5e0f43ef6ec3ef66da516
Rust
iCodeIN/Lil.rs
/src/main.rs
UTF-8
2,658
2.953125
3
[ "Apache-2.0" ]
permissive
use std::io; use std::io::Write; mod ast; mod lexer; mod parser; mod typer; mod source_map; mod type_map; mod error; use crate::parser::Parser; use crate::parser::Error; use crate::typer::TypeChecker; use crate::source_map::SourceMap; use crate::type_map::TypeMap; use crate::error::SyntaxError; use crate::ast::AbstractSyntaxTree; fn main() { repl(); } fn repl() { let stdin = io::stdin(); let mut stdout = io::stdout(); // Buffer to hold input before parsing. let mut input = String::new(); // let mut ast = AbstractSyntaxTree::new(); // loop { write!(stdout,"> "); stdout.flush(); // Read input line stdin.read_line(&mut input); let line = input.as_str(); // Construct temporary source map let mut source_map = SourceMap::new(line); // Construct temporary type map let mut type_map = TypeMap::new(); // Parse it! let d = Parser::new(line, &mut ast, |i,s| source_map.map(i,s)).parse_decl(); // if d.is_err() { print_error(line,d.err().unwrap()); } else { let ast = d.ok().unwrap(); // println!("Parsed: {}",&ast); // // Now type check it! // let typing = TypeChecker::new(|i,t| type_map.map(i,t)).check(&ast); // // // if typing.is_err() { // print_syntax_error(&typing.err().unwrap(), &source_map); // } else { // println!("Type checking suceeded"); // } } // input.clear(); } } fn print_error(line: &str, err: Error) { println!("error:{}: {}",err.start,err.message); println!(); print!("{}",line); print_highlight(line,err.start,err.end); } fn print_syntax_error<'a>(err: &SyntaxError, map: &SourceMap<'a>) { println!("error: {}",err.errno); // Determine the highlight let hl = map.get_highlight(err.node); // Print the enclosing line print!("{}",hl.line); // Highlight relevant section print_highlight(hl.line,hl.start,hl.end); } fn print_highlight<'a>(line: &'a str, start: usize, end: usize) { // Convert the given line into equivalent whitespace let indent = to_whitespace(line,start); // Print out preamble print!("{}",indent); // for i in start .. end { print!("^"); } println!(""); } /// Convert the start of a given line into corresponding whitespace. /// This is pretty straightforward, where most characters are simply /// converted into spaces. However, in some cases, we want to keep /// the character as is (e.g. for a tab). fn to_whitespace(line: &str, offset: usize) -> String { // Personally, a loop has more clarity than this jiberish :) line.char_indices().filter(|s| s.0 < offset).map(|s| " ").collect() }
true
68c39db03303ab46ef3e822f3cac40694b4c8e7f
Rust
nathanfaucett/rs-scene_renderer
/tests/test.rs
UTF-8
2,984
2.625
3
[ "MIT" ]
permissive
#![feature(alloc)] #![feature(collections)] #![no_std] extern crate alloc; extern crate collections; extern crate shared; extern crate scene_graph; extern crate scene_renderer; use shared::Shared; use scene_graph::{Id, Scene}; use scene_renderer::{SceneRenderer, Renderer, Plugin}; struct SomeRendererData { scene_renderer: Option<SceneRenderer>, } #[derive(Clone)] pub struct SomeRenderer { data: Shared<SomeRendererData>, } impl SomeRenderer { pub fn new() -> Self { SomeRenderer { data: Shared::new(SomeRendererData { scene_renderer: None, }) } } } impl Renderer for SomeRenderer { fn get_id(&self) -> Id { Id::of::<SomeRenderer>() } fn get_scene_renderer(&self) -> Option<SceneRenderer> { self.data.scene_renderer.clone() } fn set_scene_renderer(&mut self, renderer: Option<SceneRenderer>) { self.data.scene_renderer = renderer; } fn get_order(&self) -> usize { 0 } fn init(&mut self) {} fn clear(&mut self) {} fn before_render(&mut self) {} fn after_render(&mut self) {} fn render(&mut self) {} } impl PartialEq<SomeRenderer> for SomeRenderer { fn eq(&self, other: &SomeRenderer) -> bool { (&*self.data as *const _) == (&*other.data as *const _) } fn ne(&self, other: &SomeRenderer) -> bool { !self.eq(other) } } struct SomePluginData { scene_renderer: Option<SceneRenderer>, } #[derive(Clone)] pub struct SomePlugin { data: Shared<SomePluginData>, } impl SomePlugin { pub fn new() -> Self { SomePlugin { data: Shared::new(SomePluginData { scene_renderer: None, }) } } } impl Plugin for SomePlugin { fn get_id(&self) -> Id { Id::of::<SomePlugin>() } fn get_scene_renderer(&self) -> Option<SceneRenderer> { self.data.scene_renderer.clone() } fn set_scene_renderer(&mut self, scene_renderer: Option<SceneRenderer>) { self.data.scene_renderer = scene_renderer; } fn get_order(&self) -> usize {0} fn clear(&mut self) {} fn init(&mut self) {} fn before_render(&mut self) {} fn after_render(&mut self) {} } #[test] fn test_scene() { let mut scene = Scene::new(); let mut scene_renderer = SceneRenderer::new(scene.clone()); let some_renderer = SomeRenderer::new(); let plugin = SomePlugin::new(); scene_renderer.add_plugin(plugin); assert_eq!(scene_renderer.has_plugin::<SomePlugin>(), true); scene_renderer.add_renderer(some_renderer.clone()); assert_eq!(scene_renderer.has_renderer::<SomeRenderer>(), true); let renderer = scene_renderer.get_renderer::<SomeRenderer>().unwrap(); assert_eq!(renderer == some_renderer, true); scene.init(); scene_renderer.init(); scene_renderer.render(); scene_renderer.remove_renderer::<SomeRenderer>(); assert_eq!(scene_renderer.has_renderer::<SomeRenderer>(), false); }
true
5559630c3c01b1537c3952b2bb64beeb4beab319
Rust
SoundRabbit/soldoresol
/src/arena.org/block/character.rs
UTF-8
9,904
2.90625
3
[]
no_license
use super::block_trait::DisplayNamed; use super::BlockId; use crate::arena::resource::ResourceId; use crate::libs::color::Pallet; use crate::libs::select_list::SelectList; #[derive(Clone)] pub struct CharacterTexture { name: String, texture_id: Option<ResourceId>, height: f32, } #[derive(Clone)] pub struct Character { size: f32, name: String, display_name: String, description: String, position: [f32; 3], textures: SelectList<CharacterTexture>, properties: Vec<BlockId>, name_color: Pallet, } impl Character { pub fn new() -> Self { Self { size: 1.0, name: String::from(""), display_name: String::from(""), description: String::from(""), position: [0.0, 0.0, 0.0], textures: SelectList::new( vec![CharacterTexture { name: String::from("[default]"), texture_id: None, height: 1.0, }], 0, ), properties: vec![], name_color: Pallet::gray(9).a(100), } } pub fn size(&self) -> f32 { self.size } pub fn set_size(&mut self, size: f32) { self.size = size; } pub fn current_tex_height(&self) -> f32 { if let Some(tex) = self.textures.selected() { tex.height } else { 1.0 } } pub fn set_tex_height(&mut self, tex_idx: usize, height: f32) { if let Some(tex) = self.textures.get_mut(tex_idx) { tex.height = height; } } pub fn current_tex_id(&self) -> Option<&ResourceId> { if let Some(tex) = self.textures.selected() { tex.texture_id.as_ref() } else { None } } pub fn set_tex_id(&mut self, tex_idx: usize, tex_id: Option<ResourceId>) { if let Some(tex) = self.textures.get_mut(tex_idx) { tex.texture_id = tex_id; } } pub fn name(&self) -> &String { &self.name } pub fn set_name(&mut self, name: String) { self.name = name; } pub fn display_name(&self) -> &String { &self.display_name } pub fn set_display_name(&mut self, display_name: String) { self.display_name = display_name; } pub fn name_color(&self) -> &Pallet { &self.name_color } pub fn set_name_color(&mut self, color: Pallet) { self.name_color = color; } pub fn description(&self) -> &String { &self.description } pub fn set_description(&mut self, description: String) { self.description = description; } pub fn position(&self) -> &[f32; 3] { &self.position } pub fn set_position(&mut self, position: [f32; 3]) { self.position = position; } pub fn tex_names(&self) -> Vec<&str> { self.textures.iter().map(|tex| tex.name.as_str()).collect() } pub fn current_tex_name(&self) -> &str { self.textures .selected() .map(|tex| tex.name.as_str()) .unwrap_or("") } pub fn current_tex_idx(&self) -> usize { self.textures.selected_idx() } pub fn set_current_tex_idx(&mut self, idx: usize) { self.textures.set_selected_idx(idx); } pub fn add_tex_to_select(&mut self) { self.textures.push(CharacterTexture { name: String::from("新規立ち絵"), texture_id: None, height: self.size, }); self.textures.set_selected_idx(self.textures.len() - 1); } pub fn remove_tex(&mut self, tex_idx: usize) { if self.textures.len() > 1 { self.textures.remove(tex_idx); if self.textures.selected_idx() >= self.textures.len() { self.textures.set_selected_idx(self.textures.len() - 1); } } } pub fn set_tex_name(&mut self, tex_idx: usize, tex_name: String) { if let Some(tex) = self.textures.get_mut(tex_idx) { tex.name = tex_name; } } pub fn properties(&self) -> impl Iterator<Item = &BlockId> { self.properties.iter() } pub fn add_property(&mut self, property_id: BlockId) { self.properties.push(property_id); } } impl DisplayNamed for Character { fn display_name(&self) -> &String { self.display_name() } fn set_display_name(&mut self, name: String) { self.set_display_name(name); } } impl CharacterTexture { async fn pack_to_toml(&self) -> toml::Value { let mut packed = toml::value::Table::new(); packed.insert(String::from("name"), toml::Value::String(self.name.clone())); if let Some(texture_id) = &self.texture_id { packed.insert( String::from("texture_id"), toml::Value::String(texture_id.to_string()), ); } packed.insert( String::from("height"), toml::Value::Float(self.height as f64), ); toml::Value::Table(packed) } async fn unpack_from_toml(packed: toml::Value) -> Self { let mut unpacked = Self { name: String::new(), texture_id: None, height: 1.0, }; if let toml::Value::Table(mut packed) = packed { if let Some(toml::Value::String(name)) = packed.remove("name") { unpacked.name = name; } if let Some(toml::Value::String(texture_id)) = packed.remove("texture_id") { if let Some(texture_id) = ResourceId::from_str(&texture_id) { unpacked.texture_id = Some(texture_id); } } if let Some(toml::Value::Float(height)) = packed.remove("height") { unpacked.height = height as f32; } } unpacked } } impl Character { pub async fn pack_to_toml(&self) -> toml::Value { let mut packed = toml::value::Table::new(); packed.insert(String::from("size"), toml::Value::Float(self.size as f64)); packed.insert(String::from("name"), toml::Value::String(self.name.clone())); packed.insert( String::from("description"), toml::Value::String(self.description.clone()), ); packed.insert( String::from("display_name"), toml::Value::String(self.display_name.clone()), ); let props = { let mut props = toml::value::Array::new(); for prop_id in self.properties.iter() { props.push(toml::Value::String(prop_id.to_string())); } props }; packed.insert(String::from("propaties"), toml::Value::Array(props)); let textures = { let mut textures = toml::value::Table::new(); textures.insert( String::from("_selected_idx"), toml::Value::Integer(self.textures.selected_idx() as i64), ); let payload = { let mut payload = toml::value::Array::new(); for texture in self.textures.iter() { payload.push(texture.pack_to_toml().await); } payload }; textures.insert(String::from("_payload"), toml::Value::Array(payload)); textures }; packed.insert(String::from("textures"), toml::Value::Table(textures)); toml::Value::Table(packed) } pub async fn unpack_from_toml(packed: toml::Value) -> Self { let mut unpacked = Self::new(); if let toml::Value::Table(mut packed) = packed { if let Some(toml::Value::Float(size)) = packed.remove("size") { unpacked.size = size as f32; } if let Some(toml::Value::String(name)) = packed.remove("name") { unpacked.name = name; } if let Some(toml::Value::String(description)) = packed.remove("description") { unpacked.description = description; } if let Some(toml::Value::String(display_name)) = packed.remove("display_name") { unpacked.display_name = display_name; } if let Some(toml::Value::Array(packed_props)) = packed.remove("propaties") { let mut props = vec![]; for packed_prop_id in packed_props { if let toml::Value::String(prop_id) = packed_prop_id { if let Some(prop_id) = BlockId::from_str(&prop_id) { props.push(prop_id); } } } unpacked.properties = props; } if let Some(toml::Value::Table(mut textures)) = packed.remove("textures") { let selected_idx = if let Some(toml::Value::Integer(x)) = textures.remove("_selected_idx") { x.max(0) as usize } else { 0 }; let payload = if let Some(toml::Value::Array(textures)) = textures.remove("_payload") { let mut payload = vec![]; for texture in textures { payload.push(CharacterTexture::unpack_from_toml(texture).await); } payload } else { vec![] }; if payload.len() > 0 { let selected_idx = selected_idx.min(payload.len()); unpacked.textures = SelectList::new(payload, selected_idx); } } } unpacked } }
true
52b63947742f76fb45929ae19f9785d27cb7d9c7
Rust
rm-rf-etc/basic_ml_in_rust
/src/shared.rs
UTF-8
384
2.765625
3
[]
no_license
use super::ml::Matrix2D; #[allow(dead_code)] pub fn round(f: f32) -> f32 { let prec = 100000.0; (f * prec).round() / prec } #[allow(dead_code)] pub fn assert_matrices_eq(mat: &Matrix2D, exp_mat: &Matrix2D) { let y = mat.shape()[0]; let x = mat.shape()[1]; for (i, j) in (0..y).zip(0..x) { assert_eq!(round(mat[[i, j]]), round(exp_mat[[i, j]])); } }
true
87224fd3b23c50c6941404e062ce50e43c05af04
Rust
iambotHQ/zalando-api-client
/src/models/brand.rs
UTF-8
2,857
2.53125
3
[]
no_license
/* * Zalando Shop API * * The shop API empowers developers to build amazing new apps or websites using Zalando shop data and services. * * OpenAPI spec version: v1.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git */ /// Brand : Zalando API Brand Schema #[derive(Debug, Serialize, Deserialize, Clone)] pub struct Brand { /// The unique key for a brand #[serde(rename = "key")] key: String, /// Name of the brand #[serde(rename = "name")] name: String, /// The url of the brand within the Zalando web shop #[serde(rename = "shopUrl")] shop_url: String, /// The url of the brand logo within the Zalando web shop #[serde(rename = "logoUrl")] logo_url: Option<String>, /// The url of the large brand logo within the Zalando web shop #[serde(rename = "logoLargeUrl")] logo_large_url: Option<String>, #[serde(rename = "brandFamily")] brand_family: Option<::models::BrandFamily> } impl Brand { /// Zalando API Brand Schema pub fn new(key: String, name: String, shop_url: String) -> Brand { Brand { key: key, name: name, shop_url: shop_url, logo_url: None, logo_large_url: None, brand_family: None } } pub fn set_key(&mut self, key: String) { self.key = key; } pub fn with_key(mut self, key: String) -> Brand { self.key = key; self } pub fn key(&self) -> &String { &self.key } pub fn set_name(&mut self, name: String) { self.name = name; } pub fn with_name(mut self, name: String) -> Brand { self.name = name; self } pub fn name(&self) -> &String { &self.name } pub fn set_shop_url(&mut self, shop_url: String) { self.shop_url = shop_url; } pub fn with_shop_url(mut self, shop_url: String) -> Brand { self.shop_url = shop_url; self } pub fn shop_url(&self) -> &String { &self.shop_url } pub fn set_logo_url(&mut self, logo_url: String) { self.logo_url = Some(logo_url); } pub fn with_logo_url(mut self, logo_url: String) -> Brand { self.logo_url = Some(logo_url); self } pub fn logo_url(&self) -> &Option<String> { &self.logo_url } pub fn set_logo_large_url(&mut self, logo_large_url: String) { self.logo_large_url = Some(logo_large_url); } pub fn with_logo_large_url(mut self, logo_large_url: String) -> Brand { self.logo_large_url = Some(logo_large_url); self } pub fn logo_large_url(&self) -> &Option<String> { &self.logo_large_url } pub fn set_brand_family(&mut self, brand_family: ::models::BrandFamily) { self.brand_family = Some(brand_family); } pub fn with_brand_family(mut self, brand_family: ::models::BrandFamily) -> Brand { self.brand_family = Some(brand_family); self } pub fn brand_family(&self) -> &Option<::models::BrandFamily> { &self.brand_family } }
true
9d6cf3fc71071e5eb81d63d8fabf2d75a7968113
Rust
gba-rs/gba-emu
/src/thumb_formats/multiple_load_store.rs
UTF-8
5,293
3.015625
3
[ "Apache-2.0", "MIT" ]
permissive
use crate::operations::instruction::Instruction; use crate::cpu::{cpu::CPU, cpu::THUMB_PC}; use crate::memory::memory_bus::MemoryBus; use std::fmt; pub struct MultipleLoadStore { pub opcode: u8, pub rb: u8, pub register_list: Vec<u8>, pub load: bool } impl From<u16> for MultipleLoadStore { fn from(value: u16) -> MultipleLoadStore { let mut temp_reg_list: Vec<u8> = vec![]; for i in 0..8 { if ((value >> i) & 0x01) != 0{ temp_reg_list.push(i as u8); } } return MultipleLoadStore { register_list: temp_reg_list, rb: ((value >> 8) & 0x7) as u8, opcode: ((value >> 11) & 0x1) as u8, load: ((value & 0x800) >> 11) != 0 }; } } impl Instruction for MultipleLoadStore { fn execute(&self, cpu: &mut CPU, mem_bus: &mut MemoryBus) -> u32 { let base = cpu.get_register(self.rb); let mut offset = 0; if self.load { if self.register_list.len() == 0 { cpu.set_register(THUMB_PC, mem_bus.read_u32(base)); cpu.set_register(self.rb, base + 0x40); } else { for reg_num in self.register_list.iter() { let value = mem_bus.read_u32(base + offset); cpu.set_register(*reg_num, value); offset += 4; } cpu.set_register(self.rb, base + offset); } } else { if self.register_list.len() == 0 { mem_bus.write_u32(base, cpu.get_register(THUMB_PC) + 4); cpu.set_register(self.rb, base + 0x40); } else { for reg_num in self.register_list.iter() { let value = cpu.get_register(*reg_num); if *reg_num == self.rb { if *reg_num == self.register_list[0] { //old mem_bus.write_u32(base + offset, value); } else { //new mem_bus.write_u32(base + offset, base + (4 * self.register_list.len() as u32)); } } else { mem_bus.write_u32(base + offset, value); } offset += 4; } cpu.set_register(self.rb, base + offset); } } mem_bus.cycle_clock.get_cycles() } fn asm(&self) -> String{ return format!("{:?}", self); } fn cycles(&self) -> u32 {return 3;} // Normal LDM instructions take nS + 1N + 1I and LDM PC takes (n+1)S + 2N + 1I //STM instructions take (n-1)S + 2N incremental cycles to execute, where n is the number of words transferred. } impl fmt::Debug for MultipleLoadStore { fn fmt( & self, f: & mut fmt::Formatter < '_ > ) -> fmt::Result { if self.load { write!(f, "LDMIA r{}!, {{", self.rb)?; } else { write!(f, "STMIA r{}!, {{", self.rb)?; } for reg_num in self.register_list.iter() { write!(f, " r{} ", *reg_num)?; } write!(f, "}}") } } #[cfg(test)] mod tests { use super::*; use crate::gba::GBA; use crate::cpu::{cpu::InstructionSet}; use std::borrow::{BorrowMut}; #[test] fn stmia_test() { let mut gba: GBA = GBA::default(); gba.cpu.set_instruction_set(InstructionSet::Thumb); for i in 0..8 { gba.cpu.set_register(i, (i as u32) * 100); } let base = 0x02000000; gba.cpu.set_register(2, base); // Store, rb = 2, rlist = {1, 3, 5, 7} // STMIA r2!, {1, 3, 5, 7} let decode_result = gba.cpu.decode(0xC2AA); match decode_result { Ok(mut instr) => { (instr.borrow_mut() as &mut dyn Instruction).execute(&mut gba.cpu, &mut gba.memory_bus); }, Err(e) => { panic!("{:?}", e); } } assert_eq!(100, gba.memory_bus.mem_map.read_u32(base)); assert_eq!(300, gba.memory_bus.mem_map.read_u32(base + 4)); assert_eq!(500, gba.memory_bus.mem_map.read_u32(base + 8)); assert_eq!(700, gba.memory_bus.mem_map.read_u32(base + 12)); } #[test] fn ldmia_test() { let mut gba: GBA = GBA::default(); gba.cpu.set_instruction_set(InstructionSet::Thumb); let base = 0x02000000; for i in 0..8 { gba.memory_bus.mem_map.write_u32(0x02000000 + (i * 4), (100 * i) as u32); } gba.cpu.set_register(2, base); // Load, rb = 2, rlist = {1, 3, 5, 7} // LDMIA r2!, {1, 3, 5, 7} let decode_result = gba.cpu.decode(0xCAAA); match decode_result { Ok(mut instr) => { (instr.borrow_mut() as &mut dyn Instruction).execute(&mut gba.cpu, &mut gba.memory_bus); }, Err(e) => { panic!("{:?}", e); } } assert_eq!(0, gba.cpu.get_register(1)); assert_eq!(100, gba.cpu.get_register(3)); assert_eq!(200, gba.cpu.get_register(5)); assert_eq!(300, gba.cpu.get_register(7)); } }
true
a8464339d6a1e3ab076e015edb6f726e7f99907e
Rust
Fiedzia/rust-instrumentation
/src/instrumentation/utils.rs
UTF-8
406
3.5625
4
[]
no_license
pub fn dotsplit(s:~str) -> (~str, Option<~str>) { //! Split string s into two parts, separated by first . character. //! This functions assumes that s is not empty //! ie. ~"foo.bar" -> ~"foo", Some(~"bar") //! ~"foo" -> ~"foo", None match s.find_str(&".") { None => (s, None), Some(idx) => (s.slice(0, idx).to_owned(), Some(s.slice(idx+1, s.len()).to_owned())) } }
true
1703b7f7f27620d71bba67955c06ceb68d7bc6e2
Rust
bombless/rusti
/tests/repl.rs
UTF-8
1,570
3.34375
3
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
use std::process::Command; fn repl_run(args: &[&str]) -> String { let rusti = if cfg!(windows) { "target/debug/rusti.exe" } else { "target/debug/rusti" }; match Command::new(rusti).args(args).env("HOME", "data").output() { Ok(out) => String::from_utf8(out.stdout).unwrap(), Err(e) => panic!("failed to spawn process: {}", e) } } fn repl_cmd(cmd: &str) -> String { repl_run(&["--no-rc", "-c", cmd]) } fn repl_eval(code: &str) -> String { repl_run(&["--no-rc", "-e", code]) } fn repl_file(path: &str) -> String { repl_run(&["--no-rc", path]) } #[test] fn test_eval() { assert_eq!(repl_eval(r#"println!("Hello, world!");"#), "Hello, world!\n"); assert_eq!(repl_eval(r#"vec![1, 2, 3]"#), "[1, 2, 3]\n"); assert_eq!(repl_eval("let a = 1; a"), "1\n"); assert_eq!(repl_eval("fn foo() -> u32 { 2 } foo()"), "2\n"); assert_eq!(repl_eval("fn foo() -> u32 { 3 }; foo()"), "3\n"); } #[test] fn test_file() { assert_eq!(repl_file("data/test_file.rs"), "foo\n123 = i32\nbar\n"); } #[test] fn test_print() { assert_eq!(repl_cmd(".print 1"), "1\n"); assert_eq!(repl_cmd(r#".p "Hello!""#), "Hello!\n"); } #[test] fn test_rc() { assert_eq!(repl_run(&["-e", r#"println!("hi, rc!");"#]), "rc says hi\nhi, rc!\n"); } #[test] fn test_type() { assert_eq!(repl_cmd(".type 1"), "1 = i32\n"); assert_eq!(repl_cmd(r#".t "hai2u""#), "\"hai2u\" = &'static str\n"); assert_eq!(repl_cmd(":t &1"), "&1 = &i32\n"); assert_eq!(repl_cmd(".t vec![1u32]"), "vec![1u32] = collections::vec::Vec<u32>\n"); }
true
c5fcfedba3054f43094199f9e9f47857cf4250d8
Rust
romatthe/remoc
/remoc/src/rch/mpsc/receiver.rs
UTF-8
13,151
2.625
3
[ "Apache-2.0" ]
permissive
use bytes::Buf; use futures::{ready, FutureExt}; use serde::{Deserialize, Serialize}; use std::{ error::Error, fmt, marker::PhantomData, sync::Mutex, task::{Context, Poll}, }; use super::{ super::{ base::{self, PortDeserializer, PortSerializer}, buffer, RemoteSendError, BACKCHANNEL_MSG_CLOSE, BACKCHANNEL_MSG_ERROR, }, Distributor, }; use crate::{chmux, codec, RemoteSend}; /// An error occurred during receiving over an mpsc channel. #[derive(Clone, Debug, Serialize, Deserialize)] pub enum RecvError { /// Receiving from a remote endpoint failed. RemoteReceive(base::RecvError), /// Connecting a sent channel failed. RemoteConnect(chmux::ConnectError), /// Listening for a connection from a received channel failed. RemoteListen(chmux::ListenerError), } impl fmt::Display for RecvError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Self::RemoteReceive(err) => write!(f, "receive error: {}", err), Self::RemoteConnect(err) => write!(f, "connect error: {}", err), Self::RemoteListen(err) => write!(f, "listen error: {}", err), } } } impl Error for RecvError {} impl RecvError { /// Returns whether the error is final, i.e. no further receive operation can succeed. pub fn is_final(&self) -> bool { match self { Self::RemoteReceive(err) => err.is_final(), Self::RemoteConnect(_) | Self::RemoteListen(_) => true, } } } /// Receive values from the associated [Sender](super::Sender), /// which may be located on a remote endpoint. /// /// Instances are created by the [channel](super::channel) function. pub struct Receiver<T, Codec = codec::Default, Buffer = buffer::Default> { inner: Option<ReceiverInner<T>>, #[allow(clippy::type_complexity)] successor_tx: Mutex<Option<tokio::sync::oneshot::Sender<ReceiverInner<T>>>>, _codec: PhantomData<Codec>, _buffer: PhantomData<Buffer>, } impl<T, Codec, Buffer> fmt::Debug for Receiver<T, Codec, Buffer> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Receiver").finish() } } pub(crate) struct ReceiverInner<T> { rx: tokio::sync::mpsc::Receiver<Result<T, RecvError>>, closed_tx: tokio::sync::watch::Sender<bool>, remote_send_err_tx: tokio::sync::watch::Sender<Option<RemoteSendError>>, } /// Mpsc receiver in transport. #[derive(Serialize, Deserialize)] pub(crate) struct TransportedReceiver<T, Codec> { /// chmux port number. port: u32, /// Data type. data: PhantomData<T>, /// Data codec. codec: PhantomData<Codec>, } impl<T, Codec, Buffer> Receiver<T, Codec, Buffer> { pub(crate) fn new( rx: tokio::sync::mpsc::Receiver<Result<T, RecvError>>, closed_tx: tokio::sync::watch::Sender<bool>, remote_send_err_tx: tokio::sync::watch::Sender<Option<RemoteSendError>>, ) -> Self { Self { inner: Some(ReceiverInner { rx, closed_tx, remote_send_err_tx }), successor_tx: Mutex::new(None), _codec: PhantomData, _buffer: PhantomData, } } /// Receives the next value for this receiver. /// /// This function returns `Ok(None)` when the channel sender has been dropped. #[inline] pub async fn recv(&mut self) -> Result<Option<T>, RecvError> { match self.inner.as_mut().unwrap().rx.recv().await { Some(Ok(value_opt)) => Ok(Some(value_opt)), Some(Err(err)) => Err(err), None => Ok(None), } } /// Polls to receive the next message on this channel. /// /// This function returns `Poll::Ready(Ok(None))` when the channel sender has been dropped. #[inline] pub fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll<Result<Option<T>, RecvError>> { match ready!(self.inner.as_mut().unwrap().rx.poll_recv(cx)) { Some(Ok(value_opt)) => Poll::Ready(Ok(Some(value_opt))), Some(Err(err)) => Poll::Ready(Err(err)), None => Poll::Ready(Ok(None)), } } /// Blocking receive to call outside of asynchronous contexts. /// /// This function returns `Ok(None)` when the channel sender has been dropped. /// /// # Panics /// This function panics if called within an asynchronous execution context. #[inline] pub fn blocking_recv(&mut self) -> Result<Option<T>, RecvError> { let rt = tokio::runtime::Builder::new_current_thread().build().unwrap(); rt.block_on(self.recv()) } /// Closes the receiving half of a channel without dropping it. #[inline] pub fn close(&mut self) { let _ = self.inner.as_mut().unwrap().closed_tx.send(true); } /// Sets the codec that will be used when sending this receiver to a remote endpoint. pub fn set_codec<NewCodec>(mut self) -> Receiver<T, NewCodec, Buffer> { Receiver { inner: self.inner.take(), successor_tx: Mutex::new(None), _codec: PhantomData, _buffer: PhantomData, } } /// Sets the buffer size that will be used when sending this receiver to a remote endpoint. pub fn set_buffer<NewBuffer>(mut self) -> Receiver<T, Codec, NewBuffer> where NewBuffer: buffer::Size, { assert!(NewBuffer::size() > 0, "buffer size must not be zero"); Receiver { inner: self.inner.take(), successor_tx: Mutex::new(None), _codec: PhantomData, _buffer: PhantomData, } } } impl<T, Codec, Buffer> Receiver<T, Codec, Buffer> where T: RemoteSend + Clone, Codec: codec::Codec, Buffer: buffer::Size, { /// Distribute received items over multiple receivers. /// /// Each value is received by one of the receivers. /// /// If `wait_on_empty` is true, the distributor waits if all subscribers are closed. /// Otherwise it terminates. pub fn distribute(self, wait_on_empty: bool) -> Distributor<T, Codec, Buffer> { Distributor::new(self, wait_on_empty) } } impl<T, Codec, Buffer> Drop for Receiver<T, Codec, Buffer> { fn drop(&mut self) { let mut successor_tx = self.successor_tx.lock().unwrap(); if let Some(successor_tx) = successor_tx.take() { let _ = successor_tx.send(self.inner.take().unwrap()); } } } impl<T, Codec, Buffer> Serialize for Receiver<T, Codec, Buffer> where T: RemoteSend, Codec: codec::Codec, Buffer: buffer::Size, { /// Serializes this receiver for sending over a chmux channel. #[inline] fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer, { // Register successor of this receiver. let (successor_tx, successor_rx) = tokio::sync::oneshot::channel(); *self.successor_tx.lock().unwrap() = Some(successor_tx); let port = PortSerializer::connect(|connect| { async move { // Receiver has been dropped after sending, so we receive its channels. let ReceiverInner { mut rx, closed_tx, remote_send_err_tx } = match successor_rx.await { Ok(inner) => inner, Err(_) => return, }; // Establish chmux channel. let (raw_tx, mut raw_rx) = match connect.await { Ok(tx_rx) => tx_rx, Err(err) => { let _ = remote_send_err_tx.send(Some(RemoteSendError::Connect(err))); return; } }; // Encode data using remote sender. let mut remote_tx = base::Sender::<Result<T, RecvError>, Codec>::new(raw_tx); // Process events. let mut backchannel_active = true; loop { tokio::select! { biased; // Back channel message from remote endpoint. backchannel_msg = raw_rx.recv(), if backchannel_active => { match backchannel_msg { Ok(Some(mut msg)) if msg.remaining() >= 1 => { match msg.get_u8() { BACKCHANNEL_MSG_CLOSE => { let _ = closed_tx.send(true); } BACKCHANNEL_MSG_ERROR => { let _ = remote_send_err_tx.send(Some(RemoteSendError::Forward)); } _ => (), } }, _ => backchannel_active = false, } } // Data to send to remote endpoint. res_opt = rx.recv() => { let res = match res_opt { Some(res) => res, None => break, }; if let Err(err) = remote_tx.send(res).await { let _ = remote_send_err_tx.send(Some(RemoteSendError::Send(err.kind))); } } } } } .boxed() })?; // Encode chmux port number in transport type and serialize it. let transported = TransportedReceiver::<T, Codec> { port, data: PhantomData, codec: PhantomData }; transported.serialize(serializer) } } impl<'de, T, Codec, Buffer> Deserialize<'de> for Receiver<T, Codec, Buffer> where T: RemoteSend, Codec: codec::Codec, Buffer: buffer::Size, { /// Deserializes the receiver after it has been received over a chmux channel. #[inline] fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: serde::Deserializer<'de>, { assert!(Buffer::size() > 0, "BUFFER must not be zero"); // Get chmux port number from deserialized transport type. let TransportedReceiver { port, .. } = TransportedReceiver::<T, Codec>::deserialize(deserializer)?; // Create channels. let (tx, rx) = tokio::sync::mpsc::channel(Buffer::size()); let (closed_tx, mut closed_rx) = tokio::sync::watch::channel(false); let (remote_send_err_tx, mut remote_send_err_rx) = tokio::sync::watch::channel(None); PortDeserializer::accept(port, |local_port, request| { async move { // Accept chmux connection request. let (mut raw_tx, raw_rx) = match request.accept_from(local_port).await { Ok(tx_rx) => tx_rx, Err(err) => { let _ = tx.send(Err(RecvError::RemoteListen(err))).await; return; } }; // Decode received data using remote receiver. let mut remote_rx = base::Receiver::<Result<T, RecvError>, Codec>::new(raw_rx); // Process events. let mut close_sent = false; loop { tokio::select! { biased; // Channel closure requested locally. res = closed_rx.changed() => { match res { Ok(()) if *closed_rx.borrow() && !close_sent => { let _ = raw_tx.send(vec![BACKCHANNEL_MSG_CLOSE].into()).await; close_sent = true; } Ok(()) => (), Err(_) => break, } } // Notify remote endpoint of error. Ok(()) = remote_send_err_rx.changed() => { if remote_send_err_rx.borrow().as_ref().is_some() { let _ = raw_tx.send(vec![BACKCHANNEL_MSG_ERROR].into()).await; } } // Data received from remote endpoint. res = remote_rx.recv() => { let value = match res { Ok(Some(value)) => value, Ok(None) => break, Err(err) => Err(RecvError::RemoteReceive(err)), }; if tx.send(value).await.is_err() { break; } } } } } .boxed() })?; Ok(Self::new(rx, closed_tx, remote_send_err_tx)) } }
true
2e41826ce1589665d1a52b16c31c7d747cfd6456
Rust
tifennf/tiplouf
/tests/api_route.rs
UTF-8
7,164
3
3
[]
no_license
// YOU need to start mongod, then `cargo run` to start the server, then you can `cargo test` use reqwest::Response; use reqwest::StatusCode; use reqwest::header; use serde_json::Value; use std::collections::HashSet; use fake::{Dummy, Fake, Faker}; use serde::{Deserialize, Serialize}; use serde_json::json; const IP: &str = "http://127.0.0.1:3000"; #[derive(Debug, Serialize, Deserialize, PartialEq, Dummy)] struct User { username: String, password: String, } #[derive(Debug, Serialize, Deserialize, PartialEq)] struct ApiResponse<T> { status: String, data: T, } #[derive(Debug, Serialize, Deserialize, PartialEq)] struct Playlist { tracklist: Vec<Track>, tag: Option<String>, p_id: String, } #[derive(Debug, Serialize, Deserialize, PartialEq)] struct Track { url: String, p_id: String, t_id: String, } fn tracklist_example() -> HashSet<String> { let mut tracklist = HashSet::new(); tracklist.insert("track1".to_string()); tracklist.insert("track2".to_string()); tracklist.insert("track3".to_string()); tracklist } fn playlist_example() -> Value { let tracklist = tracklist_example(); json!({ "tracklist": tracklist, "tag": "classique" }) } async fn post_one_playlist(client: &reqwest::Client, url: &str, session_id: &str) -> Response { let body = playlist_example(); client .post(url) .header(header::COOKIE, session_id) .json(&body) .send() .await .unwrap() } async fn register_then_login(client: &reqwest::Client) -> String { let user: User = Faker.fake(); let url = format!("{}/auth/register", IP); let res = client.post(url).json(&user).send().await.unwrap(); assert!(res.status().is_success()); let url = format!("{}/auth/login", IP); let res = client.post(url).json(&user).send().await.unwrap(); let session_id = res .cookies() .reduce(|a, b| if a.name() == "session_id" { a } else { b }) .unwrap(); let session_id = format!("{}={}", session_id.name(), session_id.value()); println!("{}", session_id); session_id } //////////////////////// #[tokio::test] async fn all_route() { let client = reqwest::Client::new(); let session_id = register_then_login(&client).await; get_playlist(&client, &session_id).await; get_playlist_by_tag(&client, &session_id).await; post_playlist(&client, &session_id).await; get_one_playlist(&client, &session_id).await; delete_playlist(&client, &session_id).await; post_track(&client, &session_id).await; delete_track(&client, &session_id).await; } async fn get_playlist(client: &reqwest::Client, session_id: &str) { for _ in 0..5 { post_playlist(&client, session_id).await; } let url = format!("{}/playlist", IP); let res = client .get(url) .header(header::COOKIE, session_id) .send() .await .unwrap(); let status = res.status(); let playlist = res.json::<ApiResponse<Vec<Playlist>>>().await.unwrap(); assert!(status.is_success()); assert_eq!(playlist.status, "success"); } async fn get_playlist_by_tag(client: &reqwest::Client, session_id: &str) { for _ in 0..5 { post_playlist(&client, session_id).await; } let url = format!("{}/playlist?tag=classique", IP); let res = client .get(url) .header(header::COOKIE, session_id) .send() .await .unwrap(); let status = res.status(); let playlist = res.json::<ApiResponse<Vec<Playlist>>>().await.unwrap(); assert!(status.is_success()); assert_eq!(playlist.status, "success"); } async fn post_playlist(client: &reqwest::Client, session_id: &str) { let url = format!("{}/playlist", IP); let res = post_one_playlist(client, &url, session_id).await; let status = res.status(); let playlist = res.json::<ApiResponse<Playlist>>().await.unwrap(); assert_eq!(status, StatusCode::CREATED); assert_eq!(playlist.status, "success"); } async fn get_one_playlist(client: &reqwest::Client, session_id: &str) { let url = format!("{}/playlist", IP); let playlist1 = post_one_playlist(client, &url, session_id) .await .json::<ApiResponse<Playlist>>() .await .unwrap(); let id = &playlist1.data.p_id; let url = format!("{}/{}", url, id); let res = client .get(url) .header(header::COOKIE, session_id) .send() .await .unwrap(); let status = res.status(); let playlist2 = res.json::<ApiResponse<Playlist>>().await.unwrap(); assert!(status.is_success()); assert_eq!(playlist1.status, "success"); assert_eq!(playlist1, playlist2); } async fn delete_playlist(client: &reqwest::Client, session_id: &str) { let url = format!("{}/playlist", IP); let playlist1 = post_one_playlist(client, &url, session_id) .await .json::<ApiResponse<Playlist>>() .await .unwrap(); let id = &playlist1.data.p_id; let url = format!("{}/{}", url, id); let res = client .delete(url) .header(header::COOKIE, session_id) .send() .await .unwrap(); let status = res.status(); let playlist2 = res.json::<ApiResponse<Playlist>>().await.unwrap(); assert_eq!(status, StatusCode::ACCEPTED); assert_eq!(playlist2.status, "success"); assert_eq!(playlist1, playlist2); } async fn post_track(client: &reqwest::Client, session_id: &str) { let url = format!("{}/playlist", IP); let playlist1 = post_one_playlist(client, &url, session_id) .await .json::<ApiResponse<Playlist>>() .await .unwrap(); let id = &playlist1.data.p_id; let url = format!("{}/{}/track", url, id); let track = tracklist_example(); let res = client .post(url) .header(header::COOKIE, session_id) .json(&track) .send() .await .unwrap(); let status = res.status(); let playlist2 = res.json::<ApiResponse<Playlist>>().await.unwrap(); assert_eq!(status, StatusCode::CREATED); assert_eq!(playlist2.status, "success"); assert_ne!(playlist1, playlist2); } async fn delete_track(client: &reqwest::Client, session_id: &str) { let url = format!("{}/playlist", IP); let playlist1 = post_one_playlist(client, &url, session_id) .await .json::<ApiResponse<Playlist>>() .await .unwrap(); let id = &playlist1.data.p_id; let url = format!("{}/{}/track", url, id); let id_list = playlist1 .data .tracklist .iter() .map(|t| t.t_id.clone()) .collect::<HashSet<String>>(); let res = client .delete(url) .header(header::COOKIE, session_id) .json(&id_list) .send() .await .unwrap(); let status = res.status(); let playlist2 = res.json::<ApiResponse<Playlist>>().await.unwrap(); assert_eq!(status, StatusCode::ACCEPTED); assert_eq!(playlist2.status, "success"); assert_ne!(playlist1, playlist2); }
true
6ca68551bc27bc5de465a535597e56c9bad241ef
Rust
v33ps/mischief
/src/main.rs
UTF-8
7,147
2.625
3
[]
no_license
use std::net::{TcpStream, TcpListener}; use std::io::{Read, Write}; use std::thread; use serde_json::{Error}; // #[allow(unused_imports)] use serde::{Serialize, Deserialize}; #[allow(unused_imports)] use crossbeam_channel::{unbounded, RecvError, TryRecvError}; #[allow(unused_imports)] use crossbeam_channel::{Receiver, Sender}; use std::collections::HashMap; extern crate reqwest; // use std::time::Duration; use std::time; mod tasks; use tasks::*; mod filesystem; use filesystem::*; use log::{info, trace, warn}; #[derive(Default, Debug, Clone, PartialEq, Deserialize)] #[serde(rename_all = "camelCase")] pub struct Client { pub client_name: String, #[serde(rename = "clientID")] pub client_id: i64, pub task_queue: Vec<Task>, pub lastcheckintime: i64, pub interval: f32, } fn desearlizer_client(req: &mut reqwest::Response) -> Result<Client, Error> { let mut buffer = String::new(); match req.read_to_string(&mut buffer) { Ok(_) => (), Err(e) => println!("error : {}", e.to_string()) }; println!("buffer before serializaztion: {}", buffer); let v = match serde_json::from_str::<Client>(&buffer){ Ok(v) => v, Err(e) => return Err(e) }; Ok(v) } fn desearlizer_task(req: &mut reqwest::Response) -> Result<Task, Error> { let mut buffer = String::new(); match req.read_to_string(&mut buffer) { Ok(_) => (), Err(e) => println!("error : {}", e.to_string()) }; println!("buffer before serializaztion: {}", buffer); let v = match serde_json::from_str::<Task>(&buffer){ Ok(v) => v, Err(e) => return Err(e) }; Ok(v) } impl Client { pub fn new() -> Self { let mut map = HashMap::new(); map.insert("clientName", "rust".to_string()); let req_client = reqwest::Client::new(); let mut res = req_client.post("http://localhost:7777/client/new") .json(&map).send().unwrap(); let mut buffer = String::new(); match res.read_to_string(&mut buffer) { Ok(_) => (), Err(e) => println!("error : {}", e.to_string()) }; println!("buffer before serializaztion: {}", buffer); let v = serde_json::from_str::<Client>(&buffer).expect("oh"); Self { ..v } } pub fn add_task(&mut self, task: Task) { self.task_queue.push(task); } pub fn get_task(&mut self) { let mut map = HashMap::new(); map.insert("clientID", self.client_id); let req_client = reqwest::Client::new(); let mut res = req_client.post("http://localhost:7777/client/get_tasks") .json(&map).send().unwrap(); let mut buffer = String::new(); match res.read_to_string(&mut buffer) { Ok(_) => (), Err(e) => println!("error : {}", e.to_string()) }; if res.status() != 204 { println!("task buffer before serializaztion: {}", buffer); let v = serde_json::from_str::<Client>(&buffer).expect("oh"); // check to see that the taskID doesn't already exist in our task_queue let mut found = false; for current_task in &mut self.task_queue { for new_task in & v.task_queue { if current_task.task_id == new_task.task_id { found = true; break; } } } // if we haven't found this task, then add it to the queue. Otherwise, we are probably // already processing it if found != true { for task in v.task_queue { self.task_queue.push(task); } } } } } fn main() { // let name = String::from("rust"); let mut client = Client::new(); // now loop forever getting tasks every now and then let duration = (&client.interval * 1000.0) as u64; let sleep_duration = time::Duration::from_millis(duration); let (channel_out, channel_in) = unbounded(); // sleep for duration given by server, every interval wake up and ask for new tasks loop { thread::sleep(sleep_duration); // get new tasks from the server // need to return success/failure so we know if we should send something into the thread or not client.get_task(); // fuck me let mut c = client.clone(); let out_c = channel_out.clone(); // spawn a thread to deal with the new tasks let thread_hndl = thread::spawn(move || { handle_task(&mut c, out_c); }); if let Ok(resp_from_thread) = channel_in.try_recv() { println!("yayyy from main {}", &resp_from_thread); // need to send resp to server, and remvoe task from the queue let resp_task_id = resp_from_thread.parse::<i32>().unwrap(); client.task_queue.retain(|x| x.task_id != resp_task_id); } } } fn handle_task(client: &mut Client, main_out_c: Sender<String>) { let (channel_out, channel_in) = unbounded(); let task_types = TaskCommandTypes::new(); // walk over the task queue. For any task_queue.state == 0, handle it. for task in &mut client.task_queue { // all tasks will have at least 1 iteration, but may have more. We also may have a sleep // between iterations let duration = (task.iteration_delay * 1000) as u64; let sleep_duration = time::Duration::from_millis(duration); for _iteration in 0..task.iterations { let task_type = task_types.determine_task_type(task.command_type); if task_type == "filesystem" { // start the filesystem thread and go go go let out_c = channel_out.clone(); filesystem::handle_filesystem(task, out_c); task.state = 1; } // peek into the channel from our thread to see if there is data // if there is, send it back if let Ok(resp_from_thread) = channel_in.try_recv() { println!("handle_task got something: {}", &resp_from_thread); // should send the task ID back out if successful. Otherwise, an err string main_out_c.send(resp_from_thread).unwrap(); task.state = 2; } thread::sleep(sleep_duration); } } } fn serializer(msg: String) -> Result<Task, Error> { let v = match serde_json::from_str::<Task>(&msg){ Ok(v) => v, Err(e) => return Err(e) }; Ok(v) } fn get_command(stream: &mut TcpStream, buf: &mut[u8]) -> Result<Task, Error> { let buf_sz = stream.read(buf).expect("failed to read from stream"); let buf_usize = buf_sz as usize; let v = match serde_json::from_slice::<Task>(&buf[..buf_usize]){ Ok(v) => v, Err(e) => return Err(e) }; Ok(v) } fn send_err(stream: &mut TcpStream, err: Error) { let _ = stream.write(err.to_string().as_bytes()).expect("failed a write"); }
true
6edd313651181ad625b7380bb55f0c146708375b
Rust
madadam/xor-name
/src/xorable.rs
UTF-8
15,091
3.109375
3
[ "BSD-3-Clause", "MIT" ]
permissive
// Copyright 2020 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT // http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD // https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied, // modified, or distributed except according to those terms. Please review the Licences for the // specific language governing permissions and limitations relating to use of the SAFE Network // Software. use std::{ cmp::{min, Ordering}, marker::Sized, mem, num::Wrapping, }; /// A sequence of bits, as a point in XOR space. /// /// These are considered points in a space with the XOR metric, and need to implement the /// functionality required by `RoutingTable` to use them as node names. pub trait Xorable: Ord + Sized { /// Returns the length of the common prefix with the `other` name; e. g. /// the when `other = 11110000` and `self = 11111111` this is 4. fn common_prefix(&self, other: &Self) -> usize; /// Compares the distance of the arguments to `self`. Returns `Less` if `lhs` is closer, /// `Greater` if `rhs` is closer, and `Equal` if `lhs == rhs`. (The XOR distance can only be /// equal if the arguments are equal.) fn cmp_distance(&self, lhs: &Self, rhs: &Self) -> Ordering; /// Returns `true` if the `i`-th bit is `1`. fn bit(&self, i: usize) -> bool; /// Returns `true` if the `i`-th bit of other has a different value to the `i`-th bit of `self`. fn differs_in_bit(&self, other: &Self, i: usize) -> bool; /// Returns a copy of `self`, with the `index`-th bit flipped. /// /// If `index` exceeds the number of bits in `self`, an unmodified copy of `self` is returned. fn with_flipped_bit(self, i: usize) -> Self; /// Returns a copy of `self`, with the `index`-th bit set to `bit`. /// /// If `index` exceeds the number of bits in `self`, an unmodified copy of `self` is returned. fn with_bit(self, i: usize, bit: bool) -> Self; /// Returns a binary format string, with leading zero bits included. fn binary(&self) -> String; /// Returns a binary debug format string of `????????...????????` fn debug_binary(&self) -> String; /// Returns a copy of self with first `n` bits preserved, and remaining bits /// set to 0 (val == false) or 1 (val == true). fn set_remaining(self, n: usize, val: bool) -> Self; /// Returns the number of bits in `Self`. fn bit_len() -> usize { mem::size_of::<Self>() * 8 } /// Returns a `Self` instance constructed from an array of bytes. fn from_hash<T: AsRef<[u8]>>(hash: T) -> Self; } /// Converts a string into debug format of `????????...????????` when the string is longer than 20. pub fn debug_format(input: String) -> String { if input.len() <= 20 { return input; } input .chars() .take(8) .chain("...".chars()) .chain(input.chars().skip(input.len() - 8)) .collect() } macro_rules! impl_xorable_for_array { ($t:ident, $l:expr) => { impl Xorable for [$t; $l] { fn common_prefix(&self, other: &[$t; $l]) -> usize { for byte_index in 0..$l { if self[byte_index] != other[byte_index] { return (byte_index * mem::size_of::<$t>() * 8) + (self[byte_index] ^ other[byte_index]).leading_zeros() as usize; } } $l * mem::size_of::<$t>() * 8 } fn cmp_distance(&self, lhs: &[$t; $l], rhs: &[$t; $l]) -> Ordering { for i in 0..$l { if lhs[i] != rhs[i] { return Ord::cmp(&(lhs[i] ^ self[i]), &(rhs[i] ^ self[i])); } } Ordering::Equal } fn bit(&self, i: usize) -> bool { let bits = mem::size_of::<$t>() * 8; let index = i / bits; let pow_i = 1 << (bits - 1 - (i % bits)); self[index] & pow_i != 0 } fn differs_in_bit(&self, name: &[$t; $l], i: usize) -> bool { let bits = mem::size_of::<$t>() * 8; let index = i / bits; let pow_i = 1 << (bits - 1 - (i % bits)); (self[index] ^ name[index]) & pow_i != 0 } fn with_flipped_bit(mut self, i: usize) -> Self { let bits = mem::size_of::<$t>() * 8; if i >= Self::bit_len() { return self; } self[i / bits] ^= 1 << (bits - 1 - i % bits); self } fn with_bit(mut self, i: usize, bit: bool) -> Self { let bits = mem::size_of::<$t>() * 8; if i >= Self::bit_len() { return self; } let pow_i = 1 << (bits - 1 - i % bits); // 1 on bit i % bits. if bit { self[i / bits] |= pow_i; } else { self[i / bits] &= !pow_i; } self } fn binary(&self) -> String { let bit_len = Self::bit_len(); let mut s = String::with_capacity(bit_len); for value in self.iter() { s.push_str(&value.binary()); } s } fn debug_binary(&self) -> String { debug_format(self.binary()) } fn set_remaining(mut self, n: usize, val: bool) -> Self { let bits = mem::size_of::<$t>() * 8; for (i, x) in self.iter_mut().enumerate() { if n <= i * bits { *x = if val { !0 } else { 0 }; } else if n < (i + 1) * bits { let mask = !0 >> (n - i * bits); if val { *x |= mask } else { *x &= !mask } } // else n >= (i+1) * bits: nothing to do } self } fn from_hash<T: AsRef<[u8]>>(hash: T) -> Self { let hash = hash.as_ref(); let size = mem::size_of::<$t>(); let needed_bytes = min(hash.len(), size * $l); let mut result: [$t; $l] = [0; $l]; let full_elems = needed_bytes / size; for (i, elem) in result.iter_mut().enumerate().take(full_elems) { for j in 0..size { let mut x = Wrapping(*elem); // x <<= 8 would break for $t = u8 x <<= 4; x <<= 4; *elem = x.0; *elem |= hash[i * size + j]; } } for j in 0..(needed_bytes % size) { let mut x = Wrapping(result[full_elems]); // x <<= 8 would break for $t = u8 x <<= 4; x <<= 4; result[full_elems] = x.0; result[full_elems] |= hash[full_elems * size + j]; } result } } }; } impl_xorable_for_array!(u8, 32); impl_xorable_for_array!(u8, 16); impl_xorable_for_array!(u8, 8); impl_xorable_for_array!(u8, 4); macro_rules! impl_xorable { ($t:ident) => { impl Xorable for $t { fn common_prefix(&self, other: &Self) -> usize { (self ^ other).leading_zeros() as usize } fn cmp_distance(&self, lhs: &Self, rhs: &Self) -> Ordering { Ord::cmp(&(lhs ^ self), &(rhs ^ self)) } fn bit(&self, i: usize) -> bool { let pow_i = 1 << (mem::size_of::<Self>() * 8 - 1 - i); // 1 on bit i. self & pow_i != 0 } fn differs_in_bit(&self, name: &Self, i: usize) -> bool { let pow_i = 1 << (mem::size_of::<Self>() * 8 - 1 - i); // 1 on bit i. (self ^ name) & pow_i != 0 } fn with_flipped_bit(mut self, i: usize) -> Self { if i >= mem::size_of::<Self>() * 8 { return self; } let pow_i = 1 << (mem::size_of::<Self>() * 8 - 1 - i); // 1 on bit i. self ^= pow_i; self } fn with_bit(mut self, i: usize, bit: bool) -> Self { if i >= mem::size_of::<Self>() * 8 { return self; } let pow_i = 1 << (mem::size_of::<Self>() * 8 - 1 - i); // 1 on bit i. if bit { self |= pow_i; } else { self &= !pow_i; } self } fn binary(&self) -> String { format!("{1:00$b}", mem::size_of::<Self>() * 8, self) } fn debug_binary(&self) -> String { debug_format(self.binary()) } fn set_remaining(self, n: usize, val: bool) -> Self { let bits = mem::size_of::<Self>() * 8; if n >= bits { self } else { let mask = !0 >> n; if val { self | mask } else { self & !mask } } } fn from_hash<T: AsRef<[u8]>>(hash: T) -> Self { let hash = hash.as_ref(); let size = mem::size_of::<$t>(); let needed_bytes = min(hash.len(), size); let mut result: $t = 0; for elem in hash.into_iter().take(needed_bytes) { let mut x = Wrapping(result); // x <<= 8 would break for $t = u8 x <<= 4; x <<= 4; result = x.0; result |= Into::<$t>::into(*elem); } result } } }; } impl_xorable!(usize); impl_xorable!(u64); impl_xorable!(u32); impl_xorable!(u16); impl_xorable!(u8); #[cfg(test)] mod tests { use super::*; use std::cmp::Ordering; #[test] fn common_prefix() { assert_eq!(0, 0u8.common_prefix(&128u8)); assert_eq!(3, 10u8.common_prefix(&16u8)); assert_eq!(0, 0u16.common_prefix(&(1 << 15))); assert_eq!(11, 10u16.common_prefix(&16u16)); assert_eq!(64, 100u64.common_prefix(&100)); } #[test] fn common_prefix_array() { assert_eq!(0, [0, 0, 0, 0].common_prefix(&[128u8, 0, 0, 0])); assert_eq!(11, [0, 10u8, 0, 0].common_prefix(&[0, 16u8, 0, 0])); assert_eq!(31, [1u8, 2, 3, 4].common_prefix(&[1, 2, 3, 5])); assert_eq!(32, [1u8, 2, 3, 4].common_prefix(&[1, 2, 3, 4])); } #[test] fn cmp_distance() { assert_eq!(Ordering::Equal, 42u8.cmp_distance(&13, &13)); assert_eq!(Ordering::Less, 42u8.cmp_distance(&44, &45)); assert_eq!(Ordering::Greater, 42u8.cmp_distance(&45, &44)); } #[test] fn cmp_distance_array() { assert_eq!( Ordering::Equal, [1u8, 2, 3, 4].cmp_distance(&[2u8, 3, 4, 5], &[2u8, 3, 4, 5]) ); assert_eq!( Ordering::Less, [1u8, 2, 3, 4].cmp_distance(&[2u8, 2, 4, 5], &[2u8, 3, 6, 5]) ); assert_eq!( Ordering::Greater, [1u8, 2, 3, 4].cmp_distance(&[2u8, 3, 6, 5], &[2u8, 2, 4, 5]) ); assert_eq!( Ordering::Less, [1u8, 2, 3, 4].cmp_distance(&[1, 2, 3, 8], &[1, 2, 8, 4]) ); assert_eq!( Ordering::Greater, [1u8, 2, 3, 4].cmp_distance(&[1, 2, 8, 4], &[1, 2, 3, 8]) ); assert_eq!( Ordering::Less, [1u8, 2, 3, 4].cmp_distance(&[1, 2, 7, 4], &[1, 2, 6, 4]) ); assert_eq!( Ordering::Greater, [1u8, 2, 3, 4].cmp_distance(&[1, 2, 6, 4], &[1, 2, 7, 4]) ); } #[test] fn bit() { assert_eq!(false, 0b0010_1000u8.bit(0)); assert_eq!(true, 0b0010_1000u8.bit(2)); assert_eq!(false, 0b0010_1000u8.bit(3)); } #[test] fn bit_array() { assert_eq!(true, [2u8, 128, 1, 0].bit(6)); assert_eq!(true, [2u8, 128, 1, 0].bit(8)); assert_eq!(true, [2u8, 128, 1, 0].bit(23)); assert_eq!(false, [2u8, 128, 1, 0].bit(5)); assert_eq!(false, [2u8, 128, 1, 0].bit(7)); assert_eq!(false, [2u8, 128, 1, 0].bit(9)); assert_eq!(false, [2u8, 128, 1, 0].bit(22)); assert_eq!(false, [2u8, 128, 1, 0].bit(24)); } #[test] fn differs_in_bit() { assert!(0b0010_1010u8.differs_in_bit(&0b0010_0010u8, 4)); assert!(0b0010_1010u8.differs_in_bit(&0b0000_0010u8, 4)); assert!(!0b0010_1010u8.differs_in_bit(&0b0000_1010u8, 4)); } #[test] fn differs_in_bit_array() { assert!([0u8, 0, 0, 0].differs_in_bit(&[0, 1, 0, 10], 15)); assert!([0u8, 7, 0, 0].differs_in_bit(&[0, 0, 0, 0], 14)); assert!(![0u8, 7, 0, 0].differs_in_bit(&[0, 0, 0, 0], 26)); } #[test] fn set_remaining() { assert_eq!(0b1001_1011u8.set_remaining(5, false), 0b1001_1000); assert_eq!(0b1111_1111u8.set_remaining(2, false), 0b1100_0000); assert_eq!(0b0000_0000u8.set_remaining(4, true), 0b0000_1111); } #[test] fn set_remaining_array() { assert_eq!([13u8, 112, 9, 1].set_remaining(0, false), [0u8, 0, 0, 0]); assert_eq!( [13u8, 112, 9, 1].set_remaining(100, false), [13u8, 112, 9, 1] ); assert_eq!([13u8, 112, 9, 1].set_remaining(10, false), [13u8, 64, 0, 0]); assert_eq!( [13u8, 112, 9, 1].set_remaining(10, true), [13u8, 127, 255, 255] ); } #[test] fn bit_len() { type Array32 = [u8; 32]; type Array16 = [u8; 16]; type Array8 = [u8; 8]; type Array4 = [u8; 4]; assert_eq!(u64::bit_len(), 64); assert_eq!(u32::bit_len(), 32); assert_eq!(u16::bit_len(), 16); assert_eq!(u8::bit_len(), 8); assert_eq!(Array32::bit_len(), 256); assert_eq!(Array16::bit_len(), 128); assert_eq!(Array8::bit_len(), 64); assert_eq!(Array4::bit_len(), 32); } #[test] fn from_hash() { assert_eq!(u8::from_hash([5u8]), 5); assert_eq!(u8::from_hash([5u8, 6]), 5); assert_eq!(u16::from_hash([8u8, 6]), 2054); assert_eq!(u16::from_hash([8u8, 6, 7]), 2054); assert_eq!(u16::from_hash([8u8]), 8); } }
true
f8278ca780bd7d0c846c78a3273e2f7bab02344e
Rust
XOSplicer/codingame-solutions
/puzzles/community/langtons_ant.rs
UTF-8
4,463
3.109375
3
[]
no_license
use std::io; use std::io::BufRead; macro_rules! print_err { ($($arg:tt)*) => ( { use std::io::Write; writeln!(&mut ::std::io::stderr(), $($arg)*).ok(); } ) } macro_rules! parse_input { ($x:expr, $t:ident) => ($x.trim().parse::<$t>().unwrap()) } #[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)] enum Direction { N,E,S,W } #[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)] enum GridCell { Black, White } #[derive(Debug, PartialEq, Eq, Hash, Clone)] struct State { width: usize, height: usize, ant_x: usize, ant_y: usize, ant_dir: Direction, turns_left: usize, grid: Vec<Vec<GridCell>>, } impl Direction { fn turn_left(&self) -> Self { match self { &Direction::N => Direction::W, &Direction::E => Direction::N, &Direction::S => Direction::E, &Direction::W => Direction::S, } } fn turn_right(&self) -> Self { match self { &Direction::N => Direction::E, &Direction::E => Direction::S, &Direction::S => Direction::W, &Direction::W => Direction::N, } } } impl GridCell { fn flip(&self) -> Self { match self { &GridCell::Black => GridCell::White, &GridCell::White => GridCell::Black, } } } impl State { fn step(&self) -> Self { let mut next = self.clone(); print_err!("old color: {:?}", self.grid[self.ant_x][self.ant_y]); print_err!("old dir: {:?}", self.ant_dir); next.ant_dir = match self.grid[self.ant_y][self.ant_x] { GridCell::Black => self.ant_dir.turn_right(), GridCell::White => self.ant_dir.turn_left(), }; print_err!("new dir: {:?}", next.ant_dir); next.grid[self.ant_y][self.ant_x] = self.grid[self.ant_y][self.ant_x].flip(); print_err!("new color: {:?}", next.grid[self.ant_y][self.ant_x]); print_err!("old pos xy: {} {}", self.ant_x, self.ant_y); next.ant_x = (self.ant_x as i32 + match next.ant_dir { Direction::E => 1, Direction::W => -1, _ => 0, }) as usize; next.ant_y = (self.ant_y as i32 + match next.ant_dir { Direction::S => 1, Direction::N => -1, _ => 0, }) as usize; print_err!("new pos xy: {} {}", next.ant_x, next.ant_y); next.turns_left = self.turns_left - 1; next } fn grid_string(&self) -> String { let lines: Vec<String> = self.grid.iter().map(|r| r.iter().map(|c| match c { &GridCell::Black => '#', &GridCell::White => '.', }).collect() ).collect(); lines.join("\n").to_string() } } fn read_init() -> State { let stdin = io::stdin(); let mut lines = stdin.lock().lines().map(|x| x.unwrap()); let line = lines.next().unwrap(); let mut wh = line.split(" "); let w: u32= wh.next().unwrap().parse().unwrap(); let h: u32= wh.next().unwrap().parse().unwrap(); let line = lines.next().unwrap(); let mut xy = line.split(" "); let x: u32= xy.next().unwrap().parse().unwrap(); let y: u32= xy.next().unwrap().parse().unwrap(); let dir = match lines.next().unwrap().trim() { "N" => Direction::N, "E" => Direction::E, "S" => Direction::S, "W" => Direction::W, _ => unreachable!(), }; let t: u32 = lines.next().unwrap().parse().unwrap(); let grid = lines .map(|l| l.chars() .map(|c| match c { '#' => GridCell::Black, '.' => GridCell::White, _ => unreachable!(), }) .collect() ) .collect::<Vec<Vec<_>>>(); State { width: w as usize, height: h as usize, ant_x: x as usize, ant_y: y as usize, ant_dir: dir, turns_left: t as usize, grid: grid, } } fn main() { let mut state = read_init(); print_err!("ant xy: {} {} dir: {:?} grid: \n{}", state.ant_x, state.ant_y, state.ant_dir, state.grid_string()); while state.turns_left > 0 { state = state.step(); print_err!("ant xy: {} {} dir: {:?} grid: \n{}", state.ant_x, state.ant_y, state.ant_dir, state.grid_string()); } println!("{}", state.grid_string()); }
true
e5ebf947b4e16b688c0e2976d4f20a66515155ab
Rust
kolen/rustzx
/src/zx/controller.rs
UTF-8
15,328
2.78125
3
[ "MIT" ]
permissive
//! Contains ZX Spectrum System contrller (like ula or so) of emulator use std::fs::File; use std::io::Read; use std::path::{Path, PathBuf}; // use almost everything :D use utils::{split_word, Clocks}; use utils::screen::*; use utils::events::*; use utils::InstantFlag; use z80::Z80Bus; use zx::{ZXMemory, RomType, RamType}; use zx::memory::{Page, PAGE_SIZE}; use zx::machine::ZXMachine; use zx::tape::*; use zx::ZXKey; use zx::screen::canvas::ZXCanvas; use zx::screen::border::ZXBorder; use zx::screen::colors::{ZXColor, ZXPalette}; use zx::roms::*; use zx::constants::*; use zx::sound::mixer::ZXMixer; use settings::RustzxSettings; use zx::joy::kempston::*; /// ZX System controller pub struct ZXController { // parts of ZX Spectum. pub machine: ZXMachine, pub memory: ZXMemory, pub canvas: ZXCanvas, pub tape: Box<ZXTape>, pub border: ZXBorder, pub kempston: Option<KempstonJoy>, //pub beeper: ZXBeeper, pub mixer: ZXMixer, pub keyboard: [u8; 8], // current border color border_color: u8, // clocls count from frame start frame_clocks: Clocks, // frames count, which passed during emulation invokation passed_frames: usize, // main event queue events: EventQueue, // flag, which signals emulator to break emulation and process last event immediately instant_event: InstantFlag, // audio in mic: bool, // audio out ear: bool, paging_enabled: bool, screen_bank: u8, } impl ZXController { /// Returns new ZXController from settings pub fn new(settings: &RustzxSettings) -> ZXController { let (memory, paging, screen_bank); match settings.machine { ZXMachine::Sinclair48K => { memory = ZXMemory::new(RomType::K16, RamType::K48); paging = false; screen_bank = 0; } ZXMachine::Sinclair128K => { memory = ZXMemory::new(RomType::K32, RamType::K128); paging = true; screen_bank = 5; } }; let kempston = if settings.kempston { Some(KempstonJoy::new()) } else { None }; let mut out = ZXController { machine: settings.machine, memory: memory, canvas: ZXCanvas::new(settings.machine), border: ZXBorder::new(settings.machine, ZXPalette::default()), kempston: kempston, mixer: ZXMixer::new(settings.beeper_enabled, settings.ay_enabled), keyboard: [0xFF; 8], border_color: 0x00, frame_clocks: Clocks(0), passed_frames: 0, tape: Box::new(Tap::new()), events: EventQueue::new(), instant_event: InstantFlag::new(false), mic: false, ear: false, paging_enabled: paging, screen_bank: screen_bank, }; out.mixer.ay.mode(settings.ay_mode); out.mixer.volume(settings.volume as f64 / 200.0); out } /// returns current frame emulation pos in percents fn frame_pos(&self) -> f64 { let val = self.frame_clocks.count() as f64 / self.machine.specs().clocks_frame as f64; if val > 1.0 { 1.0 } else { val } } /// loads rom from file /// for 128-K machines path must contain ".0" in the tail /// and second rom bank will be loaded automatically pub fn load_rom(&mut self, path: impl AsRef<Path>) { match self.machine { // Single ROM file ZXMachine::Sinclair48K => { let mut rom = Vec::new(); File::open(path).ok().expect("[ERROR] ROM not found").read_to_end(&mut rom) .unwrap(); self.memory.load_rom(0, &rom); } // Two ROM's ZXMachine::Sinclair128K => { let mut rom0 = Vec::new(); let mut rom1 = Vec::new(); if !path.as_ref().extension().map_or(false, |e| e == "0") { println!("[Warning] ROM0 filename should end with .0"); } File::open(path.as_ref()).ok().expect("[ERROR] ROM0 not found").read_to_end(&mut rom0) .unwrap(); let mut second_path: PathBuf = path.as_ref().to_path_buf(); second_path.set_extension("1"); File::open(second_path).ok().expect("[ERROR] ROM1 not found").read_to_end(&mut rom1) .unwrap(); self.memory.load_rom(0, &rom0) .load_rom(1, &rom1); println!("ROM's Loaded"); } } } /// loads builted-in ROM pub fn load_default_rom(&mut self) { match self.machine { ZXMachine::Sinclair48K => { self.memory.load_rom(0, ROM_48K); } ZXMachine::Sinclair128K => { self.memory.load_rom(0, ROM_128K_0) .load_rom(1, ROM_128K_1); } } } /// Changes key state in controller pub fn send_key(&mut self, key: ZXKey, pressed: bool) { // TODO: Move row detection to ZXKey type let rownum = match key.half_port { 0xFE => Some(0), 0xFD => Some(1), 0xFB => Some(2), 0xF7 => Some(3), 0xEF => Some(4), 0xDF => Some(5), 0xBF => Some(6), 0x7F => Some(7), _ => None, }; if let Some(rownum) = rownum { self.keyboard[rownum] = self.keyboard[rownum] & (!key.mask); if !pressed { self.keyboard[rownum] |= key.mask; } } } /// Dumps memory space pub fn dump(&self) -> Vec<u8> { self.memory.dump() } /// Returns current bus floating value fn floating_bus_value(&self) -> u8 { let specs = self.machine.specs(); let clocks = self.frame_clocks; if clocks.count() < specs.clocks_first_pixel + 2 { return 0xFF; } let clocks = clocks.count() - (specs.clocks_first_pixel + 2); let row = clocks / specs.clocks_line; let clocks = clocks % specs.clocks_line; let col = (clocks / 8) * 2 + (clocks % 8) / 2; if row < CANVAS_HEIGHT && clocks < specs.clocks_screen_row - CLOCKS_PER_COL && ((clocks & 0x04) == 0) { if clocks % 2 == 0 { return self.memory.read(bitmap_line_addr(row) + col as u16); } else { let byte = (row / 8) * 32 + col; return self.memory.read(0x5800 + byte as u16); }; } return 0xFF; } /// make contention fn do_contention(&mut self) { let contention = self.machine.contention_clocks(self.frame_clocks); self.wait_internal(contention); } ///make contention + wait some clocks fn do_contention_and_wait(&mut self, wait_time: Clocks) { let contention = self.machine.contention_clocks(self.frame_clocks); self.wait_internal(contention + wait_time); } // check addr contention fn addr_is_contended(&self, addr: u16) -> bool { return if let Page::Ram(bank) = self.memory.get_page(addr) { self.machine.bank_is_contended(bank as usize) } else { false } } /// Returns early IO contention clocks fn io_contention_first(&mut self, port: u16) { if self.addr_is_contended(port) { self.do_contention(); }; self.wait_internal(Clocks(1)); } /// Returns late IO contention clocks fn io_contention_last(&mut self, port: u16) { if self.machine.port_is_contended(port) { self.do_contention_and_wait(Clocks(2)); } else { if self.addr_is_contended(port) { self.do_contention_and_wait(Clocks(1)); self.do_contention_and_wait(Clocks(1)); self.do_contention(); } else { self.wait_internal(Clocks(2)); } } } /// Starts a new frame fn new_frame(&mut self) { self.frame_clocks -= self.machine.specs().clocks_frame; self.canvas.new_frame(); self.border.new_frame(); self.mixer.new_frame(); } /// force clears all events pub fn clear_events(&mut self) { self.events.clear(); } /// check events count pub fn no_events(&self) -> bool { self.events.is_empty() } /// Returns last event pub fn pop_event(&mut self) -> Option<Event> { self.events.receive_event() } /// Returns true if all frame clocks has been passed pub fn frames_count(&self) -> usize { self.passed_frames } pub fn reset_frame_counter(&mut self) { self.passed_frames = 0; } /// Returns current clocks from frame start pub fn clocks(&self) -> Clocks { self.frame_clocks } fn write_7ffd(&mut self, val: u8) { if !self.paging_enabled { return; } // remap top 16K of the ram self.memory.remap(3, Page::Ram(val & 0x07)); // third block is not pageable // second block is screen buffer, not pageable. but we need to change active buffer let new_screen_bank = if val & 0x08 == 0 { 5 } else { 7 }; self.canvas.switch_bank(new_screen_bank as usize); self.screen_bank = new_screen_bank; // remap ROM self.memory.remap(0, Page::Rom((val >> 4) & 0x01)); // check paging allow bit if val & 0x20 != 0 { self.paging_enabled = false; } } } impl Z80Bus for ZXController { /// we need to check different breakpoints like tape /// loading detection breakpoint fn pc_callback(&mut self, addr: u16) { // check mapped memory page at 0x0000 .. 0x3FFF let check_fast_load = match self.machine { ZXMachine::Sinclair48K if self.memory.get_bank_type(0) == Page::Rom(0) => true, ZXMachine::Sinclair128K if self.memory.get_bank_type(0) == Page::Rom(1) => true, _ => false, }; if check_fast_load { // Tape LOAD/VERIFY if addr == ADDR_LD_BREAK { // Add event (Fast tape loading request) it must be executed // by emulator immediately self.events.send_event(Event::new(EventKind::FastTapeLoad, self.frame_clocks)); self.instant_event.set(); } } } /// read data without taking onto account contention fn read_internal(&mut self, addr: u16) -> u8 { self.memory.read(addr) } /// write data without taking onto account contention fn write_internal(&mut self, addr: u16, data: u8) { self.memory.write(addr, data); // if ram then compare bank to screen bank if let Page::Ram(bank) = self.memory.get_page(addr) { self.canvas.update(addr % PAGE_SIZE as u16, bank as usize, data); } } /// Cahnges internal state on clocks count change (emualtion processing) fn wait_internal(&mut self, clk: Clocks) { self.frame_clocks += clk; (*self.tape).process_clocks(clk); let mic = (*self.tape).current_bit(); self.mic = mic; let pos = self.frame_pos(); self.mixer.beeper.change_bit(self.mic | self.ear); self.mixer.process(pos); self.canvas.process_clocks(self.frame_clocks); if self.frame_clocks.count() >= self.machine.specs().clocks_frame { self.new_frame(); self.passed_frames += 1; } } // wait with memory request pin active fn wait_mreq(&mut self, addr: u16, clk: Clocks) { match self.machine { ZXMachine::Sinclair48K | ZXMachine::Sinclair128K=> { // contention in low 16k RAM if self.addr_is_contended(addr) { self.do_contention(); } } } self.wait_internal(clk); } /// wait without memory request pin active fn wait_no_mreq(&mut self, addr: u16, clk: Clocks) { // only for 48 K! self.wait_mreq(addr, clk); } /// read io from hardware fn read_io(&mut self, port: u16) -> u8 { // all contentions check self.io_contention_first(port); self.io_contention_last(port); // find out what we need to do let (h, _) = split_word(port); let output = if port & 0x0001 == 0 { // ULA port let mut tmp: u8 = 0xFF; for n in 0..8 { // if bit of row reset if ((h >> n) & 0x01) == 0 { tmp &= self.keyboard[n]; } } // invert bit 6 if mic_hw active; if self.mic { tmp ^= 0x40; } // 5 and 7 unused tmp } else if port & 0xC002 == 0xC000 { // AY regs self.mixer.ay.read() } else if self.kempston.is_some() && (port & 0x0020 == 0) { if let Some(ref joy) = self.kempston { joy.read() } else { unreachable!() } } else { self.floating_bus_value() }; // add one clock after operation self.wait_internal(Clocks(1)); output } /// write value to hardware port fn write_io(&mut self, port: u16, data: u8) { // first contention self.io_contention_first(port); // find active port if port & 0xC002 == 0xC000 { self.mixer.ay.select_reg(data); } else if port & 0xC002 == 0x8000 { self.mixer.ay.write(data); } else if port & 0x0001 == 0 { self.border_color = data & 0x07; self.border.set_border(self.frame_clocks, ZXColor::from_bits(data & 0x07)); self.mic = data & 0x08 != 0; self.ear = data & 0x10 != 0; self.mixer.beeper.change_bit(self.mic | self.ear); } else if (port & 0x8002 == 0) && (self.machine == ZXMachine::Sinclair128K) { self.write_7ffd(data); } // last contention after byte write self.io_contention_last(port); // add one clock after operation self.wait_internal(Clocks(1)); } /// value, requested during `INT0` interrupt fn read_interrupt(&mut self) -> u8 { 0xFF } /// checks system maskable interrupt pin state fn int_active(&self) -> bool { self.frame_clocks.count() % self.machine.specs().clocks_frame < self.machine.specs().interrupt_length } /// checks non-maskable interrupt pin state fn nmi_active(&self) -> bool { false } /// CPU calls it when RETI instruction was processed fn reti(&mut self) {} /// CPU calls when was being halted fn halt(&mut self, _: bool) {} /// checks instant events fn instant_event(&self) -> bool { self.instant_event.pick() } }
true
230ac50a7480fe92b261ea7e0b88a608e80178f7
Rust
troyvassalotti/days-of-rustmas
/src/main.rs
UTF-8
902
3.265625
3
[]
no_license
fn main() { let days = ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth"]; let lyrics = ["A partridge in a pear tree", "Two turtle doves, and", "Three french hens", "Four calling birds", "Five golden rings", "Six geese a-laying", "Seven swans a-swimming", "Eight maids a-milking", "Nine ladies dancing", "Ten lords a-leaping", "Eleven pipers piping", "Twelve drummers drumming"]; for n in 0..12 { println!("On the {} day of Christmas, my true love sent to me", days[n]); if n == 0 { println!("{}\n", lyrics[n]); } else { let x = n; let mut words = String::new(); for index in (0..x + 1).rev() { words.push_str(lyrics[index]); words.push_str("\n"); } println!("{}", words) }; } }
true
7583c79a59298c3745e087c7eb08fdea35e28e84
Rust
r-asou/databend
/common/functions/src/aggregates/aggregator_common.rs
UTF-8
2,243
2.609375
3
[ "Apache-2.0" ]
permissive
// Copyright 2020 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::fmt::Display; use common_exception::ErrorCode; use common_exception::Result; pub fn assert_unary_params<D: Display>(name: D, actual: usize) -> Result<()> { if actual != 1 { return Err(ErrorCode::NumberArgumentsNotMatch(format!( "{} expect to have single parameters, but got {}", name, actual ))); } Ok(()) } pub fn assert_unary_arguments<D: Display>(name: D, actual: usize) -> Result<()> { if actual != 1 { return Err(ErrorCode::NumberArgumentsNotMatch(format!( "{} expect to have single arguments, but got {}", name, actual ))); } Ok(()) } pub fn assert_binary_arguments<D: Display>(name: D, actual: usize) -> Result<()> { if actual != 2 { return Err(ErrorCode::NumberArgumentsNotMatch(format!( "{} expect to have two arguments, but got {}", name, actual ))); } Ok(()) } #[allow(dead_code)] pub fn assert_arguments<D: Display>(name: D, actual: usize, expected: usize) -> Result<()> { if actual != expected { return Err(ErrorCode::NumberArgumentsNotMatch(format!( "{} expect to have {} arguments, but got {}", name, expected, actual ))); } Ok(()) } pub fn assert_variadic_arguments<D: Display>( name: D, actual: usize, expected: (usize, usize), ) -> Result<()> { if actual < expected.0 || actual > expected.1 { return Err(ErrorCode::NumberArgumentsNotMatch(format!( "{} expect to have [{}, {}] arguments, but got {}", name, expected.0, expected.1, actual ))); } Ok(()) }
true
035f752cce4ecd96938689301838d7b13217ac49
Rust
NonJam/shipyard
/src/sparse_set/sparse_array/mod.rs
UTF-8
3,045
2.6875
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
mod sparse_slice; mod sparse_slice_mut; pub(crate) use sparse_slice::SparseSlice; pub(crate) use sparse_slice_mut::SparseSliceMut; use crate::storage::EntityId; #[cfg(not(feature = "std"))] use alloc::boxed::Box; #[cfg(not(feature = "std"))] use alloc::vec::Vec; pub(crate) struct SparseArray<T>(Vec<Option<Box<T>>>); impl<T> SparseArray<T> { pub(super) fn new() -> Self { SparseArray(Vec::new()) } pub(super) fn as_slice(&self) -> SparseSlice<'_, T> { SparseSlice(&*self.0) } pub(super) fn as_slice_mut(&mut self) -> SparseSliceMut<'_, T> { SparseSliceMut(&mut *self.0) } } impl SparseArray<[usize; crate::sparse_set::BUCKET_SIZE]> { pub(super) fn allocate_at(&mut self, entity: EntityId) { if entity.bucket() >= self.0.len() { self.0.resize(entity.bucket() + 1, None); } unsafe { // SAFE we just allocated at least entity.bucket() if self.0.get_unchecked(entity.bucket()).is_none() { *self.0.get_unchecked_mut(entity.bucket()) = Some(Box::new([core::usize::MAX; crate::sparse_set::BUCKET_SIZE])); } } } pub(super) fn sparse_index(&self, entity: EntityId) -> Option<usize> { // SAFE bucket_index always returns a valid bucket index self.0 .get(entity.bucket())? .as_ref() .map(|bucket| unsafe { *bucket.get_unchecked(entity.bucket_index()) }) } pub(super) unsafe fn set_sparse_index_unchecked(&mut self, entity: EntityId, index: usize) { match self.0.get_unchecked_mut(entity.bucket()) { Some(bucket) => *bucket.get_unchecked_mut(entity.bucket_index()) = index, None => core::hint::unreachable_unchecked(), } } } impl SparseArray<[EntityId; crate::sparse_set::metadata::BUCKET_SIZE]> { pub(crate) fn allocate_at(&mut self, entity: EntityId) { if entity.shared_bucket() >= self.0.len() { self.0.resize(entity.shared_bucket() + 1, None); } unsafe { // SAFE we just allocated at least entity.bucket() if self.0.get_unchecked(entity.shared_bucket()).is_none() { *self.0.get_unchecked_mut(entity.shared_bucket()) = Some(Box::new( [EntityId::dead(); crate::sparse_set::metadata::BUCKET_SIZE], )); } } } pub(super) fn shared_index(&self, entity: EntityId) -> Option<EntityId> { self.0 .get(entity.shared_bucket())? .as_ref() .map(|bucket| unsafe { *bucket.get_unchecked(entity.shared_bucket_index()) }) } pub(super) unsafe fn set_sparse_index_unchecked(&mut self, shared: EntityId, owned: EntityId) { self.allocate_at(shared); match self.0.get_unchecked_mut(shared.shared_bucket()) { Some(bucket) => *bucket.get_unchecked_mut(shared.shared_bucket_index()) = owned, None => core::hint::unreachable_unchecked(), } } }
true
d19fc4e5e52369e26f34f39766d0550e9afe3fdc
Rust
5l1v3r1/vita
/src/sources/binaryedge.rs
UTF-8
2,531
3.140625
3
[ "LicenseRef-scancode-unknown-license-reference", "Unlicense" ]
permissive
use crate::error::Result; use crate::IntoSubdomain; use async_std::task; use dotenv::dotenv; use serde::Deserialize; use std::collections::HashSet; use std::env; use std::sync::Arc; #[derive(Deserialize)] struct BinaryEdgeResponse { page: i32, pagesize: i32, total: i32, events: Vec<String>, } impl IntoSubdomain for BinaryEdgeResponse { fn subdomains(&self) -> HashSet<String> { self.events.iter().map(|s| s.into()).collect() } } fn build_url(host: &str, page: Option<i32>) -> String { match page { Some(p) => format!( "https://api.binaryedge.io/v2/query/domains/subdomain/{}?page={}", host, p ), None => format!( "https://api.binaryedge.io/v2/query/domains/subdomain/{}", host ), } } // fetches the page in sequential order, it would be better to fetch them concurrently, // but for the small amount of pages it probably doesn't matter pub async fn run(host: Arc<String>) -> Result<HashSet<String>> { let mut tasks = Vec::new(); let mut results: HashSet<String> = HashSet::new(); let resp = next_page(&host, None).await; // insert subdomains from first page. resp.subdomains() .into_iter() .map(|s| results.insert(s)) .for_each(drop); let mut page = resp.page; loop { let host = host.clone(); if page > 0 && page * resp.pagesize >= resp.total { break; } page += 1; tasks.push(task::spawn( async move { next_page(&host, Some(page)).await }, )); } for t in tasks { t.await .subdomains() .into_iter() .map(|s| results.insert(s)) .for_each(drop); } Ok(results) } async fn next_page(host: &str, page: Option<i32>) -> BinaryEdgeResponse { dotenv().ok(); let uri = build_url(host, page); let api_key = env::var("BINARYEDGE_TOKEN") .expect("BINARYEDGE_TOKEN must be set in order to use Binaryedge as a data source"); surf::get(uri) .set_header("X-Key", api_key) .recv_json() .await .unwrap() } #[cfg(test)] mod tests { use super::*; use futures_await_test::async_test; // Checks to see if the run function returns subdomains #[async_test] #[ignore] async fn returns_results() { let host = Arc::new("hackerone.com".to_string()); let results = run(host).await.unwrap(); assert!(results.len() > 3); } }
true
e044091a941bf1603dd463136c2afa14fd9cb9c8
Rust
cyndis/jis0208
/map.rs
UTF-8
633,080
2.75
3
[]
no_license
use std::mem::transmute; pub fn decode(codepoint: u16) -> Option<char> { match codepoint { 0x2121 => Some(unsafe { transmute(0x3000u32) }), 0x2122 => Some(unsafe { transmute(0x3001u32) }), 0x2123 => Some(unsafe { transmute(0x3002u32) }), 0x2124 => Some(unsafe { transmute(0xff0cu32) }), 0x2125 => Some(unsafe { transmute(0xff0eu32) }), 0x2126 => Some(unsafe { transmute(0x30fbu32) }), 0x2127 => Some(unsafe { transmute(0xff1au32) }), 0x2128 => Some(unsafe { transmute(0xff1bu32) }), 0x2129 => Some(unsafe { transmute(0xff1fu32) }), 0x212a => Some(unsafe { transmute(0xff01u32) }), 0x212b => Some(unsafe { transmute(0x309bu32) }), 0x212c => Some(unsafe { transmute(0x309cu32) }), 0x212d => Some(unsafe { transmute(0x00b4u32) }), 0x212e => Some(unsafe { transmute(0xff40u32) }), 0x212f => Some(unsafe { transmute(0x00a8u32) }), 0x2130 => Some(unsafe { transmute(0xff3eu32) }), 0x2131 => Some(unsafe { transmute(0xffe3u32) }), 0x2132 => Some(unsafe { transmute(0xff3fu32) }), 0x2133 => Some(unsafe { transmute(0x30fdu32) }), 0x2134 => Some(unsafe { transmute(0x30feu32) }), 0x2135 => Some(unsafe { transmute(0x309du32) }), 0x2136 => Some(unsafe { transmute(0x309eu32) }), 0x2137 => Some(unsafe { transmute(0x3003u32) }), 0x2138 => Some(unsafe { transmute(0x4eddu32) }), 0x2139 => Some(unsafe { transmute(0x3005u32) }), 0x213a => Some(unsafe { transmute(0x3006u32) }), 0x213b => Some(unsafe { transmute(0x3007u32) }), 0x213c => Some(unsafe { transmute(0x30fcu32) }), 0x213d => Some(unsafe { transmute(0x2015u32) }), 0x213e => Some(unsafe { transmute(0x2010u32) }), 0x213f => Some(unsafe { transmute(0xff0fu32) }), 0x2140 => Some(unsafe { transmute(0x005cu32) }), 0x2141 => Some(unsafe { transmute(0x301cu32) }), 0x2142 => Some(unsafe { transmute(0x2016u32) }), 0x2143 => Some(unsafe { transmute(0xff5cu32) }), 0x2144 => Some(unsafe { transmute(0x2026u32) }), 0x2145 => Some(unsafe { transmute(0x2025u32) }), 0x2146 => Some(unsafe { transmute(0x2018u32) }), 0x2147 => Some(unsafe { transmute(0x2019u32) }), 0x2148 => Some(unsafe { transmute(0x201cu32) }), 0x2149 => Some(unsafe { transmute(0x201du32) }), 0x214a => Some(unsafe { transmute(0xff08u32) }), 0x214b => Some(unsafe { transmute(0xff09u32) }), 0x214c => Some(unsafe { transmute(0x3014u32) }), 0x214d => Some(unsafe { transmute(0x3015u32) }), 0x214e => Some(unsafe { transmute(0xff3bu32) }), 0x214f => Some(unsafe { transmute(0xff3du32) }), 0x2150 => Some(unsafe { transmute(0xff5bu32) }), 0x2151 => Some(unsafe { transmute(0xff5du32) }), 0x2152 => Some(unsafe { transmute(0x3008u32) }), 0x2153 => Some(unsafe { transmute(0x3009u32) }), 0x2154 => Some(unsafe { transmute(0x300au32) }), 0x2155 => Some(unsafe { transmute(0x300bu32) }), 0x2156 => Some(unsafe { transmute(0x300cu32) }), 0x2157 => Some(unsafe { transmute(0x300du32) }), 0x2158 => Some(unsafe { transmute(0x300eu32) }), 0x2159 => Some(unsafe { transmute(0x300fu32) }), 0x215a => Some(unsafe { transmute(0x3010u32) }), 0x215b => Some(unsafe { transmute(0x3011u32) }), 0x215c => Some(unsafe { transmute(0xff0bu32) }), 0x215d => Some(unsafe { transmute(0x2212u32) }), 0x215e => Some(unsafe { transmute(0x00b1u32) }), 0x215f => Some(unsafe { transmute(0x00d7u32) }), 0x2160 => Some(unsafe { transmute(0x00f7u32) }), 0x2161 => Some(unsafe { transmute(0xff1du32) }), 0x2162 => Some(unsafe { transmute(0x2260u32) }), 0x2163 => Some(unsafe { transmute(0xff1cu32) }), 0x2164 => Some(unsafe { transmute(0xff1eu32) }), 0x2165 => Some(unsafe { transmute(0x2266u32) }), 0x2166 => Some(unsafe { transmute(0x2267u32) }), 0x2167 => Some(unsafe { transmute(0x221eu32) }), 0x2168 => Some(unsafe { transmute(0x2234u32) }), 0x2169 => Some(unsafe { transmute(0x2642u32) }), 0x216a => Some(unsafe { transmute(0x2640u32) }), 0x216b => Some(unsafe { transmute(0x00b0u32) }), 0x216c => Some(unsafe { transmute(0x2032u32) }), 0x216d => Some(unsafe { transmute(0x2033u32) }), 0x216e => Some(unsafe { transmute(0x2103u32) }), 0x216f => Some(unsafe { transmute(0xffe5u32) }), 0x2170 => Some(unsafe { transmute(0xff04u32) }), 0x2171 => Some(unsafe { transmute(0x00a2u32) }), 0x2172 => Some(unsafe { transmute(0x00a3u32) }), 0x2173 => Some(unsafe { transmute(0xff05u32) }), 0x2174 => Some(unsafe { transmute(0xff03u32) }), 0x2175 => Some(unsafe { transmute(0xff06u32) }), 0x2176 => Some(unsafe { transmute(0xff0au32) }), 0x2177 => Some(unsafe { transmute(0xff20u32) }), 0x2178 => Some(unsafe { transmute(0x00a7u32) }), 0x2179 => Some(unsafe { transmute(0x2606u32) }), 0x217a => Some(unsafe { transmute(0x2605u32) }), 0x217b => Some(unsafe { transmute(0x25cbu32) }), 0x217c => Some(unsafe { transmute(0x25cfu32) }), 0x217d => Some(unsafe { transmute(0x25ceu32) }), 0x217e => Some(unsafe { transmute(0x25c7u32) }), 0x2221 => Some(unsafe { transmute(0x25c6u32) }), 0x2222 => Some(unsafe { transmute(0x25a1u32) }), 0x2223 => Some(unsafe { transmute(0x25a0u32) }), 0x2224 => Some(unsafe { transmute(0x25b3u32) }), 0x2225 => Some(unsafe { transmute(0x25b2u32) }), 0x2226 => Some(unsafe { transmute(0x25bdu32) }), 0x2227 => Some(unsafe { transmute(0x25bcu32) }), 0x2228 => Some(unsafe { transmute(0x203bu32) }), 0x2229 => Some(unsafe { transmute(0x3012u32) }), 0x222a => Some(unsafe { transmute(0x2192u32) }), 0x222b => Some(unsafe { transmute(0x2190u32) }), 0x222c => Some(unsafe { transmute(0x2191u32) }), 0x222d => Some(unsafe { transmute(0x2193u32) }), 0x222e => Some(unsafe { transmute(0x3013u32) }), 0x223a => Some(unsafe { transmute(0x2208u32) }), 0x223b => Some(unsafe { transmute(0x220bu32) }), 0x223c => Some(unsafe { transmute(0x2286u32) }), 0x223d => Some(unsafe { transmute(0x2287u32) }), 0x223e => Some(unsafe { transmute(0x2282u32) }), 0x223f => Some(unsafe { transmute(0x2283u32) }), 0x2240 => Some(unsafe { transmute(0x222au32) }), 0x2241 => Some(unsafe { transmute(0x2229u32) }), 0x224a => Some(unsafe { transmute(0x2227u32) }), 0x224b => Some(unsafe { transmute(0x2228u32) }), 0x224c => Some(unsafe { transmute(0x00acu32) }), 0x224d => Some(unsafe { transmute(0x21d2u32) }), 0x224e => Some(unsafe { transmute(0x21d4u32) }), 0x224f => Some(unsafe { transmute(0x2200u32) }), 0x2250 => Some(unsafe { transmute(0x2203u32) }), 0x225c => Some(unsafe { transmute(0x2220u32) }), 0x225d => Some(unsafe { transmute(0x22a5u32) }), 0x225e => Some(unsafe { transmute(0x2312u32) }), 0x225f => Some(unsafe { transmute(0x2202u32) }), 0x2260 => Some(unsafe { transmute(0x2207u32) }), 0x2261 => Some(unsafe { transmute(0x2261u32) }), 0x2262 => Some(unsafe { transmute(0x2252u32) }), 0x2263 => Some(unsafe { transmute(0x226au32) }), 0x2264 => Some(unsafe { transmute(0x226bu32) }), 0x2265 => Some(unsafe { transmute(0x221au32) }), 0x2266 => Some(unsafe { transmute(0x223du32) }), 0x2267 => Some(unsafe { transmute(0x221du32) }), 0x2268 => Some(unsafe { transmute(0x2235u32) }), 0x2269 => Some(unsafe { transmute(0x222bu32) }), 0x226a => Some(unsafe { transmute(0x222cu32) }), 0x2272 => Some(unsafe { transmute(0x212bu32) }), 0x2273 => Some(unsafe { transmute(0x2030u32) }), 0x2274 => Some(unsafe { transmute(0x266fu32) }), 0x2275 => Some(unsafe { transmute(0x266du32) }), 0x2276 => Some(unsafe { transmute(0x266au32) }), 0x2277 => Some(unsafe { transmute(0x2020u32) }), 0x2278 => Some(unsafe { transmute(0x2021u32) }), 0x2279 => Some(unsafe { transmute(0x00b6u32) }), 0x227e => Some(unsafe { transmute(0x25efu32) }), 0x2330 => Some(unsafe { transmute(0xff10u32) }), 0x2331 => Some(unsafe { transmute(0xff11u32) }), 0x2332 => Some(unsafe { transmute(0xff12u32) }), 0x2333 => Some(unsafe { transmute(0xff13u32) }), 0x2334 => Some(unsafe { transmute(0xff14u32) }), 0x2335 => Some(unsafe { transmute(0xff15u32) }), 0x2336 => Some(unsafe { transmute(0xff16u32) }), 0x2337 => Some(unsafe { transmute(0xff17u32) }), 0x2338 => Some(unsafe { transmute(0xff18u32) }), 0x2339 => Some(unsafe { transmute(0xff19u32) }), 0x2341 => Some(unsafe { transmute(0xff21u32) }), 0x2342 => Some(unsafe { transmute(0xff22u32) }), 0x2343 => Some(unsafe { transmute(0xff23u32) }), 0x2344 => Some(unsafe { transmute(0xff24u32) }), 0x2345 => Some(unsafe { transmute(0xff25u32) }), 0x2346 => Some(unsafe { transmute(0xff26u32) }), 0x2347 => Some(unsafe { transmute(0xff27u32) }), 0x2348 => Some(unsafe { transmute(0xff28u32) }), 0x2349 => Some(unsafe { transmute(0xff29u32) }), 0x234a => Some(unsafe { transmute(0xff2au32) }), 0x234b => Some(unsafe { transmute(0xff2bu32) }), 0x234c => Some(unsafe { transmute(0xff2cu32) }), 0x234d => Some(unsafe { transmute(0xff2du32) }), 0x234e => Some(unsafe { transmute(0xff2eu32) }), 0x234f => Some(unsafe { transmute(0xff2fu32) }), 0x2350 => Some(unsafe { transmute(0xff30u32) }), 0x2351 => Some(unsafe { transmute(0xff31u32) }), 0x2352 => Some(unsafe { transmute(0xff32u32) }), 0x2353 => Some(unsafe { transmute(0xff33u32) }), 0x2354 => Some(unsafe { transmute(0xff34u32) }), 0x2355 => Some(unsafe { transmute(0xff35u32) }), 0x2356 => Some(unsafe { transmute(0xff36u32) }), 0x2357 => Some(unsafe { transmute(0xff37u32) }), 0x2358 => Some(unsafe { transmute(0xff38u32) }), 0x2359 => Some(unsafe { transmute(0xff39u32) }), 0x235a => Some(unsafe { transmute(0xff3au32) }), 0x2361 => Some(unsafe { transmute(0xff41u32) }), 0x2362 => Some(unsafe { transmute(0xff42u32) }), 0x2363 => Some(unsafe { transmute(0xff43u32) }), 0x2364 => Some(unsafe { transmute(0xff44u32) }), 0x2365 => Some(unsafe { transmute(0xff45u32) }), 0x2366 => Some(unsafe { transmute(0xff46u32) }), 0x2367 => Some(unsafe { transmute(0xff47u32) }), 0x2368 => Some(unsafe { transmute(0xff48u32) }), 0x2369 => Some(unsafe { transmute(0xff49u32) }), 0x236a => Some(unsafe { transmute(0xff4au32) }), 0x236b => Some(unsafe { transmute(0xff4bu32) }), 0x236c => Some(unsafe { transmute(0xff4cu32) }), 0x236d => Some(unsafe { transmute(0xff4du32) }), 0x236e => Some(unsafe { transmute(0xff4eu32) }), 0x236f => Some(unsafe { transmute(0xff4fu32) }), 0x2370 => Some(unsafe { transmute(0xff50u32) }), 0x2371 => Some(unsafe { transmute(0xff51u32) }), 0x2372 => Some(unsafe { transmute(0xff52u32) }), 0x2373 => Some(unsafe { transmute(0xff53u32) }), 0x2374 => Some(unsafe { transmute(0xff54u32) }), 0x2375 => Some(unsafe { transmute(0xff55u32) }), 0x2376 => Some(unsafe { transmute(0xff56u32) }), 0x2377 => Some(unsafe { transmute(0xff57u32) }), 0x2378 => Some(unsafe { transmute(0xff58u32) }), 0x2379 => Some(unsafe { transmute(0xff59u32) }), 0x237a => Some(unsafe { transmute(0xff5au32) }), 0x2421 => Some(unsafe { transmute(0x3041u32) }), 0x2422 => Some(unsafe { transmute(0x3042u32) }), 0x2423 => Some(unsafe { transmute(0x3043u32) }), 0x2424 => Some(unsafe { transmute(0x3044u32) }), 0x2425 => Some(unsafe { transmute(0x3045u32) }), 0x2426 => Some(unsafe { transmute(0x3046u32) }), 0x2427 => Some(unsafe { transmute(0x3047u32) }), 0x2428 => Some(unsafe { transmute(0x3048u32) }), 0x2429 => Some(unsafe { transmute(0x3049u32) }), 0x242a => Some(unsafe { transmute(0x304au32) }), 0x242b => Some(unsafe { transmute(0x304bu32) }), 0x242c => Some(unsafe { transmute(0x304cu32) }), 0x242d => Some(unsafe { transmute(0x304du32) }), 0x242e => Some(unsafe { transmute(0x304eu32) }), 0x242f => Some(unsafe { transmute(0x304fu32) }), 0x2430 => Some(unsafe { transmute(0x3050u32) }), 0x2431 => Some(unsafe { transmute(0x3051u32) }), 0x2432 => Some(unsafe { transmute(0x3052u32) }), 0x2433 => Some(unsafe { transmute(0x3053u32) }), 0x2434 => Some(unsafe { transmute(0x3054u32) }), 0x2435 => Some(unsafe { transmute(0x3055u32) }), 0x2436 => Some(unsafe { transmute(0x3056u32) }), 0x2437 => Some(unsafe { transmute(0x3057u32) }), 0x2438 => Some(unsafe { transmute(0x3058u32) }), 0x2439 => Some(unsafe { transmute(0x3059u32) }), 0x243a => Some(unsafe { transmute(0x305au32) }), 0x243b => Some(unsafe { transmute(0x305bu32) }), 0x243c => Some(unsafe { transmute(0x305cu32) }), 0x243d => Some(unsafe { transmute(0x305du32) }), 0x243e => Some(unsafe { transmute(0x305eu32) }), 0x243f => Some(unsafe { transmute(0x305fu32) }), 0x2440 => Some(unsafe { transmute(0x3060u32) }), 0x2441 => Some(unsafe { transmute(0x3061u32) }), 0x2442 => Some(unsafe { transmute(0x3062u32) }), 0x2443 => Some(unsafe { transmute(0x3063u32) }), 0x2444 => Some(unsafe { transmute(0x3064u32) }), 0x2445 => Some(unsafe { transmute(0x3065u32) }), 0x2446 => Some(unsafe { transmute(0x3066u32) }), 0x2447 => Some(unsafe { transmute(0x3067u32) }), 0x2448 => Some(unsafe { transmute(0x3068u32) }), 0x2449 => Some(unsafe { transmute(0x3069u32) }), 0x244a => Some(unsafe { transmute(0x306au32) }), 0x244b => Some(unsafe { transmute(0x306bu32) }), 0x244c => Some(unsafe { transmute(0x306cu32) }), 0x244d => Some(unsafe { transmute(0x306du32) }), 0x244e => Some(unsafe { transmute(0x306eu32) }), 0x244f => Some(unsafe { transmute(0x306fu32) }), 0x2450 => Some(unsafe { transmute(0x3070u32) }), 0x2451 => Some(unsafe { transmute(0x3071u32) }), 0x2452 => Some(unsafe { transmute(0x3072u32) }), 0x2453 => Some(unsafe { transmute(0x3073u32) }), 0x2454 => Some(unsafe { transmute(0x3074u32) }), 0x2455 => Some(unsafe { transmute(0x3075u32) }), 0x2456 => Some(unsafe { transmute(0x3076u32) }), 0x2457 => Some(unsafe { transmute(0x3077u32) }), 0x2458 => Some(unsafe { transmute(0x3078u32) }), 0x2459 => Some(unsafe { transmute(0x3079u32) }), 0x245a => Some(unsafe { transmute(0x307au32) }), 0x245b => Some(unsafe { transmute(0x307bu32) }), 0x245c => Some(unsafe { transmute(0x307cu32) }), 0x245d => Some(unsafe { transmute(0x307du32) }), 0x245e => Some(unsafe { transmute(0x307eu32) }), 0x245f => Some(unsafe { transmute(0x307fu32) }), 0x2460 => Some(unsafe { transmute(0x3080u32) }), 0x2461 => Some(unsafe { transmute(0x3081u32) }), 0x2462 => Some(unsafe { transmute(0x3082u32) }), 0x2463 => Some(unsafe { transmute(0x3083u32) }), 0x2464 => Some(unsafe { transmute(0x3084u32) }), 0x2465 => Some(unsafe { transmute(0x3085u32) }), 0x2466 => Some(unsafe { transmute(0x3086u32) }), 0x2467 => Some(unsafe { transmute(0x3087u32) }), 0x2468 => Some(unsafe { transmute(0x3088u32) }), 0x2469 => Some(unsafe { transmute(0x3089u32) }), 0x246a => Some(unsafe { transmute(0x308au32) }), 0x246b => Some(unsafe { transmute(0x308bu32) }), 0x246c => Some(unsafe { transmute(0x308cu32) }), 0x246d => Some(unsafe { transmute(0x308du32) }), 0x246e => Some(unsafe { transmute(0x308eu32) }), 0x246f => Some(unsafe { transmute(0x308fu32) }), 0x2470 => Some(unsafe { transmute(0x3090u32) }), 0x2471 => Some(unsafe { transmute(0x3091u32) }), 0x2472 => Some(unsafe { transmute(0x3092u32) }), 0x2473 => Some(unsafe { transmute(0x3093u32) }), 0x2521 => Some(unsafe { transmute(0x30a1u32) }), 0x2522 => Some(unsafe { transmute(0x30a2u32) }), 0x2523 => Some(unsafe { transmute(0x30a3u32) }), 0x2524 => Some(unsafe { transmute(0x30a4u32) }), 0x2525 => Some(unsafe { transmute(0x30a5u32) }), 0x2526 => Some(unsafe { transmute(0x30a6u32) }), 0x2527 => Some(unsafe { transmute(0x30a7u32) }), 0x2528 => Some(unsafe { transmute(0x30a8u32) }), 0x2529 => Some(unsafe { transmute(0x30a9u32) }), 0x252a => Some(unsafe { transmute(0x30aau32) }), 0x252b => Some(unsafe { transmute(0x30abu32) }), 0x252c => Some(unsafe { transmute(0x30acu32) }), 0x252d => Some(unsafe { transmute(0x30adu32) }), 0x252e => Some(unsafe { transmute(0x30aeu32) }), 0x252f => Some(unsafe { transmute(0x30afu32) }), 0x2530 => Some(unsafe { transmute(0x30b0u32) }), 0x2531 => Some(unsafe { transmute(0x30b1u32) }), 0x2532 => Some(unsafe { transmute(0x30b2u32) }), 0x2533 => Some(unsafe { transmute(0x30b3u32) }), 0x2534 => Some(unsafe { transmute(0x30b4u32) }), 0x2535 => Some(unsafe { transmute(0x30b5u32) }), 0x2536 => Some(unsafe { transmute(0x30b6u32) }), 0x2537 => Some(unsafe { transmute(0x30b7u32) }), 0x2538 => Some(unsafe { transmute(0x30b8u32) }), 0x2539 => Some(unsafe { transmute(0x30b9u32) }), 0x253a => Some(unsafe { transmute(0x30bau32) }), 0x253b => Some(unsafe { transmute(0x30bbu32) }), 0x253c => Some(unsafe { transmute(0x30bcu32) }), 0x253d => Some(unsafe { transmute(0x30bdu32) }), 0x253e => Some(unsafe { transmute(0x30beu32) }), 0x253f => Some(unsafe { transmute(0x30bfu32) }), 0x2540 => Some(unsafe { transmute(0x30c0u32) }), 0x2541 => Some(unsafe { transmute(0x30c1u32) }), 0x2542 => Some(unsafe { transmute(0x30c2u32) }), 0x2543 => Some(unsafe { transmute(0x30c3u32) }), 0x2544 => Some(unsafe { transmute(0x30c4u32) }), 0x2545 => Some(unsafe { transmute(0x30c5u32) }), 0x2546 => Some(unsafe { transmute(0x30c6u32) }), 0x2547 => Some(unsafe { transmute(0x30c7u32) }), 0x2548 => Some(unsafe { transmute(0x30c8u32) }), 0x2549 => Some(unsafe { transmute(0x30c9u32) }), 0x254a => Some(unsafe { transmute(0x30cau32) }), 0x254b => Some(unsafe { transmute(0x30cbu32) }), 0x254c => Some(unsafe { transmute(0x30ccu32) }), 0x254d => Some(unsafe { transmute(0x30cdu32) }), 0x254e => Some(unsafe { transmute(0x30ceu32) }), 0x254f => Some(unsafe { transmute(0x30cfu32) }), 0x2550 => Some(unsafe { transmute(0x30d0u32) }), 0x2551 => Some(unsafe { transmute(0x30d1u32) }), 0x2552 => Some(unsafe { transmute(0x30d2u32) }), 0x2553 => Some(unsafe { transmute(0x30d3u32) }), 0x2554 => Some(unsafe { transmute(0x30d4u32) }), 0x2555 => Some(unsafe { transmute(0x30d5u32) }), 0x2556 => Some(unsafe { transmute(0x30d6u32) }), 0x2557 => Some(unsafe { transmute(0x30d7u32) }), 0x2558 => Some(unsafe { transmute(0x30d8u32) }), 0x2559 => Some(unsafe { transmute(0x30d9u32) }), 0x255a => Some(unsafe { transmute(0x30dau32) }), 0x255b => Some(unsafe { transmute(0x30dbu32) }), 0x255c => Some(unsafe { transmute(0x30dcu32) }), 0x255d => Some(unsafe { transmute(0x30ddu32) }), 0x255e => Some(unsafe { transmute(0x30deu32) }), 0x255f => Some(unsafe { transmute(0x30dfu32) }), 0x2560 => Some(unsafe { transmute(0x30e0u32) }), 0x2561 => Some(unsafe { transmute(0x30e1u32) }), 0x2562 => Some(unsafe { transmute(0x30e2u32) }), 0x2563 => Some(unsafe { transmute(0x30e3u32) }), 0x2564 => Some(unsafe { transmute(0x30e4u32) }), 0x2565 => Some(unsafe { transmute(0x30e5u32) }), 0x2566 => Some(unsafe { transmute(0x30e6u32) }), 0x2567 => Some(unsafe { transmute(0x30e7u32) }), 0x2568 => Some(unsafe { transmute(0x30e8u32) }), 0x2569 => Some(unsafe { transmute(0x30e9u32) }), 0x256a => Some(unsafe { transmute(0x30eau32) }), 0x256b => Some(unsafe { transmute(0x30ebu32) }), 0x256c => Some(unsafe { transmute(0x30ecu32) }), 0x256d => Some(unsafe { transmute(0x30edu32) }), 0x256e => Some(unsafe { transmute(0x30eeu32) }), 0x256f => Some(unsafe { transmute(0x30efu32) }), 0x2570 => Some(unsafe { transmute(0x30f0u32) }), 0x2571 => Some(unsafe { transmute(0x30f1u32) }), 0x2572 => Some(unsafe { transmute(0x30f2u32) }), 0x2573 => Some(unsafe { transmute(0x30f3u32) }), 0x2574 => Some(unsafe { transmute(0x30f4u32) }), 0x2575 => Some(unsafe { transmute(0x30f5u32) }), 0x2576 => Some(unsafe { transmute(0x30f6u32) }), 0x2621 => Some(unsafe { transmute(0x0391u32) }), 0x2622 => Some(unsafe { transmute(0x0392u32) }), 0x2623 => Some(unsafe { transmute(0x0393u32) }), 0x2624 => Some(unsafe { transmute(0x0394u32) }), 0x2625 => Some(unsafe { transmute(0x0395u32) }), 0x2626 => Some(unsafe { transmute(0x0396u32) }), 0x2627 => Some(unsafe { transmute(0x0397u32) }), 0x2628 => Some(unsafe { transmute(0x0398u32) }), 0x2629 => Some(unsafe { transmute(0x0399u32) }), 0x262a => Some(unsafe { transmute(0x039au32) }), 0x262b => Some(unsafe { transmute(0x039bu32) }), 0x262c => Some(unsafe { transmute(0x039cu32) }), 0x262d => Some(unsafe { transmute(0x039du32) }), 0x262e => Some(unsafe { transmute(0x039eu32) }), 0x262f => Some(unsafe { transmute(0x039fu32) }), 0x2630 => Some(unsafe { transmute(0x03a0u32) }), 0x2631 => Some(unsafe { transmute(0x03a1u32) }), 0x2632 => Some(unsafe { transmute(0x03a3u32) }), 0x2633 => Some(unsafe { transmute(0x03a4u32) }), 0x2634 => Some(unsafe { transmute(0x03a5u32) }), 0x2635 => Some(unsafe { transmute(0x03a6u32) }), 0x2636 => Some(unsafe { transmute(0x03a7u32) }), 0x2637 => Some(unsafe { transmute(0x03a8u32) }), 0x2638 => Some(unsafe { transmute(0x03a9u32) }), 0x2641 => Some(unsafe { transmute(0x03b1u32) }), 0x2642 => Some(unsafe { transmute(0x03b2u32) }), 0x2643 => Some(unsafe { transmute(0x03b3u32) }), 0x2644 => Some(unsafe { transmute(0x03b4u32) }), 0x2645 => Some(unsafe { transmute(0x03b5u32) }), 0x2646 => Some(unsafe { transmute(0x03b6u32) }), 0x2647 => Some(unsafe { transmute(0x03b7u32) }), 0x2648 => Some(unsafe { transmute(0x03b8u32) }), 0x2649 => Some(unsafe { transmute(0x03b9u32) }), 0x264a => Some(unsafe { transmute(0x03bau32) }), 0x264b => Some(unsafe { transmute(0x03bbu32) }), 0x264c => Some(unsafe { transmute(0x03bcu32) }), 0x264d => Some(unsafe { transmute(0x03bdu32) }), 0x264e => Some(unsafe { transmute(0x03beu32) }), 0x264f => Some(unsafe { transmute(0x03bfu32) }), 0x2650 => Some(unsafe { transmute(0x03c0u32) }), 0x2651 => Some(unsafe { transmute(0x03c1u32) }), 0x2652 => Some(unsafe { transmute(0x03c3u32) }), 0x2653 => Some(unsafe { transmute(0x03c4u32) }), 0x2654 => Some(unsafe { transmute(0x03c5u32) }), 0x2655 => Some(unsafe { transmute(0x03c6u32) }), 0x2656 => Some(unsafe { transmute(0x03c7u32) }), 0x2657 => Some(unsafe { transmute(0x03c8u32) }), 0x2658 => Some(unsafe { transmute(0x03c9u32) }), 0x2721 => Some(unsafe { transmute(0x0410u32) }), 0x2722 => Some(unsafe { transmute(0x0411u32) }), 0x2723 => Some(unsafe { transmute(0x0412u32) }), 0x2724 => Some(unsafe { transmute(0x0413u32) }), 0x2725 => Some(unsafe { transmute(0x0414u32) }), 0x2726 => Some(unsafe { transmute(0x0415u32) }), 0x2727 => Some(unsafe { transmute(0x0401u32) }), 0x2728 => Some(unsafe { transmute(0x0416u32) }), 0x2729 => Some(unsafe { transmute(0x0417u32) }), 0x272a => Some(unsafe { transmute(0x0418u32) }), 0x272b => Some(unsafe { transmute(0x0419u32) }), 0x272c => Some(unsafe { transmute(0x041au32) }), 0x272d => Some(unsafe { transmute(0x041bu32) }), 0x272e => Some(unsafe { transmute(0x041cu32) }), 0x272f => Some(unsafe { transmute(0x041du32) }), 0x2730 => Some(unsafe { transmute(0x041eu32) }), 0x2731 => Some(unsafe { transmute(0x041fu32) }), 0x2732 => Some(unsafe { transmute(0x0420u32) }), 0x2733 => Some(unsafe { transmute(0x0421u32) }), 0x2734 => Some(unsafe { transmute(0x0422u32) }), 0x2735 => Some(unsafe { transmute(0x0423u32) }), 0x2736 => Some(unsafe { transmute(0x0424u32) }), 0x2737 => Some(unsafe { transmute(0x0425u32) }), 0x2738 => Some(unsafe { transmute(0x0426u32) }), 0x2739 => Some(unsafe { transmute(0x0427u32) }), 0x273a => Some(unsafe { transmute(0x0428u32) }), 0x273b => Some(unsafe { transmute(0x0429u32) }), 0x273c => Some(unsafe { transmute(0x042au32) }), 0x273d => Some(unsafe { transmute(0x042bu32) }), 0x273e => Some(unsafe { transmute(0x042cu32) }), 0x273f => Some(unsafe { transmute(0x042du32) }), 0x2740 => Some(unsafe { transmute(0x042eu32) }), 0x2741 => Some(unsafe { transmute(0x042fu32) }), 0x2751 => Some(unsafe { transmute(0x0430u32) }), 0x2752 => Some(unsafe { transmute(0x0431u32) }), 0x2753 => Some(unsafe { transmute(0x0432u32) }), 0x2754 => Some(unsafe { transmute(0x0433u32) }), 0x2755 => Some(unsafe { transmute(0x0434u32) }), 0x2756 => Some(unsafe { transmute(0x0435u32) }), 0x2757 => Some(unsafe { transmute(0x0451u32) }), 0x2758 => Some(unsafe { transmute(0x0436u32) }), 0x2759 => Some(unsafe { transmute(0x0437u32) }), 0x275a => Some(unsafe { transmute(0x0438u32) }), 0x275b => Some(unsafe { transmute(0x0439u32) }), 0x275c => Some(unsafe { transmute(0x043au32) }), 0x275d => Some(unsafe { transmute(0x043bu32) }), 0x275e => Some(unsafe { transmute(0x043cu32) }), 0x275f => Some(unsafe { transmute(0x043du32) }), 0x2760 => Some(unsafe { transmute(0x043eu32) }), 0x2761 => Some(unsafe { transmute(0x043fu32) }), 0x2762 => Some(unsafe { transmute(0x0440u32) }), 0x2763 => Some(unsafe { transmute(0x0441u32) }), 0x2764 => Some(unsafe { transmute(0x0442u32) }), 0x2765 => Some(unsafe { transmute(0x0443u32) }), 0x2766 => Some(unsafe { transmute(0x0444u32) }), 0x2767 => Some(unsafe { transmute(0x0445u32) }), 0x2768 => Some(unsafe { transmute(0x0446u32) }), 0x2769 => Some(unsafe { transmute(0x0447u32) }), 0x276a => Some(unsafe { transmute(0x0448u32) }), 0x276b => Some(unsafe { transmute(0x0449u32) }), 0x276c => Some(unsafe { transmute(0x044au32) }), 0x276d => Some(unsafe { transmute(0x044bu32) }), 0x276e => Some(unsafe { transmute(0x044cu32) }), 0x276f => Some(unsafe { transmute(0x044du32) }), 0x2770 => Some(unsafe { transmute(0x044eu32) }), 0x2771 => Some(unsafe { transmute(0x044fu32) }), 0x2821 => Some(unsafe { transmute(0x2500u32) }), 0x2822 => Some(unsafe { transmute(0x2502u32) }), 0x2823 => Some(unsafe { transmute(0x250cu32) }), 0x2824 => Some(unsafe { transmute(0x2510u32) }), 0x2825 => Some(unsafe { transmute(0x2518u32) }), 0x2826 => Some(unsafe { transmute(0x2514u32) }), 0x2827 => Some(unsafe { transmute(0x251cu32) }), 0x2828 => Some(unsafe { transmute(0x252cu32) }), 0x2829 => Some(unsafe { transmute(0x2524u32) }), 0x282a => Some(unsafe { transmute(0x2534u32) }), 0x282b => Some(unsafe { transmute(0x253cu32) }), 0x282c => Some(unsafe { transmute(0x2501u32) }), 0x282d => Some(unsafe { transmute(0x2503u32) }), 0x282e => Some(unsafe { transmute(0x250fu32) }), 0x282f => Some(unsafe { transmute(0x2513u32) }), 0x2830 => Some(unsafe { transmute(0x251bu32) }), 0x2831 => Some(unsafe { transmute(0x2517u32) }), 0x2832 => Some(unsafe { transmute(0x2523u32) }), 0x2833 => Some(unsafe { transmute(0x2533u32) }), 0x2834 => Some(unsafe { transmute(0x252bu32) }), 0x2835 => Some(unsafe { transmute(0x253bu32) }), 0x2836 => Some(unsafe { transmute(0x254bu32) }), 0x2837 => Some(unsafe { transmute(0x2520u32) }), 0x2838 => Some(unsafe { transmute(0x252fu32) }), 0x2839 => Some(unsafe { transmute(0x2528u32) }), 0x283a => Some(unsafe { transmute(0x2537u32) }), 0x283b => Some(unsafe { transmute(0x253fu32) }), 0x283c => Some(unsafe { transmute(0x251du32) }), 0x283d => Some(unsafe { transmute(0x2530u32) }), 0x283e => Some(unsafe { transmute(0x2525u32) }), 0x283f => Some(unsafe { transmute(0x2538u32) }), 0x2840 => Some(unsafe { transmute(0x2542u32) }), 0x3021 => Some(unsafe { transmute(0x4e9cu32) }), 0x3022 => Some(unsafe { transmute(0x5516u32) }), 0x3023 => Some(unsafe { transmute(0x5a03u32) }), 0x3024 => Some(unsafe { transmute(0x963fu32) }), 0x3025 => Some(unsafe { transmute(0x54c0u32) }), 0x3026 => Some(unsafe { transmute(0x611bu32) }), 0x3027 => Some(unsafe { transmute(0x6328u32) }), 0x3028 => Some(unsafe { transmute(0x59f6u32) }), 0x3029 => Some(unsafe { transmute(0x9022u32) }), 0x302a => Some(unsafe { transmute(0x8475u32) }), 0x302b => Some(unsafe { transmute(0x831cu32) }), 0x302c => Some(unsafe { transmute(0x7a50u32) }), 0x302d => Some(unsafe { transmute(0x60aau32) }), 0x302e => Some(unsafe { transmute(0x63e1u32) }), 0x302f => Some(unsafe { transmute(0x6e25u32) }), 0x3030 => Some(unsafe { transmute(0x65edu32) }), 0x3031 => Some(unsafe { transmute(0x8466u32) }), 0x3032 => Some(unsafe { transmute(0x82a6u32) }), 0x3033 => Some(unsafe { transmute(0x9bf5u32) }), 0x3034 => Some(unsafe { transmute(0x6893u32) }), 0x3035 => Some(unsafe { transmute(0x5727u32) }), 0x3036 => Some(unsafe { transmute(0x65a1u32) }), 0x3037 => Some(unsafe { transmute(0x6271u32) }), 0x3038 => Some(unsafe { transmute(0x5b9bu32) }), 0x3039 => Some(unsafe { transmute(0x59d0u32) }), 0x303a => Some(unsafe { transmute(0x867bu32) }), 0x303b => Some(unsafe { transmute(0x98f4u32) }), 0x303c => Some(unsafe { transmute(0x7d62u32) }), 0x303d => Some(unsafe { transmute(0x7dbeu32) }), 0x303e => Some(unsafe { transmute(0x9b8eu32) }), 0x303f => Some(unsafe { transmute(0x6216u32) }), 0x3040 => Some(unsafe { transmute(0x7c9fu32) }), 0x3041 => Some(unsafe { transmute(0x88b7u32) }), 0x3042 => Some(unsafe { transmute(0x5b89u32) }), 0x3043 => Some(unsafe { transmute(0x5eb5u32) }), 0x3044 => Some(unsafe { transmute(0x6309u32) }), 0x3045 => Some(unsafe { transmute(0x6697u32) }), 0x3046 => Some(unsafe { transmute(0x6848u32) }), 0x3047 => Some(unsafe { transmute(0x95c7u32) }), 0x3048 => Some(unsafe { transmute(0x978du32) }), 0x3049 => Some(unsafe { transmute(0x674fu32) }), 0x304a => Some(unsafe { transmute(0x4ee5u32) }), 0x304b => Some(unsafe { transmute(0x4f0au32) }), 0x304c => Some(unsafe { transmute(0x4f4du32) }), 0x304d => Some(unsafe { transmute(0x4f9du32) }), 0x304e => Some(unsafe { transmute(0x5049u32) }), 0x304f => Some(unsafe { transmute(0x56f2u32) }), 0x3050 => Some(unsafe { transmute(0x5937u32) }), 0x3051 => Some(unsafe { transmute(0x59d4u32) }), 0x3052 => Some(unsafe { transmute(0x5a01u32) }), 0x3053 => Some(unsafe { transmute(0x5c09u32) }), 0x3054 => Some(unsafe { transmute(0x60dfu32) }), 0x3055 => Some(unsafe { transmute(0x610fu32) }), 0x3056 => Some(unsafe { transmute(0x6170u32) }), 0x3057 => Some(unsafe { transmute(0x6613u32) }), 0x3058 => Some(unsafe { transmute(0x6905u32) }), 0x3059 => Some(unsafe { transmute(0x70bau32) }), 0x305a => Some(unsafe { transmute(0x754fu32) }), 0x305b => Some(unsafe { transmute(0x7570u32) }), 0x305c => Some(unsafe { transmute(0x79fbu32) }), 0x305d => Some(unsafe { transmute(0x7dadu32) }), 0x305e => Some(unsafe { transmute(0x7defu32) }), 0x305f => Some(unsafe { transmute(0x80c3u32) }), 0x3060 => Some(unsafe { transmute(0x840eu32) }), 0x3061 => Some(unsafe { transmute(0x8863u32) }), 0x3062 => Some(unsafe { transmute(0x8b02u32) }), 0x3063 => Some(unsafe { transmute(0x9055u32) }), 0x3064 => Some(unsafe { transmute(0x907au32) }), 0x3065 => Some(unsafe { transmute(0x533bu32) }), 0x3066 => Some(unsafe { transmute(0x4e95u32) }), 0x3067 => Some(unsafe { transmute(0x4ea5u32) }), 0x3068 => Some(unsafe { transmute(0x57dfu32) }), 0x3069 => Some(unsafe { transmute(0x80b2u32) }), 0x306a => Some(unsafe { transmute(0x90c1u32) }), 0x306b => Some(unsafe { transmute(0x78efu32) }), 0x306c => Some(unsafe { transmute(0x4e00u32) }), 0x306d => Some(unsafe { transmute(0x58f1u32) }), 0x306e => Some(unsafe { transmute(0x6ea2u32) }), 0x306f => Some(unsafe { transmute(0x9038u32) }), 0x3070 => Some(unsafe { transmute(0x7a32u32) }), 0x3071 => Some(unsafe { transmute(0x8328u32) }), 0x3072 => Some(unsafe { transmute(0x828bu32) }), 0x3073 => Some(unsafe { transmute(0x9c2fu32) }), 0x3074 => Some(unsafe { transmute(0x5141u32) }), 0x3075 => Some(unsafe { transmute(0x5370u32) }), 0x3076 => Some(unsafe { transmute(0x54bdu32) }), 0x3077 => Some(unsafe { transmute(0x54e1u32) }), 0x3078 => Some(unsafe { transmute(0x56e0u32) }), 0x3079 => Some(unsafe { transmute(0x59fbu32) }), 0x307a => Some(unsafe { transmute(0x5f15u32) }), 0x307b => Some(unsafe { transmute(0x98f2u32) }), 0x307c => Some(unsafe { transmute(0x6debu32) }), 0x307d => Some(unsafe { transmute(0x80e4u32) }), 0x307e => Some(unsafe { transmute(0x852du32) }), 0x3121 => Some(unsafe { transmute(0x9662u32) }), 0x3122 => Some(unsafe { transmute(0x9670u32) }), 0x3123 => Some(unsafe { transmute(0x96a0u32) }), 0x3124 => Some(unsafe { transmute(0x97fbu32) }), 0x3125 => Some(unsafe { transmute(0x540bu32) }), 0x3126 => Some(unsafe { transmute(0x53f3u32) }), 0x3127 => Some(unsafe { transmute(0x5b87u32) }), 0x3128 => Some(unsafe { transmute(0x70cfu32) }), 0x3129 => Some(unsafe { transmute(0x7fbdu32) }), 0x312a => Some(unsafe { transmute(0x8fc2u32) }), 0x312b => Some(unsafe { transmute(0x96e8u32) }), 0x312c => Some(unsafe { transmute(0x536fu32) }), 0x312d => Some(unsafe { transmute(0x9d5cu32) }), 0x312e => Some(unsafe { transmute(0x7abau32) }), 0x312f => Some(unsafe { transmute(0x4e11u32) }), 0x3130 => Some(unsafe { transmute(0x7893u32) }), 0x3131 => Some(unsafe { transmute(0x81fcu32) }), 0x3132 => Some(unsafe { transmute(0x6e26u32) }), 0x3133 => Some(unsafe { transmute(0x5618u32) }), 0x3134 => Some(unsafe { transmute(0x5504u32) }), 0x3135 => Some(unsafe { transmute(0x6b1du32) }), 0x3136 => Some(unsafe { transmute(0x851au32) }), 0x3137 => Some(unsafe { transmute(0x9c3bu32) }), 0x3138 => Some(unsafe { transmute(0x59e5u32) }), 0x3139 => Some(unsafe { transmute(0x53a9u32) }), 0x313a => Some(unsafe { transmute(0x6d66u32) }), 0x313b => Some(unsafe { transmute(0x74dcu32) }), 0x313c => Some(unsafe { transmute(0x958fu32) }), 0x313d => Some(unsafe { transmute(0x5642u32) }), 0x313e => Some(unsafe { transmute(0x4e91u32) }), 0x313f => Some(unsafe { transmute(0x904bu32) }), 0x3140 => Some(unsafe { transmute(0x96f2u32) }), 0x3141 => Some(unsafe { transmute(0x834fu32) }), 0x3142 => Some(unsafe { transmute(0x990cu32) }), 0x3143 => Some(unsafe { transmute(0x53e1u32) }), 0x3144 => Some(unsafe { transmute(0x55b6u32) }), 0x3145 => Some(unsafe { transmute(0x5b30u32) }), 0x3146 => Some(unsafe { transmute(0x5f71u32) }), 0x3147 => Some(unsafe { transmute(0x6620u32) }), 0x3148 => Some(unsafe { transmute(0x66f3u32) }), 0x3149 => Some(unsafe { transmute(0x6804u32) }), 0x314a => Some(unsafe { transmute(0x6c38u32) }), 0x314b => Some(unsafe { transmute(0x6cf3u32) }), 0x314c => Some(unsafe { transmute(0x6d29u32) }), 0x314d => Some(unsafe { transmute(0x745bu32) }), 0x314e => Some(unsafe { transmute(0x76c8u32) }), 0x314f => Some(unsafe { transmute(0x7a4eu32) }), 0x3150 => Some(unsafe { transmute(0x9834u32) }), 0x3151 => Some(unsafe { transmute(0x82f1u32) }), 0x3152 => Some(unsafe { transmute(0x885bu32) }), 0x3153 => Some(unsafe { transmute(0x8a60u32) }), 0x3154 => Some(unsafe { transmute(0x92edu32) }), 0x3155 => Some(unsafe { transmute(0x6db2u32) }), 0x3156 => Some(unsafe { transmute(0x75abu32) }), 0x3157 => Some(unsafe { transmute(0x76cau32) }), 0x3158 => Some(unsafe { transmute(0x99c5u32) }), 0x3159 => Some(unsafe { transmute(0x60a6u32) }), 0x315a => Some(unsafe { transmute(0x8b01u32) }), 0x315b => Some(unsafe { transmute(0x8d8au32) }), 0x315c => Some(unsafe { transmute(0x95b2u32) }), 0x315d => Some(unsafe { transmute(0x698eu32) }), 0x315e => Some(unsafe { transmute(0x53adu32) }), 0x315f => Some(unsafe { transmute(0x5186u32) }), 0x3160 => Some(unsafe { transmute(0x5712u32) }), 0x3161 => Some(unsafe { transmute(0x5830u32) }), 0x3162 => Some(unsafe { transmute(0x5944u32) }), 0x3163 => Some(unsafe { transmute(0x5bb4u32) }), 0x3164 => Some(unsafe { transmute(0x5ef6u32) }), 0x3165 => Some(unsafe { transmute(0x6028u32) }), 0x3166 => Some(unsafe { transmute(0x63a9u32) }), 0x3167 => Some(unsafe { transmute(0x63f4u32) }), 0x3168 => Some(unsafe { transmute(0x6cbfu32) }), 0x3169 => Some(unsafe { transmute(0x6f14u32) }), 0x316a => Some(unsafe { transmute(0x708eu32) }), 0x316b => Some(unsafe { transmute(0x7114u32) }), 0x316c => Some(unsafe { transmute(0x7159u32) }), 0x316d => Some(unsafe { transmute(0x71d5u32) }), 0x316e => Some(unsafe { transmute(0x733fu32) }), 0x316f => Some(unsafe { transmute(0x7e01u32) }), 0x3170 => Some(unsafe { transmute(0x8276u32) }), 0x3171 => Some(unsafe { transmute(0x82d1u32) }), 0x3172 => Some(unsafe { transmute(0x8597u32) }), 0x3173 => Some(unsafe { transmute(0x9060u32) }), 0x3174 => Some(unsafe { transmute(0x925bu32) }), 0x3175 => Some(unsafe { transmute(0x9d1bu32) }), 0x3176 => Some(unsafe { transmute(0x5869u32) }), 0x3177 => Some(unsafe { transmute(0x65bcu32) }), 0x3178 => Some(unsafe { transmute(0x6c5au32) }), 0x3179 => Some(unsafe { transmute(0x7525u32) }), 0x317a => Some(unsafe { transmute(0x51f9u32) }), 0x317b => Some(unsafe { transmute(0x592eu32) }), 0x317c => Some(unsafe { transmute(0x5965u32) }), 0x317d => Some(unsafe { transmute(0x5f80u32) }), 0x317e => Some(unsafe { transmute(0x5fdcu32) }), 0x3221 => Some(unsafe { transmute(0x62bcu32) }), 0x3222 => Some(unsafe { transmute(0x65fau32) }), 0x3223 => Some(unsafe { transmute(0x6a2au32) }), 0x3224 => Some(unsafe { transmute(0x6b27u32) }), 0x3225 => Some(unsafe { transmute(0x6bb4u32) }), 0x3226 => Some(unsafe { transmute(0x738bu32) }), 0x3227 => Some(unsafe { transmute(0x7fc1u32) }), 0x3228 => Some(unsafe { transmute(0x8956u32) }), 0x3229 => Some(unsafe { transmute(0x9d2cu32) }), 0x322a => Some(unsafe { transmute(0x9d0eu32) }), 0x322b => Some(unsafe { transmute(0x9ec4u32) }), 0x322c => Some(unsafe { transmute(0x5ca1u32) }), 0x322d => Some(unsafe { transmute(0x6c96u32) }), 0x322e => Some(unsafe { transmute(0x837bu32) }), 0x322f => Some(unsafe { transmute(0x5104u32) }), 0x3230 => Some(unsafe { transmute(0x5c4bu32) }), 0x3231 => Some(unsafe { transmute(0x61b6u32) }), 0x3232 => Some(unsafe { transmute(0x81c6u32) }), 0x3233 => Some(unsafe { transmute(0x6876u32) }), 0x3234 => Some(unsafe { transmute(0x7261u32) }), 0x3235 => Some(unsafe { transmute(0x4e59u32) }), 0x3236 => Some(unsafe { transmute(0x4ffau32) }), 0x3237 => Some(unsafe { transmute(0x5378u32) }), 0x3238 => Some(unsafe { transmute(0x6069u32) }), 0x3239 => Some(unsafe { transmute(0x6e29u32) }), 0x323a => Some(unsafe { transmute(0x7a4fu32) }), 0x323b => Some(unsafe { transmute(0x97f3u32) }), 0x323c => Some(unsafe { transmute(0x4e0bu32) }), 0x323d => Some(unsafe { transmute(0x5316u32) }), 0x323e => Some(unsafe { transmute(0x4eeeu32) }), 0x323f => Some(unsafe { transmute(0x4f55u32) }), 0x3240 => Some(unsafe { transmute(0x4f3du32) }), 0x3241 => Some(unsafe { transmute(0x4fa1u32) }), 0x3242 => Some(unsafe { transmute(0x4f73u32) }), 0x3243 => Some(unsafe { transmute(0x52a0u32) }), 0x3244 => Some(unsafe { transmute(0x53efu32) }), 0x3245 => Some(unsafe { transmute(0x5609u32) }), 0x3246 => Some(unsafe { transmute(0x590fu32) }), 0x3247 => Some(unsafe { transmute(0x5ac1u32) }), 0x3248 => Some(unsafe { transmute(0x5bb6u32) }), 0x3249 => Some(unsafe { transmute(0x5be1u32) }), 0x324a => Some(unsafe { transmute(0x79d1u32) }), 0x324b => Some(unsafe { transmute(0x6687u32) }), 0x324c => Some(unsafe { transmute(0x679cu32) }), 0x324d => Some(unsafe { transmute(0x67b6u32) }), 0x324e => Some(unsafe { transmute(0x6b4cu32) }), 0x324f => Some(unsafe { transmute(0x6cb3u32) }), 0x3250 => Some(unsafe { transmute(0x706bu32) }), 0x3251 => Some(unsafe { transmute(0x73c2u32) }), 0x3252 => Some(unsafe { transmute(0x798du32) }), 0x3253 => Some(unsafe { transmute(0x79beu32) }), 0x3254 => Some(unsafe { transmute(0x7a3cu32) }), 0x3255 => Some(unsafe { transmute(0x7b87u32) }), 0x3256 => Some(unsafe { transmute(0x82b1u32) }), 0x3257 => Some(unsafe { transmute(0x82dbu32) }), 0x3258 => Some(unsafe { transmute(0x8304u32) }), 0x3259 => Some(unsafe { transmute(0x8377u32) }), 0x325a => Some(unsafe { transmute(0x83efu32) }), 0x325b => Some(unsafe { transmute(0x83d3u32) }), 0x325c => Some(unsafe { transmute(0x8766u32) }), 0x325d => Some(unsafe { transmute(0x8ab2u32) }), 0x325e => Some(unsafe { transmute(0x5629u32) }), 0x325f => Some(unsafe { transmute(0x8ca8u32) }), 0x3260 => Some(unsafe { transmute(0x8fe6u32) }), 0x3261 => Some(unsafe { transmute(0x904eu32) }), 0x3262 => Some(unsafe { transmute(0x971eu32) }), 0x3263 => Some(unsafe { transmute(0x868au32) }), 0x3264 => Some(unsafe { transmute(0x4fc4u32) }), 0x3265 => Some(unsafe { transmute(0x5ce8u32) }), 0x3266 => Some(unsafe { transmute(0x6211u32) }), 0x3267 => Some(unsafe { transmute(0x7259u32) }), 0x3268 => Some(unsafe { transmute(0x753bu32) }), 0x3269 => Some(unsafe { transmute(0x81e5u32) }), 0x326a => Some(unsafe { transmute(0x82bdu32) }), 0x326b => Some(unsafe { transmute(0x86feu32) }), 0x326c => Some(unsafe { transmute(0x8cc0u32) }), 0x326d => Some(unsafe { transmute(0x96c5u32) }), 0x326e => Some(unsafe { transmute(0x9913u32) }), 0x326f => Some(unsafe { transmute(0x99d5u32) }), 0x3270 => Some(unsafe { transmute(0x4ecbu32) }), 0x3271 => Some(unsafe { transmute(0x4f1au32) }), 0x3272 => Some(unsafe { transmute(0x89e3u32) }), 0x3273 => Some(unsafe { transmute(0x56deu32) }), 0x3274 => Some(unsafe { transmute(0x584au32) }), 0x3275 => Some(unsafe { transmute(0x58cau32) }), 0x3276 => Some(unsafe { transmute(0x5efbu32) }), 0x3277 => Some(unsafe { transmute(0x5febu32) }), 0x3278 => Some(unsafe { transmute(0x602au32) }), 0x3279 => Some(unsafe { transmute(0x6094u32) }), 0x327a => Some(unsafe { transmute(0x6062u32) }), 0x327b => Some(unsafe { transmute(0x61d0u32) }), 0x327c => Some(unsafe { transmute(0x6212u32) }), 0x327d => Some(unsafe { transmute(0x62d0u32) }), 0x327e => Some(unsafe { transmute(0x6539u32) }), 0x3321 => Some(unsafe { transmute(0x9b41u32) }), 0x3322 => Some(unsafe { transmute(0x6666u32) }), 0x3323 => Some(unsafe { transmute(0x68b0u32) }), 0x3324 => Some(unsafe { transmute(0x6d77u32) }), 0x3325 => Some(unsafe { transmute(0x7070u32) }), 0x3326 => Some(unsafe { transmute(0x754cu32) }), 0x3327 => Some(unsafe { transmute(0x7686u32) }), 0x3328 => Some(unsafe { transmute(0x7d75u32) }), 0x3329 => Some(unsafe { transmute(0x82a5u32) }), 0x332a => Some(unsafe { transmute(0x87f9u32) }), 0x332b => Some(unsafe { transmute(0x958bu32) }), 0x332c => Some(unsafe { transmute(0x968eu32) }), 0x332d => Some(unsafe { transmute(0x8c9du32) }), 0x332e => Some(unsafe { transmute(0x51f1u32) }), 0x332f => Some(unsafe { transmute(0x52beu32) }), 0x3330 => Some(unsafe { transmute(0x5916u32) }), 0x3331 => Some(unsafe { transmute(0x54b3u32) }), 0x3332 => Some(unsafe { transmute(0x5bb3u32) }), 0x3333 => Some(unsafe { transmute(0x5d16u32) }), 0x3334 => Some(unsafe { transmute(0x6168u32) }), 0x3335 => Some(unsafe { transmute(0x6982u32) }), 0x3336 => Some(unsafe { transmute(0x6dafu32) }), 0x3337 => Some(unsafe { transmute(0x788du32) }), 0x3338 => Some(unsafe { transmute(0x84cbu32) }), 0x3339 => Some(unsafe { transmute(0x8857u32) }), 0x333a => Some(unsafe { transmute(0x8a72u32) }), 0x333b => Some(unsafe { transmute(0x93a7u32) }), 0x333c => Some(unsafe { transmute(0x9ab8u32) }), 0x333d => Some(unsafe { transmute(0x6d6cu32) }), 0x333e => Some(unsafe { transmute(0x99a8u32) }), 0x333f => Some(unsafe { transmute(0x86d9u32) }), 0x3340 => Some(unsafe { transmute(0x57a3u32) }), 0x3341 => Some(unsafe { transmute(0x67ffu32) }), 0x3342 => Some(unsafe { transmute(0x86ceu32) }), 0x3343 => Some(unsafe { transmute(0x920eu32) }), 0x3344 => Some(unsafe { transmute(0x5283u32) }), 0x3345 => Some(unsafe { transmute(0x5687u32) }), 0x3346 => Some(unsafe { transmute(0x5404u32) }), 0x3347 => Some(unsafe { transmute(0x5ed3u32) }), 0x3348 => Some(unsafe { transmute(0x62e1u32) }), 0x3349 => Some(unsafe { transmute(0x64b9u32) }), 0x334a => Some(unsafe { transmute(0x683cu32) }), 0x334b => Some(unsafe { transmute(0x6838u32) }), 0x334c => Some(unsafe { transmute(0x6bbbu32) }), 0x334d => Some(unsafe { transmute(0x7372u32) }), 0x334e => Some(unsafe { transmute(0x78bau32) }), 0x334f => Some(unsafe { transmute(0x7a6bu32) }), 0x3350 => Some(unsafe { transmute(0x899au32) }), 0x3351 => Some(unsafe { transmute(0x89d2u32) }), 0x3352 => Some(unsafe { transmute(0x8d6bu32) }), 0x3353 => Some(unsafe { transmute(0x8f03u32) }), 0x3354 => Some(unsafe { transmute(0x90edu32) }), 0x3355 => Some(unsafe { transmute(0x95a3u32) }), 0x3356 => Some(unsafe { transmute(0x9694u32) }), 0x3357 => Some(unsafe { transmute(0x9769u32) }), 0x3358 => Some(unsafe { transmute(0x5b66u32) }), 0x3359 => Some(unsafe { transmute(0x5cb3u32) }), 0x335a => Some(unsafe { transmute(0x697du32) }), 0x335b => Some(unsafe { transmute(0x984du32) }), 0x335c => Some(unsafe { transmute(0x984eu32) }), 0x335d => Some(unsafe { transmute(0x639bu32) }), 0x335e => Some(unsafe { transmute(0x7b20u32) }), 0x335f => Some(unsafe { transmute(0x6a2bu32) }), 0x3360 => Some(unsafe { transmute(0x6a7fu32) }), 0x3361 => Some(unsafe { transmute(0x68b6u32) }), 0x3362 => Some(unsafe { transmute(0x9c0du32) }), 0x3363 => Some(unsafe { transmute(0x6f5fu32) }), 0x3364 => Some(unsafe { transmute(0x5272u32) }), 0x3365 => Some(unsafe { transmute(0x559du32) }), 0x3366 => Some(unsafe { transmute(0x6070u32) }), 0x3367 => Some(unsafe { transmute(0x62ecu32) }), 0x3368 => Some(unsafe { transmute(0x6d3bu32) }), 0x3369 => Some(unsafe { transmute(0x6e07u32) }), 0x336a => Some(unsafe { transmute(0x6ed1u32) }), 0x336b => Some(unsafe { transmute(0x845bu32) }), 0x336c => Some(unsafe { transmute(0x8910u32) }), 0x336d => Some(unsafe { transmute(0x8f44u32) }), 0x336e => Some(unsafe { transmute(0x4e14u32) }), 0x336f => Some(unsafe { transmute(0x9c39u32) }), 0x3370 => Some(unsafe { transmute(0x53f6u32) }), 0x3371 => Some(unsafe { transmute(0x691bu32) }), 0x3372 => Some(unsafe { transmute(0x6a3au32) }), 0x3373 => Some(unsafe { transmute(0x9784u32) }), 0x3374 => Some(unsafe { transmute(0x682au32) }), 0x3375 => Some(unsafe { transmute(0x515cu32) }), 0x3376 => Some(unsafe { transmute(0x7ac3u32) }), 0x3377 => Some(unsafe { transmute(0x84b2u32) }), 0x3378 => Some(unsafe { transmute(0x91dcu32) }), 0x3379 => Some(unsafe { transmute(0x938cu32) }), 0x337a => Some(unsafe { transmute(0x565bu32) }), 0x337b => Some(unsafe { transmute(0x9d28u32) }), 0x337c => Some(unsafe { transmute(0x6822u32) }), 0x337d => Some(unsafe { transmute(0x8305u32) }), 0x337e => Some(unsafe { transmute(0x8431u32) }), 0x3421 => Some(unsafe { transmute(0x7ca5u32) }), 0x3422 => Some(unsafe { transmute(0x5208u32) }), 0x3423 => Some(unsafe { transmute(0x82c5u32) }), 0x3424 => Some(unsafe { transmute(0x74e6u32) }), 0x3425 => Some(unsafe { transmute(0x4e7eu32) }), 0x3426 => Some(unsafe { transmute(0x4f83u32) }), 0x3427 => Some(unsafe { transmute(0x51a0u32) }), 0x3428 => Some(unsafe { transmute(0x5bd2u32) }), 0x3429 => Some(unsafe { transmute(0x520au32) }), 0x342a => Some(unsafe { transmute(0x52d8u32) }), 0x342b => Some(unsafe { transmute(0x52e7u32) }), 0x342c => Some(unsafe { transmute(0x5dfbu32) }), 0x342d => Some(unsafe { transmute(0x559au32) }), 0x342e => Some(unsafe { transmute(0x582au32) }), 0x342f => Some(unsafe { transmute(0x59e6u32) }), 0x3430 => Some(unsafe { transmute(0x5b8cu32) }), 0x3431 => Some(unsafe { transmute(0x5b98u32) }), 0x3432 => Some(unsafe { transmute(0x5bdbu32) }), 0x3433 => Some(unsafe { transmute(0x5e72u32) }), 0x3434 => Some(unsafe { transmute(0x5e79u32) }), 0x3435 => Some(unsafe { transmute(0x60a3u32) }), 0x3436 => Some(unsafe { transmute(0x611fu32) }), 0x3437 => Some(unsafe { transmute(0x6163u32) }), 0x3438 => Some(unsafe { transmute(0x61beu32) }), 0x3439 => Some(unsafe { transmute(0x63dbu32) }), 0x343a => Some(unsafe { transmute(0x6562u32) }), 0x343b => Some(unsafe { transmute(0x67d1u32) }), 0x343c => Some(unsafe { transmute(0x6853u32) }), 0x343d => Some(unsafe { transmute(0x68fau32) }), 0x343e => Some(unsafe { transmute(0x6b3eu32) }), 0x343f => Some(unsafe { transmute(0x6b53u32) }), 0x3440 => Some(unsafe { transmute(0x6c57u32) }), 0x3441 => Some(unsafe { transmute(0x6f22u32) }), 0x3442 => Some(unsafe { transmute(0x6f97u32) }), 0x3443 => Some(unsafe { transmute(0x6f45u32) }), 0x3444 => Some(unsafe { transmute(0x74b0u32) }), 0x3445 => Some(unsafe { transmute(0x7518u32) }), 0x3446 => Some(unsafe { transmute(0x76e3u32) }), 0x3447 => Some(unsafe { transmute(0x770bu32) }), 0x3448 => Some(unsafe { transmute(0x7affu32) }), 0x3449 => Some(unsafe { transmute(0x7ba1u32) }), 0x344a => Some(unsafe { transmute(0x7c21u32) }), 0x344b => Some(unsafe { transmute(0x7de9u32) }), 0x344c => Some(unsafe { transmute(0x7f36u32) }), 0x344d => Some(unsafe { transmute(0x7ff0u32) }), 0x344e => Some(unsafe { transmute(0x809du32) }), 0x344f => Some(unsafe { transmute(0x8266u32) }), 0x3450 => Some(unsafe { transmute(0x839eu32) }), 0x3451 => Some(unsafe { transmute(0x89b3u32) }), 0x3452 => Some(unsafe { transmute(0x8accu32) }), 0x3453 => Some(unsafe { transmute(0x8cabu32) }), 0x3454 => Some(unsafe { transmute(0x9084u32) }), 0x3455 => Some(unsafe { transmute(0x9451u32) }), 0x3456 => Some(unsafe { transmute(0x9593u32) }), 0x3457 => Some(unsafe { transmute(0x9591u32) }), 0x3458 => Some(unsafe { transmute(0x95a2u32) }), 0x3459 => Some(unsafe { transmute(0x9665u32) }), 0x345a => Some(unsafe { transmute(0x97d3u32) }), 0x345b => Some(unsafe { transmute(0x9928u32) }), 0x345c => Some(unsafe { transmute(0x8218u32) }), 0x345d => Some(unsafe { transmute(0x4e38u32) }), 0x345e => Some(unsafe { transmute(0x542bu32) }), 0x345f => Some(unsafe { transmute(0x5cb8u32) }), 0x3460 => Some(unsafe { transmute(0x5dccu32) }), 0x3461 => Some(unsafe { transmute(0x73a9u32) }), 0x3462 => Some(unsafe { transmute(0x764cu32) }), 0x3463 => Some(unsafe { transmute(0x773cu32) }), 0x3464 => Some(unsafe { transmute(0x5ca9u32) }), 0x3465 => Some(unsafe { transmute(0x7febu32) }), 0x3466 => Some(unsafe { transmute(0x8d0bu32) }), 0x3467 => Some(unsafe { transmute(0x96c1u32) }), 0x3468 => Some(unsafe { transmute(0x9811u32) }), 0x3469 => Some(unsafe { transmute(0x9854u32) }), 0x346a => Some(unsafe { transmute(0x9858u32) }), 0x346b => Some(unsafe { transmute(0x4f01u32) }), 0x346c => Some(unsafe { transmute(0x4f0eu32) }), 0x346d => Some(unsafe { transmute(0x5371u32) }), 0x346e => Some(unsafe { transmute(0x559cu32) }), 0x346f => Some(unsafe { transmute(0x5668u32) }), 0x3470 => Some(unsafe { transmute(0x57fau32) }), 0x3471 => Some(unsafe { transmute(0x5947u32) }), 0x3472 => Some(unsafe { transmute(0x5b09u32) }), 0x3473 => Some(unsafe { transmute(0x5bc4u32) }), 0x3474 => Some(unsafe { transmute(0x5c90u32) }), 0x3475 => Some(unsafe { transmute(0x5e0cu32) }), 0x3476 => Some(unsafe { transmute(0x5e7eu32) }), 0x3477 => Some(unsafe { transmute(0x5fccu32) }), 0x3478 => Some(unsafe { transmute(0x63eeu32) }), 0x3479 => Some(unsafe { transmute(0x673au32) }), 0x347a => Some(unsafe { transmute(0x65d7u32) }), 0x347b => Some(unsafe { transmute(0x65e2u32) }), 0x347c => Some(unsafe { transmute(0x671fu32) }), 0x347d => Some(unsafe { transmute(0x68cbu32) }), 0x347e => Some(unsafe { transmute(0x68c4u32) }), 0x3521 => Some(unsafe { transmute(0x6a5fu32) }), 0x3522 => Some(unsafe { transmute(0x5e30u32) }), 0x3523 => Some(unsafe { transmute(0x6bc5u32) }), 0x3524 => Some(unsafe { transmute(0x6c17u32) }), 0x3525 => Some(unsafe { transmute(0x6c7du32) }), 0x3526 => Some(unsafe { transmute(0x757fu32) }), 0x3527 => Some(unsafe { transmute(0x7948u32) }), 0x3528 => Some(unsafe { transmute(0x5b63u32) }), 0x3529 => Some(unsafe { transmute(0x7a00u32) }), 0x352a => Some(unsafe { transmute(0x7d00u32) }), 0x352b => Some(unsafe { transmute(0x5fbdu32) }), 0x352c => Some(unsafe { transmute(0x898fu32) }), 0x352d => Some(unsafe { transmute(0x8a18u32) }), 0x352e => Some(unsafe { transmute(0x8cb4u32) }), 0x352f => Some(unsafe { transmute(0x8d77u32) }), 0x3530 => Some(unsafe { transmute(0x8eccu32) }), 0x3531 => Some(unsafe { transmute(0x8f1du32) }), 0x3532 => Some(unsafe { transmute(0x98e2u32) }), 0x3533 => Some(unsafe { transmute(0x9a0eu32) }), 0x3534 => Some(unsafe { transmute(0x9b3cu32) }), 0x3535 => Some(unsafe { transmute(0x4e80u32) }), 0x3536 => Some(unsafe { transmute(0x507du32) }), 0x3537 => Some(unsafe { transmute(0x5100u32) }), 0x3538 => Some(unsafe { transmute(0x5993u32) }), 0x3539 => Some(unsafe { transmute(0x5b9cu32) }), 0x353a => Some(unsafe { transmute(0x622fu32) }), 0x353b => Some(unsafe { transmute(0x6280u32) }), 0x353c => Some(unsafe { transmute(0x64ecu32) }), 0x353d => Some(unsafe { transmute(0x6b3au32) }), 0x353e => Some(unsafe { transmute(0x72a0u32) }), 0x353f => Some(unsafe { transmute(0x7591u32) }), 0x3540 => Some(unsafe { transmute(0x7947u32) }), 0x3541 => Some(unsafe { transmute(0x7fa9u32) }), 0x3542 => Some(unsafe { transmute(0x87fbu32) }), 0x3543 => Some(unsafe { transmute(0x8abcu32) }), 0x3544 => Some(unsafe { transmute(0x8b70u32) }), 0x3545 => Some(unsafe { transmute(0x63acu32) }), 0x3546 => Some(unsafe { transmute(0x83cau32) }), 0x3547 => Some(unsafe { transmute(0x97a0u32) }), 0x3548 => Some(unsafe { transmute(0x5409u32) }), 0x3549 => Some(unsafe { transmute(0x5403u32) }), 0x354a => Some(unsafe { transmute(0x55abu32) }), 0x354b => Some(unsafe { transmute(0x6854u32) }), 0x354c => Some(unsafe { transmute(0x6a58u32) }), 0x354d => Some(unsafe { transmute(0x8a70u32) }), 0x354e => Some(unsafe { transmute(0x7827u32) }), 0x354f => Some(unsafe { transmute(0x6775u32) }), 0x3550 => Some(unsafe { transmute(0x9ecdu32) }), 0x3551 => Some(unsafe { transmute(0x5374u32) }), 0x3552 => Some(unsafe { transmute(0x5ba2u32) }), 0x3553 => Some(unsafe { transmute(0x811au32) }), 0x3554 => Some(unsafe { transmute(0x8650u32) }), 0x3555 => Some(unsafe { transmute(0x9006u32) }), 0x3556 => Some(unsafe { transmute(0x4e18u32) }), 0x3557 => Some(unsafe { transmute(0x4e45u32) }), 0x3558 => Some(unsafe { transmute(0x4ec7u32) }), 0x3559 => Some(unsafe { transmute(0x4f11u32) }), 0x355a => Some(unsafe { transmute(0x53cau32) }), 0x355b => Some(unsafe { transmute(0x5438u32) }), 0x355c => Some(unsafe { transmute(0x5baeu32) }), 0x355d => Some(unsafe { transmute(0x5f13u32) }), 0x355e => Some(unsafe { transmute(0x6025u32) }), 0x355f => Some(unsafe { transmute(0x6551u32) }), 0x3560 => Some(unsafe { transmute(0x673du32) }), 0x3561 => Some(unsafe { transmute(0x6c42u32) }), 0x3562 => Some(unsafe { transmute(0x6c72u32) }), 0x3563 => Some(unsafe { transmute(0x6ce3u32) }), 0x3564 => Some(unsafe { transmute(0x7078u32) }), 0x3565 => Some(unsafe { transmute(0x7403u32) }), 0x3566 => Some(unsafe { transmute(0x7a76u32) }), 0x3567 => Some(unsafe { transmute(0x7aaeu32) }), 0x3568 => Some(unsafe { transmute(0x7b08u32) }), 0x3569 => Some(unsafe { transmute(0x7d1au32) }), 0x356a => Some(unsafe { transmute(0x7cfeu32) }), 0x356b => Some(unsafe { transmute(0x7d66u32) }), 0x356c => Some(unsafe { transmute(0x65e7u32) }), 0x356d => Some(unsafe { transmute(0x725bu32) }), 0x356e => Some(unsafe { transmute(0x53bbu32) }), 0x356f => Some(unsafe { transmute(0x5c45u32) }), 0x3570 => Some(unsafe { transmute(0x5de8u32) }), 0x3571 => Some(unsafe { transmute(0x62d2u32) }), 0x3572 => Some(unsafe { transmute(0x62e0u32) }), 0x3573 => Some(unsafe { transmute(0x6319u32) }), 0x3574 => Some(unsafe { transmute(0x6e20u32) }), 0x3575 => Some(unsafe { transmute(0x865au32) }), 0x3576 => Some(unsafe { transmute(0x8a31u32) }), 0x3577 => Some(unsafe { transmute(0x8dddu32) }), 0x3578 => Some(unsafe { transmute(0x92f8u32) }), 0x3579 => Some(unsafe { transmute(0x6f01u32) }), 0x357a => Some(unsafe { transmute(0x79a6u32) }), 0x357b => Some(unsafe { transmute(0x9b5au32) }), 0x357c => Some(unsafe { transmute(0x4ea8u32) }), 0x357d => Some(unsafe { transmute(0x4eabu32) }), 0x357e => Some(unsafe { transmute(0x4eacu32) }), 0x3621 => Some(unsafe { transmute(0x4f9bu32) }), 0x3622 => Some(unsafe { transmute(0x4fa0u32) }), 0x3623 => Some(unsafe { transmute(0x50d1u32) }), 0x3624 => Some(unsafe { transmute(0x5147u32) }), 0x3625 => Some(unsafe { transmute(0x7af6u32) }), 0x3626 => Some(unsafe { transmute(0x5171u32) }), 0x3627 => Some(unsafe { transmute(0x51f6u32) }), 0x3628 => Some(unsafe { transmute(0x5354u32) }), 0x3629 => Some(unsafe { transmute(0x5321u32) }), 0x362a => Some(unsafe { transmute(0x537fu32) }), 0x362b => Some(unsafe { transmute(0x53ebu32) }), 0x362c => Some(unsafe { transmute(0x55acu32) }), 0x362d => Some(unsafe { transmute(0x5883u32) }), 0x362e => Some(unsafe { transmute(0x5ce1u32) }), 0x362f => Some(unsafe { transmute(0x5f37u32) }), 0x3630 => Some(unsafe { transmute(0x5f4au32) }), 0x3631 => Some(unsafe { transmute(0x602fu32) }), 0x3632 => Some(unsafe { transmute(0x6050u32) }), 0x3633 => Some(unsafe { transmute(0x606du32) }), 0x3634 => Some(unsafe { transmute(0x631fu32) }), 0x3635 => Some(unsafe { transmute(0x6559u32) }), 0x3636 => Some(unsafe { transmute(0x6a4bu32) }), 0x3637 => Some(unsafe { transmute(0x6cc1u32) }), 0x3638 => Some(unsafe { transmute(0x72c2u32) }), 0x3639 => Some(unsafe { transmute(0x72edu32) }), 0x363a => Some(unsafe { transmute(0x77efu32) }), 0x363b => Some(unsafe { transmute(0x80f8u32) }), 0x363c => Some(unsafe { transmute(0x8105u32) }), 0x363d => Some(unsafe { transmute(0x8208u32) }), 0x363e => Some(unsafe { transmute(0x854eu32) }), 0x363f => Some(unsafe { transmute(0x90f7u32) }), 0x3640 => Some(unsafe { transmute(0x93e1u32) }), 0x3641 => Some(unsafe { transmute(0x97ffu32) }), 0x3642 => Some(unsafe { transmute(0x9957u32) }), 0x3643 => Some(unsafe { transmute(0x9a5au32) }), 0x3644 => Some(unsafe { transmute(0x4ef0u32) }), 0x3645 => Some(unsafe { transmute(0x51ddu32) }), 0x3646 => Some(unsafe { transmute(0x5c2du32) }), 0x3647 => Some(unsafe { transmute(0x6681u32) }), 0x3648 => Some(unsafe { transmute(0x696du32) }), 0x3649 => Some(unsafe { transmute(0x5c40u32) }), 0x364a => Some(unsafe { transmute(0x66f2u32) }), 0x364b => Some(unsafe { transmute(0x6975u32) }), 0x364c => Some(unsafe { transmute(0x7389u32) }), 0x364d => Some(unsafe { transmute(0x6850u32) }), 0x364e => Some(unsafe { transmute(0x7c81u32) }), 0x364f => Some(unsafe { transmute(0x50c5u32) }), 0x3650 => Some(unsafe { transmute(0x52e4u32) }), 0x3651 => Some(unsafe { transmute(0x5747u32) }), 0x3652 => Some(unsafe { transmute(0x5dfeu32) }), 0x3653 => Some(unsafe { transmute(0x9326u32) }), 0x3654 => Some(unsafe { transmute(0x65a4u32) }), 0x3655 => Some(unsafe { transmute(0x6b23u32) }), 0x3656 => Some(unsafe { transmute(0x6b3du32) }), 0x3657 => Some(unsafe { transmute(0x7434u32) }), 0x3658 => Some(unsafe { transmute(0x7981u32) }), 0x3659 => Some(unsafe { transmute(0x79bdu32) }), 0x365a => Some(unsafe { transmute(0x7b4bu32) }), 0x365b => Some(unsafe { transmute(0x7dcau32) }), 0x365c => Some(unsafe { transmute(0x82b9u32) }), 0x365d => Some(unsafe { transmute(0x83ccu32) }), 0x365e => Some(unsafe { transmute(0x887fu32) }), 0x365f => Some(unsafe { transmute(0x895fu32) }), 0x3660 => Some(unsafe { transmute(0x8b39u32) }), 0x3661 => Some(unsafe { transmute(0x8fd1u32) }), 0x3662 => Some(unsafe { transmute(0x91d1u32) }), 0x3663 => Some(unsafe { transmute(0x541fu32) }), 0x3664 => Some(unsafe { transmute(0x9280u32) }), 0x3665 => Some(unsafe { transmute(0x4e5du32) }), 0x3666 => Some(unsafe { transmute(0x5036u32) }), 0x3667 => Some(unsafe { transmute(0x53e5u32) }), 0x3668 => Some(unsafe { transmute(0x533au32) }), 0x3669 => Some(unsafe { transmute(0x72d7u32) }), 0x366a => Some(unsafe { transmute(0x7396u32) }), 0x366b => Some(unsafe { transmute(0x77e9u32) }), 0x366c => Some(unsafe { transmute(0x82e6u32) }), 0x366d => Some(unsafe { transmute(0x8eafu32) }), 0x366e => Some(unsafe { transmute(0x99c6u32) }), 0x366f => Some(unsafe { transmute(0x99c8u32) }), 0x3670 => Some(unsafe { transmute(0x99d2u32) }), 0x3671 => Some(unsafe { transmute(0x5177u32) }), 0x3672 => Some(unsafe { transmute(0x611au32) }), 0x3673 => Some(unsafe { transmute(0x865eu32) }), 0x3674 => Some(unsafe { transmute(0x55b0u32) }), 0x3675 => Some(unsafe { transmute(0x7a7au32) }), 0x3676 => Some(unsafe { transmute(0x5076u32) }), 0x3677 => Some(unsafe { transmute(0x5bd3u32) }), 0x3678 => Some(unsafe { transmute(0x9047u32) }), 0x3679 => Some(unsafe { transmute(0x9685u32) }), 0x367a => Some(unsafe { transmute(0x4e32u32) }), 0x367b => Some(unsafe { transmute(0x6adbu32) }), 0x367c => Some(unsafe { transmute(0x91e7u32) }), 0x367d => Some(unsafe { transmute(0x5c51u32) }), 0x367e => Some(unsafe { transmute(0x5c48u32) }), 0x3721 => Some(unsafe { transmute(0x6398u32) }), 0x3722 => Some(unsafe { transmute(0x7a9fu32) }), 0x3723 => Some(unsafe { transmute(0x6c93u32) }), 0x3724 => Some(unsafe { transmute(0x9774u32) }), 0x3725 => Some(unsafe { transmute(0x8f61u32) }), 0x3726 => Some(unsafe { transmute(0x7aaau32) }), 0x3727 => Some(unsafe { transmute(0x718au32) }), 0x3728 => Some(unsafe { transmute(0x9688u32) }), 0x3729 => Some(unsafe { transmute(0x7c82u32) }), 0x372a => Some(unsafe { transmute(0x6817u32) }), 0x372b => Some(unsafe { transmute(0x7e70u32) }), 0x372c => Some(unsafe { transmute(0x6851u32) }), 0x372d => Some(unsafe { transmute(0x936cu32) }), 0x372e => Some(unsafe { transmute(0x52f2u32) }), 0x372f => Some(unsafe { transmute(0x541bu32) }), 0x3730 => Some(unsafe { transmute(0x85abu32) }), 0x3731 => Some(unsafe { transmute(0x8a13u32) }), 0x3732 => Some(unsafe { transmute(0x7fa4u32) }), 0x3733 => Some(unsafe { transmute(0x8ecdu32) }), 0x3734 => Some(unsafe { transmute(0x90e1u32) }), 0x3735 => Some(unsafe { transmute(0x5366u32) }), 0x3736 => Some(unsafe { transmute(0x8888u32) }), 0x3737 => Some(unsafe { transmute(0x7941u32) }), 0x3738 => Some(unsafe { transmute(0x4fc2u32) }), 0x3739 => Some(unsafe { transmute(0x50beu32) }), 0x373a => Some(unsafe { transmute(0x5211u32) }), 0x373b => Some(unsafe { transmute(0x5144u32) }), 0x373c => Some(unsafe { transmute(0x5553u32) }), 0x373d => Some(unsafe { transmute(0x572du32) }), 0x373e => Some(unsafe { transmute(0x73eau32) }), 0x373f => Some(unsafe { transmute(0x578bu32) }), 0x3740 => Some(unsafe { transmute(0x5951u32) }), 0x3741 => Some(unsafe { transmute(0x5f62u32) }), 0x3742 => Some(unsafe { transmute(0x5f84u32) }), 0x3743 => Some(unsafe { transmute(0x6075u32) }), 0x3744 => Some(unsafe { transmute(0x6176u32) }), 0x3745 => Some(unsafe { transmute(0x6167u32) }), 0x3746 => Some(unsafe { transmute(0x61a9u32) }), 0x3747 => Some(unsafe { transmute(0x63b2u32) }), 0x3748 => Some(unsafe { transmute(0x643au32) }), 0x3749 => Some(unsafe { transmute(0x656cu32) }), 0x374a => Some(unsafe { transmute(0x666fu32) }), 0x374b => Some(unsafe { transmute(0x6842u32) }), 0x374c => Some(unsafe { transmute(0x6e13u32) }), 0x374d => Some(unsafe { transmute(0x7566u32) }), 0x374e => Some(unsafe { transmute(0x7a3du32) }), 0x374f => Some(unsafe { transmute(0x7cfbu32) }), 0x3750 => Some(unsafe { transmute(0x7d4cu32) }), 0x3751 => Some(unsafe { transmute(0x7d99u32) }), 0x3752 => Some(unsafe { transmute(0x7e4bu32) }), 0x3753 => Some(unsafe { transmute(0x7f6bu32) }), 0x3754 => Some(unsafe { transmute(0x830eu32) }), 0x3755 => Some(unsafe { transmute(0x834au32) }), 0x3756 => Some(unsafe { transmute(0x86cdu32) }), 0x3757 => Some(unsafe { transmute(0x8a08u32) }), 0x3758 => Some(unsafe { transmute(0x8a63u32) }), 0x3759 => Some(unsafe { transmute(0x8b66u32) }), 0x375a => Some(unsafe { transmute(0x8efdu32) }), 0x375b => Some(unsafe { transmute(0x981au32) }), 0x375c => Some(unsafe { transmute(0x9d8fu32) }), 0x375d => Some(unsafe { transmute(0x82b8u32) }), 0x375e => Some(unsafe { transmute(0x8fceu32) }), 0x375f => Some(unsafe { transmute(0x9be8u32) }), 0x3760 => Some(unsafe { transmute(0x5287u32) }), 0x3761 => Some(unsafe { transmute(0x621fu32) }), 0x3762 => Some(unsafe { transmute(0x6483u32) }), 0x3763 => Some(unsafe { transmute(0x6fc0u32) }), 0x3764 => Some(unsafe { transmute(0x9699u32) }), 0x3765 => Some(unsafe { transmute(0x6841u32) }), 0x3766 => Some(unsafe { transmute(0x5091u32) }), 0x3767 => Some(unsafe { transmute(0x6b20u32) }), 0x3768 => Some(unsafe { transmute(0x6c7au32) }), 0x3769 => Some(unsafe { transmute(0x6f54u32) }), 0x376a => Some(unsafe { transmute(0x7a74u32) }), 0x376b => Some(unsafe { transmute(0x7d50u32) }), 0x376c => Some(unsafe { transmute(0x8840u32) }), 0x376d => Some(unsafe { transmute(0x8a23u32) }), 0x376e => Some(unsafe { transmute(0x6708u32) }), 0x376f => Some(unsafe { transmute(0x4ef6u32) }), 0x3770 => Some(unsafe { transmute(0x5039u32) }), 0x3771 => Some(unsafe { transmute(0x5026u32) }), 0x3772 => Some(unsafe { transmute(0x5065u32) }), 0x3773 => Some(unsafe { transmute(0x517cu32) }), 0x3774 => Some(unsafe { transmute(0x5238u32) }), 0x3775 => Some(unsafe { transmute(0x5263u32) }), 0x3776 => Some(unsafe { transmute(0x55a7u32) }), 0x3777 => Some(unsafe { transmute(0x570fu32) }), 0x3778 => Some(unsafe { transmute(0x5805u32) }), 0x3779 => Some(unsafe { transmute(0x5accu32) }), 0x377a => Some(unsafe { transmute(0x5efau32) }), 0x377b => Some(unsafe { transmute(0x61b2u32) }), 0x377c => Some(unsafe { transmute(0x61f8u32) }), 0x377d => Some(unsafe { transmute(0x62f3u32) }), 0x377e => Some(unsafe { transmute(0x6372u32) }), 0x3821 => Some(unsafe { transmute(0x691cu32) }), 0x3822 => Some(unsafe { transmute(0x6a29u32) }), 0x3823 => Some(unsafe { transmute(0x727du32) }), 0x3824 => Some(unsafe { transmute(0x72acu32) }), 0x3825 => Some(unsafe { transmute(0x732eu32) }), 0x3826 => Some(unsafe { transmute(0x7814u32) }), 0x3827 => Some(unsafe { transmute(0x786fu32) }), 0x3828 => Some(unsafe { transmute(0x7d79u32) }), 0x3829 => Some(unsafe { transmute(0x770cu32) }), 0x382a => Some(unsafe { transmute(0x80a9u32) }), 0x382b => Some(unsafe { transmute(0x898bu32) }), 0x382c => Some(unsafe { transmute(0x8b19u32) }), 0x382d => Some(unsafe { transmute(0x8ce2u32) }), 0x382e => Some(unsafe { transmute(0x8ed2u32) }), 0x382f => Some(unsafe { transmute(0x9063u32) }), 0x3830 => Some(unsafe { transmute(0x9375u32) }), 0x3831 => Some(unsafe { transmute(0x967au32) }), 0x3832 => Some(unsafe { transmute(0x9855u32) }), 0x3833 => Some(unsafe { transmute(0x9a13u32) }), 0x3834 => Some(unsafe { transmute(0x9e78u32) }), 0x3835 => Some(unsafe { transmute(0x5143u32) }), 0x3836 => Some(unsafe { transmute(0x539fu32) }), 0x3837 => Some(unsafe { transmute(0x53b3u32) }), 0x3838 => Some(unsafe { transmute(0x5e7bu32) }), 0x3839 => Some(unsafe { transmute(0x5f26u32) }), 0x383a => Some(unsafe { transmute(0x6e1bu32) }), 0x383b => Some(unsafe { transmute(0x6e90u32) }), 0x383c => Some(unsafe { transmute(0x7384u32) }), 0x383d => Some(unsafe { transmute(0x73feu32) }), 0x383e => Some(unsafe { transmute(0x7d43u32) }), 0x383f => Some(unsafe { transmute(0x8237u32) }), 0x3840 => Some(unsafe { transmute(0x8a00u32) }), 0x3841 => Some(unsafe { transmute(0x8afau32) }), 0x3842 => Some(unsafe { transmute(0x9650u32) }), 0x3843 => Some(unsafe { transmute(0x4e4eu32) }), 0x3844 => Some(unsafe { transmute(0x500bu32) }), 0x3845 => Some(unsafe { transmute(0x53e4u32) }), 0x3846 => Some(unsafe { transmute(0x547cu32) }), 0x3847 => Some(unsafe { transmute(0x56fau32) }), 0x3848 => Some(unsafe { transmute(0x59d1u32) }), 0x3849 => Some(unsafe { transmute(0x5b64u32) }), 0x384a => Some(unsafe { transmute(0x5df1u32) }), 0x384b => Some(unsafe { transmute(0x5eabu32) }), 0x384c => Some(unsafe { transmute(0x5f27u32) }), 0x384d => Some(unsafe { transmute(0x6238u32) }), 0x384e => Some(unsafe { transmute(0x6545u32) }), 0x384f => Some(unsafe { transmute(0x67afu32) }), 0x3850 => Some(unsafe { transmute(0x6e56u32) }), 0x3851 => Some(unsafe { transmute(0x72d0u32) }), 0x3852 => Some(unsafe { transmute(0x7ccau32) }), 0x3853 => Some(unsafe { transmute(0x88b4u32) }), 0x3854 => Some(unsafe { transmute(0x80a1u32) }), 0x3855 => Some(unsafe { transmute(0x80e1u32) }), 0x3856 => Some(unsafe { transmute(0x83f0u32) }), 0x3857 => Some(unsafe { transmute(0x864eu32) }), 0x3858 => Some(unsafe { transmute(0x8a87u32) }), 0x3859 => Some(unsafe { transmute(0x8de8u32) }), 0x385a => Some(unsafe { transmute(0x9237u32) }), 0x385b => Some(unsafe { transmute(0x96c7u32) }), 0x385c => Some(unsafe { transmute(0x9867u32) }), 0x385d => Some(unsafe { transmute(0x9f13u32) }), 0x385e => Some(unsafe { transmute(0x4e94u32) }), 0x385f => Some(unsafe { transmute(0x4e92u32) }), 0x3860 => Some(unsafe { transmute(0x4f0du32) }), 0x3861 => Some(unsafe { transmute(0x5348u32) }), 0x3862 => Some(unsafe { transmute(0x5449u32) }), 0x3863 => Some(unsafe { transmute(0x543eu32) }), 0x3864 => Some(unsafe { transmute(0x5a2fu32) }), 0x3865 => Some(unsafe { transmute(0x5f8cu32) }), 0x3866 => Some(unsafe { transmute(0x5fa1u32) }), 0x3867 => Some(unsafe { transmute(0x609fu32) }), 0x3868 => Some(unsafe { transmute(0x68a7u32) }), 0x3869 => Some(unsafe { transmute(0x6a8eu32) }), 0x386a => Some(unsafe { transmute(0x745au32) }), 0x386b => Some(unsafe { transmute(0x7881u32) }), 0x386c => Some(unsafe { transmute(0x8a9eu32) }), 0x386d => Some(unsafe { transmute(0x8aa4u32) }), 0x386e => Some(unsafe { transmute(0x8b77u32) }), 0x386f => Some(unsafe { transmute(0x9190u32) }), 0x3870 => Some(unsafe { transmute(0x4e5eu32) }), 0x3871 => Some(unsafe { transmute(0x9bc9u32) }), 0x3872 => Some(unsafe { transmute(0x4ea4u32) }), 0x3873 => Some(unsafe { transmute(0x4f7cu32) }), 0x3874 => Some(unsafe { transmute(0x4fafu32) }), 0x3875 => Some(unsafe { transmute(0x5019u32) }), 0x3876 => Some(unsafe { transmute(0x5016u32) }), 0x3877 => Some(unsafe { transmute(0x5149u32) }), 0x3878 => Some(unsafe { transmute(0x516cu32) }), 0x3879 => Some(unsafe { transmute(0x529fu32) }), 0x387a => Some(unsafe { transmute(0x52b9u32) }), 0x387b => Some(unsafe { transmute(0x52feu32) }), 0x387c => Some(unsafe { transmute(0x539au32) }), 0x387d => Some(unsafe { transmute(0x53e3u32) }), 0x387e => Some(unsafe { transmute(0x5411u32) }), 0x3921 => Some(unsafe { transmute(0x540eu32) }), 0x3922 => Some(unsafe { transmute(0x5589u32) }), 0x3923 => Some(unsafe { transmute(0x5751u32) }), 0x3924 => Some(unsafe { transmute(0x57a2u32) }), 0x3925 => Some(unsafe { transmute(0x597du32) }), 0x3926 => Some(unsafe { transmute(0x5b54u32) }), 0x3927 => Some(unsafe { transmute(0x5b5du32) }), 0x3928 => Some(unsafe { transmute(0x5b8fu32) }), 0x3929 => Some(unsafe { transmute(0x5de5u32) }), 0x392a => Some(unsafe { transmute(0x5de7u32) }), 0x392b => Some(unsafe { transmute(0x5df7u32) }), 0x392c => Some(unsafe { transmute(0x5e78u32) }), 0x392d => Some(unsafe { transmute(0x5e83u32) }), 0x392e => Some(unsafe { transmute(0x5e9au32) }), 0x392f => Some(unsafe { transmute(0x5eb7u32) }), 0x3930 => Some(unsafe { transmute(0x5f18u32) }), 0x3931 => Some(unsafe { transmute(0x6052u32) }), 0x3932 => Some(unsafe { transmute(0x614cu32) }), 0x3933 => Some(unsafe { transmute(0x6297u32) }), 0x3934 => Some(unsafe { transmute(0x62d8u32) }), 0x3935 => Some(unsafe { transmute(0x63a7u32) }), 0x3936 => Some(unsafe { transmute(0x653bu32) }), 0x3937 => Some(unsafe { transmute(0x6602u32) }), 0x3938 => Some(unsafe { transmute(0x6643u32) }), 0x3939 => Some(unsafe { transmute(0x66f4u32) }), 0x393a => Some(unsafe { transmute(0x676du32) }), 0x393b => Some(unsafe { transmute(0x6821u32) }), 0x393c => Some(unsafe { transmute(0x6897u32) }), 0x393d => Some(unsafe { transmute(0x69cbu32) }), 0x393e => Some(unsafe { transmute(0x6c5fu32) }), 0x393f => Some(unsafe { transmute(0x6d2au32) }), 0x3940 => Some(unsafe { transmute(0x6d69u32) }), 0x3941 => Some(unsafe { transmute(0x6e2fu32) }), 0x3942 => Some(unsafe { transmute(0x6e9du32) }), 0x3943 => Some(unsafe { transmute(0x7532u32) }), 0x3944 => Some(unsafe { transmute(0x7687u32) }), 0x3945 => Some(unsafe { transmute(0x786cu32) }), 0x3946 => Some(unsafe { transmute(0x7a3fu32) }), 0x3947 => Some(unsafe { transmute(0x7ce0u32) }), 0x3948 => Some(unsafe { transmute(0x7d05u32) }), 0x3949 => Some(unsafe { transmute(0x7d18u32) }), 0x394a => Some(unsafe { transmute(0x7d5eu32) }), 0x394b => Some(unsafe { transmute(0x7db1u32) }), 0x394c => Some(unsafe { transmute(0x8015u32) }), 0x394d => Some(unsafe { transmute(0x8003u32) }), 0x394e => Some(unsafe { transmute(0x80afu32) }), 0x394f => Some(unsafe { transmute(0x80b1u32) }), 0x3950 => Some(unsafe { transmute(0x8154u32) }), 0x3951 => Some(unsafe { transmute(0x818fu32) }), 0x3952 => Some(unsafe { transmute(0x822au32) }), 0x3953 => Some(unsafe { transmute(0x8352u32) }), 0x3954 => Some(unsafe { transmute(0x884cu32) }), 0x3955 => Some(unsafe { transmute(0x8861u32) }), 0x3956 => Some(unsafe { transmute(0x8b1bu32) }), 0x3957 => Some(unsafe { transmute(0x8ca2u32) }), 0x3958 => Some(unsafe { transmute(0x8cfcu32) }), 0x3959 => Some(unsafe { transmute(0x90cau32) }), 0x395a => Some(unsafe { transmute(0x9175u32) }), 0x395b => Some(unsafe { transmute(0x9271u32) }), 0x395c => Some(unsafe { transmute(0x783fu32) }), 0x395d => Some(unsafe { transmute(0x92fcu32) }), 0x395e => Some(unsafe { transmute(0x95a4u32) }), 0x395f => Some(unsafe { transmute(0x964du32) }), 0x3960 => Some(unsafe { transmute(0x9805u32) }), 0x3961 => Some(unsafe { transmute(0x9999u32) }), 0x3962 => Some(unsafe { transmute(0x9ad8u32) }), 0x3963 => Some(unsafe { transmute(0x9d3bu32) }), 0x3964 => Some(unsafe { transmute(0x525bu32) }), 0x3965 => Some(unsafe { transmute(0x52abu32) }), 0x3966 => Some(unsafe { transmute(0x53f7u32) }), 0x3967 => Some(unsafe { transmute(0x5408u32) }), 0x3968 => Some(unsafe { transmute(0x58d5u32) }), 0x3969 => Some(unsafe { transmute(0x62f7u32) }), 0x396a => Some(unsafe { transmute(0x6fe0u32) }), 0x396b => Some(unsafe { transmute(0x8c6au32) }), 0x396c => Some(unsafe { transmute(0x8f5fu32) }), 0x396d => Some(unsafe { transmute(0x9eb9u32) }), 0x396e => Some(unsafe { transmute(0x514bu32) }), 0x396f => Some(unsafe { transmute(0x523bu32) }), 0x3970 => Some(unsafe { transmute(0x544au32) }), 0x3971 => Some(unsafe { transmute(0x56fdu32) }), 0x3972 => Some(unsafe { transmute(0x7a40u32) }), 0x3973 => Some(unsafe { transmute(0x9177u32) }), 0x3974 => Some(unsafe { transmute(0x9d60u32) }), 0x3975 => Some(unsafe { transmute(0x9ed2u32) }), 0x3976 => Some(unsafe { transmute(0x7344u32) }), 0x3977 => Some(unsafe { transmute(0x6f09u32) }), 0x3978 => Some(unsafe { transmute(0x8170u32) }), 0x3979 => Some(unsafe { transmute(0x7511u32) }), 0x397a => Some(unsafe { transmute(0x5ffdu32) }), 0x397b => Some(unsafe { transmute(0x60dau32) }), 0x397c => Some(unsafe { transmute(0x9aa8u32) }), 0x397d => Some(unsafe { transmute(0x72dbu32) }), 0x397e => Some(unsafe { transmute(0x8fbcu32) }), 0x3a21 => Some(unsafe { transmute(0x6b64u32) }), 0x3a22 => Some(unsafe { transmute(0x9803u32) }), 0x3a23 => Some(unsafe { transmute(0x4ecau32) }), 0x3a24 => Some(unsafe { transmute(0x56f0u32) }), 0x3a25 => Some(unsafe { transmute(0x5764u32) }), 0x3a26 => Some(unsafe { transmute(0x58beu32) }), 0x3a27 => Some(unsafe { transmute(0x5a5au32) }), 0x3a28 => Some(unsafe { transmute(0x6068u32) }), 0x3a29 => Some(unsafe { transmute(0x61c7u32) }), 0x3a2a => Some(unsafe { transmute(0x660fu32) }), 0x3a2b => Some(unsafe { transmute(0x6606u32) }), 0x3a2c => Some(unsafe { transmute(0x6839u32) }), 0x3a2d => Some(unsafe { transmute(0x68b1u32) }), 0x3a2e => Some(unsafe { transmute(0x6df7u32) }), 0x3a2f => Some(unsafe { transmute(0x75d5u32) }), 0x3a30 => Some(unsafe { transmute(0x7d3au32) }), 0x3a31 => Some(unsafe { transmute(0x826eu32) }), 0x3a32 => Some(unsafe { transmute(0x9b42u32) }), 0x3a33 => Some(unsafe { transmute(0x4e9bu32) }), 0x3a34 => Some(unsafe { transmute(0x4f50u32) }), 0x3a35 => Some(unsafe { transmute(0x53c9u32) }), 0x3a36 => Some(unsafe { transmute(0x5506u32) }), 0x3a37 => Some(unsafe { transmute(0x5d6fu32) }), 0x3a38 => Some(unsafe { transmute(0x5de6u32) }), 0x3a39 => Some(unsafe { transmute(0x5deeu32) }), 0x3a3a => Some(unsafe { transmute(0x67fbu32) }), 0x3a3b => Some(unsafe { transmute(0x6c99u32) }), 0x3a3c => Some(unsafe { transmute(0x7473u32) }), 0x3a3d => Some(unsafe { transmute(0x7802u32) }), 0x3a3e => Some(unsafe { transmute(0x8a50u32) }), 0x3a3f => Some(unsafe { transmute(0x9396u32) }), 0x3a40 => Some(unsafe { transmute(0x88dfu32) }), 0x3a41 => Some(unsafe { transmute(0x5750u32) }), 0x3a42 => Some(unsafe { transmute(0x5ea7u32) }), 0x3a43 => Some(unsafe { transmute(0x632bu32) }), 0x3a44 => Some(unsafe { transmute(0x50b5u32) }), 0x3a45 => Some(unsafe { transmute(0x50acu32) }), 0x3a46 => Some(unsafe { transmute(0x518du32) }), 0x3a47 => Some(unsafe { transmute(0x6700u32) }), 0x3a48 => Some(unsafe { transmute(0x54c9u32) }), 0x3a49 => Some(unsafe { transmute(0x585eu32) }), 0x3a4a => Some(unsafe { transmute(0x59bbu32) }), 0x3a4b => Some(unsafe { transmute(0x5bb0u32) }), 0x3a4c => Some(unsafe { transmute(0x5f69u32) }), 0x3a4d => Some(unsafe { transmute(0x624du32) }), 0x3a4e => Some(unsafe { transmute(0x63a1u32) }), 0x3a4f => Some(unsafe { transmute(0x683du32) }), 0x3a50 => Some(unsafe { transmute(0x6b73u32) }), 0x3a51 => Some(unsafe { transmute(0x6e08u32) }), 0x3a52 => Some(unsafe { transmute(0x707du32) }), 0x3a53 => Some(unsafe { transmute(0x91c7u32) }), 0x3a54 => Some(unsafe { transmute(0x7280u32) }), 0x3a55 => Some(unsafe { transmute(0x7815u32) }), 0x3a56 => Some(unsafe { transmute(0x7826u32) }), 0x3a57 => Some(unsafe { transmute(0x796du32) }), 0x3a58 => Some(unsafe { transmute(0x658eu32) }), 0x3a59 => Some(unsafe { transmute(0x7d30u32) }), 0x3a5a => Some(unsafe { transmute(0x83dcu32) }), 0x3a5b => Some(unsafe { transmute(0x88c1u32) }), 0x3a5c => Some(unsafe { transmute(0x8f09u32) }), 0x3a5d => Some(unsafe { transmute(0x969bu32) }), 0x3a5e => Some(unsafe { transmute(0x5264u32) }), 0x3a5f => Some(unsafe { transmute(0x5728u32) }), 0x3a60 => Some(unsafe { transmute(0x6750u32) }), 0x3a61 => Some(unsafe { transmute(0x7f6au32) }), 0x3a62 => Some(unsafe { transmute(0x8ca1u32) }), 0x3a63 => Some(unsafe { transmute(0x51b4u32) }), 0x3a64 => Some(unsafe { transmute(0x5742u32) }), 0x3a65 => Some(unsafe { transmute(0x962au32) }), 0x3a66 => Some(unsafe { transmute(0x583au32) }), 0x3a67 => Some(unsafe { transmute(0x698au32) }), 0x3a68 => Some(unsafe { transmute(0x80b4u32) }), 0x3a69 => Some(unsafe { transmute(0x54b2u32) }), 0x3a6a => Some(unsafe { transmute(0x5d0eu32) }), 0x3a6b => Some(unsafe { transmute(0x57fcu32) }), 0x3a6c => Some(unsafe { transmute(0x7895u32) }), 0x3a6d => Some(unsafe { transmute(0x9dfau32) }), 0x3a6e => Some(unsafe { transmute(0x4f5cu32) }), 0x3a6f => Some(unsafe { transmute(0x524au32) }), 0x3a70 => Some(unsafe { transmute(0x548bu32) }), 0x3a71 => Some(unsafe { transmute(0x643eu32) }), 0x3a72 => Some(unsafe { transmute(0x6628u32) }), 0x3a73 => Some(unsafe { transmute(0x6714u32) }), 0x3a74 => Some(unsafe { transmute(0x67f5u32) }), 0x3a75 => Some(unsafe { transmute(0x7a84u32) }), 0x3a76 => Some(unsafe { transmute(0x7b56u32) }), 0x3a77 => Some(unsafe { transmute(0x7d22u32) }), 0x3a78 => Some(unsafe { transmute(0x932fu32) }), 0x3a79 => Some(unsafe { transmute(0x685cu32) }), 0x3a7a => Some(unsafe { transmute(0x9badu32) }), 0x3a7b => Some(unsafe { transmute(0x7b39u32) }), 0x3a7c => Some(unsafe { transmute(0x5319u32) }), 0x3a7d => Some(unsafe { transmute(0x518au32) }), 0x3a7e => Some(unsafe { transmute(0x5237u32) }), 0x3b21 => Some(unsafe { transmute(0x5bdfu32) }), 0x3b22 => Some(unsafe { transmute(0x62f6u32) }), 0x3b23 => Some(unsafe { transmute(0x64aeu32) }), 0x3b24 => Some(unsafe { transmute(0x64e6u32) }), 0x3b25 => Some(unsafe { transmute(0x672du32) }), 0x3b26 => Some(unsafe { transmute(0x6bbau32) }), 0x3b27 => Some(unsafe { transmute(0x85a9u32) }), 0x3b28 => Some(unsafe { transmute(0x96d1u32) }), 0x3b29 => Some(unsafe { transmute(0x7690u32) }), 0x3b2a => Some(unsafe { transmute(0x9bd6u32) }), 0x3b2b => Some(unsafe { transmute(0x634cu32) }), 0x3b2c => Some(unsafe { transmute(0x9306u32) }), 0x3b2d => Some(unsafe { transmute(0x9babu32) }), 0x3b2e => Some(unsafe { transmute(0x76bfu32) }), 0x3b2f => Some(unsafe { transmute(0x6652u32) }), 0x3b30 => Some(unsafe { transmute(0x4e09u32) }), 0x3b31 => Some(unsafe { transmute(0x5098u32) }), 0x3b32 => Some(unsafe { transmute(0x53c2u32) }), 0x3b33 => Some(unsafe { transmute(0x5c71u32) }), 0x3b34 => Some(unsafe { transmute(0x60e8u32) }), 0x3b35 => Some(unsafe { transmute(0x6492u32) }), 0x3b36 => Some(unsafe { transmute(0x6563u32) }), 0x3b37 => Some(unsafe { transmute(0x685fu32) }), 0x3b38 => Some(unsafe { transmute(0x71e6u32) }), 0x3b39 => Some(unsafe { transmute(0x73cau32) }), 0x3b3a => Some(unsafe { transmute(0x7523u32) }), 0x3b3b => Some(unsafe { transmute(0x7b97u32) }), 0x3b3c => Some(unsafe { transmute(0x7e82u32) }), 0x3b3d => Some(unsafe { transmute(0x8695u32) }), 0x3b3e => Some(unsafe { transmute(0x8b83u32) }), 0x3b3f => Some(unsafe { transmute(0x8cdbu32) }), 0x3b40 => Some(unsafe { transmute(0x9178u32) }), 0x3b41 => Some(unsafe { transmute(0x9910u32) }), 0x3b42 => Some(unsafe { transmute(0x65acu32) }), 0x3b43 => Some(unsafe { transmute(0x66abu32) }), 0x3b44 => Some(unsafe { transmute(0x6b8bu32) }), 0x3b45 => Some(unsafe { transmute(0x4ed5u32) }), 0x3b46 => Some(unsafe { transmute(0x4ed4u32) }), 0x3b47 => Some(unsafe { transmute(0x4f3au32) }), 0x3b48 => Some(unsafe { transmute(0x4f7fu32) }), 0x3b49 => Some(unsafe { transmute(0x523au32) }), 0x3b4a => Some(unsafe { transmute(0x53f8u32) }), 0x3b4b => Some(unsafe { transmute(0x53f2u32) }), 0x3b4c => Some(unsafe { transmute(0x55e3u32) }), 0x3b4d => Some(unsafe { transmute(0x56dbu32) }), 0x3b4e => Some(unsafe { transmute(0x58ebu32) }), 0x3b4f => Some(unsafe { transmute(0x59cbu32) }), 0x3b50 => Some(unsafe { transmute(0x59c9u32) }), 0x3b51 => Some(unsafe { transmute(0x59ffu32) }), 0x3b52 => Some(unsafe { transmute(0x5b50u32) }), 0x3b53 => Some(unsafe { transmute(0x5c4du32) }), 0x3b54 => Some(unsafe { transmute(0x5e02u32) }), 0x3b55 => Some(unsafe { transmute(0x5e2bu32) }), 0x3b56 => Some(unsafe { transmute(0x5fd7u32) }), 0x3b57 => Some(unsafe { transmute(0x601du32) }), 0x3b58 => Some(unsafe { transmute(0x6307u32) }), 0x3b59 => Some(unsafe { transmute(0x652fu32) }), 0x3b5a => Some(unsafe { transmute(0x5b5cu32) }), 0x3b5b => Some(unsafe { transmute(0x65afu32) }), 0x3b5c => Some(unsafe { transmute(0x65bdu32) }), 0x3b5d => Some(unsafe { transmute(0x65e8u32) }), 0x3b5e => Some(unsafe { transmute(0x679du32) }), 0x3b5f => Some(unsafe { transmute(0x6b62u32) }), 0x3b60 => Some(unsafe { transmute(0x6b7bu32) }), 0x3b61 => Some(unsafe { transmute(0x6c0fu32) }), 0x3b62 => Some(unsafe { transmute(0x7345u32) }), 0x3b63 => Some(unsafe { transmute(0x7949u32) }), 0x3b64 => Some(unsafe { transmute(0x79c1u32) }), 0x3b65 => Some(unsafe { transmute(0x7cf8u32) }), 0x3b66 => Some(unsafe { transmute(0x7d19u32) }), 0x3b67 => Some(unsafe { transmute(0x7d2bu32) }), 0x3b68 => Some(unsafe { transmute(0x80a2u32) }), 0x3b69 => Some(unsafe { transmute(0x8102u32) }), 0x3b6a => Some(unsafe { transmute(0x81f3u32) }), 0x3b6b => Some(unsafe { transmute(0x8996u32) }), 0x3b6c => Some(unsafe { transmute(0x8a5eu32) }), 0x3b6d => Some(unsafe { transmute(0x8a69u32) }), 0x3b6e => Some(unsafe { transmute(0x8a66u32) }), 0x3b6f => Some(unsafe { transmute(0x8a8cu32) }), 0x3b70 => Some(unsafe { transmute(0x8aeeu32) }), 0x3b71 => Some(unsafe { transmute(0x8cc7u32) }), 0x3b72 => Some(unsafe { transmute(0x8cdcu32) }), 0x3b73 => Some(unsafe { transmute(0x96ccu32) }), 0x3b74 => Some(unsafe { transmute(0x98fcu32) }), 0x3b75 => Some(unsafe { transmute(0x6b6fu32) }), 0x3b76 => Some(unsafe { transmute(0x4e8bu32) }), 0x3b77 => Some(unsafe { transmute(0x4f3cu32) }), 0x3b78 => Some(unsafe { transmute(0x4f8du32) }), 0x3b79 => Some(unsafe { transmute(0x5150u32) }), 0x3b7a => Some(unsafe { transmute(0x5b57u32) }), 0x3b7b => Some(unsafe { transmute(0x5bfau32) }), 0x3b7c => Some(unsafe { transmute(0x6148u32) }), 0x3b7d => Some(unsafe { transmute(0x6301u32) }), 0x3b7e => Some(unsafe { transmute(0x6642u32) }), 0x3c21 => Some(unsafe { transmute(0x6b21u32) }), 0x3c22 => Some(unsafe { transmute(0x6ecbu32) }), 0x3c23 => Some(unsafe { transmute(0x6cbbu32) }), 0x3c24 => Some(unsafe { transmute(0x723eu32) }), 0x3c25 => Some(unsafe { transmute(0x74bdu32) }), 0x3c26 => Some(unsafe { transmute(0x75d4u32) }), 0x3c27 => Some(unsafe { transmute(0x78c1u32) }), 0x3c28 => Some(unsafe { transmute(0x793au32) }), 0x3c29 => Some(unsafe { transmute(0x800cu32) }), 0x3c2a => Some(unsafe { transmute(0x8033u32) }), 0x3c2b => Some(unsafe { transmute(0x81eau32) }), 0x3c2c => Some(unsafe { transmute(0x8494u32) }), 0x3c2d => Some(unsafe { transmute(0x8f9eu32) }), 0x3c2e => Some(unsafe { transmute(0x6c50u32) }), 0x3c2f => Some(unsafe { transmute(0x9e7fu32) }), 0x3c30 => Some(unsafe { transmute(0x5f0fu32) }), 0x3c31 => Some(unsafe { transmute(0x8b58u32) }), 0x3c32 => Some(unsafe { transmute(0x9d2bu32) }), 0x3c33 => Some(unsafe { transmute(0x7afau32) }), 0x3c34 => Some(unsafe { transmute(0x8ef8u32) }), 0x3c35 => Some(unsafe { transmute(0x5b8du32) }), 0x3c36 => Some(unsafe { transmute(0x96ebu32) }), 0x3c37 => Some(unsafe { transmute(0x4e03u32) }), 0x3c38 => Some(unsafe { transmute(0x53f1u32) }), 0x3c39 => Some(unsafe { transmute(0x57f7u32) }), 0x3c3a => Some(unsafe { transmute(0x5931u32) }), 0x3c3b => Some(unsafe { transmute(0x5ac9u32) }), 0x3c3c => Some(unsafe { transmute(0x5ba4u32) }), 0x3c3d => Some(unsafe { transmute(0x6089u32) }), 0x3c3e => Some(unsafe { transmute(0x6e7fu32) }), 0x3c3f => Some(unsafe { transmute(0x6f06u32) }), 0x3c40 => Some(unsafe { transmute(0x75beu32) }), 0x3c41 => Some(unsafe { transmute(0x8ceau32) }), 0x3c42 => Some(unsafe { transmute(0x5b9fu32) }), 0x3c43 => Some(unsafe { transmute(0x8500u32) }), 0x3c44 => Some(unsafe { transmute(0x7be0u32) }), 0x3c45 => Some(unsafe { transmute(0x5072u32) }), 0x3c46 => Some(unsafe { transmute(0x67f4u32) }), 0x3c47 => Some(unsafe { transmute(0x829du32) }), 0x3c48 => Some(unsafe { transmute(0x5c61u32) }), 0x3c49 => Some(unsafe { transmute(0x854au32) }), 0x3c4a => Some(unsafe { transmute(0x7e1eu32) }), 0x3c4b => Some(unsafe { transmute(0x820eu32) }), 0x3c4c => Some(unsafe { transmute(0x5199u32) }), 0x3c4d => Some(unsafe { transmute(0x5c04u32) }), 0x3c4e => Some(unsafe { transmute(0x6368u32) }), 0x3c4f => Some(unsafe { transmute(0x8d66u32) }), 0x3c50 => Some(unsafe { transmute(0x659cu32) }), 0x3c51 => Some(unsafe { transmute(0x716eu32) }), 0x3c52 => Some(unsafe { transmute(0x793eu32) }), 0x3c53 => Some(unsafe { transmute(0x7d17u32) }), 0x3c54 => Some(unsafe { transmute(0x8005u32) }), 0x3c55 => Some(unsafe { transmute(0x8b1du32) }), 0x3c56 => Some(unsafe { transmute(0x8ecau32) }), 0x3c57 => Some(unsafe { transmute(0x906eu32) }), 0x3c58 => Some(unsafe { transmute(0x86c7u32) }), 0x3c59 => Some(unsafe { transmute(0x90aau32) }), 0x3c5a => Some(unsafe { transmute(0x501fu32) }), 0x3c5b => Some(unsafe { transmute(0x52fau32) }), 0x3c5c => Some(unsafe { transmute(0x5c3au32) }), 0x3c5d => Some(unsafe { transmute(0x6753u32) }), 0x3c5e => Some(unsafe { transmute(0x707cu32) }), 0x3c5f => Some(unsafe { transmute(0x7235u32) }), 0x3c60 => Some(unsafe { transmute(0x914cu32) }), 0x3c61 => Some(unsafe { transmute(0x91c8u32) }), 0x3c62 => Some(unsafe { transmute(0x932bu32) }), 0x3c63 => Some(unsafe { transmute(0x82e5u32) }), 0x3c64 => Some(unsafe { transmute(0x5bc2u32) }), 0x3c65 => Some(unsafe { transmute(0x5f31u32) }), 0x3c66 => Some(unsafe { transmute(0x60f9u32) }), 0x3c67 => Some(unsafe { transmute(0x4e3bu32) }), 0x3c68 => Some(unsafe { transmute(0x53d6u32) }), 0x3c69 => Some(unsafe { transmute(0x5b88u32) }), 0x3c6a => Some(unsafe { transmute(0x624bu32) }), 0x3c6b => Some(unsafe { transmute(0x6731u32) }), 0x3c6c => Some(unsafe { transmute(0x6b8au32) }), 0x3c6d => Some(unsafe { transmute(0x72e9u32) }), 0x3c6e => Some(unsafe { transmute(0x73e0u32) }), 0x3c6f => Some(unsafe { transmute(0x7a2eu32) }), 0x3c70 => Some(unsafe { transmute(0x816bu32) }), 0x3c71 => Some(unsafe { transmute(0x8da3u32) }), 0x3c72 => Some(unsafe { transmute(0x9152u32) }), 0x3c73 => Some(unsafe { transmute(0x9996u32) }), 0x3c74 => Some(unsafe { transmute(0x5112u32) }), 0x3c75 => Some(unsafe { transmute(0x53d7u32) }), 0x3c76 => Some(unsafe { transmute(0x546au32) }), 0x3c77 => Some(unsafe { transmute(0x5bffu32) }), 0x3c78 => Some(unsafe { transmute(0x6388u32) }), 0x3c79 => Some(unsafe { transmute(0x6a39u32) }), 0x3c7a => Some(unsafe { transmute(0x7dacu32) }), 0x3c7b => Some(unsafe { transmute(0x9700u32) }), 0x3c7c => Some(unsafe { transmute(0x56dau32) }), 0x3c7d => Some(unsafe { transmute(0x53ceu32) }), 0x3c7e => Some(unsafe { transmute(0x5468u32) }), 0x3d21 => Some(unsafe { transmute(0x5b97u32) }), 0x3d22 => Some(unsafe { transmute(0x5c31u32) }), 0x3d23 => Some(unsafe { transmute(0x5ddeu32) }), 0x3d24 => Some(unsafe { transmute(0x4feeu32) }), 0x3d25 => Some(unsafe { transmute(0x6101u32) }), 0x3d26 => Some(unsafe { transmute(0x62feu32) }), 0x3d27 => Some(unsafe { transmute(0x6d32u32) }), 0x3d28 => Some(unsafe { transmute(0x79c0u32) }), 0x3d29 => Some(unsafe { transmute(0x79cbu32) }), 0x3d2a => Some(unsafe { transmute(0x7d42u32) }), 0x3d2b => Some(unsafe { transmute(0x7e4du32) }), 0x3d2c => Some(unsafe { transmute(0x7fd2u32) }), 0x3d2d => Some(unsafe { transmute(0x81edu32) }), 0x3d2e => Some(unsafe { transmute(0x821fu32) }), 0x3d2f => Some(unsafe { transmute(0x8490u32) }), 0x3d30 => Some(unsafe { transmute(0x8846u32) }), 0x3d31 => Some(unsafe { transmute(0x8972u32) }), 0x3d32 => Some(unsafe { transmute(0x8b90u32) }), 0x3d33 => Some(unsafe { transmute(0x8e74u32) }), 0x3d34 => Some(unsafe { transmute(0x8f2fu32) }), 0x3d35 => Some(unsafe { transmute(0x9031u32) }), 0x3d36 => Some(unsafe { transmute(0x914bu32) }), 0x3d37 => Some(unsafe { transmute(0x916cu32) }), 0x3d38 => Some(unsafe { transmute(0x96c6u32) }), 0x3d39 => Some(unsafe { transmute(0x919cu32) }), 0x3d3a => Some(unsafe { transmute(0x4ec0u32) }), 0x3d3b => Some(unsafe { transmute(0x4f4fu32) }), 0x3d3c => Some(unsafe { transmute(0x5145u32) }), 0x3d3d => Some(unsafe { transmute(0x5341u32) }), 0x3d3e => Some(unsafe { transmute(0x5f93u32) }), 0x3d3f => Some(unsafe { transmute(0x620eu32) }), 0x3d40 => Some(unsafe { transmute(0x67d4u32) }), 0x3d41 => Some(unsafe { transmute(0x6c41u32) }), 0x3d42 => Some(unsafe { transmute(0x6e0bu32) }), 0x3d43 => Some(unsafe { transmute(0x7363u32) }), 0x3d44 => Some(unsafe { transmute(0x7e26u32) }), 0x3d45 => Some(unsafe { transmute(0x91cdu32) }), 0x3d46 => Some(unsafe { transmute(0x9283u32) }), 0x3d47 => Some(unsafe { transmute(0x53d4u32) }), 0x3d48 => Some(unsafe { transmute(0x5919u32) }), 0x3d49 => Some(unsafe { transmute(0x5bbfu32) }), 0x3d4a => Some(unsafe { transmute(0x6dd1u32) }), 0x3d4b => Some(unsafe { transmute(0x795du32) }), 0x3d4c => Some(unsafe { transmute(0x7e2eu32) }), 0x3d4d => Some(unsafe { transmute(0x7c9bu32) }), 0x3d4e => Some(unsafe { transmute(0x587eu32) }), 0x3d4f => Some(unsafe { transmute(0x719fu32) }), 0x3d50 => Some(unsafe { transmute(0x51fau32) }), 0x3d51 => Some(unsafe { transmute(0x8853u32) }), 0x3d52 => Some(unsafe { transmute(0x8ff0u32) }), 0x3d53 => Some(unsafe { transmute(0x4fcau32) }), 0x3d54 => Some(unsafe { transmute(0x5cfbu32) }), 0x3d55 => Some(unsafe { transmute(0x6625u32) }), 0x3d56 => Some(unsafe { transmute(0x77acu32) }), 0x3d57 => Some(unsafe { transmute(0x7ae3u32) }), 0x3d58 => Some(unsafe { transmute(0x821cu32) }), 0x3d59 => Some(unsafe { transmute(0x99ffu32) }), 0x3d5a => Some(unsafe { transmute(0x51c6u32) }), 0x3d5b => Some(unsafe { transmute(0x5faau32) }), 0x3d5c => Some(unsafe { transmute(0x65ecu32) }), 0x3d5d => Some(unsafe { transmute(0x696fu32) }), 0x3d5e => Some(unsafe { transmute(0x6b89u32) }), 0x3d5f => Some(unsafe { transmute(0x6df3u32) }), 0x3d60 => Some(unsafe { transmute(0x6e96u32) }), 0x3d61 => Some(unsafe { transmute(0x6f64u32) }), 0x3d62 => Some(unsafe { transmute(0x76feu32) }), 0x3d63 => Some(unsafe { transmute(0x7d14u32) }), 0x3d64 => Some(unsafe { transmute(0x5de1u32) }), 0x3d65 => Some(unsafe { transmute(0x9075u32) }), 0x3d66 => Some(unsafe { transmute(0x9187u32) }), 0x3d67 => Some(unsafe { transmute(0x9806u32) }), 0x3d68 => Some(unsafe { transmute(0x51e6u32) }), 0x3d69 => Some(unsafe { transmute(0x521du32) }), 0x3d6a => Some(unsafe { transmute(0x6240u32) }), 0x3d6b => Some(unsafe { transmute(0x6691u32) }), 0x3d6c => Some(unsafe { transmute(0x66d9u32) }), 0x3d6d => Some(unsafe { transmute(0x6e1au32) }), 0x3d6e => Some(unsafe { transmute(0x5eb6u32) }), 0x3d6f => Some(unsafe { transmute(0x7dd2u32) }), 0x3d70 => Some(unsafe { transmute(0x7f72u32) }), 0x3d71 => Some(unsafe { transmute(0x66f8u32) }), 0x3d72 => Some(unsafe { transmute(0x85afu32) }), 0x3d73 => Some(unsafe { transmute(0x85f7u32) }), 0x3d74 => Some(unsafe { transmute(0x8af8u32) }), 0x3d75 => Some(unsafe { transmute(0x52a9u32) }), 0x3d76 => Some(unsafe { transmute(0x53d9u32) }), 0x3d77 => Some(unsafe { transmute(0x5973u32) }), 0x3d78 => Some(unsafe { transmute(0x5e8fu32) }), 0x3d79 => Some(unsafe { transmute(0x5f90u32) }), 0x3d7a => Some(unsafe { transmute(0x6055u32) }), 0x3d7b => Some(unsafe { transmute(0x92e4u32) }), 0x3d7c => Some(unsafe { transmute(0x9664u32) }), 0x3d7d => Some(unsafe { transmute(0x50b7u32) }), 0x3d7e => Some(unsafe { transmute(0x511fu32) }), 0x3e21 => Some(unsafe { transmute(0x52ddu32) }), 0x3e22 => Some(unsafe { transmute(0x5320u32) }), 0x3e23 => Some(unsafe { transmute(0x5347u32) }), 0x3e24 => Some(unsafe { transmute(0x53ecu32) }), 0x3e25 => Some(unsafe { transmute(0x54e8u32) }), 0x3e26 => Some(unsafe { transmute(0x5546u32) }), 0x3e27 => Some(unsafe { transmute(0x5531u32) }), 0x3e28 => Some(unsafe { transmute(0x5617u32) }), 0x3e29 => Some(unsafe { transmute(0x5968u32) }), 0x3e2a => Some(unsafe { transmute(0x59beu32) }), 0x3e2b => Some(unsafe { transmute(0x5a3cu32) }), 0x3e2c => Some(unsafe { transmute(0x5bb5u32) }), 0x3e2d => Some(unsafe { transmute(0x5c06u32) }), 0x3e2e => Some(unsafe { transmute(0x5c0fu32) }), 0x3e2f => Some(unsafe { transmute(0x5c11u32) }), 0x3e30 => Some(unsafe { transmute(0x5c1au32) }), 0x3e31 => Some(unsafe { transmute(0x5e84u32) }), 0x3e32 => Some(unsafe { transmute(0x5e8au32) }), 0x3e33 => Some(unsafe { transmute(0x5ee0u32) }), 0x3e34 => Some(unsafe { transmute(0x5f70u32) }), 0x3e35 => Some(unsafe { transmute(0x627fu32) }), 0x3e36 => Some(unsafe { transmute(0x6284u32) }), 0x3e37 => Some(unsafe { transmute(0x62dbu32) }), 0x3e38 => Some(unsafe { transmute(0x638cu32) }), 0x3e39 => Some(unsafe { transmute(0x6377u32) }), 0x3e3a => Some(unsafe { transmute(0x6607u32) }), 0x3e3b => Some(unsafe { transmute(0x660cu32) }), 0x3e3c => Some(unsafe { transmute(0x662du32) }), 0x3e3d => Some(unsafe { transmute(0x6676u32) }), 0x3e3e => Some(unsafe { transmute(0x677eu32) }), 0x3e3f => Some(unsafe { transmute(0x68a2u32) }), 0x3e40 => Some(unsafe { transmute(0x6a1fu32) }), 0x3e41 => Some(unsafe { transmute(0x6a35u32) }), 0x3e42 => Some(unsafe { transmute(0x6cbcu32) }), 0x3e43 => Some(unsafe { transmute(0x6d88u32) }), 0x3e44 => Some(unsafe { transmute(0x6e09u32) }), 0x3e45 => Some(unsafe { transmute(0x6e58u32) }), 0x3e46 => Some(unsafe { transmute(0x713cu32) }), 0x3e47 => Some(unsafe { transmute(0x7126u32) }), 0x3e48 => Some(unsafe { transmute(0x7167u32) }), 0x3e49 => Some(unsafe { transmute(0x75c7u32) }), 0x3e4a => Some(unsafe { transmute(0x7701u32) }), 0x3e4b => Some(unsafe { transmute(0x785du32) }), 0x3e4c => Some(unsafe { transmute(0x7901u32) }), 0x3e4d => Some(unsafe { transmute(0x7965u32) }), 0x3e4e => Some(unsafe { transmute(0x79f0u32) }), 0x3e4f => Some(unsafe { transmute(0x7ae0u32) }), 0x3e50 => Some(unsafe { transmute(0x7b11u32) }), 0x3e51 => Some(unsafe { transmute(0x7ca7u32) }), 0x3e52 => Some(unsafe { transmute(0x7d39u32) }), 0x3e53 => Some(unsafe { transmute(0x8096u32) }), 0x3e54 => Some(unsafe { transmute(0x83d6u32) }), 0x3e55 => Some(unsafe { transmute(0x848bu32) }), 0x3e56 => Some(unsafe { transmute(0x8549u32) }), 0x3e57 => Some(unsafe { transmute(0x885du32) }), 0x3e58 => Some(unsafe { transmute(0x88f3u32) }), 0x3e59 => Some(unsafe { transmute(0x8a1fu32) }), 0x3e5a => Some(unsafe { transmute(0x8a3cu32) }), 0x3e5b => Some(unsafe { transmute(0x8a54u32) }), 0x3e5c => Some(unsafe { transmute(0x8a73u32) }), 0x3e5d => Some(unsafe { transmute(0x8c61u32) }), 0x3e5e => Some(unsafe { transmute(0x8cdeu32) }), 0x3e5f => Some(unsafe { transmute(0x91a4u32) }), 0x3e60 => Some(unsafe { transmute(0x9266u32) }), 0x3e61 => Some(unsafe { transmute(0x937eu32) }), 0x3e62 => Some(unsafe { transmute(0x9418u32) }), 0x3e63 => Some(unsafe { transmute(0x969cu32) }), 0x3e64 => Some(unsafe { transmute(0x9798u32) }), 0x3e65 => Some(unsafe { transmute(0x4e0au32) }), 0x3e66 => Some(unsafe { transmute(0x4e08u32) }), 0x3e67 => Some(unsafe { transmute(0x4e1eu32) }), 0x3e68 => Some(unsafe { transmute(0x4e57u32) }), 0x3e69 => Some(unsafe { transmute(0x5197u32) }), 0x3e6a => Some(unsafe { transmute(0x5270u32) }), 0x3e6b => Some(unsafe { transmute(0x57ceu32) }), 0x3e6c => Some(unsafe { transmute(0x5834u32) }), 0x3e6d => Some(unsafe { transmute(0x58ccu32) }), 0x3e6e => Some(unsafe { transmute(0x5b22u32) }), 0x3e6f => Some(unsafe { transmute(0x5e38u32) }), 0x3e70 => Some(unsafe { transmute(0x60c5u32) }), 0x3e71 => Some(unsafe { transmute(0x64feu32) }), 0x3e72 => Some(unsafe { transmute(0x6761u32) }), 0x3e73 => Some(unsafe { transmute(0x6756u32) }), 0x3e74 => Some(unsafe { transmute(0x6d44u32) }), 0x3e75 => Some(unsafe { transmute(0x72b6u32) }), 0x3e76 => Some(unsafe { transmute(0x7573u32) }), 0x3e77 => Some(unsafe { transmute(0x7a63u32) }), 0x3e78 => Some(unsafe { transmute(0x84b8u32) }), 0x3e79 => Some(unsafe { transmute(0x8b72u32) }), 0x3e7a => Some(unsafe { transmute(0x91b8u32) }), 0x3e7b => Some(unsafe { transmute(0x9320u32) }), 0x3e7c => Some(unsafe { transmute(0x5631u32) }), 0x3e7d => Some(unsafe { transmute(0x57f4u32) }), 0x3e7e => Some(unsafe { transmute(0x98feu32) }), 0x3f21 => Some(unsafe { transmute(0x62edu32) }), 0x3f22 => Some(unsafe { transmute(0x690du32) }), 0x3f23 => Some(unsafe { transmute(0x6b96u32) }), 0x3f24 => Some(unsafe { transmute(0x71edu32) }), 0x3f25 => Some(unsafe { transmute(0x7e54u32) }), 0x3f26 => Some(unsafe { transmute(0x8077u32) }), 0x3f27 => Some(unsafe { transmute(0x8272u32) }), 0x3f28 => Some(unsafe { transmute(0x89e6u32) }), 0x3f29 => Some(unsafe { transmute(0x98dfu32) }), 0x3f2a => Some(unsafe { transmute(0x8755u32) }), 0x3f2b => Some(unsafe { transmute(0x8fb1u32) }), 0x3f2c => Some(unsafe { transmute(0x5c3bu32) }), 0x3f2d => Some(unsafe { transmute(0x4f38u32) }), 0x3f2e => Some(unsafe { transmute(0x4fe1u32) }), 0x3f2f => Some(unsafe { transmute(0x4fb5u32) }), 0x3f30 => Some(unsafe { transmute(0x5507u32) }), 0x3f31 => Some(unsafe { transmute(0x5a20u32) }), 0x3f32 => Some(unsafe { transmute(0x5bddu32) }), 0x3f33 => Some(unsafe { transmute(0x5be9u32) }), 0x3f34 => Some(unsafe { transmute(0x5fc3u32) }), 0x3f35 => Some(unsafe { transmute(0x614eu32) }), 0x3f36 => Some(unsafe { transmute(0x632fu32) }), 0x3f37 => Some(unsafe { transmute(0x65b0u32) }), 0x3f38 => Some(unsafe { transmute(0x664bu32) }), 0x3f39 => Some(unsafe { transmute(0x68eeu32) }), 0x3f3a => Some(unsafe { transmute(0x699bu32) }), 0x3f3b => Some(unsafe { transmute(0x6d78u32) }), 0x3f3c => Some(unsafe { transmute(0x6df1u32) }), 0x3f3d => Some(unsafe { transmute(0x7533u32) }), 0x3f3e => Some(unsafe { transmute(0x75b9u32) }), 0x3f3f => Some(unsafe { transmute(0x771fu32) }), 0x3f40 => Some(unsafe { transmute(0x795eu32) }), 0x3f41 => Some(unsafe { transmute(0x79e6u32) }), 0x3f42 => Some(unsafe { transmute(0x7d33u32) }), 0x3f43 => Some(unsafe { transmute(0x81e3u32) }), 0x3f44 => Some(unsafe { transmute(0x82afu32) }), 0x3f45 => Some(unsafe { transmute(0x85aau32) }), 0x3f46 => Some(unsafe { transmute(0x89aau32) }), 0x3f47 => Some(unsafe { transmute(0x8a3au32) }), 0x3f48 => Some(unsafe { transmute(0x8eabu32) }), 0x3f49 => Some(unsafe { transmute(0x8f9bu32) }), 0x3f4a => Some(unsafe { transmute(0x9032u32) }), 0x3f4b => Some(unsafe { transmute(0x91ddu32) }), 0x3f4c => Some(unsafe { transmute(0x9707u32) }), 0x3f4d => Some(unsafe { transmute(0x4ebau32) }), 0x3f4e => Some(unsafe { transmute(0x4ec1u32) }), 0x3f4f => Some(unsafe { transmute(0x5203u32) }), 0x3f50 => Some(unsafe { transmute(0x5875u32) }), 0x3f51 => Some(unsafe { transmute(0x58ecu32) }), 0x3f52 => Some(unsafe { transmute(0x5c0bu32) }), 0x3f53 => Some(unsafe { transmute(0x751au32) }), 0x3f54 => Some(unsafe { transmute(0x5c3du32) }), 0x3f55 => Some(unsafe { transmute(0x814eu32) }), 0x3f56 => Some(unsafe { transmute(0x8a0au32) }), 0x3f57 => Some(unsafe { transmute(0x8fc5u32) }), 0x3f58 => Some(unsafe { transmute(0x9663u32) }), 0x3f59 => Some(unsafe { transmute(0x976du32) }), 0x3f5a => Some(unsafe { transmute(0x7b25u32) }), 0x3f5b => Some(unsafe { transmute(0x8acfu32) }), 0x3f5c => Some(unsafe { transmute(0x9808u32) }), 0x3f5d => Some(unsafe { transmute(0x9162u32) }), 0x3f5e => Some(unsafe { transmute(0x56f3u32) }), 0x3f5f => Some(unsafe { transmute(0x53a8u32) }), 0x3f60 => Some(unsafe { transmute(0x9017u32) }), 0x3f61 => Some(unsafe { transmute(0x5439u32) }), 0x3f62 => Some(unsafe { transmute(0x5782u32) }), 0x3f63 => Some(unsafe { transmute(0x5e25u32) }), 0x3f64 => Some(unsafe { transmute(0x63a8u32) }), 0x3f65 => Some(unsafe { transmute(0x6c34u32) }), 0x3f66 => Some(unsafe { transmute(0x708au32) }), 0x3f67 => Some(unsafe { transmute(0x7761u32) }), 0x3f68 => Some(unsafe { transmute(0x7c8bu32) }), 0x3f69 => Some(unsafe { transmute(0x7fe0u32) }), 0x3f6a => Some(unsafe { transmute(0x8870u32) }), 0x3f6b => Some(unsafe { transmute(0x9042u32) }), 0x3f6c => Some(unsafe { transmute(0x9154u32) }), 0x3f6d => Some(unsafe { transmute(0x9310u32) }), 0x3f6e => Some(unsafe { transmute(0x9318u32) }), 0x3f6f => Some(unsafe { transmute(0x968fu32) }), 0x3f70 => Some(unsafe { transmute(0x745eu32) }), 0x3f71 => Some(unsafe { transmute(0x9ac4u32) }), 0x3f72 => Some(unsafe { transmute(0x5d07u32) }), 0x3f73 => Some(unsafe { transmute(0x5d69u32) }), 0x3f74 => Some(unsafe { transmute(0x6570u32) }), 0x3f75 => Some(unsafe { transmute(0x67a2u32) }), 0x3f76 => Some(unsafe { transmute(0x8da8u32) }), 0x3f77 => Some(unsafe { transmute(0x96dbu32) }), 0x3f78 => Some(unsafe { transmute(0x636eu32) }), 0x3f79 => Some(unsafe { transmute(0x6749u32) }), 0x3f7a => Some(unsafe { transmute(0x6919u32) }), 0x3f7b => Some(unsafe { transmute(0x83c5u32) }), 0x3f7c => Some(unsafe { transmute(0x9817u32) }), 0x3f7d => Some(unsafe { transmute(0x96c0u32) }), 0x3f7e => Some(unsafe { transmute(0x88feu32) }), 0x4021 => Some(unsafe { transmute(0x6f84u32) }), 0x4022 => Some(unsafe { transmute(0x647au32) }), 0x4023 => Some(unsafe { transmute(0x5bf8u32) }), 0x4024 => Some(unsafe { transmute(0x4e16u32) }), 0x4025 => Some(unsafe { transmute(0x702cu32) }), 0x4026 => Some(unsafe { transmute(0x755du32) }), 0x4027 => Some(unsafe { transmute(0x662fu32) }), 0x4028 => Some(unsafe { transmute(0x51c4u32) }), 0x4029 => Some(unsafe { transmute(0x5236u32) }), 0x402a => Some(unsafe { transmute(0x52e2u32) }), 0x402b => Some(unsafe { transmute(0x59d3u32) }), 0x402c => Some(unsafe { transmute(0x5f81u32) }), 0x402d => Some(unsafe { transmute(0x6027u32) }), 0x402e => Some(unsafe { transmute(0x6210u32) }), 0x402f => Some(unsafe { transmute(0x653fu32) }), 0x4030 => Some(unsafe { transmute(0x6574u32) }), 0x4031 => Some(unsafe { transmute(0x661fu32) }), 0x4032 => Some(unsafe { transmute(0x6674u32) }), 0x4033 => Some(unsafe { transmute(0x68f2u32) }), 0x4034 => Some(unsafe { transmute(0x6816u32) }), 0x4035 => Some(unsafe { transmute(0x6b63u32) }), 0x4036 => Some(unsafe { transmute(0x6e05u32) }), 0x4037 => Some(unsafe { transmute(0x7272u32) }), 0x4038 => Some(unsafe { transmute(0x751fu32) }), 0x4039 => Some(unsafe { transmute(0x76dbu32) }), 0x403a => Some(unsafe { transmute(0x7cbeu32) }), 0x403b => Some(unsafe { transmute(0x8056u32) }), 0x403c => Some(unsafe { transmute(0x58f0u32) }), 0x403d => Some(unsafe { transmute(0x88fdu32) }), 0x403e => Some(unsafe { transmute(0x897fu32) }), 0x403f => Some(unsafe { transmute(0x8aa0u32) }), 0x4040 => Some(unsafe { transmute(0x8a93u32) }), 0x4041 => Some(unsafe { transmute(0x8acbu32) }), 0x4042 => Some(unsafe { transmute(0x901du32) }), 0x4043 => Some(unsafe { transmute(0x9192u32) }), 0x4044 => Some(unsafe { transmute(0x9752u32) }), 0x4045 => Some(unsafe { transmute(0x9759u32) }), 0x4046 => Some(unsafe { transmute(0x6589u32) }), 0x4047 => Some(unsafe { transmute(0x7a0eu32) }), 0x4048 => Some(unsafe { transmute(0x8106u32) }), 0x4049 => Some(unsafe { transmute(0x96bbu32) }), 0x404a => Some(unsafe { transmute(0x5e2du32) }), 0x404b => Some(unsafe { transmute(0x60dcu32) }), 0x404c => Some(unsafe { transmute(0x621au32) }), 0x404d => Some(unsafe { transmute(0x65a5u32) }), 0x404e => Some(unsafe { transmute(0x6614u32) }), 0x404f => Some(unsafe { transmute(0x6790u32) }), 0x4050 => Some(unsafe { transmute(0x77f3u32) }), 0x4051 => Some(unsafe { transmute(0x7a4du32) }), 0x4052 => Some(unsafe { transmute(0x7c4du32) }), 0x4053 => Some(unsafe { transmute(0x7e3eu32) }), 0x4054 => Some(unsafe { transmute(0x810au32) }), 0x4055 => Some(unsafe { transmute(0x8cacu32) }), 0x4056 => Some(unsafe { transmute(0x8d64u32) }), 0x4057 => Some(unsafe { transmute(0x8de1u32) }), 0x4058 => Some(unsafe { transmute(0x8e5fu32) }), 0x4059 => Some(unsafe { transmute(0x78a9u32) }), 0x405a => Some(unsafe { transmute(0x5207u32) }), 0x405b => Some(unsafe { transmute(0x62d9u32) }), 0x405c => Some(unsafe { transmute(0x63a5u32) }), 0x405d => Some(unsafe { transmute(0x6442u32) }), 0x405e => Some(unsafe { transmute(0x6298u32) }), 0x405f => Some(unsafe { transmute(0x8a2du32) }), 0x4060 => Some(unsafe { transmute(0x7a83u32) }), 0x4061 => Some(unsafe { transmute(0x7bc0u32) }), 0x4062 => Some(unsafe { transmute(0x8aacu32) }), 0x4063 => Some(unsafe { transmute(0x96eau32) }), 0x4064 => Some(unsafe { transmute(0x7d76u32) }), 0x4065 => Some(unsafe { transmute(0x820cu32) }), 0x4066 => Some(unsafe { transmute(0x8749u32) }), 0x4067 => Some(unsafe { transmute(0x4ed9u32) }), 0x4068 => Some(unsafe { transmute(0x5148u32) }), 0x4069 => Some(unsafe { transmute(0x5343u32) }), 0x406a => Some(unsafe { transmute(0x5360u32) }), 0x406b => Some(unsafe { transmute(0x5ba3u32) }), 0x406c => Some(unsafe { transmute(0x5c02u32) }), 0x406d => Some(unsafe { transmute(0x5c16u32) }), 0x406e => Some(unsafe { transmute(0x5dddu32) }), 0x406f => Some(unsafe { transmute(0x6226u32) }), 0x4070 => Some(unsafe { transmute(0x6247u32) }), 0x4071 => Some(unsafe { transmute(0x64b0u32) }), 0x4072 => Some(unsafe { transmute(0x6813u32) }), 0x4073 => Some(unsafe { transmute(0x6834u32) }), 0x4074 => Some(unsafe { transmute(0x6cc9u32) }), 0x4075 => Some(unsafe { transmute(0x6d45u32) }), 0x4076 => Some(unsafe { transmute(0x6d17u32) }), 0x4077 => Some(unsafe { transmute(0x67d3u32) }), 0x4078 => Some(unsafe { transmute(0x6f5cu32) }), 0x4079 => Some(unsafe { transmute(0x714eu32) }), 0x407a => Some(unsafe { transmute(0x717du32) }), 0x407b => Some(unsafe { transmute(0x65cbu32) }), 0x407c => Some(unsafe { transmute(0x7a7fu32) }), 0x407d => Some(unsafe { transmute(0x7badu32) }), 0x407e => Some(unsafe { transmute(0x7ddau32) }), 0x4121 => Some(unsafe { transmute(0x7e4au32) }), 0x4122 => Some(unsafe { transmute(0x7fa8u32) }), 0x4123 => Some(unsafe { transmute(0x817au32) }), 0x4124 => Some(unsafe { transmute(0x821bu32) }), 0x4125 => Some(unsafe { transmute(0x8239u32) }), 0x4126 => Some(unsafe { transmute(0x85a6u32) }), 0x4127 => Some(unsafe { transmute(0x8a6eu32) }), 0x4128 => Some(unsafe { transmute(0x8cceu32) }), 0x4129 => Some(unsafe { transmute(0x8df5u32) }), 0x412a => Some(unsafe { transmute(0x9078u32) }), 0x412b => Some(unsafe { transmute(0x9077u32) }), 0x412c => Some(unsafe { transmute(0x92adu32) }), 0x412d => Some(unsafe { transmute(0x9291u32) }), 0x412e => Some(unsafe { transmute(0x9583u32) }), 0x412f => Some(unsafe { transmute(0x9baeu32) }), 0x4130 => Some(unsafe { transmute(0x524du32) }), 0x4131 => Some(unsafe { transmute(0x5584u32) }), 0x4132 => Some(unsafe { transmute(0x6f38u32) }), 0x4133 => Some(unsafe { transmute(0x7136u32) }), 0x4134 => Some(unsafe { transmute(0x5168u32) }), 0x4135 => Some(unsafe { transmute(0x7985u32) }), 0x4136 => Some(unsafe { transmute(0x7e55u32) }), 0x4137 => Some(unsafe { transmute(0x81b3u32) }), 0x4138 => Some(unsafe { transmute(0x7cceu32) }), 0x4139 => Some(unsafe { transmute(0x564cu32) }), 0x413a => Some(unsafe { transmute(0x5851u32) }), 0x413b => Some(unsafe { transmute(0x5ca8u32) }), 0x413c => Some(unsafe { transmute(0x63aau32) }), 0x413d => Some(unsafe { transmute(0x66feu32) }), 0x413e => Some(unsafe { transmute(0x66fdu32) }), 0x413f => Some(unsafe { transmute(0x695au32) }), 0x4140 => Some(unsafe { transmute(0x72d9u32) }), 0x4141 => Some(unsafe { transmute(0x758fu32) }), 0x4142 => Some(unsafe { transmute(0x758eu32) }), 0x4143 => Some(unsafe { transmute(0x790eu32) }), 0x4144 => Some(unsafe { transmute(0x7956u32) }), 0x4145 => Some(unsafe { transmute(0x79dfu32) }), 0x4146 => Some(unsafe { transmute(0x7c97u32) }), 0x4147 => Some(unsafe { transmute(0x7d20u32) }), 0x4148 => Some(unsafe { transmute(0x7d44u32) }), 0x4149 => Some(unsafe { transmute(0x8607u32) }), 0x414a => Some(unsafe { transmute(0x8a34u32) }), 0x414b => Some(unsafe { transmute(0x963bu32) }), 0x414c => Some(unsafe { transmute(0x9061u32) }), 0x414d => Some(unsafe { transmute(0x9f20u32) }), 0x414e => Some(unsafe { transmute(0x50e7u32) }), 0x414f => Some(unsafe { transmute(0x5275u32) }), 0x4150 => Some(unsafe { transmute(0x53ccu32) }), 0x4151 => Some(unsafe { transmute(0x53e2u32) }), 0x4152 => Some(unsafe { transmute(0x5009u32) }), 0x4153 => Some(unsafe { transmute(0x55aau32) }), 0x4154 => Some(unsafe { transmute(0x58eeu32) }), 0x4155 => Some(unsafe { transmute(0x594fu32) }), 0x4156 => Some(unsafe { transmute(0x723du32) }), 0x4157 => Some(unsafe { transmute(0x5b8bu32) }), 0x4158 => Some(unsafe { transmute(0x5c64u32) }), 0x4159 => Some(unsafe { transmute(0x531du32) }), 0x415a => Some(unsafe { transmute(0x60e3u32) }), 0x415b => Some(unsafe { transmute(0x60f3u32) }), 0x415c => Some(unsafe { transmute(0x635cu32) }), 0x415d => Some(unsafe { transmute(0x6383u32) }), 0x415e => Some(unsafe { transmute(0x633fu32) }), 0x415f => Some(unsafe { transmute(0x63bbu32) }), 0x4160 => Some(unsafe { transmute(0x64cdu32) }), 0x4161 => Some(unsafe { transmute(0x65e9u32) }), 0x4162 => Some(unsafe { transmute(0x66f9u32) }), 0x4163 => Some(unsafe { transmute(0x5de3u32) }), 0x4164 => Some(unsafe { transmute(0x69cdu32) }), 0x4165 => Some(unsafe { transmute(0x69fdu32) }), 0x4166 => Some(unsafe { transmute(0x6f15u32) }), 0x4167 => Some(unsafe { transmute(0x71e5u32) }), 0x4168 => Some(unsafe { transmute(0x4e89u32) }), 0x4169 => Some(unsafe { transmute(0x75e9u32) }), 0x416a => Some(unsafe { transmute(0x76f8u32) }), 0x416b => Some(unsafe { transmute(0x7a93u32) }), 0x416c => Some(unsafe { transmute(0x7cdfu32) }), 0x416d => Some(unsafe { transmute(0x7dcfu32) }), 0x416e => Some(unsafe { transmute(0x7d9cu32) }), 0x416f => Some(unsafe { transmute(0x8061u32) }), 0x4170 => Some(unsafe { transmute(0x8349u32) }), 0x4171 => Some(unsafe { transmute(0x8358u32) }), 0x4172 => Some(unsafe { transmute(0x846cu32) }), 0x4173 => Some(unsafe { transmute(0x84bcu32) }), 0x4174 => Some(unsafe { transmute(0x85fbu32) }), 0x4175 => Some(unsafe { transmute(0x88c5u32) }), 0x4176 => Some(unsafe { transmute(0x8d70u32) }), 0x4177 => Some(unsafe { transmute(0x9001u32) }), 0x4178 => Some(unsafe { transmute(0x906du32) }), 0x4179 => Some(unsafe { transmute(0x9397u32) }), 0x417a => Some(unsafe { transmute(0x971cu32) }), 0x417b => Some(unsafe { transmute(0x9a12u32) }), 0x417c => Some(unsafe { transmute(0x50cfu32) }), 0x417d => Some(unsafe { transmute(0x5897u32) }), 0x417e => Some(unsafe { transmute(0x618eu32) }), 0x4221 => Some(unsafe { transmute(0x81d3u32) }), 0x4222 => Some(unsafe { transmute(0x8535u32) }), 0x4223 => Some(unsafe { transmute(0x8d08u32) }), 0x4224 => Some(unsafe { transmute(0x9020u32) }), 0x4225 => Some(unsafe { transmute(0x4fc3u32) }), 0x4226 => Some(unsafe { transmute(0x5074u32) }), 0x4227 => Some(unsafe { transmute(0x5247u32) }), 0x4228 => Some(unsafe { transmute(0x5373u32) }), 0x4229 => Some(unsafe { transmute(0x606fu32) }), 0x422a => Some(unsafe { transmute(0x6349u32) }), 0x422b => Some(unsafe { transmute(0x675fu32) }), 0x422c => Some(unsafe { transmute(0x6e2cu32) }), 0x422d => Some(unsafe { transmute(0x8db3u32) }), 0x422e => Some(unsafe { transmute(0x901fu32) }), 0x422f => Some(unsafe { transmute(0x4fd7u32) }), 0x4230 => Some(unsafe { transmute(0x5c5eu32) }), 0x4231 => Some(unsafe { transmute(0x8ccau32) }), 0x4232 => Some(unsafe { transmute(0x65cfu32) }), 0x4233 => Some(unsafe { transmute(0x7d9au32) }), 0x4234 => Some(unsafe { transmute(0x5352u32) }), 0x4235 => Some(unsafe { transmute(0x8896u32) }), 0x4236 => Some(unsafe { transmute(0x5176u32) }), 0x4237 => Some(unsafe { transmute(0x63c3u32) }), 0x4238 => Some(unsafe { transmute(0x5b58u32) }), 0x4239 => Some(unsafe { transmute(0x5b6bu32) }), 0x423a => Some(unsafe { transmute(0x5c0au32) }), 0x423b => Some(unsafe { transmute(0x640du32) }), 0x423c => Some(unsafe { transmute(0x6751u32) }), 0x423d => Some(unsafe { transmute(0x905cu32) }), 0x423e => Some(unsafe { transmute(0x4ed6u32) }), 0x423f => Some(unsafe { transmute(0x591au32) }), 0x4240 => Some(unsafe { transmute(0x592au32) }), 0x4241 => Some(unsafe { transmute(0x6c70u32) }), 0x4242 => Some(unsafe { transmute(0x8a51u32) }), 0x4243 => Some(unsafe { transmute(0x553eu32) }), 0x4244 => Some(unsafe { transmute(0x5815u32) }), 0x4245 => Some(unsafe { transmute(0x59a5u32) }), 0x4246 => Some(unsafe { transmute(0x60f0u32) }), 0x4247 => Some(unsafe { transmute(0x6253u32) }), 0x4248 => Some(unsafe { transmute(0x67c1u32) }), 0x4249 => Some(unsafe { transmute(0x8235u32) }), 0x424a => Some(unsafe { transmute(0x6955u32) }), 0x424b => Some(unsafe { transmute(0x9640u32) }), 0x424c => Some(unsafe { transmute(0x99c4u32) }), 0x424d => Some(unsafe { transmute(0x9a28u32) }), 0x424e => Some(unsafe { transmute(0x4f53u32) }), 0x424f => Some(unsafe { transmute(0x5806u32) }), 0x4250 => Some(unsafe { transmute(0x5bfeu32) }), 0x4251 => Some(unsafe { transmute(0x8010u32) }), 0x4252 => Some(unsafe { transmute(0x5cb1u32) }), 0x4253 => Some(unsafe { transmute(0x5e2fu32) }), 0x4254 => Some(unsafe { transmute(0x5f85u32) }), 0x4255 => Some(unsafe { transmute(0x6020u32) }), 0x4256 => Some(unsafe { transmute(0x614bu32) }), 0x4257 => Some(unsafe { transmute(0x6234u32) }), 0x4258 => Some(unsafe { transmute(0x66ffu32) }), 0x4259 => Some(unsafe { transmute(0x6cf0u32) }), 0x425a => Some(unsafe { transmute(0x6edeu32) }), 0x425b => Some(unsafe { transmute(0x80ceu32) }), 0x425c => Some(unsafe { transmute(0x817fu32) }), 0x425d => Some(unsafe { transmute(0x82d4u32) }), 0x425e => Some(unsafe { transmute(0x888bu32) }), 0x425f => Some(unsafe { transmute(0x8cb8u32) }), 0x4260 => Some(unsafe { transmute(0x9000u32) }), 0x4261 => Some(unsafe { transmute(0x902eu32) }), 0x4262 => Some(unsafe { transmute(0x968au32) }), 0x4263 => Some(unsafe { transmute(0x9edbu32) }), 0x4264 => Some(unsafe { transmute(0x9bdbu32) }), 0x4265 => Some(unsafe { transmute(0x4ee3u32) }), 0x4266 => Some(unsafe { transmute(0x53f0u32) }), 0x4267 => Some(unsafe { transmute(0x5927u32) }), 0x4268 => Some(unsafe { transmute(0x7b2cu32) }), 0x4269 => Some(unsafe { transmute(0x918du32) }), 0x426a => Some(unsafe { transmute(0x984cu32) }), 0x426b => Some(unsafe { transmute(0x9df9u32) }), 0x426c => Some(unsafe { transmute(0x6eddu32) }), 0x426d => Some(unsafe { transmute(0x7027u32) }), 0x426e => Some(unsafe { transmute(0x5353u32) }), 0x426f => Some(unsafe { transmute(0x5544u32) }), 0x4270 => Some(unsafe { transmute(0x5b85u32) }), 0x4271 => Some(unsafe { transmute(0x6258u32) }), 0x4272 => Some(unsafe { transmute(0x629eu32) }), 0x4273 => Some(unsafe { transmute(0x62d3u32) }), 0x4274 => Some(unsafe { transmute(0x6ca2u32) }), 0x4275 => Some(unsafe { transmute(0x6fefu32) }), 0x4276 => Some(unsafe { transmute(0x7422u32) }), 0x4277 => Some(unsafe { transmute(0x8a17u32) }), 0x4278 => Some(unsafe { transmute(0x9438u32) }), 0x4279 => Some(unsafe { transmute(0x6fc1u32) }), 0x427a => Some(unsafe { transmute(0x8afeu32) }), 0x427b => Some(unsafe { transmute(0x8338u32) }), 0x427c => Some(unsafe { transmute(0x51e7u32) }), 0x427d => Some(unsafe { transmute(0x86f8u32) }), 0x427e => Some(unsafe { transmute(0x53eau32) }), 0x4321 => Some(unsafe { transmute(0x53e9u32) }), 0x4322 => Some(unsafe { transmute(0x4f46u32) }), 0x4323 => Some(unsafe { transmute(0x9054u32) }), 0x4324 => Some(unsafe { transmute(0x8fb0u32) }), 0x4325 => Some(unsafe { transmute(0x596au32) }), 0x4326 => Some(unsafe { transmute(0x8131u32) }), 0x4327 => Some(unsafe { transmute(0x5dfdu32) }), 0x4328 => Some(unsafe { transmute(0x7aeau32) }), 0x4329 => Some(unsafe { transmute(0x8fbfu32) }), 0x432a => Some(unsafe { transmute(0x68dau32) }), 0x432b => Some(unsafe { transmute(0x8c37u32) }), 0x432c => Some(unsafe { transmute(0x72f8u32) }), 0x432d => Some(unsafe { transmute(0x9c48u32) }), 0x432e => Some(unsafe { transmute(0x6a3du32) }), 0x432f => Some(unsafe { transmute(0x8ab0u32) }), 0x4330 => Some(unsafe { transmute(0x4e39u32) }), 0x4331 => Some(unsafe { transmute(0x5358u32) }), 0x4332 => Some(unsafe { transmute(0x5606u32) }), 0x4333 => Some(unsafe { transmute(0x5766u32) }), 0x4334 => Some(unsafe { transmute(0x62c5u32) }), 0x4335 => Some(unsafe { transmute(0x63a2u32) }), 0x4336 => Some(unsafe { transmute(0x65e6u32) }), 0x4337 => Some(unsafe { transmute(0x6b4eu32) }), 0x4338 => Some(unsafe { transmute(0x6de1u32) }), 0x4339 => Some(unsafe { transmute(0x6e5bu32) }), 0x433a => Some(unsafe { transmute(0x70adu32) }), 0x433b => Some(unsafe { transmute(0x77edu32) }), 0x433c => Some(unsafe { transmute(0x7aefu32) }), 0x433d => Some(unsafe { transmute(0x7baau32) }), 0x433e => Some(unsafe { transmute(0x7dbbu32) }), 0x433f => Some(unsafe { transmute(0x803du32) }), 0x4340 => Some(unsafe { transmute(0x80c6u32) }), 0x4341 => Some(unsafe { transmute(0x86cbu32) }), 0x4342 => Some(unsafe { transmute(0x8a95u32) }), 0x4343 => Some(unsafe { transmute(0x935bu32) }), 0x4344 => Some(unsafe { transmute(0x56e3u32) }), 0x4345 => Some(unsafe { transmute(0x58c7u32) }), 0x4346 => Some(unsafe { transmute(0x5f3eu32) }), 0x4347 => Some(unsafe { transmute(0x65adu32) }), 0x4348 => Some(unsafe { transmute(0x6696u32) }), 0x4349 => Some(unsafe { transmute(0x6a80u32) }), 0x434a => Some(unsafe { transmute(0x6bb5u32) }), 0x434b => Some(unsafe { transmute(0x7537u32) }), 0x434c => Some(unsafe { transmute(0x8ac7u32) }), 0x434d => Some(unsafe { transmute(0x5024u32) }), 0x434e => Some(unsafe { transmute(0x77e5u32) }), 0x434f => Some(unsafe { transmute(0x5730u32) }), 0x4350 => Some(unsafe { transmute(0x5f1bu32) }), 0x4351 => Some(unsafe { transmute(0x6065u32) }), 0x4352 => Some(unsafe { transmute(0x667au32) }), 0x4353 => Some(unsafe { transmute(0x6c60u32) }), 0x4354 => Some(unsafe { transmute(0x75f4u32) }), 0x4355 => Some(unsafe { transmute(0x7a1au32) }), 0x4356 => Some(unsafe { transmute(0x7f6eu32) }), 0x4357 => Some(unsafe { transmute(0x81f4u32) }), 0x4358 => Some(unsafe { transmute(0x8718u32) }), 0x4359 => Some(unsafe { transmute(0x9045u32) }), 0x435a => Some(unsafe { transmute(0x99b3u32) }), 0x435b => Some(unsafe { transmute(0x7bc9u32) }), 0x435c => Some(unsafe { transmute(0x755cu32) }), 0x435d => Some(unsafe { transmute(0x7af9u32) }), 0x435e => Some(unsafe { transmute(0x7b51u32) }), 0x435f => Some(unsafe { transmute(0x84c4u32) }), 0x4360 => Some(unsafe { transmute(0x9010u32) }), 0x4361 => Some(unsafe { transmute(0x79e9u32) }), 0x4362 => Some(unsafe { transmute(0x7a92u32) }), 0x4363 => Some(unsafe { transmute(0x8336u32) }), 0x4364 => Some(unsafe { transmute(0x5ae1u32) }), 0x4365 => Some(unsafe { transmute(0x7740u32) }), 0x4366 => Some(unsafe { transmute(0x4e2du32) }), 0x4367 => Some(unsafe { transmute(0x4ef2u32) }), 0x4368 => Some(unsafe { transmute(0x5b99u32) }), 0x4369 => Some(unsafe { transmute(0x5fe0u32) }), 0x436a => Some(unsafe { transmute(0x62bdu32) }), 0x436b => Some(unsafe { transmute(0x663cu32) }), 0x436c => Some(unsafe { transmute(0x67f1u32) }), 0x436d => Some(unsafe { transmute(0x6ce8u32) }), 0x436e => Some(unsafe { transmute(0x866bu32) }), 0x436f => Some(unsafe { transmute(0x8877u32) }), 0x4370 => Some(unsafe { transmute(0x8a3bu32) }), 0x4371 => Some(unsafe { transmute(0x914eu32) }), 0x4372 => Some(unsafe { transmute(0x92f3u32) }), 0x4373 => Some(unsafe { transmute(0x99d0u32) }), 0x4374 => Some(unsafe { transmute(0x6a17u32) }), 0x4375 => Some(unsafe { transmute(0x7026u32) }), 0x4376 => Some(unsafe { transmute(0x732au32) }), 0x4377 => Some(unsafe { transmute(0x82e7u32) }), 0x4378 => Some(unsafe { transmute(0x8457u32) }), 0x4379 => Some(unsafe { transmute(0x8cafu32) }), 0x437a => Some(unsafe { transmute(0x4e01u32) }), 0x437b => Some(unsafe { transmute(0x5146u32) }), 0x437c => Some(unsafe { transmute(0x51cbu32) }), 0x437d => Some(unsafe { transmute(0x558bu32) }), 0x437e => Some(unsafe { transmute(0x5bf5u32) }), 0x4421 => Some(unsafe { transmute(0x5e16u32) }), 0x4422 => Some(unsafe { transmute(0x5e33u32) }), 0x4423 => Some(unsafe { transmute(0x5e81u32) }), 0x4424 => Some(unsafe { transmute(0x5f14u32) }), 0x4425 => Some(unsafe { transmute(0x5f35u32) }), 0x4426 => Some(unsafe { transmute(0x5f6bu32) }), 0x4427 => Some(unsafe { transmute(0x5fb4u32) }), 0x4428 => Some(unsafe { transmute(0x61f2u32) }), 0x4429 => Some(unsafe { transmute(0x6311u32) }), 0x442a => Some(unsafe { transmute(0x66a2u32) }), 0x442b => Some(unsafe { transmute(0x671du32) }), 0x442c => Some(unsafe { transmute(0x6f6eu32) }), 0x442d => Some(unsafe { transmute(0x7252u32) }), 0x442e => Some(unsafe { transmute(0x753au32) }), 0x442f => Some(unsafe { transmute(0x773au32) }), 0x4430 => Some(unsafe { transmute(0x8074u32) }), 0x4431 => Some(unsafe { transmute(0x8139u32) }), 0x4432 => Some(unsafe { transmute(0x8178u32) }), 0x4433 => Some(unsafe { transmute(0x8776u32) }), 0x4434 => Some(unsafe { transmute(0x8abfu32) }), 0x4435 => Some(unsafe { transmute(0x8adcu32) }), 0x4436 => Some(unsafe { transmute(0x8d85u32) }), 0x4437 => Some(unsafe { transmute(0x8df3u32) }), 0x4438 => Some(unsafe { transmute(0x929au32) }), 0x4439 => Some(unsafe { transmute(0x9577u32) }), 0x443a => Some(unsafe { transmute(0x9802u32) }), 0x443b => Some(unsafe { transmute(0x9ce5u32) }), 0x443c => Some(unsafe { transmute(0x52c5u32) }), 0x443d => Some(unsafe { transmute(0x6357u32) }), 0x443e => Some(unsafe { transmute(0x76f4u32) }), 0x443f => Some(unsafe { transmute(0x6715u32) }), 0x4440 => Some(unsafe { transmute(0x6c88u32) }), 0x4441 => Some(unsafe { transmute(0x73cdu32) }), 0x4442 => Some(unsafe { transmute(0x8cc3u32) }), 0x4443 => Some(unsafe { transmute(0x93aeu32) }), 0x4444 => Some(unsafe { transmute(0x9673u32) }), 0x4445 => Some(unsafe { transmute(0x6d25u32) }), 0x4446 => Some(unsafe { transmute(0x589cu32) }), 0x4447 => Some(unsafe { transmute(0x690eu32) }), 0x4448 => Some(unsafe { transmute(0x69ccu32) }), 0x4449 => Some(unsafe { transmute(0x8ffdu32) }), 0x444a => Some(unsafe { transmute(0x939au32) }), 0x444b => Some(unsafe { transmute(0x75dbu32) }), 0x444c => Some(unsafe { transmute(0x901au32) }), 0x444d => Some(unsafe { transmute(0x585au32) }), 0x444e => Some(unsafe { transmute(0x6802u32) }), 0x444f => Some(unsafe { transmute(0x63b4u32) }), 0x4450 => Some(unsafe { transmute(0x69fbu32) }), 0x4451 => Some(unsafe { transmute(0x4f43u32) }), 0x4452 => Some(unsafe { transmute(0x6f2cu32) }), 0x4453 => Some(unsafe { transmute(0x67d8u32) }), 0x4454 => Some(unsafe { transmute(0x8fbbu32) }), 0x4455 => Some(unsafe { transmute(0x8526u32) }), 0x4456 => Some(unsafe { transmute(0x7db4u32) }), 0x4457 => Some(unsafe { transmute(0x9354u32) }), 0x4458 => Some(unsafe { transmute(0x693fu32) }), 0x4459 => Some(unsafe { transmute(0x6f70u32) }), 0x445a => Some(unsafe { transmute(0x576au32) }), 0x445b => Some(unsafe { transmute(0x58f7u32) }), 0x445c => Some(unsafe { transmute(0x5b2cu32) }), 0x445d => Some(unsafe { transmute(0x7d2cu32) }), 0x445e => Some(unsafe { transmute(0x722au32) }), 0x445f => Some(unsafe { transmute(0x540au32) }), 0x4460 => Some(unsafe { transmute(0x91e3u32) }), 0x4461 => Some(unsafe { transmute(0x9db4u32) }), 0x4462 => Some(unsafe { transmute(0x4eadu32) }), 0x4463 => Some(unsafe { transmute(0x4f4eu32) }), 0x4464 => Some(unsafe { transmute(0x505cu32) }), 0x4465 => Some(unsafe { transmute(0x5075u32) }), 0x4466 => Some(unsafe { transmute(0x5243u32) }), 0x4467 => Some(unsafe { transmute(0x8c9eu32) }), 0x4468 => Some(unsafe { transmute(0x5448u32) }), 0x4469 => Some(unsafe { transmute(0x5824u32) }), 0x446a => Some(unsafe { transmute(0x5b9au32) }), 0x446b => Some(unsafe { transmute(0x5e1du32) }), 0x446c => Some(unsafe { transmute(0x5e95u32) }), 0x446d => Some(unsafe { transmute(0x5eadu32) }), 0x446e => Some(unsafe { transmute(0x5ef7u32) }), 0x446f => Some(unsafe { transmute(0x5f1fu32) }), 0x4470 => Some(unsafe { transmute(0x608cu32) }), 0x4471 => Some(unsafe { transmute(0x62b5u32) }), 0x4472 => Some(unsafe { transmute(0x633au32) }), 0x4473 => Some(unsafe { transmute(0x63d0u32) }), 0x4474 => Some(unsafe { transmute(0x68afu32) }), 0x4475 => Some(unsafe { transmute(0x6c40u32) }), 0x4476 => Some(unsafe { transmute(0x7887u32) }), 0x4477 => Some(unsafe { transmute(0x798eu32) }), 0x4478 => Some(unsafe { transmute(0x7a0bu32) }), 0x4479 => Some(unsafe { transmute(0x7de0u32) }), 0x447a => Some(unsafe { transmute(0x8247u32) }), 0x447b => Some(unsafe { transmute(0x8a02u32) }), 0x447c => Some(unsafe { transmute(0x8ae6u32) }), 0x447d => Some(unsafe { transmute(0x8e44u32) }), 0x447e => Some(unsafe { transmute(0x9013u32) }), 0x4521 => Some(unsafe { transmute(0x90b8u32) }), 0x4522 => Some(unsafe { transmute(0x912du32) }), 0x4523 => Some(unsafe { transmute(0x91d8u32) }), 0x4524 => Some(unsafe { transmute(0x9f0eu32) }), 0x4525 => Some(unsafe { transmute(0x6ce5u32) }), 0x4526 => Some(unsafe { transmute(0x6458u32) }), 0x4527 => Some(unsafe { transmute(0x64e2u32) }), 0x4528 => Some(unsafe { transmute(0x6575u32) }), 0x4529 => Some(unsafe { transmute(0x6ef4u32) }), 0x452a => Some(unsafe { transmute(0x7684u32) }), 0x452b => Some(unsafe { transmute(0x7b1bu32) }), 0x452c => Some(unsafe { transmute(0x9069u32) }), 0x452d => Some(unsafe { transmute(0x93d1u32) }), 0x452e => Some(unsafe { transmute(0x6ebau32) }), 0x452f => Some(unsafe { transmute(0x54f2u32) }), 0x4530 => Some(unsafe { transmute(0x5fb9u32) }), 0x4531 => Some(unsafe { transmute(0x64a4u32) }), 0x4532 => Some(unsafe { transmute(0x8f4du32) }), 0x4533 => Some(unsafe { transmute(0x8fedu32) }), 0x4534 => Some(unsafe { transmute(0x9244u32) }), 0x4535 => Some(unsafe { transmute(0x5178u32) }), 0x4536 => Some(unsafe { transmute(0x586bu32) }), 0x4537 => Some(unsafe { transmute(0x5929u32) }), 0x4538 => Some(unsafe { transmute(0x5c55u32) }), 0x4539 => Some(unsafe { transmute(0x5e97u32) }), 0x453a => Some(unsafe { transmute(0x6dfbu32) }), 0x453b => Some(unsafe { transmute(0x7e8fu32) }), 0x453c => Some(unsafe { transmute(0x751cu32) }), 0x453d => Some(unsafe { transmute(0x8cbcu32) }), 0x453e => Some(unsafe { transmute(0x8ee2u32) }), 0x453f => Some(unsafe { transmute(0x985bu32) }), 0x4540 => Some(unsafe { transmute(0x70b9u32) }), 0x4541 => Some(unsafe { transmute(0x4f1du32) }), 0x4542 => Some(unsafe { transmute(0x6bbfu32) }), 0x4543 => Some(unsafe { transmute(0x6fb1u32) }), 0x4544 => Some(unsafe { transmute(0x7530u32) }), 0x4545 => Some(unsafe { transmute(0x96fbu32) }), 0x4546 => Some(unsafe { transmute(0x514eu32) }), 0x4547 => Some(unsafe { transmute(0x5410u32) }), 0x4548 => Some(unsafe { transmute(0x5835u32) }), 0x4549 => Some(unsafe { transmute(0x5857u32) }), 0x454a => Some(unsafe { transmute(0x59acu32) }), 0x454b => Some(unsafe { transmute(0x5c60u32) }), 0x454c => Some(unsafe { transmute(0x5f92u32) }), 0x454d => Some(unsafe { transmute(0x6597u32) }), 0x454e => Some(unsafe { transmute(0x675cu32) }), 0x454f => Some(unsafe { transmute(0x6e21u32) }), 0x4550 => Some(unsafe { transmute(0x767bu32) }), 0x4551 => Some(unsafe { transmute(0x83dfu32) }), 0x4552 => Some(unsafe { transmute(0x8cedu32) }), 0x4553 => Some(unsafe { transmute(0x9014u32) }), 0x4554 => Some(unsafe { transmute(0x90fdu32) }), 0x4555 => Some(unsafe { transmute(0x934du32) }), 0x4556 => Some(unsafe { transmute(0x7825u32) }), 0x4557 => Some(unsafe { transmute(0x783au32) }), 0x4558 => Some(unsafe { transmute(0x52aau32) }), 0x4559 => Some(unsafe { transmute(0x5ea6u32) }), 0x455a => Some(unsafe { transmute(0x571fu32) }), 0x455b => Some(unsafe { transmute(0x5974u32) }), 0x455c => Some(unsafe { transmute(0x6012u32) }), 0x455d => Some(unsafe { transmute(0x5012u32) }), 0x455e => Some(unsafe { transmute(0x515au32) }), 0x455f => Some(unsafe { transmute(0x51acu32) }), 0x4560 => Some(unsafe { transmute(0x51cdu32) }), 0x4561 => Some(unsafe { transmute(0x5200u32) }), 0x4562 => Some(unsafe { transmute(0x5510u32) }), 0x4563 => Some(unsafe { transmute(0x5854u32) }), 0x4564 => Some(unsafe { transmute(0x5858u32) }), 0x4565 => Some(unsafe { transmute(0x5957u32) }), 0x4566 => Some(unsafe { transmute(0x5b95u32) }), 0x4567 => Some(unsafe { transmute(0x5cf6u32) }), 0x4568 => Some(unsafe { transmute(0x5d8bu32) }), 0x4569 => Some(unsafe { transmute(0x60bcu32) }), 0x456a => Some(unsafe { transmute(0x6295u32) }), 0x456b => Some(unsafe { transmute(0x642du32) }), 0x456c => Some(unsafe { transmute(0x6771u32) }), 0x456d => Some(unsafe { transmute(0x6843u32) }), 0x456e => Some(unsafe { transmute(0x68bcu32) }), 0x456f => Some(unsafe { transmute(0x68dfu32) }), 0x4570 => Some(unsafe { transmute(0x76d7u32) }), 0x4571 => Some(unsafe { transmute(0x6dd8u32) }), 0x4572 => Some(unsafe { transmute(0x6e6fu32) }), 0x4573 => Some(unsafe { transmute(0x6d9bu32) }), 0x4574 => Some(unsafe { transmute(0x706fu32) }), 0x4575 => Some(unsafe { transmute(0x71c8u32) }), 0x4576 => Some(unsafe { transmute(0x5f53u32) }), 0x4577 => Some(unsafe { transmute(0x75d8u32) }), 0x4578 => Some(unsafe { transmute(0x7977u32) }), 0x4579 => Some(unsafe { transmute(0x7b49u32) }), 0x457a => Some(unsafe { transmute(0x7b54u32) }), 0x457b => Some(unsafe { transmute(0x7b52u32) }), 0x457c => Some(unsafe { transmute(0x7cd6u32) }), 0x457d => Some(unsafe { transmute(0x7d71u32) }), 0x457e => Some(unsafe { transmute(0x5230u32) }), 0x4621 => Some(unsafe { transmute(0x8463u32) }), 0x4622 => Some(unsafe { transmute(0x8569u32) }), 0x4623 => Some(unsafe { transmute(0x85e4u32) }), 0x4624 => Some(unsafe { transmute(0x8a0eu32) }), 0x4625 => Some(unsafe { transmute(0x8b04u32) }), 0x4626 => Some(unsafe { transmute(0x8c46u32) }), 0x4627 => Some(unsafe { transmute(0x8e0fu32) }), 0x4628 => Some(unsafe { transmute(0x9003u32) }), 0x4629 => Some(unsafe { transmute(0x900fu32) }), 0x462a => Some(unsafe { transmute(0x9419u32) }), 0x462b => Some(unsafe { transmute(0x9676u32) }), 0x462c => Some(unsafe { transmute(0x982du32) }), 0x462d => Some(unsafe { transmute(0x9a30u32) }), 0x462e => Some(unsafe { transmute(0x95d8u32) }), 0x462f => Some(unsafe { transmute(0x50cdu32) }), 0x4630 => Some(unsafe { transmute(0x52d5u32) }), 0x4631 => Some(unsafe { transmute(0x540cu32) }), 0x4632 => Some(unsafe { transmute(0x5802u32) }), 0x4633 => Some(unsafe { transmute(0x5c0eu32) }), 0x4634 => Some(unsafe { transmute(0x61a7u32) }), 0x4635 => Some(unsafe { transmute(0x649eu32) }), 0x4636 => Some(unsafe { transmute(0x6d1eu32) }), 0x4637 => Some(unsafe { transmute(0x77b3u32) }), 0x4638 => Some(unsafe { transmute(0x7ae5u32) }), 0x4639 => Some(unsafe { transmute(0x80f4u32) }), 0x463a => Some(unsafe { transmute(0x8404u32) }), 0x463b => Some(unsafe { transmute(0x9053u32) }), 0x463c => Some(unsafe { transmute(0x9285u32) }), 0x463d => Some(unsafe { transmute(0x5ce0u32) }), 0x463e => Some(unsafe { transmute(0x9d07u32) }), 0x463f => Some(unsafe { transmute(0x533fu32) }), 0x4640 => Some(unsafe { transmute(0x5f97u32) }), 0x4641 => Some(unsafe { transmute(0x5fb3u32) }), 0x4642 => Some(unsafe { transmute(0x6d9cu32) }), 0x4643 => Some(unsafe { transmute(0x7279u32) }), 0x4644 => Some(unsafe { transmute(0x7763u32) }), 0x4645 => Some(unsafe { transmute(0x79bfu32) }), 0x4646 => Some(unsafe { transmute(0x7be4u32) }), 0x4647 => Some(unsafe { transmute(0x6bd2u32) }), 0x4648 => Some(unsafe { transmute(0x72ecu32) }), 0x4649 => Some(unsafe { transmute(0x8aadu32) }), 0x464a => Some(unsafe { transmute(0x6803u32) }), 0x464b => Some(unsafe { transmute(0x6a61u32) }), 0x464c => Some(unsafe { transmute(0x51f8u32) }), 0x464d => Some(unsafe { transmute(0x7a81u32) }), 0x464e => Some(unsafe { transmute(0x6934u32) }), 0x464f => Some(unsafe { transmute(0x5c4au32) }), 0x4650 => Some(unsafe { transmute(0x9cf6u32) }), 0x4651 => Some(unsafe { transmute(0x82ebu32) }), 0x4652 => Some(unsafe { transmute(0x5bc5u32) }), 0x4653 => Some(unsafe { transmute(0x9149u32) }), 0x4654 => Some(unsafe { transmute(0x701eu32) }), 0x4655 => Some(unsafe { transmute(0x5678u32) }), 0x4656 => Some(unsafe { transmute(0x5c6fu32) }), 0x4657 => Some(unsafe { transmute(0x60c7u32) }), 0x4658 => Some(unsafe { transmute(0x6566u32) }), 0x4659 => Some(unsafe { transmute(0x6c8cu32) }), 0x465a => Some(unsafe { transmute(0x8c5au32) }), 0x465b => Some(unsafe { transmute(0x9041u32) }), 0x465c => Some(unsafe { transmute(0x9813u32) }), 0x465d => Some(unsafe { transmute(0x5451u32) }), 0x465e => Some(unsafe { transmute(0x66c7u32) }), 0x465f => Some(unsafe { transmute(0x920du32) }), 0x4660 => Some(unsafe { transmute(0x5948u32) }), 0x4661 => Some(unsafe { transmute(0x90a3u32) }), 0x4662 => Some(unsafe { transmute(0x5185u32) }), 0x4663 => Some(unsafe { transmute(0x4e4du32) }), 0x4664 => Some(unsafe { transmute(0x51eau32) }), 0x4665 => Some(unsafe { transmute(0x8599u32) }), 0x4666 => Some(unsafe { transmute(0x8b0eu32) }), 0x4667 => Some(unsafe { transmute(0x7058u32) }), 0x4668 => Some(unsafe { transmute(0x637au32) }), 0x4669 => Some(unsafe { transmute(0x934bu32) }), 0x466a => Some(unsafe { transmute(0x6962u32) }), 0x466b => Some(unsafe { transmute(0x99b4u32) }), 0x466c => Some(unsafe { transmute(0x7e04u32) }), 0x466d => Some(unsafe { transmute(0x7577u32) }), 0x466e => Some(unsafe { transmute(0x5357u32) }), 0x466f => Some(unsafe { transmute(0x6960u32) }), 0x4670 => Some(unsafe { transmute(0x8edfu32) }), 0x4671 => Some(unsafe { transmute(0x96e3u32) }), 0x4672 => Some(unsafe { transmute(0x6c5du32) }), 0x4673 => Some(unsafe { transmute(0x4e8cu32) }), 0x4674 => Some(unsafe { transmute(0x5c3cu32) }), 0x4675 => Some(unsafe { transmute(0x5f10u32) }), 0x4676 => Some(unsafe { transmute(0x8fe9u32) }), 0x4677 => Some(unsafe { transmute(0x5302u32) }), 0x4678 => Some(unsafe { transmute(0x8cd1u32) }), 0x4679 => Some(unsafe { transmute(0x8089u32) }), 0x467a => Some(unsafe { transmute(0x8679u32) }), 0x467b => Some(unsafe { transmute(0x5effu32) }), 0x467c => Some(unsafe { transmute(0x65e5u32) }), 0x467d => Some(unsafe { transmute(0x4e73u32) }), 0x467e => Some(unsafe { transmute(0x5165u32) }), 0x4721 => Some(unsafe { transmute(0x5982u32) }), 0x4722 => Some(unsafe { transmute(0x5c3fu32) }), 0x4723 => Some(unsafe { transmute(0x97eeu32) }), 0x4724 => Some(unsafe { transmute(0x4efbu32) }), 0x4725 => Some(unsafe { transmute(0x598au32) }), 0x4726 => Some(unsafe { transmute(0x5fcdu32) }), 0x4727 => Some(unsafe { transmute(0x8a8du32) }), 0x4728 => Some(unsafe { transmute(0x6fe1u32) }), 0x4729 => Some(unsafe { transmute(0x79b0u32) }), 0x472a => Some(unsafe { transmute(0x7962u32) }), 0x472b => Some(unsafe { transmute(0x5be7u32) }), 0x472c => Some(unsafe { transmute(0x8471u32) }), 0x472d => Some(unsafe { transmute(0x732bu32) }), 0x472e => Some(unsafe { transmute(0x71b1u32) }), 0x472f => Some(unsafe { transmute(0x5e74u32) }), 0x4730 => Some(unsafe { transmute(0x5ff5u32) }), 0x4731 => Some(unsafe { transmute(0x637bu32) }), 0x4732 => Some(unsafe { transmute(0x649au32) }), 0x4733 => Some(unsafe { transmute(0x71c3u32) }), 0x4734 => Some(unsafe { transmute(0x7c98u32) }), 0x4735 => Some(unsafe { transmute(0x4e43u32) }), 0x4736 => Some(unsafe { transmute(0x5efcu32) }), 0x4737 => Some(unsafe { transmute(0x4e4bu32) }), 0x4738 => Some(unsafe { transmute(0x57dcu32) }), 0x4739 => Some(unsafe { transmute(0x56a2u32) }), 0x473a => Some(unsafe { transmute(0x60a9u32) }), 0x473b => Some(unsafe { transmute(0x6fc3u32) }), 0x473c => Some(unsafe { transmute(0x7d0du32) }), 0x473d => Some(unsafe { transmute(0x80fdu32) }), 0x473e => Some(unsafe { transmute(0x8133u32) }), 0x473f => Some(unsafe { transmute(0x81bfu32) }), 0x4740 => Some(unsafe { transmute(0x8fb2u32) }), 0x4741 => Some(unsafe { transmute(0x8997u32) }), 0x4742 => Some(unsafe { transmute(0x86a4u32) }), 0x4743 => Some(unsafe { transmute(0x5df4u32) }), 0x4744 => Some(unsafe { transmute(0x628au32) }), 0x4745 => Some(unsafe { transmute(0x64adu32) }), 0x4746 => Some(unsafe { transmute(0x8987u32) }), 0x4747 => Some(unsafe { transmute(0x6777u32) }), 0x4748 => Some(unsafe { transmute(0x6ce2u32) }), 0x4749 => Some(unsafe { transmute(0x6d3eu32) }), 0x474a => Some(unsafe { transmute(0x7436u32) }), 0x474b => Some(unsafe { transmute(0x7834u32) }), 0x474c => Some(unsafe { transmute(0x5a46u32) }), 0x474d => Some(unsafe { transmute(0x7f75u32) }), 0x474e => Some(unsafe { transmute(0x82adu32) }), 0x474f => Some(unsafe { transmute(0x99acu32) }), 0x4750 => Some(unsafe { transmute(0x4ff3u32) }), 0x4751 => Some(unsafe { transmute(0x5ec3u32) }), 0x4752 => Some(unsafe { transmute(0x62ddu32) }), 0x4753 => Some(unsafe { transmute(0x6392u32) }), 0x4754 => Some(unsafe { transmute(0x6557u32) }), 0x4755 => Some(unsafe { transmute(0x676fu32) }), 0x4756 => Some(unsafe { transmute(0x76c3u32) }), 0x4757 => Some(unsafe { transmute(0x724cu32) }), 0x4758 => Some(unsafe { transmute(0x80ccu32) }), 0x4759 => Some(unsafe { transmute(0x80bau32) }), 0x475a => Some(unsafe { transmute(0x8f29u32) }), 0x475b => Some(unsafe { transmute(0x914du32) }), 0x475c => Some(unsafe { transmute(0x500du32) }), 0x475d => Some(unsafe { transmute(0x57f9u32) }), 0x475e => Some(unsafe { transmute(0x5a92u32) }), 0x475f => Some(unsafe { transmute(0x6885u32) }), 0x4760 => Some(unsafe { transmute(0x6973u32) }), 0x4761 => Some(unsafe { transmute(0x7164u32) }), 0x4762 => Some(unsafe { transmute(0x72fdu32) }), 0x4763 => Some(unsafe { transmute(0x8cb7u32) }), 0x4764 => Some(unsafe { transmute(0x58f2u32) }), 0x4765 => Some(unsafe { transmute(0x8ce0u32) }), 0x4766 => Some(unsafe { transmute(0x966au32) }), 0x4767 => Some(unsafe { transmute(0x9019u32) }), 0x4768 => Some(unsafe { transmute(0x877fu32) }), 0x4769 => Some(unsafe { transmute(0x79e4u32) }), 0x476a => Some(unsafe { transmute(0x77e7u32) }), 0x476b => Some(unsafe { transmute(0x8429u32) }), 0x476c => Some(unsafe { transmute(0x4f2fu32) }), 0x476d => Some(unsafe { transmute(0x5265u32) }), 0x476e => Some(unsafe { transmute(0x535au32) }), 0x476f => Some(unsafe { transmute(0x62cdu32) }), 0x4770 => Some(unsafe { transmute(0x67cfu32) }), 0x4771 => Some(unsafe { transmute(0x6ccau32) }), 0x4772 => Some(unsafe { transmute(0x767du32) }), 0x4773 => Some(unsafe { transmute(0x7b94u32) }), 0x4774 => Some(unsafe { transmute(0x7c95u32) }), 0x4775 => Some(unsafe { transmute(0x8236u32) }), 0x4776 => Some(unsafe { transmute(0x8584u32) }), 0x4777 => Some(unsafe { transmute(0x8febu32) }), 0x4778 => Some(unsafe { transmute(0x66ddu32) }), 0x4779 => Some(unsafe { transmute(0x6f20u32) }), 0x477a => Some(unsafe { transmute(0x7206u32) }), 0x477b => Some(unsafe { transmute(0x7e1bu32) }), 0x477c => Some(unsafe { transmute(0x83abu32) }), 0x477d => Some(unsafe { transmute(0x99c1u32) }), 0x477e => Some(unsafe { transmute(0x9ea6u32) }), 0x4821 => Some(unsafe { transmute(0x51fdu32) }), 0x4822 => Some(unsafe { transmute(0x7bb1u32) }), 0x4823 => Some(unsafe { transmute(0x7872u32) }), 0x4824 => Some(unsafe { transmute(0x7bb8u32) }), 0x4825 => Some(unsafe { transmute(0x8087u32) }), 0x4826 => Some(unsafe { transmute(0x7b48u32) }), 0x4827 => Some(unsafe { transmute(0x6ae8u32) }), 0x4828 => Some(unsafe { transmute(0x5e61u32) }), 0x4829 => Some(unsafe { transmute(0x808cu32) }), 0x482a => Some(unsafe { transmute(0x7551u32) }), 0x482b => Some(unsafe { transmute(0x7560u32) }), 0x482c => Some(unsafe { transmute(0x516bu32) }), 0x482d => Some(unsafe { transmute(0x9262u32) }), 0x482e => Some(unsafe { transmute(0x6e8cu32) }), 0x482f => Some(unsafe { transmute(0x767au32) }), 0x4830 => Some(unsafe { transmute(0x9197u32) }), 0x4831 => Some(unsafe { transmute(0x9aeau32) }), 0x4832 => Some(unsafe { transmute(0x4f10u32) }), 0x4833 => Some(unsafe { transmute(0x7f70u32) }), 0x4834 => Some(unsafe { transmute(0x629cu32) }), 0x4835 => Some(unsafe { transmute(0x7b4fu32) }), 0x4836 => Some(unsafe { transmute(0x95a5u32) }), 0x4837 => Some(unsafe { transmute(0x9ce9u32) }), 0x4838 => Some(unsafe { transmute(0x567au32) }), 0x4839 => Some(unsafe { transmute(0x5859u32) }), 0x483a => Some(unsafe { transmute(0x86e4u32) }), 0x483b => Some(unsafe { transmute(0x96bcu32) }), 0x483c => Some(unsafe { transmute(0x4f34u32) }), 0x483d => Some(unsafe { transmute(0x5224u32) }), 0x483e => Some(unsafe { transmute(0x534au32) }), 0x483f => Some(unsafe { transmute(0x53cdu32) }), 0x4840 => Some(unsafe { transmute(0x53dbu32) }), 0x4841 => Some(unsafe { transmute(0x5e06u32) }), 0x4842 => Some(unsafe { transmute(0x642cu32) }), 0x4843 => Some(unsafe { transmute(0x6591u32) }), 0x4844 => Some(unsafe { transmute(0x677fu32) }), 0x4845 => Some(unsafe { transmute(0x6c3eu32) }), 0x4846 => Some(unsafe { transmute(0x6c4eu32) }), 0x4847 => Some(unsafe { transmute(0x7248u32) }), 0x4848 => Some(unsafe { transmute(0x72afu32) }), 0x4849 => Some(unsafe { transmute(0x73edu32) }), 0x484a => Some(unsafe { transmute(0x7554u32) }), 0x484b => Some(unsafe { transmute(0x7e41u32) }), 0x484c => Some(unsafe { transmute(0x822cu32) }), 0x484d => Some(unsafe { transmute(0x85e9u32) }), 0x484e => Some(unsafe { transmute(0x8ca9u32) }), 0x484f => Some(unsafe { transmute(0x7bc4u32) }), 0x4850 => Some(unsafe { transmute(0x91c6u32) }), 0x4851 => Some(unsafe { transmute(0x7169u32) }), 0x4852 => Some(unsafe { transmute(0x9812u32) }), 0x4853 => Some(unsafe { transmute(0x98efu32) }), 0x4854 => Some(unsafe { transmute(0x633du32) }), 0x4855 => Some(unsafe { transmute(0x6669u32) }), 0x4856 => Some(unsafe { transmute(0x756au32) }), 0x4857 => Some(unsafe { transmute(0x76e4u32) }), 0x4858 => Some(unsafe { transmute(0x78d0u32) }), 0x4859 => Some(unsafe { transmute(0x8543u32) }), 0x485a => Some(unsafe { transmute(0x86eeu32) }), 0x485b => Some(unsafe { transmute(0x532au32) }), 0x485c => Some(unsafe { transmute(0x5351u32) }), 0x485d => Some(unsafe { transmute(0x5426u32) }), 0x485e => Some(unsafe { transmute(0x5983u32) }), 0x485f => Some(unsafe { transmute(0x5e87u32) }), 0x4860 => Some(unsafe { transmute(0x5f7cu32) }), 0x4861 => Some(unsafe { transmute(0x60b2u32) }), 0x4862 => Some(unsafe { transmute(0x6249u32) }), 0x4863 => Some(unsafe { transmute(0x6279u32) }), 0x4864 => Some(unsafe { transmute(0x62abu32) }), 0x4865 => Some(unsafe { transmute(0x6590u32) }), 0x4866 => Some(unsafe { transmute(0x6bd4u32) }), 0x4867 => Some(unsafe { transmute(0x6cccu32) }), 0x4868 => Some(unsafe { transmute(0x75b2u32) }), 0x4869 => Some(unsafe { transmute(0x76aeu32) }), 0x486a => Some(unsafe { transmute(0x7891u32) }), 0x486b => Some(unsafe { transmute(0x79d8u32) }), 0x486c => Some(unsafe { transmute(0x7dcbu32) }), 0x486d => Some(unsafe { transmute(0x7f77u32) }), 0x486e => Some(unsafe { transmute(0x80a5u32) }), 0x486f => Some(unsafe { transmute(0x88abu32) }), 0x4870 => Some(unsafe { transmute(0x8ab9u32) }), 0x4871 => Some(unsafe { transmute(0x8cbbu32) }), 0x4872 => Some(unsafe { transmute(0x907fu32) }), 0x4873 => Some(unsafe { transmute(0x975eu32) }), 0x4874 => Some(unsafe { transmute(0x98dbu32) }), 0x4875 => Some(unsafe { transmute(0x6a0bu32) }), 0x4876 => Some(unsafe { transmute(0x7c38u32) }), 0x4877 => Some(unsafe { transmute(0x5099u32) }), 0x4878 => Some(unsafe { transmute(0x5c3eu32) }), 0x4879 => Some(unsafe { transmute(0x5faeu32) }), 0x487a => Some(unsafe { transmute(0x6787u32) }), 0x487b => Some(unsafe { transmute(0x6bd8u32) }), 0x487c => Some(unsafe { transmute(0x7435u32) }), 0x487d => Some(unsafe { transmute(0x7709u32) }), 0x487e => Some(unsafe { transmute(0x7f8eu32) }), 0x4921 => Some(unsafe { transmute(0x9f3bu32) }), 0x4922 => Some(unsafe { transmute(0x67cau32) }), 0x4923 => Some(unsafe { transmute(0x7a17u32) }), 0x4924 => Some(unsafe { transmute(0x5339u32) }), 0x4925 => Some(unsafe { transmute(0x758bu32) }), 0x4926 => Some(unsafe { transmute(0x9aedu32) }), 0x4927 => Some(unsafe { transmute(0x5f66u32) }), 0x4928 => Some(unsafe { transmute(0x819du32) }), 0x4929 => Some(unsafe { transmute(0x83f1u32) }), 0x492a => Some(unsafe { transmute(0x8098u32) }), 0x492b => Some(unsafe { transmute(0x5f3cu32) }), 0x492c => Some(unsafe { transmute(0x5fc5u32) }), 0x492d => Some(unsafe { transmute(0x7562u32) }), 0x492e => Some(unsafe { transmute(0x7b46u32) }), 0x492f => Some(unsafe { transmute(0x903cu32) }), 0x4930 => Some(unsafe { transmute(0x6867u32) }), 0x4931 => Some(unsafe { transmute(0x59ebu32) }), 0x4932 => Some(unsafe { transmute(0x5a9bu32) }), 0x4933 => Some(unsafe { transmute(0x7d10u32) }), 0x4934 => Some(unsafe { transmute(0x767eu32) }), 0x4935 => Some(unsafe { transmute(0x8b2cu32) }), 0x4936 => Some(unsafe { transmute(0x4ff5u32) }), 0x4937 => Some(unsafe { transmute(0x5f6au32) }), 0x4938 => Some(unsafe { transmute(0x6a19u32) }), 0x4939 => Some(unsafe { transmute(0x6c37u32) }), 0x493a => Some(unsafe { transmute(0x6f02u32) }), 0x493b => Some(unsafe { transmute(0x74e2u32) }), 0x493c => Some(unsafe { transmute(0x7968u32) }), 0x493d => Some(unsafe { transmute(0x8868u32) }), 0x493e => Some(unsafe { transmute(0x8a55u32) }), 0x493f => Some(unsafe { transmute(0x8c79u32) }), 0x4940 => Some(unsafe { transmute(0x5edfu32) }), 0x4941 => Some(unsafe { transmute(0x63cfu32) }), 0x4942 => Some(unsafe { transmute(0x75c5u32) }), 0x4943 => Some(unsafe { transmute(0x79d2u32) }), 0x4944 => Some(unsafe { transmute(0x82d7u32) }), 0x4945 => Some(unsafe { transmute(0x9328u32) }), 0x4946 => Some(unsafe { transmute(0x92f2u32) }), 0x4947 => Some(unsafe { transmute(0x849cu32) }), 0x4948 => Some(unsafe { transmute(0x86edu32) }), 0x4949 => Some(unsafe { transmute(0x9c2du32) }), 0x494a => Some(unsafe { transmute(0x54c1u32) }), 0x494b => Some(unsafe { transmute(0x5f6cu32) }), 0x494c => Some(unsafe { transmute(0x658cu32) }), 0x494d => Some(unsafe { transmute(0x6d5cu32) }), 0x494e => Some(unsafe { transmute(0x7015u32) }), 0x494f => Some(unsafe { transmute(0x8ca7u32) }), 0x4950 => Some(unsafe { transmute(0x8cd3u32) }), 0x4951 => Some(unsafe { transmute(0x983bu32) }), 0x4952 => Some(unsafe { transmute(0x654fu32) }), 0x4953 => Some(unsafe { transmute(0x74f6u32) }), 0x4954 => Some(unsafe { transmute(0x4e0du32) }), 0x4955 => Some(unsafe { transmute(0x4ed8u32) }), 0x4956 => Some(unsafe { transmute(0x57e0u32) }), 0x4957 => Some(unsafe { transmute(0x592bu32) }), 0x4958 => Some(unsafe { transmute(0x5a66u32) }), 0x4959 => Some(unsafe { transmute(0x5bccu32) }), 0x495a => Some(unsafe { transmute(0x51a8u32) }), 0x495b => Some(unsafe { transmute(0x5e03u32) }), 0x495c => Some(unsafe { transmute(0x5e9cu32) }), 0x495d => Some(unsafe { transmute(0x6016u32) }), 0x495e => Some(unsafe { transmute(0x6276u32) }), 0x495f => Some(unsafe { transmute(0x6577u32) }), 0x4960 => Some(unsafe { transmute(0x65a7u32) }), 0x4961 => Some(unsafe { transmute(0x666eu32) }), 0x4962 => Some(unsafe { transmute(0x6d6eu32) }), 0x4963 => Some(unsafe { transmute(0x7236u32) }), 0x4964 => Some(unsafe { transmute(0x7b26u32) }), 0x4965 => Some(unsafe { transmute(0x8150u32) }), 0x4966 => Some(unsafe { transmute(0x819au32) }), 0x4967 => Some(unsafe { transmute(0x8299u32) }), 0x4968 => Some(unsafe { transmute(0x8b5cu32) }), 0x4969 => Some(unsafe { transmute(0x8ca0u32) }), 0x496a => Some(unsafe { transmute(0x8ce6u32) }), 0x496b => Some(unsafe { transmute(0x8d74u32) }), 0x496c => Some(unsafe { transmute(0x961cu32) }), 0x496d => Some(unsafe { transmute(0x9644u32) }), 0x496e => Some(unsafe { transmute(0x4faeu32) }), 0x496f => Some(unsafe { transmute(0x64abu32) }), 0x4970 => Some(unsafe { transmute(0x6b66u32) }), 0x4971 => Some(unsafe { transmute(0x821eu32) }), 0x4972 => Some(unsafe { transmute(0x8461u32) }), 0x4973 => Some(unsafe { transmute(0x856au32) }), 0x4974 => Some(unsafe { transmute(0x90e8u32) }), 0x4975 => Some(unsafe { transmute(0x5c01u32) }), 0x4976 => Some(unsafe { transmute(0x6953u32) }), 0x4977 => Some(unsafe { transmute(0x98a8u32) }), 0x4978 => Some(unsafe { transmute(0x847au32) }), 0x4979 => Some(unsafe { transmute(0x8557u32) }), 0x497a => Some(unsafe { transmute(0x4f0fu32) }), 0x497b => Some(unsafe { transmute(0x526fu32) }), 0x497c => Some(unsafe { transmute(0x5fa9u32) }), 0x497d => Some(unsafe { transmute(0x5e45u32) }), 0x497e => Some(unsafe { transmute(0x670du32) }), 0x4a21 => Some(unsafe { transmute(0x798fu32) }), 0x4a22 => Some(unsafe { transmute(0x8179u32) }), 0x4a23 => Some(unsafe { transmute(0x8907u32) }), 0x4a24 => Some(unsafe { transmute(0x8986u32) }), 0x4a25 => Some(unsafe { transmute(0x6df5u32) }), 0x4a26 => Some(unsafe { transmute(0x5f17u32) }), 0x4a27 => Some(unsafe { transmute(0x6255u32) }), 0x4a28 => Some(unsafe { transmute(0x6cb8u32) }), 0x4a29 => Some(unsafe { transmute(0x4ecfu32) }), 0x4a2a => Some(unsafe { transmute(0x7269u32) }), 0x4a2b => Some(unsafe { transmute(0x9b92u32) }), 0x4a2c => Some(unsafe { transmute(0x5206u32) }), 0x4a2d => Some(unsafe { transmute(0x543bu32) }), 0x4a2e => Some(unsafe { transmute(0x5674u32) }), 0x4a2f => Some(unsafe { transmute(0x58b3u32) }), 0x4a30 => Some(unsafe { transmute(0x61a4u32) }), 0x4a31 => Some(unsafe { transmute(0x626eu32) }), 0x4a32 => Some(unsafe { transmute(0x711au32) }), 0x4a33 => Some(unsafe { transmute(0x596eu32) }), 0x4a34 => Some(unsafe { transmute(0x7c89u32) }), 0x4a35 => Some(unsafe { transmute(0x7cdeu32) }), 0x4a36 => Some(unsafe { transmute(0x7d1bu32) }), 0x4a37 => Some(unsafe { transmute(0x96f0u32) }), 0x4a38 => Some(unsafe { transmute(0x6587u32) }), 0x4a39 => Some(unsafe { transmute(0x805eu32) }), 0x4a3a => Some(unsafe { transmute(0x4e19u32) }), 0x4a3b => Some(unsafe { transmute(0x4f75u32) }), 0x4a3c => Some(unsafe { transmute(0x5175u32) }), 0x4a3d => Some(unsafe { transmute(0x5840u32) }), 0x4a3e => Some(unsafe { transmute(0x5e63u32) }), 0x4a3f => Some(unsafe { transmute(0x5e73u32) }), 0x4a40 => Some(unsafe { transmute(0x5f0au32) }), 0x4a41 => Some(unsafe { transmute(0x67c4u32) }), 0x4a42 => Some(unsafe { transmute(0x4e26u32) }), 0x4a43 => Some(unsafe { transmute(0x853du32) }), 0x4a44 => Some(unsafe { transmute(0x9589u32) }), 0x4a45 => Some(unsafe { transmute(0x965bu32) }), 0x4a46 => Some(unsafe { transmute(0x7c73u32) }), 0x4a47 => Some(unsafe { transmute(0x9801u32) }), 0x4a48 => Some(unsafe { transmute(0x50fbu32) }), 0x4a49 => Some(unsafe { transmute(0x58c1u32) }), 0x4a4a => Some(unsafe { transmute(0x7656u32) }), 0x4a4b => Some(unsafe { transmute(0x78a7u32) }), 0x4a4c => Some(unsafe { transmute(0x5225u32) }), 0x4a4d => Some(unsafe { transmute(0x77a5u32) }), 0x4a4e => Some(unsafe { transmute(0x8511u32) }), 0x4a4f => Some(unsafe { transmute(0x7b86u32) }), 0x4a50 => Some(unsafe { transmute(0x504fu32) }), 0x4a51 => Some(unsafe { transmute(0x5909u32) }), 0x4a52 => Some(unsafe { transmute(0x7247u32) }), 0x4a53 => Some(unsafe { transmute(0x7bc7u32) }), 0x4a54 => Some(unsafe { transmute(0x7de8u32) }), 0x4a55 => Some(unsafe { transmute(0x8fbau32) }), 0x4a56 => Some(unsafe { transmute(0x8fd4u32) }), 0x4a57 => Some(unsafe { transmute(0x904du32) }), 0x4a58 => Some(unsafe { transmute(0x4fbfu32) }), 0x4a59 => Some(unsafe { transmute(0x52c9u32) }), 0x4a5a => Some(unsafe { transmute(0x5a29u32) }), 0x4a5b => Some(unsafe { transmute(0x5f01u32) }), 0x4a5c => Some(unsafe { transmute(0x97adu32) }), 0x4a5d => Some(unsafe { transmute(0x4fddu32) }), 0x4a5e => Some(unsafe { transmute(0x8217u32) }), 0x4a5f => Some(unsafe { transmute(0x92eau32) }), 0x4a60 => Some(unsafe { transmute(0x5703u32) }), 0x4a61 => Some(unsafe { transmute(0x6355u32) }), 0x4a62 => Some(unsafe { transmute(0x6b69u32) }), 0x4a63 => Some(unsafe { transmute(0x752bu32) }), 0x4a64 => Some(unsafe { transmute(0x88dcu32) }), 0x4a65 => Some(unsafe { transmute(0x8f14u32) }), 0x4a66 => Some(unsafe { transmute(0x7a42u32) }), 0x4a67 => Some(unsafe { transmute(0x52dfu32) }), 0x4a68 => Some(unsafe { transmute(0x5893u32) }), 0x4a69 => Some(unsafe { transmute(0x6155u32) }), 0x4a6a => Some(unsafe { transmute(0x620au32) }), 0x4a6b => Some(unsafe { transmute(0x66aeu32) }), 0x4a6c => Some(unsafe { transmute(0x6bcdu32) }), 0x4a6d => Some(unsafe { transmute(0x7c3fu32) }), 0x4a6e => Some(unsafe { transmute(0x83e9u32) }), 0x4a6f => Some(unsafe { transmute(0x5023u32) }), 0x4a70 => Some(unsafe { transmute(0x4ff8u32) }), 0x4a71 => Some(unsafe { transmute(0x5305u32) }), 0x4a72 => Some(unsafe { transmute(0x5446u32) }), 0x4a73 => Some(unsafe { transmute(0x5831u32) }), 0x4a74 => Some(unsafe { transmute(0x5949u32) }), 0x4a75 => Some(unsafe { transmute(0x5b9du32) }), 0x4a76 => Some(unsafe { transmute(0x5cf0u32) }), 0x4a77 => Some(unsafe { transmute(0x5cefu32) }), 0x4a78 => Some(unsafe { transmute(0x5d29u32) }), 0x4a79 => Some(unsafe { transmute(0x5e96u32) }), 0x4a7a => Some(unsafe { transmute(0x62b1u32) }), 0x4a7b => Some(unsafe { transmute(0x6367u32) }), 0x4a7c => Some(unsafe { transmute(0x653eu32) }), 0x4a7d => Some(unsafe { transmute(0x65b9u32) }), 0x4a7e => Some(unsafe { transmute(0x670bu32) }), 0x4b21 => Some(unsafe { transmute(0x6cd5u32) }), 0x4b22 => Some(unsafe { transmute(0x6ce1u32) }), 0x4b23 => Some(unsafe { transmute(0x70f9u32) }), 0x4b24 => Some(unsafe { transmute(0x7832u32) }), 0x4b25 => Some(unsafe { transmute(0x7e2bu32) }), 0x4b26 => Some(unsafe { transmute(0x80deu32) }), 0x4b27 => Some(unsafe { transmute(0x82b3u32) }), 0x4b28 => Some(unsafe { transmute(0x840cu32) }), 0x4b29 => Some(unsafe { transmute(0x84ecu32) }), 0x4b2a => Some(unsafe { transmute(0x8702u32) }), 0x4b2b => Some(unsafe { transmute(0x8912u32) }), 0x4b2c => Some(unsafe { transmute(0x8a2au32) }), 0x4b2d => Some(unsafe { transmute(0x8c4au32) }), 0x4b2e => Some(unsafe { transmute(0x90a6u32) }), 0x4b2f => Some(unsafe { transmute(0x92d2u32) }), 0x4b30 => Some(unsafe { transmute(0x98fdu32) }), 0x4b31 => Some(unsafe { transmute(0x9cf3u32) }), 0x4b32 => Some(unsafe { transmute(0x9d6cu32) }), 0x4b33 => Some(unsafe { transmute(0x4e4fu32) }), 0x4b34 => Some(unsafe { transmute(0x4ea1u32) }), 0x4b35 => Some(unsafe { transmute(0x508du32) }), 0x4b36 => Some(unsafe { transmute(0x5256u32) }), 0x4b37 => Some(unsafe { transmute(0x574au32) }), 0x4b38 => Some(unsafe { transmute(0x59a8u32) }), 0x4b39 => Some(unsafe { transmute(0x5e3du32) }), 0x4b3a => Some(unsafe { transmute(0x5fd8u32) }), 0x4b3b => Some(unsafe { transmute(0x5fd9u32) }), 0x4b3c => Some(unsafe { transmute(0x623fu32) }), 0x4b3d => Some(unsafe { transmute(0x66b4u32) }), 0x4b3e => Some(unsafe { transmute(0x671bu32) }), 0x4b3f => Some(unsafe { transmute(0x67d0u32) }), 0x4b40 => Some(unsafe { transmute(0x68d2u32) }), 0x4b41 => Some(unsafe { transmute(0x5192u32) }), 0x4b42 => Some(unsafe { transmute(0x7d21u32) }), 0x4b43 => Some(unsafe { transmute(0x80aau32) }), 0x4b44 => Some(unsafe { transmute(0x81a8u32) }), 0x4b45 => Some(unsafe { transmute(0x8b00u32) }), 0x4b46 => Some(unsafe { transmute(0x8c8cu32) }), 0x4b47 => Some(unsafe { transmute(0x8cbfu32) }), 0x4b48 => Some(unsafe { transmute(0x927eu32) }), 0x4b49 => Some(unsafe { transmute(0x9632u32) }), 0x4b4a => Some(unsafe { transmute(0x5420u32) }), 0x4b4b => Some(unsafe { transmute(0x982cu32) }), 0x4b4c => Some(unsafe { transmute(0x5317u32) }), 0x4b4d => Some(unsafe { transmute(0x50d5u32) }), 0x4b4e => Some(unsafe { transmute(0x535cu32) }), 0x4b4f => Some(unsafe { transmute(0x58a8u32) }), 0x4b50 => Some(unsafe { transmute(0x64b2u32) }), 0x4b51 => Some(unsafe { transmute(0x6734u32) }), 0x4b52 => Some(unsafe { transmute(0x7267u32) }), 0x4b53 => Some(unsafe { transmute(0x7766u32) }), 0x4b54 => Some(unsafe { transmute(0x7a46u32) }), 0x4b55 => Some(unsafe { transmute(0x91e6u32) }), 0x4b56 => Some(unsafe { transmute(0x52c3u32) }), 0x4b57 => Some(unsafe { transmute(0x6ca1u32) }), 0x4b58 => Some(unsafe { transmute(0x6b86u32) }), 0x4b59 => Some(unsafe { transmute(0x5800u32) }), 0x4b5a => Some(unsafe { transmute(0x5e4cu32) }), 0x4b5b => Some(unsafe { transmute(0x5954u32) }), 0x4b5c => Some(unsafe { transmute(0x672cu32) }), 0x4b5d => Some(unsafe { transmute(0x7ffbu32) }), 0x4b5e => Some(unsafe { transmute(0x51e1u32) }), 0x4b5f => Some(unsafe { transmute(0x76c6u32) }), 0x4b60 => Some(unsafe { transmute(0x6469u32) }), 0x4b61 => Some(unsafe { transmute(0x78e8u32) }), 0x4b62 => Some(unsafe { transmute(0x9b54u32) }), 0x4b63 => Some(unsafe { transmute(0x9ebbu32) }), 0x4b64 => Some(unsafe { transmute(0x57cbu32) }), 0x4b65 => Some(unsafe { transmute(0x59b9u32) }), 0x4b66 => Some(unsafe { transmute(0x6627u32) }), 0x4b67 => Some(unsafe { transmute(0x679au32) }), 0x4b68 => Some(unsafe { transmute(0x6bceu32) }), 0x4b69 => Some(unsafe { transmute(0x54e9u32) }), 0x4b6a => Some(unsafe { transmute(0x69d9u32) }), 0x4b6b => Some(unsafe { transmute(0x5e55u32) }), 0x4b6c => Some(unsafe { transmute(0x819cu32) }), 0x4b6d => Some(unsafe { transmute(0x6795u32) }), 0x4b6e => Some(unsafe { transmute(0x9baau32) }), 0x4b6f => Some(unsafe { transmute(0x67feu32) }), 0x4b70 => Some(unsafe { transmute(0x9c52u32) }), 0x4b71 => Some(unsafe { transmute(0x685du32) }), 0x4b72 => Some(unsafe { transmute(0x4ea6u32) }), 0x4b73 => Some(unsafe { transmute(0x4fe3u32) }), 0x4b74 => Some(unsafe { transmute(0x53c8u32) }), 0x4b75 => Some(unsafe { transmute(0x62b9u32) }), 0x4b76 => Some(unsafe { transmute(0x672bu32) }), 0x4b77 => Some(unsafe { transmute(0x6cabu32) }), 0x4b78 => Some(unsafe { transmute(0x8fc4u32) }), 0x4b79 => Some(unsafe { transmute(0x4fadu32) }), 0x4b7a => Some(unsafe { transmute(0x7e6du32) }), 0x4b7b => Some(unsafe { transmute(0x9ebfu32) }), 0x4b7c => Some(unsafe { transmute(0x4e07u32) }), 0x4b7d => Some(unsafe { transmute(0x6162u32) }), 0x4b7e => Some(unsafe { transmute(0x6e80u32) }), 0x4c21 => Some(unsafe { transmute(0x6f2bu32) }), 0x4c22 => Some(unsafe { transmute(0x8513u32) }), 0x4c23 => Some(unsafe { transmute(0x5473u32) }), 0x4c24 => Some(unsafe { transmute(0x672au32) }), 0x4c25 => Some(unsafe { transmute(0x9b45u32) }), 0x4c26 => Some(unsafe { transmute(0x5df3u32) }), 0x4c27 => Some(unsafe { transmute(0x7b95u32) }), 0x4c28 => Some(unsafe { transmute(0x5cacu32) }), 0x4c29 => Some(unsafe { transmute(0x5bc6u32) }), 0x4c2a => Some(unsafe { transmute(0x871cu32) }), 0x4c2b => Some(unsafe { transmute(0x6e4au32) }), 0x4c2c => Some(unsafe { transmute(0x84d1u32) }), 0x4c2d => Some(unsafe { transmute(0x7a14u32) }), 0x4c2e => Some(unsafe { transmute(0x8108u32) }), 0x4c2f => Some(unsafe { transmute(0x5999u32) }), 0x4c30 => Some(unsafe { transmute(0x7c8du32) }), 0x4c31 => Some(unsafe { transmute(0x6c11u32) }), 0x4c32 => Some(unsafe { transmute(0x7720u32) }), 0x4c33 => Some(unsafe { transmute(0x52d9u32) }), 0x4c34 => Some(unsafe { transmute(0x5922u32) }), 0x4c35 => Some(unsafe { transmute(0x7121u32) }), 0x4c36 => Some(unsafe { transmute(0x725fu32) }), 0x4c37 => Some(unsafe { transmute(0x77dbu32) }), 0x4c38 => Some(unsafe { transmute(0x9727u32) }), 0x4c39 => Some(unsafe { transmute(0x9d61u32) }), 0x4c3a => Some(unsafe { transmute(0x690bu32) }), 0x4c3b => Some(unsafe { transmute(0x5a7fu32) }), 0x4c3c => Some(unsafe { transmute(0x5a18u32) }), 0x4c3d => Some(unsafe { transmute(0x51a5u32) }), 0x4c3e => Some(unsafe { transmute(0x540du32) }), 0x4c3f => Some(unsafe { transmute(0x547du32) }), 0x4c40 => Some(unsafe { transmute(0x660eu32) }), 0x4c41 => Some(unsafe { transmute(0x76dfu32) }), 0x4c42 => Some(unsafe { transmute(0x8ff7u32) }), 0x4c43 => Some(unsafe { transmute(0x9298u32) }), 0x4c44 => Some(unsafe { transmute(0x9cf4u32) }), 0x4c45 => Some(unsafe { transmute(0x59eau32) }), 0x4c46 => Some(unsafe { transmute(0x725du32) }), 0x4c47 => Some(unsafe { transmute(0x6ec5u32) }), 0x4c48 => Some(unsafe { transmute(0x514du32) }), 0x4c49 => Some(unsafe { transmute(0x68c9u32) }), 0x4c4a => Some(unsafe { transmute(0x7dbfu32) }), 0x4c4b => Some(unsafe { transmute(0x7decu32) }), 0x4c4c => Some(unsafe { transmute(0x9762u32) }), 0x4c4d => Some(unsafe { transmute(0x9ebau32) }), 0x4c4e => Some(unsafe { transmute(0x6478u32) }), 0x4c4f => Some(unsafe { transmute(0x6a21u32) }), 0x4c50 => Some(unsafe { transmute(0x8302u32) }), 0x4c51 => Some(unsafe { transmute(0x5984u32) }), 0x4c52 => Some(unsafe { transmute(0x5b5fu32) }), 0x4c53 => Some(unsafe { transmute(0x6bdbu32) }), 0x4c54 => Some(unsafe { transmute(0x731bu32) }), 0x4c55 => Some(unsafe { transmute(0x76f2u32) }), 0x4c56 => Some(unsafe { transmute(0x7db2u32) }), 0x4c57 => Some(unsafe { transmute(0x8017u32) }), 0x4c58 => Some(unsafe { transmute(0x8499u32) }), 0x4c59 => Some(unsafe { transmute(0x5132u32) }), 0x4c5a => Some(unsafe { transmute(0x6728u32) }), 0x4c5b => Some(unsafe { transmute(0x9ed9u32) }), 0x4c5c => Some(unsafe { transmute(0x76eeu32) }), 0x4c5d => Some(unsafe { transmute(0x6762u32) }), 0x4c5e => Some(unsafe { transmute(0x52ffu32) }), 0x4c5f => Some(unsafe { transmute(0x9905u32) }), 0x4c60 => Some(unsafe { transmute(0x5c24u32) }), 0x4c61 => Some(unsafe { transmute(0x623bu32) }), 0x4c62 => Some(unsafe { transmute(0x7c7eu32) }), 0x4c63 => Some(unsafe { transmute(0x8cb0u32) }), 0x4c64 => Some(unsafe { transmute(0x554fu32) }), 0x4c65 => Some(unsafe { transmute(0x60b6u32) }), 0x4c66 => Some(unsafe { transmute(0x7d0bu32) }), 0x4c67 => Some(unsafe { transmute(0x9580u32) }), 0x4c68 => Some(unsafe { transmute(0x5301u32) }), 0x4c69 => Some(unsafe { transmute(0x4e5fu32) }), 0x4c6a => Some(unsafe { transmute(0x51b6u32) }), 0x4c6b => Some(unsafe { transmute(0x591cu32) }), 0x4c6c => Some(unsafe { transmute(0x723au32) }), 0x4c6d => Some(unsafe { transmute(0x8036u32) }), 0x4c6e => Some(unsafe { transmute(0x91ceu32) }), 0x4c6f => Some(unsafe { transmute(0x5f25u32) }), 0x4c70 => Some(unsafe { transmute(0x77e2u32) }), 0x4c71 => Some(unsafe { transmute(0x5384u32) }), 0x4c72 => Some(unsafe { transmute(0x5f79u32) }), 0x4c73 => Some(unsafe { transmute(0x7d04u32) }), 0x4c74 => Some(unsafe { transmute(0x85acu32) }), 0x4c75 => Some(unsafe { transmute(0x8a33u32) }), 0x4c76 => Some(unsafe { transmute(0x8e8du32) }), 0x4c77 => Some(unsafe { transmute(0x9756u32) }), 0x4c78 => Some(unsafe { transmute(0x67f3u32) }), 0x4c79 => Some(unsafe { transmute(0x85aeu32) }), 0x4c7a => Some(unsafe { transmute(0x9453u32) }), 0x4c7b => Some(unsafe { transmute(0x6109u32) }), 0x4c7c => Some(unsafe { transmute(0x6108u32) }), 0x4c7d => Some(unsafe { transmute(0x6cb9u32) }), 0x4c7e => Some(unsafe { transmute(0x7652u32) }), 0x4d21 => Some(unsafe { transmute(0x8aedu32) }), 0x4d22 => Some(unsafe { transmute(0x8f38u32) }), 0x4d23 => Some(unsafe { transmute(0x552fu32) }), 0x4d24 => Some(unsafe { transmute(0x4f51u32) }), 0x4d25 => Some(unsafe { transmute(0x512au32) }), 0x4d26 => Some(unsafe { transmute(0x52c7u32) }), 0x4d27 => Some(unsafe { transmute(0x53cbu32) }), 0x4d28 => Some(unsafe { transmute(0x5ba5u32) }), 0x4d29 => Some(unsafe { transmute(0x5e7du32) }), 0x4d2a => Some(unsafe { transmute(0x60a0u32) }), 0x4d2b => Some(unsafe { transmute(0x6182u32) }), 0x4d2c => Some(unsafe { transmute(0x63d6u32) }), 0x4d2d => Some(unsafe { transmute(0x6709u32) }), 0x4d2e => Some(unsafe { transmute(0x67dau32) }), 0x4d2f => Some(unsafe { transmute(0x6e67u32) }), 0x4d30 => Some(unsafe { transmute(0x6d8cu32) }), 0x4d31 => Some(unsafe { transmute(0x7336u32) }), 0x4d32 => Some(unsafe { transmute(0x7337u32) }), 0x4d33 => Some(unsafe { transmute(0x7531u32) }), 0x4d34 => Some(unsafe { transmute(0x7950u32) }), 0x4d35 => Some(unsafe { transmute(0x88d5u32) }), 0x4d36 => Some(unsafe { transmute(0x8a98u32) }), 0x4d37 => Some(unsafe { transmute(0x904au32) }), 0x4d38 => Some(unsafe { transmute(0x9091u32) }), 0x4d39 => Some(unsafe { transmute(0x90f5u32) }), 0x4d3a => Some(unsafe { transmute(0x96c4u32) }), 0x4d3b => Some(unsafe { transmute(0x878du32) }), 0x4d3c => Some(unsafe { transmute(0x5915u32) }), 0x4d3d => Some(unsafe { transmute(0x4e88u32) }), 0x4d3e => Some(unsafe { transmute(0x4f59u32) }), 0x4d3f => Some(unsafe { transmute(0x4e0eu32) }), 0x4d40 => Some(unsafe { transmute(0x8a89u32) }), 0x4d41 => Some(unsafe { transmute(0x8f3fu32) }), 0x4d42 => Some(unsafe { transmute(0x9810u32) }), 0x4d43 => Some(unsafe { transmute(0x50adu32) }), 0x4d44 => Some(unsafe { transmute(0x5e7cu32) }), 0x4d45 => Some(unsafe { transmute(0x5996u32) }), 0x4d46 => Some(unsafe { transmute(0x5bb9u32) }), 0x4d47 => Some(unsafe { transmute(0x5eb8u32) }), 0x4d48 => Some(unsafe { transmute(0x63dau32) }), 0x4d49 => Some(unsafe { transmute(0x63fau32) }), 0x4d4a => Some(unsafe { transmute(0x64c1u32) }), 0x4d4b => Some(unsafe { transmute(0x66dcu32) }), 0x4d4c => Some(unsafe { transmute(0x694au32) }), 0x4d4d => Some(unsafe { transmute(0x69d8u32) }), 0x4d4e => Some(unsafe { transmute(0x6d0bu32) }), 0x4d4f => Some(unsafe { transmute(0x6eb6u32) }), 0x4d50 => Some(unsafe { transmute(0x7194u32) }), 0x4d51 => Some(unsafe { transmute(0x7528u32) }), 0x4d52 => Some(unsafe { transmute(0x7aafu32) }), 0x4d53 => Some(unsafe { transmute(0x7f8au32) }), 0x4d54 => Some(unsafe { transmute(0x8000u32) }), 0x4d55 => Some(unsafe { transmute(0x8449u32) }), 0x4d56 => Some(unsafe { transmute(0x84c9u32) }), 0x4d57 => Some(unsafe { transmute(0x8981u32) }), 0x4d58 => Some(unsafe { transmute(0x8b21u32) }), 0x4d59 => Some(unsafe { transmute(0x8e0au32) }), 0x4d5a => Some(unsafe { transmute(0x9065u32) }), 0x4d5b => Some(unsafe { transmute(0x967du32) }), 0x4d5c => Some(unsafe { transmute(0x990au32) }), 0x4d5d => Some(unsafe { transmute(0x617eu32) }), 0x4d5e => Some(unsafe { transmute(0x6291u32) }), 0x4d5f => Some(unsafe { transmute(0x6b32u32) }), 0x4d60 => Some(unsafe { transmute(0x6c83u32) }), 0x4d61 => Some(unsafe { transmute(0x6d74u32) }), 0x4d62 => Some(unsafe { transmute(0x7fccu32) }), 0x4d63 => Some(unsafe { transmute(0x7ffcu32) }), 0x4d64 => Some(unsafe { transmute(0x6dc0u32) }), 0x4d65 => Some(unsafe { transmute(0x7f85u32) }), 0x4d66 => Some(unsafe { transmute(0x87bau32) }), 0x4d67 => Some(unsafe { transmute(0x88f8u32) }), 0x4d68 => Some(unsafe { transmute(0x6765u32) }), 0x4d69 => Some(unsafe { transmute(0x83b1u32) }), 0x4d6a => Some(unsafe { transmute(0x983cu32) }), 0x4d6b => Some(unsafe { transmute(0x96f7u32) }), 0x4d6c => Some(unsafe { transmute(0x6d1bu32) }), 0x4d6d => Some(unsafe { transmute(0x7d61u32) }), 0x4d6e => Some(unsafe { transmute(0x843du32) }), 0x4d6f => Some(unsafe { transmute(0x916au32) }), 0x4d70 => Some(unsafe { transmute(0x4e71u32) }), 0x4d71 => Some(unsafe { transmute(0x5375u32) }), 0x4d72 => Some(unsafe { transmute(0x5d50u32) }), 0x4d73 => Some(unsafe { transmute(0x6b04u32) }), 0x4d74 => Some(unsafe { transmute(0x6febu32) }), 0x4d75 => Some(unsafe { transmute(0x85cdu32) }), 0x4d76 => Some(unsafe { transmute(0x862du32) }), 0x4d77 => Some(unsafe { transmute(0x89a7u32) }), 0x4d78 => Some(unsafe { transmute(0x5229u32) }), 0x4d79 => Some(unsafe { transmute(0x540fu32) }), 0x4d7a => Some(unsafe { transmute(0x5c65u32) }), 0x4d7b => Some(unsafe { transmute(0x674eu32) }), 0x4d7c => Some(unsafe { transmute(0x68a8u32) }), 0x4d7d => Some(unsafe { transmute(0x7406u32) }), 0x4d7e => Some(unsafe { transmute(0x7483u32) }), 0x4e21 => Some(unsafe { transmute(0x75e2u32) }), 0x4e22 => Some(unsafe { transmute(0x88cfu32) }), 0x4e23 => Some(unsafe { transmute(0x88e1u32) }), 0x4e24 => Some(unsafe { transmute(0x91ccu32) }), 0x4e25 => Some(unsafe { transmute(0x96e2u32) }), 0x4e26 => Some(unsafe { transmute(0x9678u32) }), 0x4e27 => Some(unsafe { transmute(0x5f8bu32) }), 0x4e28 => Some(unsafe { transmute(0x7387u32) }), 0x4e29 => Some(unsafe { transmute(0x7acbu32) }), 0x4e2a => Some(unsafe { transmute(0x844eu32) }), 0x4e2b => Some(unsafe { transmute(0x63a0u32) }), 0x4e2c => Some(unsafe { transmute(0x7565u32) }), 0x4e2d => Some(unsafe { transmute(0x5289u32) }), 0x4e2e => Some(unsafe { transmute(0x6d41u32) }), 0x4e2f => Some(unsafe { transmute(0x6e9cu32) }), 0x4e30 => Some(unsafe { transmute(0x7409u32) }), 0x4e31 => Some(unsafe { transmute(0x7559u32) }), 0x4e32 => Some(unsafe { transmute(0x786bu32) }), 0x4e33 => Some(unsafe { transmute(0x7c92u32) }), 0x4e34 => Some(unsafe { transmute(0x9686u32) }), 0x4e35 => Some(unsafe { transmute(0x7adcu32) }), 0x4e36 => Some(unsafe { transmute(0x9f8du32) }), 0x4e37 => Some(unsafe { transmute(0x4fb6u32) }), 0x4e38 => Some(unsafe { transmute(0x616eu32) }), 0x4e39 => Some(unsafe { transmute(0x65c5u32) }), 0x4e3a => Some(unsafe { transmute(0x865cu32) }), 0x4e3b => Some(unsafe { transmute(0x4e86u32) }), 0x4e3c => Some(unsafe { transmute(0x4eaeu32) }), 0x4e3d => Some(unsafe { transmute(0x50dau32) }), 0x4e3e => Some(unsafe { transmute(0x4e21u32) }), 0x4e3f => Some(unsafe { transmute(0x51ccu32) }), 0x4e40 => Some(unsafe { transmute(0x5beeu32) }), 0x4e41 => Some(unsafe { transmute(0x6599u32) }), 0x4e42 => Some(unsafe { transmute(0x6881u32) }), 0x4e43 => Some(unsafe { transmute(0x6dbcu32) }), 0x4e44 => Some(unsafe { transmute(0x731fu32) }), 0x4e45 => Some(unsafe { transmute(0x7642u32) }), 0x4e46 => Some(unsafe { transmute(0x77adu32) }), 0x4e47 => Some(unsafe { transmute(0x7a1cu32) }), 0x4e48 => Some(unsafe { transmute(0x7ce7u32) }), 0x4e49 => Some(unsafe { transmute(0x826fu32) }), 0x4e4a => Some(unsafe { transmute(0x8ad2u32) }), 0x4e4b => Some(unsafe { transmute(0x907cu32) }), 0x4e4c => Some(unsafe { transmute(0x91cfu32) }), 0x4e4d => Some(unsafe { transmute(0x9675u32) }), 0x4e4e => Some(unsafe { transmute(0x9818u32) }), 0x4e4f => Some(unsafe { transmute(0x529bu32) }), 0x4e50 => Some(unsafe { transmute(0x7dd1u32) }), 0x4e51 => Some(unsafe { transmute(0x502bu32) }), 0x4e52 => Some(unsafe { transmute(0x5398u32) }), 0x4e53 => Some(unsafe { transmute(0x6797u32) }), 0x4e54 => Some(unsafe { transmute(0x6dcbu32) }), 0x4e55 => Some(unsafe { transmute(0x71d0u32) }), 0x4e56 => Some(unsafe { transmute(0x7433u32) }), 0x4e57 => Some(unsafe { transmute(0x81e8u32) }), 0x4e58 => Some(unsafe { transmute(0x8f2au32) }), 0x4e59 => Some(unsafe { transmute(0x96a3u32) }), 0x4e5a => Some(unsafe { transmute(0x9c57u32) }), 0x4e5b => Some(unsafe { transmute(0x9e9fu32) }), 0x4e5c => Some(unsafe { transmute(0x7460u32) }), 0x4e5d => Some(unsafe { transmute(0x5841u32) }), 0x4e5e => Some(unsafe { transmute(0x6d99u32) }), 0x4e5f => Some(unsafe { transmute(0x7d2fu32) }), 0x4e60 => Some(unsafe { transmute(0x985eu32) }), 0x4e61 => Some(unsafe { transmute(0x4ee4u32) }), 0x4e62 => Some(unsafe { transmute(0x4f36u32) }), 0x4e63 => Some(unsafe { transmute(0x4f8bu32) }), 0x4e64 => Some(unsafe { transmute(0x51b7u32) }), 0x4e65 => Some(unsafe { transmute(0x52b1u32) }), 0x4e66 => Some(unsafe { transmute(0x5dbau32) }), 0x4e67 => Some(unsafe { transmute(0x601cu32) }), 0x4e68 => Some(unsafe { transmute(0x73b2u32) }), 0x4e69 => Some(unsafe { transmute(0x793cu32) }), 0x4e6a => Some(unsafe { transmute(0x82d3u32) }), 0x4e6b => Some(unsafe { transmute(0x9234u32) }), 0x4e6c => Some(unsafe { transmute(0x96b7u32) }), 0x4e6d => Some(unsafe { transmute(0x96f6u32) }), 0x4e6e => Some(unsafe { transmute(0x970au32) }), 0x4e6f => Some(unsafe { transmute(0x9e97u32) }), 0x4e70 => Some(unsafe { transmute(0x9f62u32) }), 0x4e71 => Some(unsafe { transmute(0x66a6u32) }), 0x4e72 => Some(unsafe { transmute(0x6b74u32) }), 0x4e73 => Some(unsafe { transmute(0x5217u32) }), 0x4e74 => Some(unsafe { transmute(0x52a3u32) }), 0x4e75 => Some(unsafe { transmute(0x70c8u32) }), 0x4e76 => Some(unsafe { transmute(0x88c2u32) }), 0x4e77 => Some(unsafe { transmute(0x5ec9u32) }), 0x4e78 => Some(unsafe { transmute(0x604bu32) }), 0x4e79 => Some(unsafe { transmute(0x6190u32) }), 0x4e7a => Some(unsafe { transmute(0x6f23u32) }), 0x4e7b => Some(unsafe { transmute(0x7149u32) }), 0x4e7c => Some(unsafe { transmute(0x7c3eu32) }), 0x4e7d => Some(unsafe { transmute(0x7df4u32) }), 0x4e7e => Some(unsafe { transmute(0x806fu32) }), 0x4f21 => Some(unsafe { transmute(0x84eeu32) }), 0x4f22 => Some(unsafe { transmute(0x9023u32) }), 0x4f23 => Some(unsafe { transmute(0x932cu32) }), 0x4f24 => Some(unsafe { transmute(0x5442u32) }), 0x4f25 => Some(unsafe { transmute(0x9b6fu32) }), 0x4f26 => Some(unsafe { transmute(0x6ad3u32) }), 0x4f27 => Some(unsafe { transmute(0x7089u32) }), 0x4f28 => Some(unsafe { transmute(0x8cc2u32) }), 0x4f29 => Some(unsafe { transmute(0x8defu32) }), 0x4f2a => Some(unsafe { transmute(0x9732u32) }), 0x4f2b => Some(unsafe { transmute(0x52b4u32) }), 0x4f2c => Some(unsafe { transmute(0x5a41u32) }), 0x4f2d => Some(unsafe { transmute(0x5ecau32) }), 0x4f2e => Some(unsafe { transmute(0x5f04u32) }), 0x4f2f => Some(unsafe { transmute(0x6717u32) }), 0x4f30 => Some(unsafe { transmute(0x697cu32) }), 0x4f31 => Some(unsafe { transmute(0x6994u32) }), 0x4f32 => Some(unsafe { transmute(0x6d6au32) }), 0x4f33 => Some(unsafe { transmute(0x6f0fu32) }), 0x4f34 => Some(unsafe { transmute(0x7262u32) }), 0x4f35 => Some(unsafe { transmute(0x72fcu32) }), 0x4f36 => Some(unsafe { transmute(0x7bedu32) }), 0x4f37 => Some(unsafe { transmute(0x8001u32) }), 0x4f38 => Some(unsafe { transmute(0x807eu32) }), 0x4f39 => Some(unsafe { transmute(0x874bu32) }), 0x4f3a => Some(unsafe { transmute(0x90ceu32) }), 0x4f3b => Some(unsafe { transmute(0x516du32) }), 0x4f3c => Some(unsafe { transmute(0x9e93u32) }), 0x4f3d => Some(unsafe { transmute(0x7984u32) }), 0x4f3e => Some(unsafe { transmute(0x808bu32) }), 0x4f3f => Some(unsafe { transmute(0x9332u32) }), 0x4f40 => Some(unsafe { transmute(0x8ad6u32) }), 0x4f41 => Some(unsafe { transmute(0x502du32) }), 0x4f42 => Some(unsafe { transmute(0x548cu32) }), 0x4f43 => Some(unsafe { transmute(0x8a71u32) }), 0x4f44 => Some(unsafe { transmute(0x6b6au32) }), 0x4f45 => Some(unsafe { transmute(0x8cc4u32) }), 0x4f46 => Some(unsafe { transmute(0x8107u32) }), 0x4f47 => Some(unsafe { transmute(0x60d1u32) }), 0x4f48 => Some(unsafe { transmute(0x67a0u32) }), 0x4f49 => Some(unsafe { transmute(0x9df2u32) }), 0x4f4a => Some(unsafe { transmute(0x4e99u32) }), 0x4f4b => Some(unsafe { transmute(0x4e98u32) }), 0x4f4c => Some(unsafe { transmute(0x9c10u32) }), 0x4f4d => Some(unsafe { transmute(0x8a6bu32) }), 0x4f4e => Some(unsafe { transmute(0x85c1u32) }), 0x4f4f => Some(unsafe { transmute(0x8568u32) }), 0x4f50 => Some(unsafe { transmute(0x6900u32) }), 0x4f51 => Some(unsafe { transmute(0x6e7eu32) }), 0x4f52 => Some(unsafe { transmute(0x7897u32) }), 0x4f53 => Some(unsafe { transmute(0x8155u32) }), 0x5021 => Some(unsafe { transmute(0x5f0cu32) }), 0x5022 => Some(unsafe { transmute(0x4e10u32) }), 0x5023 => Some(unsafe { transmute(0x4e15u32) }), 0x5024 => Some(unsafe { transmute(0x4e2au32) }), 0x5025 => Some(unsafe { transmute(0x4e31u32) }), 0x5026 => Some(unsafe { transmute(0x4e36u32) }), 0x5027 => Some(unsafe { transmute(0x4e3cu32) }), 0x5028 => Some(unsafe { transmute(0x4e3fu32) }), 0x5029 => Some(unsafe { transmute(0x4e42u32) }), 0x502a => Some(unsafe { transmute(0x4e56u32) }), 0x502b => Some(unsafe { transmute(0x4e58u32) }), 0x502c => Some(unsafe { transmute(0x4e82u32) }), 0x502d => Some(unsafe { transmute(0x4e85u32) }), 0x502e => Some(unsafe { transmute(0x8c6bu32) }), 0x502f => Some(unsafe { transmute(0x4e8au32) }), 0x5030 => Some(unsafe { transmute(0x8212u32) }), 0x5031 => Some(unsafe { transmute(0x5f0du32) }), 0x5032 => Some(unsafe { transmute(0x4e8eu32) }), 0x5033 => Some(unsafe { transmute(0x4e9eu32) }), 0x5034 => Some(unsafe { transmute(0x4e9fu32) }), 0x5035 => Some(unsafe { transmute(0x4ea0u32) }), 0x5036 => Some(unsafe { transmute(0x4ea2u32) }), 0x5037 => Some(unsafe { transmute(0x4eb0u32) }), 0x5038 => Some(unsafe { transmute(0x4eb3u32) }), 0x5039 => Some(unsafe { transmute(0x4eb6u32) }), 0x503a => Some(unsafe { transmute(0x4eceu32) }), 0x503b => Some(unsafe { transmute(0x4ecdu32) }), 0x503c => Some(unsafe { transmute(0x4ec4u32) }), 0x503d => Some(unsafe { transmute(0x4ec6u32) }), 0x503e => Some(unsafe { transmute(0x4ec2u32) }), 0x503f => Some(unsafe { transmute(0x4ed7u32) }), 0x5040 => Some(unsafe { transmute(0x4edeu32) }), 0x5041 => Some(unsafe { transmute(0x4eedu32) }), 0x5042 => Some(unsafe { transmute(0x4edfu32) }), 0x5043 => Some(unsafe { transmute(0x4ef7u32) }), 0x5044 => Some(unsafe { transmute(0x4f09u32) }), 0x5045 => Some(unsafe { transmute(0x4f5au32) }), 0x5046 => Some(unsafe { transmute(0x4f30u32) }), 0x5047 => Some(unsafe { transmute(0x4f5bu32) }), 0x5048 => Some(unsafe { transmute(0x4f5du32) }), 0x5049 => Some(unsafe { transmute(0x4f57u32) }), 0x504a => Some(unsafe { transmute(0x4f47u32) }), 0x504b => Some(unsafe { transmute(0x4f76u32) }), 0x504c => Some(unsafe { transmute(0x4f88u32) }), 0x504d => Some(unsafe { transmute(0x4f8fu32) }), 0x504e => Some(unsafe { transmute(0x4f98u32) }), 0x504f => Some(unsafe { transmute(0x4f7bu32) }), 0x5050 => Some(unsafe { transmute(0x4f69u32) }), 0x5051 => Some(unsafe { transmute(0x4f70u32) }), 0x5052 => Some(unsafe { transmute(0x4f91u32) }), 0x5053 => Some(unsafe { transmute(0x4f6fu32) }), 0x5054 => Some(unsafe { transmute(0x4f86u32) }), 0x5055 => Some(unsafe { transmute(0x4f96u32) }), 0x5056 => Some(unsafe { transmute(0x5118u32) }), 0x5057 => Some(unsafe { transmute(0x4fd4u32) }), 0x5058 => Some(unsafe { transmute(0x4fdfu32) }), 0x5059 => Some(unsafe { transmute(0x4fceu32) }), 0x505a => Some(unsafe { transmute(0x4fd8u32) }), 0x505b => Some(unsafe { transmute(0x4fdbu32) }), 0x505c => Some(unsafe { transmute(0x4fd1u32) }), 0x505d => Some(unsafe { transmute(0x4fdau32) }), 0x505e => Some(unsafe { transmute(0x4fd0u32) }), 0x505f => Some(unsafe { transmute(0x4fe4u32) }), 0x5060 => Some(unsafe { transmute(0x4fe5u32) }), 0x5061 => Some(unsafe { transmute(0x501au32) }), 0x5062 => Some(unsafe { transmute(0x5028u32) }), 0x5063 => Some(unsafe { transmute(0x5014u32) }), 0x5064 => Some(unsafe { transmute(0x502au32) }), 0x5065 => Some(unsafe { transmute(0x5025u32) }), 0x5066 => Some(unsafe { transmute(0x5005u32) }), 0x5067 => Some(unsafe { transmute(0x4f1cu32) }), 0x5068 => Some(unsafe { transmute(0x4ff6u32) }), 0x5069 => Some(unsafe { transmute(0x5021u32) }), 0x506a => Some(unsafe { transmute(0x5029u32) }), 0x506b => Some(unsafe { transmute(0x502cu32) }), 0x506c => Some(unsafe { transmute(0x4ffeu32) }), 0x506d => Some(unsafe { transmute(0x4fefu32) }), 0x506e => Some(unsafe { transmute(0x5011u32) }), 0x506f => Some(unsafe { transmute(0x5006u32) }), 0x5070 => Some(unsafe { transmute(0x5043u32) }), 0x5071 => Some(unsafe { transmute(0x5047u32) }), 0x5072 => Some(unsafe { transmute(0x6703u32) }), 0x5073 => Some(unsafe { transmute(0x5055u32) }), 0x5074 => Some(unsafe { transmute(0x5050u32) }), 0x5075 => Some(unsafe { transmute(0x5048u32) }), 0x5076 => Some(unsafe { transmute(0x505au32) }), 0x5077 => Some(unsafe { transmute(0x5056u32) }), 0x5078 => Some(unsafe { transmute(0x506cu32) }), 0x5079 => Some(unsafe { transmute(0x5078u32) }), 0x507a => Some(unsafe { transmute(0x5080u32) }), 0x507b => Some(unsafe { transmute(0x509au32) }), 0x507c => Some(unsafe { transmute(0x5085u32) }), 0x507d => Some(unsafe { transmute(0x50b4u32) }), 0x507e => Some(unsafe { transmute(0x50b2u32) }), 0x5121 => Some(unsafe { transmute(0x50c9u32) }), 0x5122 => Some(unsafe { transmute(0x50cau32) }), 0x5123 => Some(unsafe { transmute(0x50b3u32) }), 0x5124 => Some(unsafe { transmute(0x50c2u32) }), 0x5125 => Some(unsafe { transmute(0x50d6u32) }), 0x5126 => Some(unsafe { transmute(0x50deu32) }), 0x5127 => Some(unsafe { transmute(0x50e5u32) }), 0x5128 => Some(unsafe { transmute(0x50edu32) }), 0x5129 => Some(unsafe { transmute(0x50e3u32) }), 0x512a => Some(unsafe { transmute(0x50eeu32) }), 0x512b => Some(unsafe { transmute(0x50f9u32) }), 0x512c => Some(unsafe { transmute(0x50f5u32) }), 0x512d => Some(unsafe { transmute(0x5109u32) }), 0x512e => Some(unsafe { transmute(0x5101u32) }), 0x512f => Some(unsafe { transmute(0x5102u32) }), 0x5130 => Some(unsafe { transmute(0x5116u32) }), 0x5131 => Some(unsafe { transmute(0x5115u32) }), 0x5132 => Some(unsafe { transmute(0x5114u32) }), 0x5133 => Some(unsafe { transmute(0x511au32) }), 0x5134 => Some(unsafe { transmute(0x5121u32) }), 0x5135 => Some(unsafe { transmute(0x513au32) }), 0x5136 => Some(unsafe { transmute(0x5137u32) }), 0x5137 => Some(unsafe { transmute(0x513cu32) }), 0x5138 => Some(unsafe { transmute(0x513bu32) }), 0x5139 => Some(unsafe { transmute(0x513fu32) }), 0x513a => Some(unsafe { transmute(0x5140u32) }), 0x513b => Some(unsafe { transmute(0x5152u32) }), 0x513c => Some(unsafe { transmute(0x514cu32) }), 0x513d => Some(unsafe { transmute(0x5154u32) }), 0x513e => Some(unsafe { transmute(0x5162u32) }), 0x513f => Some(unsafe { transmute(0x7af8u32) }), 0x5140 => Some(unsafe { transmute(0x5169u32) }), 0x5141 => Some(unsafe { transmute(0x516au32) }), 0x5142 => Some(unsafe { transmute(0x516eu32) }), 0x5143 => Some(unsafe { transmute(0x5180u32) }), 0x5144 => Some(unsafe { transmute(0x5182u32) }), 0x5145 => Some(unsafe { transmute(0x56d8u32) }), 0x5146 => Some(unsafe { transmute(0x518cu32) }), 0x5147 => Some(unsafe { transmute(0x5189u32) }), 0x5148 => Some(unsafe { transmute(0x518fu32) }), 0x5149 => Some(unsafe { transmute(0x5191u32) }), 0x514a => Some(unsafe { transmute(0x5193u32) }), 0x514b => Some(unsafe { transmute(0x5195u32) }), 0x514c => Some(unsafe { transmute(0x5196u32) }), 0x514d => Some(unsafe { transmute(0x51a4u32) }), 0x514e => Some(unsafe { transmute(0x51a6u32) }), 0x514f => Some(unsafe { transmute(0x51a2u32) }), 0x5150 => Some(unsafe { transmute(0x51a9u32) }), 0x5151 => Some(unsafe { transmute(0x51aau32) }), 0x5152 => Some(unsafe { transmute(0x51abu32) }), 0x5153 => Some(unsafe { transmute(0x51b3u32) }), 0x5154 => Some(unsafe { transmute(0x51b1u32) }), 0x5155 => Some(unsafe { transmute(0x51b2u32) }), 0x5156 => Some(unsafe { transmute(0x51b0u32) }), 0x5157 => Some(unsafe { transmute(0x51b5u32) }), 0x5158 => Some(unsafe { transmute(0x51bdu32) }), 0x5159 => Some(unsafe { transmute(0x51c5u32) }), 0x515a => Some(unsafe { transmute(0x51c9u32) }), 0x515b => Some(unsafe { transmute(0x51dbu32) }), 0x515c => Some(unsafe { transmute(0x51e0u32) }), 0x515d => Some(unsafe { transmute(0x8655u32) }), 0x515e => Some(unsafe { transmute(0x51e9u32) }), 0x515f => Some(unsafe { transmute(0x51edu32) }), 0x5160 => Some(unsafe { transmute(0x51f0u32) }), 0x5161 => Some(unsafe { transmute(0x51f5u32) }), 0x5162 => Some(unsafe { transmute(0x51feu32) }), 0x5163 => Some(unsafe { transmute(0x5204u32) }), 0x5164 => Some(unsafe { transmute(0x520bu32) }), 0x5165 => Some(unsafe { transmute(0x5214u32) }), 0x5166 => Some(unsafe { transmute(0x520eu32) }), 0x5167 => Some(unsafe { transmute(0x5227u32) }), 0x5168 => Some(unsafe { transmute(0x522au32) }), 0x5169 => Some(unsafe { transmute(0x522eu32) }), 0x516a => Some(unsafe { transmute(0x5233u32) }), 0x516b => Some(unsafe { transmute(0x5239u32) }), 0x516c => Some(unsafe { transmute(0x524fu32) }), 0x516d => Some(unsafe { transmute(0x5244u32) }), 0x516e => Some(unsafe { transmute(0x524bu32) }), 0x516f => Some(unsafe { transmute(0x524cu32) }), 0x5170 => Some(unsafe { transmute(0x525eu32) }), 0x5171 => Some(unsafe { transmute(0x5254u32) }), 0x5172 => Some(unsafe { transmute(0x526au32) }), 0x5173 => Some(unsafe { transmute(0x5274u32) }), 0x5174 => Some(unsafe { transmute(0x5269u32) }), 0x5175 => Some(unsafe { transmute(0x5273u32) }), 0x5176 => Some(unsafe { transmute(0x527fu32) }), 0x5177 => Some(unsafe { transmute(0x527du32) }), 0x5178 => Some(unsafe { transmute(0x528du32) }), 0x5179 => Some(unsafe { transmute(0x5294u32) }), 0x517a => Some(unsafe { transmute(0x5292u32) }), 0x517b => Some(unsafe { transmute(0x5271u32) }), 0x517c => Some(unsafe { transmute(0x5288u32) }), 0x517d => Some(unsafe { transmute(0x5291u32) }), 0x517e => Some(unsafe { transmute(0x8fa8u32) }), 0x5221 => Some(unsafe { transmute(0x8fa7u32) }), 0x5222 => Some(unsafe { transmute(0x52acu32) }), 0x5223 => Some(unsafe { transmute(0x52adu32) }), 0x5224 => Some(unsafe { transmute(0x52bcu32) }), 0x5225 => Some(unsafe { transmute(0x52b5u32) }), 0x5226 => Some(unsafe { transmute(0x52c1u32) }), 0x5227 => Some(unsafe { transmute(0x52cdu32) }), 0x5228 => Some(unsafe { transmute(0x52d7u32) }), 0x5229 => Some(unsafe { transmute(0x52deu32) }), 0x522a => Some(unsafe { transmute(0x52e3u32) }), 0x522b => Some(unsafe { transmute(0x52e6u32) }), 0x522c => Some(unsafe { transmute(0x98edu32) }), 0x522d => Some(unsafe { transmute(0x52e0u32) }), 0x522e => Some(unsafe { transmute(0x52f3u32) }), 0x522f => Some(unsafe { transmute(0x52f5u32) }), 0x5230 => Some(unsafe { transmute(0x52f8u32) }), 0x5231 => Some(unsafe { transmute(0x52f9u32) }), 0x5232 => Some(unsafe { transmute(0x5306u32) }), 0x5233 => Some(unsafe { transmute(0x5308u32) }), 0x5234 => Some(unsafe { transmute(0x7538u32) }), 0x5235 => Some(unsafe { transmute(0x530du32) }), 0x5236 => Some(unsafe { transmute(0x5310u32) }), 0x5237 => Some(unsafe { transmute(0x530fu32) }), 0x5238 => Some(unsafe { transmute(0x5315u32) }), 0x5239 => Some(unsafe { transmute(0x531au32) }), 0x523a => Some(unsafe { transmute(0x5323u32) }), 0x523b => Some(unsafe { transmute(0x532fu32) }), 0x523c => Some(unsafe { transmute(0x5331u32) }), 0x523d => Some(unsafe { transmute(0x5333u32) }), 0x523e => Some(unsafe { transmute(0x5338u32) }), 0x523f => Some(unsafe { transmute(0x5340u32) }), 0x5240 => Some(unsafe { transmute(0x5346u32) }), 0x5241 => Some(unsafe { transmute(0x5345u32) }), 0x5242 => Some(unsafe { transmute(0x4e17u32) }), 0x5243 => Some(unsafe { transmute(0x5349u32) }), 0x5244 => Some(unsafe { transmute(0x534du32) }), 0x5245 => Some(unsafe { transmute(0x51d6u32) }), 0x5246 => Some(unsafe { transmute(0x535eu32) }), 0x5247 => Some(unsafe { transmute(0x5369u32) }), 0x5248 => Some(unsafe { transmute(0x536eu32) }), 0x5249 => Some(unsafe { transmute(0x5918u32) }), 0x524a => Some(unsafe { transmute(0x537bu32) }), 0x524b => Some(unsafe { transmute(0x5377u32) }), 0x524c => Some(unsafe { transmute(0x5382u32) }), 0x524d => Some(unsafe { transmute(0x5396u32) }), 0x524e => Some(unsafe { transmute(0x53a0u32) }), 0x524f => Some(unsafe { transmute(0x53a6u32) }), 0x5250 => Some(unsafe { transmute(0x53a5u32) }), 0x5251 => Some(unsafe { transmute(0x53aeu32) }), 0x5252 => Some(unsafe { transmute(0x53b0u32) }), 0x5253 => Some(unsafe { transmute(0x53b6u32) }), 0x5254 => Some(unsafe { transmute(0x53c3u32) }), 0x5255 => Some(unsafe { transmute(0x7c12u32) }), 0x5256 => Some(unsafe { transmute(0x96d9u32) }), 0x5257 => Some(unsafe { transmute(0x53dfu32) }), 0x5258 => Some(unsafe { transmute(0x66fcu32) }), 0x5259 => Some(unsafe { transmute(0x71eeu32) }), 0x525a => Some(unsafe { transmute(0x53eeu32) }), 0x525b => Some(unsafe { transmute(0x53e8u32) }), 0x525c => Some(unsafe { transmute(0x53edu32) }), 0x525d => Some(unsafe { transmute(0x53fau32) }), 0x525e => Some(unsafe { transmute(0x5401u32) }), 0x525f => Some(unsafe { transmute(0x543du32) }), 0x5260 => Some(unsafe { transmute(0x5440u32) }), 0x5261 => Some(unsafe { transmute(0x542cu32) }), 0x5262 => Some(unsafe { transmute(0x542du32) }), 0x5263 => Some(unsafe { transmute(0x543cu32) }), 0x5264 => Some(unsafe { transmute(0x542eu32) }), 0x5265 => Some(unsafe { transmute(0x5436u32) }), 0x5266 => Some(unsafe { transmute(0x5429u32) }), 0x5267 => Some(unsafe { transmute(0x541du32) }), 0x5268 => Some(unsafe { transmute(0x544eu32) }), 0x5269 => Some(unsafe { transmute(0x548fu32) }), 0x526a => Some(unsafe { transmute(0x5475u32) }), 0x526b => Some(unsafe { transmute(0x548eu32) }), 0x526c => Some(unsafe { transmute(0x545fu32) }), 0x526d => Some(unsafe { transmute(0x5471u32) }), 0x526e => Some(unsafe { transmute(0x5477u32) }), 0x526f => Some(unsafe { transmute(0x5470u32) }), 0x5270 => Some(unsafe { transmute(0x5492u32) }), 0x5271 => Some(unsafe { transmute(0x547bu32) }), 0x5272 => Some(unsafe { transmute(0x5480u32) }), 0x5273 => Some(unsafe { transmute(0x5476u32) }), 0x5274 => Some(unsafe { transmute(0x5484u32) }), 0x5275 => Some(unsafe { transmute(0x5490u32) }), 0x5276 => Some(unsafe { transmute(0x5486u32) }), 0x5277 => Some(unsafe { transmute(0x54c7u32) }), 0x5278 => Some(unsafe { transmute(0x54a2u32) }), 0x5279 => Some(unsafe { transmute(0x54b8u32) }), 0x527a => Some(unsafe { transmute(0x54a5u32) }), 0x527b => Some(unsafe { transmute(0x54acu32) }), 0x527c => Some(unsafe { transmute(0x54c4u32) }), 0x527d => Some(unsafe { transmute(0x54c8u32) }), 0x527e => Some(unsafe { transmute(0x54a8u32) }), 0x5321 => Some(unsafe { transmute(0x54abu32) }), 0x5322 => Some(unsafe { transmute(0x54c2u32) }), 0x5323 => Some(unsafe { transmute(0x54a4u32) }), 0x5324 => Some(unsafe { transmute(0x54beu32) }), 0x5325 => Some(unsafe { transmute(0x54bcu32) }), 0x5326 => Some(unsafe { transmute(0x54d8u32) }), 0x5327 => Some(unsafe { transmute(0x54e5u32) }), 0x5328 => Some(unsafe { transmute(0x54e6u32) }), 0x5329 => Some(unsafe { transmute(0x550fu32) }), 0x532a => Some(unsafe { transmute(0x5514u32) }), 0x532b => Some(unsafe { transmute(0x54fdu32) }), 0x532c => Some(unsafe { transmute(0x54eeu32) }), 0x532d => Some(unsafe { transmute(0x54edu32) }), 0x532e => Some(unsafe { transmute(0x54fau32) }), 0x532f => Some(unsafe { transmute(0x54e2u32) }), 0x5330 => Some(unsafe { transmute(0x5539u32) }), 0x5331 => Some(unsafe { transmute(0x5540u32) }), 0x5332 => Some(unsafe { transmute(0x5563u32) }), 0x5333 => Some(unsafe { transmute(0x554cu32) }), 0x5334 => Some(unsafe { transmute(0x552eu32) }), 0x5335 => Some(unsafe { transmute(0x555cu32) }), 0x5336 => Some(unsafe { transmute(0x5545u32) }), 0x5337 => Some(unsafe { transmute(0x5556u32) }), 0x5338 => Some(unsafe { transmute(0x5557u32) }), 0x5339 => Some(unsafe { transmute(0x5538u32) }), 0x533a => Some(unsafe { transmute(0x5533u32) }), 0x533b => Some(unsafe { transmute(0x555du32) }), 0x533c => Some(unsafe { transmute(0x5599u32) }), 0x533d => Some(unsafe { transmute(0x5580u32) }), 0x533e => Some(unsafe { transmute(0x54afu32) }), 0x533f => Some(unsafe { transmute(0x558au32) }), 0x5340 => Some(unsafe { transmute(0x559fu32) }), 0x5341 => Some(unsafe { transmute(0x557bu32) }), 0x5342 => Some(unsafe { transmute(0x557eu32) }), 0x5343 => Some(unsafe { transmute(0x5598u32) }), 0x5344 => Some(unsafe { transmute(0x559eu32) }), 0x5345 => Some(unsafe { transmute(0x55aeu32) }), 0x5346 => Some(unsafe { transmute(0x557cu32) }), 0x5347 => Some(unsafe { transmute(0x5583u32) }), 0x5348 => Some(unsafe { transmute(0x55a9u32) }), 0x5349 => Some(unsafe { transmute(0x5587u32) }), 0x534a => Some(unsafe { transmute(0x55a8u32) }), 0x534b => Some(unsafe { transmute(0x55dau32) }), 0x534c => Some(unsafe { transmute(0x55c5u32) }), 0x534d => Some(unsafe { transmute(0x55dfu32) }), 0x534e => Some(unsafe { transmute(0x55c4u32) }), 0x534f => Some(unsafe { transmute(0x55dcu32) }), 0x5350 => Some(unsafe { transmute(0x55e4u32) }), 0x5351 => Some(unsafe { transmute(0x55d4u32) }), 0x5352 => Some(unsafe { transmute(0x5614u32) }), 0x5353 => Some(unsafe { transmute(0x55f7u32) }), 0x5354 => Some(unsafe { transmute(0x5616u32) }), 0x5355 => Some(unsafe { transmute(0x55feu32) }), 0x5356 => Some(unsafe { transmute(0x55fdu32) }), 0x5357 => Some(unsafe { transmute(0x561bu32) }), 0x5358 => Some(unsafe { transmute(0x55f9u32) }), 0x5359 => Some(unsafe { transmute(0x564eu32) }), 0x535a => Some(unsafe { transmute(0x5650u32) }), 0x535b => Some(unsafe { transmute(0x71dfu32) }), 0x535c => Some(unsafe { transmute(0x5634u32) }), 0x535d => Some(unsafe { transmute(0x5636u32) }), 0x535e => Some(unsafe { transmute(0x5632u32) }), 0x535f => Some(unsafe { transmute(0x5638u32) }), 0x5360 => Some(unsafe { transmute(0x566bu32) }), 0x5361 => Some(unsafe { transmute(0x5664u32) }), 0x5362 => Some(unsafe { transmute(0x562fu32) }), 0x5363 => Some(unsafe { transmute(0x566cu32) }), 0x5364 => Some(unsafe { transmute(0x566au32) }), 0x5365 => Some(unsafe { transmute(0x5686u32) }), 0x5366 => Some(unsafe { transmute(0x5680u32) }), 0x5367 => Some(unsafe { transmute(0x568au32) }), 0x5368 => Some(unsafe { transmute(0x56a0u32) }), 0x5369 => Some(unsafe { transmute(0x5694u32) }), 0x536a => Some(unsafe { transmute(0x568fu32) }), 0x536b => Some(unsafe { transmute(0x56a5u32) }), 0x536c => Some(unsafe { transmute(0x56aeu32) }), 0x536d => Some(unsafe { transmute(0x56b6u32) }), 0x536e => Some(unsafe { transmute(0x56b4u32) }), 0x536f => Some(unsafe { transmute(0x56c2u32) }), 0x5370 => Some(unsafe { transmute(0x56bcu32) }), 0x5371 => Some(unsafe { transmute(0x56c1u32) }), 0x5372 => Some(unsafe { transmute(0x56c3u32) }), 0x5373 => Some(unsafe { transmute(0x56c0u32) }), 0x5374 => Some(unsafe { transmute(0x56c8u32) }), 0x5375 => Some(unsafe { transmute(0x56ceu32) }), 0x5376 => Some(unsafe { transmute(0x56d1u32) }), 0x5377 => Some(unsafe { transmute(0x56d3u32) }), 0x5378 => Some(unsafe { transmute(0x56d7u32) }), 0x5379 => Some(unsafe { transmute(0x56eeu32) }), 0x537a => Some(unsafe { transmute(0x56f9u32) }), 0x537b => Some(unsafe { transmute(0x5700u32) }), 0x537c => Some(unsafe { transmute(0x56ffu32) }), 0x537d => Some(unsafe { transmute(0x5704u32) }), 0x537e => Some(unsafe { transmute(0x5709u32) }), 0x5421 => Some(unsafe { transmute(0x5708u32) }), 0x5422 => Some(unsafe { transmute(0x570bu32) }), 0x5423 => Some(unsafe { transmute(0x570du32) }), 0x5424 => Some(unsafe { transmute(0x5713u32) }), 0x5425 => Some(unsafe { transmute(0x5718u32) }), 0x5426 => Some(unsafe { transmute(0x5716u32) }), 0x5427 => Some(unsafe { transmute(0x55c7u32) }), 0x5428 => Some(unsafe { transmute(0x571cu32) }), 0x5429 => Some(unsafe { transmute(0x5726u32) }), 0x542a => Some(unsafe { transmute(0x5737u32) }), 0x542b => Some(unsafe { transmute(0x5738u32) }), 0x542c => Some(unsafe { transmute(0x574eu32) }), 0x542d => Some(unsafe { transmute(0x573bu32) }), 0x542e => Some(unsafe { transmute(0x5740u32) }), 0x542f => Some(unsafe { transmute(0x574fu32) }), 0x5430 => Some(unsafe { transmute(0x5769u32) }), 0x5431 => Some(unsafe { transmute(0x57c0u32) }), 0x5432 => Some(unsafe { transmute(0x5788u32) }), 0x5433 => Some(unsafe { transmute(0x5761u32) }), 0x5434 => Some(unsafe { transmute(0x577fu32) }), 0x5435 => Some(unsafe { transmute(0x5789u32) }), 0x5436 => Some(unsafe { transmute(0x5793u32) }), 0x5437 => Some(unsafe { transmute(0x57a0u32) }), 0x5438 => Some(unsafe { transmute(0x57b3u32) }), 0x5439 => Some(unsafe { transmute(0x57a4u32) }), 0x543a => Some(unsafe { transmute(0x57aau32) }), 0x543b => Some(unsafe { transmute(0x57b0u32) }), 0x543c => Some(unsafe { transmute(0x57c3u32) }), 0x543d => Some(unsafe { transmute(0x57c6u32) }), 0x543e => Some(unsafe { transmute(0x57d4u32) }), 0x543f => Some(unsafe { transmute(0x57d2u32) }), 0x5440 => Some(unsafe { transmute(0x57d3u32) }), 0x5441 => Some(unsafe { transmute(0x580au32) }), 0x5442 => Some(unsafe { transmute(0x57d6u32) }), 0x5443 => Some(unsafe { transmute(0x57e3u32) }), 0x5444 => Some(unsafe { transmute(0x580bu32) }), 0x5445 => Some(unsafe { transmute(0x5819u32) }), 0x5446 => Some(unsafe { transmute(0x581du32) }), 0x5447 => Some(unsafe { transmute(0x5872u32) }), 0x5448 => Some(unsafe { transmute(0x5821u32) }), 0x5449 => Some(unsafe { transmute(0x5862u32) }), 0x544a => Some(unsafe { transmute(0x584bu32) }), 0x544b => Some(unsafe { transmute(0x5870u32) }), 0x544c => Some(unsafe { transmute(0x6bc0u32) }), 0x544d => Some(unsafe { transmute(0x5852u32) }), 0x544e => Some(unsafe { transmute(0x583du32) }), 0x544f => Some(unsafe { transmute(0x5879u32) }), 0x5450 => Some(unsafe { transmute(0x5885u32) }), 0x5451 => Some(unsafe { transmute(0x58b9u32) }), 0x5452 => Some(unsafe { transmute(0x589fu32) }), 0x5453 => Some(unsafe { transmute(0x58abu32) }), 0x5454 => Some(unsafe { transmute(0x58bau32) }), 0x5455 => Some(unsafe { transmute(0x58deu32) }), 0x5456 => Some(unsafe { transmute(0x58bbu32) }), 0x5457 => Some(unsafe { transmute(0x58b8u32) }), 0x5458 => Some(unsafe { transmute(0x58aeu32) }), 0x5459 => Some(unsafe { transmute(0x58c5u32) }), 0x545a => Some(unsafe { transmute(0x58d3u32) }), 0x545b => Some(unsafe { transmute(0x58d1u32) }), 0x545c => Some(unsafe { transmute(0x58d7u32) }), 0x545d => Some(unsafe { transmute(0x58d9u32) }), 0x545e => Some(unsafe { transmute(0x58d8u32) }), 0x545f => Some(unsafe { transmute(0x58e5u32) }), 0x5460 => Some(unsafe { transmute(0x58dcu32) }), 0x5461 => Some(unsafe { transmute(0x58e4u32) }), 0x5462 => Some(unsafe { transmute(0x58dfu32) }), 0x5463 => Some(unsafe { transmute(0x58efu32) }), 0x5464 => Some(unsafe { transmute(0x58fau32) }), 0x5465 => Some(unsafe { transmute(0x58f9u32) }), 0x5466 => Some(unsafe { transmute(0x58fbu32) }), 0x5467 => Some(unsafe { transmute(0x58fcu32) }), 0x5468 => Some(unsafe { transmute(0x58fdu32) }), 0x5469 => Some(unsafe { transmute(0x5902u32) }), 0x546a => Some(unsafe { transmute(0x590au32) }), 0x546b => Some(unsafe { transmute(0x5910u32) }), 0x546c => Some(unsafe { transmute(0x591bu32) }), 0x546d => Some(unsafe { transmute(0x68a6u32) }), 0x546e => Some(unsafe { transmute(0x5925u32) }), 0x546f => Some(unsafe { transmute(0x592cu32) }), 0x5470 => Some(unsafe { transmute(0x592du32) }), 0x5471 => Some(unsafe { transmute(0x5932u32) }), 0x5472 => Some(unsafe { transmute(0x5938u32) }), 0x5473 => Some(unsafe { transmute(0x593eu32) }), 0x5474 => Some(unsafe { transmute(0x7ad2u32) }), 0x5475 => Some(unsafe { transmute(0x5955u32) }), 0x5476 => Some(unsafe { transmute(0x5950u32) }), 0x5477 => Some(unsafe { transmute(0x594eu32) }), 0x5478 => Some(unsafe { transmute(0x595au32) }), 0x5479 => Some(unsafe { transmute(0x5958u32) }), 0x547a => Some(unsafe { transmute(0x5962u32) }), 0x547b => Some(unsafe { transmute(0x5960u32) }), 0x547c => Some(unsafe { transmute(0x5967u32) }), 0x547d => Some(unsafe { transmute(0x596cu32) }), 0x547e => Some(unsafe { transmute(0x5969u32) }), 0x5521 => Some(unsafe { transmute(0x5978u32) }), 0x5522 => Some(unsafe { transmute(0x5981u32) }), 0x5523 => Some(unsafe { transmute(0x599du32) }), 0x5524 => Some(unsafe { transmute(0x4f5eu32) }), 0x5525 => Some(unsafe { transmute(0x4fabu32) }), 0x5526 => Some(unsafe { transmute(0x59a3u32) }), 0x5527 => Some(unsafe { transmute(0x59b2u32) }), 0x5528 => Some(unsafe { transmute(0x59c6u32) }), 0x5529 => Some(unsafe { transmute(0x59e8u32) }), 0x552a => Some(unsafe { transmute(0x59dcu32) }), 0x552b => Some(unsafe { transmute(0x598du32) }), 0x552c => Some(unsafe { transmute(0x59d9u32) }), 0x552d => Some(unsafe { transmute(0x59dau32) }), 0x552e => Some(unsafe { transmute(0x5a25u32) }), 0x552f => Some(unsafe { transmute(0x5a1fu32) }), 0x5530 => Some(unsafe { transmute(0x5a11u32) }), 0x5531 => Some(unsafe { transmute(0x5a1cu32) }), 0x5532 => Some(unsafe { transmute(0x5a09u32) }), 0x5533 => Some(unsafe { transmute(0x5a1au32) }), 0x5534 => Some(unsafe { transmute(0x5a40u32) }), 0x5535 => Some(unsafe { transmute(0x5a6cu32) }), 0x5536 => Some(unsafe { transmute(0x5a49u32) }), 0x5537 => Some(unsafe { transmute(0x5a35u32) }), 0x5538 => Some(unsafe { transmute(0x5a36u32) }), 0x5539 => Some(unsafe { transmute(0x5a62u32) }), 0x553a => Some(unsafe { transmute(0x5a6au32) }), 0x553b => Some(unsafe { transmute(0x5a9au32) }), 0x553c => Some(unsafe { transmute(0x5abcu32) }), 0x553d => Some(unsafe { transmute(0x5abeu32) }), 0x553e => Some(unsafe { transmute(0x5acbu32) }), 0x553f => Some(unsafe { transmute(0x5ac2u32) }), 0x5540 => Some(unsafe { transmute(0x5abdu32) }), 0x5541 => Some(unsafe { transmute(0x5ae3u32) }), 0x5542 => Some(unsafe { transmute(0x5ad7u32) }), 0x5543 => Some(unsafe { transmute(0x5ae6u32) }), 0x5544 => Some(unsafe { transmute(0x5ae9u32) }), 0x5545 => Some(unsafe { transmute(0x5ad6u32) }), 0x5546 => Some(unsafe { transmute(0x5afau32) }), 0x5547 => Some(unsafe { transmute(0x5afbu32) }), 0x5548 => Some(unsafe { transmute(0x5b0cu32) }), 0x5549 => Some(unsafe { transmute(0x5b0bu32) }), 0x554a => Some(unsafe { transmute(0x5b16u32) }), 0x554b => Some(unsafe { transmute(0x5b32u32) }), 0x554c => Some(unsafe { transmute(0x5ad0u32) }), 0x554d => Some(unsafe { transmute(0x5b2au32) }), 0x554e => Some(unsafe { transmute(0x5b36u32) }), 0x554f => Some(unsafe { transmute(0x5b3eu32) }), 0x5550 => Some(unsafe { transmute(0x5b43u32) }), 0x5551 => Some(unsafe { transmute(0x5b45u32) }), 0x5552 => Some(unsafe { transmute(0x5b40u32) }), 0x5553 => Some(unsafe { transmute(0x5b51u32) }), 0x5554 => Some(unsafe { transmute(0x5b55u32) }), 0x5555 => Some(unsafe { transmute(0x5b5au32) }), 0x5556 => Some(unsafe { transmute(0x5b5bu32) }), 0x5557 => Some(unsafe { transmute(0x5b65u32) }), 0x5558 => Some(unsafe { transmute(0x5b69u32) }), 0x5559 => Some(unsafe { transmute(0x5b70u32) }), 0x555a => Some(unsafe { transmute(0x5b73u32) }), 0x555b => Some(unsafe { transmute(0x5b75u32) }), 0x555c => Some(unsafe { transmute(0x5b78u32) }), 0x555d => Some(unsafe { transmute(0x6588u32) }), 0x555e => Some(unsafe { transmute(0x5b7au32) }), 0x555f => Some(unsafe { transmute(0x5b80u32) }), 0x5560 => Some(unsafe { transmute(0x5b83u32) }), 0x5561 => Some(unsafe { transmute(0x5ba6u32) }), 0x5562 => Some(unsafe { transmute(0x5bb8u32) }), 0x5563 => Some(unsafe { transmute(0x5bc3u32) }), 0x5564 => Some(unsafe { transmute(0x5bc7u32) }), 0x5565 => Some(unsafe { transmute(0x5bc9u32) }), 0x5566 => Some(unsafe { transmute(0x5bd4u32) }), 0x5567 => Some(unsafe { transmute(0x5bd0u32) }), 0x5568 => Some(unsafe { transmute(0x5be4u32) }), 0x5569 => Some(unsafe { transmute(0x5be6u32) }), 0x556a => Some(unsafe { transmute(0x5be2u32) }), 0x556b => Some(unsafe { transmute(0x5bdeu32) }), 0x556c => Some(unsafe { transmute(0x5be5u32) }), 0x556d => Some(unsafe { transmute(0x5bebu32) }), 0x556e => Some(unsafe { transmute(0x5bf0u32) }), 0x556f => Some(unsafe { transmute(0x5bf6u32) }), 0x5570 => Some(unsafe { transmute(0x5bf3u32) }), 0x5571 => Some(unsafe { transmute(0x5c05u32) }), 0x5572 => Some(unsafe { transmute(0x5c07u32) }), 0x5573 => Some(unsafe { transmute(0x5c08u32) }), 0x5574 => Some(unsafe { transmute(0x5c0du32) }), 0x5575 => Some(unsafe { transmute(0x5c13u32) }), 0x5576 => Some(unsafe { transmute(0x5c20u32) }), 0x5577 => Some(unsafe { transmute(0x5c22u32) }), 0x5578 => Some(unsafe { transmute(0x5c28u32) }), 0x5579 => Some(unsafe { transmute(0x5c38u32) }), 0x557a => Some(unsafe { transmute(0x5c39u32) }), 0x557b => Some(unsafe { transmute(0x5c41u32) }), 0x557c => Some(unsafe { transmute(0x5c46u32) }), 0x557d => Some(unsafe { transmute(0x5c4eu32) }), 0x557e => Some(unsafe { transmute(0x5c53u32) }), 0x5621 => Some(unsafe { transmute(0x5c50u32) }), 0x5622 => Some(unsafe { transmute(0x5c4fu32) }), 0x5623 => Some(unsafe { transmute(0x5b71u32) }), 0x5624 => Some(unsafe { transmute(0x5c6cu32) }), 0x5625 => Some(unsafe { transmute(0x5c6eu32) }), 0x5626 => Some(unsafe { transmute(0x4e62u32) }), 0x5627 => Some(unsafe { transmute(0x5c76u32) }), 0x5628 => Some(unsafe { transmute(0x5c79u32) }), 0x5629 => Some(unsafe { transmute(0x5c8cu32) }), 0x562a => Some(unsafe { transmute(0x5c91u32) }), 0x562b => Some(unsafe { transmute(0x5c94u32) }), 0x562c => Some(unsafe { transmute(0x599bu32) }), 0x562d => Some(unsafe { transmute(0x5cabu32) }), 0x562e => Some(unsafe { transmute(0x5cbbu32) }), 0x562f => Some(unsafe { transmute(0x5cb6u32) }), 0x5630 => Some(unsafe { transmute(0x5cbcu32) }), 0x5631 => Some(unsafe { transmute(0x5cb7u32) }), 0x5632 => Some(unsafe { transmute(0x5cc5u32) }), 0x5633 => Some(unsafe { transmute(0x5cbeu32) }), 0x5634 => Some(unsafe { transmute(0x5cc7u32) }), 0x5635 => Some(unsafe { transmute(0x5cd9u32) }), 0x5636 => Some(unsafe { transmute(0x5ce9u32) }), 0x5637 => Some(unsafe { transmute(0x5cfdu32) }), 0x5638 => Some(unsafe { transmute(0x5cfau32) }), 0x5639 => Some(unsafe { transmute(0x5cedu32) }), 0x563a => Some(unsafe { transmute(0x5d8cu32) }), 0x563b => Some(unsafe { transmute(0x5ceau32) }), 0x563c => Some(unsafe { transmute(0x5d0bu32) }), 0x563d => Some(unsafe { transmute(0x5d15u32) }), 0x563e => Some(unsafe { transmute(0x5d17u32) }), 0x563f => Some(unsafe { transmute(0x5d5cu32) }), 0x5640 => Some(unsafe { transmute(0x5d1fu32) }), 0x5641 => Some(unsafe { transmute(0x5d1bu32) }), 0x5642 => Some(unsafe { transmute(0x5d11u32) }), 0x5643 => Some(unsafe { transmute(0x5d14u32) }), 0x5644 => Some(unsafe { transmute(0x5d22u32) }), 0x5645 => Some(unsafe { transmute(0x5d1au32) }), 0x5646 => Some(unsafe { transmute(0x5d19u32) }), 0x5647 => Some(unsafe { transmute(0x5d18u32) }), 0x5648 => Some(unsafe { transmute(0x5d4cu32) }), 0x5649 => Some(unsafe { transmute(0x5d52u32) }), 0x564a => Some(unsafe { transmute(0x5d4eu32) }), 0x564b => Some(unsafe { transmute(0x5d4bu32) }), 0x564c => Some(unsafe { transmute(0x5d6cu32) }), 0x564d => Some(unsafe { transmute(0x5d73u32) }), 0x564e => Some(unsafe { transmute(0x5d76u32) }), 0x564f => Some(unsafe { transmute(0x5d87u32) }), 0x5650 => Some(unsafe { transmute(0x5d84u32) }), 0x5651 => Some(unsafe { transmute(0x5d82u32) }), 0x5652 => Some(unsafe { transmute(0x5da2u32) }), 0x5653 => Some(unsafe { transmute(0x5d9du32) }), 0x5654 => Some(unsafe { transmute(0x5dacu32) }), 0x5655 => Some(unsafe { transmute(0x5daeu32) }), 0x5656 => Some(unsafe { transmute(0x5dbdu32) }), 0x5657 => Some(unsafe { transmute(0x5d90u32) }), 0x5658 => Some(unsafe { transmute(0x5db7u32) }), 0x5659 => Some(unsafe { transmute(0x5dbcu32) }), 0x565a => Some(unsafe { transmute(0x5dc9u32) }), 0x565b => Some(unsafe { transmute(0x5dcdu32) }), 0x565c => Some(unsafe { transmute(0x5dd3u32) }), 0x565d => Some(unsafe { transmute(0x5dd2u32) }), 0x565e => Some(unsafe { transmute(0x5dd6u32) }), 0x565f => Some(unsafe { transmute(0x5ddbu32) }), 0x5660 => Some(unsafe { transmute(0x5debu32) }), 0x5661 => Some(unsafe { transmute(0x5df2u32) }), 0x5662 => Some(unsafe { transmute(0x5df5u32) }), 0x5663 => Some(unsafe { transmute(0x5e0bu32) }), 0x5664 => Some(unsafe { transmute(0x5e1au32) }), 0x5665 => Some(unsafe { transmute(0x5e19u32) }), 0x5666 => Some(unsafe { transmute(0x5e11u32) }), 0x5667 => Some(unsafe { transmute(0x5e1bu32) }), 0x5668 => Some(unsafe { transmute(0x5e36u32) }), 0x5669 => Some(unsafe { transmute(0x5e37u32) }), 0x566a => Some(unsafe { transmute(0x5e44u32) }), 0x566b => Some(unsafe { transmute(0x5e43u32) }), 0x566c => Some(unsafe { transmute(0x5e40u32) }), 0x566d => Some(unsafe { transmute(0x5e4eu32) }), 0x566e => Some(unsafe { transmute(0x5e57u32) }), 0x566f => Some(unsafe { transmute(0x5e54u32) }), 0x5670 => Some(unsafe { transmute(0x5e5fu32) }), 0x5671 => Some(unsafe { transmute(0x5e62u32) }), 0x5672 => Some(unsafe { transmute(0x5e64u32) }), 0x5673 => Some(unsafe { transmute(0x5e47u32) }), 0x5674 => Some(unsafe { transmute(0x5e75u32) }), 0x5675 => Some(unsafe { transmute(0x5e76u32) }), 0x5676 => Some(unsafe { transmute(0x5e7au32) }), 0x5677 => Some(unsafe { transmute(0x9ebcu32) }), 0x5678 => Some(unsafe { transmute(0x5e7fu32) }), 0x5679 => Some(unsafe { transmute(0x5ea0u32) }), 0x567a => Some(unsafe { transmute(0x5ec1u32) }), 0x567b => Some(unsafe { transmute(0x5ec2u32) }), 0x567c => Some(unsafe { transmute(0x5ec8u32) }), 0x567d => Some(unsafe { transmute(0x5ed0u32) }), 0x567e => Some(unsafe { transmute(0x5ecfu32) }), 0x5721 => Some(unsafe { transmute(0x5ed6u32) }), 0x5722 => Some(unsafe { transmute(0x5ee3u32) }), 0x5723 => Some(unsafe { transmute(0x5eddu32) }), 0x5724 => Some(unsafe { transmute(0x5edau32) }), 0x5725 => Some(unsafe { transmute(0x5edbu32) }), 0x5726 => Some(unsafe { transmute(0x5ee2u32) }), 0x5727 => Some(unsafe { transmute(0x5ee1u32) }), 0x5728 => Some(unsafe { transmute(0x5ee8u32) }), 0x5729 => Some(unsafe { transmute(0x5ee9u32) }), 0x572a => Some(unsafe { transmute(0x5eecu32) }), 0x572b => Some(unsafe { transmute(0x5ef1u32) }), 0x572c => Some(unsafe { transmute(0x5ef3u32) }), 0x572d => Some(unsafe { transmute(0x5ef0u32) }), 0x572e => Some(unsafe { transmute(0x5ef4u32) }), 0x572f => Some(unsafe { transmute(0x5ef8u32) }), 0x5730 => Some(unsafe { transmute(0x5efeu32) }), 0x5731 => Some(unsafe { transmute(0x5f03u32) }), 0x5732 => Some(unsafe { transmute(0x5f09u32) }), 0x5733 => Some(unsafe { transmute(0x5f5du32) }), 0x5734 => Some(unsafe { transmute(0x5f5cu32) }), 0x5735 => Some(unsafe { transmute(0x5f0bu32) }), 0x5736 => Some(unsafe { transmute(0x5f11u32) }), 0x5737 => Some(unsafe { transmute(0x5f16u32) }), 0x5738 => Some(unsafe { transmute(0x5f29u32) }), 0x5739 => Some(unsafe { transmute(0x5f2du32) }), 0x573a => Some(unsafe { transmute(0x5f38u32) }), 0x573b => Some(unsafe { transmute(0x5f41u32) }), 0x573c => Some(unsafe { transmute(0x5f48u32) }), 0x573d => Some(unsafe { transmute(0x5f4cu32) }), 0x573e => Some(unsafe { transmute(0x5f4eu32) }), 0x573f => Some(unsafe { transmute(0x5f2fu32) }), 0x5740 => Some(unsafe { transmute(0x5f51u32) }), 0x5741 => Some(unsafe { transmute(0x5f56u32) }), 0x5742 => Some(unsafe { transmute(0x5f57u32) }), 0x5743 => Some(unsafe { transmute(0x5f59u32) }), 0x5744 => Some(unsafe { transmute(0x5f61u32) }), 0x5745 => Some(unsafe { transmute(0x5f6du32) }), 0x5746 => Some(unsafe { transmute(0x5f73u32) }), 0x5747 => Some(unsafe { transmute(0x5f77u32) }), 0x5748 => Some(unsafe { transmute(0x5f83u32) }), 0x5749 => Some(unsafe { transmute(0x5f82u32) }), 0x574a => Some(unsafe { transmute(0x5f7fu32) }), 0x574b => Some(unsafe { transmute(0x5f8au32) }), 0x574c => Some(unsafe { transmute(0x5f88u32) }), 0x574d => Some(unsafe { transmute(0x5f91u32) }), 0x574e => Some(unsafe { transmute(0x5f87u32) }), 0x574f => Some(unsafe { transmute(0x5f9eu32) }), 0x5750 => Some(unsafe { transmute(0x5f99u32) }), 0x5751 => Some(unsafe { transmute(0x5f98u32) }), 0x5752 => Some(unsafe { transmute(0x5fa0u32) }), 0x5753 => Some(unsafe { transmute(0x5fa8u32) }), 0x5754 => Some(unsafe { transmute(0x5fadu32) }), 0x5755 => Some(unsafe { transmute(0x5fbcu32) }), 0x5756 => Some(unsafe { transmute(0x5fd6u32) }), 0x5757 => Some(unsafe { transmute(0x5ffbu32) }), 0x5758 => Some(unsafe { transmute(0x5fe4u32) }), 0x5759 => Some(unsafe { transmute(0x5ff8u32) }), 0x575a => Some(unsafe { transmute(0x5ff1u32) }), 0x575b => Some(unsafe { transmute(0x5fddu32) }), 0x575c => Some(unsafe { transmute(0x60b3u32) }), 0x575d => Some(unsafe { transmute(0x5fffu32) }), 0x575e => Some(unsafe { transmute(0x6021u32) }), 0x575f => Some(unsafe { transmute(0x6060u32) }), 0x5760 => Some(unsafe { transmute(0x6019u32) }), 0x5761 => Some(unsafe { transmute(0x6010u32) }), 0x5762 => Some(unsafe { transmute(0x6029u32) }), 0x5763 => Some(unsafe { transmute(0x600eu32) }), 0x5764 => Some(unsafe { transmute(0x6031u32) }), 0x5765 => Some(unsafe { transmute(0x601bu32) }), 0x5766 => Some(unsafe { transmute(0x6015u32) }), 0x5767 => Some(unsafe { transmute(0x602bu32) }), 0x5768 => Some(unsafe { transmute(0x6026u32) }), 0x5769 => Some(unsafe { transmute(0x600fu32) }), 0x576a => Some(unsafe { transmute(0x603au32) }), 0x576b => Some(unsafe { transmute(0x605au32) }), 0x576c => Some(unsafe { transmute(0x6041u32) }), 0x576d => Some(unsafe { transmute(0x606au32) }), 0x576e => Some(unsafe { transmute(0x6077u32) }), 0x576f => Some(unsafe { transmute(0x605fu32) }), 0x5770 => Some(unsafe { transmute(0x604au32) }), 0x5771 => Some(unsafe { transmute(0x6046u32) }), 0x5772 => Some(unsafe { transmute(0x604du32) }), 0x5773 => Some(unsafe { transmute(0x6063u32) }), 0x5774 => Some(unsafe { transmute(0x6043u32) }), 0x5775 => Some(unsafe { transmute(0x6064u32) }), 0x5776 => Some(unsafe { transmute(0x6042u32) }), 0x5777 => Some(unsafe { transmute(0x606cu32) }), 0x5778 => Some(unsafe { transmute(0x606bu32) }), 0x5779 => Some(unsafe { transmute(0x6059u32) }), 0x577a => Some(unsafe { transmute(0x6081u32) }), 0x577b => Some(unsafe { transmute(0x608du32) }), 0x577c => Some(unsafe { transmute(0x60e7u32) }), 0x577d => Some(unsafe { transmute(0x6083u32) }), 0x577e => Some(unsafe { transmute(0x609au32) }), 0x5821 => Some(unsafe { transmute(0x6084u32) }), 0x5822 => Some(unsafe { transmute(0x609bu32) }), 0x5823 => Some(unsafe { transmute(0x6096u32) }), 0x5824 => Some(unsafe { transmute(0x6097u32) }), 0x5825 => Some(unsafe { transmute(0x6092u32) }), 0x5826 => Some(unsafe { transmute(0x60a7u32) }), 0x5827 => Some(unsafe { transmute(0x608bu32) }), 0x5828 => Some(unsafe { transmute(0x60e1u32) }), 0x5829 => Some(unsafe { transmute(0x60b8u32) }), 0x582a => Some(unsafe { transmute(0x60e0u32) }), 0x582b => Some(unsafe { transmute(0x60d3u32) }), 0x582c => Some(unsafe { transmute(0x60b4u32) }), 0x582d => Some(unsafe { transmute(0x5ff0u32) }), 0x582e => Some(unsafe { transmute(0x60bdu32) }), 0x582f => Some(unsafe { transmute(0x60c6u32) }), 0x5830 => Some(unsafe { transmute(0x60b5u32) }), 0x5831 => Some(unsafe { transmute(0x60d8u32) }), 0x5832 => Some(unsafe { transmute(0x614du32) }), 0x5833 => Some(unsafe { transmute(0x6115u32) }), 0x5834 => Some(unsafe { transmute(0x6106u32) }), 0x5835 => Some(unsafe { transmute(0x60f6u32) }), 0x5836 => Some(unsafe { transmute(0x60f7u32) }), 0x5837 => Some(unsafe { transmute(0x6100u32) }), 0x5838 => Some(unsafe { transmute(0x60f4u32) }), 0x5839 => Some(unsafe { transmute(0x60fau32) }), 0x583a => Some(unsafe { transmute(0x6103u32) }), 0x583b => Some(unsafe { transmute(0x6121u32) }), 0x583c => Some(unsafe { transmute(0x60fbu32) }), 0x583d => Some(unsafe { transmute(0x60f1u32) }), 0x583e => Some(unsafe { transmute(0x610du32) }), 0x583f => Some(unsafe { transmute(0x610eu32) }), 0x5840 => Some(unsafe { transmute(0x6147u32) }), 0x5841 => Some(unsafe { transmute(0x613eu32) }), 0x5842 => Some(unsafe { transmute(0x6128u32) }), 0x5843 => Some(unsafe { transmute(0x6127u32) }), 0x5844 => Some(unsafe { transmute(0x614au32) }), 0x5845 => Some(unsafe { transmute(0x613fu32) }), 0x5846 => Some(unsafe { transmute(0x613cu32) }), 0x5847 => Some(unsafe { transmute(0x612cu32) }), 0x5848 => Some(unsafe { transmute(0x6134u32) }), 0x5849 => Some(unsafe { transmute(0x613du32) }), 0x584a => Some(unsafe { transmute(0x6142u32) }), 0x584b => Some(unsafe { transmute(0x6144u32) }), 0x584c => Some(unsafe { transmute(0x6173u32) }), 0x584d => Some(unsafe { transmute(0x6177u32) }), 0x584e => Some(unsafe { transmute(0x6158u32) }), 0x584f => Some(unsafe { transmute(0x6159u32) }), 0x5850 => Some(unsafe { transmute(0x615au32) }), 0x5851 => Some(unsafe { transmute(0x616bu32) }), 0x5852 => Some(unsafe { transmute(0x6174u32) }), 0x5853 => Some(unsafe { transmute(0x616fu32) }), 0x5854 => Some(unsafe { transmute(0x6165u32) }), 0x5855 => Some(unsafe { transmute(0x6171u32) }), 0x5856 => Some(unsafe { transmute(0x615fu32) }), 0x5857 => Some(unsafe { transmute(0x615du32) }), 0x5858 => Some(unsafe { transmute(0x6153u32) }), 0x5859 => Some(unsafe { transmute(0x6175u32) }), 0x585a => Some(unsafe { transmute(0x6199u32) }), 0x585b => Some(unsafe { transmute(0x6196u32) }), 0x585c => Some(unsafe { transmute(0x6187u32) }), 0x585d => Some(unsafe { transmute(0x61acu32) }), 0x585e => Some(unsafe { transmute(0x6194u32) }), 0x585f => Some(unsafe { transmute(0x619au32) }), 0x5860 => Some(unsafe { transmute(0x618au32) }), 0x5861 => Some(unsafe { transmute(0x6191u32) }), 0x5862 => Some(unsafe { transmute(0x61abu32) }), 0x5863 => Some(unsafe { transmute(0x61aeu32) }), 0x5864 => Some(unsafe { transmute(0x61ccu32) }), 0x5865 => Some(unsafe { transmute(0x61cau32) }), 0x5866 => Some(unsafe { transmute(0x61c9u32) }), 0x5867 => Some(unsafe { transmute(0x61f7u32) }), 0x5868 => Some(unsafe { transmute(0x61c8u32) }), 0x5869 => Some(unsafe { transmute(0x61c3u32) }), 0x586a => Some(unsafe { transmute(0x61c6u32) }), 0x586b => Some(unsafe { transmute(0x61bau32) }), 0x586c => Some(unsafe { transmute(0x61cbu32) }), 0x586d => Some(unsafe { transmute(0x7f79u32) }), 0x586e => Some(unsafe { transmute(0x61cdu32) }), 0x586f => Some(unsafe { transmute(0x61e6u32) }), 0x5870 => Some(unsafe { transmute(0x61e3u32) }), 0x5871 => Some(unsafe { transmute(0x61f6u32) }), 0x5872 => Some(unsafe { transmute(0x61fau32) }), 0x5873 => Some(unsafe { transmute(0x61f4u32) }), 0x5874 => Some(unsafe { transmute(0x61ffu32) }), 0x5875 => Some(unsafe { transmute(0x61fdu32) }), 0x5876 => Some(unsafe { transmute(0x61fcu32) }), 0x5877 => Some(unsafe { transmute(0x61feu32) }), 0x5878 => Some(unsafe { transmute(0x6200u32) }), 0x5879 => Some(unsafe { transmute(0x6208u32) }), 0x587a => Some(unsafe { transmute(0x6209u32) }), 0x587b => Some(unsafe { transmute(0x620du32) }), 0x587c => Some(unsafe { transmute(0x620cu32) }), 0x587d => Some(unsafe { transmute(0x6214u32) }), 0x587e => Some(unsafe { transmute(0x621bu32) }), 0x5921 => Some(unsafe { transmute(0x621eu32) }), 0x5922 => Some(unsafe { transmute(0x6221u32) }), 0x5923 => Some(unsafe { transmute(0x622au32) }), 0x5924 => Some(unsafe { transmute(0x622eu32) }), 0x5925 => Some(unsafe { transmute(0x6230u32) }), 0x5926 => Some(unsafe { transmute(0x6232u32) }), 0x5927 => Some(unsafe { transmute(0x6233u32) }), 0x5928 => Some(unsafe { transmute(0x6241u32) }), 0x5929 => Some(unsafe { transmute(0x624eu32) }), 0x592a => Some(unsafe { transmute(0x625eu32) }), 0x592b => Some(unsafe { transmute(0x6263u32) }), 0x592c => Some(unsafe { transmute(0x625bu32) }), 0x592d => Some(unsafe { transmute(0x6260u32) }), 0x592e => Some(unsafe { transmute(0x6268u32) }), 0x592f => Some(unsafe { transmute(0x627cu32) }), 0x5930 => Some(unsafe { transmute(0x6282u32) }), 0x5931 => Some(unsafe { transmute(0x6289u32) }), 0x5932 => Some(unsafe { transmute(0x627eu32) }), 0x5933 => Some(unsafe { transmute(0x6292u32) }), 0x5934 => Some(unsafe { transmute(0x6293u32) }), 0x5935 => Some(unsafe { transmute(0x6296u32) }), 0x5936 => Some(unsafe { transmute(0x62d4u32) }), 0x5937 => Some(unsafe { transmute(0x6283u32) }), 0x5938 => Some(unsafe { transmute(0x6294u32) }), 0x5939 => Some(unsafe { transmute(0x62d7u32) }), 0x593a => Some(unsafe { transmute(0x62d1u32) }), 0x593b => Some(unsafe { transmute(0x62bbu32) }), 0x593c => Some(unsafe { transmute(0x62cfu32) }), 0x593d => Some(unsafe { transmute(0x62ffu32) }), 0x593e => Some(unsafe { transmute(0x62c6u32) }), 0x593f => Some(unsafe { transmute(0x64d4u32) }), 0x5940 => Some(unsafe { transmute(0x62c8u32) }), 0x5941 => Some(unsafe { transmute(0x62dcu32) }), 0x5942 => Some(unsafe { transmute(0x62ccu32) }), 0x5943 => Some(unsafe { transmute(0x62cau32) }), 0x5944 => Some(unsafe { transmute(0x62c2u32) }), 0x5945 => Some(unsafe { transmute(0x62c7u32) }), 0x5946 => Some(unsafe { transmute(0x629bu32) }), 0x5947 => Some(unsafe { transmute(0x62c9u32) }), 0x5948 => Some(unsafe { transmute(0x630cu32) }), 0x5949 => Some(unsafe { transmute(0x62eeu32) }), 0x594a => Some(unsafe { transmute(0x62f1u32) }), 0x594b => Some(unsafe { transmute(0x6327u32) }), 0x594c => Some(unsafe { transmute(0x6302u32) }), 0x594d => Some(unsafe { transmute(0x6308u32) }), 0x594e => Some(unsafe { transmute(0x62efu32) }), 0x594f => Some(unsafe { transmute(0x62f5u32) }), 0x5950 => Some(unsafe { transmute(0x6350u32) }), 0x5951 => Some(unsafe { transmute(0x633eu32) }), 0x5952 => Some(unsafe { transmute(0x634du32) }), 0x5953 => Some(unsafe { transmute(0x641cu32) }), 0x5954 => Some(unsafe { transmute(0x634fu32) }), 0x5955 => Some(unsafe { transmute(0x6396u32) }), 0x5956 => Some(unsafe { transmute(0x638eu32) }), 0x5957 => Some(unsafe { transmute(0x6380u32) }), 0x5958 => Some(unsafe { transmute(0x63abu32) }), 0x5959 => Some(unsafe { transmute(0x6376u32) }), 0x595a => Some(unsafe { transmute(0x63a3u32) }), 0x595b => Some(unsafe { transmute(0x638fu32) }), 0x595c => Some(unsafe { transmute(0x6389u32) }), 0x595d => Some(unsafe { transmute(0x639fu32) }), 0x595e => Some(unsafe { transmute(0x63b5u32) }), 0x595f => Some(unsafe { transmute(0x636bu32) }), 0x5960 => Some(unsafe { transmute(0x6369u32) }), 0x5961 => Some(unsafe { transmute(0x63beu32) }), 0x5962 => Some(unsafe { transmute(0x63e9u32) }), 0x5963 => Some(unsafe { transmute(0x63c0u32) }), 0x5964 => Some(unsafe { transmute(0x63c6u32) }), 0x5965 => Some(unsafe { transmute(0x63e3u32) }), 0x5966 => Some(unsafe { transmute(0x63c9u32) }), 0x5967 => Some(unsafe { transmute(0x63d2u32) }), 0x5968 => Some(unsafe { transmute(0x63f6u32) }), 0x5969 => Some(unsafe { transmute(0x63c4u32) }), 0x596a => Some(unsafe { transmute(0x6416u32) }), 0x596b => Some(unsafe { transmute(0x6434u32) }), 0x596c => Some(unsafe { transmute(0x6406u32) }), 0x596d => Some(unsafe { transmute(0x6413u32) }), 0x596e => Some(unsafe { transmute(0x6426u32) }), 0x596f => Some(unsafe { transmute(0x6436u32) }), 0x5970 => Some(unsafe { transmute(0x651du32) }), 0x5971 => Some(unsafe { transmute(0x6417u32) }), 0x5972 => Some(unsafe { transmute(0x6428u32) }), 0x5973 => Some(unsafe { transmute(0x640fu32) }), 0x5974 => Some(unsafe { transmute(0x6467u32) }), 0x5975 => Some(unsafe { transmute(0x646fu32) }), 0x5976 => Some(unsafe { transmute(0x6476u32) }), 0x5977 => Some(unsafe { transmute(0x644eu32) }), 0x5978 => Some(unsafe { transmute(0x652au32) }), 0x5979 => Some(unsafe { transmute(0x6495u32) }), 0x597a => Some(unsafe { transmute(0x6493u32) }), 0x597b => Some(unsafe { transmute(0x64a5u32) }), 0x597c => Some(unsafe { transmute(0x64a9u32) }), 0x597d => Some(unsafe { transmute(0x6488u32) }), 0x597e => Some(unsafe { transmute(0x64bcu32) }), 0x5a21 => Some(unsafe { transmute(0x64dau32) }), 0x5a22 => Some(unsafe { transmute(0x64d2u32) }), 0x5a23 => Some(unsafe { transmute(0x64c5u32) }), 0x5a24 => Some(unsafe { transmute(0x64c7u32) }), 0x5a25 => Some(unsafe { transmute(0x64bbu32) }), 0x5a26 => Some(unsafe { transmute(0x64d8u32) }), 0x5a27 => Some(unsafe { transmute(0x64c2u32) }), 0x5a28 => Some(unsafe { transmute(0x64f1u32) }), 0x5a29 => Some(unsafe { transmute(0x64e7u32) }), 0x5a2a => Some(unsafe { transmute(0x8209u32) }), 0x5a2b => Some(unsafe { transmute(0x64e0u32) }), 0x5a2c => Some(unsafe { transmute(0x64e1u32) }), 0x5a2d => Some(unsafe { transmute(0x62acu32) }), 0x5a2e => Some(unsafe { transmute(0x64e3u32) }), 0x5a2f => Some(unsafe { transmute(0x64efu32) }), 0x5a30 => Some(unsafe { transmute(0x652cu32) }), 0x5a31 => Some(unsafe { transmute(0x64f6u32) }), 0x5a32 => Some(unsafe { transmute(0x64f4u32) }), 0x5a33 => Some(unsafe { transmute(0x64f2u32) }), 0x5a34 => Some(unsafe { transmute(0x64fau32) }), 0x5a35 => Some(unsafe { transmute(0x6500u32) }), 0x5a36 => Some(unsafe { transmute(0x64fdu32) }), 0x5a37 => Some(unsafe { transmute(0x6518u32) }), 0x5a38 => Some(unsafe { transmute(0x651cu32) }), 0x5a39 => Some(unsafe { transmute(0x6505u32) }), 0x5a3a => Some(unsafe { transmute(0x6524u32) }), 0x5a3b => Some(unsafe { transmute(0x6523u32) }), 0x5a3c => Some(unsafe { transmute(0x652bu32) }), 0x5a3d => Some(unsafe { transmute(0x6534u32) }), 0x5a3e => Some(unsafe { transmute(0x6535u32) }), 0x5a3f => Some(unsafe { transmute(0x6537u32) }), 0x5a40 => Some(unsafe { transmute(0x6536u32) }), 0x5a41 => Some(unsafe { transmute(0x6538u32) }), 0x5a42 => Some(unsafe { transmute(0x754bu32) }), 0x5a43 => Some(unsafe { transmute(0x6548u32) }), 0x5a44 => Some(unsafe { transmute(0x6556u32) }), 0x5a45 => Some(unsafe { transmute(0x6555u32) }), 0x5a46 => Some(unsafe { transmute(0x654du32) }), 0x5a47 => Some(unsafe { transmute(0x6558u32) }), 0x5a48 => Some(unsafe { transmute(0x655eu32) }), 0x5a49 => Some(unsafe { transmute(0x655du32) }), 0x5a4a => Some(unsafe { transmute(0x6572u32) }), 0x5a4b => Some(unsafe { transmute(0x6578u32) }), 0x5a4c => Some(unsafe { transmute(0x6582u32) }), 0x5a4d => Some(unsafe { transmute(0x6583u32) }), 0x5a4e => Some(unsafe { transmute(0x8b8au32) }), 0x5a4f => Some(unsafe { transmute(0x659bu32) }), 0x5a50 => Some(unsafe { transmute(0x659fu32) }), 0x5a51 => Some(unsafe { transmute(0x65abu32) }), 0x5a52 => Some(unsafe { transmute(0x65b7u32) }), 0x5a53 => Some(unsafe { transmute(0x65c3u32) }), 0x5a54 => Some(unsafe { transmute(0x65c6u32) }), 0x5a55 => Some(unsafe { transmute(0x65c1u32) }), 0x5a56 => Some(unsafe { transmute(0x65c4u32) }), 0x5a57 => Some(unsafe { transmute(0x65ccu32) }), 0x5a58 => Some(unsafe { transmute(0x65d2u32) }), 0x5a59 => Some(unsafe { transmute(0x65dbu32) }), 0x5a5a => Some(unsafe { transmute(0x65d9u32) }), 0x5a5b => Some(unsafe { transmute(0x65e0u32) }), 0x5a5c => Some(unsafe { transmute(0x65e1u32) }), 0x5a5d => Some(unsafe { transmute(0x65f1u32) }), 0x5a5e => Some(unsafe { transmute(0x6772u32) }), 0x5a5f => Some(unsafe { transmute(0x660au32) }), 0x5a60 => Some(unsafe { transmute(0x6603u32) }), 0x5a61 => Some(unsafe { transmute(0x65fbu32) }), 0x5a62 => Some(unsafe { transmute(0x6773u32) }), 0x5a63 => Some(unsafe { transmute(0x6635u32) }), 0x5a64 => Some(unsafe { transmute(0x6636u32) }), 0x5a65 => Some(unsafe { transmute(0x6634u32) }), 0x5a66 => Some(unsafe { transmute(0x661cu32) }), 0x5a67 => Some(unsafe { transmute(0x664fu32) }), 0x5a68 => Some(unsafe { transmute(0x6644u32) }), 0x5a69 => Some(unsafe { transmute(0x6649u32) }), 0x5a6a => Some(unsafe { transmute(0x6641u32) }), 0x5a6b => Some(unsafe { transmute(0x665eu32) }), 0x5a6c => Some(unsafe { transmute(0x665du32) }), 0x5a6d => Some(unsafe { transmute(0x6664u32) }), 0x5a6e => Some(unsafe { transmute(0x6667u32) }), 0x5a6f => Some(unsafe { transmute(0x6668u32) }), 0x5a70 => Some(unsafe { transmute(0x665fu32) }), 0x5a71 => Some(unsafe { transmute(0x6662u32) }), 0x5a72 => Some(unsafe { transmute(0x6670u32) }), 0x5a73 => Some(unsafe { transmute(0x6683u32) }), 0x5a74 => Some(unsafe { transmute(0x6688u32) }), 0x5a75 => Some(unsafe { transmute(0x668eu32) }), 0x5a76 => Some(unsafe { transmute(0x6689u32) }), 0x5a77 => Some(unsafe { transmute(0x6684u32) }), 0x5a78 => Some(unsafe { transmute(0x6698u32) }), 0x5a79 => Some(unsafe { transmute(0x669du32) }), 0x5a7a => Some(unsafe { transmute(0x66c1u32) }), 0x5a7b => Some(unsafe { transmute(0x66b9u32) }), 0x5a7c => Some(unsafe { transmute(0x66c9u32) }), 0x5a7d => Some(unsafe { transmute(0x66beu32) }), 0x5a7e => Some(unsafe { transmute(0x66bcu32) }), 0x5b21 => Some(unsafe { transmute(0x66c4u32) }), 0x5b22 => Some(unsafe { transmute(0x66b8u32) }), 0x5b23 => Some(unsafe { transmute(0x66d6u32) }), 0x5b24 => Some(unsafe { transmute(0x66dau32) }), 0x5b25 => Some(unsafe { transmute(0x66e0u32) }), 0x5b26 => Some(unsafe { transmute(0x663fu32) }), 0x5b27 => Some(unsafe { transmute(0x66e6u32) }), 0x5b28 => Some(unsafe { transmute(0x66e9u32) }), 0x5b29 => Some(unsafe { transmute(0x66f0u32) }), 0x5b2a => Some(unsafe { transmute(0x66f5u32) }), 0x5b2b => Some(unsafe { transmute(0x66f7u32) }), 0x5b2c => Some(unsafe { transmute(0x670fu32) }), 0x5b2d => Some(unsafe { transmute(0x6716u32) }), 0x5b2e => Some(unsafe { transmute(0x671eu32) }), 0x5b2f => Some(unsafe { transmute(0x6726u32) }), 0x5b30 => Some(unsafe { transmute(0x6727u32) }), 0x5b31 => Some(unsafe { transmute(0x9738u32) }), 0x5b32 => Some(unsafe { transmute(0x672eu32) }), 0x5b33 => Some(unsafe { transmute(0x673fu32) }), 0x5b34 => Some(unsafe { transmute(0x6736u32) }), 0x5b35 => Some(unsafe { transmute(0x6741u32) }), 0x5b36 => Some(unsafe { transmute(0x6738u32) }), 0x5b37 => Some(unsafe { transmute(0x6737u32) }), 0x5b38 => Some(unsafe { transmute(0x6746u32) }), 0x5b39 => Some(unsafe { transmute(0x675eu32) }), 0x5b3a => Some(unsafe { transmute(0x6760u32) }), 0x5b3b => Some(unsafe { transmute(0x6759u32) }), 0x5b3c => Some(unsafe { transmute(0x6763u32) }), 0x5b3d => Some(unsafe { transmute(0x6764u32) }), 0x5b3e => Some(unsafe { transmute(0x6789u32) }), 0x5b3f => Some(unsafe { transmute(0x6770u32) }), 0x5b40 => Some(unsafe { transmute(0x67a9u32) }), 0x5b41 => Some(unsafe { transmute(0x677cu32) }), 0x5b42 => Some(unsafe { transmute(0x676au32) }), 0x5b43 => Some(unsafe { transmute(0x678cu32) }), 0x5b44 => Some(unsafe { transmute(0x678bu32) }), 0x5b45 => Some(unsafe { transmute(0x67a6u32) }), 0x5b46 => Some(unsafe { transmute(0x67a1u32) }), 0x5b47 => Some(unsafe { transmute(0x6785u32) }), 0x5b48 => Some(unsafe { transmute(0x67b7u32) }), 0x5b49 => Some(unsafe { transmute(0x67efu32) }), 0x5b4a => Some(unsafe { transmute(0x67b4u32) }), 0x5b4b => Some(unsafe { transmute(0x67ecu32) }), 0x5b4c => Some(unsafe { transmute(0x67b3u32) }), 0x5b4d => Some(unsafe { transmute(0x67e9u32) }), 0x5b4e => Some(unsafe { transmute(0x67b8u32) }), 0x5b4f => Some(unsafe { transmute(0x67e4u32) }), 0x5b50 => Some(unsafe { transmute(0x67deu32) }), 0x5b51 => Some(unsafe { transmute(0x67ddu32) }), 0x5b52 => Some(unsafe { transmute(0x67e2u32) }), 0x5b53 => Some(unsafe { transmute(0x67eeu32) }), 0x5b54 => Some(unsafe { transmute(0x67b9u32) }), 0x5b55 => Some(unsafe { transmute(0x67ceu32) }), 0x5b56 => Some(unsafe { transmute(0x67c6u32) }), 0x5b57 => Some(unsafe { transmute(0x67e7u32) }), 0x5b58 => Some(unsafe { transmute(0x6a9cu32) }), 0x5b59 => Some(unsafe { transmute(0x681eu32) }), 0x5b5a => Some(unsafe { transmute(0x6846u32) }), 0x5b5b => Some(unsafe { transmute(0x6829u32) }), 0x5b5c => Some(unsafe { transmute(0x6840u32) }), 0x5b5d => Some(unsafe { transmute(0x684du32) }), 0x5b5e => Some(unsafe { transmute(0x6832u32) }), 0x5b5f => Some(unsafe { transmute(0x684eu32) }), 0x5b60 => Some(unsafe { transmute(0x68b3u32) }), 0x5b61 => Some(unsafe { transmute(0x682bu32) }), 0x5b62 => Some(unsafe { transmute(0x6859u32) }), 0x5b63 => Some(unsafe { transmute(0x6863u32) }), 0x5b64 => Some(unsafe { transmute(0x6877u32) }), 0x5b65 => Some(unsafe { transmute(0x687fu32) }), 0x5b66 => Some(unsafe { transmute(0x689fu32) }), 0x5b67 => Some(unsafe { transmute(0x688fu32) }), 0x5b68 => Some(unsafe { transmute(0x68adu32) }), 0x5b69 => Some(unsafe { transmute(0x6894u32) }), 0x5b6a => Some(unsafe { transmute(0x689du32) }), 0x5b6b => Some(unsafe { transmute(0x689bu32) }), 0x5b6c => Some(unsafe { transmute(0x6883u32) }), 0x5b6d => Some(unsafe { transmute(0x6aaeu32) }), 0x5b6e => Some(unsafe { transmute(0x68b9u32) }), 0x5b6f => Some(unsafe { transmute(0x6874u32) }), 0x5b70 => Some(unsafe { transmute(0x68b5u32) }), 0x5b71 => Some(unsafe { transmute(0x68a0u32) }), 0x5b72 => Some(unsafe { transmute(0x68bau32) }), 0x5b73 => Some(unsafe { transmute(0x690fu32) }), 0x5b74 => Some(unsafe { transmute(0x688du32) }), 0x5b75 => Some(unsafe { transmute(0x687eu32) }), 0x5b76 => Some(unsafe { transmute(0x6901u32) }), 0x5b77 => Some(unsafe { transmute(0x68cau32) }), 0x5b78 => Some(unsafe { transmute(0x6908u32) }), 0x5b79 => Some(unsafe { transmute(0x68d8u32) }), 0x5b7a => Some(unsafe { transmute(0x6922u32) }), 0x5b7b => Some(unsafe { transmute(0x6926u32) }), 0x5b7c => Some(unsafe { transmute(0x68e1u32) }), 0x5b7d => Some(unsafe { transmute(0x690cu32) }), 0x5b7e => Some(unsafe { transmute(0x68cdu32) }), 0x5c21 => Some(unsafe { transmute(0x68d4u32) }), 0x5c22 => Some(unsafe { transmute(0x68e7u32) }), 0x5c23 => Some(unsafe { transmute(0x68d5u32) }), 0x5c24 => Some(unsafe { transmute(0x6936u32) }), 0x5c25 => Some(unsafe { transmute(0x6912u32) }), 0x5c26 => Some(unsafe { transmute(0x6904u32) }), 0x5c27 => Some(unsafe { transmute(0x68d7u32) }), 0x5c28 => Some(unsafe { transmute(0x68e3u32) }), 0x5c29 => Some(unsafe { transmute(0x6925u32) }), 0x5c2a => Some(unsafe { transmute(0x68f9u32) }), 0x5c2b => Some(unsafe { transmute(0x68e0u32) }), 0x5c2c => Some(unsafe { transmute(0x68efu32) }), 0x5c2d => Some(unsafe { transmute(0x6928u32) }), 0x5c2e => Some(unsafe { transmute(0x692au32) }), 0x5c2f => Some(unsafe { transmute(0x691au32) }), 0x5c30 => Some(unsafe { transmute(0x6923u32) }), 0x5c31 => Some(unsafe { transmute(0x6921u32) }), 0x5c32 => Some(unsafe { transmute(0x68c6u32) }), 0x5c33 => Some(unsafe { transmute(0x6979u32) }), 0x5c34 => Some(unsafe { transmute(0x6977u32) }), 0x5c35 => Some(unsafe { transmute(0x695cu32) }), 0x5c36 => Some(unsafe { transmute(0x6978u32) }), 0x5c37 => Some(unsafe { transmute(0x696bu32) }), 0x5c38 => Some(unsafe { transmute(0x6954u32) }), 0x5c39 => Some(unsafe { transmute(0x697eu32) }), 0x5c3a => Some(unsafe { transmute(0x696eu32) }), 0x5c3b => Some(unsafe { transmute(0x6939u32) }), 0x5c3c => Some(unsafe { transmute(0x6974u32) }), 0x5c3d => Some(unsafe { transmute(0x693du32) }), 0x5c3e => Some(unsafe { transmute(0x6959u32) }), 0x5c3f => Some(unsafe { transmute(0x6930u32) }), 0x5c40 => Some(unsafe { transmute(0x6961u32) }), 0x5c41 => Some(unsafe { transmute(0x695eu32) }), 0x5c42 => Some(unsafe { transmute(0x695du32) }), 0x5c43 => Some(unsafe { transmute(0x6981u32) }), 0x5c44 => Some(unsafe { transmute(0x696au32) }), 0x5c45 => Some(unsafe { transmute(0x69b2u32) }), 0x5c46 => Some(unsafe { transmute(0x69aeu32) }), 0x5c47 => Some(unsafe { transmute(0x69d0u32) }), 0x5c48 => Some(unsafe { transmute(0x69bfu32) }), 0x5c49 => Some(unsafe { transmute(0x69c1u32) }), 0x5c4a => Some(unsafe { transmute(0x69d3u32) }), 0x5c4b => Some(unsafe { transmute(0x69beu32) }), 0x5c4c => Some(unsafe { transmute(0x69ceu32) }), 0x5c4d => Some(unsafe { transmute(0x5be8u32) }), 0x5c4e => Some(unsafe { transmute(0x69cau32) }), 0x5c4f => Some(unsafe { transmute(0x69ddu32) }), 0x5c50 => Some(unsafe { transmute(0x69bbu32) }), 0x5c51 => Some(unsafe { transmute(0x69c3u32) }), 0x5c52 => Some(unsafe { transmute(0x69a7u32) }), 0x5c53 => Some(unsafe { transmute(0x6a2eu32) }), 0x5c54 => Some(unsafe { transmute(0x6991u32) }), 0x5c55 => Some(unsafe { transmute(0x69a0u32) }), 0x5c56 => Some(unsafe { transmute(0x699cu32) }), 0x5c57 => Some(unsafe { transmute(0x6995u32) }), 0x5c58 => Some(unsafe { transmute(0x69b4u32) }), 0x5c59 => Some(unsafe { transmute(0x69deu32) }), 0x5c5a => Some(unsafe { transmute(0x69e8u32) }), 0x5c5b => Some(unsafe { transmute(0x6a02u32) }), 0x5c5c => Some(unsafe { transmute(0x6a1bu32) }), 0x5c5d => Some(unsafe { transmute(0x69ffu32) }), 0x5c5e => Some(unsafe { transmute(0x6b0au32) }), 0x5c5f => Some(unsafe { transmute(0x69f9u32) }), 0x5c60 => Some(unsafe { transmute(0x69f2u32) }), 0x5c61 => Some(unsafe { transmute(0x69e7u32) }), 0x5c62 => Some(unsafe { transmute(0x6a05u32) }), 0x5c63 => Some(unsafe { transmute(0x69b1u32) }), 0x5c64 => Some(unsafe { transmute(0x6a1eu32) }), 0x5c65 => Some(unsafe { transmute(0x69edu32) }), 0x5c66 => Some(unsafe { transmute(0x6a14u32) }), 0x5c67 => Some(unsafe { transmute(0x69ebu32) }), 0x5c68 => Some(unsafe { transmute(0x6a0au32) }), 0x5c69 => Some(unsafe { transmute(0x6a12u32) }), 0x5c6a => Some(unsafe { transmute(0x6ac1u32) }), 0x5c6b => Some(unsafe { transmute(0x6a23u32) }), 0x5c6c => Some(unsafe { transmute(0x6a13u32) }), 0x5c6d => Some(unsafe { transmute(0x6a44u32) }), 0x5c6e => Some(unsafe { transmute(0x6a0cu32) }), 0x5c6f => Some(unsafe { transmute(0x6a72u32) }), 0x5c70 => Some(unsafe { transmute(0x6a36u32) }), 0x5c71 => Some(unsafe { transmute(0x6a78u32) }), 0x5c72 => Some(unsafe { transmute(0x6a47u32) }), 0x5c73 => Some(unsafe { transmute(0x6a62u32) }), 0x5c74 => Some(unsafe { transmute(0x6a59u32) }), 0x5c75 => Some(unsafe { transmute(0x6a66u32) }), 0x5c76 => Some(unsafe { transmute(0x6a48u32) }), 0x5c77 => Some(unsafe { transmute(0x6a38u32) }), 0x5c78 => Some(unsafe { transmute(0x6a22u32) }), 0x5c79 => Some(unsafe { transmute(0x6a90u32) }), 0x5c7a => Some(unsafe { transmute(0x6a8du32) }), 0x5c7b => Some(unsafe { transmute(0x6aa0u32) }), 0x5c7c => Some(unsafe { transmute(0x6a84u32) }), 0x5c7d => Some(unsafe { transmute(0x6aa2u32) }), 0x5c7e => Some(unsafe { transmute(0x6aa3u32) }), 0x5d21 => Some(unsafe { transmute(0x6a97u32) }), 0x5d22 => Some(unsafe { transmute(0x8617u32) }), 0x5d23 => Some(unsafe { transmute(0x6abbu32) }), 0x5d24 => Some(unsafe { transmute(0x6ac3u32) }), 0x5d25 => Some(unsafe { transmute(0x6ac2u32) }), 0x5d26 => Some(unsafe { transmute(0x6ab8u32) }), 0x5d27 => Some(unsafe { transmute(0x6ab3u32) }), 0x5d28 => Some(unsafe { transmute(0x6aacu32) }), 0x5d29 => Some(unsafe { transmute(0x6adeu32) }), 0x5d2a => Some(unsafe { transmute(0x6ad1u32) }), 0x5d2b => Some(unsafe { transmute(0x6adfu32) }), 0x5d2c => Some(unsafe { transmute(0x6aaau32) }), 0x5d2d => Some(unsafe { transmute(0x6adau32) }), 0x5d2e => Some(unsafe { transmute(0x6aeau32) }), 0x5d2f => Some(unsafe { transmute(0x6afbu32) }), 0x5d30 => Some(unsafe { transmute(0x6b05u32) }), 0x5d31 => Some(unsafe { transmute(0x8616u32) }), 0x5d32 => Some(unsafe { transmute(0x6afau32) }), 0x5d33 => Some(unsafe { transmute(0x6b12u32) }), 0x5d34 => Some(unsafe { transmute(0x6b16u32) }), 0x5d35 => Some(unsafe { transmute(0x9b31u32) }), 0x5d36 => Some(unsafe { transmute(0x6b1fu32) }), 0x5d37 => Some(unsafe { transmute(0x6b38u32) }), 0x5d38 => Some(unsafe { transmute(0x6b37u32) }), 0x5d39 => Some(unsafe { transmute(0x76dcu32) }), 0x5d3a => Some(unsafe { transmute(0x6b39u32) }), 0x5d3b => Some(unsafe { transmute(0x98eeu32) }), 0x5d3c => Some(unsafe { transmute(0x6b47u32) }), 0x5d3d => Some(unsafe { transmute(0x6b43u32) }), 0x5d3e => Some(unsafe { transmute(0x6b49u32) }), 0x5d3f => Some(unsafe { transmute(0x6b50u32) }), 0x5d40 => Some(unsafe { transmute(0x6b59u32) }), 0x5d41 => Some(unsafe { transmute(0x6b54u32) }), 0x5d42 => Some(unsafe { transmute(0x6b5bu32) }), 0x5d43 => Some(unsafe { transmute(0x6b5fu32) }), 0x5d44 => Some(unsafe { transmute(0x6b61u32) }), 0x5d45 => Some(unsafe { transmute(0x6b78u32) }), 0x5d46 => Some(unsafe { transmute(0x6b79u32) }), 0x5d47 => Some(unsafe { transmute(0x6b7fu32) }), 0x5d48 => Some(unsafe { transmute(0x6b80u32) }), 0x5d49 => Some(unsafe { transmute(0x6b84u32) }), 0x5d4a => Some(unsafe { transmute(0x6b83u32) }), 0x5d4b => Some(unsafe { transmute(0x6b8du32) }), 0x5d4c => Some(unsafe { transmute(0x6b98u32) }), 0x5d4d => Some(unsafe { transmute(0x6b95u32) }), 0x5d4e => Some(unsafe { transmute(0x6b9eu32) }), 0x5d4f => Some(unsafe { transmute(0x6ba4u32) }), 0x5d50 => Some(unsafe { transmute(0x6baau32) }), 0x5d51 => Some(unsafe { transmute(0x6babu32) }), 0x5d52 => Some(unsafe { transmute(0x6bafu32) }), 0x5d53 => Some(unsafe { transmute(0x6bb2u32) }), 0x5d54 => Some(unsafe { transmute(0x6bb1u32) }), 0x5d55 => Some(unsafe { transmute(0x6bb3u32) }), 0x5d56 => Some(unsafe { transmute(0x6bb7u32) }), 0x5d57 => Some(unsafe { transmute(0x6bbcu32) }), 0x5d58 => Some(unsafe { transmute(0x6bc6u32) }), 0x5d59 => Some(unsafe { transmute(0x6bcbu32) }), 0x5d5a => Some(unsafe { transmute(0x6bd3u32) }), 0x5d5b => Some(unsafe { transmute(0x6bdfu32) }), 0x5d5c => Some(unsafe { transmute(0x6becu32) }), 0x5d5d => Some(unsafe { transmute(0x6bebu32) }), 0x5d5e => Some(unsafe { transmute(0x6bf3u32) }), 0x5d5f => Some(unsafe { transmute(0x6befu32) }), 0x5d60 => Some(unsafe { transmute(0x9ebeu32) }), 0x5d61 => Some(unsafe { transmute(0x6c08u32) }), 0x5d62 => Some(unsafe { transmute(0x6c13u32) }), 0x5d63 => Some(unsafe { transmute(0x6c14u32) }), 0x5d64 => Some(unsafe { transmute(0x6c1bu32) }), 0x5d65 => Some(unsafe { transmute(0x6c24u32) }), 0x5d66 => Some(unsafe { transmute(0x6c23u32) }), 0x5d67 => Some(unsafe { transmute(0x6c5eu32) }), 0x5d68 => Some(unsafe { transmute(0x6c55u32) }), 0x5d69 => Some(unsafe { transmute(0x6c62u32) }), 0x5d6a => Some(unsafe { transmute(0x6c6au32) }), 0x5d6b => Some(unsafe { transmute(0x6c82u32) }), 0x5d6c => Some(unsafe { transmute(0x6c8du32) }), 0x5d6d => Some(unsafe { transmute(0x6c9au32) }), 0x5d6e => Some(unsafe { transmute(0x6c81u32) }), 0x5d6f => Some(unsafe { transmute(0x6c9bu32) }), 0x5d70 => Some(unsafe { transmute(0x6c7eu32) }), 0x5d71 => Some(unsafe { transmute(0x6c68u32) }), 0x5d72 => Some(unsafe { transmute(0x6c73u32) }), 0x5d73 => Some(unsafe { transmute(0x6c92u32) }), 0x5d74 => Some(unsafe { transmute(0x6c90u32) }), 0x5d75 => Some(unsafe { transmute(0x6cc4u32) }), 0x5d76 => Some(unsafe { transmute(0x6cf1u32) }), 0x5d77 => Some(unsafe { transmute(0x6cd3u32) }), 0x5d78 => Some(unsafe { transmute(0x6cbdu32) }), 0x5d79 => Some(unsafe { transmute(0x6cd7u32) }), 0x5d7a => Some(unsafe { transmute(0x6cc5u32) }), 0x5d7b => Some(unsafe { transmute(0x6cddu32) }), 0x5d7c => Some(unsafe { transmute(0x6caeu32) }), 0x5d7d => Some(unsafe { transmute(0x6cb1u32) }), 0x5d7e => Some(unsafe { transmute(0x6cbeu32) }), 0x5e21 => Some(unsafe { transmute(0x6cbau32) }), 0x5e22 => Some(unsafe { transmute(0x6cdbu32) }), 0x5e23 => Some(unsafe { transmute(0x6cefu32) }), 0x5e24 => Some(unsafe { transmute(0x6cd9u32) }), 0x5e25 => Some(unsafe { transmute(0x6ceau32) }), 0x5e26 => Some(unsafe { transmute(0x6d1fu32) }), 0x5e27 => Some(unsafe { transmute(0x884du32) }), 0x5e28 => Some(unsafe { transmute(0x6d36u32) }), 0x5e29 => Some(unsafe { transmute(0x6d2bu32) }), 0x5e2a => Some(unsafe { transmute(0x6d3du32) }), 0x5e2b => Some(unsafe { transmute(0x6d38u32) }), 0x5e2c => Some(unsafe { transmute(0x6d19u32) }), 0x5e2d => Some(unsafe { transmute(0x6d35u32) }), 0x5e2e => Some(unsafe { transmute(0x6d33u32) }), 0x5e2f => Some(unsafe { transmute(0x6d12u32) }), 0x5e30 => Some(unsafe { transmute(0x6d0cu32) }), 0x5e31 => Some(unsafe { transmute(0x6d63u32) }), 0x5e32 => Some(unsafe { transmute(0x6d93u32) }), 0x5e33 => Some(unsafe { transmute(0x6d64u32) }), 0x5e34 => Some(unsafe { transmute(0x6d5au32) }), 0x5e35 => Some(unsafe { transmute(0x6d79u32) }), 0x5e36 => Some(unsafe { transmute(0x6d59u32) }), 0x5e37 => Some(unsafe { transmute(0x6d8eu32) }), 0x5e38 => Some(unsafe { transmute(0x6d95u32) }), 0x5e39 => Some(unsafe { transmute(0x6fe4u32) }), 0x5e3a => Some(unsafe { transmute(0x6d85u32) }), 0x5e3b => Some(unsafe { transmute(0x6df9u32) }), 0x5e3c => Some(unsafe { transmute(0x6e15u32) }), 0x5e3d => Some(unsafe { transmute(0x6e0au32) }), 0x5e3e => Some(unsafe { transmute(0x6db5u32) }), 0x5e3f => Some(unsafe { transmute(0x6dc7u32) }), 0x5e40 => Some(unsafe { transmute(0x6de6u32) }), 0x5e41 => Some(unsafe { transmute(0x6db8u32) }), 0x5e42 => Some(unsafe { transmute(0x6dc6u32) }), 0x5e43 => Some(unsafe { transmute(0x6decu32) }), 0x5e44 => Some(unsafe { transmute(0x6ddeu32) }), 0x5e45 => Some(unsafe { transmute(0x6dccu32) }), 0x5e46 => Some(unsafe { transmute(0x6de8u32) }), 0x5e47 => Some(unsafe { transmute(0x6dd2u32) }), 0x5e48 => Some(unsafe { transmute(0x6dc5u32) }), 0x5e49 => Some(unsafe { transmute(0x6dfau32) }), 0x5e4a => Some(unsafe { transmute(0x6dd9u32) }), 0x5e4b => Some(unsafe { transmute(0x6de4u32) }), 0x5e4c => Some(unsafe { transmute(0x6dd5u32) }), 0x5e4d => Some(unsafe { transmute(0x6deau32) }), 0x5e4e => Some(unsafe { transmute(0x6deeu32) }), 0x5e4f => Some(unsafe { transmute(0x6e2du32) }), 0x5e50 => Some(unsafe { transmute(0x6e6eu32) }), 0x5e51 => Some(unsafe { transmute(0x6e2eu32) }), 0x5e52 => Some(unsafe { transmute(0x6e19u32) }), 0x5e53 => Some(unsafe { transmute(0x6e72u32) }), 0x5e54 => Some(unsafe { transmute(0x6e5fu32) }), 0x5e55 => Some(unsafe { transmute(0x6e3eu32) }), 0x5e56 => Some(unsafe { transmute(0x6e23u32) }), 0x5e57 => Some(unsafe { transmute(0x6e6bu32) }), 0x5e58 => Some(unsafe { transmute(0x6e2bu32) }), 0x5e59 => Some(unsafe { transmute(0x6e76u32) }), 0x5e5a => Some(unsafe { transmute(0x6e4du32) }), 0x5e5b => Some(unsafe { transmute(0x6e1fu32) }), 0x5e5c => Some(unsafe { transmute(0x6e43u32) }), 0x5e5d => Some(unsafe { transmute(0x6e3au32) }), 0x5e5e => Some(unsafe { transmute(0x6e4eu32) }), 0x5e5f => Some(unsafe { transmute(0x6e24u32) }), 0x5e60 => Some(unsafe { transmute(0x6effu32) }), 0x5e61 => Some(unsafe { transmute(0x6e1du32) }), 0x5e62 => Some(unsafe { transmute(0x6e38u32) }), 0x5e63 => Some(unsafe { transmute(0x6e82u32) }), 0x5e64 => Some(unsafe { transmute(0x6eaau32) }), 0x5e65 => Some(unsafe { transmute(0x6e98u32) }), 0x5e66 => Some(unsafe { transmute(0x6ec9u32) }), 0x5e67 => Some(unsafe { transmute(0x6eb7u32) }), 0x5e68 => Some(unsafe { transmute(0x6ed3u32) }), 0x5e69 => Some(unsafe { transmute(0x6ebdu32) }), 0x5e6a => Some(unsafe { transmute(0x6eafu32) }), 0x5e6b => Some(unsafe { transmute(0x6ec4u32) }), 0x5e6c => Some(unsafe { transmute(0x6eb2u32) }), 0x5e6d => Some(unsafe { transmute(0x6ed4u32) }), 0x5e6e => Some(unsafe { transmute(0x6ed5u32) }), 0x5e6f => Some(unsafe { transmute(0x6e8fu32) }), 0x5e70 => Some(unsafe { transmute(0x6ea5u32) }), 0x5e71 => Some(unsafe { transmute(0x6ec2u32) }), 0x5e72 => Some(unsafe { transmute(0x6e9fu32) }), 0x5e73 => Some(unsafe { transmute(0x6f41u32) }), 0x5e74 => Some(unsafe { transmute(0x6f11u32) }), 0x5e75 => Some(unsafe { transmute(0x704cu32) }), 0x5e76 => Some(unsafe { transmute(0x6eecu32) }), 0x5e77 => Some(unsafe { transmute(0x6ef8u32) }), 0x5e78 => Some(unsafe { transmute(0x6efeu32) }), 0x5e79 => Some(unsafe { transmute(0x6f3fu32) }), 0x5e7a => Some(unsafe { transmute(0x6ef2u32) }), 0x5e7b => Some(unsafe { transmute(0x6f31u32) }), 0x5e7c => Some(unsafe { transmute(0x6eefu32) }), 0x5e7d => Some(unsafe { transmute(0x6f32u32) }), 0x5e7e => Some(unsafe { transmute(0x6eccu32) }), 0x5f21 => Some(unsafe { transmute(0x6f3eu32) }), 0x5f22 => Some(unsafe { transmute(0x6f13u32) }), 0x5f23 => Some(unsafe { transmute(0x6ef7u32) }), 0x5f24 => Some(unsafe { transmute(0x6f86u32) }), 0x5f25 => Some(unsafe { transmute(0x6f7au32) }), 0x5f26 => Some(unsafe { transmute(0x6f78u32) }), 0x5f27 => Some(unsafe { transmute(0x6f81u32) }), 0x5f28 => Some(unsafe { transmute(0x6f80u32) }), 0x5f29 => Some(unsafe { transmute(0x6f6fu32) }), 0x5f2a => Some(unsafe { transmute(0x6f5bu32) }), 0x5f2b => Some(unsafe { transmute(0x6ff3u32) }), 0x5f2c => Some(unsafe { transmute(0x6f6du32) }), 0x5f2d => Some(unsafe { transmute(0x6f82u32) }), 0x5f2e => Some(unsafe { transmute(0x6f7cu32) }), 0x5f2f => Some(unsafe { transmute(0x6f58u32) }), 0x5f30 => Some(unsafe { transmute(0x6f8eu32) }), 0x5f31 => Some(unsafe { transmute(0x6f91u32) }), 0x5f32 => Some(unsafe { transmute(0x6fc2u32) }), 0x5f33 => Some(unsafe { transmute(0x6f66u32) }), 0x5f34 => Some(unsafe { transmute(0x6fb3u32) }), 0x5f35 => Some(unsafe { transmute(0x6fa3u32) }), 0x5f36 => Some(unsafe { transmute(0x6fa1u32) }), 0x5f37 => Some(unsafe { transmute(0x6fa4u32) }), 0x5f38 => Some(unsafe { transmute(0x6fb9u32) }), 0x5f39 => Some(unsafe { transmute(0x6fc6u32) }), 0x5f3a => Some(unsafe { transmute(0x6faau32) }), 0x5f3b => Some(unsafe { transmute(0x6fdfu32) }), 0x5f3c => Some(unsafe { transmute(0x6fd5u32) }), 0x5f3d => Some(unsafe { transmute(0x6fecu32) }), 0x5f3e => Some(unsafe { transmute(0x6fd4u32) }), 0x5f3f => Some(unsafe { transmute(0x6fd8u32) }), 0x5f40 => Some(unsafe { transmute(0x6ff1u32) }), 0x5f41 => Some(unsafe { transmute(0x6feeu32) }), 0x5f42 => Some(unsafe { transmute(0x6fdbu32) }), 0x5f43 => Some(unsafe { transmute(0x7009u32) }), 0x5f44 => Some(unsafe { transmute(0x700bu32) }), 0x5f45 => Some(unsafe { transmute(0x6ffau32) }), 0x5f46 => Some(unsafe { transmute(0x7011u32) }), 0x5f47 => Some(unsafe { transmute(0x7001u32) }), 0x5f48 => Some(unsafe { transmute(0x700fu32) }), 0x5f49 => Some(unsafe { transmute(0x6ffeu32) }), 0x5f4a => Some(unsafe { transmute(0x701bu32) }), 0x5f4b => Some(unsafe { transmute(0x701au32) }), 0x5f4c => Some(unsafe { transmute(0x6f74u32) }), 0x5f4d => Some(unsafe { transmute(0x701du32) }), 0x5f4e => Some(unsafe { transmute(0x7018u32) }), 0x5f4f => Some(unsafe { transmute(0x701fu32) }), 0x5f50 => Some(unsafe { transmute(0x7030u32) }), 0x5f51 => Some(unsafe { transmute(0x703eu32) }), 0x5f52 => Some(unsafe { transmute(0x7032u32) }), 0x5f53 => Some(unsafe { transmute(0x7051u32) }), 0x5f54 => Some(unsafe { transmute(0x7063u32) }), 0x5f55 => Some(unsafe { transmute(0x7099u32) }), 0x5f56 => Some(unsafe { transmute(0x7092u32) }), 0x5f57 => Some(unsafe { transmute(0x70afu32) }), 0x5f58 => Some(unsafe { transmute(0x70f1u32) }), 0x5f59 => Some(unsafe { transmute(0x70acu32) }), 0x5f5a => Some(unsafe { transmute(0x70b8u32) }), 0x5f5b => Some(unsafe { transmute(0x70b3u32) }), 0x5f5c => Some(unsafe { transmute(0x70aeu32) }), 0x5f5d => Some(unsafe { transmute(0x70dfu32) }), 0x5f5e => Some(unsafe { transmute(0x70cbu32) }), 0x5f5f => Some(unsafe { transmute(0x70ddu32) }), 0x5f60 => Some(unsafe { transmute(0x70d9u32) }), 0x5f61 => Some(unsafe { transmute(0x7109u32) }), 0x5f62 => Some(unsafe { transmute(0x70fdu32) }), 0x5f63 => Some(unsafe { transmute(0x711cu32) }), 0x5f64 => Some(unsafe { transmute(0x7119u32) }), 0x5f65 => Some(unsafe { transmute(0x7165u32) }), 0x5f66 => Some(unsafe { transmute(0x7155u32) }), 0x5f67 => Some(unsafe { transmute(0x7188u32) }), 0x5f68 => Some(unsafe { transmute(0x7166u32) }), 0x5f69 => Some(unsafe { transmute(0x7162u32) }), 0x5f6a => Some(unsafe { transmute(0x714cu32) }), 0x5f6b => Some(unsafe { transmute(0x7156u32) }), 0x5f6c => Some(unsafe { transmute(0x716cu32) }), 0x5f6d => Some(unsafe { transmute(0x718fu32) }), 0x5f6e => Some(unsafe { transmute(0x71fbu32) }), 0x5f6f => Some(unsafe { transmute(0x7184u32) }), 0x5f70 => Some(unsafe { transmute(0x7195u32) }), 0x5f71 => Some(unsafe { transmute(0x71a8u32) }), 0x5f72 => Some(unsafe { transmute(0x71acu32) }), 0x5f73 => Some(unsafe { transmute(0x71d7u32) }), 0x5f74 => Some(unsafe { transmute(0x71b9u32) }), 0x5f75 => Some(unsafe { transmute(0x71beu32) }), 0x5f76 => Some(unsafe { transmute(0x71d2u32) }), 0x5f77 => Some(unsafe { transmute(0x71c9u32) }), 0x5f78 => Some(unsafe { transmute(0x71d4u32) }), 0x5f79 => Some(unsafe { transmute(0x71ceu32) }), 0x5f7a => Some(unsafe { transmute(0x71e0u32) }), 0x5f7b => Some(unsafe { transmute(0x71ecu32) }), 0x5f7c => Some(unsafe { transmute(0x71e7u32) }), 0x5f7d => Some(unsafe { transmute(0x71f5u32) }), 0x5f7e => Some(unsafe { transmute(0x71fcu32) }), 0x6021 => Some(unsafe { transmute(0x71f9u32) }), 0x6022 => Some(unsafe { transmute(0x71ffu32) }), 0x6023 => Some(unsafe { transmute(0x720du32) }), 0x6024 => Some(unsafe { transmute(0x7210u32) }), 0x6025 => Some(unsafe { transmute(0x721bu32) }), 0x6026 => Some(unsafe { transmute(0x7228u32) }), 0x6027 => Some(unsafe { transmute(0x722du32) }), 0x6028 => Some(unsafe { transmute(0x722cu32) }), 0x6029 => Some(unsafe { transmute(0x7230u32) }), 0x602a => Some(unsafe { transmute(0x7232u32) }), 0x602b => Some(unsafe { transmute(0x723bu32) }), 0x602c => Some(unsafe { transmute(0x723cu32) }), 0x602d => Some(unsafe { transmute(0x723fu32) }), 0x602e => Some(unsafe { transmute(0x7240u32) }), 0x602f => Some(unsafe { transmute(0x7246u32) }), 0x6030 => Some(unsafe { transmute(0x724bu32) }), 0x6031 => Some(unsafe { transmute(0x7258u32) }), 0x6032 => Some(unsafe { transmute(0x7274u32) }), 0x6033 => Some(unsafe { transmute(0x727eu32) }), 0x6034 => Some(unsafe { transmute(0x7282u32) }), 0x6035 => Some(unsafe { transmute(0x7281u32) }), 0x6036 => Some(unsafe { transmute(0x7287u32) }), 0x6037 => Some(unsafe { transmute(0x7292u32) }), 0x6038 => Some(unsafe { transmute(0x7296u32) }), 0x6039 => Some(unsafe { transmute(0x72a2u32) }), 0x603a => Some(unsafe { transmute(0x72a7u32) }), 0x603b => Some(unsafe { transmute(0x72b9u32) }), 0x603c => Some(unsafe { transmute(0x72b2u32) }), 0x603d => Some(unsafe { transmute(0x72c3u32) }), 0x603e => Some(unsafe { transmute(0x72c6u32) }), 0x603f => Some(unsafe { transmute(0x72c4u32) }), 0x6040 => Some(unsafe { transmute(0x72ceu32) }), 0x6041 => Some(unsafe { transmute(0x72d2u32) }), 0x6042 => Some(unsafe { transmute(0x72e2u32) }), 0x6043 => Some(unsafe { transmute(0x72e0u32) }), 0x6044 => Some(unsafe { transmute(0x72e1u32) }), 0x6045 => Some(unsafe { transmute(0x72f9u32) }), 0x6046 => Some(unsafe { transmute(0x72f7u32) }), 0x6047 => Some(unsafe { transmute(0x500fu32) }), 0x6048 => Some(unsafe { transmute(0x7317u32) }), 0x6049 => Some(unsafe { transmute(0x730au32) }), 0x604a => Some(unsafe { transmute(0x731cu32) }), 0x604b => Some(unsafe { transmute(0x7316u32) }), 0x604c => Some(unsafe { transmute(0x731du32) }), 0x604d => Some(unsafe { transmute(0x7334u32) }), 0x604e => Some(unsafe { transmute(0x732fu32) }), 0x604f => Some(unsafe { transmute(0x7329u32) }), 0x6050 => Some(unsafe { transmute(0x7325u32) }), 0x6051 => Some(unsafe { transmute(0x733eu32) }), 0x6052 => Some(unsafe { transmute(0x734eu32) }), 0x6053 => Some(unsafe { transmute(0x734fu32) }), 0x6054 => Some(unsafe { transmute(0x9ed8u32) }), 0x6055 => Some(unsafe { transmute(0x7357u32) }), 0x6056 => Some(unsafe { transmute(0x736au32) }), 0x6057 => Some(unsafe { transmute(0x7368u32) }), 0x6058 => Some(unsafe { transmute(0x7370u32) }), 0x6059 => Some(unsafe { transmute(0x7378u32) }), 0x605a => Some(unsafe { transmute(0x7375u32) }), 0x605b => Some(unsafe { transmute(0x737bu32) }), 0x605c => Some(unsafe { transmute(0x737au32) }), 0x605d => Some(unsafe { transmute(0x73c8u32) }), 0x605e => Some(unsafe { transmute(0x73b3u32) }), 0x605f => Some(unsafe { transmute(0x73ceu32) }), 0x6060 => Some(unsafe { transmute(0x73bbu32) }), 0x6061 => Some(unsafe { transmute(0x73c0u32) }), 0x6062 => Some(unsafe { transmute(0x73e5u32) }), 0x6063 => Some(unsafe { transmute(0x73eeu32) }), 0x6064 => Some(unsafe { transmute(0x73deu32) }), 0x6065 => Some(unsafe { transmute(0x74a2u32) }), 0x6066 => Some(unsafe { transmute(0x7405u32) }), 0x6067 => Some(unsafe { transmute(0x746fu32) }), 0x6068 => Some(unsafe { transmute(0x7425u32) }), 0x6069 => Some(unsafe { transmute(0x73f8u32) }), 0x606a => Some(unsafe { transmute(0x7432u32) }), 0x606b => Some(unsafe { transmute(0x743au32) }), 0x606c => Some(unsafe { transmute(0x7455u32) }), 0x606d => Some(unsafe { transmute(0x743fu32) }), 0x606e => Some(unsafe { transmute(0x745fu32) }), 0x606f => Some(unsafe { transmute(0x7459u32) }), 0x6070 => Some(unsafe { transmute(0x7441u32) }), 0x6071 => Some(unsafe { transmute(0x745cu32) }), 0x6072 => Some(unsafe { transmute(0x7469u32) }), 0x6073 => Some(unsafe { transmute(0x7470u32) }), 0x6074 => Some(unsafe { transmute(0x7463u32) }), 0x6075 => Some(unsafe { transmute(0x746au32) }), 0x6076 => Some(unsafe { transmute(0x7476u32) }), 0x6077 => Some(unsafe { transmute(0x747eu32) }), 0x6078 => Some(unsafe { transmute(0x748bu32) }), 0x6079 => Some(unsafe { transmute(0x749eu32) }), 0x607a => Some(unsafe { transmute(0x74a7u32) }), 0x607b => Some(unsafe { transmute(0x74cau32) }), 0x607c => Some(unsafe { transmute(0x74cfu32) }), 0x607d => Some(unsafe { transmute(0x74d4u32) }), 0x607e => Some(unsafe { transmute(0x73f1u32) }), 0x6121 => Some(unsafe { transmute(0x74e0u32) }), 0x6122 => Some(unsafe { transmute(0x74e3u32) }), 0x6123 => Some(unsafe { transmute(0x74e7u32) }), 0x6124 => Some(unsafe { transmute(0x74e9u32) }), 0x6125 => Some(unsafe { transmute(0x74eeu32) }), 0x6126 => Some(unsafe { transmute(0x74f2u32) }), 0x6127 => Some(unsafe { transmute(0x74f0u32) }), 0x6128 => Some(unsafe { transmute(0x74f1u32) }), 0x6129 => Some(unsafe { transmute(0x74f8u32) }), 0x612a => Some(unsafe { transmute(0x74f7u32) }), 0x612b => Some(unsafe { transmute(0x7504u32) }), 0x612c => Some(unsafe { transmute(0x7503u32) }), 0x612d => Some(unsafe { transmute(0x7505u32) }), 0x612e => Some(unsafe { transmute(0x750cu32) }), 0x612f => Some(unsafe { transmute(0x750eu32) }), 0x6130 => Some(unsafe { transmute(0x750du32) }), 0x6131 => Some(unsafe { transmute(0x7515u32) }), 0x6132 => Some(unsafe { transmute(0x7513u32) }), 0x6133 => Some(unsafe { transmute(0x751eu32) }), 0x6134 => Some(unsafe { transmute(0x7526u32) }), 0x6135 => Some(unsafe { transmute(0x752cu32) }), 0x6136 => Some(unsafe { transmute(0x753cu32) }), 0x6137 => Some(unsafe { transmute(0x7544u32) }), 0x6138 => Some(unsafe { transmute(0x754du32) }), 0x6139 => Some(unsafe { transmute(0x754au32) }), 0x613a => Some(unsafe { transmute(0x7549u32) }), 0x613b => Some(unsafe { transmute(0x755bu32) }), 0x613c => Some(unsafe { transmute(0x7546u32) }), 0x613d => Some(unsafe { transmute(0x755au32) }), 0x613e => Some(unsafe { transmute(0x7569u32) }), 0x613f => Some(unsafe { transmute(0x7564u32) }), 0x6140 => Some(unsafe { transmute(0x7567u32) }), 0x6141 => Some(unsafe { transmute(0x756bu32) }), 0x6142 => Some(unsafe { transmute(0x756du32) }), 0x6143 => Some(unsafe { transmute(0x7578u32) }), 0x6144 => Some(unsafe { transmute(0x7576u32) }), 0x6145 => Some(unsafe { transmute(0x7586u32) }), 0x6146 => Some(unsafe { transmute(0x7587u32) }), 0x6147 => Some(unsafe { transmute(0x7574u32) }), 0x6148 => Some(unsafe { transmute(0x758au32) }), 0x6149 => Some(unsafe { transmute(0x7589u32) }), 0x614a => Some(unsafe { transmute(0x7582u32) }), 0x614b => Some(unsafe { transmute(0x7594u32) }), 0x614c => Some(unsafe { transmute(0x759au32) }), 0x614d => Some(unsafe { transmute(0x759du32) }), 0x614e => Some(unsafe { transmute(0x75a5u32) }), 0x614f => Some(unsafe { transmute(0x75a3u32) }), 0x6150 => Some(unsafe { transmute(0x75c2u32) }), 0x6151 => Some(unsafe { transmute(0x75b3u32) }), 0x6152 => Some(unsafe { transmute(0x75c3u32) }), 0x6153 => Some(unsafe { transmute(0x75b5u32) }), 0x6154 => Some(unsafe { transmute(0x75bdu32) }), 0x6155 => Some(unsafe { transmute(0x75b8u32) }), 0x6156 => Some(unsafe { transmute(0x75bcu32) }), 0x6157 => Some(unsafe { transmute(0x75b1u32) }), 0x6158 => Some(unsafe { transmute(0x75cdu32) }), 0x6159 => Some(unsafe { transmute(0x75cau32) }), 0x615a => Some(unsafe { transmute(0x75d2u32) }), 0x615b => Some(unsafe { transmute(0x75d9u32) }), 0x615c => Some(unsafe { transmute(0x75e3u32) }), 0x615d => Some(unsafe { transmute(0x75deu32) }), 0x615e => Some(unsafe { transmute(0x75feu32) }), 0x615f => Some(unsafe { transmute(0x75ffu32) }), 0x6160 => Some(unsafe { transmute(0x75fcu32) }), 0x6161 => Some(unsafe { transmute(0x7601u32) }), 0x6162 => Some(unsafe { transmute(0x75f0u32) }), 0x6163 => Some(unsafe { transmute(0x75fau32) }), 0x6164 => Some(unsafe { transmute(0x75f2u32) }), 0x6165 => Some(unsafe { transmute(0x75f3u32) }), 0x6166 => Some(unsafe { transmute(0x760bu32) }), 0x6167 => Some(unsafe { transmute(0x760du32) }), 0x6168 => Some(unsafe { transmute(0x7609u32) }), 0x6169 => Some(unsafe { transmute(0x761fu32) }), 0x616a => Some(unsafe { transmute(0x7627u32) }), 0x616b => Some(unsafe { transmute(0x7620u32) }), 0x616c => Some(unsafe { transmute(0x7621u32) }), 0x616d => Some(unsafe { transmute(0x7622u32) }), 0x616e => Some(unsafe { transmute(0x7624u32) }), 0x616f => Some(unsafe { transmute(0x7634u32) }), 0x6170 => Some(unsafe { transmute(0x7630u32) }), 0x6171 => Some(unsafe { transmute(0x763bu32) }), 0x6172 => Some(unsafe { transmute(0x7647u32) }), 0x6173 => Some(unsafe { transmute(0x7648u32) }), 0x6174 => Some(unsafe { transmute(0x7646u32) }), 0x6175 => Some(unsafe { transmute(0x765cu32) }), 0x6176 => Some(unsafe { transmute(0x7658u32) }), 0x6177 => Some(unsafe { transmute(0x7661u32) }), 0x6178 => Some(unsafe { transmute(0x7662u32) }), 0x6179 => Some(unsafe { transmute(0x7668u32) }), 0x617a => Some(unsafe { transmute(0x7669u32) }), 0x617b => Some(unsafe { transmute(0x766au32) }), 0x617c => Some(unsafe { transmute(0x7667u32) }), 0x617d => Some(unsafe { transmute(0x766cu32) }), 0x617e => Some(unsafe { transmute(0x7670u32) }), 0x6221 => Some(unsafe { transmute(0x7672u32) }), 0x6222 => Some(unsafe { transmute(0x7676u32) }), 0x6223 => Some(unsafe { transmute(0x7678u32) }), 0x6224 => Some(unsafe { transmute(0x767cu32) }), 0x6225 => Some(unsafe { transmute(0x7680u32) }), 0x6226 => Some(unsafe { transmute(0x7683u32) }), 0x6227 => Some(unsafe { transmute(0x7688u32) }), 0x6228 => Some(unsafe { transmute(0x768bu32) }), 0x6229 => Some(unsafe { transmute(0x768eu32) }), 0x622a => Some(unsafe { transmute(0x7696u32) }), 0x622b => Some(unsafe { transmute(0x7693u32) }), 0x622c => Some(unsafe { transmute(0x7699u32) }), 0x622d => Some(unsafe { transmute(0x769au32) }), 0x622e => Some(unsafe { transmute(0x76b0u32) }), 0x622f => Some(unsafe { transmute(0x76b4u32) }), 0x6230 => Some(unsafe { transmute(0x76b8u32) }), 0x6231 => Some(unsafe { transmute(0x76b9u32) }), 0x6232 => Some(unsafe { transmute(0x76bau32) }), 0x6233 => Some(unsafe { transmute(0x76c2u32) }), 0x6234 => Some(unsafe { transmute(0x76cdu32) }), 0x6235 => Some(unsafe { transmute(0x76d6u32) }), 0x6236 => Some(unsafe { transmute(0x76d2u32) }), 0x6237 => Some(unsafe { transmute(0x76deu32) }), 0x6238 => Some(unsafe { transmute(0x76e1u32) }), 0x6239 => Some(unsafe { transmute(0x76e5u32) }), 0x623a => Some(unsafe { transmute(0x76e7u32) }), 0x623b => Some(unsafe { transmute(0x76eau32) }), 0x623c => Some(unsafe { transmute(0x862fu32) }), 0x623d => Some(unsafe { transmute(0x76fbu32) }), 0x623e => Some(unsafe { transmute(0x7708u32) }), 0x623f => Some(unsafe { transmute(0x7707u32) }), 0x6240 => Some(unsafe { transmute(0x7704u32) }), 0x6241 => Some(unsafe { transmute(0x7729u32) }), 0x6242 => Some(unsafe { transmute(0x7724u32) }), 0x6243 => Some(unsafe { transmute(0x771eu32) }), 0x6244 => Some(unsafe { transmute(0x7725u32) }), 0x6245 => Some(unsafe { transmute(0x7726u32) }), 0x6246 => Some(unsafe { transmute(0x771bu32) }), 0x6247 => Some(unsafe { transmute(0x7737u32) }), 0x6248 => Some(unsafe { transmute(0x7738u32) }), 0x6249 => Some(unsafe { transmute(0x7747u32) }), 0x624a => Some(unsafe { transmute(0x775au32) }), 0x624b => Some(unsafe { transmute(0x7768u32) }), 0x624c => Some(unsafe { transmute(0x776bu32) }), 0x624d => Some(unsafe { transmute(0x775bu32) }), 0x624e => Some(unsafe { transmute(0x7765u32) }), 0x624f => Some(unsafe { transmute(0x777fu32) }), 0x6250 => Some(unsafe { transmute(0x777eu32) }), 0x6251 => Some(unsafe { transmute(0x7779u32) }), 0x6252 => Some(unsafe { transmute(0x778eu32) }), 0x6253 => Some(unsafe { transmute(0x778bu32) }), 0x6254 => Some(unsafe { transmute(0x7791u32) }), 0x6255 => Some(unsafe { transmute(0x77a0u32) }), 0x6256 => Some(unsafe { transmute(0x779eu32) }), 0x6257 => Some(unsafe { transmute(0x77b0u32) }), 0x6258 => Some(unsafe { transmute(0x77b6u32) }), 0x6259 => Some(unsafe { transmute(0x77b9u32) }), 0x625a => Some(unsafe { transmute(0x77bfu32) }), 0x625b => Some(unsafe { transmute(0x77bcu32) }), 0x625c => Some(unsafe { transmute(0x77bdu32) }), 0x625d => Some(unsafe { transmute(0x77bbu32) }), 0x625e => Some(unsafe { transmute(0x77c7u32) }), 0x625f => Some(unsafe { transmute(0x77cdu32) }), 0x6260 => Some(unsafe { transmute(0x77d7u32) }), 0x6261 => Some(unsafe { transmute(0x77dau32) }), 0x6262 => Some(unsafe { transmute(0x77dcu32) }), 0x6263 => Some(unsafe { transmute(0x77e3u32) }), 0x6264 => Some(unsafe { transmute(0x77eeu32) }), 0x6265 => Some(unsafe { transmute(0x77fcu32) }), 0x6266 => Some(unsafe { transmute(0x780cu32) }), 0x6267 => Some(unsafe { transmute(0x7812u32) }), 0x6268 => Some(unsafe { transmute(0x7926u32) }), 0x6269 => Some(unsafe { transmute(0x7820u32) }), 0x626a => Some(unsafe { transmute(0x792au32) }), 0x626b => Some(unsafe { transmute(0x7845u32) }), 0x626c => Some(unsafe { transmute(0x788eu32) }), 0x626d => Some(unsafe { transmute(0x7874u32) }), 0x626e => Some(unsafe { transmute(0x7886u32) }), 0x626f => Some(unsafe { transmute(0x787cu32) }), 0x6270 => Some(unsafe { transmute(0x789au32) }), 0x6271 => Some(unsafe { transmute(0x788cu32) }), 0x6272 => Some(unsafe { transmute(0x78a3u32) }), 0x6273 => Some(unsafe { transmute(0x78b5u32) }), 0x6274 => Some(unsafe { transmute(0x78aau32) }), 0x6275 => Some(unsafe { transmute(0x78afu32) }), 0x6276 => Some(unsafe { transmute(0x78d1u32) }), 0x6277 => Some(unsafe { transmute(0x78c6u32) }), 0x6278 => Some(unsafe { transmute(0x78cbu32) }), 0x6279 => Some(unsafe { transmute(0x78d4u32) }), 0x627a => Some(unsafe { transmute(0x78beu32) }), 0x627b => Some(unsafe { transmute(0x78bcu32) }), 0x627c => Some(unsafe { transmute(0x78c5u32) }), 0x627d => Some(unsafe { transmute(0x78cau32) }), 0x627e => Some(unsafe { transmute(0x78ecu32) }), 0x6321 => Some(unsafe { transmute(0x78e7u32) }), 0x6322 => Some(unsafe { transmute(0x78dau32) }), 0x6323 => Some(unsafe { transmute(0x78fdu32) }), 0x6324 => Some(unsafe { transmute(0x78f4u32) }), 0x6325 => Some(unsafe { transmute(0x7907u32) }), 0x6326 => Some(unsafe { transmute(0x7912u32) }), 0x6327 => Some(unsafe { transmute(0x7911u32) }), 0x6328 => Some(unsafe { transmute(0x7919u32) }), 0x6329 => Some(unsafe { transmute(0x792cu32) }), 0x632a => Some(unsafe { transmute(0x792bu32) }), 0x632b => Some(unsafe { transmute(0x7940u32) }), 0x632c => Some(unsafe { transmute(0x7960u32) }), 0x632d => Some(unsafe { transmute(0x7957u32) }), 0x632e => Some(unsafe { transmute(0x795fu32) }), 0x632f => Some(unsafe { transmute(0x795au32) }), 0x6330 => Some(unsafe { transmute(0x7955u32) }), 0x6331 => Some(unsafe { transmute(0x7953u32) }), 0x6332 => Some(unsafe { transmute(0x797au32) }), 0x6333 => Some(unsafe { transmute(0x797fu32) }), 0x6334 => Some(unsafe { transmute(0x798au32) }), 0x6335 => Some(unsafe { transmute(0x799du32) }), 0x6336 => Some(unsafe { transmute(0x79a7u32) }), 0x6337 => Some(unsafe { transmute(0x9f4bu32) }), 0x6338 => Some(unsafe { transmute(0x79aau32) }), 0x6339 => Some(unsafe { transmute(0x79aeu32) }), 0x633a => Some(unsafe { transmute(0x79b3u32) }), 0x633b => Some(unsafe { transmute(0x79b9u32) }), 0x633c => Some(unsafe { transmute(0x79bau32) }), 0x633d => Some(unsafe { transmute(0x79c9u32) }), 0x633e => Some(unsafe { transmute(0x79d5u32) }), 0x633f => Some(unsafe { transmute(0x79e7u32) }), 0x6340 => Some(unsafe { transmute(0x79ecu32) }), 0x6341 => Some(unsafe { transmute(0x79e1u32) }), 0x6342 => Some(unsafe { transmute(0x79e3u32) }), 0x6343 => Some(unsafe { transmute(0x7a08u32) }), 0x6344 => Some(unsafe { transmute(0x7a0du32) }), 0x6345 => Some(unsafe { transmute(0x7a18u32) }), 0x6346 => Some(unsafe { transmute(0x7a19u32) }), 0x6347 => Some(unsafe { transmute(0x7a20u32) }), 0x6348 => Some(unsafe { transmute(0x7a1fu32) }), 0x6349 => Some(unsafe { transmute(0x7980u32) }), 0x634a => Some(unsafe { transmute(0x7a31u32) }), 0x634b => Some(unsafe { transmute(0x7a3bu32) }), 0x634c => Some(unsafe { transmute(0x7a3eu32) }), 0x634d => Some(unsafe { transmute(0x7a37u32) }), 0x634e => Some(unsafe { transmute(0x7a43u32) }), 0x634f => Some(unsafe { transmute(0x7a57u32) }), 0x6350 => Some(unsafe { transmute(0x7a49u32) }), 0x6351 => Some(unsafe { transmute(0x7a61u32) }), 0x6352 => Some(unsafe { transmute(0x7a62u32) }), 0x6353 => Some(unsafe { transmute(0x7a69u32) }), 0x6354 => Some(unsafe { transmute(0x9f9du32) }), 0x6355 => Some(unsafe { transmute(0x7a70u32) }), 0x6356 => Some(unsafe { transmute(0x7a79u32) }), 0x6357 => Some(unsafe { transmute(0x7a7du32) }), 0x6358 => Some(unsafe { transmute(0x7a88u32) }), 0x6359 => Some(unsafe { transmute(0x7a97u32) }), 0x635a => Some(unsafe { transmute(0x7a95u32) }), 0x635b => Some(unsafe { transmute(0x7a98u32) }), 0x635c => Some(unsafe { transmute(0x7a96u32) }), 0x635d => Some(unsafe { transmute(0x7aa9u32) }), 0x635e => Some(unsafe { transmute(0x7ac8u32) }), 0x635f => Some(unsafe { transmute(0x7ab0u32) }), 0x6360 => Some(unsafe { transmute(0x7ab6u32) }), 0x6361 => Some(unsafe { transmute(0x7ac5u32) }), 0x6362 => Some(unsafe { transmute(0x7ac4u32) }), 0x6363 => Some(unsafe { transmute(0x7abfu32) }), 0x6364 => Some(unsafe { transmute(0x9083u32) }), 0x6365 => Some(unsafe { transmute(0x7ac7u32) }), 0x6366 => Some(unsafe { transmute(0x7acau32) }), 0x6367 => Some(unsafe { transmute(0x7acdu32) }), 0x6368 => Some(unsafe { transmute(0x7acfu32) }), 0x6369 => Some(unsafe { transmute(0x7ad5u32) }), 0x636a => Some(unsafe { transmute(0x7ad3u32) }), 0x636b => Some(unsafe { transmute(0x7ad9u32) }), 0x636c => Some(unsafe { transmute(0x7adau32) }), 0x636d => Some(unsafe { transmute(0x7addu32) }), 0x636e => Some(unsafe { transmute(0x7ae1u32) }), 0x636f => Some(unsafe { transmute(0x7ae2u32) }), 0x6370 => Some(unsafe { transmute(0x7ae6u32) }), 0x6371 => Some(unsafe { transmute(0x7aedu32) }), 0x6372 => Some(unsafe { transmute(0x7af0u32) }), 0x6373 => Some(unsafe { transmute(0x7b02u32) }), 0x6374 => Some(unsafe { transmute(0x7b0fu32) }), 0x6375 => Some(unsafe { transmute(0x7b0au32) }), 0x6376 => Some(unsafe { transmute(0x7b06u32) }), 0x6377 => Some(unsafe { transmute(0x7b33u32) }), 0x6378 => Some(unsafe { transmute(0x7b18u32) }), 0x6379 => Some(unsafe { transmute(0x7b19u32) }), 0x637a => Some(unsafe { transmute(0x7b1eu32) }), 0x637b => Some(unsafe { transmute(0x7b35u32) }), 0x637c => Some(unsafe { transmute(0x7b28u32) }), 0x637d => Some(unsafe { transmute(0x7b36u32) }), 0x637e => Some(unsafe { transmute(0x7b50u32) }), 0x6421 => Some(unsafe { transmute(0x7b7au32) }), 0x6422 => Some(unsafe { transmute(0x7b04u32) }), 0x6423 => Some(unsafe { transmute(0x7b4du32) }), 0x6424 => Some(unsafe { transmute(0x7b0bu32) }), 0x6425 => Some(unsafe { transmute(0x7b4cu32) }), 0x6426 => Some(unsafe { transmute(0x7b45u32) }), 0x6427 => Some(unsafe { transmute(0x7b75u32) }), 0x6428 => Some(unsafe { transmute(0x7b65u32) }), 0x6429 => Some(unsafe { transmute(0x7b74u32) }), 0x642a => Some(unsafe { transmute(0x7b67u32) }), 0x642b => Some(unsafe { transmute(0x7b70u32) }), 0x642c => Some(unsafe { transmute(0x7b71u32) }), 0x642d => Some(unsafe { transmute(0x7b6cu32) }), 0x642e => Some(unsafe { transmute(0x7b6eu32) }), 0x642f => Some(unsafe { transmute(0x7b9du32) }), 0x6430 => Some(unsafe { transmute(0x7b98u32) }), 0x6431 => Some(unsafe { transmute(0x7b9fu32) }), 0x6432 => Some(unsafe { transmute(0x7b8du32) }), 0x6433 => Some(unsafe { transmute(0x7b9cu32) }), 0x6434 => Some(unsafe { transmute(0x7b9au32) }), 0x6435 => Some(unsafe { transmute(0x7b8bu32) }), 0x6436 => Some(unsafe { transmute(0x7b92u32) }), 0x6437 => Some(unsafe { transmute(0x7b8fu32) }), 0x6438 => Some(unsafe { transmute(0x7b5du32) }), 0x6439 => Some(unsafe { transmute(0x7b99u32) }), 0x643a => Some(unsafe { transmute(0x7bcbu32) }), 0x643b => Some(unsafe { transmute(0x7bc1u32) }), 0x643c => Some(unsafe { transmute(0x7bccu32) }), 0x643d => Some(unsafe { transmute(0x7bcfu32) }), 0x643e => Some(unsafe { transmute(0x7bb4u32) }), 0x643f => Some(unsafe { transmute(0x7bc6u32) }), 0x6440 => Some(unsafe { transmute(0x7bddu32) }), 0x6441 => Some(unsafe { transmute(0x7be9u32) }), 0x6442 => Some(unsafe { transmute(0x7c11u32) }), 0x6443 => Some(unsafe { transmute(0x7c14u32) }), 0x6444 => Some(unsafe { transmute(0x7be6u32) }), 0x6445 => Some(unsafe { transmute(0x7be5u32) }), 0x6446 => Some(unsafe { transmute(0x7c60u32) }), 0x6447 => Some(unsafe { transmute(0x7c00u32) }), 0x6448 => Some(unsafe { transmute(0x7c07u32) }), 0x6449 => Some(unsafe { transmute(0x7c13u32) }), 0x644a => Some(unsafe { transmute(0x7bf3u32) }), 0x644b => Some(unsafe { transmute(0x7bf7u32) }), 0x644c => Some(unsafe { transmute(0x7c17u32) }), 0x644d => Some(unsafe { transmute(0x7c0du32) }), 0x644e => Some(unsafe { transmute(0x7bf6u32) }), 0x644f => Some(unsafe { transmute(0x7c23u32) }), 0x6450 => Some(unsafe { transmute(0x7c27u32) }), 0x6451 => Some(unsafe { transmute(0x7c2au32) }), 0x6452 => Some(unsafe { transmute(0x7c1fu32) }), 0x6453 => Some(unsafe { transmute(0x7c37u32) }), 0x6454 => Some(unsafe { transmute(0x7c2bu32) }), 0x6455 => Some(unsafe { transmute(0x7c3du32) }), 0x6456 => Some(unsafe { transmute(0x7c4cu32) }), 0x6457 => Some(unsafe { transmute(0x7c43u32) }), 0x6458 => Some(unsafe { transmute(0x7c54u32) }), 0x6459 => Some(unsafe { transmute(0x7c4fu32) }), 0x645a => Some(unsafe { transmute(0x7c40u32) }), 0x645b => Some(unsafe { transmute(0x7c50u32) }), 0x645c => Some(unsafe { transmute(0x7c58u32) }), 0x645d => Some(unsafe { transmute(0x7c5fu32) }), 0x645e => Some(unsafe { transmute(0x7c64u32) }), 0x645f => Some(unsafe { transmute(0x7c56u32) }), 0x6460 => Some(unsafe { transmute(0x7c65u32) }), 0x6461 => Some(unsafe { transmute(0x7c6cu32) }), 0x6462 => Some(unsafe { transmute(0x7c75u32) }), 0x6463 => Some(unsafe { transmute(0x7c83u32) }), 0x6464 => Some(unsafe { transmute(0x7c90u32) }), 0x6465 => Some(unsafe { transmute(0x7ca4u32) }), 0x6466 => Some(unsafe { transmute(0x7cadu32) }), 0x6467 => Some(unsafe { transmute(0x7ca2u32) }), 0x6468 => Some(unsafe { transmute(0x7cabu32) }), 0x6469 => Some(unsafe { transmute(0x7ca1u32) }), 0x646a => Some(unsafe { transmute(0x7ca8u32) }), 0x646b => Some(unsafe { transmute(0x7cb3u32) }), 0x646c => Some(unsafe { transmute(0x7cb2u32) }), 0x646d => Some(unsafe { transmute(0x7cb1u32) }), 0x646e => Some(unsafe { transmute(0x7caeu32) }), 0x646f => Some(unsafe { transmute(0x7cb9u32) }), 0x6470 => Some(unsafe { transmute(0x7cbdu32) }), 0x6471 => Some(unsafe { transmute(0x7cc0u32) }), 0x6472 => Some(unsafe { transmute(0x7cc5u32) }), 0x6473 => Some(unsafe { transmute(0x7cc2u32) }), 0x6474 => Some(unsafe { transmute(0x7cd8u32) }), 0x6475 => Some(unsafe { transmute(0x7cd2u32) }), 0x6476 => Some(unsafe { transmute(0x7cdcu32) }), 0x6477 => Some(unsafe { transmute(0x7ce2u32) }), 0x6478 => Some(unsafe { transmute(0x9b3bu32) }), 0x6479 => Some(unsafe { transmute(0x7cefu32) }), 0x647a => Some(unsafe { transmute(0x7cf2u32) }), 0x647b => Some(unsafe { transmute(0x7cf4u32) }), 0x647c => Some(unsafe { transmute(0x7cf6u32) }), 0x647d => Some(unsafe { transmute(0x7cfau32) }), 0x647e => Some(unsafe { transmute(0x7d06u32) }), 0x6521 => Some(unsafe { transmute(0x7d02u32) }), 0x6522 => Some(unsafe { transmute(0x7d1cu32) }), 0x6523 => Some(unsafe { transmute(0x7d15u32) }), 0x6524 => Some(unsafe { transmute(0x7d0au32) }), 0x6525 => Some(unsafe { transmute(0x7d45u32) }), 0x6526 => Some(unsafe { transmute(0x7d4bu32) }), 0x6527 => Some(unsafe { transmute(0x7d2eu32) }), 0x6528 => Some(unsafe { transmute(0x7d32u32) }), 0x6529 => Some(unsafe { transmute(0x7d3fu32) }), 0x652a => Some(unsafe { transmute(0x7d35u32) }), 0x652b => Some(unsafe { transmute(0x7d46u32) }), 0x652c => Some(unsafe { transmute(0x7d73u32) }), 0x652d => Some(unsafe { transmute(0x7d56u32) }), 0x652e => Some(unsafe { transmute(0x7d4eu32) }), 0x652f => Some(unsafe { transmute(0x7d72u32) }), 0x6530 => Some(unsafe { transmute(0x7d68u32) }), 0x6531 => Some(unsafe { transmute(0x7d6eu32) }), 0x6532 => Some(unsafe { transmute(0x7d4fu32) }), 0x6533 => Some(unsafe { transmute(0x7d63u32) }), 0x6534 => Some(unsafe { transmute(0x7d93u32) }), 0x6535 => Some(unsafe { transmute(0x7d89u32) }), 0x6536 => Some(unsafe { transmute(0x7d5bu32) }), 0x6537 => Some(unsafe { transmute(0x7d8fu32) }), 0x6538 => Some(unsafe { transmute(0x7d7du32) }), 0x6539 => Some(unsafe { transmute(0x7d9bu32) }), 0x653a => Some(unsafe { transmute(0x7dbau32) }), 0x653b => Some(unsafe { transmute(0x7daeu32) }), 0x653c => Some(unsafe { transmute(0x7da3u32) }), 0x653d => Some(unsafe { transmute(0x7db5u32) }), 0x653e => Some(unsafe { transmute(0x7dc7u32) }), 0x653f => Some(unsafe { transmute(0x7dbdu32) }), 0x6540 => Some(unsafe { transmute(0x7dabu32) }), 0x6541 => Some(unsafe { transmute(0x7e3du32) }), 0x6542 => Some(unsafe { transmute(0x7da2u32) }), 0x6543 => Some(unsafe { transmute(0x7dafu32) }), 0x6544 => Some(unsafe { transmute(0x7ddcu32) }), 0x6545 => Some(unsafe { transmute(0x7db8u32) }), 0x6546 => Some(unsafe { transmute(0x7d9fu32) }), 0x6547 => Some(unsafe { transmute(0x7db0u32) }), 0x6548 => Some(unsafe { transmute(0x7dd8u32) }), 0x6549 => Some(unsafe { transmute(0x7dddu32) }), 0x654a => Some(unsafe { transmute(0x7de4u32) }), 0x654b => Some(unsafe { transmute(0x7ddeu32) }), 0x654c => Some(unsafe { transmute(0x7dfbu32) }), 0x654d => Some(unsafe { transmute(0x7df2u32) }), 0x654e => Some(unsafe { transmute(0x7de1u32) }), 0x654f => Some(unsafe { transmute(0x7e05u32) }), 0x6550 => Some(unsafe { transmute(0x7e0au32) }), 0x6551 => Some(unsafe { transmute(0x7e23u32) }), 0x6552 => Some(unsafe { transmute(0x7e21u32) }), 0x6553 => Some(unsafe { transmute(0x7e12u32) }), 0x6554 => Some(unsafe { transmute(0x7e31u32) }), 0x6555 => Some(unsafe { transmute(0x7e1fu32) }), 0x6556 => Some(unsafe { transmute(0x7e09u32) }), 0x6557 => Some(unsafe { transmute(0x7e0bu32) }), 0x6558 => Some(unsafe { transmute(0x7e22u32) }), 0x6559 => Some(unsafe { transmute(0x7e46u32) }), 0x655a => Some(unsafe { transmute(0x7e66u32) }), 0x655b => Some(unsafe { transmute(0x7e3bu32) }), 0x655c => Some(unsafe { transmute(0x7e35u32) }), 0x655d => Some(unsafe { transmute(0x7e39u32) }), 0x655e => Some(unsafe { transmute(0x7e43u32) }), 0x655f => Some(unsafe { transmute(0x7e37u32) }), 0x6560 => Some(unsafe { transmute(0x7e32u32) }), 0x6561 => Some(unsafe { transmute(0x7e3au32) }), 0x6562 => Some(unsafe { transmute(0x7e67u32) }), 0x6563 => Some(unsafe { transmute(0x7e5du32) }), 0x6564 => Some(unsafe { transmute(0x7e56u32) }), 0x6565 => Some(unsafe { transmute(0x7e5eu32) }), 0x6566 => Some(unsafe { transmute(0x7e59u32) }), 0x6567 => Some(unsafe { transmute(0x7e5au32) }), 0x6568 => Some(unsafe { transmute(0x7e79u32) }), 0x6569 => Some(unsafe { transmute(0x7e6au32) }), 0x656a => Some(unsafe { transmute(0x7e69u32) }), 0x656b => Some(unsafe { transmute(0x7e7cu32) }), 0x656c => Some(unsafe { transmute(0x7e7bu32) }), 0x656d => Some(unsafe { transmute(0x7e83u32) }), 0x656e => Some(unsafe { transmute(0x7dd5u32) }), 0x656f => Some(unsafe { transmute(0x7e7du32) }), 0x6570 => Some(unsafe { transmute(0x8faeu32) }), 0x6571 => Some(unsafe { transmute(0x7e7fu32) }), 0x6572 => Some(unsafe { transmute(0x7e88u32) }), 0x6573 => Some(unsafe { transmute(0x7e89u32) }), 0x6574 => Some(unsafe { transmute(0x7e8cu32) }), 0x6575 => Some(unsafe { transmute(0x7e92u32) }), 0x6576 => Some(unsafe { transmute(0x7e90u32) }), 0x6577 => Some(unsafe { transmute(0x7e93u32) }), 0x6578 => Some(unsafe { transmute(0x7e94u32) }), 0x6579 => Some(unsafe { transmute(0x7e96u32) }), 0x657a => Some(unsafe { transmute(0x7e8eu32) }), 0x657b => Some(unsafe { transmute(0x7e9bu32) }), 0x657c => Some(unsafe { transmute(0x7e9cu32) }), 0x657d => Some(unsafe { transmute(0x7f38u32) }), 0x657e => Some(unsafe { transmute(0x7f3au32) }), 0x6621 => Some(unsafe { transmute(0x7f45u32) }), 0x6622 => Some(unsafe { transmute(0x7f4cu32) }), 0x6623 => Some(unsafe { transmute(0x7f4du32) }), 0x6624 => Some(unsafe { transmute(0x7f4eu32) }), 0x6625 => Some(unsafe { transmute(0x7f50u32) }), 0x6626 => Some(unsafe { transmute(0x7f51u32) }), 0x6627 => Some(unsafe { transmute(0x7f55u32) }), 0x6628 => Some(unsafe { transmute(0x7f54u32) }), 0x6629 => Some(unsafe { transmute(0x7f58u32) }), 0x662a => Some(unsafe { transmute(0x7f5fu32) }), 0x662b => Some(unsafe { transmute(0x7f60u32) }), 0x662c => Some(unsafe { transmute(0x7f68u32) }), 0x662d => Some(unsafe { transmute(0x7f69u32) }), 0x662e => Some(unsafe { transmute(0x7f67u32) }), 0x662f => Some(unsafe { transmute(0x7f78u32) }), 0x6630 => Some(unsafe { transmute(0x7f82u32) }), 0x6631 => Some(unsafe { transmute(0x7f86u32) }), 0x6632 => Some(unsafe { transmute(0x7f83u32) }), 0x6633 => Some(unsafe { transmute(0x7f88u32) }), 0x6634 => Some(unsafe { transmute(0x7f87u32) }), 0x6635 => Some(unsafe { transmute(0x7f8cu32) }), 0x6636 => Some(unsafe { transmute(0x7f94u32) }), 0x6637 => Some(unsafe { transmute(0x7f9eu32) }), 0x6638 => Some(unsafe { transmute(0x7f9du32) }), 0x6639 => Some(unsafe { transmute(0x7f9au32) }), 0x663a => Some(unsafe { transmute(0x7fa3u32) }), 0x663b => Some(unsafe { transmute(0x7fafu32) }), 0x663c => Some(unsafe { transmute(0x7fb2u32) }), 0x663d => Some(unsafe { transmute(0x7fb9u32) }), 0x663e => Some(unsafe { transmute(0x7faeu32) }), 0x663f => Some(unsafe { transmute(0x7fb6u32) }), 0x6640 => Some(unsafe { transmute(0x7fb8u32) }), 0x6641 => Some(unsafe { transmute(0x8b71u32) }), 0x6642 => Some(unsafe { transmute(0x7fc5u32) }), 0x6643 => Some(unsafe { transmute(0x7fc6u32) }), 0x6644 => Some(unsafe { transmute(0x7fcau32) }), 0x6645 => Some(unsafe { transmute(0x7fd5u32) }), 0x6646 => Some(unsafe { transmute(0x7fd4u32) }), 0x6647 => Some(unsafe { transmute(0x7fe1u32) }), 0x6648 => Some(unsafe { transmute(0x7fe6u32) }), 0x6649 => Some(unsafe { transmute(0x7fe9u32) }), 0x664a => Some(unsafe { transmute(0x7ff3u32) }), 0x664b => Some(unsafe { transmute(0x7ff9u32) }), 0x664c => Some(unsafe { transmute(0x98dcu32) }), 0x664d => Some(unsafe { transmute(0x8006u32) }), 0x664e => Some(unsafe { transmute(0x8004u32) }), 0x664f => Some(unsafe { transmute(0x800bu32) }), 0x6650 => Some(unsafe { transmute(0x8012u32) }), 0x6651 => Some(unsafe { transmute(0x8018u32) }), 0x6652 => Some(unsafe { transmute(0x8019u32) }), 0x6653 => Some(unsafe { transmute(0x801cu32) }), 0x6654 => Some(unsafe { transmute(0x8021u32) }), 0x6655 => Some(unsafe { transmute(0x8028u32) }), 0x6656 => Some(unsafe { transmute(0x803fu32) }), 0x6657 => Some(unsafe { transmute(0x803bu32) }), 0x6658 => Some(unsafe { transmute(0x804au32) }), 0x6659 => Some(unsafe { transmute(0x8046u32) }), 0x665a => Some(unsafe { transmute(0x8052u32) }), 0x665b => Some(unsafe { transmute(0x8058u32) }), 0x665c => Some(unsafe { transmute(0x805au32) }), 0x665d => Some(unsafe { transmute(0x805fu32) }), 0x665e => Some(unsafe { transmute(0x8062u32) }), 0x665f => Some(unsafe { transmute(0x8068u32) }), 0x6660 => Some(unsafe { transmute(0x8073u32) }), 0x6661 => Some(unsafe { transmute(0x8072u32) }), 0x6662 => Some(unsafe { transmute(0x8070u32) }), 0x6663 => Some(unsafe { transmute(0x8076u32) }), 0x6664 => Some(unsafe { transmute(0x8079u32) }), 0x6665 => Some(unsafe { transmute(0x807du32) }), 0x6666 => Some(unsafe { transmute(0x807fu32) }), 0x6667 => Some(unsafe { transmute(0x8084u32) }), 0x6668 => Some(unsafe { transmute(0x8086u32) }), 0x6669 => Some(unsafe { transmute(0x8085u32) }), 0x666a => Some(unsafe { transmute(0x809bu32) }), 0x666b => Some(unsafe { transmute(0x8093u32) }), 0x666c => Some(unsafe { transmute(0x809au32) }), 0x666d => Some(unsafe { transmute(0x80adu32) }), 0x666e => Some(unsafe { transmute(0x5190u32) }), 0x666f => Some(unsafe { transmute(0x80acu32) }), 0x6670 => Some(unsafe { transmute(0x80dbu32) }), 0x6671 => Some(unsafe { transmute(0x80e5u32) }), 0x6672 => Some(unsafe { transmute(0x80d9u32) }), 0x6673 => Some(unsafe { transmute(0x80ddu32) }), 0x6674 => Some(unsafe { transmute(0x80c4u32) }), 0x6675 => Some(unsafe { transmute(0x80dau32) }), 0x6676 => Some(unsafe { transmute(0x80d6u32) }), 0x6677 => Some(unsafe { transmute(0x8109u32) }), 0x6678 => Some(unsafe { transmute(0x80efu32) }), 0x6679 => Some(unsafe { transmute(0x80f1u32) }), 0x667a => Some(unsafe { transmute(0x811bu32) }), 0x667b => Some(unsafe { transmute(0x8129u32) }), 0x667c => Some(unsafe { transmute(0x8123u32) }), 0x667d => Some(unsafe { transmute(0x812fu32) }), 0x667e => Some(unsafe { transmute(0x814bu32) }), 0x6721 => Some(unsafe { transmute(0x968bu32) }), 0x6722 => Some(unsafe { transmute(0x8146u32) }), 0x6723 => Some(unsafe { transmute(0x813eu32) }), 0x6724 => Some(unsafe { transmute(0x8153u32) }), 0x6725 => Some(unsafe { transmute(0x8151u32) }), 0x6726 => Some(unsafe { transmute(0x80fcu32) }), 0x6727 => Some(unsafe { transmute(0x8171u32) }), 0x6728 => Some(unsafe { transmute(0x816eu32) }), 0x6729 => Some(unsafe { transmute(0x8165u32) }), 0x672a => Some(unsafe { transmute(0x8166u32) }), 0x672b => Some(unsafe { transmute(0x8174u32) }), 0x672c => Some(unsafe { transmute(0x8183u32) }), 0x672d => Some(unsafe { transmute(0x8188u32) }), 0x672e => Some(unsafe { transmute(0x818au32) }), 0x672f => Some(unsafe { transmute(0x8180u32) }), 0x6730 => Some(unsafe { transmute(0x8182u32) }), 0x6731 => Some(unsafe { transmute(0x81a0u32) }), 0x6732 => Some(unsafe { transmute(0x8195u32) }), 0x6733 => Some(unsafe { transmute(0x81a4u32) }), 0x6734 => Some(unsafe { transmute(0x81a3u32) }), 0x6735 => Some(unsafe { transmute(0x815fu32) }), 0x6736 => Some(unsafe { transmute(0x8193u32) }), 0x6737 => Some(unsafe { transmute(0x81a9u32) }), 0x6738 => Some(unsafe { transmute(0x81b0u32) }), 0x6739 => Some(unsafe { transmute(0x81b5u32) }), 0x673a => Some(unsafe { transmute(0x81beu32) }), 0x673b => Some(unsafe { transmute(0x81b8u32) }), 0x673c => Some(unsafe { transmute(0x81bdu32) }), 0x673d => Some(unsafe { transmute(0x81c0u32) }), 0x673e => Some(unsafe { transmute(0x81c2u32) }), 0x673f => Some(unsafe { transmute(0x81bau32) }), 0x6740 => Some(unsafe { transmute(0x81c9u32) }), 0x6741 => Some(unsafe { transmute(0x81cdu32) }), 0x6742 => Some(unsafe { transmute(0x81d1u32) }), 0x6743 => Some(unsafe { transmute(0x81d9u32) }), 0x6744 => Some(unsafe { transmute(0x81d8u32) }), 0x6745 => Some(unsafe { transmute(0x81c8u32) }), 0x6746 => Some(unsafe { transmute(0x81dau32) }), 0x6747 => Some(unsafe { transmute(0x81dfu32) }), 0x6748 => Some(unsafe { transmute(0x81e0u32) }), 0x6749 => Some(unsafe { transmute(0x81e7u32) }), 0x674a => Some(unsafe { transmute(0x81fau32) }), 0x674b => Some(unsafe { transmute(0x81fbu32) }), 0x674c => Some(unsafe { transmute(0x81feu32) }), 0x674d => Some(unsafe { transmute(0x8201u32) }), 0x674e => Some(unsafe { transmute(0x8202u32) }), 0x674f => Some(unsafe { transmute(0x8205u32) }), 0x6750 => Some(unsafe { transmute(0x8207u32) }), 0x6751 => Some(unsafe { transmute(0x820au32) }), 0x6752 => Some(unsafe { transmute(0x820du32) }), 0x6753 => Some(unsafe { transmute(0x8210u32) }), 0x6754 => Some(unsafe { transmute(0x8216u32) }), 0x6755 => Some(unsafe { transmute(0x8229u32) }), 0x6756 => Some(unsafe { transmute(0x822bu32) }), 0x6757 => Some(unsafe { transmute(0x8238u32) }), 0x6758 => Some(unsafe { transmute(0x8233u32) }), 0x6759 => Some(unsafe { transmute(0x8240u32) }), 0x675a => Some(unsafe { transmute(0x8259u32) }), 0x675b => Some(unsafe { transmute(0x8258u32) }), 0x675c => Some(unsafe { transmute(0x825du32) }), 0x675d => Some(unsafe { transmute(0x825au32) }), 0x675e => Some(unsafe { transmute(0x825fu32) }), 0x675f => Some(unsafe { transmute(0x8264u32) }), 0x6760 => Some(unsafe { transmute(0x8262u32) }), 0x6761 => Some(unsafe { transmute(0x8268u32) }), 0x6762 => Some(unsafe { transmute(0x826au32) }), 0x6763 => Some(unsafe { transmute(0x826bu32) }), 0x6764 => Some(unsafe { transmute(0x822eu32) }), 0x6765 => Some(unsafe { transmute(0x8271u32) }), 0x6766 => Some(unsafe { transmute(0x8277u32) }), 0x6767 => Some(unsafe { transmute(0x8278u32) }), 0x6768 => Some(unsafe { transmute(0x827eu32) }), 0x6769 => Some(unsafe { transmute(0x828du32) }), 0x676a => Some(unsafe { transmute(0x8292u32) }), 0x676b => Some(unsafe { transmute(0x82abu32) }), 0x676c => Some(unsafe { transmute(0x829fu32) }), 0x676d => Some(unsafe { transmute(0x82bbu32) }), 0x676e => Some(unsafe { transmute(0x82acu32) }), 0x676f => Some(unsafe { transmute(0x82e1u32) }), 0x6770 => Some(unsafe { transmute(0x82e3u32) }), 0x6771 => Some(unsafe { transmute(0x82dfu32) }), 0x6772 => Some(unsafe { transmute(0x82d2u32) }), 0x6773 => Some(unsafe { transmute(0x82f4u32) }), 0x6774 => Some(unsafe { transmute(0x82f3u32) }), 0x6775 => Some(unsafe { transmute(0x82fau32) }), 0x6776 => Some(unsafe { transmute(0x8393u32) }), 0x6777 => Some(unsafe { transmute(0x8303u32) }), 0x6778 => Some(unsafe { transmute(0x82fbu32) }), 0x6779 => Some(unsafe { transmute(0x82f9u32) }), 0x677a => Some(unsafe { transmute(0x82deu32) }), 0x677b => Some(unsafe { transmute(0x8306u32) }), 0x677c => Some(unsafe { transmute(0x82dcu32) }), 0x677d => Some(unsafe { transmute(0x8309u32) }), 0x677e => Some(unsafe { transmute(0x82d9u32) }), 0x6821 => Some(unsafe { transmute(0x8335u32) }), 0x6822 => Some(unsafe { transmute(0x8334u32) }), 0x6823 => Some(unsafe { transmute(0x8316u32) }), 0x6824 => Some(unsafe { transmute(0x8332u32) }), 0x6825 => Some(unsafe { transmute(0x8331u32) }), 0x6826 => Some(unsafe { transmute(0x8340u32) }), 0x6827 => Some(unsafe { transmute(0x8339u32) }), 0x6828 => Some(unsafe { transmute(0x8350u32) }), 0x6829 => Some(unsafe { transmute(0x8345u32) }), 0x682a => Some(unsafe { transmute(0x832fu32) }), 0x682b => Some(unsafe { transmute(0x832bu32) }), 0x682c => Some(unsafe { transmute(0x8317u32) }), 0x682d => Some(unsafe { transmute(0x8318u32) }), 0x682e => Some(unsafe { transmute(0x8385u32) }), 0x682f => Some(unsafe { transmute(0x839au32) }), 0x6830 => Some(unsafe { transmute(0x83aau32) }), 0x6831 => Some(unsafe { transmute(0x839fu32) }), 0x6832 => Some(unsafe { transmute(0x83a2u32) }), 0x6833 => Some(unsafe { transmute(0x8396u32) }), 0x6834 => Some(unsafe { transmute(0x8323u32) }), 0x6835 => Some(unsafe { transmute(0x838eu32) }), 0x6836 => Some(unsafe { transmute(0x8387u32) }), 0x6837 => Some(unsafe { transmute(0x838au32) }), 0x6838 => Some(unsafe { transmute(0x837cu32) }), 0x6839 => Some(unsafe { transmute(0x83b5u32) }), 0x683a => Some(unsafe { transmute(0x8373u32) }), 0x683b => Some(unsafe { transmute(0x8375u32) }), 0x683c => Some(unsafe { transmute(0x83a0u32) }), 0x683d => Some(unsafe { transmute(0x8389u32) }), 0x683e => Some(unsafe { transmute(0x83a8u32) }), 0x683f => Some(unsafe { transmute(0x83f4u32) }), 0x6840 => Some(unsafe { transmute(0x8413u32) }), 0x6841 => Some(unsafe { transmute(0x83ebu32) }), 0x6842 => Some(unsafe { transmute(0x83ceu32) }), 0x6843 => Some(unsafe { transmute(0x83fdu32) }), 0x6844 => Some(unsafe { transmute(0x8403u32) }), 0x6845 => Some(unsafe { transmute(0x83d8u32) }), 0x6846 => Some(unsafe { transmute(0x840bu32) }), 0x6847 => Some(unsafe { transmute(0x83c1u32) }), 0x6848 => Some(unsafe { transmute(0x83f7u32) }), 0x6849 => Some(unsafe { transmute(0x8407u32) }), 0x684a => Some(unsafe { transmute(0x83e0u32) }), 0x684b => Some(unsafe { transmute(0x83f2u32) }), 0x684c => Some(unsafe { transmute(0x840du32) }), 0x684d => Some(unsafe { transmute(0x8422u32) }), 0x684e => Some(unsafe { transmute(0x8420u32) }), 0x684f => Some(unsafe { transmute(0x83bdu32) }), 0x6850 => Some(unsafe { transmute(0x8438u32) }), 0x6851 => Some(unsafe { transmute(0x8506u32) }), 0x6852 => Some(unsafe { transmute(0x83fbu32) }), 0x6853 => Some(unsafe { transmute(0x846du32) }), 0x6854 => Some(unsafe { transmute(0x842au32) }), 0x6855 => Some(unsafe { transmute(0x843cu32) }), 0x6856 => Some(unsafe { transmute(0x855au32) }), 0x6857 => Some(unsafe { transmute(0x8484u32) }), 0x6858 => Some(unsafe { transmute(0x8477u32) }), 0x6859 => Some(unsafe { transmute(0x846bu32) }), 0x685a => Some(unsafe { transmute(0x84adu32) }), 0x685b => Some(unsafe { transmute(0x846eu32) }), 0x685c => Some(unsafe { transmute(0x8482u32) }), 0x685d => Some(unsafe { transmute(0x8469u32) }), 0x685e => Some(unsafe { transmute(0x8446u32) }), 0x685f => Some(unsafe { transmute(0x842cu32) }), 0x6860 => Some(unsafe { transmute(0x846fu32) }), 0x6861 => Some(unsafe { transmute(0x8479u32) }), 0x6862 => Some(unsafe { transmute(0x8435u32) }), 0x6863 => Some(unsafe { transmute(0x84cau32) }), 0x6864 => Some(unsafe { transmute(0x8462u32) }), 0x6865 => Some(unsafe { transmute(0x84b9u32) }), 0x6866 => Some(unsafe { transmute(0x84bfu32) }), 0x6867 => Some(unsafe { transmute(0x849fu32) }), 0x6868 => Some(unsafe { transmute(0x84d9u32) }), 0x6869 => Some(unsafe { transmute(0x84cdu32) }), 0x686a => Some(unsafe { transmute(0x84bbu32) }), 0x686b => Some(unsafe { transmute(0x84dau32) }), 0x686c => Some(unsafe { transmute(0x84d0u32) }), 0x686d => Some(unsafe { transmute(0x84c1u32) }), 0x686e => Some(unsafe { transmute(0x84c6u32) }), 0x686f => Some(unsafe { transmute(0x84d6u32) }), 0x6870 => Some(unsafe { transmute(0x84a1u32) }), 0x6871 => Some(unsafe { transmute(0x8521u32) }), 0x6872 => Some(unsafe { transmute(0x84ffu32) }), 0x6873 => Some(unsafe { transmute(0x84f4u32) }), 0x6874 => Some(unsafe { transmute(0x8517u32) }), 0x6875 => Some(unsafe { transmute(0x8518u32) }), 0x6876 => Some(unsafe { transmute(0x852cu32) }), 0x6877 => Some(unsafe { transmute(0x851fu32) }), 0x6878 => Some(unsafe { transmute(0x8515u32) }), 0x6879 => Some(unsafe { transmute(0x8514u32) }), 0x687a => Some(unsafe { transmute(0x84fcu32) }), 0x687b => Some(unsafe { transmute(0x8540u32) }), 0x687c => Some(unsafe { transmute(0x8563u32) }), 0x687d => Some(unsafe { transmute(0x8558u32) }), 0x687e => Some(unsafe { transmute(0x8548u32) }), 0x6921 => Some(unsafe { transmute(0x8541u32) }), 0x6922 => Some(unsafe { transmute(0x8602u32) }), 0x6923 => Some(unsafe { transmute(0x854bu32) }), 0x6924 => Some(unsafe { transmute(0x8555u32) }), 0x6925 => Some(unsafe { transmute(0x8580u32) }), 0x6926 => Some(unsafe { transmute(0x85a4u32) }), 0x6927 => Some(unsafe { transmute(0x8588u32) }), 0x6928 => Some(unsafe { transmute(0x8591u32) }), 0x6929 => Some(unsafe { transmute(0x858au32) }), 0x692a => Some(unsafe { transmute(0x85a8u32) }), 0x692b => Some(unsafe { transmute(0x856du32) }), 0x692c => Some(unsafe { transmute(0x8594u32) }), 0x692d => Some(unsafe { transmute(0x859bu32) }), 0x692e => Some(unsafe { transmute(0x85eau32) }), 0x692f => Some(unsafe { transmute(0x8587u32) }), 0x6930 => Some(unsafe { transmute(0x859cu32) }), 0x6931 => Some(unsafe { transmute(0x8577u32) }), 0x6932 => Some(unsafe { transmute(0x857eu32) }), 0x6933 => Some(unsafe { transmute(0x8590u32) }), 0x6934 => Some(unsafe { transmute(0x85c9u32) }), 0x6935 => Some(unsafe { transmute(0x85bau32) }), 0x6936 => Some(unsafe { transmute(0x85cfu32) }), 0x6937 => Some(unsafe { transmute(0x85b9u32) }), 0x6938 => Some(unsafe { transmute(0x85d0u32) }), 0x6939 => Some(unsafe { transmute(0x85d5u32) }), 0x693a => Some(unsafe { transmute(0x85ddu32) }), 0x693b => Some(unsafe { transmute(0x85e5u32) }), 0x693c => Some(unsafe { transmute(0x85dcu32) }), 0x693d => Some(unsafe { transmute(0x85f9u32) }), 0x693e => Some(unsafe { transmute(0x860au32) }), 0x693f => Some(unsafe { transmute(0x8613u32) }), 0x6940 => Some(unsafe { transmute(0x860bu32) }), 0x6941 => Some(unsafe { transmute(0x85feu32) }), 0x6942 => Some(unsafe { transmute(0x85fau32) }), 0x6943 => Some(unsafe { transmute(0x8606u32) }), 0x6944 => Some(unsafe { transmute(0x8622u32) }), 0x6945 => Some(unsafe { transmute(0x861au32) }), 0x6946 => Some(unsafe { transmute(0x8630u32) }), 0x6947 => Some(unsafe { transmute(0x863fu32) }), 0x6948 => Some(unsafe { transmute(0x864du32) }), 0x6949 => Some(unsafe { transmute(0x4e55u32) }), 0x694a => Some(unsafe { transmute(0x8654u32) }), 0x694b => Some(unsafe { transmute(0x865fu32) }), 0x694c => Some(unsafe { transmute(0x8667u32) }), 0x694d => Some(unsafe { transmute(0x8671u32) }), 0x694e => Some(unsafe { transmute(0x8693u32) }), 0x694f => Some(unsafe { transmute(0x86a3u32) }), 0x6950 => Some(unsafe { transmute(0x86a9u32) }), 0x6951 => Some(unsafe { transmute(0x86aau32) }), 0x6952 => Some(unsafe { transmute(0x868bu32) }), 0x6953 => Some(unsafe { transmute(0x868cu32) }), 0x6954 => Some(unsafe { transmute(0x86b6u32) }), 0x6955 => Some(unsafe { transmute(0x86afu32) }), 0x6956 => Some(unsafe { transmute(0x86c4u32) }), 0x6957 => Some(unsafe { transmute(0x86c6u32) }), 0x6958 => Some(unsafe { transmute(0x86b0u32) }), 0x6959 => Some(unsafe { transmute(0x86c9u32) }), 0x695a => Some(unsafe { transmute(0x8823u32) }), 0x695b => Some(unsafe { transmute(0x86abu32) }), 0x695c => Some(unsafe { transmute(0x86d4u32) }), 0x695d => Some(unsafe { transmute(0x86deu32) }), 0x695e => Some(unsafe { transmute(0x86e9u32) }), 0x695f => Some(unsafe { transmute(0x86ecu32) }), 0x6960 => Some(unsafe { transmute(0x86dfu32) }), 0x6961 => Some(unsafe { transmute(0x86dbu32) }), 0x6962 => Some(unsafe { transmute(0x86efu32) }), 0x6963 => Some(unsafe { transmute(0x8712u32) }), 0x6964 => Some(unsafe { transmute(0x8706u32) }), 0x6965 => Some(unsafe { transmute(0x8708u32) }), 0x6966 => Some(unsafe { transmute(0x8700u32) }), 0x6967 => Some(unsafe { transmute(0x8703u32) }), 0x6968 => Some(unsafe { transmute(0x86fbu32) }), 0x6969 => Some(unsafe { transmute(0x8711u32) }), 0x696a => Some(unsafe { transmute(0x8709u32) }), 0x696b => Some(unsafe { transmute(0x870du32) }), 0x696c => Some(unsafe { transmute(0x86f9u32) }), 0x696d => Some(unsafe { transmute(0x870au32) }), 0x696e => Some(unsafe { transmute(0x8734u32) }), 0x696f => Some(unsafe { transmute(0x873fu32) }), 0x6970 => Some(unsafe { transmute(0x8737u32) }), 0x6971 => Some(unsafe { transmute(0x873bu32) }), 0x6972 => Some(unsafe { transmute(0x8725u32) }), 0x6973 => Some(unsafe { transmute(0x8729u32) }), 0x6974 => Some(unsafe { transmute(0x871au32) }), 0x6975 => Some(unsafe { transmute(0x8760u32) }), 0x6976 => Some(unsafe { transmute(0x875fu32) }), 0x6977 => Some(unsafe { transmute(0x8778u32) }), 0x6978 => Some(unsafe { transmute(0x874cu32) }), 0x6979 => Some(unsafe { transmute(0x874eu32) }), 0x697a => Some(unsafe { transmute(0x8774u32) }), 0x697b => Some(unsafe { transmute(0x8757u32) }), 0x697c => Some(unsafe { transmute(0x8768u32) }), 0x697d => Some(unsafe { transmute(0x876eu32) }), 0x697e => Some(unsafe { transmute(0x8759u32) }), 0x6a21 => Some(unsafe { transmute(0x8753u32) }), 0x6a22 => Some(unsafe { transmute(0x8763u32) }), 0x6a23 => Some(unsafe { transmute(0x876au32) }), 0x6a24 => Some(unsafe { transmute(0x8805u32) }), 0x6a25 => Some(unsafe { transmute(0x87a2u32) }), 0x6a26 => Some(unsafe { transmute(0x879fu32) }), 0x6a27 => Some(unsafe { transmute(0x8782u32) }), 0x6a28 => Some(unsafe { transmute(0x87afu32) }), 0x6a29 => Some(unsafe { transmute(0x87cbu32) }), 0x6a2a => Some(unsafe { transmute(0x87bdu32) }), 0x6a2b => Some(unsafe { transmute(0x87c0u32) }), 0x6a2c => Some(unsafe { transmute(0x87d0u32) }), 0x6a2d => Some(unsafe { transmute(0x96d6u32) }), 0x6a2e => Some(unsafe { transmute(0x87abu32) }), 0x6a2f => Some(unsafe { transmute(0x87c4u32) }), 0x6a30 => Some(unsafe { transmute(0x87b3u32) }), 0x6a31 => Some(unsafe { transmute(0x87c7u32) }), 0x6a32 => Some(unsafe { transmute(0x87c6u32) }), 0x6a33 => Some(unsafe { transmute(0x87bbu32) }), 0x6a34 => Some(unsafe { transmute(0x87efu32) }), 0x6a35 => Some(unsafe { transmute(0x87f2u32) }), 0x6a36 => Some(unsafe { transmute(0x87e0u32) }), 0x6a37 => Some(unsafe { transmute(0x880fu32) }), 0x6a38 => Some(unsafe { transmute(0x880du32) }), 0x6a39 => Some(unsafe { transmute(0x87feu32) }), 0x6a3a => Some(unsafe { transmute(0x87f6u32) }), 0x6a3b => Some(unsafe { transmute(0x87f7u32) }), 0x6a3c => Some(unsafe { transmute(0x880eu32) }), 0x6a3d => Some(unsafe { transmute(0x87d2u32) }), 0x6a3e => Some(unsafe { transmute(0x8811u32) }), 0x6a3f => Some(unsafe { transmute(0x8816u32) }), 0x6a40 => Some(unsafe { transmute(0x8815u32) }), 0x6a41 => Some(unsafe { transmute(0x8822u32) }), 0x6a42 => Some(unsafe { transmute(0x8821u32) }), 0x6a43 => Some(unsafe { transmute(0x8831u32) }), 0x6a44 => Some(unsafe { transmute(0x8836u32) }), 0x6a45 => Some(unsafe { transmute(0x8839u32) }), 0x6a46 => Some(unsafe { transmute(0x8827u32) }), 0x6a47 => Some(unsafe { transmute(0x883bu32) }), 0x6a48 => Some(unsafe { transmute(0x8844u32) }), 0x6a49 => Some(unsafe { transmute(0x8842u32) }), 0x6a4a => Some(unsafe { transmute(0x8852u32) }), 0x6a4b => Some(unsafe { transmute(0x8859u32) }), 0x6a4c => Some(unsafe { transmute(0x885eu32) }), 0x6a4d => Some(unsafe { transmute(0x8862u32) }), 0x6a4e => Some(unsafe { transmute(0x886bu32) }), 0x6a4f => Some(unsafe { transmute(0x8881u32) }), 0x6a50 => Some(unsafe { transmute(0x887eu32) }), 0x6a51 => Some(unsafe { transmute(0x889eu32) }), 0x6a52 => Some(unsafe { transmute(0x8875u32) }), 0x6a53 => Some(unsafe { transmute(0x887du32) }), 0x6a54 => Some(unsafe { transmute(0x88b5u32) }), 0x6a55 => Some(unsafe { transmute(0x8872u32) }), 0x6a56 => Some(unsafe { transmute(0x8882u32) }), 0x6a57 => Some(unsafe { transmute(0x8897u32) }), 0x6a58 => Some(unsafe { transmute(0x8892u32) }), 0x6a59 => Some(unsafe { transmute(0x88aeu32) }), 0x6a5a => Some(unsafe { transmute(0x8899u32) }), 0x6a5b => Some(unsafe { transmute(0x88a2u32) }), 0x6a5c => Some(unsafe { transmute(0x888du32) }), 0x6a5d => Some(unsafe { transmute(0x88a4u32) }), 0x6a5e => Some(unsafe { transmute(0x88b0u32) }), 0x6a5f => Some(unsafe { transmute(0x88bfu32) }), 0x6a60 => Some(unsafe { transmute(0x88b1u32) }), 0x6a61 => Some(unsafe { transmute(0x88c3u32) }), 0x6a62 => Some(unsafe { transmute(0x88c4u32) }), 0x6a63 => Some(unsafe { transmute(0x88d4u32) }), 0x6a64 => Some(unsafe { transmute(0x88d8u32) }), 0x6a65 => Some(unsafe { transmute(0x88d9u32) }), 0x6a66 => Some(unsafe { transmute(0x88ddu32) }), 0x6a67 => Some(unsafe { transmute(0x88f9u32) }), 0x6a68 => Some(unsafe { transmute(0x8902u32) }), 0x6a69 => Some(unsafe { transmute(0x88fcu32) }), 0x6a6a => Some(unsafe { transmute(0x88f4u32) }), 0x6a6b => Some(unsafe { transmute(0x88e8u32) }), 0x6a6c => Some(unsafe { transmute(0x88f2u32) }), 0x6a6d => Some(unsafe { transmute(0x8904u32) }), 0x6a6e => Some(unsafe { transmute(0x890cu32) }), 0x6a6f => Some(unsafe { transmute(0x890au32) }), 0x6a70 => Some(unsafe { transmute(0x8913u32) }), 0x6a71 => Some(unsafe { transmute(0x8943u32) }), 0x6a72 => Some(unsafe { transmute(0x891eu32) }), 0x6a73 => Some(unsafe { transmute(0x8925u32) }), 0x6a74 => Some(unsafe { transmute(0x892au32) }), 0x6a75 => Some(unsafe { transmute(0x892bu32) }), 0x6a76 => Some(unsafe { transmute(0x8941u32) }), 0x6a77 => Some(unsafe { transmute(0x8944u32) }), 0x6a78 => Some(unsafe { transmute(0x893bu32) }), 0x6a79 => Some(unsafe { transmute(0x8936u32) }), 0x6a7a => Some(unsafe { transmute(0x8938u32) }), 0x6a7b => Some(unsafe { transmute(0x894cu32) }), 0x6a7c => Some(unsafe { transmute(0x891du32) }), 0x6a7d => Some(unsafe { transmute(0x8960u32) }), 0x6a7e => Some(unsafe { transmute(0x895eu32) }), 0x6b21 => Some(unsafe { transmute(0x8966u32) }), 0x6b22 => Some(unsafe { transmute(0x8964u32) }), 0x6b23 => Some(unsafe { transmute(0x896du32) }), 0x6b24 => Some(unsafe { transmute(0x896au32) }), 0x6b25 => Some(unsafe { transmute(0x896fu32) }), 0x6b26 => Some(unsafe { transmute(0x8974u32) }), 0x6b27 => Some(unsafe { transmute(0x8977u32) }), 0x6b28 => Some(unsafe { transmute(0x897eu32) }), 0x6b29 => Some(unsafe { transmute(0x8983u32) }), 0x6b2a => Some(unsafe { transmute(0x8988u32) }), 0x6b2b => Some(unsafe { transmute(0x898au32) }), 0x6b2c => Some(unsafe { transmute(0x8993u32) }), 0x6b2d => Some(unsafe { transmute(0x8998u32) }), 0x6b2e => Some(unsafe { transmute(0x89a1u32) }), 0x6b2f => Some(unsafe { transmute(0x89a9u32) }), 0x6b30 => Some(unsafe { transmute(0x89a6u32) }), 0x6b31 => Some(unsafe { transmute(0x89acu32) }), 0x6b32 => Some(unsafe { transmute(0x89afu32) }), 0x6b33 => Some(unsafe { transmute(0x89b2u32) }), 0x6b34 => Some(unsafe { transmute(0x89bau32) }), 0x6b35 => Some(unsafe { transmute(0x89bdu32) }), 0x6b36 => Some(unsafe { transmute(0x89bfu32) }), 0x6b37 => Some(unsafe { transmute(0x89c0u32) }), 0x6b38 => Some(unsafe { transmute(0x89dau32) }), 0x6b39 => Some(unsafe { transmute(0x89dcu32) }), 0x6b3a => Some(unsafe { transmute(0x89ddu32) }), 0x6b3b => Some(unsafe { transmute(0x89e7u32) }), 0x6b3c => Some(unsafe { transmute(0x89f4u32) }), 0x6b3d => Some(unsafe { transmute(0x89f8u32) }), 0x6b3e => Some(unsafe { transmute(0x8a03u32) }), 0x6b3f => Some(unsafe { transmute(0x8a16u32) }), 0x6b40 => Some(unsafe { transmute(0x8a10u32) }), 0x6b41 => Some(unsafe { transmute(0x8a0cu32) }), 0x6b42 => Some(unsafe { transmute(0x8a1bu32) }), 0x6b43 => Some(unsafe { transmute(0x8a1du32) }), 0x6b44 => Some(unsafe { transmute(0x8a25u32) }), 0x6b45 => Some(unsafe { transmute(0x8a36u32) }), 0x6b46 => Some(unsafe { transmute(0x8a41u32) }), 0x6b47 => Some(unsafe { transmute(0x8a5bu32) }), 0x6b48 => Some(unsafe { transmute(0x8a52u32) }), 0x6b49 => Some(unsafe { transmute(0x8a46u32) }), 0x6b4a => Some(unsafe { transmute(0x8a48u32) }), 0x6b4b => Some(unsafe { transmute(0x8a7cu32) }), 0x6b4c => Some(unsafe { transmute(0x8a6du32) }), 0x6b4d => Some(unsafe { transmute(0x8a6cu32) }), 0x6b4e => Some(unsafe { transmute(0x8a62u32) }), 0x6b4f => Some(unsafe { transmute(0x8a85u32) }), 0x6b50 => Some(unsafe { transmute(0x8a82u32) }), 0x6b51 => Some(unsafe { transmute(0x8a84u32) }), 0x6b52 => Some(unsafe { transmute(0x8aa8u32) }), 0x6b53 => Some(unsafe { transmute(0x8aa1u32) }), 0x6b54 => Some(unsafe { transmute(0x8a91u32) }), 0x6b55 => Some(unsafe { transmute(0x8aa5u32) }), 0x6b56 => Some(unsafe { transmute(0x8aa6u32) }), 0x6b57 => Some(unsafe { transmute(0x8a9au32) }), 0x6b58 => Some(unsafe { transmute(0x8aa3u32) }), 0x6b59 => Some(unsafe { transmute(0x8ac4u32) }), 0x6b5a => Some(unsafe { transmute(0x8acdu32) }), 0x6b5b => Some(unsafe { transmute(0x8ac2u32) }), 0x6b5c => Some(unsafe { transmute(0x8adau32) }), 0x6b5d => Some(unsafe { transmute(0x8aebu32) }), 0x6b5e => Some(unsafe { transmute(0x8af3u32) }), 0x6b5f => Some(unsafe { transmute(0x8ae7u32) }), 0x6b60 => Some(unsafe { transmute(0x8ae4u32) }), 0x6b61 => Some(unsafe { transmute(0x8af1u32) }), 0x6b62 => Some(unsafe { transmute(0x8b14u32) }), 0x6b63 => Some(unsafe { transmute(0x8ae0u32) }), 0x6b64 => Some(unsafe { transmute(0x8ae2u32) }), 0x6b65 => Some(unsafe { transmute(0x8af7u32) }), 0x6b66 => Some(unsafe { transmute(0x8adeu32) }), 0x6b67 => Some(unsafe { transmute(0x8adbu32) }), 0x6b68 => Some(unsafe { transmute(0x8b0cu32) }), 0x6b69 => Some(unsafe { transmute(0x8b07u32) }), 0x6b6a => Some(unsafe { transmute(0x8b1au32) }), 0x6b6b => Some(unsafe { transmute(0x8ae1u32) }), 0x6b6c => Some(unsafe { transmute(0x8b16u32) }), 0x6b6d => Some(unsafe { transmute(0x8b10u32) }), 0x6b6e => Some(unsafe { transmute(0x8b17u32) }), 0x6b6f => Some(unsafe { transmute(0x8b20u32) }), 0x6b70 => Some(unsafe { transmute(0x8b33u32) }), 0x6b71 => Some(unsafe { transmute(0x97abu32) }), 0x6b72 => Some(unsafe { transmute(0x8b26u32) }), 0x6b73 => Some(unsafe { transmute(0x8b2bu32) }), 0x6b74 => Some(unsafe { transmute(0x8b3eu32) }), 0x6b75 => Some(unsafe { transmute(0x8b28u32) }), 0x6b76 => Some(unsafe { transmute(0x8b41u32) }), 0x6b77 => Some(unsafe { transmute(0x8b4cu32) }), 0x6b78 => Some(unsafe { transmute(0x8b4fu32) }), 0x6b79 => Some(unsafe { transmute(0x8b4eu32) }), 0x6b7a => Some(unsafe { transmute(0x8b49u32) }), 0x6b7b => Some(unsafe { transmute(0x8b56u32) }), 0x6b7c => Some(unsafe { transmute(0x8b5bu32) }), 0x6b7d => Some(unsafe { transmute(0x8b5au32) }), 0x6b7e => Some(unsafe { transmute(0x8b6bu32) }), 0x6c21 => Some(unsafe { transmute(0x8b5fu32) }), 0x6c22 => Some(unsafe { transmute(0x8b6cu32) }), 0x6c23 => Some(unsafe { transmute(0x8b6fu32) }), 0x6c24 => Some(unsafe { transmute(0x8b74u32) }), 0x6c25 => Some(unsafe { transmute(0x8b7du32) }), 0x6c26 => Some(unsafe { transmute(0x8b80u32) }), 0x6c27 => Some(unsafe { transmute(0x8b8cu32) }), 0x6c28 => Some(unsafe { transmute(0x8b8eu32) }), 0x6c29 => Some(unsafe { transmute(0x8b92u32) }), 0x6c2a => Some(unsafe { transmute(0x8b93u32) }), 0x6c2b => Some(unsafe { transmute(0x8b96u32) }), 0x6c2c => Some(unsafe { transmute(0x8b99u32) }), 0x6c2d => Some(unsafe { transmute(0x8b9au32) }), 0x6c2e => Some(unsafe { transmute(0x8c3au32) }), 0x6c2f => Some(unsafe { transmute(0x8c41u32) }), 0x6c30 => Some(unsafe { transmute(0x8c3fu32) }), 0x6c31 => Some(unsafe { transmute(0x8c48u32) }), 0x6c32 => Some(unsafe { transmute(0x8c4cu32) }), 0x6c33 => Some(unsafe { transmute(0x8c4eu32) }), 0x6c34 => Some(unsafe { transmute(0x8c50u32) }), 0x6c35 => Some(unsafe { transmute(0x8c55u32) }), 0x6c36 => Some(unsafe { transmute(0x8c62u32) }), 0x6c37 => Some(unsafe { transmute(0x8c6cu32) }), 0x6c38 => Some(unsafe { transmute(0x8c78u32) }), 0x6c39 => Some(unsafe { transmute(0x8c7au32) }), 0x6c3a => Some(unsafe { transmute(0x8c82u32) }), 0x6c3b => Some(unsafe { transmute(0x8c89u32) }), 0x6c3c => Some(unsafe { transmute(0x8c85u32) }), 0x6c3d => Some(unsafe { transmute(0x8c8au32) }), 0x6c3e => Some(unsafe { transmute(0x8c8du32) }), 0x6c3f => Some(unsafe { transmute(0x8c8eu32) }), 0x6c40 => Some(unsafe { transmute(0x8c94u32) }), 0x6c41 => Some(unsafe { transmute(0x8c7cu32) }), 0x6c42 => Some(unsafe { transmute(0x8c98u32) }), 0x6c43 => Some(unsafe { transmute(0x621du32) }), 0x6c44 => Some(unsafe { transmute(0x8cadu32) }), 0x6c45 => Some(unsafe { transmute(0x8caau32) }), 0x6c46 => Some(unsafe { transmute(0x8cbdu32) }), 0x6c47 => Some(unsafe { transmute(0x8cb2u32) }), 0x6c48 => Some(unsafe { transmute(0x8cb3u32) }), 0x6c49 => Some(unsafe { transmute(0x8caeu32) }), 0x6c4a => Some(unsafe { transmute(0x8cb6u32) }), 0x6c4b => Some(unsafe { transmute(0x8cc8u32) }), 0x6c4c => Some(unsafe { transmute(0x8cc1u32) }), 0x6c4d => Some(unsafe { transmute(0x8ce4u32) }), 0x6c4e => Some(unsafe { transmute(0x8ce3u32) }), 0x6c4f => Some(unsafe { transmute(0x8cdau32) }), 0x6c50 => Some(unsafe { transmute(0x8cfdu32) }), 0x6c51 => Some(unsafe { transmute(0x8cfau32) }), 0x6c52 => Some(unsafe { transmute(0x8cfbu32) }), 0x6c53 => Some(unsafe { transmute(0x8d04u32) }), 0x6c54 => Some(unsafe { transmute(0x8d05u32) }), 0x6c55 => Some(unsafe { transmute(0x8d0au32) }), 0x6c56 => Some(unsafe { transmute(0x8d07u32) }), 0x6c57 => Some(unsafe { transmute(0x8d0fu32) }), 0x6c58 => Some(unsafe { transmute(0x8d0du32) }), 0x6c59 => Some(unsafe { transmute(0x8d10u32) }), 0x6c5a => Some(unsafe { transmute(0x9f4eu32) }), 0x6c5b => Some(unsafe { transmute(0x8d13u32) }), 0x6c5c => Some(unsafe { transmute(0x8ccdu32) }), 0x6c5d => Some(unsafe { transmute(0x8d14u32) }), 0x6c5e => Some(unsafe { transmute(0x8d16u32) }), 0x6c5f => Some(unsafe { transmute(0x8d67u32) }), 0x6c60 => Some(unsafe { transmute(0x8d6du32) }), 0x6c61 => Some(unsafe { transmute(0x8d71u32) }), 0x6c62 => Some(unsafe { transmute(0x8d73u32) }), 0x6c63 => Some(unsafe { transmute(0x8d81u32) }), 0x6c64 => Some(unsafe { transmute(0x8d99u32) }), 0x6c65 => Some(unsafe { transmute(0x8dc2u32) }), 0x6c66 => Some(unsafe { transmute(0x8dbeu32) }), 0x6c67 => Some(unsafe { transmute(0x8dbau32) }), 0x6c68 => Some(unsafe { transmute(0x8dcfu32) }), 0x6c69 => Some(unsafe { transmute(0x8ddau32) }), 0x6c6a => Some(unsafe { transmute(0x8dd6u32) }), 0x6c6b => Some(unsafe { transmute(0x8dccu32) }), 0x6c6c => Some(unsafe { transmute(0x8ddbu32) }), 0x6c6d => Some(unsafe { transmute(0x8dcbu32) }), 0x6c6e => Some(unsafe { transmute(0x8deau32) }), 0x6c6f => Some(unsafe { transmute(0x8debu32) }), 0x6c70 => Some(unsafe { transmute(0x8ddfu32) }), 0x6c71 => Some(unsafe { transmute(0x8de3u32) }), 0x6c72 => Some(unsafe { transmute(0x8dfcu32) }), 0x6c73 => Some(unsafe { transmute(0x8e08u32) }), 0x6c74 => Some(unsafe { transmute(0x8e09u32) }), 0x6c75 => Some(unsafe { transmute(0x8dffu32) }), 0x6c76 => Some(unsafe { transmute(0x8e1du32) }), 0x6c77 => Some(unsafe { transmute(0x8e1eu32) }), 0x6c78 => Some(unsafe { transmute(0x8e10u32) }), 0x6c79 => Some(unsafe { transmute(0x8e1fu32) }), 0x6c7a => Some(unsafe { transmute(0x8e42u32) }), 0x6c7b => Some(unsafe { transmute(0x8e35u32) }), 0x6c7c => Some(unsafe { transmute(0x8e30u32) }), 0x6c7d => Some(unsafe { transmute(0x8e34u32) }), 0x6c7e => Some(unsafe { transmute(0x8e4au32) }), 0x6d21 => Some(unsafe { transmute(0x8e47u32) }), 0x6d22 => Some(unsafe { transmute(0x8e49u32) }), 0x6d23 => Some(unsafe { transmute(0x8e4cu32) }), 0x6d24 => Some(unsafe { transmute(0x8e50u32) }), 0x6d25 => Some(unsafe { transmute(0x8e48u32) }), 0x6d26 => Some(unsafe { transmute(0x8e59u32) }), 0x6d27 => Some(unsafe { transmute(0x8e64u32) }), 0x6d28 => Some(unsafe { transmute(0x8e60u32) }), 0x6d29 => Some(unsafe { transmute(0x8e2au32) }), 0x6d2a => Some(unsafe { transmute(0x8e63u32) }), 0x6d2b => Some(unsafe { transmute(0x8e55u32) }), 0x6d2c => Some(unsafe { transmute(0x8e76u32) }), 0x6d2d => Some(unsafe { transmute(0x8e72u32) }), 0x6d2e => Some(unsafe { transmute(0x8e7cu32) }), 0x6d2f => Some(unsafe { transmute(0x8e81u32) }), 0x6d30 => Some(unsafe { transmute(0x8e87u32) }), 0x6d31 => Some(unsafe { transmute(0x8e85u32) }), 0x6d32 => Some(unsafe { transmute(0x8e84u32) }), 0x6d33 => Some(unsafe { transmute(0x8e8bu32) }), 0x6d34 => Some(unsafe { transmute(0x8e8au32) }), 0x6d35 => Some(unsafe { transmute(0x8e93u32) }), 0x6d36 => Some(unsafe { transmute(0x8e91u32) }), 0x6d37 => Some(unsafe { transmute(0x8e94u32) }), 0x6d38 => Some(unsafe { transmute(0x8e99u32) }), 0x6d39 => Some(unsafe { transmute(0x8eaau32) }), 0x6d3a => Some(unsafe { transmute(0x8ea1u32) }), 0x6d3b => Some(unsafe { transmute(0x8eacu32) }), 0x6d3c => Some(unsafe { transmute(0x8eb0u32) }), 0x6d3d => Some(unsafe { transmute(0x8ec6u32) }), 0x6d3e => Some(unsafe { transmute(0x8eb1u32) }), 0x6d3f => Some(unsafe { transmute(0x8ebeu32) }), 0x6d40 => Some(unsafe { transmute(0x8ec5u32) }), 0x6d41 => Some(unsafe { transmute(0x8ec8u32) }), 0x6d42 => Some(unsafe { transmute(0x8ecbu32) }), 0x6d43 => Some(unsafe { transmute(0x8edbu32) }), 0x6d44 => Some(unsafe { transmute(0x8ee3u32) }), 0x6d45 => Some(unsafe { transmute(0x8efcu32) }), 0x6d46 => Some(unsafe { transmute(0x8efbu32) }), 0x6d47 => Some(unsafe { transmute(0x8eebu32) }), 0x6d48 => Some(unsafe { transmute(0x8efeu32) }), 0x6d49 => Some(unsafe { transmute(0x8f0au32) }), 0x6d4a => Some(unsafe { transmute(0x8f05u32) }), 0x6d4b => Some(unsafe { transmute(0x8f15u32) }), 0x6d4c => Some(unsafe { transmute(0x8f12u32) }), 0x6d4d => Some(unsafe { transmute(0x8f19u32) }), 0x6d4e => Some(unsafe { transmute(0x8f13u32) }), 0x6d4f => Some(unsafe { transmute(0x8f1cu32) }), 0x6d50 => Some(unsafe { transmute(0x8f1fu32) }), 0x6d51 => Some(unsafe { transmute(0x8f1bu32) }), 0x6d52 => Some(unsafe { transmute(0x8f0cu32) }), 0x6d53 => Some(unsafe { transmute(0x8f26u32) }), 0x6d54 => Some(unsafe { transmute(0x8f33u32) }), 0x6d55 => Some(unsafe { transmute(0x8f3bu32) }), 0x6d56 => Some(unsafe { transmute(0x8f39u32) }), 0x6d57 => Some(unsafe { transmute(0x8f45u32) }), 0x6d58 => Some(unsafe { transmute(0x8f42u32) }), 0x6d59 => Some(unsafe { transmute(0x8f3eu32) }), 0x6d5a => Some(unsafe { transmute(0x8f4cu32) }), 0x6d5b => Some(unsafe { transmute(0x8f49u32) }), 0x6d5c => Some(unsafe { transmute(0x8f46u32) }), 0x6d5d => Some(unsafe { transmute(0x8f4eu32) }), 0x6d5e => Some(unsafe { transmute(0x8f57u32) }), 0x6d5f => Some(unsafe { transmute(0x8f5cu32) }), 0x6d60 => Some(unsafe { transmute(0x8f62u32) }), 0x6d61 => Some(unsafe { transmute(0x8f63u32) }), 0x6d62 => Some(unsafe { transmute(0x8f64u32) }), 0x6d63 => Some(unsafe { transmute(0x8f9cu32) }), 0x6d64 => Some(unsafe { transmute(0x8f9fu32) }), 0x6d65 => Some(unsafe { transmute(0x8fa3u32) }), 0x6d66 => Some(unsafe { transmute(0x8fadu32) }), 0x6d67 => Some(unsafe { transmute(0x8fafu32) }), 0x6d68 => Some(unsafe { transmute(0x8fb7u32) }), 0x6d69 => Some(unsafe { transmute(0x8fdau32) }), 0x6d6a => Some(unsafe { transmute(0x8fe5u32) }), 0x6d6b => Some(unsafe { transmute(0x8fe2u32) }), 0x6d6c => Some(unsafe { transmute(0x8feau32) }), 0x6d6d => Some(unsafe { transmute(0x8fefu32) }), 0x6d6e => Some(unsafe { transmute(0x9087u32) }), 0x6d6f => Some(unsafe { transmute(0x8ff4u32) }), 0x6d70 => Some(unsafe { transmute(0x9005u32) }), 0x6d71 => Some(unsafe { transmute(0x8ff9u32) }), 0x6d72 => Some(unsafe { transmute(0x8ffau32) }), 0x6d73 => Some(unsafe { transmute(0x9011u32) }), 0x6d74 => Some(unsafe { transmute(0x9015u32) }), 0x6d75 => Some(unsafe { transmute(0x9021u32) }), 0x6d76 => Some(unsafe { transmute(0x900du32) }), 0x6d77 => Some(unsafe { transmute(0x901eu32) }), 0x6d78 => Some(unsafe { transmute(0x9016u32) }), 0x6d79 => Some(unsafe { transmute(0x900bu32) }), 0x6d7a => Some(unsafe { transmute(0x9027u32) }), 0x6d7b => Some(unsafe { transmute(0x9036u32) }), 0x6d7c => Some(unsafe { transmute(0x9035u32) }), 0x6d7d => Some(unsafe { transmute(0x9039u32) }), 0x6d7e => Some(unsafe { transmute(0x8ff8u32) }), 0x6e21 => Some(unsafe { transmute(0x904fu32) }), 0x6e22 => Some(unsafe { transmute(0x9050u32) }), 0x6e23 => Some(unsafe { transmute(0x9051u32) }), 0x6e24 => Some(unsafe { transmute(0x9052u32) }), 0x6e25 => Some(unsafe { transmute(0x900eu32) }), 0x6e26 => Some(unsafe { transmute(0x9049u32) }), 0x6e27 => Some(unsafe { transmute(0x903eu32) }), 0x6e28 => Some(unsafe { transmute(0x9056u32) }), 0x6e29 => Some(unsafe { transmute(0x9058u32) }), 0x6e2a => Some(unsafe { transmute(0x905eu32) }), 0x6e2b => Some(unsafe { transmute(0x9068u32) }), 0x6e2c => Some(unsafe { transmute(0x906fu32) }), 0x6e2d => Some(unsafe { transmute(0x9076u32) }), 0x6e2e => Some(unsafe { transmute(0x96a8u32) }), 0x6e2f => Some(unsafe { transmute(0x9072u32) }), 0x6e30 => Some(unsafe { transmute(0x9082u32) }), 0x6e31 => Some(unsafe { transmute(0x907du32) }), 0x6e32 => Some(unsafe { transmute(0x9081u32) }), 0x6e33 => Some(unsafe { transmute(0x9080u32) }), 0x6e34 => Some(unsafe { transmute(0x908au32) }), 0x6e35 => Some(unsafe { transmute(0x9089u32) }), 0x6e36 => Some(unsafe { transmute(0x908fu32) }), 0x6e37 => Some(unsafe { transmute(0x90a8u32) }), 0x6e38 => Some(unsafe { transmute(0x90afu32) }), 0x6e39 => Some(unsafe { transmute(0x90b1u32) }), 0x6e3a => Some(unsafe { transmute(0x90b5u32) }), 0x6e3b => Some(unsafe { transmute(0x90e2u32) }), 0x6e3c => Some(unsafe { transmute(0x90e4u32) }), 0x6e3d => Some(unsafe { transmute(0x6248u32) }), 0x6e3e => Some(unsafe { transmute(0x90dbu32) }), 0x6e3f => Some(unsafe { transmute(0x9102u32) }), 0x6e40 => Some(unsafe { transmute(0x9112u32) }), 0x6e41 => Some(unsafe { transmute(0x9119u32) }), 0x6e42 => Some(unsafe { transmute(0x9132u32) }), 0x6e43 => Some(unsafe { transmute(0x9130u32) }), 0x6e44 => Some(unsafe { transmute(0x914au32) }), 0x6e45 => Some(unsafe { transmute(0x9156u32) }), 0x6e46 => Some(unsafe { transmute(0x9158u32) }), 0x6e47 => Some(unsafe { transmute(0x9163u32) }), 0x6e48 => Some(unsafe { transmute(0x9165u32) }), 0x6e49 => Some(unsafe { transmute(0x9169u32) }), 0x6e4a => Some(unsafe { transmute(0x9173u32) }), 0x6e4b => Some(unsafe { transmute(0x9172u32) }), 0x6e4c => Some(unsafe { transmute(0x918bu32) }), 0x6e4d => Some(unsafe { transmute(0x9189u32) }), 0x6e4e => Some(unsafe { transmute(0x9182u32) }), 0x6e4f => Some(unsafe { transmute(0x91a2u32) }), 0x6e50 => Some(unsafe { transmute(0x91abu32) }), 0x6e51 => Some(unsafe { transmute(0x91afu32) }), 0x6e52 => Some(unsafe { transmute(0x91aau32) }), 0x6e53 => Some(unsafe { transmute(0x91b5u32) }), 0x6e54 => Some(unsafe { transmute(0x91b4u32) }), 0x6e55 => Some(unsafe { transmute(0x91bau32) }), 0x6e56 => Some(unsafe { transmute(0x91c0u32) }), 0x6e57 => Some(unsafe { transmute(0x91c1u32) }), 0x6e58 => Some(unsafe { transmute(0x91c9u32) }), 0x6e59 => Some(unsafe { transmute(0x91cbu32) }), 0x6e5a => Some(unsafe { transmute(0x91d0u32) }), 0x6e5b => Some(unsafe { transmute(0x91d6u32) }), 0x6e5c => Some(unsafe { transmute(0x91dfu32) }), 0x6e5d => Some(unsafe { transmute(0x91e1u32) }), 0x6e5e => Some(unsafe { transmute(0x91dbu32) }), 0x6e5f => Some(unsafe { transmute(0x91fcu32) }), 0x6e60 => Some(unsafe { transmute(0x91f5u32) }), 0x6e61 => Some(unsafe { transmute(0x91f6u32) }), 0x6e62 => Some(unsafe { transmute(0x921eu32) }), 0x6e63 => Some(unsafe { transmute(0x91ffu32) }), 0x6e64 => Some(unsafe { transmute(0x9214u32) }), 0x6e65 => Some(unsafe { transmute(0x922cu32) }), 0x6e66 => Some(unsafe { transmute(0x9215u32) }), 0x6e67 => Some(unsafe { transmute(0x9211u32) }), 0x6e68 => Some(unsafe { transmute(0x925eu32) }), 0x6e69 => Some(unsafe { transmute(0x9257u32) }), 0x6e6a => Some(unsafe { transmute(0x9245u32) }), 0x6e6b => Some(unsafe { transmute(0x9249u32) }), 0x6e6c => Some(unsafe { transmute(0x9264u32) }), 0x6e6d => Some(unsafe { transmute(0x9248u32) }), 0x6e6e => Some(unsafe { transmute(0x9295u32) }), 0x6e6f => Some(unsafe { transmute(0x923fu32) }), 0x6e70 => Some(unsafe { transmute(0x924bu32) }), 0x6e71 => Some(unsafe { transmute(0x9250u32) }), 0x6e72 => Some(unsafe { transmute(0x929cu32) }), 0x6e73 => Some(unsafe { transmute(0x9296u32) }), 0x6e74 => Some(unsafe { transmute(0x9293u32) }), 0x6e75 => Some(unsafe { transmute(0x929bu32) }), 0x6e76 => Some(unsafe { transmute(0x925au32) }), 0x6e77 => Some(unsafe { transmute(0x92cfu32) }), 0x6e78 => Some(unsafe { transmute(0x92b9u32) }), 0x6e79 => Some(unsafe { transmute(0x92b7u32) }), 0x6e7a => Some(unsafe { transmute(0x92e9u32) }), 0x6e7b => Some(unsafe { transmute(0x930fu32) }), 0x6e7c => Some(unsafe { transmute(0x92fau32) }), 0x6e7d => Some(unsafe { transmute(0x9344u32) }), 0x6e7e => Some(unsafe { transmute(0x932eu32) }), 0x6f21 => Some(unsafe { transmute(0x9319u32) }), 0x6f22 => Some(unsafe { transmute(0x9322u32) }), 0x6f23 => Some(unsafe { transmute(0x931au32) }), 0x6f24 => Some(unsafe { transmute(0x9323u32) }), 0x6f25 => Some(unsafe { transmute(0x933au32) }), 0x6f26 => Some(unsafe { transmute(0x9335u32) }), 0x6f27 => Some(unsafe { transmute(0x933bu32) }), 0x6f28 => Some(unsafe { transmute(0x935cu32) }), 0x6f29 => Some(unsafe { transmute(0x9360u32) }), 0x6f2a => Some(unsafe { transmute(0x937cu32) }), 0x6f2b => Some(unsafe { transmute(0x936eu32) }), 0x6f2c => Some(unsafe { transmute(0x9356u32) }), 0x6f2d => Some(unsafe { transmute(0x93b0u32) }), 0x6f2e => Some(unsafe { transmute(0x93acu32) }), 0x6f2f => Some(unsafe { transmute(0x93adu32) }), 0x6f30 => Some(unsafe { transmute(0x9394u32) }), 0x6f31 => Some(unsafe { transmute(0x93b9u32) }), 0x6f32 => Some(unsafe { transmute(0x93d6u32) }), 0x6f33 => Some(unsafe { transmute(0x93d7u32) }), 0x6f34 => Some(unsafe { transmute(0x93e8u32) }), 0x6f35 => Some(unsafe { transmute(0x93e5u32) }), 0x6f36 => Some(unsafe { transmute(0x93d8u32) }), 0x6f37 => Some(unsafe { transmute(0x93c3u32) }), 0x6f38 => Some(unsafe { transmute(0x93ddu32) }), 0x6f39 => Some(unsafe { transmute(0x93d0u32) }), 0x6f3a => Some(unsafe { transmute(0x93c8u32) }), 0x6f3b => Some(unsafe { transmute(0x93e4u32) }), 0x6f3c => Some(unsafe { transmute(0x941au32) }), 0x6f3d => Some(unsafe { transmute(0x9414u32) }), 0x6f3e => Some(unsafe { transmute(0x9413u32) }), 0x6f3f => Some(unsafe { transmute(0x9403u32) }), 0x6f40 => Some(unsafe { transmute(0x9407u32) }), 0x6f41 => Some(unsafe { transmute(0x9410u32) }), 0x6f42 => Some(unsafe { transmute(0x9436u32) }), 0x6f43 => Some(unsafe { transmute(0x942bu32) }), 0x6f44 => Some(unsafe { transmute(0x9435u32) }), 0x6f45 => Some(unsafe { transmute(0x9421u32) }), 0x6f46 => Some(unsafe { transmute(0x943au32) }), 0x6f47 => Some(unsafe { transmute(0x9441u32) }), 0x6f48 => Some(unsafe { transmute(0x9452u32) }), 0x6f49 => Some(unsafe { transmute(0x9444u32) }), 0x6f4a => Some(unsafe { transmute(0x945bu32) }), 0x6f4b => Some(unsafe { transmute(0x9460u32) }), 0x6f4c => Some(unsafe { transmute(0x9462u32) }), 0x6f4d => Some(unsafe { transmute(0x945eu32) }), 0x6f4e => Some(unsafe { transmute(0x946au32) }), 0x6f4f => Some(unsafe { transmute(0x9229u32) }), 0x6f50 => Some(unsafe { transmute(0x9470u32) }), 0x6f51 => Some(unsafe { transmute(0x9475u32) }), 0x6f52 => Some(unsafe { transmute(0x9477u32) }), 0x6f53 => Some(unsafe { transmute(0x947du32) }), 0x6f54 => Some(unsafe { transmute(0x945au32) }), 0x6f55 => Some(unsafe { transmute(0x947cu32) }), 0x6f56 => Some(unsafe { transmute(0x947eu32) }), 0x6f57 => Some(unsafe { transmute(0x9481u32) }), 0x6f58 => Some(unsafe { transmute(0x947fu32) }), 0x6f59 => Some(unsafe { transmute(0x9582u32) }), 0x6f5a => Some(unsafe { transmute(0x9587u32) }), 0x6f5b => Some(unsafe { transmute(0x958au32) }), 0x6f5c => Some(unsafe { transmute(0x9594u32) }), 0x6f5d => Some(unsafe { transmute(0x9596u32) }), 0x6f5e => Some(unsafe { transmute(0x9598u32) }), 0x6f5f => Some(unsafe { transmute(0x9599u32) }), 0x6f60 => Some(unsafe { transmute(0x95a0u32) }), 0x6f61 => Some(unsafe { transmute(0x95a8u32) }), 0x6f62 => Some(unsafe { transmute(0x95a7u32) }), 0x6f63 => Some(unsafe { transmute(0x95adu32) }), 0x6f64 => Some(unsafe { transmute(0x95bcu32) }), 0x6f65 => Some(unsafe { transmute(0x95bbu32) }), 0x6f66 => Some(unsafe { transmute(0x95b9u32) }), 0x6f67 => Some(unsafe { transmute(0x95beu32) }), 0x6f68 => Some(unsafe { transmute(0x95cau32) }), 0x6f69 => Some(unsafe { transmute(0x6ff6u32) }), 0x6f6a => Some(unsafe { transmute(0x95c3u32) }), 0x6f6b => Some(unsafe { transmute(0x95cdu32) }), 0x6f6c => Some(unsafe { transmute(0x95ccu32) }), 0x6f6d => Some(unsafe { transmute(0x95d5u32) }), 0x6f6e => Some(unsafe { transmute(0x95d4u32) }), 0x6f6f => Some(unsafe { transmute(0x95d6u32) }), 0x6f70 => Some(unsafe { transmute(0x95dcu32) }), 0x6f71 => Some(unsafe { transmute(0x95e1u32) }), 0x6f72 => Some(unsafe { transmute(0x95e5u32) }), 0x6f73 => Some(unsafe { transmute(0x95e2u32) }), 0x6f74 => Some(unsafe { transmute(0x9621u32) }), 0x6f75 => Some(unsafe { transmute(0x9628u32) }), 0x6f76 => Some(unsafe { transmute(0x962eu32) }), 0x6f77 => Some(unsafe { transmute(0x962fu32) }), 0x6f78 => Some(unsafe { transmute(0x9642u32) }), 0x6f79 => Some(unsafe { transmute(0x964cu32) }), 0x6f7a => Some(unsafe { transmute(0x964fu32) }), 0x6f7b => Some(unsafe { transmute(0x964bu32) }), 0x6f7c => Some(unsafe { transmute(0x9677u32) }), 0x6f7d => Some(unsafe { transmute(0x965cu32) }), 0x6f7e => Some(unsafe { transmute(0x965eu32) }), 0x7021 => Some(unsafe { transmute(0x965du32) }), 0x7022 => Some(unsafe { transmute(0x965fu32) }), 0x7023 => Some(unsafe { transmute(0x9666u32) }), 0x7024 => Some(unsafe { transmute(0x9672u32) }), 0x7025 => Some(unsafe { transmute(0x966cu32) }), 0x7026 => Some(unsafe { transmute(0x968du32) }), 0x7027 => Some(unsafe { transmute(0x9698u32) }), 0x7028 => Some(unsafe { transmute(0x9695u32) }), 0x7029 => Some(unsafe { transmute(0x9697u32) }), 0x702a => Some(unsafe { transmute(0x96aau32) }), 0x702b => Some(unsafe { transmute(0x96a7u32) }), 0x702c => Some(unsafe { transmute(0x96b1u32) }), 0x702d => Some(unsafe { transmute(0x96b2u32) }), 0x702e => Some(unsafe { transmute(0x96b0u32) }), 0x702f => Some(unsafe { transmute(0x96b4u32) }), 0x7030 => Some(unsafe { transmute(0x96b6u32) }), 0x7031 => Some(unsafe { transmute(0x96b8u32) }), 0x7032 => Some(unsafe { transmute(0x96b9u32) }), 0x7033 => Some(unsafe { transmute(0x96ceu32) }), 0x7034 => Some(unsafe { transmute(0x96cbu32) }), 0x7035 => Some(unsafe { transmute(0x96c9u32) }), 0x7036 => Some(unsafe { transmute(0x96cdu32) }), 0x7037 => Some(unsafe { transmute(0x894du32) }), 0x7038 => Some(unsafe { transmute(0x96dcu32) }), 0x7039 => Some(unsafe { transmute(0x970du32) }), 0x703a => Some(unsafe { transmute(0x96d5u32) }), 0x703b => Some(unsafe { transmute(0x96f9u32) }), 0x703c => Some(unsafe { transmute(0x9704u32) }), 0x703d => Some(unsafe { transmute(0x9706u32) }), 0x703e => Some(unsafe { transmute(0x9708u32) }), 0x703f => Some(unsafe { transmute(0x9713u32) }), 0x7040 => Some(unsafe { transmute(0x970eu32) }), 0x7041 => Some(unsafe { transmute(0x9711u32) }), 0x7042 => Some(unsafe { transmute(0x970fu32) }), 0x7043 => Some(unsafe { transmute(0x9716u32) }), 0x7044 => Some(unsafe { transmute(0x9719u32) }), 0x7045 => Some(unsafe { transmute(0x9724u32) }), 0x7046 => Some(unsafe { transmute(0x972au32) }), 0x7047 => Some(unsafe { transmute(0x9730u32) }), 0x7048 => Some(unsafe { transmute(0x9739u32) }), 0x7049 => Some(unsafe { transmute(0x973du32) }), 0x704a => Some(unsafe { transmute(0x973eu32) }), 0x704b => Some(unsafe { transmute(0x9744u32) }), 0x704c => Some(unsafe { transmute(0x9746u32) }), 0x704d => Some(unsafe { transmute(0x9748u32) }), 0x704e => Some(unsafe { transmute(0x9742u32) }), 0x704f => Some(unsafe { transmute(0x9749u32) }), 0x7050 => Some(unsafe { transmute(0x975cu32) }), 0x7051 => Some(unsafe { transmute(0x9760u32) }), 0x7052 => Some(unsafe { transmute(0x9764u32) }), 0x7053 => Some(unsafe { transmute(0x9766u32) }), 0x7054 => Some(unsafe { transmute(0x9768u32) }), 0x7055 => Some(unsafe { transmute(0x52d2u32) }), 0x7056 => Some(unsafe { transmute(0x976bu32) }), 0x7057 => Some(unsafe { transmute(0x9771u32) }), 0x7058 => Some(unsafe { transmute(0x9779u32) }), 0x7059 => Some(unsafe { transmute(0x9785u32) }), 0x705a => Some(unsafe { transmute(0x977cu32) }), 0x705b => Some(unsafe { transmute(0x9781u32) }), 0x705c => Some(unsafe { transmute(0x977au32) }), 0x705d => Some(unsafe { transmute(0x9786u32) }), 0x705e => Some(unsafe { transmute(0x978bu32) }), 0x705f => Some(unsafe { transmute(0x978fu32) }), 0x7060 => Some(unsafe { transmute(0x9790u32) }), 0x7061 => Some(unsafe { transmute(0x979cu32) }), 0x7062 => Some(unsafe { transmute(0x97a8u32) }), 0x7063 => Some(unsafe { transmute(0x97a6u32) }), 0x7064 => Some(unsafe { transmute(0x97a3u32) }), 0x7065 => Some(unsafe { transmute(0x97b3u32) }), 0x7066 => Some(unsafe { transmute(0x97b4u32) }), 0x7067 => Some(unsafe { transmute(0x97c3u32) }), 0x7068 => Some(unsafe { transmute(0x97c6u32) }), 0x7069 => Some(unsafe { transmute(0x97c8u32) }), 0x706a => Some(unsafe { transmute(0x97cbu32) }), 0x706b => Some(unsafe { transmute(0x97dcu32) }), 0x706c => Some(unsafe { transmute(0x97edu32) }), 0x706d => Some(unsafe { transmute(0x9f4fu32) }), 0x706e => Some(unsafe { transmute(0x97f2u32) }), 0x706f => Some(unsafe { transmute(0x7adfu32) }), 0x7070 => Some(unsafe { transmute(0x97f6u32) }), 0x7071 => Some(unsafe { transmute(0x97f5u32) }), 0x7072 => Some(unsafe { transmute(0x980fu32) }), 0x7073 => Some(unsafe { transmute(0x980cu32) }), 0x7074 => Some(unsafe { transmute(0x9838u32) }), 0x7075 => Some(unsafe { transmute(0x9824u32) }), 0x7076 => Some(unsafe { transmute(0x9821u32) }), 0x7077 => Some(unsafe { transmute(0x9837u32) }), 0x7078 => Some(unsafe { transmute(0x983du32) }), 0x7079 => Some(unsafe { transmute(0x9846u32) }), 0x707a => Some(unsafe { transmute(0x984fu32) }), 0x707b => Some(unsafe { transmute(0x984bu32) }), 0x707c => Some(unsafe { transmute(0x986bu32) }), 0x707d => Some(unsafe { transmute(0x986fu32) }), 0x707e => Some(unsafe { transmute(0x9870u32) }), 0x7121 => Some(unsafe { transmute(0x9871u32) }), 0x7122 => Some(unsafe { transmute(0x9874u32) }), 0x7123 => Some(unsafe { transmute(0x9873u32) }), 0x7124 => Some(unsafe { transmute(0x98aau32) }), 0x7125 => Some(unsafe { transmute(0x98afu32) }), 0x7126 => Some(unsafe { transmute(0x98b1u32) }), 0x7127 => Some(unsafe { transmute(0x98b6u32) }), 0x7128 => Some(unsafe { transmute(0x98c4u32) }), 0x7129 => Some(unsafe { transmute(0x98c3u32) }), 0x712a => Some(unsafe { transmute(0x98c6u32) }), 0x712b => Some(unsafe { transmute(0x98e9u32) }), 0x712c => Some(unsafe { transmute(0x98ebu32) }), 0x712d => Some(unsafe { transmute(0x9903u32) }), 0x712e => Some(unsafe { transmute(0x9909u32) }), 0x712f => Some(unsafe { transmute(0x9912u32) }), 0x7130 => Some(unsafe { transmute(0x9914u32) }), 0x7131 => Some(unsafe { transmute(0x9918u32) }), 0x7132 => Some(unsafe { transmute(0x9921u32) }), 0x7133 => Some(unsafe { transmute(0x991du32) }), 0x7134 => Some(unsafe { transmute(0x991eu32) }), 0x7135 => Some(unsafe { transmute(0x9924u32) }), 0x7136 => Some(unsafe { transmute(0x9920u32) }), 0x7137 => Some(unsafe { transmute(0x992cu32) }), 0x7138 => Some(unsafe { transmute(0x992eu32) }), 0x7139 => Some(unsafe { transmute(0x993du32) }), 0x713a => Some(unsafe { transmute(0x993eu32) }), 0x713b => Some(unsafe { transmute(0x9942u32) }), 0x713c => Some(unsafe { transmute(0x9949u32) }), 0x713d => Some(unsafe { transmute(0x9945u32) }), 0x713e => Some(unsafe { transmute(0x9950u32) }), 0x713f => Some(unsafe { transmute(0x994bu32) }), 0x7140 => Some(unsafe { transmute(0x9951u32) }), 0x7141 => Some(unsafe { transmute(0x9952u32) }), 0x7142 => Some(unsafe { transmute(0x994cu32) }), 0x7143 => Some(unsafe { transmute(0x9955u32) }), 0x7144 => Some(unsafe { transmute(0x9997u32) }), 0x7145 => Some(unsafe { transmute(0x9998u32) }), 0x7146 => Some(unsafe { transmute(0x99a5u32) }), 0x7147 => Some(unsafe { transmute(0x99adu32) }), 0x7148 => Some(unsafe { transmute(0x99aeu32) }), 0x7149 => Some(unsafe { transmute(0x99bcu32) }), 0x714a => Some(unsafe { transmute(0x99dfu32) }), 0x714b => Some(unsafe { transmute(0x99dbu32) }), 0x714c => Some(unsafe { transmute(0x99ddu32) }), 0x714d => Some(unsafe { transmute(0x99d8u32) }), 0x714e => Some(unsafe { transmute(0x99d1u32) }), 0x714f => Some(unsafe { transmute(0x99edu32) }), 0x7150 => Some(unsafe { transmute(0x99eeu32) }), 0x7151 => Some(unsafe { transmute(0x99f1u32) }), 0x7152 => Some(unsafe { transmute(0x99f2u32) }), 0x7153 => Some(unsafe { transmute(0x99fbu32) }), 0x7154 => Some(unsafe { transmute(0x99f8u32) }), 0x7155 => Some(unsafe { transmute(0x9a01u32) }), 0x7156 => Some(unsafe { transmute(0x9a0fu32) }), 0x7157 => Some(unsafe { transmute(0x9a05u32) }), 0x7158 => Some(unsafe { transmute(0x99e2u32) }), 0x7159 => Some(unsafe { transmute(0x9a19u32) }), 0x715a => Some(unsafe { transmute(0x9a2bu32) }), 0x715b => Some(unsafe { transmute(0x9a37u32) }), 0x715c => Some(unsafe { transmute(0x9a45u32) }), 0x715d => Some(unsafe { transmute(0x9a42u32) }), 0x715e => Some(unsafe { transmute(0x9a40u32) }), 0x715f => Some(unsafe { transmute(0x9a43u32) }), 0x7160 => Some(unsafe { transmute(0x9a3eu32) }), 0x7161 => Some(unsafe { transmute(0x9a55u32) }), 0x7162 => Some(unsafe { transmute(0x9a4du32) }), 0x7163 => Some(unsafe { transmute(0x9a5bu32) }), 0x7164 => Some(unsafe { transmute(0x9a57u32) }), 0x7165 => Some(unsafe { transmute(0x9a5fu32) }), 0x7166 => Some(unsafe { transmute(0x9a62u32) }), 0x7167 => Some(unsafe { transmute(0x9a65u32) }), 0x7168 => Some(unsafe { transmute(0x9a64u32) }), 0x7169 => Some(unsafe { transmute(0x9a69u32) }), 0x716a => Some(unsafe { transmute(0x9a6bu32) }), 0x716b => Some(unsafe { transmute(0x9a6au32) }), 0x716c => Some(unsafe { transmute(0x9aadu32) }), 0x716d => Some(unsafe { transmute(0x9ab0u32) }), 0x716e => Some(unsafe { transmute(0x9abcu32) }), 0x716f => Some(unsafe { transmute(0x9ac0u32) }), 0x7170 => Some(unsafe { transmute(0x9acfu32) }), 0x7171 => Some(unsafe { transmute(0x9ad1u32) }), 0x7172 => Some(unsafe { transmute(0x9ad3u32) }), 0x7173 => Some(unsafe { transmute(0x9ad4u32) }), 0x7174 => Some(unsafe { transmute(0x9adeu32) }), 0x7175 => Some(unsafe { transmute(0x9adfu32) }), 0x7176 => Some(unsafe { transmute(0x9ae2u32) }), 0x7177 => Some(unsafe { transmute(0x9ae3u32) }), 0x7178 => Some(unsafe { transmute(0x9ae6u32) }), 0x7179 => Some(unsafe { transmute(0x9aefu32) }), 0x717a => Some(unsafe { transmute(0x9aebu32) }), 0x717b => Some(unsafe { transmute(0x9aeeu32) }), 0x717c => Some(unsafe { transmute(0x9af4u32) }), 0x717d => Some(unsafe { transmute(0x9af1u32) }), 0x717e => Some(unsafe { transmute(0x9af7u32) }), 0x7221 => Some(unsafe { transmute(0x9afbu32) }), 0x7222 => Some(unsafe { transmute(0x9b06u32) }), 0x7223 => Some(unsafe { transmute(0x9b18u32) }), 0x7224 => Some(unsafe { transmute(0x9b1au32) }), 0x7225 => Some(unsafe { transmute(0x9b1fu32) }), 0x7226 => Some(unsafe { transmute(0x9b22u32) }), 0x7227 => Some(unsafe { transmute(0x9b23u32) }), 0x7228 => Some(unsafe { transmute(0x9b25u32) }), 0x7229 => Some(unsafe { transmute(0x9b27u32) }), 0x722a => Some(unsafe { transmute(0x9b28u32) }), 0x722b => Some(unsafe { transmute(0x9b29u32) }), 0x722c => Some(unsafe { transmute(0x9b2au32) }), 0x722d => Some(unsafe { transmute(0x9b2eu32) }), 0x722e => Some(unsafe { transmute(0x9b2fu32) }), 0x722f => Some(unsafe { transmute(0x9b32u32) }), 0x7230 => Some(unsafe { transmute(0x9b44u32) }), 0x7231 => Some(unsafe { transmute(0x9b43u32) }), 0x7232 => Some(unsafe { transmute(0x9b4fu32) }), 0x7233 => Some(unsafe { transmute(0x9b4du32) }), 0x7234 => Some(unsafe { transmute(0x9b4eu32) }), 0x7235 => Some(unsafe { transmute(0x9b51u32) }), 0x7236 => Some(unsafe { transmute(0x9b58u32) }), 0x7237 => Some(unsafe { transmute(0x9b74u32) }), 0x7238 => Some(unsafe { transmute(0x9b93u32) }), 0x7239 => Some(unsafe { transmute(0x9b83u32) }), 0x723a => Some(unsafe { transmute(0x9b91u32) }), 0x723b => Some(unsafe { transmute(0x9b96u32) }), 0x723c => Some(unsafe { transmute(0x9b97u32) }), 0x723d => Some(unsafe { transmute(0x9b9fu32) }), 0x723e => Some(unsafe { transmute(0x9ba0u32) }), 0x723f => Some(unsafe { transmute(0x9ba8u32) }), 0x7240 => Some(unsafe { transmute(0x9bb4u32) }), 0x7241 => Some(unsafe { transmute(0x9bc0u32) }), 0x7242 => Some(unsafe { transmute(0x9bcau32) }), 0x7243 => Some(unsafe { transmute(0x9bb9u32) }), 0x7244 => Some(unsafe { transmute(0x9bc6u32) }), 0x7245 => Some(unsafe { transmute(0x9bcfu32) }), 0x7246 => Some(unsafe { transmute(0x9bd1u32) }), 0x7247 => Some(unsafe { transmute(0x9bd2u32) }), 0x7248 => Some(unsafe { transmute(0x9be3u32) }), 0x7249 => Some(unsafe { transmute(0x9be2u32) }), 0x724a => Some(unsafe { transmute(0x9be4u32) }), 0x724b => Some(unsafe { transmute(0x9bd4u32) }), 0x724c => Some(unsafe { transmute(0x9be1u32) }), 0x724d => Some(unsafe { transmute(0x9c3au32) }), 0x724e => Some(unsafe { transmute(0x9bf2u32) }), 0x724f => Some(unsafe { transmute(0x9bf1u32) }), 0x7250 => Some(unsafe { transmute(0x9bf0u32) }), 0x7251 => Some(unsafe { transmute(0x9c15u32) }), 0x7252 => Some(unsafe { transmute(0x9c14u32) }), 0x7253 => Some(unsafe { transmute(0x9c09u32) }), 0x7254 => Some(unsafe { transmute(0x9c13u32) }), 0x7255 => Some(unsafe { transmute(0x9c0cu32) }), 0x7256 => Some(unsafe { transmute(0x9c06u32) }), 0x7257 => Some(unsafe { transmute(0x9c08u32) }), 0x7258 => Some(unsafe { transmute(0x9c12u32) }), 0x7259 => Some(unsafe { transmute(0x9c0au32) }), 0x725a => Some(unsafe { transmute(0x9c04u32) }), 0x725b => Some(unsafe { transmute(0x9c2eu32) }), 0x725c => Some(unsafe { transmute(0x9c1bu32) }), 0x725d => Some(unsafe { transmute(0x9c25u32) }), 0x725e => Some(unsafe { transmute(0x9c24u32) }), 0x725f => Some(unsafe { transmute(0x9c21u32) }), 0x7260 => Some(unsafe { transmute(0x9c30u32) }), 0x7261 => Some(unsafe { transmute(0x9c47u32) }), 0x7262 => Some(unsafe { transmute(0x9c32u32) }), 0x7263 => Some(unsafe { transmute(0x9c46u32) }), 0x7264 => Some(unsafe { transmute(0x9c3eu32) }), 0x7265 => Some(unsafe { transmute(0x9c5au32) }), 0x7266 => Some(unsafe { transmute(0x9c60u32) }), 0x7267 => Some(unsafe { transmute(0x9c67u32) }), 0x7268 => Some(unsafe { transmute(0x9c76u32) }), 0x7269 => Some(unsafe { transmute(0x9c78u32) }), 0x726a => Some(unsafe { transmute(0x9ce7u32) }), 0x726b => Some(unsafe { transmute(0x9cecu32) }), 0x726c => Some(unsafe { transmute(0x9cf0u32) }), 0x726d => Some(unsafe { transmute(0x9d09u32) }), 0x726e => Some(unsafe { transmute(0x9d08u32) }), 0x726f => Some(unsafe { transmute(0x9cebu32) }), 0x7270 => Some(unsafe { transmute(0x9d03u32) }), 0x7271 => Some(unsafe { transmute(0x9d06u32) }), 0x7272 => Some(unsafe { transmute(0x9d2au32) }), 0x7273 => Some(unsafe { transmute(0x9d26u32) }), 0x7274 => Some(unsafe { transmute(0x9dafu32) }), 0x7275 => Some(unsafe { transmute(0x9d23u32) }), 0x7276 => Some(unsafe { transmute(0x9d1fu32) }), 0x7277 => Some(unsafe { transmute(0x9d44u32) }), 0x7278 => Some(unsafe { transmute(0x9d15u32) }), 0x7279 => Some(unsafe { transmute(0x9d12u32) }), 0x727a => Some(unsafe { transmute(0x9d41u32) }), 0x727b => Some(unsafe { transmute(0x9d3fu32) }), 0x727c => Some(unsafe { transmute(0x9d3eu32) }), 0x727d => Some(unsafe { transmute(0x9d46u32) }), 0x727e => Some(unsafe { transmute(0x9d48u32) }), 0x7321 => Some(unsafe { transmute(0x9d5du32) }), 0x7322 => Some(unsafe { transmute(0x9d5eu32) }), 0x7323 => Some(unsafe { transmute(0x9d64u32) }), 0x7324 => Some(unsafe { transmute(0x9d51u32) }), 0x7325 => Some(unsafe { transmute(0x9d50u32) }), 0x7326 => Some(unsafe { transmute(0x9d59u32) }), 0x7327 => Some(unsafe { transmute(0x9d72u32) }), 0x7328 => Some(unsafe { transmute(0x9d89u32) }), 0x7329 => Some(unsafe { transmute(0x9d87u32) }), 0x732a => Some(unsafe { transmute(0x9dabu32) }), 0x732b => Some(unsafe { transmute(0x9d6fu32) }), 0x732c => Some(unsafe { transmute(0x9d7au32) }), 0x732d => Some(unsafe { transmute(0x9d9au32) }), 0x732e => Some(unsafe { transmute(0x9da4u32) }), 0x732f => Some(unsafe { transmute(0x9da9u32) }), 0x7330 => Some(unsafe { transmute(0x9db2u32) }), 0x7331 => Some(unsafe { transmute(0x9dc4u32) }), 0x7332 => Some(unsafe { transmute(0x9dc1u32) }), 0x7333 => Some(unsafe { transmute(0x9dbbu32) }), 0x7334 => Some(unsafe { transmute(0x9db8u32) }), 0x7335 => Some(unsafe { transmute(0x9dbau32) }), 0x7336 => Some(unsafe { transmute(0x9dc6u32) }), 0x7337 => Some(unsafe { transmute(0x9dcfu32) }), 0x7338 => Some(unsafe { transmute(0x9dc2u32) }), 0x7339 => Some(unsafe { transmute(0x9dd9u32) }), 0x733a => Some(unsafe { transmute(0x9dd3u32) }), 0x733b => Some(unsafe { transmute(0x9df8u32) }), 0x733c => Some(unsafe { transmute(0x9de6u32) }), 0x733d => Some(unsafe { transmute(0x9dedu32) }), 0x733e => Some(unsafe { transmute(0x9defu32) }), 0x733f => Some(unsafe { transmute(0x9dfdu32) }), 0x7340 => Some(unsafe { transmute(0x9e1au32) }), 0x7341 => Some(unsafe { transmute(0x9e1bu32) }), 0x7342 => Some(unsafe { transmute(0x9e1eu32) }), 0x7343 => Some(unsafe { transmute(0x9e75u32) }), 0x7344 => Some(unsafe { transmute(0x9e79u32) }), 0x7345 => Some(unsafe { transmute(0x9e7du32) }), 0x7346 => Some(unsafe { transmute(0x9e81u32) }), 0x7347 => Some(unsafe { transmute(0x9e88u32) }), 0x7348 => Some(unsafe { transmute(0x9e8bu32) }), 0x7349 => Some(unsafe { transmute(0x9e8cu32) }), 0x734a => Some(unsafe { transmute(0x9e92u32) }), 0x734b => Some(unsafe { transmute(0x9e95u32) }), 0x734c => Some(unsafe { transmute(0x9e91u32) }), 0x734d => Some(unsafe { transmute(0x9e9du32) }), 0x734e => Some(unsafe { transmute(0x9ea5u32) }), 0x734f => Some(unsafe { transmute(0x9ea9u32) }), 0x7350 => Some(unsafe { transmute(0x9eb8u32) }), 0x7351 => Some(unsafe { transmute(0x9eaau32) }), 0x7352 => Some(unsafe { transmute(0x9eadu32) }), 0x7353 => Some(unsafe { transmute(0x9761u32) }), 0x7354 => Some(unsafe { transmute(0x9eccu32) }), 0x7355 => Some(unsafe { transmute(0x9eceu32) }), 0x7356 => Some(unsafe { transmute(0x9ecfu32) }), 0x7357 => Some(unsafe { transmute(0x9ed0u32) }), 0x7358 => Some(unsafe { transmute(0x9ed4u32) }), 0x7359 => Some(unsafe { transmute(0x9edcu32) }), 0x735a => Some(unsafe { transmute(0x9edeu32) }), 0x735b => Some(unsafe { transmute(0x9eddu32) }), 0x735c => Some(unsafe { transmute(0x9ee0u32) }), 0x735d => Some(unsafe { transmute(0x9ee5u32) }), 0x735e => Some(unsafe { transmute(0x9ee8u32) }), 0x735f => Some(unsafe { transmute(0x9eefu32) }), 0x7360 => Some(unsafe { transmute(0x9ef4u32) }), 0x7361 => Some(unsafe { transmute(0x9ef6u32) }), 0x7362 => Some(unsafe { transmute(0x9ef7u32) }), 0x7363 => Some(unsafe { transmute(0x9ef9u32) }), 0x7364 => Some(unsafe { transmute(0x9efbu32) }), 0x7365 => Some(unsafe { transmute(0x9efcu32) }), 0x7366 => Some(unsafe { transmute(0x9efdu32) }), 0x7367 => Some(unsafe { transmute(0x9f07u32) }), 0x7368 => Some(unsafe { transmute(0x9f08u32) }), 0x7369 => Some(unsafe { transmute(0x76b7u32) }), 0x736a => Some(unsafe { transmute(0x9f15u32) }), 0x736b => Some(unsafe { transmute(0x9f21u32) }), 0x736c => Some(unsafe { transmute(0x9f2cu32) }), 0x736d => Some(unsafe { transmute(0x9f3eu32) }), 0x736e => Some(unsafe { transmute(0x9f4au32) }), 0x736f => Some(unsafe { transmute(0x9f52u32) }), 0x7370 => Some(unsafe { transmute(0x9f54u32) }), 0x7371 => Some(unsafe { transmute(0x9f63u32) }), 0x7372 => Some(unsafe { transmute(0x9f5fu32) }), 0x7373 => Some(unsafe { transmute(0x9f60u32) }), 0x7374 => Some(unsafe { transmute(0x9f61u32) }), 0x7375 => Some(unsafe { transmute(0x9f66u32) }), 0x7376 => Some(unsafe { transmute(0x9f67u32) }), 0x7377 => Some(unsafe { transmute(0x9f6cu32) }), 0x7378 => Some(unsafe { transmute(0x9f6au32) }), 0x7379 => Some(unsafe { transmute(0x9f77u32) }), 0x737a => Some(unsafe { transmute(0x9f72u32) }), 0x737b => Some(unsafe { transmute(0x9f76u32) }), 0x737c => Some(unsafe { transmute(0x9f95u32) }), 0x737d => Some(unsafe { transmute(0x9f9cu32) }), 0x737e => Some(unsafe { transmute(0x9fa0u32) }), 0x7421 => Some(unsafe { transmute(0x582fu32) }), 0x7422 => Some(unsafe { transmute(0x69c7u32) }), 0x7423 => Some(unsafe { transmute(0x9059u32) }), 0x7424 => Some(unsafe { transmute(0x7464u32) }), 0x7425 => Some(unsafe { transmute(0x51dcu32) }), 0x7426 => Some(unsafe { transmute(0x7199u32) }), _ => None } } pub fn encode(ch: char) -> Option<u16> { match ch as u32 { 0x3000 => Some(0x2121u16), 0x3001 => Some(0x2122u16), 0x3002 => Some(0x2123u16), 0xff0c => Some(0x2124u16), 0xff0e => Some(0x2125u16), 0x30fb => Some(0x2126u16), 0xff1a => Some(0x2127u16), 0xff1b => Some(0x2128u16), 0xff1f => Some(0x2129u16), 0xff01 => Some(0x212au16), 0x309b => Some(0x212bu16), 0x309c => Some(0x212cu16), 0x00b4 => Some(0x212du16), 0xff40 => Some(0x212eu16), 0x00a8 => Some(0x212fu16), 0xff3e => Some(0x2130u16), 0xffe3 => Some(0x2131u16), 0xff3f => Some(0x2132u16), 0x30fd => Some(0x2133u16), 0x30fe => Some(0x2134u16), 0x309d => Some(0x2135u16), 0x309e => Some(0x2136u16), 0x3003 => Some(0x2137u16), 0x4edd => Some(0x2138u16), 0x3005 => Some(0x2139u16), 0x3006 => Some(0x213au16), 0x3007 => Some(0x213bu16), 0x30fc => Some(0x213cu16), 0x2015 => Some(0x213du16), 0x2010 => Some(0x213eu16), 0xff0f => Some(0x213fu16), 0x005c => Some(0x2140u16), 0x301c => Some(0x2141u16), 0x2016 => Some(0x2142u16), 0xff5c => Some(0x2143u16), 0x2026 => Some(0x2144u16), 0x2025 => Some(0x2145u16), 0x2018 => Some(0x2146u16), 0x2019 => Some(0x2147u16), 0x201c => Some(0x2148u16), 0x201d => Some(0x2149u16), 0xff08 => Some(0x214au16), 0xff09 => Some(0x214bu16), 0x3014 => Some(0x214cu16), 0x3015 => Some(0x214du16), 0xff3b => Some(0x214eu16), 0xff3d => Some(0x214fu16), 0xff5b => Some(0x2150u16), 0xff5d => Some(0x2151u16), 0x3008 => Some(0x2152u16), 0x3009 => Some(0x2153u16), 0x300a => Some(0x2154u16), 0x300b => Some(0x2155u16), 0x300c => Some(0x2156u16), 0x300d => Some(0x2157u16), 0x300e => Some(0x2158u16), 0x300f => Some(0x2159u16), 0x3010 => Some(0x215au16), 0x3011 => Some(0x215bu16), 0xff0b => Some(0x215cu16), 0x2212 => Some(0x215du16), 0x00b1 => Some(0x215eu16), 0x00d7 => Some(0x215fu16), 0x00f7 => Some(0x2160u16), 0xff1d => Some(0x2161u16), 0x2260 => Some(0x2162u16), 0xff1c => Some(0x2163u16), 0xff1e => Some(0x2164u16), 0x2266 => Some(0x2165u16), 0x2267 => Some(0x2166u16), 0x221e => Some(0x2167u16), 0x2234 => Some(0x2168u16), 0x2642 => Some(0x2169u16), 0x2640 => Some(0x216au16), 0x00b0 => Some(0x216bu16), 0x2032 => Some(0x216cu16), 0x2033 => Some(0x216du16), 0x2103 => Some(0x216eu16), 0xffe5 => Some(0x216fu16), 0xff04 => Some(0x2170u16), 0x00a2 => Some(0x2171u16), 0x00a3 => Some(0x2172u16), 0xff05 => Some(0x2173u16), 0xff03 => Some(0x2174u16), 0xff06 => Some(0x2175u16), 0xff0a => Some(0x2176u16), 0xff20 => Some(0x2177u16), 0x00a7 => Some(0x2178u16), 0x2606 => Some(0x2179u16), 0x2605 => Some(0x217au16), 0x25cb => Some(0x217bu16), 0x25cf => Some(0x217cu16), 0x25ce => Some(0x217du16), 0x25c7 => Some(0x217eu16), 0x25c6 => Some(0x2221u16), 0x25a1 => Some(0x2222u16), 0x25a0 => Some(0x2223u16), 0x25b3 => Some(0x2224u16), 0x25b2 => Some(0x2225u16), 0x25bd => Some(0x2226u16), 0x25bc => Some(0x2227u16), 0x203b => Some(0x2228u16), 0x3012 => Some(0x2229u16), 0x2192 => Some(0x222au16), 0x2190 => Some(0x222bu16), 0x2191 => Some(0x222cu16), 0x2193 => Some(0x222du16), 0x3013 => Some(0x222eu16), 0x2208 => Some(0x223au16), 0x220b => Some(0x223bu16), 0x2286 => Some(0x223cu16), 0x2287 => Some(0x223du16), 0x2282 => Some(0x223eu16), 0x2283 => Some(0x223fu16), 0x222a => Some(0x2240u16), 0x2229 => Some(0x2241u16), 0x2227 => Some(0x224au16), 0x2228 => Some(0x224bu16), 0x00ac => Some(0x224cu16), 0x21d2 => Some(0x224du16), 0x21d4 => Some(0x224eu16), 0x2200 => Some(0x224fu16), 0x2203 => Some(0x2250u16), 0x2220 => Some(0x225cu16), 0x22a5 => Some(0x225du16), 0x2312 => Some(0x225eu16), 0x2202 => Some(0x225fu16), 0x2207 => Some(0x2260u16), 0x2261 => Some(0x2261u16), 0x2252 => Some(0x2262u16), 0x226a => Some(0x2263u16), 0x226b => Some(0x2264u16), 0x221a => Some(0x2265u16), 0x223d => Some(0x2266u16), 0x221d => Some(0x2267u16), 0x2235 => Some(0x2268u16), 0x222b => Some(0x2269u16), 0x222c => Some(0x226au16), 0x212b => Some(0x2272u16), 0x2030 => Some(0x2273u16), 0x266f => Some(0x2274u16), 0x266d => Some(0x2275u16), 0x266a => Some(0x2276u16), 0x2020 => Some(0x2277u16), 0x2021 => Some(0x2278u16), 0x00b6 => Some(0x2279u16), 0x25ef => Some(0x227eu16), 0xff10 => Some(0x2330u16), 0xff11 => Some(0x2331u16), 0xff12 => Some(0x2332u16), 0xff13 => Some(0x2333u16), 0xff14 => Some(0x2334u16), 0xff15 => Some(0x2335u16), 0xff16 => Some(0x2336u16), 0xff17 => Some(0x2337u16), 0xff18 => Some(0x2338u16), 0xff19 => Some(0x2339u16), 0xff21 => Some(0x2341u16), 0xff22 => Some(0x2342u16), 0xff23 => Some(0x2343u16), 0xff24 => Some(0x2344u16), 0xff25 => Some(0x2345u16), 0xff26 => Some(0x2346u16), 0xff27 => Some(0x2347u16), 0xff28 => Some(0x2348u16), 0xff29 => Some(0x2349u16), 0xff2a => Some(0x234au16), 0xff2b => Some(0x234bu16), 0xff2c => Some(0x234cu16), 0xff2d => Some(0x234du16), 0xff2e => Some(0x234eu16), 0xff2f => Some(0x234fu16), 0xff30 => Some(0x2350u16), 0xff31 => Some(0x2351u16), 0xff32 => Some(0x2352u16), 0xff33 => Some(0x2353u16), 0xff34 => Some(0x2354u16), 0xff35 => Some(0x2355u16), 0xff36 => Some(0x2356u16), 0xff37 => Some(0x2357u16), 0xff38 => Some(0x2358u16), 0xff39 => Some(0x2359u16), 0xff3a => Some(0x235au16), 0xff41 => Some(0x2361u16), 0xff42 => Some(0x2362u16), 0xff43 => Some(0x2363u16), 0xff44 => Some(0x2364u16), 0xff45 => Some(0x2365u16), 0xff46 => Some(0x2366u16), 0xff47 => Some(0x2367u16), 0xff48 => Some(0x2368u16), 0xff49 => Some(0x2369u16), 0xff4a => Some(0x236au16), 0xff4b => Some(0x236bu16), 0xff4c => Some(0x236cu16), 0xff4d => Some(0x236du16), 0xff4e => Some(0x236eu16), 0xff4f => Some(0x236fu16), 0xff50 => Some(0x2370u16), 0xff51 => Some(0x2371u16), 0xff52 => Some(0x2372u16), 0xff53 => Some(0x2373u16), 0xff54 => Some(0x2374u16), 0xff55 => Some(0x2375u16), 0xff56 => Some(0x2376u16), 0xff57 => Some(0x2377u16), 0xff58 => Some(0x2378u16), 0xff59 => Some(0x2379u16), 0xff5a => Some(0x237au16), 0x3041 => Some(0x2421u16), 0x3042 => Some(0x2422u16), 0x3043 => Some(0x2423u16), 0x3044 => Some(0x2424u16), 0x3045 => Some(0x2425u16), 0x3046 => Some(0x2426u16), 0x3047 => Some(0x2427u16), 0x3048 => Some(0x2428u16), 0x3049 => Some(0x2429u16), 0x304a => Some(0x242au16), 0x304b => Some(0x242bu16), 0x304c => Some(0x242cu16), 0x304d => Some(0x242du16), 0x304e => Some(0x242eu16), 0x304f => Some(0x242fu16), 0x3050 => Some(0x2430u16), 0x3051 => Some(0x2431u16), 0x3052 => Some(0x2432u16), 0x3053 => Some(0x2433u16), 0x3054 => Some(0x2434u16), 0x3055 => Some(0x2435u16), 0x3056 => Some(0x2436u16), 0x3057 => Some(0x2437u16), 0x3058 => Some(0x2438u16), 0x3059 => Some(0x2439u16), 0x305a => Some(0x243au16), 0x305b => Some(0x243bu16), 0x305c => Some(0x243cu16), 0x305d => Some(0x243du16), 0x305e => Some(0x243eu16), 0x305f => Some(0x243fu16), 0x3060 => Some(0x2440u16), 0x3061 => Some(0x2441u16), 0x3062 => Some(0x2442u16), 0x3063 => Some(0x2443u16), 0x3064 => Some(0x2444u16), 0x3065 => Some(0x2445u16), 0x3066 => Some(0x2446u16), 0x3067 => Some(0x2447u16), 0x3068 => Some(0x2448u16), 0x3069 => Some(0x2449u16), 0x306a => Some(0x244au16), 0x306b => Some(0x244bu16), 0x306c => Some(0x244cu16), 0x306d => Some(0x244du16), 0x306e => Some(0x244eu16), 0x306f => Some(0x244fu16), 0x3070 => Some(0x2450u16), 0x3071 => Some(0x2451u16), 0x3072 => Some(0x2452u16), 0x3073 => Some(0x2453u16), 0x3074 => Some(0x2454u16), 0x3075 => Some(0x2455u16), 0x3076 => Some(0x2456u16), 0x3077 => Some(0x2457u16), 0x3078 => Some(0x2458u16), 0x3079 => Some(0x2459u16), 0x307a => Some(0x245au16), 0x307b => Some(0x245bu16), 0x307c => Some(0x245cu16), 0x307d => Some(0x245du16), 0x307e => Some(0x245eu16), 0x307f => Some(0x245fu16), 0x3080 => Some(0x2460u16), 0x3081 => Some(0x2461u16), 0x3082 => Some(0x2462u16), 0x3083 => Some(0x2463u16), 0x3084 => Some(0x2464u16), 0x3085 => Some(0x2465u16), 0x3086 => Some(0x2466u16), 0x3087 => Some(0x2467u16), 0x3088 => Some(0x2468u16), 0x3089 => Some(0x2469u16), 0x308a => Some(0x246au16), 0x308b => Some(0x246bu16), 0x308c => Some(0x246cu16), 0x308d => Some(0x246du16), 0x308e => Some(0x246eu16), 0x308f => Some(0x246fu16), 0x3090 => Some(0x2470u16), 0x3091 => Some(0x2471u16), 0x3092 => Some(0x2472u16), 0x3093 => Some(0x2473u16), 0x30a1 => Some(0x2521u16), 0x30a2 => Some(0x2522u16), 0x30a3 => Some(0x2523u16), 0x30a4 => Some(0x2524u16), 0x30a5 => Some(0x2525u16), 0x30a6 => Some(0x2526u16), 0x30a7 => Some(0x2527u16), 0x30a8 => Some(0x2528u16), 0x30a9 => Some(0x2529u16), 0x30aa => Some(0x252au16), 0x30ab => Some(0x252bu16), 0x30ac => Some(0x252cu16), 0x30ad => Some(0x252du16), 0x30ae => Some(0x252eu16), 0x30af => Some(0x252fu16), 0x30b0 => Some(0x2530u16), 0x30b1 => Some(0x2531u16), 0x30b2 => Some(0x2532u16), 0x30b3 => Some(0x2533u16), 0x30b4 => Some(0x2534u16), 0x30b5 => Some(0x2535u16), 0x30b6 => Some(0x2536u16), 0x30b7 => Some(0x2537u16), 0x30b8 => Some(0x2538u16), 0x30b9 => Some(0x2539u16), 0x30ba => Some(0x253au16), 0x30bb => Some(0x253bu16), 0x30bc => Some(0x253cu16), 0x30bd => Some(0x253du16), 0x30be => Some(0x253eu16), 0x30bf => Some(0x253fu16), 0x30c0 => Some(0x2540u16), 0x30c1 => Some(0x2541u16), 0x30c2 => Some(0x2542u16), 0x30c3 => Some(0x2543u16), 0x30c4 => Some(0x2544u16), 0x30c5 => Some(0x2545u16), 0x30c6 => Some(0x2546u16), 0x30c7 => Some(0x2547u16), 0x30c8 => Some(0x2548u16), 0x30c9 => Some(0x2549u16), 0x30ca => Some(0x254au16), 0x30cb => Some(0x254bu16), 0x30cc => Some(0x254cu16), 0x30cd => Some(0x254du16), 0x30ce => Some(0x254eu16), 0x30cf => Some(0x254fu16), 0x30d0 => Some(0x2550u16), 0x30d1 => Some(0x2551u16), 0x30d2 => Some(0x2552u16), 0x30d3 => Some(0x2553u16), 0x30d4 => Some(0x2554u16), 0x30d5 => Some(0x2555u16), 0x30d6 => Some(0x2556u16), 0x30d7 => Some(0x2557u16), 0x30d8 => Some(0x2558u16), 0x30d9 => Some(0x2559u16), 0x30da => Some(0x255au16), 0x30db => Some(0x255bu16), 0x30dc => Some(0x255cu16), 0x30dd => Some(0x255du16), 0x30de => Some(0x255eu16), 0x30df => Some(0x255fu16), 0x30e0 => Some(0x2560u16), 0x30e1 => Some(0x2561u16), 0x30e2 => Some(0x2562u16), 0x30e3 => Some(0x2563u16), 0x30e4 => Some(0x2564u16), 0x30e5 => Some(0x2565u16), 0x30e6 => Some(0x2566u16), 0x30e7 => Some(0x2567u16), 0x30e8 => Some(0x2568u16), 0x30e9 => Some(0x2569u16), 0x30ea => Some(0x256au16), 0x30eb => Some(0x256bu16), 0x30ec => Some(0x256cu16), 0x30ed => Some(0x256du16), 0x30ee => Some(0x256eu16), 0x30ef => Some(0x256fu16), 0x30f0 => Some(0x2570u16), 0x30f1 => Some(0x2571u16), 0x30f2 => Some(0x2572u16), 0x30f3 => Some(0x2573u16), 0x30f4 => Some(0x2574u16), 0x30f5 => Some(0x2575u16), 0x30f6 => Some(0x2576u16), 0x0391 => Some(0x2621u16), 0x0392 => Some(0x2622u16), 0x0393 => Some(0x2623u16), 0x0394 => Some(0x2624u16), 0x0395 => Some(0x2625u16), 0x0396 => Some(0x2626u16), 0x0397 => Some(0x2627u16), 0x0398 => Some(0x2628u16), 0x0399 => Some(0x2629u16), 0x039a => Some(0x262au16), 0x039b => Some(0x262bu16), 0x039c => Some(0x262cu16), 0x039d => Some(0x262du16), 0x039e => Some(0x262eu16), 0x039f => Some(0x262fu16), 0x03a0 => Some(0x2630u16), 0x03a1 => Some(0x2631u16), 0x03a3 => Some(0x2632u16), 0x03a4 => Some(0x2633u16), 0x03a5 => Some(0x2634u16), 0x03a6 => Some(0x2635u16), 0x03a7 => Some(0x2636u16), 0x03a8 => Some(0x2637u16), 0x03a9 => Some(0x2638u16), 0x03b1 => Some(0x2641u16), 0x03b2 => Some(0x2642u16), 0x03b3 => Some(0x2643u16), 0x03b4 => Some(0x2644u16), 0x03b5 => Some(0x2645u16), 0x03b6 => Some(0x2646u16), 0x03b7 => Some(0x2647u16), 0x03b8 => Some(0x2648u16), 0x03b9 => Some(0x2649u16), 0x03ba => Some(0x264au16), 0x03bb => Some(0x264bu16), 0x03bc => Some(0x264cu16), 0x03bd => Some(0x264du16), 0x03be => Some(0x264eu16), 0x03bf => Some(0x264fu16), 0x03c0 => Some(0x2650u16), 0x03c1 => Some(0x2651u16), 0x03c3 => Some(0x2652u16), 0x03c4 => Some(0x2653u16), 0x03c5 => Some(0x2654u16), 0x03c6 => Some(0x2655u16), 0x03c7 => Some(0x2656u16), 0x03c8 => Some(0x2657u16), 0x03c9 => Some(0x2658u16), 0x0410 => Some(0x2721u16), 0x0411 => Some(0x2722u16), 0x0412 => Some(0x2723u16), 0x0413 => Some(0x2724u16), 0x0414 => Some(0x2725u16), 0x0415 => Some(0x2726u16), 0x0401 => Some(0x2727u16), 0x0416 => Some(0x2728u16), 0x0417 => Some(0x2729u16), 0x0418 => Some(0x272au16), 0x0419 => Some(0x272bu16), 0x041a => Some(0x272cu16), 0x041b => Some(0x272du16), 0x041c => Some(0x272eu16), 0x041d => Some(0x272fu16), 0x041e => Some(0x2730u16), 0x041f => Some(0x2731u16), 0x0420 => Some(0x2732u16), 0x0421 => Some(0x2733u16), 0x0422 => Some(0x2734u16), 0x0423 => Some(0x2735u16), 0x0424 => Some(0x2736u16), 0x0425 => Some(0x2737u16), 0x0426 => Some(0x2738u16), 0x0427 => Some(0x2739u16), 0x0428 => Some(0x273au16), 0x0429 => Some(0x273bu16), 0x042a => Some(0x273cu16), 0x042b => Some(0x273du16), 0x042c => Some(0x273eu16), 0x042d => Some(0x273fu16), 0x042e => Some(0x2740u16), 0x042f => Some(0x2741u16), 0x0430 => Some(0x2751u16), 0x0431 => Some(0x2752u16), 0x0432 => Some(0x2753u16), 0x0433 => Some(0x2754u16), 0x0434 => Some(0x2755u16), 0x0435 => Some(0x2756u16), 0x0451 => Some(0x2757u16), 0x0436 => Some(0x2758u16), 0x0437 => Some(0x2759u16), 0x0438 => Some(0x275au16), 0x0439 => Some(0x275bu16), 0x043a => Some(0x275cu16), 0x043b => Some(0x275du16), 0x043c => Some(0x275eu16), 0x043d => Some(0x275fu16), 0x043e => Some(0x2760u16), 0x043f => Some(0x2761u16), 0x0440 => Some(0x2762u16), 0x0441 => Some(0x2763u16), 0x0442 => Some(0x2764u16), 0x0443 => Some(0x2765u16), 0x0444 => Some(0x2766u16), 0x0445 => Some(0x2767u16), 0x0446 => Some(0x2768u16), 0x0447 => Some(0x2769u16), 0x0448 => Some(0x276au16), 0x0449 => Some(0x276bu16), 0x044a => Some(0x276cu16), 0x044b => Some(0x276du16), 0x044c => Some(0x276eu16), 0x044d => Some(0x276fu16), 0x044e => Some(0x2770u16), 0x044f => Some(0x2771u16), 0x2500 => Some(0x2821u16), 0x2502 => Some(0x2822u16), 0x250c => Some(0x2823u16), 0x2510 => Some(0x2824u16), 0x2518 => Some(0x2825u16), 0x2514 => Some(0x2826u16), 0x251c => Some(0x2827u16), 0x252c => Some(0x2828u16), 0x2524 => Some(0x2829u16), 0x2534 => Some(0x282au16), 0x253c => Some(0x282bu16), 0x2501 => Some(0x282cu16), 0x2503 => Some(0x282du16), 0x250f => Some(0x282eu16), 0x2513 => Some(0x282fu16), 0x251b => Some(0x2830u16), 0x2517 => Some(0x2831u16), 0x2523 => Some(0x2832u16), 0x2533 => Some(0x2833u16), 0x252b => Some(0x2834u16), 0x253b => Some(0x2835u16), 0x254b => Some(0x2836u16), 0x2520 => Some(0x2837u16), 0x252f => Some(0x2838u16), 0x2528 => Some(0x2839u16), 0x2537 => Some(0x283au16), 0x253f => Some(0x283bu16), 0x251d => Some(0x283cu16), 0x2530 => Some(0x283du16), 0x2525 => Some(0x283eu16), 0x2538 => Some(0x283fu16), 0x2542 => Some(0x2840u16), 0x4e9c => Some(0x3021u16), 0x5516 => Some(0x3022u16), 0x5a03 => Some(0x3023u16), 0x963f => Some(0x3024u16), 0x54c0 => Some(0x3025u16), 0x611b => Some(0x3026u16), 0x6328 => Some(0x3027u16), 0x59f6 => Some(0x3028u16), 0x9022 => Some(0x3029u16), 0x8475 => Some(0x302au16), 0x831c => Some(0x302bu16), 0x7a50 => Some(0x302cu16), 0x60aa => Some(0x302du16), 0x63e1 => Some(0x302eu16), 0x6e25 => Some(0x302fu16), 0x65ed => Some(0x3030u16), 0x8466 => Some(0x3031u16), 0x82a6 => Some(0x3032u16), 0x9bf5 => Some(0x3033u16), 0x6893 => Some(0x3034u16), 0x5727 => Some(0x3035u16), 0x65a1 => Some(0x3036u16), 0x6271 => Some(0x3037u16), 0x5b9b => Some(0x3038u16), 0x59d0 => Some(0x3039u16), 0x867b => Some(0x303au16), 0x98f4 => Some(0x303bu16), 0x7d62 => Some(0x303cu16), 0x7dbe => Some(0x303du16), 0x9b8e => Some(0x303eu16), 0x6216 => Some(0x303fu16), 0x7c9f => Some(0x3040u16), 0x88b7 => Some(0x3041u16), 0x5b89 => Some(0x3042u16), 0x5eb5 => Some(0x3043u16), 0x6309 => Some(0x3044u16), 0x6697 => Some(0x3045u16), 0x6848 => Some(0x3046u16), 0x95c7 => Some(0x3047u16), 0x978d => Some(0x3048u16), 0x674f => Some(0x3049u16), 0x4ee5 => Some(0x304au16), 0x4f0a => Some(0x304bu16), 0x4f4d => Some(0x304cu16), 0x4f9d => Some(0x304du16), 0x5049 => Some(0x304eu16), 0x56f2 => Some(0x304fu16), 0x5937 => Some(0x3050u16), 0x59d4 => Some(0x3051u16), 0x5a01 => Some(0x3052u16), 0x5c09 => Some(0x3053u16), 0x60df => Some(0x3054u16), 0x610f => Some(0x3055u16), 0x6170 => Some(0x3056u16), 0x6613 => Some(0x3057u16), 0x6905 => Some(0x3058u16), 0x70ba => Some(0x3059u16), 0x754f => Some(0x305au16), 0x7570 => Some(0x305bu16), 0x79fb => Some(0x305cu16), 0x7dad => Some(0x305du16), 0x7def => Some(0x305eu16), 0x80c3 => Some(0x305fu16), 0x840e => Some(0x3060u16), 0x8863 => Some(0x3061u16), 0x8b02 => Some(0x3062u16), 0x9055 => Some(0x3063u16), 0x907a => Some(0x3064u16), 0x533b => Some(0x3065u16), 0x4e95 => Some(0x3066u16), 0x4ea5 => Some(0x3067u16), 0x57df => Some(0x3068u16), 0x80b2 => Some(0x3069u16), 0x90c1 => Some(0x306au16), 0x78ef => Some(0x306bu16), 0x4e00 => Some(0x306cu16), 0x58f1 => Some(0x306du16), 0x6ea2 => Some(0x306eu16), 0x9038 => Some(0x306fu16), 0x7a32 => Some(0x3070u16), 0x8328 => Some(0x3071u16), 0x828b => Some(0x3072u16), 0x9c2f => Some(0x3073u16), 0x5141 => Some(0x3074u16), 0x5370 => Some(0x3075u16), 0x54bd => Some(0x3076u16), 0x54e1 => Some(0x3077u16), 0x56e0 => Some(0x3078u16), 0x59fb => Some(0x3079u16), 0x5f15 => Some(0x307au16), 0x98f2 => Some(0x307bu16), 0x6deb => Some(0x307cu16), 0x80e4 => Some(0x307du16), 0x852d => Some(0x307eu16), 0x9662 => Some(0x3121u16), 0x9670 => Some(0x3122u16), 0x96a0 => Some(0x3123u16), 0x97fb => Some(0x3124u16), 0x540b => Some(0x3125u16), 0x53f3 => Some(0x3126u16), 0x5b87 => Some(0x3127u16), 0x70cf => Some(0x3128u16), 0x7fbd => Some(0x3129u16), 0x8fc2 => Some(0x312au16), 0x96e8 => Some(0x312bu16), 0x536f => Some(0x312cu16), 0x9d5c => Some(0x312du16), 0x7aba => Some(0x312eu16), 0x4e11 => Some(0x312fu16), 0x7893 => Some(0x3130u16), 0x81fc => Some(0x3131u16), 0x6e26 => Some(0x3132u16), 0x5618 => Some(0x3133u16), 0x5504 => Some(0x3134u16), 0x6b1d => Some(0x3135u16), 0x851a => Some(0x3136u16), 0x9c3b => Some(0x3137u16), 0x59e5 => Some(0x3138u16), 0x53a9 => Some(0x3139u16), 0x6d66 => Some(0x313au16), 0x74dc => Some(0x313bu16), 0x958f => Some(0x313cu16), 0x5642 => Some(0x313du16), 0x4e91 => Some(0x313eu16), 0x904b => Some(0x313fu16), 0x96f2 => Some(0x3140u16), 0x834f => Some(0x3141u16), 0x990c => Some(0x3142u16), 0x53e1 => Some(0x3143u16), 0x55b6 => Some(0x3144u16), 0x5b30 => Some(0x3145u16), 0x5f71 => Some(0x3146u16), 0x6620 => Some(0x3147u16), 0x66f3 => Some(0x3148u16), 0x6804 => Some(0x3149u16), 0x6c38 => Some(0x314au16), 0x6cf3 => Some(0x314bu16), 0x6d29 => Some(0x314cu16), 0x745b => Some(0x314du16), 0x76c8 => Some(0x314eu16), 0x7a4e => Some(0x314fu16), 0x9834 => Some(0x3150u16), 0x82f1 => Some(0x3151u16), 0x885b => Some(0x3152u16), 0x8a60 => Some(0x3153u16), 0x92ed => Some(0x3154u16), 0x6db2 => Some(0x3155u16), 0x75ab => Some(0x3156u16), 0x76ca => Some(0x3157u16), 0x99c5 => Some(0x3158u16), 0x60a6 => Some(0x3159u16), 0x8b01 => Some(0x315au16), 0x8d8a => Some(0x315bu16), 0x95b2 => Some(0x315cu16), 0x698e => Some(0x315du16), 0x53ad => Some(0x315eu16), 0x5186 => Some(0x315fu16), 0x5712 => Some(0x3160u16), 0x5830 => Some(0x3161u16), 0x5944 => Some(0x3162u16), 0x5bb4 => Some(0x3163u16), 0x5ef6 => Some(0x3164u16), 0x6028 => Some(0x3165u16), 0x63a9 => Some(0x3166u16), 0x63f4 => Some(0x3167u16), 0x6cbf => Some(0x3168u16), 0x6f14 => Some(0x3169u16), 0x708e => Some(0x316au16), 0x7114 => Some(0x316bu16), 0x7159 => Some(0x316cu16), 0x71d5 => Some(0x316du16), 0x733f => Some(0x316eu16), 0x7e01 => Some(0x316fu16), 0x8276 => Some(0x3170u16), 0x82d1 => Some(0x3171u16), 0x8597 => Some(0x3172u16), 0x9060 => Some(0x3173u16), 0x925b => Some(0x3174u16), 0x9d1b => Some(0x3175u16), 0x5869 => Some(0x3176u16), 0x65bc => Some(0x3177u16), 0x6c5a => Some(0x3178u16), 0x7525 => Some(0x3179u16), 0x51f9 => Some(0x317au16), 0x592e => Some(0x317bu16), 0x5965 => Some(0x317cu16), 0x5f80 => Some(0x317du16), 0x5fdc => Some(0x317eu16), 0x62bc => Some(0x3221u16), 0x65fa => Some(0x3222u16), 0x6a2a => Some(0x3223u16), 0x6b27 => Some(0x3224u16), 0x6bb4 => Some(0x3225u16), 0x738b => Some(0x3226u16), 0x7fc1 => Some(0x3227u16), 0x8956 => Some(0x3228u16), 0x9d2c => Some(0x3229u16), 0x9d0e => Some(0x322au16), 0x9ec4 => Some(0x322bu16), 0x5ca1 => Some(0x322cu16), 0x6c96 => Some(0x322du16), 0x837b => Some(0x322eu16), 0x5104 => Some(0x322fu16), 0x5c4b => Some(0x3230u16), 0x61b6 => Some(0x3231u16), 0x81c6 => Some(0x3232u16), 0x6876 => Some(0x3233u16), 0x7261 => Some(0x3234u16), 0x4e59 => Some(0x3235u16), 0x4ffa => Some(0x3236u16), 0x5378 => Some(0x3237u16), 0x6069 => Some(0x3238u16), 0x6e29 => Some(0x3239u16), 0x7a4f => Some(0x323au16), 0x97f3 => Some(0x323bu16), 0x4e0b => Some(0x323cu16), 0x5316 => Some(0x323du16), 0x4eee => Some(0x323eu16), 0x4f55 => Some(0x323fu16), 0x4f3d => Some(0x3240u16), 0x4fa1 => Some(0x3241u16), 0x4f73 => Some(0x3242u16), 0x52a0 => Some(0x3243u16), 0x53ef => Some(0x3244u16), 0x5609 => Some(0x3245u16), 0x590f => Some(0x3246u16), 0x5ac1 => Some(0x3247u16), 0x5bb6 => Some(0x3248u16), 0x5be1 => Some(0x3249u16), 0x79d1 => Some(0x324au16), 0x6687 => Some(0x324bu16), 0x679c => Some(0x324cu16), 0x67b6 => Some(0x324du16), 0x6b4c => Some(0x324eu16), 0x6cb3 => Some(0x324fu16), 0x706b => Some(0x3250u16), 0x73c2 => Some(0x3251u16), 0x798d => Some(0x3252u16), 0x79be => Some(0x3253u16), 0x7a3c => Some(0x3254u16), 0x7b87 => Some(0x3255u16), 0x82b1 => Some(0x3256u16), 0x82db => Some(0x3257u16), 0x8304 => Some(0x3258u16), 0x8377 => Some(0x3259u16), 0x83ef => Some(0x325au16), 0x83d3 => Some(0x325bu16), 0x8766 => Some(0x325cu16), 0x8ab2 => Some(0x325du16), 0x5629 => Some(0x325eu16), 0x8ca8 => Some(0x325fu16), 0x8fe6 => Some(0x3260u16), 0x904e => Some(0x3261u16), 0x971e => Some(0x3262u16), 0x868a => Some(0x3263u16), 0x4fc4 => Some(0x3264u16), 0x5ce8 => Some(0x3265u16), 0x6211 => Some(0x3266u16), 0x7259 => Some(0x3267u16), 0x753b => Some(0x3268u16), 0x81e5 => Some(0x3269u16), 0x82bd => Some(0x326au16), 0x86fe => Some(0x326bu16), 0x8cc0 => Some(0x326cu16), 0x96c5 => Some(0x326du16), 0x9913 => Some(0x326eu16), 0x99d5 => Some(0x326fu16), 0x4ecb => Some(0x3270u16), 0x4f1a => Some(0x3271u16), 0x89e3 => Some(0x3272u16), 0x56de => Some(0x3273u16), 0x584a => Some(0x3274u16), 0x58ca => Some(0x3275u16), 0x5efb => Some(0x3276u16), 0x5feb => Some(0x3277u16), 0x602a => Some(0x3278u16), 0x6094 => Some(0x3279u16), 0x6062 => Some(0x327au16), 0x61d0 => Some(0x327bu16), 0x6212 => Some(0x327cu16), 0x62d0 => Some(0x327du16), 0x6539 => Some(0x327eu16), 0x9b41 => Some(0x3321u16), 0x6666 => Some(0x3322u16), 0x68b0 => Some(0x3323u16), 0x6d77 => Some(0x3324u16), 0x7070 => Some(0x3325u16), 0x754c => Some(0x3326u16), 0x7686 => Some(0x3327u16), 0x7d75 => Some(0x3328u16), 0x82a5 => Some(0x3329u16), 0x87f9 => Some(0x332au16), 0x958b => Some(0x332bu16), 0x968e => Some(0x332cu16), 0x8c9d => Some(0x332du16), 0x51f1 => Some(0x332eu16), 0x52be => Some(0x332fu16), 0x5916 => Some(0x3330u16), 0x54b3 => Some(0x3331u16), 0x5bb3 => Some(0x3332u16), 0x5d16 => Some(0x3333u16), 0x6168 => Some(0x3334u16), 0x6982 => Some(0x3335u16), 0x6daf => Some(0x3336u16), 0x788d => Some(0x3337u16), 0x84cb => Some(0x3338u16), 0x8857 => Some(0x3339u16), 0x8a72 => Some(0x333au16), 0x93a7 => Some(0x333bu16), 0x9ab8 => Some(0x333cu16), 0x6d6c => Some(0x333du16), 0x99a8 => Some(0x333eu16), 0x86d9 => Some(0x333fu16), 0x57a3 => Some(0x3340u16), 0x67ff => Some(0x3341u16), 0x86ce => Some(0x3342u16), 0x920e => Some(0x3343u16), 0x5283 => Some(0x3344u16), 0x5687 => Some(0x3345u16), 0x5404 => Some(0x3346u16), 0x5ed3 => Some(0x3347u16), 0x62e1 => Some(0x3348u16), 0x64b9 => Some(0x3349u16), 0x683c => Some(0x334au16), 0x6838 => Some(0x334bu16), 0x6bbb => Some(0x334cu16), 0x7372 => Some(0x334du16), 0x78ba => Some(0x334eu16), 0x7a6b => Some(0x334fu16), 0x899a => Some(0x3350u16), 0x89d2 => Some(0x3351u16), 0x8d6b => Some(0x3352u16), 0x8f03 => Some(0x3353u16), 0x90ed => Some(0x3354u16), 0x95a3 => Some(0x3355u16), 0x9694 => Some(0x3356u16), 0x9769 => Some(0x3357u16), 0x5b66 => Some(0x3358u16), 0x5cb3 => Some(0x3359u16), 0x697d => Some(0x335au16), 0x984d => Some(0x335bu16), 0x984e => Some(0x335cu16), 0x639b => Some(0x335du16), 0x7b20 => Some(0x335eu16), 0x6a2b => Some(0x335fu16), 0x6a7f => Some(0x3360u16), 0x68b6 => Some(0x3361u16), 0x9c0d => Some(0x3362u16), 0x6f5f => Some(0x3363u16), 0x5272 => Some(0x3364u16), 0x559d => Some(0x3365u16), 0x6070 => Some(0x3366u16), 0x62ec => Some(0x3367u16), 0x6d3b => Some(0x3368u16), 0x6e07 => Some(0x3369u16), 0x6ed1 => Some(0x336au16), 0x845b => Some(0x336bu16), 0x8910 => Some(0x336cu16), 0x8f44 => Some(0x336du16), 0x4e14 => Some(0x336eu16), 0x9c39 => Some(0x336fu16), 0x53f6 => Some(0x3370u16), 0x691b => Some(0x3371u16), 0x6a3a => Some(0x3372u16), 0x9784 => Some(0x3373u16), 0x682a => Some(0x3374u16), 0x515c => Some(0x3375u16), 0x7ac3 => Some(0x3376u16), 0x84b2 => Some(0x3377u16), 0x91dc => Some(0x3378u16), 0x938c => Some(0x3379u16), 0x565b => Some(0x337au16), 0x9d28 => Some(0x337bu16), 0x6822 => Some(0x337cu16), 0x8305 => Some(0x337du16), 0x8431 => Some(0x337eu16), 0x7ca5 => Some(0x3421u16), 0x5208 => Some(0x3422u16), 0x82c5 => Some(0x3423u16), 0x74e6 => Some(0x3424u16), 0x4e7e => Some(0x3425u16), 0x4f83 => Some(0x3426u16), 0x51a0 => Some(0x3427u16), 0x5bd2 => Some(0x3428u16), 0x520a => Some(0x3429u16), 0x52d8 => Some(0x342au16), 0x52e7 => Some(0x342bu16), 0x5dfb => Some(0x342cu16), 0x559a => Some(0x342du16), 0x582a => Some(0x342eu16), 0x59e6 => Some(0x342fu16), 0x5b8c => Some(0x3430u16), 0x5b98 => Some(0x3431u16), 0x5bdb => Some(0x3432u16), 0x5e72 => Some(0x3433u16), 0x5e79 => Some(0x3434u16), 0x60a3 => Some(0x3435u16), 0x611f => Some(0x3436u16), 0x6163 => Some(0x3437u16), 0x61be => Some(0x3438u16), 0x63db => Some(0x3439u16), 0x6562 => Some(0x343au16), 0x67d1 => Some(0x343bu16), 0x6853 => Some(0x343cu16), 0x68fa => Some(0x343du16), 0x6b3e => Some(0x343eu16), 0x6b53 => Some(0x343fu16), 0x6c57 => Some(0x3440u16), 0x6f22 => Some(0x3441u16), 0x6f97 => Some(0x3442u16), 0x6f45 => Some(0x3443u16), 0x74b0 => Some(0x3444u16), 0x7518 => Some(0x3445u16), 0x76e3 => Some(0x3446u16), 0x770b => Some(0x3447u16), 0x7aff => Some(0x3448u16), 0x7ba1 => Some(0x3449u16), 0x7c21 => Some(0x344au16), 0x7de9 => Some(0x344bu16), 0x7f36 => Some(0x344cu16), 0x7ff0 => Some(0x344du16), 0x809d => Some(0x344eu16), 0x8266 => Some(0x344fu16), 0x839e => Some(0x3450u16), 0x89b3 => Some(0x3451u16), 0x8acc => Some(0x3452u16), 0x8cab => Some(0x3453u16), 0x9084 => Some(0x3454u16), 0x9451 => Some(0x3455u16), 0x9593 => Some(0x3456u16), 0x9591 => Some(0x3457u16), 0x95a2 => Some(0x3458u16), 0x9665 => Some(0x3459u16), 0x97d3 => Some(0x345au16), 0x9928 => Some(0x345bu16), 0x8218 => Some(0x345cu16), 0x4e38 => Some(0x345du16), 0x542b => Some(0x345eu16), 0x5cb8 => Some(0x345fu16), 0x5dcc => Some(0x3460u16), 0x73a9 => Some(0x3461u16), 0x764c => Some(0x3462u16), 0x773c => Some(0x3463u16), 0x5ca9 => Some(0x3464u16), 0x7feb => Some(0x3465u16), 0x8d0b => Some(0x3466u16), 0x96c1 => Some(0x3467u16), 0x9811 => Some(0x3468u16), 0x9854 => Some(0x3469u16), 0x9858 => Some(0x346au16), 0x4f01 => Some(0x346bu16), 0x4f0e => Some(0x346cu16), 0x5371 => Some(0x346du16), 0x559c => Some(0x346eu16), 0x5668 => Some(0x346fu16), 0x57fa => Some(0x3470u16), 0x5947 => Some(0x3471u16), 0x5b09 => Some(0x3472u16), 0x5bc4 => Some(0x3473u16), 0x5c90 => Some(0x3474u16), 0x5e0c => Some(0x3475u16), 0x5e7e => Some(0x3476u16), 0x5fcc => Some(0x3477u16), 0x63ee => Some(0x3478u16), 0x673a => Some(0x3479u16), 0x65d7 => Some(0x347au16), 0x65e2 => Some(0x347bu16), 0x671f => Some(0x347cu16), 0x68cb => Some(0x347du16), 0x68c4 => Some(0x347eu16), 0x6a5f => Some(0x3521u16), 0x5e30 => Some(0x3522u16), 0x6bc5 => Some(0x3523u16), 0x6c17 => Some(0x3524u16), 0x6c7d => Some(0x3525u16), 0x757f => Some(0x3526u16), 0x7948 => Some(0x3527u16), 0x5b63 => Some(0x3528u16), 0x7a00 => Some(0x3529u16), 0x7d00 => Some(0x352au16), 0x5fbd => Some(0x352bu16), 0x898f => Some(0x352cu16), 0x8a18 => Some(0x352du16), 0x8cb4 => Some(0x352eu16), 0x8d77 => Some(0x352fu16), 0x8ecc => Some(0x3530u16), 0x8f1d => Some(0x3531u16), 0x98e2 => Some(0x3532u16), 0x9a0e => Some(0x3533u16), 0x9b3c => Some(0x3534u16), 0x4e80 => Some(0x3535u16), 0x507d => Some(0x3536u16), 0x5100 => Some(0x3537u16), 0x5993 => Some(0x3538u16), 0x5b9c => Some(0x3539u16), 0x622f => Some(0x353au16), 0x6280 => Some(0x353bu16), 0x64ec => Some(0x353cu16), 0x6b3a => Some(0x353du16), 0x72a0 => Some(0x353eu16), 0x7591 => Some(0x353fu16), 0x7947 => Some(0x3540u16), 0x7fa9 => Some(0x3541u16), 0x87fb => Some(0x3542u16), 0x8abc => Some(0x3543u16), 0x8b70 => Some(0x3544u16), 0x63ac => Some(0x3545u16), 0x83ca => Some(0x3546u16), 0x97a0 => Some(0x3547u16), 0x5409 => Some(0x3548u16), 0x5403 => Some(0x3549u16), 0x55ab => Some(0x354au16), 0x6854 => Some(0x354bu16), 0x6a58 => Some(0x354cu16), 0x8a70 => Some(0x354du16), 0x7827 => Some(0x354eu16), 0x6775 => Some(0x354fu16), 0x9ecd => Some(0x3550u16), 0x5374 => Some(0x3551u16), 0x5ba2 => Some(0x3552u16), 0x811a => Some(0x3553u16), 0x8650 => Some(0x3554u16), 0x9006 => Some(0x3555u16), 0x4e18 => Some(0x3556u16), 0x4e45 => Some(0x3557u16), 0x4ec7 => Some(0x3558u16), 0x4f11 => Some(0x3559u16), 0x53ca => Some(0x355au16), 0x5438 => Some(0x355bu16), 0x5bae => Some(0x355cu16), 0x5f13 => Some(0x355du16), 0x6025 => Some(0x355eu16), 0x6551 => Some(0x355fu16), 0x673d => Some(0x3560u16), 0x6c42 => Some(0x3561u16), 0x6c72 => Some(0x3562u16), 0x6ce3 => Some(0x3563u16), 0x7078 => Some(0x3564u16), 0x7403 => Some(0x3565u16), 0x7a76 => Some(0x3566u16), 0x7aae => Some(0x3567u16), 0x7b08 => Some(0x3568u16), 0x7d1a => Some(0x3569u16), 0x7cfe => Some(0x356au16), 0x7d66 => Some(0x356bu16), 0x65e7 => Some(0x356cu16), 0x725b => Some(0x356du16), 0x53bb => Some(0x356eu16), 0x5c45 => Some(0x356fu16), 0x5de8 => Some(0x3570u16), 0x62d2 => Some(0x3571u16), 0x62e0 => Some(0x3572u16), 0x6319 => Some(0x3573u16), 0x6e20 => Some(0x3574u16), 0x865a => Some(0x3575u16), 0x8a31 => Some(0x3576u16), 0x8ddd => Some(0x3577u16), 0x92f8 => Some(0x3578u16), 0x6f01 => Some(0x3579u16), 0x79a6 => Some(0x357au16), 0x9b5a => Some(0x357bu16), 0x4ea8 => Some(0x357cu16), 0x4eab => Some(0x357du16), 0x4eac => Some(0x357eu16), 0x4f9b => Some(0x3621u16), 0x4fa0 => Some(0x3622u16), 0x50d1 => Some(0x3623u16), 0x5147 => Some(0x3624u16), 0x7af6 => Some(0x3625u16), 0x5171 => Some(0x3626u16), 0x51f6 => Some(0x3627u16), 0x5354 => Some(0x3628u16), 0x5321 => Some(0x3629u16), 0x537f => Some(0x362au16), 0x53eb => Some(0x362bu16), 0x55ac => Some(0x362cu16), 0x5883 => Some(0x362du16), 0x5ce1 => Some(0x362eu16), 0x5f37 => Some(0x362fu16), 0x5f4a => Some(0x3630u16), 0x602f => Some(0x3631u16), 0x6050 => Some(0x3632u16), 0x606d => Some(0x3633u16), 0x631f => Some(0x3634u16), 0x6559 => Some(0x3635u16), 0x6a4b => Some(0x3636u16), 0x6cc1 => Some(0x3637u16), 0x72c2 => Some(0x3638u16), 0x72ed => Some(0x3639u16), 0x77ef => Some(0x363au16), 0x80f8 => Some(0x363bu16), 0x8105 => Some(0x363cu16), 0x8208 => Some(0x363du16), 0x854e => Some(0x363eu16), 0x90f7 => Some(0x363fu16), 0x93e1 => Some(0x3640u16), 0x97ff => Some(0x3641u16), 0x9957 => Some(0x3642u16), 0x9a5a => Some(0x3643u16), 0x4ef0 => Some(0x3644u16), 0x51dd => Some(0x3645u16), 0x5c2d => Some(0x3646u16), 0x6681 => Some(0x3647u16), 0x696d => Some(0x3648u16), 0x5c40 => Some(0x3649u16), 0x66f2 => Some(0x364au16), 0x6975 => Some(0x364bu16), 0x7389 => Some(0x364cu16), 0x6850 => Some(0x364du16), 0x7c81 => Some(0x364eu16), 0x50c5 => Some(0x364fu16), 0x52e4 => Some(0x3650u16), 0x5747 => Some(0x3651u16), 0x5dfe => Some(0x3652u16), 0x9326 => Some(0x3653u16), 0x65a4 => Some(0x3654u16), 0x6b23 => Some(0x3655u16), 0x6b3d => Some(0x3656u16), 0x7434 => Some(0x3657u16), 0x7981 => Some(0x3658u16), 0x79bd => Some(0x3659u16), 0x7b4b => Some(0x365au16), 0x7dca => Some(0x365bu16), 0x82b9 => Some(0x365cu16), 0x83cc => Some(0x365du16), 0x887f => Some(0x365eu16), 0x895f => Some(0x365fu16), 0x8b39 => Some(0x3660u16), 0x8fd1 => Some(0x3661u16), 0x91d1 => Some(0x3662u16), 0x541f => Some(0x3663u16), 0x9280 => Some(0x3664u16), 0x4e5d => Some(0x3665u16), 0x5036 => Some(0x3666u16), 0x53e5 => Some(0x3667u16), 0x533a => Some(0x3668u16), 0x72d7 => Some(0x3669u16), 0x7396 => Some(0x366au16), 0x77e9 => Some(0x366bu16), 0x82e6 => Some(0x366cu16), 0x8eaf => Some(0x366du16), 0x99c6 => Some(0x366eu16), 0x99c8 => Some(0x366fu16), 0x99d2 => Some(0x3670u16), 0x5177 => Some(0x3671u16), 0x611a => Some(0x3672u16), 0x865e => Some(0x3673u16), 0x55b0 => Some(0x3674u16), 0x7a7a => Some(0x3675u16), 0x5076 => Some(0x3676u16), 0x5bd3 => Some(0x3677u16), 0x9047 => Some(0x3678u16), 0x9685 => Some(0x3679u16), 0x4e32 => Some(0x367au16), 0x6adb => Some(0x367bu16), 0x91e7 => Some(0x367cu16), 0x5c51 => Some(0x367du16), 0x5c48 => Some(0x367eu16), 0x6398 => Some(0x3721u16), 0x7a9f => Some(0x3722u16), 0x6c93 => Some(0x3723u16), 0x9774 => Some(0x3724u16), 0x8f61 => Some(0x3725u16), 0x7aaa => Some(0x3726u16), 0x718a => Some(0x3727u16), 0x9688 => Some(0x3728u16), 0x7c82 => Some(0x3729u16), 0x6817 => Some(0x372au16), 0x7e70 => Some(0x372bu16), 0x6851 => Some(0x372cu16), 0x936c => Some(0x372du16), 0x52f2 => Some(0x372eu16), 0x541b => Some(0x372fu16), 0x85ab => Some(0x3730u16), 0x8a13 => Some(0x3731u16), 0x7fa4 => Some(0x3732u16), 0x8ecd => Some(0x3733u16), 0x90e1 => Some(0x3734u16), 0x5366 => Some(0x3735u16), 0x8888 => Some(0x3736u16), 0x7941 => Some(0x3737u16), 0x4fc2 => Some(0x3738u16), 0x50be => Some(0x3739u16), 0x5211 => Some(0x373au16), 0x5144 => Some(0x373bu16), 0x5553 => Some(0x373cu16), 0x572d => Some(0x373du16), 0x73ea => Some(0x373eu16), 0x578b => Some(0x373fu16), 0x5951 => Some(0x3740u16), 0x5f62 => Some(0x3741u16), 0x5f84 => Some(0x3742u16), 0x6075 => Some(0x3743u16), 0x6176 => Some(0x3744u16), 0x6167 => Some(0x3745u16), 0x61a9 => Some(0x3746u16), 0x63b2 => Some(0x3747u16), 0x643a => Some(0x3748u16), 0x656c => Some(0x3749u16), 0x666f => Some(0x374au16), 0x6842 => Some(0x374bu16), 0x6e13 => Some(0x374cu16), 0x7566 => Some(0x374du16), 0x7a3d => Some(0x374eu16), 0x7cfb => Some(0x374fu16), 0x7d4c => Some(0x3750u16), 0x7d99 => Some(0x3751u16), 0x7e4b => Some(0x3752u16), 0x7f6b => Some(0x3753u16), 0x830e => Some(0x3754u16), 0x834a => Some(0x3755u16), 0x86cd => Some(0x3756u16), 0x8a08 => Some(0x3757u16), 0x8a63 => Some(0x3758u16), 0x8b66 => Some(0x3759u16), 0x8efd => Some(0x375au16), 0x981a => Some(0x375bu16), 0x9d8f => Some(0x375cu16), 0x82b8 => Some(0x375du16), 0x8fce => Some(0x375eu16), 0x9be8 => Some(0x375fu16), 0x5287 => Some(0x3760u16), 0x621f => Some(0x3761u16), 0x6483 => Some(0x3762u16), 0x6fc0 => Some(0x3763u16), 0x9699 => Some(0x3764u16), 0x6841 => Some(0x3765u16), 0x5091 => Some(0x3766u16), 0x6b20 => Some(0x3767u16), 0x6c7a => Some(0x3768u16), 0x6f54 => Some(0x3769u16), 0x7a74 => Some(0x376au16), 0x7d50 => Some(0x376bu16), 0x8840 => Some(0x376cu16), 0x8a23 => Some(0x376du16), 0x6708 => Some(0x376eu16), 0x4ef6 => Some(0x376fu16), 0x5039 => Some(0x3770u16), 0x5026 => Some(0x3771u16), 0x5065 => Some(0x3772u16), 0x517c => Some(0x3773u16), 0x5238 => Some(0x3774u16), 0x5263 => Some(0x3775u16), 0x55a7 => Some(0x3776u16), 0x570f => Some(0x3777u16), 0x5805 => Some(0x3778u16), 0x5acc => Some(0x3779u16), 0x5efa => Some(0x377au16), 0x61b2 => Some(0x377bu16), 0x61f8 => Some(0x377cu16), 0x62f3 => Some(0x377du16), 0x6372 => Some(0x377eu16), 0x691c => Some(0x3821u16), 0x6a29 => Some(0x3822u16), 0x727d => Some(0x3823u16), 0x72ac => Some(0x3824u16), 0x732e => Some(0x3825u16), 0x7814 => Some(0x3826u16), 0x786f => Some(0x3827u16), 0x7d79 => Some(0x3828u16), 0x770c => Some(0x3829u16), 0x80a9 => Some(0x382au16), 0x898b => Some(0x382bu16), 0x8b19 => Some(0x382cu16), 0x8ce2 => Some(0x382du16), 0x8ed2 => Some(0x382eu16), 0x9063 => Some(0x382fu16), 0x9375 => Some(0x3830u16), 0x967a => Some(0x3831u16), 0x9855 => Some(0x3832u16), 0x9a13 => Some(0x3833u16), 0x9e78 => Some(0x3834u16), 0x5143 => Some(0x3835u16), 0x539f => Some(0x3836u16), 0x53b3 => Some(0x3837u16), 0x5e7b => Some(0x3838u16), 0x5f26 => Some(0x3839u16), 0x6e1b => Some(0x383au16), 0x6e90 => Some(0x383bu16), 0x7384 => Some(0x383cu16), 0x73fe => Some(0x383du16), 0x7d43 => Some(0x383eu16), 0x8237 => Some(0x383fu16), 0x8a00 => Some(0x3840u16), 0x8afa => Some(0x3841u16), 0x9650 => Some(0x3842u16), 0x4e4e => Some(0x3843u16), 0x500b => Some(0x3844u16), 0x53e4 => Some(0x3845u16), 0x547c => Some(0x3846u16), 0x56fa => Some(0x3847u16), 0x59d1 => Some(0x3848u16), 0x5b64 => Some(0x3849u16), 0x5df1 => Some(0x384au16), 0x5eab => Some(0x384bu16), 0x5f27 => Some(0x384cu16), 0x6238 => Some(0x384du16), 0x6545 => Some(0x384eu16), 0x67af => Some(0x384fu16), 0x6e56 => Some(0x3850u16), 0x72d0 => Some(0x3851u16), 0x7cca => Some(0x3852u16), 0x88b4 => Some(0x3853u16), 0x80a1 => Some(0x3854u16), 0x80e1 => Some(0x3855u16), 0x83f0 => Some(0x3856u16), 0x864e => Some(0x3857u16), 0x8a87 => Some(0x3858u16), 0x8de8 => Some(0x3859u16), 0x9237 => Some(0x385au16), 0x96c7 => Some(0x385bu16), 0x9867 => Some(0x385cu16), 0x9f13 => Some(0x385du16), 0x4e94 => Some(0x385eu16), 0x4e92 => Some(0x385fu16), 0x4f0d => Some(0x3860u16), 0x5348 => Some(0x3861u16), 0x5449 => Some(0x3862u16), 0x543e => Some(0x3863u16), 0x5a2f => Some(0x3864u16), 0x5f8c => Some(0x3865u16), 0x5fa1 => Some(0x3866u16), 0x609f => Some(0x3867u16), 0x68a7 => Some(0x3868u16), 0x6a8e => Some(0x3869u16), 0x745a => Some(0x386au16), 0x7881 => Some(0x386bu16), 0x8a9e => Some(0x386cu16), 0x8aa4 => Some(0x386du16), 0x8b77 => Some(0x386eu16), 0x9190 => Some(0x386fu16), 0x4e5e => Some(0x3870u16), 0x9bc9 => Some(0x3871u16), 0x4ea4 => Some(0x3872u16), 0x4f7c => Some(0x3873u16), 0x4faf => Some(0x3874u16), 0x5019 => Some(0x3875u16), 0x5016 => Some(0x3876u16), 0x5149 => Some(0x3877u16), 0x516c => Some(0x3878u16), 0x529f => Some(0x3879u16), 0x52b9 => Some(0x387au16), 0x52fe => Some(0x387bu16), 0x539a => Some(0x387cu16), 0x53e3 => Some(0x387du16), 0x5411 => Some(0x387eu16), 0x540e => Some(0x3921u16), 0x5589 => Some(0x3922u16), 0x5751 => Some(0x3923u16), 0x57a2 => Some(0x3924u16), 0x597d => Some(0x3925u16), 0x5b54 => Some(0x3926u16), 0x5b5d => Some(0x3927u16), 0x5b8f => Some(0x3928u16), 0x5de5 => Some(0x3929u16), 0x5de7 => Some(0x392au16), 0x5df7 => Some(0x392bu16), 0x5e78 => Some(0x392cu16), 0x5e83 => Some(0x392du16), 0x5e9a => Some(0x392eu16), 0x5eb7 => Some(0x392fu16), 0x5f18 => Some(0x3930u16), 0x6052 => Some(0x3931u16), 0x614c => Some(0x3932u16), 0x6297 => Some(0x3933u16), 0x62d8 => Some(0x3934u16), 0x63a7 => Some(0x3935u16), 0x653b => Some(0x3936u16), 0x6602 => Some(0x3937u16), 0x6643 => Some(0x3938u16), 0x66f4 => Some(0x3939u16), 0x676d => Some(0x393au16), 0x6821 => Some(0x393bu16), 0x6897 => Some(0x393cu16), 0x69cb => Some(0x393du16), 0x6c5f => Some(0x393eu16), 0x6d2a => Some(0x393fu16), 0x6d69 => Some(0x3940u16), 0x6e2f => Some(0x3941u16), 0x6e9d => Some(0x3942u16), 0x7532 => Some(0x3943u16), 0x7687 => Some(0x3944u16), 0x786c => Some(0x3945u16), 0x7a3f => Some(0x3946u16), 0x7ce0 => Some(0x3947u16), 0x7d05 => Some(0x3948u16), 0x7d18 => Some(0x3949u16), 0x7d5e => Some(0x394au16), 0x7db1 => Some(0x394bu16), 0x8015 => Some(0x394cu16), 0x8003 => Some(0x394du16), 0x80af => Some(0x394eu16), 0x80b1 => Some(0x394fu16), 0x8154 => Some(0x3950u16), 0x818f => Some(0x3951u16), 0x822a => Some(0x3952u16), 0x8352 => Some(0x3953u16), 0x884c => Some(0x3954u16), 0x8861 => Some(0x3955u16), 0x8b1b => Some(0x3956u16), 0x8ca2 => Some(0x3957u16), 0x8cfc => Some(0x3958u16), 0x90ca => Some(0x3959u16), 0x9175 => Some(0x395au16), 0x9271 => Some(0x395bu16), 0x783f => Some(0x395cu16), 0x92fc => Some(0x395du16), 0x95a4 => Some(0x395eu16), 0x964d => Some(0x395fu16), 0x9805 => Some(0x3960u16), 0x9999 => Some(0x3961u16), 0x9ad8 => Some(0x3962u16), 0x9d3b => Some(0x3963u16), 0x525b => Some(0x3964u16), 0x52ab => Some(0x3965u16), 0x53f7 => Some(0x3966u16), 0x5408 => Some(0x3967u16), 0x58d5 => Some(0x3968u16), 0x62f7 => Some(0x3969u16), 0x6fe0 => Some(0x396au16), 0x8c6a => Some(0x396bu16), 0x8f5f => Some(0x396cu16), 0x9eb9 => Some(0x396du16), 0x514b => Some(0x396eu16), 0x523b => Some(0x396fu16), 0x544a => Some(0x3970u16), 0x56fd => Some(0x3971u16), 0x7a40 => Some(0x3972u16), 0x9177 => Some(0x3973u16), 0x9d60 => Some(0x3974u16), 0x9ed2 => Some(0x3975u16), 0x7344 => Some(0x3976u16), 0x6f09 => Some(0x3977u16), 0x8170 => Some(0x3978u16), 0x7511 => Some(0x3979u16), 0x5ffd => Some(0x397au16), 0x60da => Some(0x397bu16), 0x9aa8 => Some(0x397cu16), 0x72db => Some(0x397du16), 0x8fbc => Some(0x397eu16), 0x6b64 => Some(0x3a21u16), 0x9803 => Some(0x3a22u16), 0x4eca => Some(0x3a23u16), 0x56f0 => Some(0x3a24u16), 0x5764 => Some(0x3a25u16), 0x58be => Some(0x3a26u16), 0x5a5a => Some(0x3a27u16), 0x6068 => Some(0x3a28u16), 0x61c7 => Some(0x3a29u16), 0x660f => Some(0x3a2au16), 0x6606 => Some(0x3a2bu16), 0x6839 => Some(0x3a2cu16), 0x68b1 => Some(0x3a2du16), 0x6df7 => Some(0x3a2eu16), 0x75d5 => Some(0x3a2fu16), 0x7d3a => Some(0x3a30u16), 0x826e => Some(0x3a31u16), 0x9b42 => Some(0x3a32u16), 0x4e9b => Some(0x3a33u16), 0x4f50 => Some(0x3a34u16), 0x53c9 => Some(0x3a35u16), 0x5506 => Some(0x3a36u16), 0x5d6f => Some(0x3a37u16), 0x5de6 => Some(0x3a38u16), 0x5dee => Some(0x3a39u16), 0x67fb => Some(0x3a3au16), 0x6c99 => Some(0x3a3bu16), 0x7473 => Some(0x3a3cu16), 0x7802 => Some(0x3a3du16), 0x8a50 => Some(0x3a3eu16), 0x9396 => Some(0x3a3fu16), 0x88df => Some(0x3a40u16), 0x5750 => Some(0x3a41u16), 0x5ea7 => Some(0x3a42u16), 0x632b => Some(0x3a43u16), 0x50b5 => Some(0x3a44u16), 0x50ac => Some(0x3a45u16), 0x518d => Some(0x3a46u16), 0x6700 => Some(0x3a47u16), 0x54c9 => Some(0x3a48u16), 0x585e => Some(0x3a49u16), 0x59bb => Some(0x3a4au16), 0x5bb0 => Some(0x3a4bu16), 0x5f69 => Some(0x3a4cu16), 0x624d => Some(0x3a4du16), 0x63a1 => Some(0x3a4eu16), 0x683d => Some(0x3a4fu16), 0x6b73 => Some(0x3a50u16), 0x6e08 => Some(0x3a51u16), 0x707d => Some(0x3a52u16), 0x91c7 => Some(0x3a53u16), 0x7280 => Some(0x3a54u16), 0x7815 => Some(0x3a55u16), 0x7826 => Some(0x3a56u16), 0x796d => Some(0x3a57u16), 0x658e => Some(0x3a58u16), 0x7d30 => Some(0x3a59u16), 0x83dc => Some(0x3a5au16), 0x88c1 => Some(0x3a5bu16), 0x8f09 => Some(0x3a5cu16), 0x969b => Some(0x3a5du16), 0x5264 => Some(0x3a5eu16), 0x5728 => Some(0x3a5fu16), 0x6750 => Some(0x3a60u16), 0x7f6a => Some(0x3a61u16), 0x8ca1 => Some(0x3a62u16), 0x51b4 => Some(0x3a63u16), 0x5742 => Some(0x3a64u16), 0x962a => Some(0x3a65u16), 0x583a => Some(0x3a66u16), 0x698a => Some(0x3a67u16), 0x80b4 => Some(0x3a68u16), 0x54b2 => Some(0x3a69u16), 0x5d0e => Some(0x3a6au16), 0x57fc => Some(0x3a6bu16), 0x7895 => Some(0x3a6cu16), 0x9dfa => Some(0x3a6du16), 0x4f5c => Some(0x3a6eu16), 0x524a => Some(0x3a6fu16), 0x548b => Some(0x3a70u16), 0x643e => Some(0x3a71u16), 0x6628 => Some(0x3a72u16), 0x6714 => Some(0x3a73u16), 0x67f5 => Some(0x3a74u16), 0x7a84 => Some(0x3a75u16), 0x7b56 => Some(0x3a76u16), 0x7d22 => Some(0x3a77u16), 0x932f => Some(0x3a78u16), 0x685c => Some(0x3a79u16), 0x9bad => Some(0x3a7au16), 0x7b39 => Some(0x3a7bu16), 0x5319 => Some(0x3a7cu16), 0x518a => Some(0x3a7du16), 0x5237 => Some(0x3a7eu16), 0x5bdf => Some(0x3b21u16), 0x62f6 => Some(0x3b22u16), 0x64ae => Some(0x3b23u16), 0x64e6 => Some(0x3b24u16), 0x672d => Some(0x3b25u16), 0x6bba => Some(0x3b26u16), 0x85a9 => Some(0x3b27u16), 0x96d1 => Some(0x3b28u16), 0x7690 => Some(0x3b29u16), 0x9bd6 => Some(0x3b2au16), 0x634c => Some(0x3b2bu16), 0x9306 => Some(0x3b2cu16), 0x9bab => Some(0x3b2du16), 0x76bf => Some(0x3b2eu16), 0x6652 => Some(0x3b2fu16), 0x4e09 => Some(0x3b30u16), 0x5098 => Some(0x3b31u16), 0x53c2 => Some(0x3b32u16), 0x5c71 => Some(0x3b33u16), 0x60e8 => Some(0x3b34u16), 0x6492 => Some(0x3b35u16), 0x6563 => Some(0x3b36u16), 0x685f => Some(0x3b37u16), 0x71e6 => Some(0x3b38u16), 0x73ca => Some(0x3b39u16), 0x7523 => Some(0x3b3au16), 0x7b97 => Some(0x3b3bu16), 0x7e82 => Some(0x3b3cu16), 0x8695 => Some(0x3b3du16), 0x8b83 => Some(0x3b3eu16), 0x8cdb => Some(0x3b3fu16), 0x9178 => Some(0x3b40u16), 0x9910 => Some(0x3b41u16), 0x65ac => Some(0x3b42u16), 0x66ab => Some(0x3b43u16), 0x6b8b => Some(0x3b44u16), 0x4ed5 => Some(0x3b45u16), 0x4ed4 => Some(0x3b46u16), 0x4f3a => Some(0x3b47u16), 0x4f7f => Some(0x3b48u16), 0x523a => Some(0x3b49u16), 0x53f8 => Some(0x3b4au16), 0x53f2 => Some(0x3b4bu16), 0x55e3 => Some(0x3b4cu16), 0x56db => Some(0x3b4du16), 0x58eb => Some(0x3b4eu16), 0x59cb => Some(0x3b4fu16), 0x59c9 => Some(0x3b50u16), 0x59ff => Some(0x3b51u16), 0x5b50 => Some(0x3b52u16), 0x5c4d => Some(0x3b53u16), 0x5e02 => Some(0x3b54u16), 0x5e2b => Some(0x3b55u16), 0x5fd7 => Some(0x3b56u16), 0x601d => Some(0x3b57u16), 0x6307 => Some(0x3b58u16), 0x652f => Some(0x3b59u16), 0x5b5c => Some(0x3b5au16), 0x65af => Some(0x3b5bu16), 0x65bd => Some(0x3b5cu16), 0x65e8 => Some(0x3b5du16), 0x679d => Some(0x3b5eu16), 0x6b62 => Some(0x3b5fu16), 0x6b7b => Some(0x3b60u16), 0x6c0f => Some(0x3b61u16), 0x7345 => Some(0x3b62u16), 0x7949 => Some(0x3b63u16), 0x79c1 => Some(0x3b64u16), 0x7cf8 => Some(0x3b65u16), 0x7d19 => Some(0x3b66u16), 0x7d2b => Some(0x3b67u16), 0x80a2 => Some(0x3b68u16), 0x8102 => Some(0x3b69u16), 0x81f3 => Some(0x3b6au16), 0x8996 => Some(0x3b6bu16), 0x8a5e => Some(0x3b6cu16), 0x8a69 => Some(0x3b6du16), 0x8a66 => Some(0x3b6eu16), 0x8a8c => Some(0x3b6fu16), 0x8aee => Some(0x3b70u16), 0x8cc7 => Some(0x3b71u16), 0x8cdc => Some(0x3b72u16), 0x96cc => Some(0x3b73u16), 0x98fc => Some(0x3b74u16), 0x6b6f => Some(0x3b75u16), 0x4e8b => Some(0x3b76u16), 0x4f3c => Some(0x3b77u16), 0x4f8d => Some(0x3b78u16), 0x5150 => Some(0x3b79u16), 0x5b57 => Some(0x3b7au16), 0x5bfa => Some(0x3b7bu16), 0x6148 => Some(0x3b7cu16), 0x6301 => Some(0x3b7du16), 0x6642 => Some(0x3b7eu16), 0x6b21 => Some(0x3c21u16), 0x6ecb => Some(0x3c22u16), 0x6cbb => Some(0x3c23u16), 0x723e => Some(0x3c24u16), 0x74bd => Some(0x3c25u16), 0x75d4 => Some(0x3c26u16), 0x78c1 => Some(0x3c27u16), 0x793a => Some(0x3c28u16), 0x800c => Some(0x3c29u16), 0x8033 => Some(0x3c2au16), 0x81ea => Some(0x3c2bu16), 0x8494 => Some(0x3c2cu16), 0x8f9e => Some(0x3c2du16), 0x6c50 => Some(0x3c2eu16), 0x9e7f => Some(0x3c2fu16), 0x5f0f => Some(0x3c30u16), 0x8b58 => Some(0x3c31u16), 0x9d2b => Some(0x3c32u16), 0x7afa => Some(0x3c33u16), 0x8ef8 => Some(0x3c34u16), 0x5b8d => Some(0x3c35u16), 0x96eb => Some(0x3c36u16), 0x4e03 => Some(0x3c37u16), 0x53f1 => Some(0x3c38u16), 0x57f7 => Some(0x3c39u16), 0x5931 => Some(0x3c3au16), 0x5ac9 => Some(0x3c3bu16), 0x5ba4 => Some(0x3c3cu16), 0x6089 => Some(0x3c3du16), 0x6e7f => Some(0x3c3eu16), 0x6f06 => Some(0x3c3fu16), 0x75be => Some(0x3c40u16), 0x8cea => Some(0x3c41u16), 0x5b9f => Some(0x3c42u16), 0x8500 => Some(0x3c43u16), 0x7be0 => Some(0x3c44u16), 0x5072 => Some(0x3c45u16), 0x67f4 => Some(0x3c46u16), 0x829d => Some(0x3c47u16), 0x5c61 => Some(0x3c48u16), 0x854a => Some(0x3c49u16), 0x7e1e => Some(0x3c4au16), 0x820e => Some(0x3c4bu16), 0x5199 => Some(0x3c4cu16), 0x5c04 => Some(0x3c4du16), 0x6368 => Some(0x3c4eu16), 0x8d66 => Some(0x3c4fu16), 0x659c => Some(0x3c50u16), 0x716e => Some(0x3c51u16), 0x793e => Some(0x3c52u16), 0x7d17 => Some(0x3c53u16), 0x8005 => Some(0x3c54u16), 0x8b1d => Some(0x3c55u16), 0x8eca => Some(0x3c56u16), 0x906e => Some(0x3c57u16), 0x86c7 => Some(0x3c58u16), 0x90aa => Some(0x3c59u16), 0x501f => Some(0x3c5au16), 0x52fa => Some(0x3c5bu16), 0x5c3a => Some(0x3c5cu16), 0x6753 => Some(0x3c5du16), 0x707c => Some(0x3c5eu16), 0x7235 => Some(0x3c5fu16), 0x914c => Some(0x3c60u16), 0x91c8 => Some(0x3c61u16), 0x932b => Some(0x3c62u16), 0x82e5 => Some(0x3c63u16), 0x5bc2 => Some(0x3c64u16), 0x5f31 => Some(0x3c65u16), 0x60f9 => Some(0x3c66u16), 0x4e3b => Some(0x3c67u16), 0x53d6 => Some(0x3c68u16), 0x5b88 => Some(0x3c69u16), 0x624b => Some(0x3c6au16), 0x6731 => Some(0x3c6bu16), 0x6b8a => Some(0x3c6cu16), 0x72e9 => Some(0x3c6du16), 0x73e0 => Some(0x3c6eu16), 0x7a2e => Some(0x3c6fu16), 0x816b => Some(0x3c70u16), 0x8da3 => Some(0x3c71u16), 0x9152 => Some(0x3c72u16), 0x9996 => Some(0x3c73u16), 0x5112 => Some(0x3c74u16), 0x53d7 => Some(0x3c75u16), 0x546a => Some(0x3c76u16), 0x5bff => Some(0x3c77u16), 0x6388 => Some(0x3c78u16), 0x6a39 => Some(0x3c79u16), 0x7dac => Some(0x3c7au16), 0x9700 => Some(0x3c7bu16), 0x56da => Some(0x3c7cu16), 0x53ce => Some(0x3c7du16), 0x5468 => Some(0x3c7eu16), 0x5b97 => Some(0x3d21u16), 0x5c31 => Some(0x3d22u16), 0x5dde => Some(0x3d23u16), 0x4fee => Some(0x3d24u16), 0x6101 => Some(0x3d25u16), 0x62fe => Some(0x3d26u16), 0x6d32 => Some(0x3d27u16), 0x79c0 => Some(0x3d28u16), 0x79cb => Some(0x3d29u16), 0x7d42 => Some(0x3d2au16), 0x7e4d => Some(0x3d2bu16), 0x7fd2 => Some(0x3d2cu16), 0x81ed => Some(0x3d2du16), 0x821f => Some(0x3d2eu16), 0x8490 => Some(0x3d2fu16), 0x8846 => Some(0x3d30u16), 0x8972 => Some(0x3d31u16), 0x8b90 => Some(0x3d32u16), 0x8e74 => Some(0x3d33u16), 0x8f2f => Some(0x3d34u16), 0x9031 => Some(0x3d35u16), 0x914b => Some(0x3d36u16), 0x916c => Some(0x3d37u16), 0x96c6 => Some(0x3d38u16), 0x919c => Some(0x3d39u16), 0x4ec0 => Some(0x3d3au16), 0x4f4f => Some(0x3d3bu16), 0x5145 => Some(0x3d3cu16), 0x5341 => Some(0x3d3du16), 0x5f93 => Some(0x3d3eu16), 0x620e => Some(0x3d3fu16), 0x67d4 => Some(0x3d40u16), 0x6c41 => Some(0x3d41u16), 0x6e0b => Some(0x3d42u16), 0x7363 => Some(0x3d43u16), 0x7e26 => Some(0x3d44u16), 0x91cd => Some(0x3d45u16), 0x9283 => Some(0x3d46u16), 0x53d4 => Some(0x3d47u16), 0x5919 => Some(0x3d48u16), 0x5bbf => Some(0x3d49u16), 0x6dd1 => Some(0x3d4au16), 0x795d => Some(0x3d4bu16), 0x7e2e => Some(0x3d4cu16), 0x7c9b => Some(0x3d4du16), 0x587e => Some(0x3d4eu16), 0x719f => Some(0x3d4fu16), 0x51fa => Some(0x3d50u16), 0x8853 => Some(0x3d51u16), 0x8ff0 => Some(0x3d52u16), 0x4fca => Some(0x3d53u16), 0x5cfb => Some(0x3d54u16), 0x6625 => Some(0x3d55u16), 0x77ac => Some(0x3d56u16), 0x7ae3 => Some(0x3d57u16), 0x821c => Some(0x3d58u16), 0x99ff => Some(0x3d59u16), 0x51c6 => Some(0x3d5au16), 0x5faa => Some(0x3d5bu16), 0x65ec => Some(0x3d5cu16), 0x696f => Some(0x3d5du16), 0x6b89 => Some(0x3d5eu16), 0x6df3 => Some(0x3d5fu16), 0x6e96 => Some(0x3d60u16), 0x6f64 => Some(0x3d61u16), 0x76fe => Some(0x3d62u16), 0x7d14 => Some(0x3d63u16), 0x5de1 => Some(0x3d64u16), 0x9075 => Some(0x3d65u16), 0x9187 => Some(0x3d66u16), 0x9806 => Some(0x3d67u16), 0x51e6 => Some(0x3d68u16), 0x521d => Some(0x3d69u16), 0x6240 => Some(0x3d6au16), 0x6691 => Some(0x3d6bu16), 0x66d9 => Some(0x3d6cu16), 0x6e1a => Some(0x3d6du16), 0x5eb6 => Some(0x3d6eu16), 0x7dd2 => Some(0x3d6fu16), 0x7f72 => Some(0x3d70u16), 0x66f8 => Some(0x3d71u16), 0x85af => Some(0x3d72u16), 0x85f7 => Some(0x3d73u16), 0x8af8 => Some(0x3d74u16), 0x52a9 => Some(0x3d75u16), 0x53d9 => Some(0x3d76u16), 0x5973 => Some(0x3d77u16), 0x5e8f => Some(0x3d78u16), 0x5f90 => Some(0x3d79u16), 0x6055 => Some(0x3d7au16), 0x92e4 => Some(0x3d7bu16), 0x9664 => Some(0x3d7cu16), 0x50b7 => Some(0x3d7du16), 0x511f => Some(0x3d7eu16), 0x52dd => Some(0x3e21u16), 0x5320 => Some(0x3e22u16), 0x5347 => Some(0x3e23u16), 0x53ec => Some(0x3e24u16), 0x54e8 => Some(0x3e25u16), 0x5546 => Some(0x3e26u16), 0x5531 => Some(0x3e27u16), 0x5617 => Some(0x3e28u16), 0x5968 => Some(0x3e29u16), 0x59be => Some(0x3e2au16), 0x5a3c => Some(0x3e2bu16), 0x5bb5 => Some(0x3e2cu16), 0x5c06 => Some(0x3e2du16), 0x5c0f => Some(0x3e2eu16), 0x5c11 => Some(0x3e2fu16), 0x5c1a => Some(0x3e30u16), 0x5e84 => Some(0x3e31u16), 0x5e8a => Some(0x3e32u16), 0x5ee0 => Some(0x3e33u16), 0x5f70 => Some(0x3e34u16), 0x627f => Some(0x3e35u16), 0x6284 => Some(0x3e36u16), 0x62db => Some(0x3e37u16), 0x638c => Some(0x3e38u16), 0x6377 => Some(0x3e39u16), 0x6607 => Some(0x3e3au16), 0x660c => Some(0x3e3bu16), 0x662d => Some(0x3e3cu16), 0x6676 => Some(0x3e3du16), 0x677e => Some(0x3e3eu16), 0x68a2 => Some(0x3e3fu16), 0x6a1f => Some(0x3e40u16), 0x6a35 => Some(0x3e41u16), 0x6cbc => Some(0x3e42u16), 0x6d88 => Some(0x3e43u16), 0x6e09 => Some(0x3e44u16), 0x6e58 => Some(0x3e45u16), 0x713c => Some(0x3e46u16), 0x7126 => Some(0x3e47u16), 0x7167 => Some(0x3e48u16), 0x75c7 => Some(0x3e49u16), 0x7701 => Some(0x3e4au16), 0x785d => Some(0x3e4bu16), 0x7901 => Some(0x3e4cu16), 0x7965 => Some(0x3e4du16), 0x79f0 => Some(0x3e4eu16), 0x7ae0 => Some(0x3e4fu16), 0x7b11 => Some(0x3e50u16), 0x7ca7 => Some(0x3e51u16), 0x7d39 => Some(0x3e52u16), 0x8096 => Some(0x3e53u16), 0x83d6 => Some(0x3e54u16), 0x848b => Some(0x3e55u16), 0x8549 => Some(0x3e56u16), 0x885d => Some(0x3e57u16), 0x88f3 => Some(0x3e58u16), 0x8a1f => Some(0x3e59u16), 0x8a3c => Some(0x3e5au16), 0x8a54 => Some(0x3e5bu16), 0x8a73 => Some(0x3e5cu16), 0x8c61 => Some(0x3e5du16), 0x8cde => Some(0x3e5eu16), 0x91a4 => Some(0x3e5fu16), 0x9266 => Some(0x3e60u16), 0x937e => Some(0x3e61u16), 0x9418 => Some(0x3e62u16), 0x969c => Some(0x3e63u16), 0x9798 => Some(0x3e64u16), 0x4e0a => Some(0x3e65u16), 0x4e08 => Some(0x3e66u16), 0x4e1e => Some(0x3e67u16), 0x4e57 => Some(0x3e68u16), 0x5197 => Some(0x3e69u16), 0x5270 => Some(0x3e6au16), 0x57ce => Some(0x3e6bu16), 0x5834 => Some(0x3e6cu16), 0x58cc => Some(0x3e6du16), 0x5b22 => Some(0x3e6eu16), 0x5e38 => Some(0x3e6fu16), 0x60c5 => Some(0x3e70u16), 0x64fe => Some(0x3e71u16), 0x6761 => Some(0x3e72u16), 0x6756 => Some(0x3e73u16), 0x6d44 => Some(0x3e74u16), 0x72b6 => Some(0x3e75u16), 0x7573 => Some(0x3e76u16), 0x7a63 => Some(0x3e77u16), 0x84b8 => Some(0x3e78u16), 0x8b72 => Some(0x3e79u16), 0x91b8 => Some(0x3e7au16), 0x9320 => Some(0x3e7bu16), 0x5631 => Some(0x3e7cu16), 0x57f4 => Some(0x3e7du16), 0x98fe => Some(0x3e7eu16), 0x62ed => Some(0x3f21u16), 0x690d => Some(0x3f22u16), 0x6b96 => Some(0x3f23u16), 0x71ed => Some(0x3f24u16), 0x7e54 => Some(0x3f25u16), 0x8077 => Some(0x3f26u16), 0x8272 => Some(0x3f27u16), 0x89e6 => Some(0x3f28u16), 0x98df => Some(0x3f29u16), 0x8755 => Some(0x3f2au16), 0x8fb1 => Some(0x3f2bu16), 0x5c3b => Some(0x3f2cu16), 0x4f38 => Some(0x3f2du16), 0x4fe1 => Some(0x3f2eu16), 0x4fb5 => Some(0x3f2fu16), 0x5507 => Some(0x3f30u16), 0x5a20 => Some(0x3f31u16), 0x5bdd => Some(0x3f32u16), 0x5be9 => Some(0x3f33u16), 0x5fc3 => Some(0x3f34u16), 0x614e => Some(0x3f35u16), 0x632f => Some(0x3f36u16), 0x65b0 => Some(0x3f37u16), 0x664b => Some(0x3f38u16), 0x68ee => Some(0x3f39u16), 0x699b => Some(0x3f3au16), 0x6d78 => Some(0x3f3bu16), 0x6df1 => Some(0x3f3cu16), 0x7533 => Some(0x3f3du16), 0x75b9 => Some(0x3f3eu16), 0x771f => Some(0x3f3fu16), 0x795e => Some(0x3f40u16), 0x79e6 => Some(0x3f41u16), 0x7d33 => Some(0x3f42u16), 0x81e3 => Some(0x3f43u16), 0x82af => Some(0x3f44u16), 0x85aa => Some(0x3f45u16), 0x89aa => Some(0x3f46u16), 0x8a3a => Some(0x3f47u16), 0x8eab => Some(0x3f48u16), 0x8f9b => Some(0x3f49u16), 0x9032 => Some(0x3f4au16), 0x91dd => Some(0x3f4bu16), 0x9707 => Some(0x3f4cu16), 0x4eba => Some(0x3f4du16), 0x4ec1 => Some(0x3f4eu16), 0x5203 => Some(0x3f4fu16), 0x5875 => Some(0x3f50u16), 0x58ec => Some(0x3f51u16), 0x5c0b => Some(0x3f52u16), 0x751a => Some(0x3f53u16), 0x5c3d => Some(0x3f54u16), 0x814e => Some(0x3f55u16), 0x8a0a => Some(0x3f56u16), 0x8fc5 => Some(0x3f57u16), 0x9663 => Some(0x3f58u16), 0x976d => Some(0x3f59u16), 0x7b25 => Some(0x3f5au16), 0x8acf => Some(0x3f5bu16), 0x9808 => Some(0x3f5cu16), 0x9162 => Some(0x3f5du16), 0x56f3 => Some(0x3f5eu16), 0x53a8 => Some(0x3f5fu16), 0x9017 => Some(0x3f60u16), 0x5439 => Some(0x3f61u16), 0x5782 => Some(0x3f62u16), 0x5e25 => Some(0x3f63u16), 0x63a8 => Some(0x3f64u16), 0x6c34 => Some(0x3f65u16), 0x708a => Some(0x3f66u16), 0x7761 => Some(0x3f67u16), 0x7c8b => Some(0x3f68u16), 0x7fe0 => Some(0x3f69u16), 0x8870 => Some(0x3f6au16), 0x9042 => Some(0x3f6bu16), 0x9154 => Some(0x3f6cu16), 0x9310 => Some(0x3f6du16), 0x9318 => Some(0x3f6eu16), 0x968f => Some(0x3f6fu16), 0x745e => Some(0x3f70u16), 0x9ac4 => Some(0x3f71u16), 0x5d07 => Some(0x3f72u16), 0x5d69 => Some(0x3f73u16), 0x6570 => Some(0x3f74u16), 0x67a2 => Some(0x3f75u16), 0x8da8 => Some(0x3f76u16), 0x96db => Some(0x3f77u16), 0x636e => Some(0x3f78u16), 0x6749 => Some(0x3f79u16), 0x6919 => Some(0x3f7au16), 0x83c5 => Some(0x3f7bu16), 0x9817 => Some(0x3f7cu16), 0x96c0 => Some(0x3f7du16), 0x88fe => Some(0x3f7eu16), 0x6f84 => Some(0x4021u16), 0x647a => Some(0x4022u16), 0x5bf8 => Some(0x4023u16), 0x4e16 => Some(0x4024u16), 0x702c => Some(0x4025u16), 0x755d => Some(0x4026u16), 0x662f => Some(0x4027u16), 0x51c4 => Some(0x4028u16), 0x5236 => Some(0x4029u16), 0x52e2 => Some(0x402au16), 0x59d3 => Some(0x402bu16), 0x5f81 => Some(0x402cu16), 0x6027 => Some(0x402du16), 0x6210 => Some(0x402eu16), 0x653f => Some(0x402fu16), 0x6574 => Some(0x4030u16), 0x661f => Some(0x4031u16), 0x6674 => Some(0x4032u16), 0x68f2 => Some(0x4033u16), 0x6816 => Some(0x4034u16), 0x6b63 => Some(0x4035u16), 0x6e05 => Some(0x4036u16), 0x7272 => Some(0x4037u16), 0x751f => Some(0x4038u16), 0x76db => Some(0x4039u16), 0x7cbe => Some(0x403au16), 0x8056 => Some(0x403bu16), 0x58f0 => Some(0x403cu16), 0x88fd => Some(0x403du16), 0x897f => Some(0x403eu16), 0x8aa0 => Some(0x403fu16), 0x8a93 => Some(0x4040u16), 0x8acb => Some(0x4041u16), 0x901d => Some(0x4042u16), 0x9192 => Some(0x4043u16), 0x9752 => Some(0x4044u16), 0x9759 => Some(0x4045u16), 0x6589 => Some(0x4046u16), 0x7a0e => Some(0x4047u16), 0x8106 => Some(0x4048u16), 0x96bb => Some(0x4049u16), 0x5e2d => Some(0x404au16), 0x60dc => Some(0x404bu16), 0x621a => Some(0x404cu16), 0x65a5 => Some(0x404du16), 0x6614 => Some(0x404eu16), 0x6790 => Some(0x404fu16), 0x77f3 => Some(0x4050u16), 0x7a4d => Some(0x4051u16), 0x7c4d => Some(0x4052u16), 0x7e3e => Some(0x4053u16), 0x810a => Some(0x4054u16), 0x8cac => Some(0x4055u16), 0x8d64 => Some(0x4056u16), 0x8de1 => Some(0x4057u16), 0x8e5f => Some(0x4058u16), 0x78a9 => Some(0x4059u16), 0x5207 => Some(0x405au16), 0x62d9 => Some(0x405bu16), 0x63a5 => Some(0x405cu16), 0x6442 => Some(0x405du16), 0x6298 => Some(0x405eu16), 0x8a2d => Some(0x405fu16), 0x7a83 => Some(0x4060u16), 0x7bc0 => Some(0x4061u16), 0x8aac => Some(0x4062u16), 0x96ea => Some(0x4063u16), 0x7d76 => Some(0x4064u16), 0x820c => Some(0x4065u16), 0x8749 => Some(0x4066u16), 0x4ed9 => Some(0x4067u16), 0x5148 => Some(0x4068u16), 0x5343 => Some(0x4069u16), 0x5360 => Some(0x406au16), 0x5ba3 => Some(0x406bu16), 0x5c02 => Some(0x406cu16), 0x5c16 => Some(0x406du16), 0x5ddd => Some(0x406eu16), 0x6226 => Some(0x406fu16), 0x6247 => Some(0x4070u16), 0x64b0 => Some(0x4071u16), 0x6813 => Some(0x4072u16), 0x6834 => Some(0x4073u16), 0x6cc9 => Some(0x4074u16), 0x6d45 => Some(0x4075u16), 0x6d17 => Some(0x4076u16), 0x67d3 => Some(0x4077u16), 0x6f5c => Some(0x4078u16), 0x714e => Some(0x4079u16), 0x717d => Some(0x407au16), 0x65cb => Some(0x407bu16), 0x7a7f => Some(0x407cu16), 0x7bad => Some(0x407du16), 0x7dda => Some(0x407eu16), 0x7e4a => Some(0x4121u16), 0x7fa8 => Some(0x4122u16), 0x817a => Some(0x4123u16), 0x821b => Some(0x4124u16), 0x8239 => Some(0x4125u16), 0x85a6 => Some(0x4126u16), 0x8a6e => Some(0x4127u16), 0x8cce => Some(0x4128u16), 0x8df5 => Some(0x4129u16), 0x9078 => Some(0x412au16), 0x9077 => Some(0x412bu16), 0x92ad => Some(0x412cu16), 0x9291 => Some(0x412du16), 0x9583 => Some(0x412eu16), 0x9bae => Some(0x412fu16), 0x524d => Some(0x4130u16), 0x5584 => Some(0x4131u16), 0x6f38 => Some(0x4132u16), 0x7136 => Some(0x4133u16), 0x5168 => Some(0x4134u16), 0x7985 => Some(0x4135u16), 0x7e55 => Some(0x4136u16), 0x81b3 => Some(0x4137u16), 0x7cce => Some(0x4138u16), 0x564c => Some(0x4139u16), 0x5851 => Some(0x413au16), 0x5ca8 => Some(0x413bu16), 0x63aa => Some(0x413cu16), 0x66fe => Some(0x413du16), 0x66fd => Some(0x413eu16), 0x695a => Some(0x413fu16), 0x72d9 => Some(0x4140u16), 0x758f => Some(0x4141u16), 0x758e => Some(0x4142u16), 0x790e => Some(0x4143u16), 0x7956 => Some(0x4144u16), 0x79df => Some(0x4145u16), 0x7c97 => Some(0x4146u16), 0x7d20 => Some(0x4147u16), 0x7d44 => Some(0x4148u16), 0x8607 => Some(0x4149u16), 0x8a34 => Some(0x414au16), 0x963b => Some(0x414bu16), 0x9061 => Some(0x414cu16), 0x9f20 => Some(0x414du16), 0x50e7 => Some(0x414eu16), 0x5275 => Some(0x414fu16), 0x53cc => Some(0x4150u16), 0x53e2 => Some(0x4151u16), 0x5009 => Some(0x4152u16), 0x55aa => Some(0x4153u16), 0x58ee => Some(0x4154u16), 0x594f => Some(0x4155u16), 0x723d => Some(0x4156u16), 0x5b8b => Some(0x4157u16), 0x5c64 => Some(0x4158u16), 0x531d => Some(0x4159u16), 0x60e3 => Some(0x415au16), 0x60f3 => Some(0x415bu16), 0x635c => Some(0x415cu16), 0x6383 => Some(0x415du16), 0x633f => Some(0x415eu16), 0x63bb => Some(0x415fu16), 0x64cd => Some(0x4160u16), 0x65e9 => Some(0x4161u16), 0x66f9 => Some(0x4162u16), 0x5de3 => Some(0x4163u16), 0x69cd => Some(0x4164u16), 0x69fd => Some(0x4165u16), 0x6f15 => Some(0x4166u16), 0x71e5 => Some(0x4167u16), 0x4e89 => Some(0x4168u16), 0x75e9 => Some(0x4169u16), 0x76f8 => Some(0x416au16), 0x7a93 => Some(0x416bu16), 0x7cdf => Some(0x416cu16), 0x7dcf => Some(0x416du16), 0x7d9c => Some(0x416eu16), 0x8061 => Some(0x416fu16), 0x8349 => Some(0x4170u16), 0x8358 => Some(0x4171u16), 0x846c => Some(0x4172u16), 0x84bc => Some(0x4173u16), 0x85fb => Some(0x4174u16), 0x88c5 => Some(0x4175u16), 0x8d70 => Some(0x4176u16), 0x9001 => Some(0x4177u16), 0x906d => Some(0x4178u16), 0x9397 => Some(0x4179u16), 0x971c => Some(0x417au16), 0x9a12 => Some(0x417bu16), 0x50cf => Some(0x417cu16), 0x5897 => Some(0x417du16), 0x618e => Some(0x417eu16), 0x81d3 => Some(0x4221u16), 0x8535 => Some(0x4222u16), 0x8d08 => Some(0x4223u16), 0x9020 => Some(0x4224u16), 0x4fc3 => Some(0x4225u16), 0x5074 => Some(0x4226u16), 0x5247 => Some(0x4227u16), 0x5373 => Some(0x4228u16), 0x606f => Some(0x4229u16), 0x6349 => Some(0x422au16), 0x675f => Some(0x422bu16), 0x6e2c => Some(0x422cu16), 0x8db3 => Some(0x422du16), 0x901f => Some(0x422eu16), 0x4fd7 => Some(0x422fu16), 0x5c5e => Some(0x4230u16), 0x8cca => Some(0x4231u16), 0x65cf => Some(0x4232u16), 0x7d9a => Some(0x4233u16), 0x5352 => Some(0x4234u16), 0x8896 => Some(0x4235u16), 0x5176 => Some(0x4236u16), 0x63c3 => Some(0x4237u16), 0x5b58 => Some(0x4238u16), 0x5b6b => Some(0x4239u16), 0x5c0a => Some(0x423au16), 0x640d => Some(0x423bu16), 0x6751 => Some(0x423cu16), 0x905c => Some(0x423du16), 0x4ed6 => Some(0x423eu16), 0x591a => Some(0x423fu16), 0x592a => Some(0x4240u16), 0x6c70 => Some(0x4241u16), 0x8a51 => Some(0x4242u16), 0x553e => Some(0x4243u16), 0x5815 => Some(0x4244u16), 0x59a5 => Some(0x4245u16), 0x60f0 => Some(0x4246u16), 0x6253 => Some(0x4247u16), 0x67c1 => Some(0x4248u16), 0x8235 => Some(0x4249u16), 0x6955 => Some(0x424au16), 0x9640 => Some(0x424bu16), 0x99c4 => Some(0x424cu16), 0x9a28 => Some(0x424du16), 0x4f53 => Some(0x424eu16), 0x5806 => Some(0x424fu16), 0x5bfe => Some(0x4250u16), 0x8010 => Some(0x4251u16), 0x5cb1 => Some(0x4252u16), 0x5e2f => Some(0x4253u16), 0x5f85 => Some(0x4254u16), 0x6020 => Some(0x4255u16), 0x614b => Some(0x4256u16), 0x6234 => Some(0x4257u16), 0x66ff => Some(0x4258u16), 0x6cf0 => Some(0x4259u16), 0x6ede => Some(0x425au16), 0x80ce => Some(0x425bu16), 0x817f => Some(0x425cu16), 0x82d4 => Some(0x425du16), 0x888b => Some(0x425eu16), 0x8cb8 => Some(0x425fu16), 0x9000 => Some(0x4260u16), 0x902e => Some(0x4261u16), 0x968a => Some(0x4262u16), 0x9edb => Some(0x4263u16), 0x9bdb => Some(0x4264u16), 0x4ee3 => Some(0x4265u16), 0x53f0 => Some(0x4266u16), 0x5927 => Some(0x4267u16), 0x7b2c => Some(0x4268u16), 0x918d => Some(0x4269u16), 0x984c => Some(0x426au16), 0x9df9 => Some(0x426bu16), 0x6edd => Some(0x426cu16), 0x7027 => Some(0x426du16), 0x5353 => Some(0x426eu16), 0x5544 => Some(0x426fu16), 0x5b85 => Some(0x4270u16), 0x6258 => Some(0x4271u16), 0x629e => Some(0x4272u16), 0x62d3 => Some(0x4273u16), 0x6ca2 => Some(0x4274u16), 0x6fef => Some(0x4275u16), 0x7422 => Some(0x4276u16), 0x8a17 => Some(0x4277u16), 0x9438 => Some(0x4278u16), 0x6fc1 => Some(0x4279u16), 0x8afe => Some(0x427au16), 0x8338 => Some(0x427bu16), 0x51e7 => Some(0x427cu16), 0x86f8 => Some(0x427du16), 0x53ea => Some(0x427eu16), 0x53e9 => Some(0x4321u16), 0x4f46 => Some(0x4322u16), 0x9054 => Some(0x4323u16), 0x8fb0 => Some(0x4324u16), 0x596a => Some(0x4325u16), 0x8131 => Some(0x4326u16), 0x5dfd => Some(0x4327u16), 0x7aea => Some(0x4328u16), 0x8fbf => Some(0x4329u16), 0x68da => Some(0x432au16), 0x8c37 => Some(0x432bu16), 0x72f8 => Some(0x432cu16), 0x9c48 => Some(0x432du16), 0x6a3d => Some(0x432eu16), 0x8ab0 => Some(0x432fu16), 0x4e39 => Some(0x4330u16), 0x5358 => Some(0x4331u16), 0x5606 => Some(0x4332u16), 0x5766 => Some(0x4333u16), 0x62c5 => Some(0x4334u16), 0x63a2 => Some(0x4335u16), 0x65e6 => Some(0x4336u16), 0x6b4e => Some(0x4337u16), 0x6de1 => Some(0x4338u16), 0x6e5b => Some(0x4339u16), 0x70ad => Some(0x433au16), 0x77ed => Some(0x433bu16), 0x7aef => Some(0x433cu16), 0x7baa => Some(0x433du16), 0x7dbb => Some(0x433eu16), 0x803d => Some(0x433fu16), 0x80c6 => Some(0x4340u16), 0x86cb => Some(0x4341u16), 0x8a95 => Some(0x4342u16), 0x935b => Some(0x4343u16), 0x56e3 => Some(0x4344u16), 0x58c7 => Some(0x4345u16), 0x5f3e => Some(0x4346u16), 0x65ad => Some(0x4347u16), 0x6696 => Some(0x4348u16), 0x6a80 => Some(0x4349u16), 0x6bb5 => Some(0x434au16), 0x7537 => Some(0x434bu16), 0x8ac7 => Some(0x434cu16), 0x5024 => Some(0x434du16), 0x77e5 => Some(0x434eu16), 0x5730 => Some(0x434fu16), 0x5f1b => Some(0x4350u16), 0x6065 => Some(0x4351u16), 0x667a => Some(0x4352u16), 0x6c60 => Some(0x4353u16), 0x75f4 => Some(0x4354u16), 0x7a1a => Some(0x4355u16), 0x7f6e => Some(0x4356u16), 0x81f4 => Some(0x4357u16), 0x8718 => Some(0x4358u16), 0x9045 => Some(0x4359u16), 0x99b3 => Some(0x435au16), 0x7bc9 => Some(0x435bu16), 0x755c => Some(0x435cu16), 0x7af9 => Some(0x435du16), 0x7b51 => Some(0x435eu16), 0x84c4 => Some(0x435fu16), 0x9010 => Some(0x4360u16), 0x79e9 => Some(0x4361u16), 0x7a92 => Some(0x4362u16), 0x8336 => Some(0x4363u16), 0x5ae1 => Some(0x4364u16), 0x7740 => Some(0x4365u16), 0x4e2d => Some(0x4366u16), 0x4ef2 => Some(0x4367u16), 0x5b99 => Some(0x4368u16), 0x5fe0 => Some(0x4369u16), 0x62bd => Some(0x436au16), 0x663c => Some(0x436bu16), 0x67f1 => Some(0x436cu16), 0x6ce8 => Some(0x436du16), 0x866b => Some(0x436eu16), 0x8877 => Some(0x436fu16), 0x8a3b => Some(0x4370u16), 0x914e => Some(0x4371u16), 0x92f3 => Some(0x4372u16), 0x99d0 => Some(0x4373u16), 0x6a17 => Some(0x4374u16), 0x7026 => Some(0x4375u16), 0x732a => Some(0x4376u16), 0x82e7 => Some(0x4377u16), 0x8457 => Some(0x4378u16), 0x8caf => Some(0x4379u16), 0x4e01 => Some(0x437au16), 0x5146 => Some(0x437bu16), 0x51cb => Some(0x437cu16), 0x558b => Some(0x437du16), 0x5bf5 => Some(0x437eu16), 0x5e16 => Some(0x4421u16), 0x5e33 => Some(0x4422u16), 0x5e81 => Some(0x4423u16), 0x5f14 => Some(0x4424u16), 0x5f35 => Some(0x4425u16), 0x5f6b => Some(0x4426u16), 0x5fb4 => Some(0x4427u16), 0x61f2 => Some(0x4428u16), 0x6311 => Some(0x4429u16), 0x66a2 => Some(0x442au16), 0x671d => Some(0x442bu16), 0x6f6e => Some(0x442cu16), 0x7252 => Some(0x442du16), 0x753a => Some(0x442eu16), 0x773a => Some(0x442fu16), 0x8074 => Some(0x4430u16), 0x8139 => Some(0x4431u16), 0x8178 => Some(0x4432u16), 0x8776 => Some(0x4433u16), 0x8abf => Some(0x4434u16), 0x8adc => Some(0x4435u16), 0x8d85 => Some(0x4436u16), 0x8df3 => Some(0x4437u16), 0x929a => Some(0x4438u16), 0x9577 => Some(0x4439u16), 0x9802 => Some(0x443au16), 0x9ce5 => Some(0x443bu16), 0x52c5 => Some(0x443cu16), 0x6357 => Some(0x443du16), 0x76f4 => Some(0x443eu16), 0x6715 => Some(0x443fu16), 0x6c88 => Some(0x4440u16), 0x73cd => Some(0x4441u16), 0x8cc3 => Some(0x4442u16), 0x93ae => Some(0x4443u16), 0x9673 => Some(0x4444u16), 0x6d25 => Some(0x4445u16), 0x589c => Some(0x4446u16), 0x690e => Some(0x4447u16), 0x69cc => Some(0x4448u16), 0x8ffd => Some(0x4449u16), 0x939a => Some(0x444au16), 0x75db => Some(0x444bu16), 0x901a => Some(0x444cu16), 0x585a => Some(0x444du16), 0x6802 => Some(0x444eu16), 0x63b4 => Some(0x444fu16), 0x69fb => Some(0x4450u16), 0x4f43 => Some(0x4451u16), 0x6f2c => Some(0x4452u16), 0x67d8 => Some(0x4453u16), 0x8fbb => Some(0x4454u16), 0x8526 => Some(0x4455u16), 0x7db4 => Some(0x4456u16), 0x9354 => Some(0x4457u16), 0x693f => Some(0x4458u16), 0x6f70 => Some(0x4459u16), 0x576a => Some(0x445au16), 0x58f7 => Some(0x445bu16), 0x5b2c => Some(0x445cu16), 0x7d2c => Some(0x445du16), 0x722a => Some(0x445eu16), 0x540a => Some(0x445fu16), 0x91e3 => Some(0x4460u16), 0x9db4 => Some(0x4461u16), 0x4ead => Some(0x4462u16), 0x4f4e => Some(0x4463u16), 0x505c => Some(0x4464u16), 0x5075 => Some(0x4465u16), 0x5243 => Some(0x4466u16), 0x8c9e => Some(0x4467u16), 0x5448 => Some(0x4468u16), 0x5824 => Some(0x4469u16), 0x5b9a => Some(0x446au16), 0x5e1d => Some(0x446bu16), 0x5e95 => Some(0x446cu16), 0x5ead => Some(0x446du16), 0x5ef7 => Some(0x446eu16), 0x5f1f => Some(0x446fu16), 0x608c => Some(0x4470u16), 0x62b5 => Some(0x4471u16), 0x633a => Some(0x4472u16), 0x63d0 => Some(0x4473u16), 0x68af => Some(0x4474u16), 0x6c40 => Some(0x4475u16), 0x7887 => Some(0x4476u16), 0x798e => Some(0x4477u16), 0x7a0b => Some(0x4478u16), 0x7de0 => Some(0x4479u16), 0x8247 => Some(0x447au16), 0x8a02 => Some(0x447bu16), 0x8ae6 => Some(0x447cu16), 0x8e44 => Some(0x447du16), 0x9013 => Some(0x447eu16), 0x90b8 => Some(0x4521u16), 0x912d => Some(0x4522u16), 0x91d8 => Some(0x4523u16), 0x9f0e => Some(0x4524u16), 0x6ce5 => Some(0x4525u16), 0x6458 => Some(0x4526u16), 0x64e2 => Some(0x4527u16), 0x6575 => Some(0x4528u16), 0x6ef4 => Some(0x4529u16), 0x7684 => Some(0x452au16), 0x7b1b => Some(0x452bu16), 0x9069 => Some(0x452cu16), 0x93d1 => Some(0x452du16), 0x6eba => Some(0x452eu16), 0x54f2 => Some(0x452fu16), 0x5fb9 => Some(0x4530u16), 0x64a4 => Some(0x4531u16), 0x8f4d => Some(0x4532u16), 0x8fed => Some(0x4533u16), 0x9244 => Some(0x4534u16), 0x5178 => Some(0x4535u16), 0x586b => Some(0x4536u16), 0x5929 => Some(0x4537u16), 0x5c55 => Some(0x4538u16), 0x5e97 => Some(0x4539u16), 0x6dfb => Some(0x453au16), 0x7e8f => Some(0x453bu16), 0x751c => Some(0x453cu16), 0x8cbc => Some(0x453du16), 0x8ee2 => Some(0x453eu16), 0x985b => Some(0x453fu16), 0x70b9 => Some(0x4540u16), 0x4f1d => Some(0x4541u16), 0x6bbf => Some(0x4542u16), 0x6fb1 => Some(0x4543u16), 0x7530 => Some(0x4544u16), 0x96fb => Some(0x4545u16), 0x514e => Some(0x4546u16), 0x5410 => Some(0x4547u16), 0x5835 => Some(0x4548u16), 0x5857 => Some(0x4549u16), 0x59ac => Some(0x454au16), 0x5c60 => Some(0x454bu16), 0x5f92 => Some(0x454cu16), 0x6597 => Some(0x454du16), 0x675c => Some(0x454eu16), 0x6e21 => Some(0x454fu16), 0x767b => Some(0x4550u16), 0x83df => Some(0x4551u16), 0x8ced => Some(0x4552u16), 0x9014 => Some(0x4553u16), 0x90fd => Some(0x4554u16), 0x934d => Some(0x4555u16), 0x7825 => Some(0x4556u16), 0x783a => Some(0x4557u16), 0x52aa => Some(0x4558u16), 0x5ea6 => Some(0x4559u16), 0x571f => Some(0x455au16), 0x5974 => Some(0x455bu16), 0x6012 => Some(0x455cu16), 0x5012 => Some(0x455du16), 0x515a => Some(0x455eu16), 0x51ac => Some(0x455fu16), 0x51cd => Some(0x4560u16), 0x5200 => Some(0x4561u16), 0x5510 => Some(0x4562u16), 0x5854 => Some(0x4563u16), 0x5858 => Some(0x4564u16), 0x5957 => Some(0x4565u16), 0x5b95 => Some(0x4566u16), 0x5cf6 => Some(0x4567u16), 0x5d8b => Some(0x4568u16), 0x60bc => Some(0x4569u16), 0x6295 => Some(0x456au16), 0x642d => Some(0x456bu16), 0x6771 => Some(0x456cu16), 0x6843 => Some(0x456du16), 0x68bc => Some(0x456eu16), 0x68df => Some(0x456fu16), 0x76d7 => Some(0x4570u16), 0x6dd8 => Some(0x4571u16), 0x6e6f => Some(0x4572u16), 0x6d9b => Some(0x4573u16), 0x706f => Some(0x4574u16), 0x71c8 => Some(0x4575u16), 0x5f53 => Some(0x4576u16), 0x75d8 => Some(0x4577u16), 0x7977 => Some(0x4578u16), 0x7b49 => Some(0x4579u16), 0x7b54 => Some(0x457au16), 0x7b52 => Some(0x457bu16), 0x7cd6 => Some(0x457cu16), 0x7d71 => Some(0x457du16), 0x5230 => Some(0x457eu16), 0x8463 => Some(0x4621u16), 0x8569 => Some(0x4622u16), 0x85e4 => Some(0x4623u16), 0x8a0e => Some(0x4624u16), 0x8b04 => Some(0x4625u16), 0x8c46 => Some(0x4626u16), 0x8e0f => Some(0x4627u16), 0x9003 => Some(0x4628u16), 0x900f => Some(0x4629u16), 0x9419 => Some(0x462au16), 0x9676 => Some(0x462bu16), 0x982d => Some(0x462cu16), 0x9a30 => Some(0x462du16), 0x95d8 => Some(0x462eu16), 0x50cd => Some(0x462fu16), 0x52d5 => Some(0x4630u16), 0x540c => Some(0x4631u16), 0x5802 => Some(0x4632u16), 0x5c0e => Some(0x4633u16), 0x61a7 => Some(0x4634u16), 0x649e => Some(0x4635u16), 0x6d1e => Some(0x4636u16), 0x77b3 => Some(0x4637u16), 0x7ae5 => Some(0x4638u16), 0x80f4 => Some(0x4639u16), 0x8404 => Some(0x463au16), 0x9053 => Some(0x463bu16), 0x9285 => Some(0x463cu16), 0x5ce0 => Some(0x463du16), 0x9d07 => Some(0x463eu16), 0x533f => Some(0x463fu16), 0x5f97 => Some(0x4640u16), 0x5fb3 => Some(0x4641u16), 0x6d9c => Some(0x4642u16), 0x7279 => Some(0x4643u16), 0x7763 => Some(0x4644u16), 0x79bf => Some(0x4645u16), 0x7be4 => Some(0x4646u16), 0x6bd2 => Some(0x4647u16), 0x72ec => Some(0x4648u16), 0x8aad => Some(0x4649u16), 0x6803 => Some(0x464au16), 0x6a61 => Some(0x464bu16), 0x51f8 => Some(0x464cu16), 0x7a81 => Some(0x464du16), 0x6934 => Some(0x464eu16), 0x5c4a => Some(0x464fu16), 0x9cf6 => Some(0x4650u16), 0x82eb => Some(0x4651u16), 0x5bc5 => Some(0x4652u16), 0x9149 => Some(0x4653u16), 0x701e => Some(0x4654u16), 0x5678 => Some(0x4655u16), 0x5c6f => Some(0x4656u16), 0x60c7 => Some(0x4657u16), 0x6566 => Some(0x4658u16), 0x6c8c => Some(0x4659u16), 0x8c5a => Some(0x465au16), 0x9041 => Some(0x465bu16), 0x9813 => Some(0x465cu16), 0x5451 => Some(0x465du16), 0x66c7 => Some(0x465eu16), 0x920d => Some(0x465fu16), 0x5948 => Some(0x4660u16), 0x90a3 => Some(0x4661u16), 0x5185 => Some(0x4662u16), 0x4e4d => Some(0x4663u16), 0x51ea => Some(0x4664u16), 0x8599 => Some(0x4665u16), 0x8b0e => Some(0x4666u16), 0x7058 => Some(0x4667u16), 0x637a => Some(0x4668u16), 0x934b => Some(0x4669u16), 0x6962 => Some(0x466au16), 0x99b4 => Some(0x466bu16), 0x7e04 => Some(0x466cu16), 0x7577 => Some(0x466du16), 0x5357 => Some(0x466eu16), 0x6960 => Some(0x466fu16), 0x8edf => Some(0x4670u16), 0x96e3 => Some(0x4671u16), 0x6c5d => Some(0x4672u16), 0x4e8c => Some(0x4673u16), 0x5c3c => Some(0x4674u16), 0x5f10 => Some(0x4675u16), 0x8fe9 => Some(0x4676u16), 0x5302 => Some(0x4677u16), 0x8cd1 => Some(0x4678u16), 0x8089 => Some(0x4679u16), 0x8679 => Some(0x467au16), 0x5eff => Some(0x467bu16), 0x65e5 => Some(0x467cu16), 0x4e73 => Some(0x467du16), 0x5165 => Some(0x467eu16), 0x5982 => Some(0x4721u16), 0x5c3f => Some(0x4722u16), 0x97ee => Some(0x4723u16), 0x4efb => Some(0x4724u16), 0x598a => Some(0x4725u16), 0x5fcd => Some(0x4726u16), 0x8a8d => Some(0x4727u16), 0x6fe1 => Some(0x4728u16), 0x79b0 => Some(0x4729u16), 0x7962 => Some(0x472au16), 0x5be7 => Some(0x472bu16), 0x8471 => Some(0x472cu16), 0x732b => Some(0x472du16), 0x71b1 => Some(0x472eu16), 0x5e74 => Some(0x472fu16), 0x5ff5 => Some(0x4730u16), 0x637b => Some(0x4731u16), 0x649a => Some(0x4732u16), 0x71c3 => Some(0x4733u16), 0x7c98 => Some(0x4734u16), 0x4e43 => Some(0x4735u16), 0x5efc => Some(0x4736u16), 0x4e4b => Some(0x4737u16), 0x57dc => Some(0x4738u16), 0x56a2 => Some(0x4739u16), 0x60a9 => Some(0x473au16), 0x6fc3 => Some(0x473bu16), 0x7d0d => Some(0x473cu16), 0x80fd => Some(0x473du16), 0x8133 => Some(0x473eu16), 0x81bf => Some(0x473fu16), 0x8fb2 => Some(0x4740u16), 0x8997 => Some(0x4741u16), 0x86a4 => Some(0x4742u16), 0x5df4 => Some(0x4743u16), 0x628a => Some(0x4744u16), 0x64ad => Some(0x4745u16), 0x8987 => Some(0x4746u16), 0x6777 => Some(0x4747u16), 0x6ce2 => Some(0x4748u16), 0x6d3e => Some(0x4749u16), 0x7436 => Some(0x474au16), 0x7834 => Some(0x474bu16), 0x5a46 => Some(0x474cu16), 0x7f75 => Some(0x474du16), 0x82ad => Some(0x474eu16), 0x99ac => Some(0x474fu16), 0x4ff3 => Some(0x4750u16), 0x5ec3 => Some(0x4751u16), 0x62dd => Some(0x4752u16), 0x6392 => Some(0x4753u16), 0x6557 => Some(0x4754u16), 0x676f => Some(0x4755u16), 0x76c3 => Some(0x4756u16), 0x724c => Some(0x4757u16), 0x80cc => Some(0x4758u16), 0x80ba => Some(0x4759u16), 0x8f29 => Some(0x475au16), 0x914d => Some(0x475bu16), 0x500d => Some(0x475cu16), 0x57f9 => Some(0x475du16), 0x5a92 => Some(0x475eu16), 0x6885 => Some(0x475fu16), 0x6973 => Some(0x4760u16), 0x7164 => Some(0x4761u16), 0x72fd => Some(0x4762u16), 0x8cb7 => Some(0x4763u16), 0x58f2 => Some(0x4764u16), 0x8ce0 => Some(0x4765u16), 0x966a => Some(0x4766u16), 0x9019 => Some(0x4767u16), 0x877f => Some(0x4768u16), 0x79e4 => Some(0x4769u16), 0x77e7 => Some(0x476au16), 0x8429 => Some(0x476bu16), 0x4f2f => Some(0x476cu16), 0x5265 => Some(0x476du16), 0x535a => Some(0x476eu16), 0x62cd => Some(0x476fu16), 0x67cf => Some(0x4770u16), 0x6cca => Some(0x4771u16), 0x767d => Some(0x4772u16), 0x7b94 => Some(0x4773u16), 0x7c95 => Some(0x4774u16), 0x8236 => Some(0x4775u16), 0x8584 => Some(0x4776u16), 0x8feb => Some(0x4777u16), 0x66dd => Some(0x4778u16), 0x6f20 => Some(0x4779u16), 0x7206 => Some(0x477au16), 0x7e1b => Some(0x477bu16), 0x83ab => Some(0x477cu16), 0x99c1 => Some(0x477du16), 0x9ea6 => Some(0x477eu16), 0x51fd => Some(0x4821u16), 0x7bb1 => Some(0x4822u16), 0x7872 => Some(0x4823u16), 0x7bb8 => Some(0x4824u16), 0x8087 => Some(0x4825u16), 0x7b48 => Some(0x4826u16), 0x6ae8 => Some(0x4827u16), 0x5e61 => Some(0x4828u16), 0x808c => Some(0x4829u16), 0x7551 => Some(0x482au16), 0x7560 => Some(0x482bu16), 0x516b => Some(0x482cu16), 0x9262 => Some(0x482du16), 0x6e8c => Some(0x482eu16), 0x767a => Some(0x482fu16), 0x9197 => Some(0x4830u16), 0x9aea => Some(0x4831u16), 0x4f10 => Some(0x4832u16), 0x7f70 => Some(0x4833u16), 0x629c => Some(0x4834u16), 0x7b4f => Some(0x4835u16), 0x95a5 => Some(0x4836u16), 0x9ce9 => Some(0x4837u16), 0x567a => Some(0x4838u16), 0x5859 => Some(0x4839u16), 0x86e4 => Some(0x483au16), 0x96bc => Some(0x483bu16), 0x4f34 => Some(0x483cu16), 0x5224 => Some(0x483du16), 0x534a => Some(0x483eu16), 0x53cd => Some(0x483fu16), 0x53db => Some(0x4840u16), 0x5e06 => Some(0x4841u16), 0x642c => Some(0x4842u16), 0x6591 => Some(0x4843u16), 0x677f => Some(0x4844u16), 0x6c3e => Some(0x4845u16), 0x6c4e => Some(0x4846u16), 0x7248 => Some(0x4847u16), 0x72af => Some(0x4848u16), 0x73ed => Some(0x4849u16), 0x7554 => Some(0x484au16), 0x7e41 => Some(0x484bu16), 0x822c => Some(0x484cu16), 0x85e9 => Some(0x484du16), 0x8ca9 => Some(0x484eu16), 0x7bc4 => Some(0x484fu16), 0x91c6 => Some(0x4850u16), 0x7169 => Some(0x4851u16), 0x9812 => Some(0x4852u16), 0x98ef => Some(0x4853u16), 0x633d => Some(0x4854u16), 0x6669 => Some(0x4855u16), 0x756a => Some(0x4856u16), 0x76e4 => Some(0x4857u16), 0x78d0 => Some(0x4858u16), 0x8543 => Some(0x4859u16), 0x86ee => Some(0x485au16), 0x532a => Some(0x485bu16), 0x5351 => Some(0x485cu16), 0x5426 => Some(0x485du16), 0x5983 => Some(0x485eu16), 0x5e87 => Some(0x485fu16), 0x5f7c => Some(0x4860u16), 0x60b2 => Some(0x4861u16), 0x6249 => Some(0x4862u16), 0x6279 => Some(0x4863u16), 0x62ab => Some(0x4864u16), 0x6590 => Some(0x4865u16), 0x6bd4 => Some(0x4866u16), 0x6ccc => Some(0x4867u16), 0x75b2 => Some(0x4868u16), 0x76ae => Some(0x4869u16), 0x7891 => Some(0x486au16), 0x79d8 => Some(0x486bu16), 0x7dcb => Some(0x486cu16), 0x7f77 => Some(0x486du16), 0x80a5 => Some(0x486eu16), 0x88ab => Some(0x486fu16), 0x8ab9 => Some(0x4870u16), 0x8cbb => Some(0x4871u16), 0x907f => Some(0x4872u16), 0x975e => Some(0x4873u16), 0x98db => Some(0x4874u16), 0x6a0b => Some(0x4875u16), 0x7c38 => Some(0x4876u16), 0x5099 => Some(0x4877u16), 0x5c3e => Some(0x4878u16), 0x5fae => Some(0x4879u16), 0x6787 => Some(0x487au16), 0x6bd8 => Some(0x487bu16), 0x7435 => Some(0x487cu16), 0x7709 => Some(0x487du16), 0x7f8e => Some(0x487eu16), 0x9f3b => Some(0x4921u16), 0x67ca => Some(0x4922u16), 0x7a17 => Some(0x4923u16), 0x5339 => Some(0x4924u16), 0x758b => Some(0x4925u16), 0x9aed => Some(0x4926u16), 0x5f66 => Some(0x4927u16), 0x819d => Some(0x4928u16), 0x83f1 => Some(0x4929u16), 0x8098 => Some(0x492au16), 0x5f3c => Some(0x492bu16), 0x5fc5 => Some(0x492cu16), 0x7562 => Some(0x492du16), 0x7b46 => Some(0x492eu16), 0x903c => Some(0x492fu16), 0x6867 => Some(0x4930u16), 0x59eb => Some(0x4931u16), 0x5a9b => Some(0x4932u16), 0x7d10 => Some(0x4933u16), 0x767e => Some(0x4934u16), 0x8b2c => Some(0x4935u16), 0x4ff5 => Some(0x4936u16), 0x5f6a => Some(0x4937u16), 0x6a19 => Some(0x4938u16), 0x6c37 => Some(0x4939u16), 0x6f02 => Some(0x493au16), 0x74e2 => Some(0x493bu16), 0x7968 => Some(0x493cu16), 0x8868 => Some(0x493du16), 0x8a55 => Some(0x493eu16), 0x8c79 => Some(0x493fu16), 0x5edf => Some(0x4940u16), 0x63cf => Some(0x4941u16), 0x75c5 => Some(0x4942u16), 0x79d2 => Some(0x4943u16), 0x82d7 => Some(0x4944u16), 0x9328 => Some(0x4945u16), 0x92f2 => Some(0x4946u16), 0x849c => Some(0x4947u16), 0x86ed => Some(0x4948u16), 0x9c2d => Some(0x4949u16), 0x54c1 => Some(0x494au16), 0x5f6c => Some(0x494bu16), 0x658c => Some(0x494cu16), 0x6d5c => Some(0x494du16), 0x7015 => Some(0x494eu16), 0x8ca7 => Some(0x494fu16), 0x8cd3 => Some(0x4950u16), 0x983b => Some(0x4951u16), 0x654f => Some(0x4952u16), 0x74f6 => Some(0x4953u16), 0x4e0d => Some(0x4954u16), 0x4ed8 => Some(0x4955u16), 0x57e0 => Some(0x4956u16), 0x592b => Some(0x4957u16), 0x5a66 => Some(0x4958u16), 0x5bcc => Some(0x4959u16), 0x51a8 => Some(0x495au16), 0x5e03 => Some(0x495bu16), 0x5e9c => Some(0x495cu16), 0x6016 => Some(0x495du16), 0x6276 => Some(0x495eu16), 0x6577 => Some(0x495fu16), 0x65a7 => Some(0x4960u16), 0x666e => Some(0x4961u16), 0x6d6e => Some(0x4962u16), 0x7236 => Some(0x4963u16), 0x7b26 => Some(0x4964u16), 0x8150 => Some(0x4965u16), 0x819a => Some(0x4966u16), 0x8299 => Some(0x4967u16), 0x8b5c => Some(0x4968u16), 0x8ca0 => Some(0x4969u16), 0x8ce6 => Some(0x496au16), 0x8d74 => Some(0x496bu16), 0x961c => Some(0x496cu16), 0x9644 => Some(0x496du16), 0x4fae => Some(0x496eu16), 0x64ab => Some(0x496fu16), 0x6b66 => Some(0x4970u16), 0x821e => Some(0x4971u16), 0x8461 => Some(0x4972u16), 0x856a => Some(0x4973u16), 0x90e8 => Some(0x4974u16), 0x5c01 => Some(0x4975u16), 0x6953 => Some(0x4976u16), 0x98a8 => Some(0x4977u16), 0x847a => Some(0x4978u16), 0x8557 => Some(0x4979u16), 0x4f0f => Some(0x497au16), 0x526f => Some(0x497bu16), 0x5fa9 => Some(0x497cu16), 0x5e45 => Some(0x497du16), 0x670d => Some(0x497eu16), 0x798f => Some(0x4a21u16), 0x8179 => Some(0x4a22u16), 0x8907 => Some(0x4a23u16), 0x8986 => Some(0x4a24u16), 0x6df5 => Some(0x4a25u16), 0x5f17 => Some(0x4a26u16), 0x6255 => Some(0x4a27u16), 0x6cb8 => Some(0x4a28u16), 0x4ecf => Some(0x4a29u16), 0x7269 => Some(0x4a2au16), 0x9b92 => Some(0x4a2bu16), 0x5206 => Some(0x4a2cu16), 0x543b => Some(0x4a2du16), 0x5674 => Some(0x4a2eu16), 0x58b3 => Some(0x4a2fu16), 0x61a4 => Some(0x4a30u16), 0x626e => Some(0x4a31u16), 0x711a => Some(0x4a32u16), 0x596e => Some(0x4a33u16), 0x7c89 => Some(0x4a34u16), 0x7cde => Some(0x4a35u16), 0x7d1b => Some(0x4a36u16), 0x96f0 => Some(0x4a37u16), 0x6587 => Some(0x4a38u16), 0x805e => Some(0x4a39u16), 0x4e19 => Some(0x4a3au16), 0x4f75 => Some(0x4a3bu16), 0x5175 => Some(0x4a3cu16), 0x5840 => Some(0x4a3du16), 0x5e63 => Some(0x4a3eu16), 0x5e73 => Some(0x4a3fu16), 0x5f0a => Some(0x4a40u16), 0x67c4 => Some(0x4a41u16), 0x4e26 => Some(0x4a42u16), 0x853d => Some(0x4a43u16), 0x9589 => Some(0x4a44u16), 0x965b => Some(0x4a45u16), 0x7c73 => Some(0x4a46u16), 0x9801 => Some(0x4a47u16), 0x50fb => Some(0x4a48u16), 0x58c1 => Some(0x4a49u16), 0x7656 => Some(0x4a4au16), 0x78a7 => Some(0x4a4bu16), 0x5225 => Some(0x4a4cu16), 0x77a5 => Some(0x4a4du16), 0x8511 => Some(0x4a4eu16), 0x7b86 => Some(0x4a4fu16), 0x504f => Some(0x4a50u16), 0x5909 => Some(0x4a51u16), 0x7247 => Some(0x4a52u16), 0x7bc7 => Some(0x4a53u16), 0x7de8 => Some(0x4a54u16), 0x8fba => Some(0x4a55u16), 0x8fd4 => Some(0x4a56u16), 0x904d => Some(0x4a57u16), 0x4fbf => Some(0x4a58u16), 0x52c9 => Some(0x4a59u16), 0x5a29 => Some(0x4a5au16), 0x5f01 => Some(0x4a5bu16), 0x97ad => Some(0x4a5cu16), 0x4fdd => Some(0x4a5du16), 0x8217 => Some(0x4a5eu16), 0x92ea => Some(0x4a5fu16), 0x5703 => Some(0x4a60u16), 0x6355 => Some(0x4a61u16), 0x6b69 => Some(0x4a62u16), 0x752b => Some(0x4a63u16), 0x88dc => Some(0x4a64u16), 0x8f14 => Some(0x4a65u16), 0x7a42 => Some(0x4a66u16), 0x52df => Some(0x4a67u16), 0x5893 => Some(0x4a68u16), 0x6155 => Some(0x4a69u16), 0x620a => Some(0x4a6au16), 0x66ae => Some(0x4a6bu16), 0x6bcd => Some(0x4a6cu16), 0x7c3f => Some(0x4a6du16), 0x83e9 => Some(0x4a6eu16), 0x5023 => Some(0x4a6fu16), 0x4ff8 => Some(0x4a70u16), 0x5305 => Some(0x4a71u16), 0x5446 => Some(0x4a72u16), 0x5831 => Some(0x4a73u16), 0x5949 => Some(0x4a74u16), 0x5b9d => Some(0x4a75u16), 0x5cf0 => Some(0x4a76u16), 0x5cef => Some(0x4a77u16), 0x5d29 => Some(0x4a78u16), 0x5e96 => Some(0x4a79u16), 0x62b1 => Some(0x4a7au16), 0x6367 => Some(0x4a7bu16), 0x653e => Some(0x4a7cu16), 0x65b9 => Some(0x4a7du16), 0x670b => Some(0x4a7eu16), 0x6cd5 => Some(0x4b21u16), 0x6ce1 => Some(0x4b22u16), 0x70f9 => Some(0x4b23u16), 0x7832 => Some(0x4b24u16), 0x7e2b => Some(0x4b25u16), 0x80de => Some(0x4b26u16), 0x82b3 => Some(0x4b27u16), 0x840c => Some(0x4b28u16), 0x84ec => Some(0x4b29u16), 0x8702 => Some(0x4b2au16), 0x8912 => Some(0x4b2bu16), 0x8a2a => Some(0x4b2cu16), 0x8c4a => Some(0x4b2du16), 0x90a6 => Some(0x4b2eu16), 0x92d2 => Some(0x4b2fu16), 0x98fd => Some(0x4b30u16), 0x9cf3 => Some(0x4b31u16), 0x9d6c => Some(0x4b32u16), 0x4e4f => Some(0x4b33u16), 0x4ea1 => Some(0x4b34u16), 0x508d => Some(0x4b35u16), 0x5256 => Some(0x4b36u16), 0x574a => Some(0x4b37u16), 0x59a8 => Some(0x4b38u16), 0x5e3d => Some(0x4b39u16), 0x5fd8 => Some(0x4b3au16), 0x5fd9 => Some(0x4b3bu16), 0x623f => Some(0x4b3cu16), 0x66b4 => Some(0x4b3du16), 0x671b => Some(0x4b3eu16), 0x67d0 => Some(0x4b3fu16), 0x68d2 => Some(0x4b40u16), 0x5192 => Some(0x4b41u16), 0x7d21 => Some(0x4b42u16), 0x80aa => Some(0x4b43u16), 0x81a8 => Some(0x4b44u16), 0x8b00 => Some(0x4b45u16), 0x8c8c => Some(0x4b46u16), 0x8cbf => Some(0x4b47u16), 0x927e => Some(0x4b48u16), 0x9632 => Some(0x4b49u16), 0x5420 => Some(0x4b4au16), 0x982c => Some(0x4b4bu16), 0x5317 => Some(0x4b4cu16), 0x50d5 => Some(0x4b4du16), 0x535c => Some(0x4b4eu16), 0x58a8 => Some(0x4b4fu16), 0x64b2 => Some(0x4b50u16), 0x6734 => Some(0x4b51u16), 0x7267 => Some(0x4b52u16), 0x7766 => Some(0x4b53u16), 0x7a46 => Some(0x4b54u16), 0x91e6 => Some(0x4b55u16), 0x52c3 => Some(0x4b56u16), 0x6ca1 => Some(0x4b57u16), 0x6b86 => Some(0x4b58u16), 0x5800 => Some(0x4b59u16), 0x5e4c => Some(0x4b5au16), 0x5954 => Some(0x4b5bu16), 0x672c => Some(0x4b5cu16), 0x7ffb => Some(0x4b5du16), 0x51e1 => Some(0x4b5eu16), 0x76c6 => Some(0x4b5fu16), 0x6469 => Some(0x4b60u16), 0x78e8 => Some(0x4b61u16), 0x9b54 => Some(0x4b62u16), 0x9ebb => Some(0x4b63u16), 0x57cb => Some(0x4b64u16), 0x59b9 => Some(0x4b65u16), 0x6627 => Some(0x4b66u16), 0x679a => Some(0x4b67u16), 0x6bce => Some(0x4b68u16), 0x54e9 => Some(0x4b69u16), 0x69d9 => Some(0x4b6au16), 0x5e55 => Some(0x4b6bu16), 0x819c => Some(0x4b6cu16), 0x6795 => Some(0x4b6du16), 0x9baa => Some(0x4b6eu16), 0x67fe => Some(0x4b6fu16), 0x9c52 => Some(0x4b70u16), 0x685d => Some(0x4b71u16), 0x4ea6 => Some(0x4b72u16), 0x4fe3 => Some(0x4b73u16), 0x53c8 => Some(0x4b74u16), 0x62b9 => Some(0x4b75u16), 0x672b => Some(0x4b76u16), 0x6cab => Some(0x4b77u16), 0x8fc4 => Some(0x4b78u16), 0x4fad => Some(0x4b79u16), 0x7e6d => Some(0x4b7au16), 0x9ebf => Some(0x4b7bu16), 0x4e07 => Some(0x4b7cu16), 0x6162 => Some(0x4b7du16), 0x6e80 => Some(0x4b7eu16), 0x6f2b => Some(0x4c21u16), 0x8513 => Some(0x4c22u16), 0x5473 => Some(0x4c23u16), 0x672a => Some(0x4c24u16), 0x9b45 => Some(0x4c25u16), 0x5df3 => Some(0x4c26u16), 0x7b95 => Some(0x4c27u16), 0x5cac => Some(0x4c28u16), 0x5bc6 => Some(0x4c29u16), 0x871c => Some(0x4c2au16), 0x6e4a => Some(0x4c2bu16), 0x84d1 => Some(0x4c2cu16), 0x7a14 => Some(0x4c2du16), 0x8108 => Some(0x4c2eu16), 0x5999 => Some(0x4c2fu16), 0x7c8d => Some(0x4c30u16), 0x6c11 => Some(0x4c31u16), 0x7720 => Some(0x4c32u16), 0x52d9 => Some(0x4c33u16), 0x5922 => Some(0x4c34u16), 0x7121 => Some(0x4c35u16), 0x725f => Some(0x4c36u16), 0x77db => Some(0x4c37u16), 0x9727 => Some(0x4c38u16), 0x9d61 => Some(0x4c39u16), 0x690b => Some(0x4c3au16), 0x5a7f => Some(0x4c3bu16), 0x5a18 => Some(0x4c3cu16), 0x51a5 => Some(0x4c3du16), 0x540d => Some(0x4c3eu16), 0x547d => Some(0x4c3fu16), 0x660e => Some(0x4c40u16), 0x76df => Some(0x4c41u16), 0x8ff7 => Some(0x4c42u16), 0x9298 => Some(0x4c43u16), 0x9cf4 => Some(0x4c44u16), 0x59ea => Some(0x4c45u16), 0x725d => Some(0x4c46u16), 0x6ec5 => Some(0x4c47u16), 0x514d => Some(0x4c48u16), 0x68c9 => Some(0x4c49u16), 0x7dbf => Some(0x4c4au16), 0x7dec => Some(0x4c4bu16), 0x9762 => Some(0x4c4cu16), 0x9eba => Some(0x4c4du16), 0x6478 => Some(0x4c4eu16), 0x6a21 => Some(0x4c4fu16), 0x8302 => Some(0x4c50u16), 0x5984 => Some(0x4c51u16), 0x5b5f => Some(0x4c52u16), 0x6bdb => Some(0x4c53u16), 0x731b => Some(0x4c54u16), 0x76f2 => Some(0x4c55u16), 0x7db2 => Some(0x4c56u16), 0x8017 => Some(0x4c57u16), 0x8499 => Some(0x4c58u16), 0x5132 => Some(0x4c59u16), 0x6728 => Some(0x4c5au16), 0x9ed9 => Some(0x4c5bu16), 0x76ee => Some(0x4c5cu16), 0x6762 => Some(0x4c5du16), 0x52ff => Some(0x4c5eu16), 0x9905 => Some(0x4c5fu16), 0x5c24 => Some(0x4c60u16), 0x623b => Some(0x4c61u16), 0x7c7e => Some(0x4c62u16), 0x8cb0 => Some(0x4c63u16), 0x554f => Some(0x4c64u16), 0x60b6 => Some(0x4c65u16), 0x7d0b => Some(0x4c66u16), 0x9580 => Some(0x4c67u16), 0x5301 => Some(0x4c68u16), 0x4e5f => Some(0x4c69u16), 0x51b6 => Some(0x4c6au16), 0x591c => Some(0x4c6bu16), 0x723a => Some(0x4c6cu16), 0x8036 => Some(0x4c6du16), 0x91ce => Some(0x4c6eu16), 0x5f25 => Some(0x4c6fu16), 0x77e2 => Some(0x4c70u16), 0x5384 => Some(0x4c71u16), 0x5f79 => Some(0x4c72u16), 0x7d04 => Some(0x4c73u16), 0x85ac => Some(0x4c74u16), 0x8a33 => Some(0x4c75u16), 0x8e8d => Some(0x4c76u16), 0x9756 => Some(0x4c77u16), 0x67f3 => Some(0x4c78u16), 0x85ae => Some(0x4c79u16), 0x9453 => Some(0x4c7au16), 0x6109 => Some(0x4c7bu16), 0x6108 => Some(0x4c7cu16), 0x6cb9 => Some(0x4c7du16), 0x7652 => Some(0x4c7eu16), 0x8aed => Some(0x4d21u16), 0x8f38 => Some(0x4d22u16), 0x552f => Some(0x4d23u16), 0x4f51 => Some(0x4d24u16), 0x512a => Some(0x4d25u16), 0x52c7 => Some(0x4d26u16), 0x53cb => Some(0x4d27u16), 0x5ba5 => Some(0x4d28u16), 0x5e7d => Some(0x4d29u16), 0x60a0 => Some(0x4d2au16), 0x6182 => Some(0x4d2bu16), 0x63d6 => Some(0x4d2cu16), 0x6709 => Some(0x4d2du16), 0x67da => Some(0x4d2eu16), 0x6e67 => Some(0x4d2fu16), 0x6d8c => Some(0x4d30u16), 0x7336 => Some(0x4d31u16), 0x7337 => Some(0x4d32u16), 0x7531 => Some(0x4d33u16), 0x7950 => Some(0x4d34u16), 0x88d5 => Some(0x4d35u16), 0x8a98 => Some(0x4d36u16), 0x904a => Some(0x4d37u16), 0x9091 => Some(0x4d38u16), 0x90f5 => Some(0x4d39u16), 0x96c4 => Some(0x4d3au16), 0x878d => Some(0x4d3bu16), 0x5915 => Some(0x4d3cu16), 0x4e88 => Some(0x4d3du16), 0x4f59 => Some(0x4d3eu16), 0x4e0e => Some(0x4d3fu16), 0x8a89 => Some(0x4d40u16), 0x8f3f => Some(0x4d41u16), 0x9810 => Some(0x4d42u16), 0x50ad => Some(0x4d43u16), 0x5e7c => Some(0x4d44u16), 0x5996 => Some(0x4d45u16), 0x5bb9 => Some(0x4d46u16), 0x5eb8 => Some(0x4d47u16), 0x63da => Some(0x4d48u16), 0x63fa => Some(0x4d49u16), 0x64c1 => Some(0x4d4au16), 0x66dc => Some(0x4d4bu16), 0x694a => Some(0x4d4cu16), 0x69d8 => Some(0x4d4du16), 0x6d0b => Some(0x4d4eu16), 0x6eb6 => Some(0x4d4fu16), 0x7194 => Some(0x4d50u16), 0x7528 => Some(0x4d51u16), 0x7aaf => Some(0x4d52u16), 0x7f8a => Some(0x4d53u16), 0x8000 => Some(0x4d54u16), 0x8449 => Some(0x4d55u16), 0x84c9 => Some(0x4d56u16), 0x8981 => Some(0x4d57u16), 0x8b21 => Some(0x4d58u16), 0x8e0a => Some(0x4d59u16), 0x9065 => Some(0x4d5au16), 0x967d => Some(0x4d5bu16), 0x990a => Some(0x4d5cu16), 0x617e => Some(0x4d5du16), 0x6291 => Some(0x4d5eu16), 0x6b32 => Some(0x4d5fu16), 0x6c83 => Some(0x4d60u16), 0x6d74 => Some(0x4d61u16), 0x7fcc => Some(0x4d62u16), 0x7ffc => Some(0x4d63u16), 0x6dc0 => Some(0x4d64u16), 0x7f85 => Some(0x4d65u16), 0x87ba => Some(0x4d66u16), 0x88f8 => Some(0x4d67u16), 0x6765 => Some(0x4d68u16), 0x83b1 => Some(0x4d69u16), 0x983c => Some(0x4d6au16), 0x96f7 => Some(0x4d6bu16), 0x6d1b => Some(0x4d6cu16), 0x7d61 => Some(0x4d6du16), 0x843d => Some(0x4d6eu16), 0x916a => Some(0x4d6fu16), 0x4e71 => Some(0x4d70u16), 0x5375 => Some(0x4d71u16), 0x5d50 => Some(0x4d72u16), 0x6b04 => Some(0x4d73u16), 0x6feb => Some(0x4d74u16), 0x85cd => Some(0x4d75u16), 0x862d => Some(0x4d76u16), 0x89a7 => Some(0x4d77u16), 0x5229 => Some(0x4d78u16), 0x540f => Some(0x4d79u16), 0x5c65 => Some(0x4d7au16), 0x674e => Some(0x4d7bu16), 0x68a8 => Some(0x4d7cu16), 0x7406 => Some(0x4d7du16), 0x7483 => Some(0x4d7eu16), 0x75e2 => Some(0x4e21u16), 0x88cf => Some(0x4e22u16), 0x88e1 => Some(0x4e23u16), 0x91cc => Some(0x4e24u16), 0x96e2 => Some(0x4e25u16), 0x9678 => Some(0x4e26u16), 0x5f8b => Some(0x4e27u16), 0x7387 => Some(0x4e28u16), 0x7acb => Some(0x4e29u16), 0x844e => Some(0x4e2au16), 0x63a0 => Some(0x4e2bu16), 0x7565 => Some(0x4e2cu16), 0x5289 => Some(0x4e2du16), 0x6d41 => Some(0x4e2eu16), 0x6e9c => Some(0x4e2fu16), 0x7409 => Some(0x4e30u16), 0x7559 => Some(0x4e31u16), 0x786b => Some(0x4e32u16), 0x7c92 => Some(0x4e33u16), 0x9686 => Some(0x4e34u16), 0x7adc => Some(0x4e35u16), 0x9f8d => Some(0x4e36u16), 0x4fb6 => Some(0x4e37u16), 0x616e => Some(0x4e38u16), 0x65c5 => Some(0x4e39u16), 0x865c => Some(0x4e3au16), 0x4e86 => Some(0x4e3bu16), 0x4eae => Some(0x4e3cu16), 0x50da => Some(0x4e3du16), 0x4e21 => Some(0x4e3eu16), 0x51cc => Some(0x4e3fu16), 0x5bee => Some(0x4e40u16), 0x6599 => Some(0x4e41u16), 0x6881 => Some(0x4e42u16), 0x6dbc => Some(0x4e43u16), 0x731f => Some(0x4e44u16), 0x7642 => Some(0x4e45u16), 0x77ad => Some(0x4e46u16), 0x7a1c => Some(0x4e47u16), 0x7ce7 => Some(0x4e48u16), 0x826f => Some(0x4e49u16), 0x8ad2 => Some(0x4e4au16), 0x907c => Some(0x4e4bu16), 0x91cf => Some(0x4e4cu16), 0x9675 => Some(0x4e4du16), 0x9818 => Some(0x4e4eu16), 0x529b => Some(0x4e4fu16), 0x7dd1 => Some(0x4e50u16), 0x502b => Some(0x4e51u16), 0x5398 => Some(0x4e52u16), 0x6797 => Some(0x4e53u16), 0x6dcb => Some(0x4e54u16), 0x71d0 => Some(0x4e55u16), 0x7433 => Some(0x4e56u16), 0x81e8 => Some(0x4e57u16), 0x8f2a => Some(0x4e58u16), 0x96a3 => Some(0x4e59u16), 0x9c57 => Some(0x4e5au16), 0x9e9f => Some(0x4e5bu16), 0x7460 => Some(0x4e5cu16), 0x5841 => Some(0x4e5du16), 0x6d99 => Some(0x4e5eu16), 0x7d2f => Some(0x4e5fu16), 0x985e => Some(0x4e60u16), 0x4ee4 => Some(0x4e61u16), 0x4f36 => Some(0x4e62u16), 0x4f8b => Some(0x4e63u16), 0x51b7 => Some(0x4e64u16), 0x52b1 => Some(0x4e65u16), 0x5dba => Some(0x4e66u16), 0x601c => Some(0x4e67u16), 0x73b2 => Some(0x4e68u16), 0x793c => Some(0x4e69u16), 0x82d3 => Some(0x4e6au16), 0x9234 => Some(0x4e6bu16), 0x96b7 => Some(0x4e6cu16), 0x96f6 => Some(0x4e6du16), 0x970a => Some(0x4e6eu16), 0x9e97 => Some(0x4e6fu16), 0x9f62 => Some(0x4e70u16), 0x66a6 => Some(0x4e71u16), 0x6b74 => Some(0x4e72u16), 0x5217 => Some(0x4e73u16), 0x52a3 => Some(0x4e74u16), 0x70c8 => Some(0x4e75u16), 0x88c2 => Some(0x4e76u16), 0x5ec9 => Some(0x4e77u16), 0x604b => Some(0x4e78u16), 0x6190 => Some(0x4e79u16), 0x6f23 => Some(0x4e7au16), 0x7149 => Some(0x4e7bu16), 0x7c3e => Some(0x4e7cu16), 0x7df4 => Some(0x4e7du16), 0x806f => Some(0x4e7eu16), 0x84ee => Some(0x4f21u16), 0x9023 => Some(0x4f22u16), 0x932c => Some(0x4f23u16), 0x5442 => Some(0x4f24u16), 0x9b6f => Some(0x4f25u16), 0x6ad3 => Some(0x4f26u16), 0x7089 => Some(0x4f27u16), 0x8cc2 => Some(0x4f28u16), 0x8def => Some(0x4f29u16), 0x9732 => Some(0x4f2au16), 0x52b4 => Some(0x4f2bu16), 0x5a41 => Some(0x4f2cu16), 0x5eca => Some(0x4f2du16), 0x5f04 => Some(0x4f2eu16), 0x6717 => Some(0x4f2fu16), 0x697c => Some(0x4f30u16), 0x6994 => Some(0x4f31u16), 0x6d6a => Some(0x4f32u16), 0x6f0f => Some(0x4f33u16), 0x7262 => Some(0x4f34u16), 0x72fc => Some(0x4f35u16), 0x7bed => Some(0x4f36u16), 0x8001 => Some(0x4f37u16), 0x807e => Some(0x4f38u16), 0x874b => Some(0x4f39u16), 0x90ce => Some(0x4f3au16), 0x516d => Some(0x4f3bu16), 0x9e93 => Some(0x4f3cu16), 0x7984 => Some(0x4f3du16), 0x808b => Some(0x4f3eu16), 0x9332 => Some(0x4f3fu16), 0x8ad6 => Some(0x4f40u16), 0x502d => Some(0x4f41u16), 0x548c => Some(0x4f42u16), 0x8a71 => Some(0x4f43u16), 0x6b6a => Some(0x4f44u16), 0x8cc4 => Some(0x4f45u16), 0x8107 => Some(0x4f46u16), 0x60d1 => Some(0x4f47u16), 0x67a0 => Some(0x4f48u16), 0x9df2 => Some(0x4f49u16), 0x4e99 => Some(0x4f4au16), 0x4e98 => Some(0x4f4bu16), 0x9c10 => Some(0x4f4cu16), 0x8a6b => Some(0x4f4du16), 0x85c1 => Some(0x4f4eu16), 0x8568 => Some(0x4f4fu16), 0x6900 => Some(0x4f50u16), 0x6e7e => Some(0x4f51u16), 0x7897 => Some(0x4f52u16), 0x8155 => Some(0x4f53u16), 0x5f0c => Some(0x5021u16), 0x4e10 => Some(0x5022u16), 0x4e15 => Some(0x5023u16), 0x4e2a => Some(0x5024u16), 0x4e31 => Some(0x5025u16), 0x4e36 => Some(0x5026u16), 0x4e3c => Some(0x5027u16), 0x4e3f => Some(0x5028u16), 0x4e42 => Some(0x5029u16), 0x4e56 => Some(0x502au16), 0x4e58 => Some(0x502bu16), 0x4e82 => Some(0x502cu16), 0x4e85 => Some(0x502du16), 0x8c6b => Some(0x502eu16), 0x4e8a => Some(0x502fu16), 0x8212 => Some(0x5030u16), 0x5f0d => Some(0x5031u16), 0x4e8e => Some(0x5032u16), 0x4e9e => Some(0x5033u16), 0x4e9f => Some(0x5034u16), 0x4ea0 => Some(0x5035u16), 0x4ea2 => Some(0x5036u16), 0x4eb0 => Some(0x5037u16), 0x4eb3 => Some(0x5038u16), 0x4eb6 => Some(0x5039u16), 0x4ece => Some(0x503au16), 0x4ecd => Some(0x503bu16), 0x4ec4 => Some(0x503cu16), 0x4ec6 => Some(0x503du16), 0x4ec2 => Some(0x503eu16), 0x4ed7 => Some(0x503fu16), 0x4ede => Some(0x5040u16), 0x4eed => Some(0x5041u16), 0x4edf => Some(0x5042u16), 0x4ef7 => Some(0x5043u16), 0x4f09 => Some(0x5044u16), 0x4f5a => Some(0x5045u16), 0x4f30 => Some(0x5046u16), 0x4f5b => Some(0x5047u16), 0x4f5d => Some(0x5048u16), 0x4f57 => Some(0x5049u16), 0x4f47 => Some(0x504au16), 0x4f76 => Some(0x504bu16), 0x4f88 => Some(0x504cu16), 0x4f8f => Some(0x504du16), 0x4f98 => Some(0x504eu16), 0x4f7b => Some(0x504fu16), 0x4f69 => Some(0x5050u16), 0x4f70 => Some(0x5051u16), 0x4f91 => Some(0x5052u16), 0x4f6f => Some(0x5053u16), 0x4f86 => Some(0x5054u16), 0x4f96 => Some(0x5055u16), 0x5118 => Some(0x5056u16), 0x4fd4 => Some(0x5057u16), 0x4fdf => Some(0x5058u16), 0x4fce => Some(0x5059u16), 0x4fd8 => Some(0x505au16), 0x4fdb => Some(0x505bu16), 0x4fd1 => Some(0x505cu16), 0x4fda => Some(0x505du16), 0x4fd0 => Some(0x505eu16), 0x4fe4 => Some(0x505fu16), 0x4fe5 => Some(0x5060u16), 0x501a => Some(0x5061u16), 0x5028 => Some(0x5062u16), 0x5014 => Some(0x5063u16), 0x502a => Some(0x5064u16), 0x5025 => Some(0x5065u16), 0x5005 => Some(0x5066u16), 0x4f1c => Some(0x5067u16), 0x4ff6 => Some(0x5068u16), 0x5021 => Some(0x5069u16), 0x5029 => Some(0x506au16), 0x502c => Some(0x506bu16), 0x4ffe => Some(0x506cu16), 0x4fef => Some(0x506du16), 0x5011 => Some(0x506eu16), 0x5006 => Some(0x506fu16), 0x5043 => Some(0x5070u16), 0x5047 => Some(0x5071u16), 0x6703 => Some(0x5072u16), 0x5055 => Some(0x5073u16), 0x5050 => Some(0x5074u16), 0x5048 => Some(0x5075u16), 0x505a => Some(0x5076u16), 0x5056 => Some(0x5077u16), 0x506c => Some(0x5078u16), 0x5078 => Some(0x5079u16), 0x5080 => Some(0x507au16), 0x509a => Some(0x507bu16), 0x5085 => Some(0x507cu16), 0x50b4 => Some(0x507du16), 0x50b2 => Some(0x507eu16), 0x50c9 => Some(0x5121u16), 0x50ca => Some(0x5122u16), 0x50b3 => Some(0x5123u16), 0x50c2 => Some(0x5124u16), 0x50d6 => Some(0x5125u16), 0x50de => Some(0x5126u16), 0x50e5 => Some(0x5127u16), 0x50ed => Some(0x5128u16), 0x50e3 => Some(0x5129u16), 0x50ee => Some(0x512au16), 0x50f9 => Some(0x512bu16), 0x50f5 => Some(0x512cu16), 0x5109 => Some(0x512du16), 0x5101 => Some(0x512eu16), 0x5102 => Some(0x512fu16), 0x5116 => Some(0x5130u16), 0x5115 => Some(0x5131u16), 0x5114 => Some(0x5132u16), 0x511a => Some(0x5133u16), 0x5121 => Some(0x5134u16), 0x513a => Some(0x5135u16), 0x5137 => Some(0x5136u16), 0x513c => Some(0x5137u16), 0x513b => Some(0x5138u16), 0x513f => Some(0x5139u16), 0x5140 => Some(0x513au16), 0x5152 => Some(0x513bu16), 0x514c => Some(0x513cu16), 0x5154 => Some(0x513du16), 0x5162 => Some(0x513eu16), 0x7af8 => Some(0x513fu16), 0x5169 => Some(0x5140u16), 0x516a => Some(0x5141u16), 0x516e => Some(0x5142u16), 0x5180 => Some(0x5143u16), 0x5182 => Some(0x5144u16), 0x56d8 => Some(0x5145u16), 0x518c => Some(0x5146u16), 0x5189 => Some(0x5147u16), 0x518f => Some(0x5148u16), 0x5191 => Some(0x5149u16), 0x5193 => Some(0x514au16), 0x5195 => Some(0x514bu16), 0x5196 => Some(0x514cu16), 0x51a4 => Some(0x514du16), 0x51a6 => Some(0x514eu16), 0x51a2 => Some(0x514fu16), 0x51a9 => Some(0x5150u16), 0x51aa => Some(0x5151u16), 0x51ab => Some(0x5152u16), 0x51b3 => Some(0x5153u16), 0x51b1 => Some(0x5154u16), 0x51b2 => Some(0x5155u16), 0x51b0 => Some(0x5156u16), 0x51b5 => Some(0x5157u16), 0x51bd => Some(0x5158u16), 0x51c5 => Some(0x5159u16), 0x51c9 => Some(0x515au16), 0x51db => Some(0x515bu16), 0x51e0 => Some(0x515cu16), 0x8655 => Some(0x515du16), 0x51e9 => Some(0x515eu16), 0x51ed => Some(0x515fu16), 0x51f0 => Some(0x5160u16), 0x51f5 => Some(0x5161u16), 0x51fe => Some(0x5162u16), 0x5204 => Some(0x5163u16), 0x520b => Some(0x5164u16), 0x5214 => Some(0x5165u16), 0x520e => Some(0x5166u16), 0x5227 => Some(0x5167u16), 0x522a => Some(0x5168u16), 0x522e => Some(0x5169u16), 0x5233 => Some(0x516au16), 0x5239 => Some(0x516bu16), 0x524f => Some(0x516cu16), 0x5244 => Some(0x516du16), 0x524b => Some(0x516eu16), 0x524c => Some(0x516fu16), 0x525e => Some(0x5170u16), 0x5254 => Some(0x5171u16), 0x526a => Some(0x5172u16), 0x5274 => Some(0x5173u16), 0x5269 => Some(0x5174u16), 0x5273 => Some(0x5175u16), 0x527f => Some(0x5176u16), 0x527d => Some(0x5177u16), 0x528d => Some(0x5178u16), 0x5294 => Some(0x5179u16), 0x5292 => Some(0x517au16), 0x5271 => Some(0x517bu16), 0x5288 => Some(0x517cu16), 0x5291 => Some(0x517du16), 0x8fa8 => Some(0x517eu16), 0x8fa7 => Some(0x5221u16), 0x52ac => Some(0x5222u16), 0x52ad => Some(0x5223u16), 0x52bc => Some(0x5224u16), 0x52b5 => Some(0x5225u16), 0x52c1 => Some(0x5226u16), 0x52cd => Some(0x5227u16), 0x52d7 => Some(0x5228u16), 0x52de => Some(0x5229u16), 0x52e3 => Some(0x522au16), 0x52e6 => Some(0x522bu16), 0x98ed => Some(0x522cu16), 0x52e0 => Some(0x522du16), 0x52f3 => Some(0x522eu16), 0x52f5 => Some(0x522fu16), 0x52f8 => Some(0x5230u16), 0x52f9 => Some(0x5231u16), 0x5306 => Some(0x5232u16), 0x5308 => Some(0x5233u16), 0x7538 => Some(0x5234u16), 0x530d => Some(0x5235u16), 0x5310 => Some(0x5236u16), 0x530f => Some(0x5237u16), 0x5315 => Some(0x5238u16), 0x531a => Some(0x5239u16), 0x5323 => Some(0x523au16), 0x532f => Some(0x523bu16), 0x5331 => Some(0x523cu16), 0x5333 => Some(0x523du16), 0x5338 => Some(0x523eu16), 0x5340 => Some(0x523fu16), 0x5346 => Some(0x5240u16), 0x5345 => Some(0x5241u16), 0x4e17 => Some(0x5242u16), 0x5349 => Some(0x5243u16), 0x534d => Some(0x5244u16), 0x51d6 => Some(0x5245u16), 0x535e => Some(0x5246u16), 0x5369 => Some(0x5247u16), 0x536e => Some(0x5248u16), 0x5918 => Some(0x5249u16), 0x537b => Some(0x524au16), 0x5377 => Some(0x524bu16), 0x5382 => Some(0x524cu16), 0x5396 => Some(0x524du16), 0x53a0 => Some(0x524eu16), 0x53a6 => Some(0x524fu16), 0x53a5 => Some(0x5250u16), 0x53ae => Some(0x5251u16), 0x53b0 => Some(0x5252u16), 0x53b6 => Some(0x5253u16), 0x53c3 => Some(0x5254u16), 0x7c12 => Some(0x5255u16), 0x96d9 => Some(0x5256u16), 0x53df => Some(0x5257u16), 0x66fc => Some(0x5258u16), 0x71ee => Some(0x5259u16), 0x53ee => Some(0x525au16), 0x53e8 => Some(0x525bu16), 0x53ed => Some(0x525cu16), 0x53fa => Some(0x525du16), 0x5401 => Some(0x525eu16), 0x543d => Some(0x525fu16), 0x5440 => Some(0x5260u16), 0x542c => Some(0x5261u16), 0x542d => Some(0x5262u16), 0x543c => Some(0x5263u16), 0x542e => Some(0x5264u16), 0x5436 => Some(0x5265u16), 0x5429 => Some(0x5266u16), 0x541d => Some(0x5267u16), 0x544e => Some(0x5268u16), 0x548f => Some(0x5269u16), 0x5475 => Some(0x526au16), 0x548e => Some(0x526bu16), 0x545f => Some(0x526cu16), 0x5471 => Some(0x526du16), 0x5477 => Some(0x526eu16), 0x5470 => Some(0x526fu16), 0x5492 => Some(0x5270u16), 0x547b => Some(0x5271u16), 0x5480 => Some(0x5272u16), 0x5476 => Some(0x5273u16), 0x5484 => Some(0x5274u16), 0x5490 => Some(0x5275u16), 0x5486 => Some(0x5276u16), 0x54c7 => Some(0x5277u16), 0x54a2 => Some(0x5278u16), 0x54b8 => Some(0x5279u16), 0x54a5 => Some(0x527au16), 0x54ac => Some(0x527bu16), 0x54c4 => Some(0x527cu16), 0x54c8 => Some(0x527du16), 0x54a8 => Some(0x527eu16), 0x54ab => Some(0x5321u16), 0x54c2 => Some(0x5322u16), 0x54a4 => Some(0x5323u16), 0x54be => Some(0x5324u16), 0x54bc => Some(0x5325u16), 0x54d8 => Some(0x5326u16), 0x54e5 => Some(0x5327u16), 0x54e6 => Some(0x5328u16), 0x550f => Some(0x5329u16), 0x5514 => Some(0x532au16), 0x54fd => Some(0x532bu16), 0x54ee => Some(0x532cu16), 0x54ed => Some(0x532du16), 0x54fa => Some(0x532eu16), 0x54e2 => Some(0x532fu16), 0x5539 => Some(0x5330u16), 0x5540 => Some(0x5331u16), 0x5563 => Some(0x5332u16), 0x554c => Some(0x5333u16), 0x552e => Some(0x5334u16), 0x555c => Some(0x5335u16), 0x5545 => Some(0x5336u16), 0x5556 => Some(0x5337u16), 0x5557 => Some(0x5338u16), 0x5538 => Some(0x5339u16), 0x5533 => Some(0x533au16), 0x555d => Some(0x533bu16), 0x5599 => Some(0x533cu16), 0x5580 => Some(0x533du16), 0x54af => Some(0x533eu16), 0x558a => Some(0x533fu16), 0x559f => Some(0x5340u16), 0x557b => Some(0x5341u16), 0x557e => Some(0x5342u16), 0x5598 => Some(0x5343u16), 0x559e => Some(0x5344u16), 0x55ae => Some(0x5345u16), 0x557c => Some(0x5346u16), 0x5583 => Some(0x5347u16), 0x55a9 => Some(0x5348u16), 0x5587 => Some(0x5349u16), 0x55a8 => Some(0x534au16), 0x55da => Some(0x534bu16), 0x55c5 => Some(0x534cu16), 0x55df => Some(0x534du16), 0x55c4 => Some(0x534eu16), 0x55dc => Some(0x534fu16), 0x55e4 => Some(0x5350u16), 0x55d4 => Some(0x5351u16), 0x5614 => Some(0x5352u16), 0x55f7 => Some(0x5353u16), 0x5616 => Some(0x5354u16), 0x55fe => Some(0x5355u16), 0x55fd => Some(0x5356u16), 0x561b => Some(0x5357u16), 0x55f9 => Some(0x5358u16), 0x564e => Some(0x5359u16), 0x5650 => Some(0x535au16), 0x71df => Some(0x535bu16), 0x5634 => Some(0x535cu16), 0x5636 => Some(0x535du16), 0x5632 => Some(0x535eu16), 0x5638 => Some(0x535fu16), 0x566b => Some(0x5360u16), 0x5664 => Some(0x5361u16), 0x562f => Some(0x5362u16), 0x566c => Some(0x5363u16), 0x566a => Some(0x5364u16), 0x5686 => Some(0x5365u16), 0x5680 => Some(0x5366u16), 0x568a => Some(0x5367u16), 0x56a0 => Some(0x5368u16), 0x5694 => Some(0x5369u16), 0x568f => Some(0x536au16), 0x56a5 => Some(0x536bu16), 0x56ae => Some(0x536cu16), 0x56b6 => Some(0x536du16), 0x56b4 => Some(0x536eu16), 0x56c2 => Some(0x536fu16), 0x56bc => Some(0x5370u16), 0x56c1 => Some(0x5371u16), 0x56c3 => Some(0x5372u16), 0x56c0 => Some(0x5373u16), 0x56c8 => Some(0x5374u16), 0x56ce => Some(0x5375u16), 0x56d1 => Some(0x5376u16), 0x56d3 => Some(0x5377u16), 0x56d7 => Some(0x5378u16), 0x56ee => Some(0x5379u16), 0x56f9 => Some(0x537au16), 0x5700 => Some(0x537bu16), 0x56ff => Some(0x537cu16), 0x5704 => Some(0x537du16), 0x5709 => Some(0x537eu16), 0x5708 => Some(0x5421u16), 0x570b => Some(0x5422u16), 0x570d => Some(0x5423u16), 0x5713 => Some(0x5424u16), 0x5718 => Some(0x5425u16), 0x5716 => Some(0x5426u16), 0x55c7 => Some(0x5427u16), 0x571c => Some(0x5428u16), 0x5726 => Some(0x5429u16), 0x5737 => Some(0x542au16), 0x5738 => Some(0x542bu16), 0x574e => Some(0x542cu16), 0x573b => Some(0x542du16), 0x5740 => Some(0x542eu16), 0x574f => Some(0x542fu16), 0x5769 => Some(0x5430u16), 0x57c0 => Some(0x5431u16), 0x5788 => Some(0x5432u16), 0x5761 => Some(0x5433u16), 0x577f => Some(0x5434u16), 0x5789 => Some(0x5435u16), 0x5793 => Some(0x5436u16), 0x57a0 => Some(0x5437u16), 0x57b3 => Some(0x5438u16), 0x57a4 => Some(0x5439u16), 0x57aa => Some(0x543au16), 0x57b0 => Some(0x543bu16), 0x57c3 => Some(0x543cu16), 0x57c6 => Some(0x543du16), 0x57d4 => Some(0x543eu16), 0x57d2 => Some(0x543fu16), 0x57d3 => Some(0x5440u16), 0x580a => Some(0x5441u16), 0x57d6 => Some(0x5442u16), 0x57e3 => Some(0x5443u16), 0x580b => Some(0x5444u16), 0x5819 => Some(0x5445u16), 0x581d => Some(0x5446u16), 0x5872 => Some(0x5447u16), 0x5821 => Some(0x5448u16), 0x5862 => Some(0x5449u16), 0x584b => Some(0x544au16), 0x5870 => Some(0x544bu16), 0x6bc0 => Some(0x544cu16), 0x5852 => Some(0x544du16), 0x583d => Some(0x544eu16), 0x5879 => Some(0x544fu16), 0x5885 => Some(0x5450u16), 0x58b9 => Some(0x5451u16), 0x589f => Some(0x5452u16), 0x58ab => Some(0x5453u16), 0x58ba => Some(0x5454u16), 0x58de => Some(0x5455u16), 0x58bb => Some(0x5456u16), 0x58b8 => Some(0x5457u16), 0x58ae => Some(0x5458u16), 0x58c5 => Some(0x5459u16), 0x58d3 => Some(0x545au16), 0x58d1 => Some(0x545bu16), 0x58d7 => Some(0x545cu16), 0x58d9 => Some(0x545du16), 0x58d8 => Some(0x545eu16), 0x58e5 => Some(0x545fu16), 0x58dc => Some(0x5460u16), 0x58e4 => Some(0x5461u16), 0x58df => Some(0x5462u16), 0x58ef => Some(0x5463u16), 0x58fa => Some(0x5464u16), 0x58f9 => Some(0x5465u16), 0x58fb => Some(0x5466u16), 0x58fc => Some(0x5467u16), 0x58fd => Some(0x5468u16), 0x5902 => Some(0x5469u16), 0x590a => Some(0x546au16), 0x5910 => Some(0x546bu16), 0x591b => Some(0x546cu16), 0x68a6 => Some(0x546du16), 0x5925 => Some(0x546eu16), 0x592c => Some(0x546fu16), 0x592d => Some(0x5470u16), 0x5932 => Some(0x5471u16), 0x5938 => Some(0x5472u16), 0x593e => Some(0x5473u16), 0x7ad2 => Some(0x5474u16), 0x5955 => Some(0x5475u16), 0x5950 => Some(0x5476u16), 0x594e => Some(0x5477u16), 0x595a => Some(0x5478u16), 0x5958 => Some(0x5479u16), 0x5962 => Some(0x547au16), 0x5960 => Some(0x547bu16), 0x5967 => Some(0x547cu16), 0x596c => Some(0x547du16), 0x5969 => Some(0x547eu16), 0x5978 => Some(0x5521u16), 0x5981 => Some(0x5522u16), 0x599d => Some(0x5523u16), 0x4f5e => Some(0x5524u16), 0x4fab => Some(0x5525u16), 0x59a3 => Some(0x5526u16), 0x59b2 => Some(0x5527u16), 0x59c6 => Some(0x5528u16), 0x59e8 => Some(0x5529u16), 0x59dc => Some(0x552au16), 0x598d => Some(0x552bu16), 0x59d9 => Some(0x552cu16), 0x59da => Some(0x552du16), 0x5a25 => Some(0x552eu16), 0x5a1f => Some(0x552fu16), 0x5a11 => Some(0x5530u16), 0x5a1c => Some(0x5531u16), 0x5a09 => Some(0x5532u16), 0x5a1a => Some(0x5533u16), 0x5a40 => Some(0x5534u16), 0x5a6c => Some(0x5535u16), 0x5a49 => Some(0x5536u16), 0x5a35 => Some(0x5537u16), 0x5a36 => Some(0x5538u16), 0x5a62 => Some(0x5539u16), 0x5a6a => Some(0x553au16), 0x5a9a => Some(0x553bu16), 0x5abc => Some(0x553cu16), 0x5abe => Some(0x553du16), 0x5acb => Some(0x553eu16), 0x5ac2 => Some(0x553fu16), 0x5abd => Some(0x5540u16), 0x5ae3 => Some(0x5541u16), 0x5ad7 => Some(0x5542u16), 0x5ae6 => Some(0x5543u16), 0x5ae9 => Some(0x5544u16), 0x5ad6 => Some(0x5545u16), 0x5afa => Some(0x5546u16), 0x5afb => Some(0x5547u16), 0x5b0c => Some(0x5548u16), 0x5b0b => Some(0x5549u16), 0x5b16 => Some(0x554au16), 0x5b32 => Some(0x554bu16), 0x5ad0 => Some(0x554cu16), 0x5b2a => Some(0x554du16), 0x5b36 => Some(0x554eu16), 0x5b3e => Some(0x554fu16), 0x5b43 => Some(0x5550u16), 0x5b45 => Some(0x5551u16), 0x5b40 => Some(0x5552u16), 0x5b51 => Some(0x5553u16), 0x5b55 => Some(0x5554u16), 0x5b5a => Some(0x5555u16), 0x5b5b => Some(0x5556u16), 0x5b65 => Some(0x5557u16), 0x5b69 => Some(0x5558u16), 0x5b70 => Some(0x5559u16), 0x5b73 => Some(0x555au16), 0x5b75 => Some(0x555bu16), 0x5b78 => Some(0x555cu16), 0x6588 => Some(0x555du16), 0x5b7a => Some(0x555eu16), 0x5b80 => Some(0x555fu16), 0x5b83 => Some(0x5560u16), 0x5ba6 => Some(0x5561u16), 0x5bb8 => Some(0x5562u16), 0x5bc3 => Some(0x5563u16), 0x5bc7 => Some(0x5564u16), 0x5bc9 => Some(0x5565u16), 0x5bd4 => Some(0x5566u16), 0x5bd0 => Some(0x5567u16), 0x5be4 => Some(0x5568u16), 0x5be6 => Some(0x5569u16), 0x5be2 => Some(0x556au16), 0x5bde => Some(0x556bu16), 0x5be5 => Some(0x556cu16), 0x5beb => Some(0x556du16), 0x5bf0 => Some(0x556eu16), 0x5bf6 => Some(0x556fu16), 0x5bf3 => Some(0x5570u16), 0x5c05 => Some(0x5571u16), 0x5c07 => Some(0x5572u16), 0x5c08 => Some(0x5573u16), 0x5c0d => Some(0x5574u16), 0x5c13 => Some(0x5575u16), 0x5c20 => Some(0x5576u16), 0x5c22 => Some(0x5577u16), 0x5c28 => Some(0x5578u16), 0x5c38 => Some(0x5579u16), 0x5c39 => Some(0x557au16), 0x5c41 => Some(0x557bu16), 0x5c46 => Some(0x557cu16), 0x5c4e => Some(0x557du16), 0x5c53 => Some(0x557eu16), 0x5c50 => Some(0x5621u16), 0x5c4f => Some(0x5622u16), 0x5b71 => Some(0x5623u16), 0x5c6c => Some(0x5624u16), 0x5c6e => Some(0x5625u16), 0x4e62 => Some(0x5626u16), 0x5c76 => Some(0x5627u16), 0x5c79 => Some(0x5628u16), 0x5c8c => Some(0x5629u16), 0x5c91 => Some(0x562au16), 0x5c94 => Some(0x562bu16), 0x599b => Some(0x562cu16), 0x5cab => Some(0x562du16), 0x5cbb => Some(0x562eu16), 0x5cb6 => Some(0x562fu16), 0x5cbc => Some(0x5630u16), 0x5cb7 => Some(0x5631u16), 0x5cc5 => Some(0x5632u16), 0x5cbe => Some(0x5633u16), 0x5cc7 => Some(0x5634u16), 0x5cd9 => Some(0x5635u16), 0x5ce9 => Some(0x5636u16), 0x5cfd => Some(0x5637u16), 0x5cfa => Some(0x5638u16), 0x5ced => Some(0x5639u16), 0x5d8c => Some(0x563au16), 0x5cea => Some(0x563bu16), 0x5d0b => Some(0x563cu16), 0x5d15 => Some(0x563du16), 0x5d17 => Some(0x563eu16), 0x5d5c => Some(0x563fu16), 0x5d1f => Some(0x5640u16), 0x5d1b => Some(0x5641u16), 0x5d11 => Some(0x5642u16), 0x5d14 => Some(0x5643u16), 0x5d22 => Some(0x5644u16), 0x5d1a => Some(0x5645u16), 0x5d19 => Some(0x5646u16), 0x5d18 => Some(0x5647u16), 0x5d4c => Some(0x5648u16), 0x5d52 => Some(0x5649u16), 0x5d4e => Some(0x564au16), 0x5d4b => Some(0x564bu16), 0x5d6c => Some(0x564cu16), 0x5d73 => Some(0x564du16), 0x5d76 => Some(0x564eu16), 0x5d87 => Some(0x564fu16), 0x5d84 => Some(0x5650u16), 0x5d82 => Some(0x5651u16), 0x5da2 => Some(0x5652u16), 0x5d9d => Some(0x5653u16), 0x5dac => Some(0x5654u16), 0x5dae => Some(0x5655u16), 0x5dbd => Some(0x5656u16), 0x5d90 => Some(0x5657u16), 0x5db7 => Some(0x5658u16), 0x5dbc => Some(0x5659u16), 0x5dc9 => Some(0x565au16), 0x5dcd => Some(0x565bu16), 0x5dd3 => Some(0x565cu16), 0x5dd2 => Some(0x565du16), 0x5dd6 => Some(0x565eu16), 0x5ddb => Some(0x565fu16), 0x5deb => Some(0x5660u16), 0x5df2 => Some(0x5661u16), 0x5df5 => Some(0x5662u16), 0x5e0b => Some(0x5663u16), 0x5e1a => Some(0x5664u16), 0x5e19 => Some(0x5665u16), 0x5e11 => Some(0x5666u16), 0x5e1b => Some(0x5667u16), 0x5e36 => Some(0x5668u16), 0x5e37 => Some(0x5669u16), 0x5e44 => Some(0x566au16), 0x5e43 => Some(0x566bu16), 0x5e40 => Some(0x566cu16), 0x5e4e => Some(0x566du16), 0x5e57 => Some(0x566eu16), 0x5e54 => Some(0x566fu16), 0x5e5f => Some(0x5670u16), 0x5e62 => Some(0x5671u16), 0x5e64 => Some(0x5672u16), 0x5e47 => Some(0x5673u16), 0x5e75 => Some(0x5674u16), 0x5e76 => Some(0x5675u16), 0x5e7a => Some(0x5676u16), 0x9ebc => Some(0x5677u16), 0x5e7f => Some(0x5678u16), 0x5ea0 => Some(0x5679u16), 0x5ec1 => Some(0x567au16), 0x5ec2 => Some(0x567bu16), 0x5ec8 => Some(0x567cu16), 0x5ed0 => Some(0x567du16), 0x5ecf => Some(0x567eu16), 0x5ed6 => Some(0x5721u16), 0x5ee3 => Some(0x5722u16), 0x5edd => Some(0x5723u16), 0x5eda => Some(0x5724u16), 0x5edb => Some(0x5725u16), 0x5ee2 => Some(0x5726u16), 0x5ee1 => Some(0x5727u16), 0x5ee8 => Some(0x5728u16), 0x5ee9 => Some(0x5729u16), 0x5eec => Some(0x572au16), 0x5ef1 => Some(0x572bu16), 0x5ef3 => Some(0x572cu16), 0x5ef0 => Some(0x572du16), 0x5ef4 => Some(0x572eu16), 0x5ef8 => Some(0x572fu16), 0x5efe => Some(0x5730u16), 0x5f03 => Some(0x5731u16), 0x5f09 => Some(0x5732u16), 0x5f5d => Some(0x5733u16), 0x5f5c => Some(0x5734u16), 0x5f0b => Some(0x5735u16), 0x5f11 => Some(0x5736u16), 0x5f16 => Some(0x5737u16), 0x5f29 => Some(0x5738u16), 0x5f2d => Some(0x5739u16), 0x5f38 => Some(0x573au16), 0x5f41 => Some(0x573bu16), 0x5f48 => Some(0x573cu16), 0x5f4c => Some(0x573du16), 0x5f4e => Some(0x573eu16), 0x5f2f => Some(0x573fu16), 0x5f51 => Some(0x5740u16), 0x5f56 => Some(0x5741u16), 0x5f57 => Some(0x5742u16), 0x5f59 => Some(0x5743u16), 0x5f61 => Some(0x5744u16), 0x5f6d => Some(0x5745u16), 0x5f73 => Some(0x5746u16), 0x5f77 => Some(0x5747u16), 0x5f83 => Some(0x5748u16), 0x5f82 => Some(0x5749u16), 0x5f7f => Some(0x574au16), 0x5f8a => Some(0x574bu16), 0x5f88 => Some(0x574cu16), 0x5f91 => Some(0x574du16), 0x5f87 => Some(0x574eu16), 0x5f9e => Some(0x574fu16), 0x5f99 => Some(0x5750u16), 0x5f98 => Some(0x5751u16), 0x5fa0 => Some(0x5752u16), 0x5fa8 => Some(0x5753u16), 0x5fad => Some(0x5754u16), 0x5fbc => Some(0x5755u16), 0x5fd6 => Some(0x5756u16), 0x5ffb => Some(0x5757u16), 0x5fe4 => Some(0x5758u16), 0x5ff8 => Some(0x5759u16), 0x5ff1 => Some(0x575au16), 0x5fdd => Some(0x575bu16), 0x60b3 => Some(0x575cu16), 0x5fff => Some(0x575du16), 0x6021 => Some(0x575eu16), 0x6060 => Some(0x575fu16), 0x6019 => Some(0x5760u16), 0x6010 => Some(0x5761u16), 0x6029 => Some(0x5762u16), 0x600e => Some(0x5763u16), 0x6031 => Some(0x5764u16), 0x601b => Some(0x5765u16), 0x6015 => Some(0x5766u16), 0x602b => Some(0x5767u16), 0x6026 => Some(0x5768u16), 0x600f => Some(0x5769u16), 0x603a => Some(0x576au16), 0x605a => Some(0x576bu16), 0x6041 => Some(0x576cu16), 0x606a => Some(0x576du16), 0x6077 => Some(0x576eu16), 0x605f => Some(0x576fu16), 0x604a => Some(0x5770u16), 0x6046 => Some(0x5771u16), 0x604d => Some(0x5772u16), 0x6063 => Some(0x5773u16), 0x6043 => Some(0x5774u16), 0x6064 => Some(0x5775u16), 0x6042 => Some(0x5776u16), 0x606c => Some(0x5777u16), 0x606b => Some(0x5778u16), 0x6059 => Some(0x5779u16), 0x6081 => Some(0x577au16), 0x608d => Some(0x577bu16), 0x60e7 => Some(0x577cu16), 0x6083 => Some(0x577du16), 0x609a => Some(0x577eu16), 0x6084 => Some(0x5821u16), 0x609b => Some(0x5822u16), 0x6096 => Some(0x5823u16), 0x6097 => Some(0x5824u16), 0x6092 => Some(0x5825u16), 0x60a7 => Some(0x5826u16), 0x608b => Some(0x5827u16), 0x60e1 => Some(0x5828u16), 0x60b8 => Some(0x5829u16), 0x60e0 => Some(0x582au16), 0x60d3 => Some(0x582bu16), 0x60b4 => Some(0x582cu16), 0x5ff0 => Some(0x582du16), 0x60bd => Some(0x582eu16), 0x60c6 => Some(0x582fu16), 0x60b5 => Some(0x5830u16), 0x60d8 => Some(0x5831u16), 0x614d => Some(0x5832u16), 0x6115 => Some(0x5833u16), 0x6106 => Some(0x5834u16), 0x60f6 => Some(0x5835u16), 0x60f7 => Some(0x5836u16), 0x6100 => Some(0x5837u16), 0x60f4 => Some(0x5838u16), 0x60fa => Some(0x5839u16), 0x6103 => Some(0x583au16), 0x6121 => Some(0x583bu16), 0x60fb => Some(0x583cu16), 0x60f1 => Some(0x583du16), 0x610d => Some(0x583eu16), 0x610e => Some(0x583fu16), 0x6147 => Some(0x5840u16), 0x613e => Some(0x5841u16), 0x6128 => Some(0x5842u16), 0x6127 => Some(0x5843u16), 0x614a => Some(0x5844u16), 0x613f => Some(0x5845u16), 0x613c => Some(0x5846u16), 0x612c => Some(0x5847u16), 0x6134 => Some(0x5848u16), 0x613d => Some(0x5849u16), 0x6142 => Some(0x584au16), 0x6144 => Some(0x584bu16), 0x6173 => Some(0x584cu16), 0x6177 => Some(0x584du16), 0x6158 => Some(0x584eu16), 0x6159 => Some(0x584fu16), 0x615a => Some(0x5850u16), 0x616b => Some(0x5851u16), 0x6174 => Some(0x5852u16), 0x616f => Some(0x5853u16), 0x6165 => Some(0x5854u16), 0x6171 => Some(0x5855u16), 0x615f => Some(0x5856u16), 0x615d => Some(0x5857u16), 0x6153 => Some(0x5858u16), 0x6175 => Some(0x5859u16), 0x6199 => Some(0x585au16), 0x6196 => Some(0x585bu16), 0x6187 => Some(0x585cu16), 0x61ac => Some(0x585du16), 0x6194 => Some(0x585eu16), 0x619a => Some(0x585fu16), 0x618a => Some(0x5860u16), 0x6191 => Some(0x5861u16), 0x61ab => Some(0x5862u16), 0x61ae => Some(0x5863u16), 0x61cc => Some(0x5864u16), 0x61ca => Some(0x5865u16), 0x61c9 => Some(0x5866u16), 0x61f7 => Some(0x5867u16), 0x61c8 => Some(0x5868u16), 0x61c3 => Some(0x5869u16), 0x61c6 => Some(0x586au16), 0x61ba => Some(0x586bu16), 0x61cb => Some(0x586cu16), 0x7f79 => Some(0x586du16), 0x61cd => Some(0x586eu16), 0x61e6 => Some(0x586fu16), 0x61e3 => Some(0x5870u16), 0x61f6 => Some(0x5871u16), 0x61fa => Some(0x5872u16), 0x61f4 => Some(0x5873u16), 0x61ff => Some(0x5874u16), 0x61fd => Some(0x5875u16), 0x61fc => Some(0x5876u16), 0x61fe => Some(0x5877u16), 0x6200 => Some(0x5878u16), 0x6208 => Some(0x5879u16), 0x6209 => Some(0x587au16), 0x620d => Some(0x587bu16), 0x620c => Some(0x587cu16), 0x6214 => Some(0x587du16), 0x621b => Some(0x587eu16), 0x621e => Some(0x5921u16), 0x6221 => Some(0x5922u16), 0x622a => Some(0x5923u16), 0x622e => Some(0x5924u16), 0x6230 => Some(0x5925u16), 0x6232 => Some(0x5926u16), 0x6233 => Some(0x5927u16), 0x6241 => Some(0x5928u16), 0x624e => Some(0x5929u16), 0x625e => Some(0x592au16), 0x6263 => Some(0x592bu16), 0x625b => Some(0x592cu16), 0x6260 => Some(0x592du16), 0x6268 => Some(0x592eu16), 0x627c => Some(0x592fu16), 0x6282 => Some(0x5930u16), 0x6289 => Some(0x5931u16), 0x627e => Some(0x5932u16), 0x6292 => Some(0x5933u16), 0x6293 => Some(0x5934u16), 0x6296 => Some(0x5935u16), 0x62d4 => Some(0x5936u16), 0x6283 => Some(0x5937u16), 0x6294 => Some(0x5938u16), 0x62d7 => Some(0x5939u16), 0x62d1 => Some(0x593au16), 0x62bb => Some(0x593bu16), 0x62cf => Some(0x593cu16), 0x62ff => Some(0x593du16), 0x62c6 => Some(0x593eu16), 0x64d4 => Some(0x593fu16), 0x62c8 => Some(0x5940u16), 0x62dc => Some(0x5941u16), 0x62cc => Some(0x5942u16), 0x62ca => Some(0x5943u16), 0x62c2 => Some(0x5944u16), 0x62c7 => Some(0x5945u16), 0x629b => Some(0x5946u16), 0x62c9 => Some(0x5947u16), 0x630c => Some(0x5948u16), 0x62ee => Some(0x5949u16), 0x62f1 => Some(0x594au16), 0x6327 => Some(0x594bu16), 0x6302 => Some(0x594cu16), 0x6308 => Some(0x594du16), 0x62ef => Some(0x594eu16), 0x62f5 => Some(0x594fu16), 0x6350 => Some(0x5950u16), 0x633e => Some(0x5951u16), 0x634d => Some(0x5952u16), 0x641c => Some(0x5953u16), 0x634f => Some(0x5954u16), 0x6396 => Some(0x5955u16), 0x638e => Some(0x5956u16), 0x6380 => Some(0x5957u16), 0x63ab => Some(0x5958u16), 0x6376 => Some(0x5959u16), 0x63a3 => Some(0x595au16), 0x638f => Some(0x595bu16), 0x6389 => Some(0x595cu16), 0x639f => Some(0x595du16), 0x63b5 => Some(0x595eu16), 0x636b => Some(0x595fu16), 0x6369 => Some(0x5960u16), 0x63be => Some(0x5961u16), 0x63e9 => Some(0x5962u16), 0x63c0 => Some(0x5963u16), 0x63c6 => Some(0x5964u16), 0x63e3 => Some(0x5965u16), 0x63c9 => Some(0x5966u16), 0x63d2 => Some(0x5967u16), 0x63f6 => Some(0x5968u16), 0x63c4 => Some(0x5969u16), 0x6416 => Some(0x596au16), 0x6434 => Some(0x596bu16), 0x6406 => Some(0x596cu16), 0x6413 => Some(0x596du16), 0x6426 => Some(0x596eu16), 0x6436 => Some(0x596fu16), 0x651d => Some(0x5970u16), 0x6417 => Some(0x5971u16), 0x6428 => Some(0x5972u16), 0x640f => Some(0x5973u16), 0x6467 => Some(0x5974u16), 0x646f => Some(0x5975u16), 0x6476 => Some(0x5976u16), 0x644e => Some(0x5977u16), 0x652a => Some(0x5978u16), 0x6495 => Some(0x5979u16), 0x6493 => Some(0x597au16), 0x64a5 => Some(0x597bu16), 0x64a9 => Some(0x597cu16), 0x6488 => Some(0x597du16), 0x64bc => Some(0x597eu16), 0x64da => Some(0x5a21u16), 0x64d2 => Some(0x5a22u16), 0x64c5 => Some(0x5a23u16), 0x64c7 => Some(0x5a24u16), 0x64bb => Some(0x5a25u16), 0x64d8 => Some(0x5a26u16), 0x64c2 => Some(0x5a27u16), 0x64f1 => Some(0x5a28u16), 0x64e7 => Some(0x5a29u16), 0x8209 => Some(0x5a2au16), 0x64e0 => Some(0x5a2bu16), 0x64e1 => Some(0x5a2cu16), 0x62ac => Some(0x5a2du16), 0x64e3 => Some(0x5a2eu16), 0x64ef => Some(0x5a2fu16), 0x652c => Some(0x5a30u16), 0x64f6 => Some(0x5a31u16), 0x64f4 => Some(0x5a32u16), 0x64f2 => Some(0x5a33u16), 0x64fa => Some(0x5a34u16), 0x6500 => Some(0x5a35u16), 0x64fd => Some(0x5a36u16), 0x6518 => Some(0x5a37u16), 0x651c => Some(0x5a38u16), 0x6505 => Some(0x5a39u16), 0x6524 => Some(0x5a3au16), 0x6523 => Some(0x5a3bu16), 0x652b => Some(0x5a3cu16), 0x6534 => Some(0x5a3du16), 0x6535 => Some(0x5a3eu16), 0x6537 => Some(0x5a3fu16), 0x6536 => Some(0x5a40u16), 0x6538 => Some(0x5a41u16), 0x754b => Some(0x5a42u16), 0x6548 => Some(0x5a43u16), 0x6556 => Some(0x5a44u16), 0x6555 => Some(0x5a45u16), 0x654d => Some(0x5a46u16), 0x6558 => Some(0x5a47u16), 0x655e => Some(0x5a48u16), 0x655d => Some(0x5a49u16), 0x6572 => Some(0x5a4au16), 0x6578 => Some(0x5a4bu16), 0x6582 => Some(0x5a4cu16), 0x6583 => Some(0x5a4du16), 0x8b8a => Some(0x5a4eu16), 0x659b => Some(0x5a4fu16), 0x659f => Some(0x5a50u16), 0x65ab => Some(0x5a51u16), 0x65b7 => Some(0x5a52u16), 0x65c3 => Some(0x5a53u16), 0x65c6 => Some(0x5a54u16), 0x65c1 => Some(0x5a55u16), 0x65c4 => Some(0x5a56u16), 0x65cc => Some(0x5a57u16), 0x65d2 => Some(0x5a58u16), 0x65db => Some(0x5a59u16), 0x65d9 => Some(0x5a5au16), 0x65e0 => Some(0x5a5bu16), 0x65e1 => Some(0x5a5cu16), 0x65f1 => Some(0x5a5du16), 0x6772 => Some(0x5a5eu16), 0x660a => Some(0x5a5fu16), 0x6603 => Some(0x5a60u16), 0x65fb => Some(0x5a61u16), 0x6773 => Some(0x5a62u16), 0x6635 => Some(0x5a63u16), 0x6636 => Some(0x5a64u16), 0x6634 => Some(0x5a65u16), 0x661c => Some(0x5a66u16), 0x664f => Some(0x5a67u16), 0x6644 => Some(0x5a68u16), 0x6649 => Some(0x5a69u16), 0x6641 => Some(0x5a6au16), 0x665e => Some(0x5a6bu16), 0x665d => Some(0x5a6cu16), 0x6664 => Some(0x5a6du16), 0x6667 => Some(0x5a6eu16), 0x6668 => Some(0x5a6fu16), 0x665f => Some(0x5a70u16), 0x6662 => Some(0x5a71u16), 0x6670 => Some(0x5a72u16), 0x6683 => Some(0x5a73u16), 0x6688 => Some(0x5a74u16), 0x668e => Some(0x5a75u16), 0x6689 => Some(0x5a76u16), 0x6684 => Some(0x5a77u16), 0x6698 => Some(0x5a78u16), 0x669d => Some(0x5a79u16), 0x66c1 => Some(0x5a7au16), 0x66b9 => Some(0x5a7bu16), 0x66c9 => Some(0x5a7cu16), 0x66be => Some(0x5a7du16), 0x66bc => Some(0x5a7eu16), 0x66c4 => Some(0x5b21u16), 0x66b8 => Some(0x5b22u16), 0x66d6 => Some(0x5b23u16), 0x66da => Some(0x5b24u16), 0x66e0 => Some(0x5b25u16), 0x663f => Some(0x5b26u16), 0x66e6 => Some(0x5b27u16), 0x66e9 => Some(0x5b28u16), 0x66f0 => Some(0x5b29u16), 0x66f5 => Some(0x5b2au16), 0x66f7 => Some(0x5b2bu16), 0x670f => Some(0x5b2cu16), 0x6716 => Some(0x5b2du16), 0x671e => Some(0x5b2eu16), 0x6726 => Some(0x5b2fu16), 0x6727 => Some(0x5b30u16), 0x9738 => Some(0x5b31u16), 0x672e => Some(0x5b32u16), 0x673f => Some(0x5b33u16), 0x6736 => Some(0x5b34u16), 0x6741 => Some(0x5b35u16), 0x6738 => Some(0x5b36u16), 0x6737 => Some(0x5b37u16), 0x6746 => Some(0x5b38u16), 0x675e => Some(0x5b39u16), 0x6760 => Some(0x5b3au16), 0x6759 => Some(0x5b3bu16), 0x6763 => Some(0x5b3cu16), 0x6764 => Some(0x5b3du16), 0x6789 => Some(0x5b3eu16), 0x6770 => Some(0x5b3fu16), 0x67a9 => Some(0x5b40u16), 0x677c => Some(0x5b41u16), 0x676a => Some(0x5b42u16), 0x678c => Some(0x5b43u16), 0x678b => Some(0x5b44u16), 0x67a6 => Some(0x5b45u16), 0x67a1 => Some(0x5b46u16), 0x6785 => Some(0x5b47u16), 0x67b7 => Some(0x5b48u16), 0x67ef => Some(0x5b49u16), 0x67b4 => Some(0x5b4au16), 0x67ec => Some(0x5b4bu16), 0x67b3 => Some(0x5b4cu16), 0x67e9 => Some(0x5b4du16), 0x67b8 => Some(0x5b4eu16), 0x67e4 => Some(0x5b4fu16), 0x67de => Some(0x5b50u16), 0x67dd => Some(0x5b51u16), 0x67e2 => Some(0x5b52u16), 0x67ee => Some(0x5b53u16), 0x67b9 => Some(0x5b54u16), 0x67ce => Some(0x5b55u16), 0x67c6 => Some(0x5b56u16), 0x67e7 => Some(0x5b57u16), 0x6a9c => Some(0x5b58u16), 0x681e => Some(0x5b59u16), 0x6846 => Some(0x5b5au16), 0x6829 => Some(0x5b5bu16), 0x6840 => Some(0x5b5cu16), 0x684d => Some(0x5b5du16), 0x6832 => Some(0x5b5eu16), 0x684e => Some(0x5b5fu16), 0x68b3 => Some(0x5b60u16), 0x682b => Some(0x5b61u16), 0x6859 => Some(0x5b62u16), 0x6863 => Some(0x5b63u16), 0x6877 => Some(0x5b64u16), 0x687f => Some(0x5b65u16), 0x689f => Some(0x5b66u16), 0x688f => Some(0x5b67u16), 0x68ad => Some(0x5b68u16), 0x6894 => Some(0x5b69u16), 0x689d => Some(0x5b6au16), 0x689b => Some(0x5b6bu16), 0x6883 => Some(0x5b6cu16), 0x6aae => Some(0x5b6du16), 0x68b9 => Some(0x5b6eu16), 0x6874 => Some(0x5b6fu16), 0x68b5 => Some(0x5b70u16), 0x68a0 => Some(0x5b71u16), 0x68ba => Some(0x5b72u16), 0x690f => Some(0x5b73u16), 0x688d => Some(0x5b74u16), 0x687e => Some(0x5b75u16), 0x6901 => Some(0x5b76u16), 0x68ca => Some(0x5b77u16), 0x6908 => Some(0x5b78u16), 0x68d8 => Some(0x5b79u16), 0x6922 => Some(0x5b7au16), 0x6926 => Some(0x5b7bu16), 0x68e1 => Some(0x5b7cu16), 0x690c => Some(0x5b7du16), 0x68cd => Some(0x5b7eu16), 0x68d4 => Some(0x5c21u16), 0x68e7 => Some(0x5c22u16), 0x68d5 => Some(0x5c23u16), 0x6936 => Some(0x5c24u16), 0x6912 => Some(0x5c25u16), 0x6904 => Some(0x5c26u16), 0x68d7 => Some(0x5c27u16), 0x68e3 => Some(0x5c28u16), 0x6925 => Some(0x5c29u16), 0x68f9 => Some(0x5c2au16), 0x68e0 => Some(0x5c2bu16), 0x68ef => Some(0x5c2cu16), 0x6928 => Some(0x5c2du16), 0x692a => Some(0x5c2eu16), 0x691a => Some(0x5c2fu16), 0x6923 => Some(0x5c30u16), 0x6921 => Some(0x5c31u16), 0x68c6 => Some(0x5c32u16), 0x6979 => Some(0x5c33u16), 0x6977 => Some(0x5c34u16), 0x695c => Some(0x5c35u16), 0x6978 => Some(0x5c36u16), 0x696b => Some(0x5c37u16), 0x6954 => Some(0x5c38u16), 0x697e => Some(0x5c39u16), 0x696e => Some(0x5c3au16), 0x6939 => Some(0x5c3bu16), 0x6974 => Some(0x5c3cu16), 0x693d => Some(0x5c3du16), 0x6959 => Some(0x5c3eu16), 0x6930 => Some(0x5c3fu16), 0x6961 => Some(0x5c40u16), 0x695e => Some(0x5c41u16), 0x695d => Some(0x5c42u16), 0x6981 => Some(0x5c43u16), 0x696a => Some(0x5c44u16), 0x69b2 => Some(0x5c45u16), 0x69ae => Some(0x5c46u16), 0x69d0 => Some(0x5c47u16), 0x69bf => Some(0x5c48u16), 0x69c1 => Some(0x5c49u16), 0x69d3 => Some(0x5c4au16), 0x69be => Some(0x5c4bu16), 0x69ce => Some(0x5c4cu16), 0x5be8 => Some(0x5c4du16), 0x69ca => Some(0x5c4eu16), 0x69dd => Some(0x5c4fu16), 0x69bb => Some(0x5c50u16), 0x69c3 => Some(0x5c51u16), 0x69a7 => Some(0x5c52u16), 0x6a2e => Some(0x5c53u16), 0x6991 => Some(0x5c54u16), 0x69a0 => Some(0x5c55u16), 0x699c => Some(0x5c56u16), 0x6995 => Some(0x5c57u16), 0x69b4 => Some(0x5c58u16), 0x69de => Some(0x5c59u16), 0x69e8 => Some(0x5c5au16), 0x6a02 => Some(0x5c5bu16), 0x6a1b => Some(0x5c5cu16), 0x69ff => Some(0x5c5du16), 0x6b0a => Some(0x5c5eu16), 0x69f9 => Some(0x5c5fu16), 0x69f2 => Some(0x5c60u16), 0x69e7 => Some(0x5c61u16), 0x6a05 => Some(0x5c62u16), 0x69b1 => Some(0x5c63u16), 0x6a1e => Some(0x5c64u16), 0x69ed => Some(0x5c65u16), 0x6a14 => Some(0x5c66u16), 0x69eb => Some(0x5c67u16), 0x6a0a => Some(0x5c68u16), 0x6a12 => Some(0x5c69u16), 0x6ac1 => Some(0x5c6au16), 0x6a23 => Some(0x5c6bu16), 0x6a13 => Some(0x5c6cu16), 0x6a44 => Some(0x5c6du16), 0x6a0c => Some(0x5c6eu16), 0x6a72 => Some(0x5c6fu16), 0x6a36 => Some(0x5c70u16), 0x6a78 => Some(0x5c71u16), 0x6a47 => Some(0x5c72u16), 0x6a62 => Some(0x5c73u16), 0x6a59 => Some(0x5c74u16), 0x6a66 => Some(0x5c75u16), 0x6a48 => Some(0x5c76u16), 0x6a38 => Some(0x5c77u16), 0x6a22 => Some(0x5c78u16), 0x6a90 => Some(0x5c79u16), 0x6a8d => Some(0x5c7au16), 0x6aa0 => Some(0x5c7bu16), 0x6a84 => Some(0x5c7cu16), 0x6aa2 => Some(0x5c7du16), 0x6aa3 => Some(0x5c7eu16), 0x6a97 => Some(0x5d21u16), 0x8617 => Some(0x5d22u16), 0x6abb => Some(0x5d23u16), 0x6ac3 => Some(0x5d24u16), 0x6ac2 => Some(0x5d25u16), 0x6ab8 => Some(0x5d26u16), 0x6ab3 => Some(0x5d27u16), 0x6aac => Some(0x5d28u16), 0x6ade => Some(0x5d29u16), 0x6ad1 => Some(0x5d2au16), 0x6adf => Some(0x5d2bu16), 0x6aaa => Some(0x5d2cu16), 0x6ada => Some(0x5d2du16), 0x6aea => Some(0x5d2eu16), 0x6afb => Some(0x5d2fu16), 0x6b05 => Some(0x5d30u16), 0x8616 => Some(0x5d31u16), 0x6afa => Some(0x5d32u16), 0x6b12 => Some(0x5d33u16), 0x6b16 => Some(0x5d34u16), 0x9b31 => Some(0x5d35u16), 0x6b1f => Some(0x5d36u16), 0x6b38 => Some(0x5d37u16), 0x6b37 => Some(0x5d38u16), 0x76dc => Some(0x5d39u16), 0x6b39 => Some(0x5d3au16), 0x98ee => Some(0x5d3bu16), 0x6b47 => Some(0x5d3cu16), 0x6b43 => Some(0x5d3du16), 0x6b49 => Some(0x5d3eu16), 0x6b50 => Some(0x5d3fu16), 0x6b59 => Some(0x5d40u16), 0x6b54 => Some(0x5d41u16), 0x6b5b => Some(0x5d42u16), 0x6b5f => Some(0x5d43u16), 0x6b61 => Some(0x5d44u16), 0x6b78 => Some(0x5d45u16), 0x6b79 => Some(0x5d46u16), 0x6b7f => Some(0x5d47u16), 0x6b80 => Some(0x5d48u16), 0x6b84 => Some(0x5d49u16), 0x6b83 => Some(0x5d4au16), 0x6b8d => Some(0x5d4bu16), 0x6b98 => Some(0x5d4cu16), 0x6b95 => Some(0x5d4du16), 0x6b9e => Some(0x5d4eu16), 0x6ba4 => Some(0x5d4fu16), 0x6baa => Some(0x5d50u16), 0x6bab => Some(0x5d51u16), 0x6baf => Some(0x5d52u16), 0x6bb2 => Some(0x5d53u16), 0x6bb1 => Some(0x5d54u16), 0x6bb3 => Some(0x5d55u16), 0x6bb7 => Some(0x5d56u16), 0x6bbc => Some(0x5d57u16), 0x6bc6 => Some(0x5d58u16), 0x6bcb => Some(0x5d59u16), 0x6bd3 => Some(0x5d5au16), 0x6bdf => Some(0x5d5bu16), 0x6bec => Some(0x5d5cu16), 0x6beb => Some(0x5d5du16), 0x6bf3 => Some(0x5d5eu16), 0x6bef => Some(0x5d5fu16), 0x9ebe => Some(0x5d60u16), 0x6c08 => Some(0x5d61u16), 0x6c13 => Some(0x5d62u16), 0x6c14 => Some(0x5d63u16), 0x6c1b => Some(0x5d64u16), 0x6c24 => Some(0x5d65u16), 0x6c23 => Some(0x5d66u16), 0x6c5e => Some(0x5d67u16), 0x6c55 => Some(0x5d68u16), 0x6c62 => Some(0x5d69u16), 0x6c6a => Some(0x5d6au16), 0x6c82 => Some(0x5d6bu16), 0x6c8d => Some(0x5d6cu16), 0x6c9a => Some(0x5d6du16), 0x6c81 => Some(0x5d6eu16), 0x6c9b => Some(0x5d6fu16), 0x6c7e => Some(0x5d70u16), 0x6c68 => Some(0x5d71u16), 0x6c73 => Some(0x5d72u16), 0x6c92 => Some(0x5d73u16), 0x6c90 => Some(0x5d74u16), 0x6cc4 => Some(0x5d75u16), 0x6cf1 => Some(0x5d76u16), 0x6cd3 => Some(0x5d77u16), 0x6cbd => Some(0x5d78u16), 0x6cd7 => Some(0x5d79u16), 0x6cc5 => Some(0x5d7au16), 0x6cdd => Some(0x5d7bu16), 0x6cae => Some(0x5d7cu16), 0x6cb1 => Some(0x5d7du16), 0x6cbe => Some(0x5d7eu16), 0x6cba => Some(0x5e21u16), 0x6cdb => Some(0x5e22u16), 0x6cef => Some(0x5e23u16), 0x6cd9 => Some(0x5e24u16), 0x6cea => Some(0x5e25u16), 0x6d1f => Some(0x5e26u16), 0x884d => Some(0x5e27u16), 0x6d36 => Some(0x5e28u16), 0x6d2b => Some(0x5e29u16), 0x6d3d => Some(0x5e2au16), 0x6d38 => Some(0x5e2bu16), 0x6d19 => Some(0x5e2cu16), 0x6d35 => Some(0x5e2du16), 0x6d33 => Some(0x5e2eu16), 0x6d12 => Some(0x5e2fu16), 0x6d0c => Some(0x5e30u16), 0x6d63 => Some(0x5e31u16), 0x6d93 => Some(0x5e32u16), 0x6d64 => Some(0x5e33u16), 0x6d5a => Some(0x5e34u16), 0x6d79 => Some(0x5e35u16), 0x6d59 => Some(0x5e36u16), 0x6d8e => Some(0x5e37u16), 0x6d95 => Some(0x5e38u16), 0x6fe4 => Some(0x5e39u16), 0x6d85 => Some(0x5e3au16), 0x6df9 => Some(0x5e3bu16), 0x6e15 => Some(0x5e3cu16), 0x6e0a => Some(0x5e3du16), 0x6db5 => Some(0x5e3eu16), 0x6dc7 => Some(0x5e3fu16), 0x6de6 => Some(0x5e40u16), 0x6db8 => Some(0x5e41u16), 0x6dc6 => Some(0x5e42u16), 0x6dec => Some(0x5e43u16), 0x6dde => Some(0x5e44u16), 0x6dcc => Some(0x5e45u16), 0x6de8 => Some(0x5e46u16), 0x6dd2 => Some(0x5e47u16), 0x6dc5 => Some(0x5e48u16), 0x6dfa => Some(0x5e49u16), 0x6dd9 => Some(0x5e4au16), 0x6de4 => Some(0x5e4bu16), 0x6dd5 => Some(0x5e4cu16), 0x6dea => Some(0x5e4du16), 0x6dee => Some(0x5e4eu16), 0x6e2d => Some(0x5e4fu16), 0x6e6e => Some(0x5e50u16), 0x6e2e => Some(0x5e51u16), 0x6e19 => Some(0x5e52u16), 0x6e72 => Some(0x5e53u16), 0x6e5f => Some(0x5e54u16), 0x6e3e => Some(0x5e55u16), 0x6e23 => Some(0x5e56u16), 0x6e6b => Some(0x5e57u16), 0x6e2b => Some(0x5e58u16), 0x6e76 => Some(0x5e59u16), 0x6e4d => Some(0x5e5au16), 0x6e1f => Some(0x5e5bu16), 0x6e43 => Some(0x5e5cu16), 0x6e3a => Some(0x5e5du16), 0x6e4e => Some(0x5e5eu16), 0x6e24 => Some(0x5e5fu16), 0x6eff => Some(0x5e60u16), 0x6e1d => Some(0x5e61u16), 0x6e38 => Some(0x5e62u16), 0x6e82 => Some(0x5e63u16), 0x6eaa => Some(0x5e64u16), 0x6e98 => Some(0x5e65u16), 0x6ec9 => Some(0x5e66u16), 0x6eb7 => Some(0x5e67u16), 0x6ed3 => Some(0x5e68u16), 0x6ebd => Some(0x5e69u16), 0x6eaf => Some(0x5e6au16), 0x6ec4 => Some(0x5e6bu16), 0x6eb2 => Some(0x5e6cu16), 0x6ed4 => Some(0x5e6du16), 0x6ed5 => Some(0x5e6eu16), 0x6e8f => Some(0x5e6fu16), 0x6ea5 => Some(0x5e70u16), 0x6ec2 => Some(0x5e71u16), 0x6e9f => Some(0x5e72u16), 0x6f41 => Some(0x5e73u16), 0x6f11 => Some(0x5e74u16), 0x704c => Some(0x5e75u16), 0x6eec => Some(0x5e76u16), 0x6ef8 => Some(0x5e77u16), 0x6efe => Some(0x5e78u16), 0x6f3f => Some(0x5e79u16), 0x6ef2 => Some(0x5e7au16), 0x6f31 => Some(0x5e7bu16), 0x6eef => Some(0x5e7cu16), 0x6f32 => Some(0x5e7du16), 0x6ecc => Some(0x5e7eu16), 0x6f3e => Some(0x5f21u16), 0x6f13 => Some(0x5f22u16), 0x6ef7 => Some(0x5f23u16), 0x6f86 => Some(0x5f24u16), 0x6f7a => Some(0x5f25u16), 0x6f78 => Some(0x5f26u16), 0x6f81 => Some(0x5f27u16), 0x6f80 => Some(0x5f28u16), 0x6f6f => Some(0x5f29u16), 0x6f5b => Some(0x5f2au16), 0x6ff3 => Some(0x5f2bu16), 0x6f6d => Some(0x5f2cu16), 0x6f82 => Some(0x5f2du16), 0x6f7c => Some(0x5f2eu16), 0x6f58 => Some(0x5f2fu16), 0x6f8e => Some(0x5f30u16), 0x6f91 => Some(0x5f31u16), 0x6fc2 => Some(0x5f32u16), 0x6f66 => Some(0x5f33u16), 0x6fb3 => Some(0x5f34u16), 0x6fa3 => Some(0x5f35u16), 0x6fa1 => Some(0x5f36u16), 0x6fa4 => Some(0x5f37u16), 0x6fb9 => Some(0x5f38u16), 0x6fc6 => Some(0x5f39u16), 0x6faa => Some(0x5f3au16), 0x6fdf => Some(0x5f3bu16), 0x6fd5 => Some(0x5f3cu16), 0x6fec => Some(0x5f3du16), 0x6fd4 => Some(0x5f3eu16), 0x6fd8 => Some(0x5f3fu16), 0x6ff1 => Some(0x5f40u16), 0x6fee => Some(0x5f41u16), 0x6fdb => Some(0x5f42u16), 0x7009 => Some(0x5f43u16), 0x700b => Some(0x5f44u16), 0x6ffa => Some(0x5f45u16), 0x7011 => Some(0x5f46u16), 0x7001 => Some(0x5f47u16), 0x700f => Some(0x5f48u16), 0x6ffe => Some(0x5f49u16), 0x701b => Some(0x5f4au16), 0x701a => Some(0x5f4bu16), 0x6f74 => Some(0x5f4cu16), 0x701d => Some(0x5f4du16), 0x7018 => Some(0x5f4eu16), 0x701f => Some(0x5f4fu16), 0x7030 => Some(0x5f50u16), 0x703e => Some(0x5f51u16), 0x7032 => Some(0x5f52u16), 0x7051 => Some(0x5f53u16), 0x7063 => Some(0x5f54u16), 0x7099 => Some(0x5f55u16), 0x7092 => Some(0x5f56u16), 0x70af => Some(0x5f57u16), 0x70f1 => Some(0x5f58u16), 0x70ac => Some(0x5f59u16), 0x70b8 => Some(0x5f5au16), 0x70b3 => Some(0x5f5bu16), 0x70ae => Some(0x5f5cu16), 0x70df => Some(0x5f5du16), 0x70cb => Some(0x5f5eu16), 0x70dd => Some(0x5f5fu16), 0x70d9 => Some(0x5f60u16), 0x7109 => Some(0x5f61u16), 0x70fd => Some(0x5f62u16), 0x711c => Some(0x5f63u16), 0x7119 => Some(0x5f64u16), 0x7165 => Some(0x5f65u16), 0x7155 => Some(0x5f66u16), 0x7188 => Some(0x5f67u16), 0x7166 => Some(0x5f68u16), 0x7162 => Some(0x5f69u16), 0x714c => Some(0x5f6au16), 0x7156 => Some(0x5f6bu16), 0x716c => Some(0x5f6cu16), 0x718f => Some(0x5f6du16), 0x71fb => Some(0x5f6eu16), 0x7184 => Some(0x5f6fu16), 0x7195 => Some(0x5f70u16), 0x71a8 => Some(0x5f71u16), 0x71ac => Some(0x5f72u16), 0x71d7 => Some(0x5f73u16), 0x71b9 => Some(0x5f74u16), 0x71be => Some(0x5f75u16), 0x71d2 => Some(0x5f76u16), 0x71c9 => Some(0x5f77u16), 0x71d4 => Some(0x5f78u16), 0x71ce => Some(0x5f79u16), 0x71e0 => Some(0x5f7au16), 0x71ec => Some(0x5f7bu16), 0x71e7 => Some(0x5f7cu16), 0x71f5 => Some(0x5f7du16), 0x71fc => Some(0x5f7eu16), 0x71f9 => Some(0x6021u16), 0x71ff => Some(0x6022u16), 0x720d => Some(0x6023u16), 0x7210 => Some(0x6024u16), 0x721b => Some(0x6025u16), 0x7228 => Some(0x6026u16), 0x722d => Some(0x6027u16), 0x722c => Some(0x6028u16), 0x7230 => Some(0x6029u16), 0x7232 => Some(0x602au16), 0x723b => Some(0x602bu16), 0x723c => Some(0x602cu16), 0x723f => Some(0x602du16), 0x7240 => Some(0x602eu16), 0x7246 => Some(0x602fu16), 0x724b => Some(0x6030u16), 0x7258 => Some(0x6031u16), 0x7274 => Some(0x6032u16), 0x727e => Some(0x6033u16), 0x7282 => Some(0x6034u16), 0x7281 => Some(0x6035u16), 0x7287 => Some(0x6036u16), 0x7292 => Some(0x6037u16), 0x7296 => Some(0x6038u16), 0x72a2 => Some(0x6039u16), 0x72a7 => Some(0x603au16), 0x72b9 => Some(0x603bu16), 0x72b2 => Some(0x603cu16), 0x72c3 => Some(0x603du16), 0x72c6 => Some(0x603eu16), 0x72c4 => Some(0x603fu16), 0x72ce => Some(0x6040u16), 0x72d2 => Some(0x6041u16), 0x72e2 => Some(0x6042u16), 0x72e0 => Some(0x6043u16), 0x72e1 => Some(0x6044u16), 0x72f9 => Some(0x6045u16), 0x72f7 => Some(0x6046u16), 0x500f => Some(0x6047u16), 0x7317 => Some(0x6048u16), 0x730a => Some(0x6049u16), 0x731c => Some(0x604au16), 0x7316 => Some(0x604bu16), 0x731d => Some(0x604cu16), 0x7334 => Some(0x604du16), 0x732f => Some(0x604eu16), 0x7329 => Some(0x604fu16), 0x7325 => Some(0x6050u16), 0x733e => Some(0x6051u16), 0x734e => Some(0x6052u16), 0x734f => Some(0x6053u16), 0x9ed8 => Some(0x6054u16), 0x7357 => Some(0x6055u16), 0x736a => Some(0x6056u16), 0x7368 => Some(0x6057u16), 0x7370 => Some(0x6058u16), 0x7378 => Some(0x6059u16), 0x7375 => Some(0x605au16), 0x737b => Some(0x605bu16), 0x737a => Some(0x605cu16), 0x73c8 => Some(0x605du16), 0x73b3 => Some(0x605eu16), 0x73ce => Some(0x605fu16), 0x73bb => Some(0x6060u16), 0x73c0 => Some(0x6061u16), 0x73e5 => Some(0x6062u16), 0x73ee => Some(0x6063u16), 0x73de => Some(0x6064u16), 0x74a2 => Some(0x6065u16), 0x7405 => Some(0x6066u16), 0x746f => Some(0x6067u16), 0x7425 => Some(0x6068u16), 0x73f8 => Some(0x6069u16), 0x7432 => Some(0x606au16), 0x743a => Some(0x606bu16), 0x7455 => Some(0x606cu16), 0x743f => Some(0x606du16), 0x745f => Some(0x606eu16), 0x7459 => Some(0x606fu16), 0x7441 => Some(0x6070u16), 0x745c => Some(0x6071u16), 0x7469 => Some(0x6072u16), 0x7470 => Some(0x6073u16), 0x7463 => Some(0x6074u16), 0x746a => Some(0x6075u16), 0x7476 => Some(0x6076u16), 0x747e => Some(0x6077u16), 0x748b => Some(0x6078u16), 0x749e => Some(0x6079u16), 0x74a7 => Some(0x607au16), 0x74ca => Some(0x607bu16), 0x74cf => Some(0x607cu16), 0x74d4 => Some(0x607du16), 0x73f1 => Some(0x607eu16), 0x74e0 => Some(0x6121u16), 0x74e3 => Some(0x6122u16), 0x74e7 => Some(0x6123u16), 0x74e9 => Some(0x6124u16), 0x74ee => Some(0x6125u16), 0x74f2 => Some(0x6126u16), 0x74f0 => Some(0x6127u16), 0x74f1 => Some(0x6128u16), 0x74f8 => Some(0x6129u16), 0x74f7 => Some(0x612au16), 0x7504 => Some(0x612bu16), 0x7503 => Some(0x612cu16), 0x7505 => Some(0x612du16), 0x750c => Some(0x612eu16), 0x750e => Some(0x612fu16), 0x750d => Some(0x6130u16), 0x7515 => Some(0x6131u16), 0x7513 => Some(0x6132u16), 0x751e => Some(0x6133u16), 0x7526 => Some(0x6134u16), 0x752c => Some(0x6135u16), 0x753c => Some(0x6136u16), 0x7544 => Some(0x6137u16), 0x754d => Some(0x6138u16), 0x754a => Some(0x6139u16), 0x7549 => Some(0x613au16), 0x755b => Some(0x613bu16), 0x7546 => Some(0x613cu16), 0x755a => Some(0x613du16), 0x7569 => Some(0x613eu16), 0x7564 => Some(0x613fu16), 0x7567 => Some(0x6140u16), 0x756b => Some(0x6141u16), 0x756d => Some(0x6142u16), 0x7578 => Some(0x6143u16), 0x7576 => Some(0x6144u16), 0x7586 => Some(0x6145u16), 0x7587 => Some(0x6146u16), 0x7574 => Some(0x6147u16), 0x758a => Some(0x6148u16), 0x7589 => Some(0x6149u16), 0x7582 => Some(0x614au16), 0x7594 => Some(0x614bu16), 0x759a => Some(0x614cu16), 0x759d => Some(0x614du16), 0x75a5 => Some(0x614eu16), 0x75a3 => Some(0x614fu16), 0x75c2 => Some(0x6150u16), 0x75b3 => Some(0x6151u16), 0x75c3 => Some(0x6152u16), 0x75b5 => Some(0x6153u16), 0x75bd => Some(0x6154u16), 0x75b8 => Some(0x6155u16), 0x75bc => Some(0x6156u16), 0x75b1 => Some(0x6157u16), 0x75cd => Some(0x6158u16), 0x75ca => Some(0x6159u16), 0x75d2 => Some(0x615au16), 0x75d9 => Some(0x615bu16), 0x75e3 => Some(0x615cu16), 0x75de => Some(0x615du16), 0x75fe => Some(0x615eu16), 0x75ff => Some(0x615fu16), 0x75fc => Some(0x6160u16), 0x7601 => Some(0x6161u16), 0x75f0 => Some(0x6162u16), 0x75fa => Some(0x6163u16), 0x75f2 => Some(0x6164u16), 0x75f3 => Some(0x6165u16), 0x760b => Some(0x6166u16), 0x760d => Some(0x6167u16), 0x7609 => Some(0x6168u16), 0x761f => Some(0x6169u16), 0x7627 => Some(0x616au16), 0x7620 => Some(0x616bu16), 0x7621 => Some(0x616cu16), 0x7622 => Some(0x616du16), 0x7624 => Some(0x616eu16), 0x7634 => Some(0x616fu16), 0x7630 => Some(0x6170u16), 0x763b => Some(0x6171u16), 0x7647 => Some(0x6172u16), 0x7648 => Some(0x6173u16), 0x7646 => Some(0x6174u16), 0x765c => Some(0x6175u16), 0x7658 => Some(0x6176u16), 0x7661 => Some(0x6177u16), 0x7662 => Some(0x6178u16), 0x7668 => Some(0x6179u16), 0x7669 => Some(0x617au16), 0x766a => Some(0x617bu16), 0x7667 => Some(0x617cu16), 0x766c => Some(0x617du16), 0x7670 => Some(0x617eu16), 0x7672 => Some(0x6221u16), 0x7676 => Some(0x6222u16), 0x7678 => Some(0x6223u16), 0x767c => Some(0x6224u16), 0x7680 => Some(0x6225u16), 0x7683 => Some(0x6226u16), 0x7688 => Some(0x6227u16), 0x768b => Some(0x6228u16), 0x768e => Some(0x6229u16), 0x7696 => Some(0x622au16), 0x7693 => Some(0x622bu16), 0x7699 => Some(0x622cu16), 0x769a => Some(0x622du16), 0x76b0 => Some(0x622eu16), 0x76b4 => Some(0x622fu16), 0x76b8 => Some(0x6230u16), 0x76b9 => Some(0x6231u16), 0x76ba => Some(0x6232u16), 0x76c2 => Some(0x6233u16), 0x76cd => Some(0x6234u16), 0x76d6 => Some(0x6235u16), 0x76d2 => Some(0x6236u16), 0x76de => Some(0x6237u16), 0x76e1 => Some(0x6238u16), 0x76e5 => Some(0x6239u16), 0x76e7 => Some(0x623au16), 0x76ea => Some(0x623bu16), 0x862f => Some(0x623cu16), 0x76fb => Some(0x623du16), 0x7708 => Some(0x623eu16), 0x7707 => Some(0x623fu16), 0x7704 => Some(0x6240u16), 0x7729 => Some(0x6241u16), 0x7724 => Some(0x6242u16), 0x771e => Some(0x6243u16), 0x7725 => Some(0x6244u16), 0x7726 => Some(0x6245u16), 0x771b => Some(0x6246u16), 0x7737 => Some(0x6247u16), 0x7738 => Some(0x6248u16), 0x7747 => Some(0x6249u16), 0x775a => Some(0x624au16), 0x7768 => Some(0x624bu16), 0x776b => Some(0x624cu16), 0x775b => Some(0x624du16), 0x7765 => Some(0x624eu16), 0x777f => Some(0x624fu16), 0x777e => Some(0x6250u16), 0x7779 => Some(0x6251u16), 0x778e => Some(0x6252u16), 0x778b => Some(0x6253u16), 0x7791 => Some(0x6254u16), 0x77a0 => Some(0x6255u16), 0x779e => Some(0x6256u16), 0x77b0 => Some(0x6257u16), 0x77b6 => Some(0x6258u16), 0x77b9 => Some(0x6259u16), 0x77bf => Some(0x625au16), 0x77bc => Some(0x625bu16), 0x77bd => Some(0x625cu16), 0x77bb => Some(0x625du16), 0x77c7 => Some(0x625eu16), 0x77cd => Some(0x625fu16), 0x77d7 => Some(0x6260u16), 0x77da => Some(0x6261u16), 0x77dc => Some(0x6262u16), 0x77e3 => Some(0x6263u16), 0x77ee => Some(0x6264u16), 0x77fc => Some(0x6265u16), 0x780c => Some(0x6266u16), 0x7812 => Some(0x6267u16), 0x7926 => Some(0x6268u16), 0x7820 => Some(0x6269u16), 0x792a => Some(0x626au16), 0x7845 => Some(0x626bu16), 0x788e => Some(0x626cu16), 0x7874 => Some(0x626du16), 0x7886 => Some(0x626eu16), 0x787c => Some(0x626fu16), 0x789a => Some(0x6270u16), 0x788c => Some(0x6271u16), 0x78a3 => Some(0x6272u16), 0x78b5 => Some(0x6273u16), 0x78aa => Some(0x6274u16), 0x78af => Some(0x6275u16), 0x78d1 => Some(0x6276u16), 0x78c6 => Some(0x6277u16), 0x78cb => Some(0x6278u16), 0x78d4 => Some(0x6279u16), 0x78be => Some(0x627au16), 0x78bc => Some(0x627bu16), 0x78c5 => Some(0x627cu16), 0x78ca => Some(0x627du16), 0x78ec => Some(0x627eu16), 0x78e7 => Some(0x6321u16), 0x78da => Some(0x6322u16), 0x78fd => Some(0x6323u16), 0x78f4 => Some(0x6324u16), 0x7907 => Some(0x6325u16), 0x7912 => Some(0x6326u16), 0x7911 => Some(0x6327u16), 0x7919 => Some(0x6328u16), 0x792c => Some(0x6329u16), 0x792b => Some(0x632au16), 0x7940 => Some(0x632bu16), 0x7960 => Some(0x632cu16), 0x7957 => Some(0x632du16), 0x795f => Some(0x632eu16), 0x795a => Some(0x632fu16), 0x7955 => Some(0x6330u16), 0x7953 => Some(0x6331u16), 0x797a => Some(0x6332u16), 0x797f => Some(0x6333u16), 0x798a => Some(0x6334u16), 0x799d => Some(0x6335u16), 0x79a7 => Some(0x6336u16), 0x9f4b => Some(0x6337u16), 0x79aa => Some(0x6338u16), 0x79ae => Some(0x6339u16), 0x79b3 => Some(0x633au16), 0x79b9 => Some(0x633bu16), 0x79ba => Some(0x633cu16), 0x79c9 => Some(0x633du16), 0x79d5 => Some(0x633eu16), 0x79e7 => Some(0x633fu16), 0x79ec => Some(0x6340u16), 0x79e1 => Some(0x6341u16), 0x79e3 => Some(0x6342u16), 0x7a08 => Some(0x6343u16), 0x7a0d => Some(0x6344u16), 0x7a18 => Some(0x6345u16), 0x7a19 => Some(0x6346u16), 0x7a20 => Some(0x6347u16), 0x7a1f => Some(0x6348u16), 0x7980 => Some(0x6349u16), 0x7a31 => Some(0x634au16), 0x7a3b => Some(0x634bu16), 0x7a3e => Some(0x634cu16), 0x7a37 => Some(0x634du16), 0x7a43 => Some(0x634eu16), 0x7a57 => Some(0x634fu16), 0x7a49 => Some(0x6350u16), 0x7a61 => Some(0x6351u16), 0x7a62 => Some(0x6352u16), 0x7a69 => Some(0x6353u16), 0x9f9d => Some(0x6354u16), 0x7a70 => Some(0x6355u16), 0x7a79 => Some(0x6356u16), 0x7a7d => Some(0x6357u16), 0x7a88 => Some(0x6358u16), 0x7a97 => Some(0x6359u16), 0x7a95 => Some(0x635au16), 0x7a98 => Some(0x635bu16), 0x7a96 => Some(0x635cu16), 0x7aa9 => Some(0x635du16), 0x7ac8 => Some(0x635eu16), 0x7ab0 => Some(0x635fu16), 0x7ab6 => Some(0x6360u16), 0x7ac5 => Some(0x6361u16), 0x7ac4 => Some(0x6362u16), 0x7abf => Some(0x6363u16), 0x9083 => Some(0x6364u16), 0x7ac7 => Some(0x6365u16), 0x7aca => Some(0x6366u16), 0x7acd => Some(0x6367u16), 0x7acf => Some(0x6368u16), 0x7ad5 => Some(0x6369u16), 0x7ad3 => Some(0x636au16), 0x7ad9 => Some(0x636bu16), 0x7ada => Some(0x636cu16), 0x7add => Some(0x636du16), 0x7ae1 => Some(0x636eu16), 0x7ae2 => Some(0x636fu16), 0x7ae6 => Some(0x6370u16), 0x7aed => Some(0x6371u16), 0x7af0 => Some(0x6372u16), 0x7b02 => Some(0x6373u16), 0x7b0f => Some(0x6374u16), 0x7b0a => Some(0x6375u16), 0x7b06 => Some(0x6376u16), 0x7b33 => Some(0x6377u16), 0x7b18 => Some(0x6378u16), 0x7b19 => Some(0x6379u16), 0x7b1e => Some(0x637au16), 0x7b35 => Some(0x637bu16), 0x7b28 => Some(0x637cu16), 0x7b36 => Some(0x637du16), 0x7b50 => Some(0x637eu16), 0x7b7a => Some(0x6421u16), 0x7b04 => Some(0x6422u16), 0x7b4d => Some(0x6423u16), 0x7b0b => Some(0x6424u16), 0x7b4c => Some(0x6425u16), 0x7b45 => Some(0x6426u16), 0x7b75 => Some(0x6427u16), 0x7b65 => Some(0x6428u16), 0x7b74 => Some(0x6429u16), 0x7b67 => Some(0x642au16), 0x7b70 => Some(0x642bu16), 0x7b71 => Some(0x642cu16), 0x7b6c => Some(0x642du16), 0x7b6e => Some(0x642eu16), 0x7b9d => Some(0x642fu16), 0x7b98 => Some(0x6430u16), 0x7b9f => Some(0x6431u16), 0x7b8d => Some(0x6432u16), 0x7b9c => Some(0x6433u16), 0x7b9a => Some(0x6434u16), 0x7b8b => Some(0x6435u16), 0x7b92 => Some(0x6436u16), 0x7b8f => Some(0x6437u16), 0x7b5d => Some(0x6438u16), 0x7b99 => Some(0x6439u16), 0x7bcb => Some(0x643au16), 0x7bc1 => Some(0x643bu16), 0x7bcc => Some(0x643cu16), 0x7bcf => Some(0x643du16), 0x7bb4 => Some(0x643eu16), 0x7bc6 => Some(0x643fu16), 0x7bdd => Some(0x6440u16), 0x7be9 => Some(0x6441u16), 0x7c11 => Some(0x6442u16), 0x7c14 => Some(0x6443u16), 0x7be6 => Some(0x6444u16), 0x7be5 => Some(0x6445u16), 0x7c60 => Some(0x6446u16), 0x7c00 => Some(0x6447u16), 0x7c07 => Some(0x6448u16), 0x7c13 => Some(0x6449u16), 0x7bf3 => Some(0x644au16), 0x7bf7 => Some(0x644bu16), 0x7c17 => Some(0x644cu16), 0x7c0d => Some(0x644du16), 0x7bf6 => Some(0x644eu16), 0x7c23 => Some(0x644fu16), 0x7c27 => Some(0x6450u16), 0x7c2a => Some(0x6451u16), 0x7c1f => Some(0x6452u16), 0x7c37 => Some(0x6453u16), 0x7c2b => Some(0x6454u16), 0x7c3d => Some(0x6455u16), 0x7c4c => Some(0x6456u16), 0x7c43 => Some(0x6457u16), 0x7c54 => Some(0x6458u16), 0x7c4f => Some(0x6459u16), 0x7c40 => Some(0x645au16), 0x7c50 => Some(0x645bu16), 0x7c58 => Some(0x645cu16), 0x7c5f => Some(0x645du16), 0x7c64 => Some(0x645eu16), 0x7c56 => Some(0x645fu16), 0x7c65 => Some(0x6460u16), 0x7c6c => Some(0x6461u16), 0x7c75 => Some(0x6462u16), 0x7c83 => Some(0x6463u16), 0x7c90 => Some(0x6464u16), 0x7ca4 => Some(0x6465u16), 0x7cad => Some(0x6466u16), 0x7ca2 => Some(0x6467u16), 0x7cab => Some(0x6468u16), 0x7ca1 => Some(0x6469u16), 0x7ca8 => Some(0x646au16), 0x7cb3 => Some(0x646bu16), 0x7cb2 => Some(0x646cu16), 0x7cb1 => Some(0x646du16), 0x7cae => Some(0x646eu16), 0x7cb9 => Some(0x646fu16), 0x7cbd => Some(0x6470u16), 0x7cc0 => Some(0x6471u16), 0x7cc5 => Some(0x6472u16), 0x7cc2 => Some(0x6473u16), 0x7cd8 => Some(0x6474u16), 0x7cd2 => Some(0x6475u16), 0x7cdc => Some(0x6476u16), 0x7ce2 => Some(0x6477u16), 0x9b3b => Some(0x6478u16), 0x7cef => Some(0x6479u16), 0x7cf2 => Some(0x647au16), 0x7cf4 => Some(0x647bu16), 0x7cf6 => Some(0x647cu16), 0x7cfa => Some(0x647du16), 0x7d06 => Some(0x647eu16), 0x7d02 => Some(0x6521u16), 0x7d1c => Some(0x6522u16), 0x7d15 => Some(0x6523u16), 0x7d0a => Some(0x6524u16), 0x7d45 => Some(0x6525u16), 0x7d4b => Some(0x6526u16), 0x7d2e => Some(0x6527u16), 0x7d32 => Some(0x6528u16), 0x7d3f => Some(0x6529u16), 0x7d35 => Some(0x652au16), 0x7d46 => Some(0x652bu16), 0x7d73 => Some(0x652cu16), 0x7d56 => Some(0x652du16), 0x7d4e => Some(0x652eu16), 0x7d72 => Some(0x652fu16), 0x7d68 => Some(0x6530u16), 0x7d6e => Some(0x6531u16), 0x7d4f => Some(0x6532u16), 0x7d63 => Some(0x6533u16), 0x7d93 => Some(0x6534u16), 0x7d89 => Some(0x6535u16), 0x7d5b => Some(0x6536u16), 0x7d8f => Some(0x6537u16), 0x7d7d => Some(0x6538u16), 0x7d9b => Some(0x6539u16), 0x7dba => Some(0x653au16), 0x7dae => Some(0x653bu16), 0x7da3 => Some(0x653cu16), 0x7db5 => Some(0x653du16), 0x7dc7 => Some(0x653eu16), 0x7dbd => Some(0x653fu16), 0x7dab => Some(0x6540u16), 0x7e3d => Some(0x6541u16), 0x7da2 => Some(0x6542u16), 0x7daf => Some(0x6543u16), 0x7ddc => Some(0x6544u16), 0x7db8 => Some(0x6545u16), 0x7d9f => Some(0x6546u16), 0x7db0 => Some(0x6547u16), 0x7dd8 => Some(0x6548u16), 0x7ddd => Some(0x6549u16), 0x7de4 => Some(0x654au16), 0x7dde => Some(0x654bu16), 0x7dfb => Some(0x654cu16), 0x7df2 => Some(0x654du16), 0x7de1 => Some(0x654eu16), 0x7e05 => Some(0x654fu16), 0x7e0a => Some(0x6550u16), 0x7e23 => Some(0x6551u16), 0x7e21 => Some(0x6552u16), 0x7e12 => Some(0x6553u16), 0x7e31 => Some(0x6554u16), 0x7e1f => Some(0x6555u16), 0x7e09 => Some(0x6556u16), 0x7e0b => Some(0x6557u16), 0x7e22 => Some(0x6558u16), 0x7e46 => Some(0x6559u16), 0x7e66 => Some(0x655au16), 0x7e3b => Some(0x655bu16), 0x7e35 => Some(0x655cu16), 0x7e39 => Some(0x655du16), 0x7e43 => Some(0x655eu16), 0x7e37 => Some(0x655fu16), 0x7e32 => Some(0x6560u16), 0x7e3a => Some(0x6561u16), 0x7e67 => Some(0x6562u16), 0x7e5d => Some(0x6563u16), 0x7e56 => Some(0x6564u16), 0x7e5e => Some(0x6565u16), 0x7e59 => Some(0x6566u16), 0x7e5a => Some(0x6567u16), 0x7e79 => Some(0x6568u16), 0x7e6a => Some(0x6569u16), 0x7e69 => Some(0x656au16), 0x7e7c => Some(0x656bu16), 0x7e7b => Some(0x656cu16), 0x7e83 => Some(0x656du16), 0x7dd5 => Some(0x656eu16), 0x7e7d => Some(0x656fu16), 0x8fae => Some(0x6570u16), 0x7e7f => Some(0x6571u16), 0x7e88 => Some(0x6572u16), 0x7e89 => Some(0x6573u16), 0x7e8c => Some(0x6574u16), 0x7e92 => Some(0x6575u16), 0x7e90 => Some(0x6576u16), 0x7e93 => Some(0x6577u16), 0x7e94 => Some(0x6578u16), 0x7e96 => Some(0x6579u16), 0x7e8e => Some(0x657au16), 0x7e9b => Some(0x657bu16), 0x7e9c => Some(0x657cu16), 0x7f38 => Some(0x657du16), 0x7f3a => Some(0x657eu16), 0x7f45 => Some(0x6621u16), 0x7f4c => Some(0x6622u16), 0x7f4d => Some(0x6623u16), 0x7f4e => Some(0x6624u16), 0x7f50 => Some(0x6625u16), 0x7f51 => Some(0x6626u16), 0x7f55 => Some(0x6627u16), 0x7f54 => Some(0x6628u16), 0x7f58 => Some(0x6629u16), 0x7f5f => Some(0x662au16), 0x7f60 => Some(0x662bu16), 0x7f68 => Some(0x662cu16), 0x7f69 => Some(0x662du16), 0x7f67 => Some(0x662eu16), 0x7f78 => Some(0x662fu16), 0x7f82 => Some(0x6630u16), 0x7f86 => Some(0x6631u16), 0x7f83 => Some(0x6632u16), 0x7f88 => Some(0x6633u16), 0x7f87 => Some(0x6634u16), 0x7f8c => Some(0x6635u16), 0x7f94 => Some(0x6636u16), 0x7f9e => Some(0x6637u16), 0x7f9d => Some(0x6638u16), 0x7f9a => Some(0x6639u16), 0x7fa3 => Some(0x663au16), 0x7faf => Some(0x663bu16), 0x7fb2 => Some(0x663cu16), 0x7fb9 => Some(0x663du16), 0x7fae => Some(0x663eu16), 0x7fb6 => Some(0x663fu16), 0x7fb8 => Some(0x6640u16), 0x8b71 => Some(0x6641u16), 0x7fc5 => Some(0x6642u16), 0x7fc6 => Some(0x6643u16), 0x7fca => Some(0x6644u16), 0x7fd5 => Some(0x6645u16), 0x7fd4 => Some(0x6646u16), 0x7fe1 => Some(0x6647u16), 0x7fe6 => Some(0x6648u16), 0x7fe9 => Some(0x6649u16), 0x7ff3 => Some(0x664au16), 0x7ff9 => Some(0x664bu16), 0x98dc => Some(0x664cu16), 0x8006 => Some(0x664du16), 0x8004 => Some(0x664eu16), 0x800b => Some(0x664fu16), 0x8012 => Some(0x6650u16), 0x8018 => Some(0x6651u16), 0x8019 => Some(0x6652u16), 0x801c => Some(0x6653u16), 0x8021 => Some(0x6654u16), 0x8028 => Some(0x6655u16), 0x803f => Some(0x6656u16), 0x803b => Some(0x6657u16), 0x804a => Some(0x6658u16), 0x8046 => Some(0x6659u16), 0x8052 => Some(0x665au16), 0x8058 => Some(0x665bu16), 0x805a => Some(0x665cu16), 0x805f => Some(0x665du16), 0x8062 => Some(0x665eu16), 0x8068 => Some(0x665fu16), 0x8073 => Some(0x6660u16), 0x8072 => Some(0x6661u16), 0x8070 => Some(0x6662u16), 0x8076 => Some(0x6663u16), 0x8079 => Some(0x6664u16), 0x807d => Some(0x6665u16), 0x807f => Some(0x6666u16), 0x8084 => Some(0x6667u16), 0x8086 => Some(0x6668u16), 0x8085 => Some(0x6669u16), 0x809b => Some(0x666au16), 0x8093 => Some(0x666bu16), 0x809a => Some(0x666cu16), 0x80ad => Some(0x666du16), 0x5190 => Some(0x666eu16), 0x80ac => Some(0x666fu16), 0x80db => Some(0x6670u16), 0x80e5 => Some(0x6671u16), 0x80d9 => Some(0x6672u16), 0x80dd => Some(0x6673u16), 0x80c4 => Some(0x6674u16), 0x80da => Some(0x6675u16), 0x80d6 => Some(0x6676u16), 0x8109 => Some(0x6677u16), 0x80ef => Some(0x6678u16), 0x80f1 => Some(0x6679u16), 0x811b => Some(0x667au16), 0x8129 => Some(0x667bu16), 0x8123 => Some(0x667cu16), 0x812f => Some(0x667du16), 0x814b => Some(0x667eu16), 0x968b => Some(0x6721u16), 0x8146 => Some(0x6722u16), 0x813e => Some(0x6723u16), 0x8153 => Some(0x6724u16), 0x8151 => Some(0x6725u16), 0x80fc => Some(0x6726u16), 0x8171 => Some(0x6727u16), 0x816e => Some(0x6728u16), 0x8165 => Some(0x6729u16), 0x8166 => Some(0x672au16), 0x8174 => Some(0x672bu16), 0x8183 => Some(0x672cu16), 0x8188 => Some(0x672du16), 0x818a => Some(0x672eu16), 0x8180 => Some(0x672fu16), 0x8182 => Some(0x6730u16), 0x81a0 => Some(0x6731u16), 0x8195 => Some(0x6732u16), 0x81a4 => Some(0x6733u16), 0x81a3 => Some(0x6734u16), 0x815f => Some(0x6735u16), 0x8193 => Some(0x6736u16), 0x81a9 => Some(0x6737u16), 0x81b0 => Some(0x6738u16), 0x81b5 => Some(0x6739u16), 0x81be => Some(0x673au16), 0x81b8 => Some(0x673bu16), 0x81bd => Some(0x673cu16), 0x81c0 => Some(0x673du16), 0x81c2 => Some(0x673eu16), 0x81ba => Some(0x673fu16), 0x81c9 => Some(0x6740u16), 0x81cd => Some(0x6741u16), 0x81d1 => Some(0x6742u16), 0x81d9 => Some(0x6743u16), 0x81d8 => Some(0x6744u16), 0x81c8 => Some(0x6745u16), 0x81da => Some(0x6746u16), 0x81df => Some(0x6747u16), 0x81e0 => Some(0x6748u16), 0x81e7 => Some(0x6749u16), 0x81fa => Some(0x674au16), 0x81fb => Some(0x674bu16), 0x81fe => Some(0x674cu16), 0x8201 => Some(0x674du16), 0x8202 => Some(0x674eu16), 0x8205 => Some(0x674fu16), 0x8207 => Some(0x6750u16), 0x820a => Some(0x6751u16), 0x820d => Some(0x6752u16), 0x8210 => Some(0x6753u16), 0x8216 => Some(0x6754u16), 0x8229 => Some(0x6755u16), 0x822b => Some(0x6756u16), 0x8238 => Some(0x6757u16), 0x8233 => Some(0x6758u16), 0x8240 => Some(0x6759u16), 0x8259 => Some(0x675au16), 0x8258 => Some(0x675bu16), 0x825d => Some(0x675cu16), 0x825a => Some(0x675du16), 0x825f => Some(0x675eu16), 0x8264 => Some(0x675fu16), 0x8262 => Some(0x6760u16), 0x8268 => Some(0x6761u16), 0x826a => Some(0x6762u16), 0x826b => Some(0x6763u16), 0x822e => Some(0x6764u16), 0x8271 => Some(0x6765u16), 0x8277 => Some(0x6766u16), 0x8278 => Some(0x6767u16), 0x827e => Some(0x6768u16), 0x828d => Some(0x6769u16), 0x8292 => Some(0x676au16), 0x82ab => Some(0x676bu16), 0x829f => Some(0x676cu16), 0x82bb => Some(0x676du16), 0x82ac => Some(0x676eu16), 0x82e1 => Some(0x676fu16), 0x82e3 => Some(0x6770u16), 0x82df => Some(0x6771u16), 0x82d2 => Some(0x6772u16), 0x82f4 => Some(0x6773u16), 0x82f3 => Some(0x6774u16), 0x82fa => Some(0x6775u16), 0x8393 => Some(0x6776u16), 0x8303 => Some(0x6777u16), 0x82fb => Some(0x6778u16), 0x82f9 => Some(0x6779u16), 0x82de => Some(0x677au16), 0x8306 => Some(0x677bu16), 0x82dc => Some(0x677cu16), 0x8309 => Some(0x677du16), 0x82d9 => Some(0x677eu16), 0x8335 => Some(0x6821u16), 0x8334 => Some(0x6822u16), 0x8316 => Some(0x6823u16), 0x8332 => Some(0x6824u16), 0x8331 => Some(0x6825u16), 0x8340 => Some(0x6826u16), 0x8339 => Some(0x6827u16), 0x8350 => Some(0x6828u16), 0x8345 => Some(0x6829u16), 0x832f => Some(0x682au16), 0x832b => Some(0x682bu16), 0x8317 => Some(0x682cu16), 0x8318 => Some(0x682du16), 0x8385 => Some(0x682eu16), 0x839a => Some(0x682fu16), 0x83aa => Some(0x6830u16), 0x839f => Some(0x6831u16), 0x83a2 => Some(0x6832u16), 0x8396 => Some(0x6833u16), 0x8323 => Some(0x6834u16), 0x838e => Some(0x6835u16), 0x8387 => Some(0x6836u16), 0x838a => Some(0x6837u16), 0x837c => Some(0x6838u16), 0x83b5 => Some(0x6839u16), 0x8373 => Some(0x683au16), 0x8375 => Some(0x683bu16), 0x83a0 => Some(0x683cu16), 0x8389 => Some(0x683du16), 0x83a8 => Some(0x683eu16), 0x83f4 => Some(0x683fu16), 0x8413 => Some(0x6840u16), 0x83eb => Some(0x6841u16), 0x83ce => Some(0x6842u16), 0x83fd => Some(0x6843u16), 0x8403 => Some(0x6844u16), 0x83d8 => Some(0x6845u16), 0x840b => Some(0x6846u16), 0x83c1 => Some(0x6847u16), 0x83f7 => Some(0x6848u16), 0x8407 => Some(0x6849u16), 0x83e0 => Some(0x684au16), 0x83f2 => Some(0x684bu16), 0x840d => Some(0x684cu16), 0x8422 => Some(0x684du16), 0x8420 => Some(0x684eu16), 0x83bd => Some(0x684fu16), 0x8438 => Some(0x6850u16), 0x8506 => Some(0x6851u16), 0x83fb => Some(0x6852u16), 0x846d => Some(0x6853u16), 0x842a => Some(0x6854u16), 0x843c => Some(0x6855u16), 0x855a => Some(0x6856u16), 0x8484 => Some(0x6857u16), 0x8477 => Some(0x6858u16), 0x846b => Some(0x6859u16), 0x84ad => Some(0x685au16), 0x846e => Some(0x685bu16), 0x8482 => Some(0x685cu16), 0x8469 => Some(0x685du16), 0x8446 => Some(0x685eu16), 0x842c => Some(0x685fu16), 0x846f => Some(0x6860u16), 0x8479 => Some(0x6861u16), 0x8435 => Some(0x6862u16), 0x84ca => Some(0x6863u16), 0x8462 => Some(0x6864u16), 0x84b9 => Some(0x6865u16), 0x84bf => Some(0x6866u16), 0x849f => Some(0x6867u16), 0x84d9 => Some(0x6868u16), 0x84cd => Some(0x6869u16), 0x84bb => Some(0x686au16), 0x84da => Some(0x686bu16), 0x84d0 => Some(0x686cu16), 0x84c1 => Some(0x686du16), 0x84c6 => Some(0x686eu16), 0x84d6 => Some(0x686fu16), 0x84a1 => Some(0x6870u16), 0x8521 => Some(0x6871u16), 0x84ff => Some(0x6872u16), 0x84f4 => Some(0x6873u16), 0x8517 => Some(0x6874u16), 0x8518 => Some(0x6875u16), 0x852c => Some(0x6876u16), 0x851f => Some(0x6877u16), 0x8515 => Some(0x6878u16), 0x8514 => Some(0x6879u16), 0x84fc => Some(0x687au16), 0x8540 => Some(0x687bu16), 0x8563 => Some(0x687cu16), 0x8558 => Some(0x687du16), 0x8548 => Some(0x687eu16), 0x8541 => Some(0x6921u16), 0x8602 => Some(0x6922u16), 0x854b => Some(0x6923u16), 0x8555 => Some(0x6924u16), 0x8580 => Some(0x6925u16), 0x85a4 => Some(0x6926u16), 0x8588 => Some(0x6927u16), 0x8591 => Some(0x6928u16), 0x858a => Some(0x6929u16), 0x85a8 => Some(0x692au16), 0x856d => Some(0x692bu16), 0x8594 => Some(0x692cu16), 0x859b => Some(0x692du16), 0x85ea => Some(0x692eu16), 0x8587 => Some(0x692fu16), 0x859c => Some(0x6930u16), 0x8577 => Some(0x6931u16), 0x857e => Some(0x6932u16), 0x8590 => Some(0x6933u16), 0x85c9 => Some(0x6934u16), 0x85ba => Some(0x6935u16), 0x85cf => Some(0x6936u16), 0x85b9 => Some(0x6937u16), 0x85d0 => Some(0x6938u16), 0x85d5 => Some(0x6939u16), 0x85dd => Some(0x693au16), 0x85e5 => Some(0x693bu16), 0x85dc => Some(0x693cu16), 0x85f9 => Some(0x693du16), 0x860a => Some(0x693eu16), 0x8613 => Some(0x693fu16), 0x860b => Some(0x6940u16), 0x85fe => Some(0x6941u16), 0x85fa => Some(0x6942u16), 0x8606 => Some(0x6943u16), 0x8622 => Some(0x6944u16), 0x861a => Some(0x6945u16), 0x8630 => Some(0x6946u16), 0x863f => Some(0x6947u16), 0x864d => Some(0x6948u16), 0x4e55 => Some(0x6949u16), 0x8654 => Some(0x694au16), 0x865f => Some(0x694bu16), 0x8667 => Some(0x694cu16), 0x8671 => Some(0x694du16), 0x8693 => Some(0x694eu16), 0x86a3 => Some(0x694fu16), 0x86a9 => Some(0x6950u16), 0x86aa => Some(0x6951u16), 0x868b => Some(0x6952u16), 0x868c => Some(0x6953u16), 0x86b6 => Some(0x6954u16), 0x86af => Some(0x6955u16), 0x86c4 => Some(0x6956u16), 0x86c6 => Some(0x6957u16), 0x86b0 => Some(0x6958u16), 0x86c9 => Some(0x6959u16), 0x8823 => Some(0x695au16), 0x86ab => Some(0x695bu16), 0x86d4 => Some(0x695cu16), 0x86de => Some(0x695du16), 0x86e9 => Some(0x695eu16), 0x86ec => Some(0x695fu16), 0x86df => Some(0x6960u16), 0x86db => Some(0x6961u16), 0x86ef => Some(0x6962u16), 0x8712 => Some(0x6963u16), 0x8706 => Some(0x6964u16), 0x8708 => Some(0x6965u16), 0x8700 => Some(0x6966u16), 0x8703 => Some(0x6967u16), 0x86fb => Some(0x6968u16), 0x8711 => Some(0x6969u16), 0x8709 => Some(0x696au16), 0x870d => Some(0x696bu16), 0x86f9 => Some(0x696cu16), 0x870a => Some(0x696du16), 0x8734 => Some(0x696eu16), 0x873f => Some(0x696fu16), 0x8737 => Some(0x6970u16), 0x873b => Some(0x6971u16), 0x8725 => Some(0x6972u16), 0x8729 => Some(0x6973u16), 0x871a => Some(0x6974u16), 0x8760 => Some(0x6975u16), 0x875f => Some(0x6976u16), 0x8778 => Some(0x6977u16), 0x874c => Some(0x6978u16), 0x874e => Some(0x6979u16), 0x8774 => Some(0x697au16), 0x8757 => Some(0x697bu16), 0x8768 => Some(0x697cu16), 0x876e => Some(0x697du16), 0x8759 => Some(0x697eu16), 0x8753 => Some(0x6a21u16), 0x8763 => Some(0x6a22u16), 0x876a => Some(0x6a23u16), 0x8805 => Some(0x6a24u16), 0x87a2 => Some(0x6a25u16), 0x879f => Some(0x6a26u16), 0x8782 => Some(0x6a27u16), 0x87af => Some(0x6a28u16), 0x87cb => Some(0x6a29u16), 0x87bd => Some(0x6a2au16), 0x87c0 => Some(0x6a2bu16), 0x87d0 => Some(0x6a2cu16), 0x96d6 => Some(0x6a2du16), 0x87ab => Some(0x6a2eu16), 0x87c4 => Some(0x6a2fu16), 0x87b3 => Some(0x6a30u16), 0x87c7 => Some(0x6a31u16), 0x87c6 => Some(0x6a32u16), 0x87bb => Some(0x6a33u16), 0x87ef => Some(0x6a34u16), 0x87f2 => Some(0x6a35u16), 0x87e0 => Some(0x6a36u16), 0x880f => Some(0x6a37u16), 0x880d => Some(0x6a38u16), 0x87fe => Some(0x6a39u16), 0x87f6 => Some(0x6a3au16), 0x87f7 => Some(0x6a3bu16), 0x880e => Some(0x6a3cu16), 0x87d2 => Some(0x6a3du16), 0x8811 => Some(0x6a3eu16), 0x8816 => Some(0x6a3fu16), 0x8815 => Some(0x6a40u16), 0x8822 => Some(0x6a41u16), 0x8821 => Some(0x6a42u16), 0x8831 => Some(0x6a43u16), 0x8836 => Some(0x6a44u16), 0x8839 => Some(0x6a45u16), 0x8827 => Some(0x6a46u16), 0x883b => Some(0x6a47u16), 0x8844 => Some(0x6a48u16), 0x8842 => Some(0x6a49u16), 0x8852 => Some(0x6a4au16), 0x8859 => Some(0x6a4bu16), 0x885e => Some(0x6a4cu16), 0x8862 => Some(0x6a4du16), 0x886b => Some(0x6a4eu16), 0x8881 => Some(0x6a4fu16), 0x887e => Some(0x6a50u16), 0x889e => Some(0x6a51u16), 0x8875 => Some(0x6a52u16), 0x887d => Some(0x6a53u16), 0x88b5 => Some(0x6a54u16), 0x8872 => Some(0x6a55u16), 0x8882 => Some(0x6a56u16), 0x8897 => Some(0x6a57u16), 0x8892 => Some(0x6a58u16), 0x88ae => Some(0x6a59u16), 0x8899 => Some(0x6a5au16), 0x88a2 => Some(0x6a5bu16), 0x888d => Some(0x6a5cu16), 0x88a4 => Some(0x6a5du16), 0x88b0 => Some(0x6a5eu16), 0x88bf => Some(0x6a5fu16), 0x88b1 => Some(0x6a60u16), 0x88c3 => Some(0x6a61u16), 0x88c4 => Some(0x6a62u16), 0x88d4 => Some(0x6a63u16), 0x88d8 => Some(0x6a64u16), 0x88d9 => Some(0x6a65u16), 0x88dd => Some(0x6a66u16), 0x88f9 => Some(0x6a67u16), 0x8902 => Some(0x6a68u16), 0x88fc => Some(0x6a69u16), 0x88f4 => Some(0x6a6au16), 0x88e8 => Some(0x6a6bu16), 0x88f2 => Some(0x6a6cu16), 0x8904 => Some(0x6a6du16), 0x890c => Some(0x6a6eu16), 0x890a => Some(0x6a6fu16), 0x8913 => Some(0x6a70u16), 0x8943 => Some(0x6a71u16), 0x891e => Some(0x6a72u16), 0x8925 => Some(0x6a73u16), 0x892a => Some(0x6a74u16), 0x892b => Some(0x6a75u16), 0x8941 => Some(0x6a76u16), 0x8944 => Some(0x6a77u16), 0x893b => Some(0x6a78u16), 0x8936 => Some(0x6a79u16), 0x8938 => Some(0x6a7au16), 0x894c => Some(0x6a7bu16), 0x891d => Some(0x6a7cu16), 0x8960 => Some(0x6a7du16), 0x895e => Some(0x6a7eu16), 0x8966 => Some(0x6b21u16), 0x8964 => Some(0x6b22u16), 0x896d => Some(0x6b23u16), 0x896a => Some(0x6b24u16), 0x896f => Some(0x6b25u16), 0x8974 => Some(0x6b26u16), 0x8977 => Some(0x6b27u16), 0x897e => Some(0x6b28u16), 0x8983 => Some(0x6b29u16), 0x8988 => Some(0x6b2au16), 0x898a => Some(0x6b2bu16), 0x8993 => Some(0x6b2cu16), 0x8998 => Some(0x6b2du16), 0x89a1 => Some(0x6b2eu16), 0x89a9 => Some(0x6b2fu16), 0x89a6 => Some(0x6b30u16), 0x89ac => Some(0x6b31u16), 0x89af => Some(0x6b32u16), 0x89b2 => Some(0x6b33u16), 0x89ba => Some(0x6b34u16), 0x89bd => Some(0x6b35u16), 0x89bf => Some(0x6b36u16), 0x89c0 => Some(0x6b37u16), 0x89da => Some(0x6b38u16), 0x89dc => Some(0x6b39u16), 0x89dd => Some(0x6b3au16), 0x89e7 => Some(0x6b3bu16), 0x89f4 => Some(0x6b3cu16), 0x89f8 => Some(0x6b3du16), 0x8a03 => Some(0x6b3eu16), 0x8a16 => Some(0x6b3fu16), 0x8a10 => Some(0x6b40u16), 0x8a0c => Some(0x6b41u16), 0x8a1b => Some(0x6b42u16), 0x8a1d => Some(0x6b43u16), 0x8a25 => Some(0x6b44u16), 0x8a36 => Some(0x6b45u16), 0x8a41 => Some(0x6b46u16), 0x8a5b => Some(0x6b47u16), 0x8a52 => Some(0x6b48u16), 0x8a46 => Some(0x6b49u16), 0x8a48 => Some(0x6b4au16), 0x8a7c => Some(0x6b4bu16), 0x8a6d => Some(0x6b4cu16), 0x8a6c => Some(0x6b4du16), 0x8a62 => Some(0x6b4eu16), 0x8a85 => Some(0x6b4fu16), 0x8a82 => Some(0x6b50u16), 0x8a84 => Some(0x6b51u16), 0x8aa8 => Some(0x6b52u16), 0x8aa1 => Some(0x6b53u16), 0x8a91 => Some(0x6b54u16), 0x8aa5 => Some(0x6b55u16), 0x8aa6 => Some(0x6b56u16), 0x8a9a => Some(0x6b57u16), 0x8aa3 => Some(0x6b58u16), 0x8ac4 => Some(0x6b59u16), 0x8acd => Some(0x6b5au16), 0x8ac2 => Some(0x6b5bu16), 0x8ada => Some(0x6b5cu16), 0x8aeb => Some(0x6b5du16), 0x8af3 => Some(0x6b5eu16), 0x8ae7 => Some(0x6b5fu16), 0x8ae4 => Some(0x6b60u16), 0x8af1 => Some(0x6b61u16), 0x8b14 => Some(0x6b62u16), 0x8ae0 => Some(0x6b63u16), 0x8ae2 => Some(0x6b64u16), 0x8af7 => Some(0x6b65u16), 0x8ade => Some(0x6b66u16), 0x8adb => Some(0x6b67u16), 0x8b0c => Some(0x6b68u16), 0x8b07 => Some(0x6b69u16), 0x8b1a => Some(0x6b6au16), 0x8ae1 => Some(0x6b6bu16), 0x8b16 => Some(0x6b6cu16), 0x8b10 => Some(0x6b6du16), 0x8b17 => Some(0x6b6eu16), 0x8b20 => Some(0x6b6fu16), 0x8b33 => Some(0x6b70u16), 0x97ab => Some(0x6b71u16), 0x8b26 => Some(0x6b72u16), 0x8b2b => Some(0x6b73u16), 0x8b3e => Some(0x6b74u16), 0x8b28 => Some(0x6b75u16), 0x8b41 => Some(0x6b76u16), 0x8b4c => Some(0x6b77u16), 0x8b4f => Some(0x6b78u16), 0x8b4e => Some(0x6b79u16), 0x8b49 => Some(0x6b7au16), 0x8b56 => Some(0x6b7bu16), 0x8b5b => Some(0x6b7cu16), 0x8b5a => Some(0x6b7du16), 0x8b6b => Some(0x6b7eu16), 0x8b5f => Some(0x6c21u16), 0x8b6c => Some(0x6c22u16), 0x8b6f => Some(0x6c23u16), 0x8b74 => Some(0x6c24u16), 0x8b7d => Some(0x6c25u16), 0x8b80 => Some(0x6c26u16), 0x8b8c => Some(0x6c27u16), 0x8b8e => Some(0x6c28u16), 0x8b92 => Some(0x6c29u16), 0x8b93 => Some(0x6c2au16), 0x8b96 => Some(0x6c2bu16), 0x8b99 => Some(0x6c2cu16), 0x8b9a => Some(0x6c2du16), 0x8c3a => Some(0x6c2eu16), 0x8c41 => Some(0x6c2fu16), 0x8c3f => Some(0x6c30u16), 0x8c48 => Some(0x6c31u16), 0x8c4c => Some(0x6c32u16), 0x8c4e => Some(0x6c33u16), 0x8c50 => Some(0x6c34u16), 0x8c55 => Some(0x6c35u16), 0x8c62 => Some(0x6c36u16), 0x8c6c => Some(0x6c37u16), 0x8c78 => Some(0x6c38u16), 0x8c7a => Some(0x6c39u16), 0x8c82 => Some(0x6c3au16), 0x8c89 => Some(0x6c3bu16), 0x8c85 => Some(0x6c3cu16), 0x8c8a => Some(0x6c3du16), 0x8c8d => Some(0x6c3eu16), 0x8c8e => Some(0x6c3fu16), 0x8c94 => Some(0x6c40u16), 0x8c7c => Some(0x6c41u16), 0x8c98 => Some(0x6c42u16), 0x621d => Some(0x6c43u16), 0x8cad => Some(0x6c44u16), 0x8caa => Some(0x6c45u16), 0x8cbd => Some(0x6c46u16), 0x8cb2 => Some(0x6c47u16), 0x8cb3 => Some(0x6c48u16), 0x8cae => Some(0x6c49u16), 0x8cb6 => Some(0x6c4au16), 0x8cc8 => Some(0x6c4bu16), 0x8cc1 => Some(0x6c4cu16), 0x8ce4 => Some(0x6c4du16), 0x8ce3 => Some(0x6c4eu16), 0x8cda => Some(0x6c4fu16), 0x8cfd => Some(0x6c50u16), 0x8cfa => Some(0x6c51u16), 0x8cfb => Some(0x6c52u16), 0x8d04 => Some(0x6c53u16), 0x8d05 => Some(0x6c54u16), 0x8d0a => Some(0x6c55u16), 0x8d07 => Some(0x6c56u16), 0x8d0f => Some(0x6c57u16), 0x8d0d => Some(0x6c58u16), 0x8d10 => Some(0x6c59u16), 0x9f4e => Some(0x6c5au16), 0x8d13 => Some(0x6c5bu16), 0x8ccd => Some(0x6c5cu16), 0x8d14 => Some(0x6c5du16), 0x8d16 => Some(0x6c5eu16), 0x8d67 => Some(0x6c5fu16), 0x8d6d => Some(0x6c60u16), 0x8d71 => Some(0x6c61u16), 0x8d73 => Some(0x6c62u16), 0x8d81 => Some(0x6c63u16), 0x8d99 => Some(0x6c64u16), 0x8dc2 => Some(0x6c65u16), 0x8dbe => Some(0x6c66u16), 0x8dba => Some(0x6c67u16), 0x8dcf => Some(0x6c68u16), 0x8dda => Some(0x6c69u16), 0x8dd6 => Some(0x6c6au16), 0x8dcc => Some(0x6c6bu16), 0x8ddb => Some(0x6c6cu16), 0x8dcb => Some(0x6c6du16), 0x8dea => Some(0x6c6eu16), 0x8deb => Some(0x6c6fu16), 0x8ddf => Some(0x6c70u16), 0x8de3 => Some(0x6c71u16), 0x8dfc => Some(0x6c72u16), 0x8e08 => Some(0x6c73u16), 0x8e09 => Some(0x6c74u16), 0x8dff => Some(0x6c75u16), 0x8e1d => Some(0x6c76u16), 0x8e1e => Some(0x6c77u16), 0x8e10 => Some(0x6c78u16), 0x8e1f => Some(0x6c79u16), 0x8e42 => Some(0x6c7au16), 0x8e35 => Some(0x6c7bu16), 0x8e30 => Some(0x6c7cu16), 0x8e34 => Some(0x6c7du16), 0x8e4a => Some(0x6c7eu16), 0x8e47 => Some(0x6d21u16), 0x8e49 => Some(0x6d22u16), 0x8e4c => Some(0x6d23u16), 0x8e50 => Some(0x6d24u16), 0x8e48 => Some(0x6d25u16), 0x8e59 => Some(0x6d26u16), 0x8e64 => Some(0x6d27u16), 0x8e60 => Some(0x6d28u16), 0x8e2a => Some(0x6d29u16), 0x8e63 => Some(0x6d2au16), 0x8e55 => Some(0x6d2bu16), 0x8e76 => Some(0x6d2cu16), 0x8e72 => Some(0x6d2du16), 0x8e7c => Some(0x6d2eu16), 0x8e81 => Some(0x6d2fu16), 0x8e87 => Some(0x6d30u16), 0x8e85 => Some(0x6d31u16), 0x8e84 => Some(0x6d32u16), 0x8e8b => Some(0x6d33u16), 0x8e8a => Some(0x6d34u16), 0x8e93 => Some(0x6d35u16), 0x8e91 => Some(0x6d36u16), 0x8e94 => Some(0x6d37u16), 0x8e99 => Some(0x6d38u16), 0x8eaa => Some(0x6d39u16), 0x8ea1 => Some(0x6d3au16), 0x8eac => Some(0x6d3bu16), 0x8eb0 => Some(0x6d3cu16), 0x8ec6 => Some(0x6d3du16), 0x8eb1 => Some(0x6d3eu16), 0x8ebe => Some(0x6d3fu16), 0x8ec5 => Some(0x6d40u16), 0x8ec8 => Some(0x6d41u16), 0x8ecb => Some(0x6d42u16), 0x8edb => Some(0x6d43u16), 0x8ee3 => Some(0x6d44u16), 0x8efc => Some(0x6d45u16), 0x8efb => Some(0x6d46u16), 0x8eeb => Some(0x6d47u16), 0x8efe => Some(0x6d48u16), 0x8f0a => Some(0x6d49u16), 0x8f05 => Some(0x6d4au16), 0x8f15 => Some(0x6d4bu16), 0x8f12 => Some(0x6d4cu16), 0x8f19 => Some(0x6d4du16), 0x8f13 => Some(0x6d4eu16), 0x8f1c => Some(0x6d4fu16), 0x8f1f => Some(0x6d50u16), 0x8f1b => Some(0x6d51u16), 0x8f0c => Some(0x6d52u16), 0x8f26 => Some(0x6d53u16), 0x8f33 => Some(0x6d54u16), 0x8f3b => Some(0x6d55u16), 0x8f39 => Some(0x6d56u16), 0x8f45 => Some(0x6d57u16), 0x8f42 => Some(0x6d58u16), 0x8f3e => Some(0x6d59u16), 0x8f4c => Some(0x6d5au16), 0x8f49 => Some(0x6d5bu16), 0x8f46 => Some(0x6d5cu16), 0x8f4e => Some(0x6d5du16), 0x8f57 => Some(0x6d5eu16), 0x8f5c => Some(0x6d5fu16), 0x8f62 => Some(0x6d60u16), 0x8f63 => Some(0x6d61u16), 0x8f64 => Some(0x6d62u16), 0x8f9c => Some(0x6d63u16), 0x8f9f => Some(0x6d64u16), 0x8fa3 => Some(0x6d65u16), 0x8fad => Some(0x6d66u16), 0x8faf => Some(0x6d67u16), 0x8fb7 => Some(0x6d68u16), 0x8fda => Some(0x6d69u16), 0x8fe5 => Some(0x6d6au16), 0x8fe2 => Some(0x6d6bu16), 0x8fea => Some(0x6d6cu16), 0x8fef => Some(0x6d6du16), 0x9087 => Some(0x6d6eu16), 0x8ff4 => Some(0x6d6fu16), 0x9005 => Some(0x6d70u16), 0x8ff9 => Some(0x6d71u16), 0x8ffa => Some(0x6d72u16), 0x9011 => Some(0x6d73u16), 0x9015 => Some(0x6d74u16), 0x9021 => Some(0x6d75u16), 0x900d => Some(0x6d76u16), 0x901e => Some(0x6d77u16), 0x9016 => Some(0x6d78u16), 0x900b => Some(0x6d79u16), 0x9027 => Some(0x6d7au16), 0x9036 => Some(0x6d7bu16), 0x9035 => Some(0x6d7cu16), 0x9039 => Some(0x6d7du16), 0x8ff8 => Some(0x6d7eu16), 0x904f => Some(0x6e21u16), 0x9050 => Some(0x6e22u16), 0x9051 => Some(0x6e23u16), 0x9052 => Some(0x6e24u16), 0x900e => Some(0x6e25u16), 0x9049 => Some(0x6e26u16), 0x903e => Some(0x6e27u16), 0x9056 => Some(0x6e28u16), 0x9058 => Some(0x6e29u16), 0x905e => Some(0x6e2au16), 0x9068 => Some(0x6e2bu16), 0x906f => Some(0x6e2cu16), 0x9076 => Some(0x6e2du16), 0x96a8 => Some(0x6e2eu16), 0x9072 => Some(0x6e2fu16), 0x9082 => Some(0x6e30u16), 0x907d => Some(0x6e31u16), 0x9081 => Some(0x6e32u16), 0x9080 => Some(0x6e33u16), 0x908a => Some(0x6e34u16), 0x9089 => Some(0x6e35u16), 0x908f => Some(0x6e36u16), 0x90a8 => Some(0x6e37u16), 0x90af => Some(0x6e38u16), 0x90b1 => Some(0x6e39u16), 0x90b5 => Some(0x6e3au16), 0x90e2 => Some(0x6e3bu16), 0x90e4 => Some(0x6e3cu16), 0x6248 => Some(0x6e3du16), 0x90db => Some(0x6e3eu16), 0x9102 => Some(0x6e3fu16), 0x9112 => Some(0x6e40u16), 0x9119 => Some(0x6e41u16), 0x9132 => Some(0x6e42u16), 0x9130 => Some(0x6e43u16), 0x914a => Some(0x6e44u16), 0x9156 => Some(0x6e45u16), 0x9158 => Some(0x6e46u16), 0x9163 => Some(0x6e47u16), 0x9165 => Some(0x6e48u16), 0x9169 => Some(0x6e49u16), 0x9173 => Some(0x6e4au16), 0x9172 => Some(0x6e4bu16), 0x918b => Some(0x6e4cu16), 0x9189 => Some(0x6e4du16), 0x9182 => Some(0x6e4eu16), 0x91a2 => Some(0x6e4fu16), 0x91ab => Some(0x6e50u16), 0x91af => Some(0x6e51u16), 0x91aa => Some(0x6e52u16), 0x91b5 => Some(0x6e53u16), 0x91b4 => Some(0x6e54u16), 0x91ba => Some(0x6e55u16), 0x91c0 => Some(0x6e56u16), 0x91c1 => Some(0x6e57u16), 0x91c9 => Some(0x6e58u16), 0x91cb => Some(0x6e59u16), 0x91d0 => Some(0x6e5au16), 0x91d6 => Some(0x6e5bu16), 0x91df => Some(0x6e5cu16), 0x91e1 => Some(0x6e5du16), 0x91db => Some(0x6e5eu16), 0x91fc => Some(0x6e5fu16), 0x91f5 => Some(0x6e60u16), 0x91f6 => Some(0x6e61u16), 0x921e => Some(0x6e62u16), 0x91ff => Some(0x6e63u16), 0x9214 => Some(0x6e64u16), 0x922c => Some(0x6e65u16), 0x9215 => Some(0x6e66u16), 0x9211 => Some(0x6e67u16), 0x925e => Some(0x6e68u16), 0x9257 => Some(0x6e69u16), 0x9245 => Some(0x6e6au16), 0x9249 => Some(0x6e6bu16), 0x9264 => Some(0x6e6cu16), 0x9248 => Some(0x6e6du16), 0x9295 => Some(0x6e6eu16), 0x923f => Some(0x6e6fu16), 0x924b => Some(0x6e70u16), 0x9250 => Some(0x6e71u16), 0x929c => Some(0x6e72u16), 0x9296 => Some(0x6e73u16), 0x9293 => Some(0x6e74u16), 0x929b => Some(0x6e75u16), 0x925a => Some(0x6e76u16), 0x92cf => Some(0x6e77u16), 0x92b9 => Some(0x6e78u16), 0x92b7 => Some(0x6e79u16), 0x92e9 => Some(0x6e7au16), 0x930f => Some(0x6e7bu16), 0x92fa => Some(0x6e7cu16), 0x9344 => Some(0x6e7du16), 0x932e => Some(0x6e7eu16), 0x9319 => Some(0x6f21u16), 0x9322 => Some(0x6f22u16), 0x931a => Some(0x6f23u16), 0x9323 => Some(0x6f24u16), 0x933a => Some(0x6f25u16), 0x9335 => Some(0x6f26u16), 0x933b => Some(0x6f27u16), 0x935c => Some(0x6f28u16), 0x9360 => Some(0x6f29u16), 0x937c => Some(0x6f2au16), 0x936e => Some(0x6f2bu16), 0x9356 => Some(0x6f2cu16), 0x93b0 => Some(0x6f2du16), 0x93ac => Some(0x6f2eu16), 0x93ad => Some(0x6f2fu16), 0x9394 => Some(0x6f30u16), 0x93b9 => Some(0x6f31u16), 0x93d6 => Some(0x6f32u16), 0x93d7 => Some(0x6f33u16), 0x93e8 => Some(0x6f34u16), 0x93e5 => Some(0x6f35u16), 0x93d8 => Some(0x6f36u16), 0x93c3 => Some(0x6f37u16), 0x93dd => Some(0x6f38u16), 0x93d0 => Some(0x6f39u16), 0x93c8 => Some(0x6f3au16), 0x93e4 => Some(0x6f3bu16), 0x941a => Some(0x6f3cu16), 0x9414 => Some(0x6f3du16), 0x9413 => Some(0x6f3eu16), 0x9403 => Some(0x6f3fu16), 0x9407 => Some(0x6f40u16), 0x9410 => Some(0x6f41u16), 0x9436 => Some(0x6f42u16), 0x942b => Some(0x6f43u16), 0x9435 => Some(0x6f44u16), 0x9421 => Some(0x6f45u16), 0x943a => Some(0x6f46u16), 0x9441 => Some(0x6f47u16), 0x9452 => Some(0x6f48u16), 0x9444 => Some(0x6f49u16), 0x945b => Some(0x6f4au16), 0x9460 => Some(0x6f4bu16), 0x9462 => Some(0x6f4cu16), 0x945e => Some(0x6f4du16), 0x946a => Some(0x6f4eu16), 0x9229 => Some(0x6f4fu16), 0x9470 => Some(0x6f50u16), 0x9475 => Some(0x6f51u16), 0x9477 => Some(0x6f52u16), 0x947d => Some(0x6f53u16), 0x945a => Some(0x6f54u16), 0x947c => Some(0x6f55u16), 0x947e => Some(0x6f56u16), 0x9481 => Some(0x6f57u16), 0x947f => Some(0x6f58u16), 0x9582 => Some(0x6f59u16), 0x9587 => Some(0x6f5au16), 0x958a => Some(0x6f5bu16), 0x9594 => Some(0x6f5cu16), 0x9596 => Some(0x6f5du16), 0x9598 => Some(0x6f5eu16), 0x9599 => Some(0x6f5fu16), 0x95a0 => Some(0x6f60u16), 0x95a8 => Some(0x6f61u16), 0x95a7 => Some(0x6f62u16), 0x95ad => Some(0x6f63u16), 0x95bc => Some(0x6f64u16), 0x95bb => Some(0x6f65u16), 0x95b9 => Some(0x6f66u16), 0x95be => Some(0x6f67u16), 0x95ca => Some(0x6f68u16), 0x6ff6 => Some(0x6f69u16), 0x95c3 => Some(0x6f6au16), 0x95cd => Some(0x6f6bu16), 0x95cc => Some(0x6f6cu16), 0x95d5 => Some(0x6f6du16), 0x95d4 => Some(0x6f6eu16), 0x95d6 => Some(0x6f6fu16), 0x95dc => Some(0x6f70u16), 0x95e1 => Some(0x6f71u16), 0x95e5 => Some(0x6f72u16), 0x95e2 => Some(0x6f73u16), 0x9621 => Some(0x6f74u16), 0x9628 => Some(0x6f75u16), 0x962e => Some(0x6f76u16), 0x962f => Some(0x6f77u16), 0x9642 => Some(0x6f78u16), 0x964c => Some(0x6f79u16), 0x964f => Some(0x6f7au16), 0x964b => Some(0x6f7bu16), 0x9677 => Some(0x6f7cu16), 0x965c => Some(0x6f7du16), 0x965e => Some(0x6f7eu16), 0x965d => Some(0x7021u16), 0x965f => Some(0x7022u16), 0x9666 => Some(0x7023u16), 0x9672 => Some(0x7024u16), 0x966c => Some(0x7025u16), 0x968d => Some(0x7026u16), 0x9698 => Some(0x7027u16), 0x9695 => Some(0x7028u16), 0x9697 => Some(0x7029u16), 0x96aa => Some(0x702au16), 0x96a7 => Some(0x702bu16), 0x96b1 => Some(0x702cu16), 0x96b2 => Some(0x702du16), 0x96b0 => Some(0x702eu16), 0x96b4 => Some(0x702fu16), 0x96b6 => Some(0x7030u16), 0x96b8 => Some(0x7031u16), 0x96b9 => Some(0x7032u16), 0x96ce => Some(0x7033u16), 0x96cb => Some(0x7034u16), 0x96c9 => Some(0x7035u16), 0x96cd => Some(0x7036u16), 0x894d => Some(0x7037u16), 0x96dc => Some(0x7038u16), 0x970d => Some(0x7039u16), 0x96d5 => Some(0x703au16), 0x96f9 => Some(0x703bu16), 0x9704 => Some(0x703cu16), 0x9706 => Some(0x703du16), 0x9708 => Some(0x703eu16), 0x9713 => Some(0x703fu16), 0x970e => Some(0x7040u16), 0x9711 => Some(0x7041u16), 0x970f => Some(0x7042u16), 0x9716 => Some(0x7043u16), 0x9719 => Some(0x7044u16), 0x9724 => Some(0x7045u16), 0x972a => Some(0x7046u16), 0x9730 => Some(0x7047u16), 0x9739 => Some(0x7048u16), 0x973d => Some(0x7049u16), 0x973e => Some(0x704au16), 0x9744 => Some(0x704bu16), 0x9746 => Some(0x704cu16), 0x9748 => Some(0x704du16), 0x9742 => Some(0x704eu16), 0x9749 => Some(0x704fu16), 0x975c => Some(0x7050u16), 0x9760 => Some(0x7051u16), 0x9764 => Some(0x7052u16), 0x9766 => Some(0x7053u16), 0x9768 => Some(0x7054u16), 0x52d2 => Some(0x7055u16), 0x976b => Some(0x7056u16), 0x9771 => Some(0x7057u16), 0x9779 => Some(0x7058u16), 0x9785 => Some(0x7059u16), 0x977c => Some(0x705au16), 0x9781 => Some(0x705bu16), 0x977a => Some(0x705cu16), 0x9786 => Some(0x705du16), 0x978b => Some(0x705eu16), 0x978f => Some(0x705fu16), 0x9790 => Some(0x7060u16), 0x979c => Some(0x7061u16), 0x97a8 => Some(0x7062u16), 0x97a6 => Some(0x7063u16), 0x97a3 => Some(0x7064u16), 0x97b3 => Some(0x7065u16), 0x97b4 => Some(0x7066u16), 0x97c3 => Some(0x7067u16), 0x97c6 => Some(0x7068u16), 0x97c8 => Some(0x7069u16), 0x97cb => Some(0x706au16), 0x97dc => Some(0x706bu16), 0x97ed => Some(0x706cu16), 0x9f4f => Some(0x706du16), 0x97f2 => Some(0x706eu16), 0x7adf => Some(0x706fu16), 0x97f6 => Some(0x7070u16), 0x97f5 => Some(0x7071u16), 0x980f => Some(0x7072u16), 0x980c => Some(0x7073u16), 0x9838 => Some(0x7074u16), 0x9824 => Some(0x7075u16), 0x9821 => Some(0x7076u16), 0x9837 => Some(0x7077u16), 0x983d => Some(0x7078u16), 0x9846 => Some(0x7079u16), 0x984f => Some(0x707au16), 0x984b => Some(0x707bu16), 0x986b => Some(0x707cu16), 0x986f => Some(0x707du16), 0x9870 => Some(0x707eu16), 0x9871 => Some(0x7121u16), 0x9874 => Some(0x7122u16), 0x9873 => Some(0x7123u16), 0x98aa => Some(0x7124u16), 0x98af => Some(0x7125u16), 0x98b1 => Some(0x7126u16), 0x98b6 => Some(0x7127u16), 0x98c4 => Some(0x7128u16), 0x98c3 => Some(0x7129u16), 0x98c6 => Some(0x712au16), 0x98e9 => Some(0x712bu16), 0x98eb => Some(0x712cu16), 0x9903 => Some(0x712du16), 0x9909 => Some(0x712eu16), 0x9912 => Some(0x712fu16), 0x9914 => Some(0x7130u16), 0x9918 => Some(0x7131u16), 0x9921 => Some(0x7132u16), 0x991d => Some(0x7133u16), 0x991e => Some(0x7134u16), 0x9924 => Some(0x7135u16), 0x9920 => Some(0x7136u16), 0x992c => Some(0x7137u16), 0x992e => Some(0x7138u16), 0x993d => Some(0x7139u16), 0x993e => Some(0x713au16), 0x9942 => Some(0x713bu16), 0x9949 => Some(0x713cu16), 0x9945 => Some(0x713du16), 0x9950 => Some(0x713eu16), 0x994b => Some(0x713fu16), 0x9951 => Some(0x7140u16), 0x9952 => Some(0x7141u16), 0x994c => Some(0x7142u16), 0x9955 => Some(0x7143u16), 0x9997 => Some(0x7144u16), 0x9998 => Some(0x7145u16), 0x99a5 => Some(0x7146u16), 0x99ad => Some(0x7147u16), 0x99ae => Some(0x7148u16), 0x99bc => Some(0x7149u16), 0x99df => Some(0x714au16), 0x99db => Some(0x714bu16), 0x99dd => Some(0x714cu16), 0x99d8 => Some(0x714du16), 0x99d1 => Some(0x714eu16), 0x99ed => Some(0x714fu16), 0x99ee => Some(0x7150u16), 0x99f1 => Some(0x7151u16), 0x99f2 => Some(0x7152u16), 0x99fb => Some(0x7153u16), 0x99f8 => Some(0x7154u16), 0x9a01 => Some(0x7155u16), 0x9a0f => Some(0x7156u16), 0x9a05 => Some(0x7157u16), 0x99e2 => Some(0x7158u16), 0x9a19 => Some(0x7159u16), 0x9a2b => Some(0x715au16), 0x9a37 => Some(0x715bu16), 0x9a45 => Some(0x715cu16), 0x9a42 => Some(0x715du16), 0x9a40 => Some(0x715eu16), 0x9a43 => Some(0x715fu16), 0x9a3e => Some(0x7160u16), 0x9a55 => Some(0x7161u16), 0x9a4d => Some(0x7162u16), 0x9a5b => Some(0x7163u16), 0x9a57 => Some(0x7164u16), 0x9a5f => Some(0x7165u16), 0x9a62 => Some(0x7166u16), 0x9a65 => Some(0x7167u16), 0x9a64 => Some(0x7168u16), 0x9a69 => Some(0x7169u16), 0x9a6b => Some(0x716au16), 0x9a6a => Some(0x716bu16), 0x9aad => Some(0x716cu16), 0x9ab0 => Some(0x716du16), 0x9abc => Some(0x716eu16), 0x9ac0 => Some(0x716fu16), 0x9acf => Some(0x7170u16), 0x9ad1 => Some(0x7171u16), 0x9ad3 => Some(0x7172u16), 0x9ad4 => Some(0x7173u16), 0x9ade => Some(0x7174u16), 0x9adf => Some(0x7175u16), 0x9ae2 => Some(0x7176u16), 0x9ae3 => Some(0x7177u16), 0x9ae6 => Some(0x7178u16), 0x9aef => Some(0x7179u16), 0x9aeb => Some(0x717au16), 0x9aee => Some(0x717bu16), 0x9af4 => Some(0x717cu16), 0x9af1 => Some(0x717du16), 0x9af7 => Some(0x717eu16), 0x9afb => Some(0x7221u16), 0x9b06 => Some(0x7222u16), 0x9b18 => Some(0x7223u16), 0x9b1a => Some(0x7224u16), 0x9b1f => Some(0x7225u16), 0x9b22 => Some(0x7226u16), 0x9b23 => Some(0x7227u16), 0x9b25 => Some(0x7228u16), 0x9b27 => Some(0x7229u16), 0x9b28 => Some(0x722au16), 0x9b29 => Some(0x722bu16), 0x9b2a => Some(0x722cu16), 0x9b2e => Some(0x722du16), 0x9b2f => Some(0x722eu16), 0x9b32 => Some(0x722fu16), 0x9b44 => Some(0x7230u16), 0x9b43 => Some(0x7231u16), 0x9b4f => Some(0x7232u16), 0x9b4d => Some(0x7233u16), 0x9b4e => Some(0x7234u16), 0x9b51 => Some(0x7235u16), 0x9b58 => Some(0x7236u16), 0x9b74 => Some(0x7237u16), 0x9b93 => Some(0x7238u16), 0x9b83 => Some(0x7239u16), 0x9b91 => Some(0x723au16), 0x9b96 => Some(0x723bu16), 0x9b97 => Some(0x723cu16), 0x9b9f => Some(0x723du16), 0x9ba0 => Some(0x723eu16), 0x9ba8 => Some(0x723fu16), 0x9bb4 => Some(0x7240u16), 0x9bc0 => Some(0x7241u16), 0x9bca => Some(0x7242u16), 0x9bb9 => Some(0x7243u16), 0x9bc6 => Some(0x7244u16), 0x9bcf => Some(0x7245u16), 0x9bd1 => Some(0x7246u16), 0x9bd2 => Some(0x7247u16), 0x9be3 => Some(0x7248u16), 0x9be2 => Some(0x7249u16), 0x9be4 => Some(0x724au16), 0x9bd4 => Some(0x724bu16), 0x9be1 => Some(0x724cu16), 0x9c3a => Some(0x724du16), 0x9bf2 => Some(0x724eu16), 0x9bf1 => Some(0x724fu16), 0x9bf0 => Some(0x7250u16), 0x9c15 => Some(0x7251u16), 0x9c14 => Some(0x7252u16), 0x9c09 => Some(0x7253u16), 0x9c13 => Some(0x7254u16), 0x9c0c => Some(0x7255u16), 0x9c06 => Some(0x7256u16), 0x9c08 => Some(0x7257u16), 0x9c12 => Some(0x7258u16), 0x9c0a => Some(0x7259u16), 0x9c04 => Some(0x725au16), 0x9c2e => Some(0x725bu16), 0x9c1b => Some(0x725cu16), 0x9c25 => Some(0x725du16), 0x9c24 => Some(0x725eu16), 0x9c21 => Some(0x725fu16), 0x9c30 => Some(0x7260u16), 0x9c47 => Some(0x7261u16), 0x9c32 => Some(0x7262u16), 0x9c46 => Some(0x7263u16), 0x9c3e => Some(0x7264u16), 0x9c5a => Some(0x7265u16), 0x9c60 => Some(0x7266u16), 0x9c67 => Some(0x7267u16), 0x9c76 => Some(0x7268u16), 0x9c78 => Some(0x7269u16), 0x9ce7 => Some(0x726au16), 0x9cec => Some(0x726bu16), 0x9cf0 => Some(0x726cu16), 0x9d09 => Some(0x726du16), 0x9d08 => Some(0x726eu16), 0x9ceb => Some(0x726fu16), 0x9d03 => Some(0x7270u16), 0x9d06 => Some(0x7271u16), 0x9d2a => Some(0x7272u16), 0x9d26 => Some(0x7273u16), 0x9daf => Some(0x7274u16), 0x9d23 => Some(0x7275u16), 0x9d1f => Some(0x7276u16), 0x9d44 => Some(0x7277u16), 0x9d15 => Some(0x7278u16), 0x9d12 => Some(0x7279u16), 0x9d41 => Some(0x727au16), 0x9d3f => Some(0x727bu16), 0x9d3e => Some(0x727cu16), 0x9d46 => Some(0x727du16), 0x9d48 => Some(0x727eu16), 0x9d5d => Some(0x7321u16), 0x9d5e => Some(0x7322u16), 0x9d64 => Some(0x7323u16), 0x9d51 => Some(0x7324u16), 0x9d50 => Some(0x7325u16), 0x9d59 => Some(0x7326u16), 0x9d72 => Some(0x7327u16), 0x9d89 => Some(0x7328u16), 0x9d87 => Some(0x7329u16), 0x9dab => Some(0x732au16), 0x9d6f => Some(0x732bu16), 0x9d7a => Some(0x732cu16), 0x9d9a => Some(0x732du16), 0x9da4 => Some(0x732eu16), 0x9da9 => Some(0x732fu16), 0x9db2 => Some(0x7330u16), 0x9dc4 => Some(0x7331u16), 0x9dc1 => Some(0x7332u16), 0x9dbb => Some(0x7333u16), 0x9db8 => Some(0x7334u16), 0x9dba => Some(0x7335u16), 0x9dc6 => Some(0x7336u16), 0x9dcf => Some(0x7337u16), 0x9dc2 => Some(0x7338u16), 0x9dd9 => Some(0x7339u16), 0x9dd3 => Some(0x733au16), 0x9df8 => Some(0x733bu16), 0x9de6 => Some(0x733cu16), 0x9ded => Some(0x733du16), 0x9def => Some(0x733eu16), 0x9dfd => Some(0x733fu16), 0x9e1a => Some(0x7340u16), 0x9e1b => Some(0x7341u16), 0x9e1e => Some(0x7342u16), 0x9e75 => Some(0x7343u16), 0x9e79 => Some(0x7344u16), 0x9e7d => Some(0x7345u16), 0x9e81 => Some(0x7346u16), 0x9e88 => Some(0x7347u16), 0x9e8b => Some(0x7348u16), 0x9e8c => Some(0x7349u16), 0x9e92 => Some(0x734au16), 0x9e95 => Some(0x734bu16), 0x9e91 => Some(0x734cu16), 0x9e9d => Some(0x734du16), 0x9ea5 => Some(0x734eu16), 0x9ea9 => Some(0x734fu16), 0x9eb8 => Some(0x7350u16), 0x9eaa => Some(0x7351u16), 0x9ead => Some(0x7352u16), 0x9761 => Some(0x7353u16), 0x9ecc => Some(0x7354u16), 0x9ece => Some(0x7355u16), 0x9ecf => Some(0x7356u16), 0x9ed0 => Some(0x7357u16), 0x9ed4 => Some(0x7358u16), 0x9edc => Some(0x7359u16), 0x9ede => Some(0x735au16), 0x9edd => Some(0x735bu16), 0x9ee0 => Some(0x735cu16), 0x9ee5 => Some(0x735du16), 0x9ee8 => Some(0x735eu16), 0x9eef => Some(0x735fu16), 0x9ef4 => Some(0x7360u16), 0x9ef6 => Some(0x7361u16), 0x9ef7 => Some(0x7362u16), 0x9ef9 => Some(0x7363u16), 0x9efb => Some(0x7364u16), 0x9efc => Some(0x7365u16), 0x9efd => Some(0x7366u16), 0x9f07 => Some(0x7367u16), 0x9f08 => Some(0x7368u16), 0x76b7 => Some(0x7369u16), 0x9f15 => Some(0x736au16), 0x9f21 => Some(0x736bu16), 0x9f2c => Some(0x736cu16), 0x9f3e => Some(0x736du16), 0x9f4a => Some(0x736eu16), 0x9f52 => Some(0x736fu16), 0x9f54 => Some(0x7370u16), 0x9f63 => Some(0x7371u16), 0x9f5f => Some(0x7372u16), 0x9f60 => Some(0x7373u16), 0x9f61 => Some(0x7374u16), 0x9f66 => Some(0x7375u16), 0x9f67 => Some(0x7376u16), 0x9f6c => Some(0x7377u16), 0x9f6a => Some(0x7378u16), 0x9f77 => Some(0x7379u16), 0x9f72 => Some(0x737au16), 0x9f76 => Some(0x737bu16), 0x9f95 => Some(0x737cu16), 0x9f9c => Some(0x737du16), 0x9fa0 => Some(0x737eu16), 0x582f => Some(0x7421u16), 0x69c7 => Some(0x7422u16), 0x9059 => Some(0x7423u16), 0x7464 => Some(0x7424u16), 0x51dc => Some(0x7425u16), 0x7199 => Some(0x7426u16), _ => None } }
true
f45cd9dc0b809274b04f98d6b9d6b9b669dd68b3
Rust
kjagiello/pacgen
/src/server.rs
UTF-8
2,028
2.609375
3
[ "MIT" ]
permissive
use chrono; use log::{error, info}; use std::net::SocketAddr; use std::sync::Arc; use hyper::server::conn::AddrStream; use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Error, Method, Request, Response, Server, StatusCode}; pub struct Config { pub addr: SocketAddr, pub pac: String, } struct Context { pub pac: String, } fn log_request<T, U>(remote_addr: &SocketAddr, req: &Request<T>, response: &Response<U>) { info!( "{} [{}] \"{} {} {:?}\" {}", remote_addr.ip(), chrono::offset::Local::now(), req.method(), req.uri(), req.version(), response.status().as_u16(), ); } #[tokio::main] pub async fn serve(config: Config) { let ctx = Arc::new(Context { pac: config.pac.trim_end().to_owned(), }); let make_service = make_service_fn(move |conn: &AddrStream| { let ctx = ctx.clone(); let remote_addr = conn.remote_addr(); async move { Ok::<_, Error>(service_fn(move |req| { let ctx = ctx.clone(); async move { let res = match *req.method() { Method::GET => Response::builder() .header("Content-Type", "application/x-ns-proxy-autoconfig") .body(Body::from(ctx.pac.clone())) .unwrap(), _ => Response::builder() .status(StatusCode::METHOD_NOT_ALLOWED) .body(Body::empty()) .unwrap(), }; log_request(&remote_addr, &req, &res); Ok::<_, Error>(res) } })) } }); info!("Starting PAC server at http://{}", config.addr); let server = Server::bind(&config.addr).serve(make_service); info!("Quit the server with CTRL-C"); if let Err(e) = server.await { error!("Server error: {}", e); } }
true
a1bb97a991cd7e6be1ea6280df694532b44b0ce9
Rust
tungli/lsode-rust
/tests/solve_ode.rs
UTF-8
2,172
2.90625
3
[ "LicenseRef-scancode-public-domain" ]
permissive
extern crate lsode; // To run tests, use --test-threads=1. Multiple threads cause trouble (reason is unknown to me). fn solution_stiff(t: f64) -> [f64; 2] { [ 2.0*(-t).exp() - (-(1000.0*t)).exp(), -((-t).exp()) + (-(1000.0*t)).exp() ] } fn rhs_stiff(y: &[f64], _t: &f64) -> Vec<f64> { let mut dy = vec![0.0, 0.0]; dy[0] = 998.0*y[0] + 1998.0*y[1]; dy[1] = -999.0*y[0] - 1999.0*y[1]; dy } #[test] fn stiff() { let y0 = [1.0, 0.0]; let ts: Vec<f64> = (0..10).map(|i| 0.1*i as f64).collect(); let atol = 1e-6; let rtol = 1e-8; let sol = lsode::solve_ode(rhs_stiff, &y0, ts.clone(), atol, rtol); for (analytical, calculated) in ts.iter().map(|x| solution_stiff(*x)).zip(sol) { assert!((analytical[0] - calculated[0]).abs() < 1e-3, "|{} - {}| calculated and expected results are suspiciously different", analytical[0], calculated[0]); assert!((analytical[1] - calculated[1]).abs() < 1e-3, "|{} - {}| calculated and expected results are suspiciously different", analytical[1], calculated[1]); } } fn solution_decay(t: f64) -> [f64; 1] { [ 1000.0*(-t).exp(), ] } fn rhs_decay(y: &[f64], _t: &f64) -> Vec<f64> { let mut dy = vec![0.0,]; dy[0] = -y[0]; dy } #[test] fn decay() { let y0 = [1000.0,]; let ts: Vec<f64> = (0..7).map(|i| 1.0*i as f64).collect(); let atol = 1e-6; let rtol = 1e-8; let sol = lsode::solve_ode(rhs_decay, &y0, ts.clone(), atol, rtol); println!("{:?}", sol); for (analytical, calculated) in ts.iter().map(|x| solution_decay(*x)).zip(sol) { assert!((analytical[0] - calculated[0]).abs() < 1e-3, "|{} - {}| calculated and expected results are suspiciously different", analytical[0], calculated[0]); } } #[test] fn closure_rhs() { let y0 = [1.0]; let ts = vec![0.0, 1.0]; let f = |y: &[f64], t: &f64| { let mut dy = vec![0.0]; dy[0] = *t * y[0]; dy }; let sol = lsode::solve_ode(f, &y0, ts, 1e-6, 1e-6); println!("{:?}", sol); assert!((sol[1][0] - y0[0]*0.5_f64.exp()).abs() < 1e-3, "error too large"); }
true
346a5f9631c3c6e7c79f3a0feab451338ed4cbf2
Rust
simsarulhaqv/WorksOnRust
/Rustworkshop/src/part06.rs
UTF-8
281
3.3125
3
[]
no_license
// Strings are unicode unlike ascii in C/C++ fn print_me_2(s: String) { println!("I am {}",s); } pub fn print_me(s:&str) { println!("I am {}", s); } pub fn main() { println!("hello world"); let f = "simsar"; print_me(&f); let f = "SIMSAR"; print_me_2(f.to_string()); }
true
71c0d672e2d0708f32eae8f597d791203adec27a
Rust
isgasho/log-derive
/src/lib.rs
UTF-8
9,046
2.984375
3
[ "MIT", "Apache-2.0" ]
permissive
#![recursion_limit = "128"] //! # Log Derive //! //! `log-derive` provides a simple attribute macro that facilitates logs as part of the [`log`] facade <br> //! Right now the only macro is [`logfn`], this macro is only for functions but it still have a lot of power. //! //! //! # Use //! The basic use of the macro is by putting it on top of the function like this: `#[logfn(INFO)]` <br> //! The return type of the function **must** implement Debug in order for this to work. <br> //! The macro will accept all log levels provided by the [`log`] facade. <br> //! If the function return a [`Result`] type the macro will accept the following additional attributes: //! `(ok = "LEVEL")` and `(err = "LEVEL")` this can provide different log levels if the function failed or not. <br> //! By default the macro uses the following formatting to print the message: `("LOG DERIVE: {:?}", return_val)` <br> //! This can be easily changed using the `fmt` attribute: `#[logfn(LEVEL, fmt = "Important Result: {:}")` //! which will accept format strings similar to [`println!`]. //! //! [`logfn`]: ./attr.logfn.html //! [`log`]: https://docs.rs/log/latest/log/index.html //! [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html //! [`println!`]: https://doc.rust-lang.org/stable/std/macro.println.html //! //! ## Examples //! ```rust //! #[macro_use] //! extern crate log_derive; //! #[macro_use] //! extern crate log; //! //! # #[derive(Debug)] //! struct Error; //! # #[derive(Debug)] //! struct Success; //! # #[derive(Debug)] //! enum Status { Alive, Dead, Unknown } //! //! #[logfn(Warn)] //! fn is_alive(person: &Person) -> Status { //! # use self::Response::*; //! # use self::Status::*; //! match person.ping() { //! Pong => Status::Alive, //! Timeout => if person.is_awake() { //! Unknown //! } else { //! Dead //! } //! } //!} //! //! #[logfn(ok = "TRACE", err = "ERROR")] //! fn call_isan(num: &str) -> Result<Success, Error> { //! if num.len() >= 10 && num.len() <= 15 { //! Ok(Success) //! } else { //! Err(Error) //! } //! } //! //! #[logfn(INFO, fmt = "a + b = {}")] //! fn addition(a: usize, b: usize) -> usize { //! a + b //! } //! //! # fn main() {} //! # enum Response {Pong, Timeout} //! # struct Person; //! # impl Person {fn ping(&self) -> Response {Response::Pong}fn is_awake(&self) -> bool {true}} //! ``` //! //! extern crate proc_macro; extern crate syn; use darling::FromMeta; use proc_macro2::TokenStream; use quote::{quote, ToTokens}; use syn::{ parse_macro_input, spanned::Spanned, token, AttributeArgs, Expr, ExprBlock, ExprClosure, Ident, ItemFn, Meta, NestedMeta, Result, ReturnType, Type, TypePath, }; struct FormattedAttributes { ok_expr: TokenStream, err_expr: TokenStream, } impl FormattedAttributes { pub fn parse_attributes(attr: &[NestedMeta], fmt_default: &str) -> darling::Result<Self> { Options::from_list(attr).map(|opts| Self::get_ok_err_streams(&opts, fmt_default)) } fn get_ok_err_streams(att: &Options, fmt_default: &str) -> Self { let ok_log = att.ok_log(); let err_log = att.err_log(); let fmt = att.fmt().unwrap_or(fmt_default); let ok_expr = match ok_log { Some(loglevel) => { let log_token = get_logger_token(&loglevel); quote!{log::log!(#log_token, #fmt, result);} } None => quote!{()}, }; let err_expr = match err_log { Some(loglevel) => { let log_token = get_logger_token(&loglevel); quote!{log::log!(#log_token, #fmt, err);} } None => quote!{()}, }; FormattedAttributes { ok_expr, err_expr } } } #[derive(Default, FromMeta)] #[darling(default)] struct NamedOptions { ok: Option<Ident>, err: Option<Ident>, fmt: Option<String>, } struct Options { /// The log level specified as the first word in the attribute. leading_level: Option<Ident>, named: NamedOptions, } impl Options { pub fn ok_log(&self) -> Option<&Ident> { self.named.ok.as_ref().or_else(|| self.leading_level.as_ref()) } pub fn err_log(&self) -> Option<&Ident> { self.named.err.as_ref().or_else(|| self.leading_level.as_ref()) } pub fn fmt(&self) -> Option<&str> { self.named.fmt.as_ref().map(|s| s.as_str()) } } impl FromMeta for Options { fn from_list(items: &[NestedMeta]) -> darling::Result<Self> { if items.is_empty() { return Err(darling::Error::too_few_items(1)); } let mut leading_level = None; if let NestedMeta::Meta(first) = &items[0] { if let Meta::Word(ident) = first { leading_level = Some(ident.clone()); } } let named = if leading_level.is_some() { NamedOptions::from_list(&items[1..])? } else { NamedOptions::from_list(items)? }; Ok( Options { leading_level, named } ) } } /// Check if a return type is some form of `Result`. This assumes that all types named `Result` /// are in fact results, but is resilient to the possibility of `Result` types being referenced /// from specific modules. pub(crate) fn is_result_type(ty: &TypePath) -> bool { if let Some(segment) = ty.path.segments.iter().last() { segment.ident == "Result" } else { false } } fn check_if_return_result(f: &ItemFn) -> bool { if let ReturnType::Type(_, t) = &f.decl.output { return match t.as_ref() { Type::Path(path) => is_result_type(path), _ => false, }; } false } fn get_logger_token(att: &Ident) -> TokenStream { // Capitalize the first letter. let attr_str = att.to_string().to_lowercase(); let mut attr_char = attr_str.chars(); let attr_str = attr_char.next().unwrap().to_uppercase().to_string() + attr_char.as_str(); let att_str = Ident::new(&attr_str, att.span()); quote!(log::Level::#att_str) } fn make_closure(original: &ItemFn) -> ExprClosure { let body = Box::new(Expr::Block(ExprBlock{ attrs: Default::default(), label: Default::default(), block: *original.block.clone(), })); ExprClosure{ attrs: Default::default(), asyncness: Default::default(), movability: Default::default(), capture: Some(token::Move{span: original.span()}), or1_token: Default::default(), inputs: Default::default(), or2_token: Default::default(), output: ReturnType::Default, body, } } fn replace_function_headers(original: ItemFn, new: &mut ItemFn) { let block = new.block.clone(); *new = original; new.block = block; } fn generate_function(closure: &ExprClosure, expressions: &FormattedAttributes, result: bool) -> Result<ItemFn> { let FormattedAttributes { ok_expr, err_expr } = expressions; let code = if result { quote!{ fn temp() { (#closure)() .map(|result| { #ok_expr; result }) .map_err(|err| { #err_expr; err }) } } } else { quote!{ fn temp() { let result = (#closure)(); #ok_expr; result } } }; syn::parse2(code) } /// Logs the result of the function it's above. /// # Examples /// ``` rust /// # #[macro_use] extern crate log_derive; /// # use std::{net::*, io::{self, Write}}; /// #[logfn(err = "Error", fmt = "Failed Sending Packet: {:?}")] /// fn send_hi(addr: SocketAddr) -> Result<(), io::Error> { /// let mut stream = TcpStream::connect(addr)?; /// stream.write(b"Hi!")?; /// Ok( () ) /// } /// /// /// ``` #[proc_macro_attribute] pub fn logfn(attr: proc_macro::TokenStream, item: proc_macro::TokenStream) -> proc_macro::TokenStream { let attr = parse_macro_input!(attr as AttributeArgs); let original_fn: ItemFn = parse_macro_input!(item as ItemFn); let fmt_default = original_fn.ident.to_string() + "() => {:?}"; let parsed_attributes = match FormattedAttributes::parse_attributes(&attr, &fmt_default) { Ok(val) => val, Err(err) => { return err.write_errors().into(); } }; let closure = make_closure(&original_fn); let is_result = check_if_return_result(&original_fn); let mut new_fn = generate_function(&closure, &parsed_attributes, is_result).expect("Failed Generating Function"); replace_function_headers(original_fn, &mut new_fn); new_fn.into_token_stream().into() } #[cfg(test)] mod tests { use quote::quote; use syn::parse_quote; use super::is_result_type; #[test] fn result_type() { assert!(is_result_type(&parse_quote!(Result<T, E>))); assert!(is_result_type(&parse_quote!(std::result::Result<T, E>))); assert!(is_result_type(&parse_quote!(fmt::Result))); } }
true
68d4cc7422695eb4c7a8c6b2548b08020dbb262c
Rust
mdeg/dexparser
/src/error.rs
UTF-8
3,091
3.046875
3
[ "MIT" ]
permissive
use failure::Fail; #[derive(Debug, Fail, Clone)] pub enum DexParserError { #[fail(display = "file unexpectedly ended early: expected {} bytes", needed)] EndedEarly { needed: usize }, #[fail(display = "could not parse file: {}", reason)] ParsingFailed { reason: String }, #[fail(display = "could not decode string to UTF8: may be malformed")] EncodingError } impl<E: std::fmt::Debug + Clone> From<nom::Err<E>> for DexParserError { fn from(e: nom::Err<E>) -> Self { match e { nom::Err::Incomplete(ref needed) => { match needed { nom::Needed::Unknown => DexParserError::ParsingFailed { reason: "file ended early".to_string() }, nom::Needed::Size(size) => DexParserError::EndedEarly { needed: *size } } }, nom::Err::Error(ctx) => { match ctx { nom::Context::Code(pos, kind) => { DexParserError::ParsingFailed { reason: format!("parsing failed at byte {:?}: parser {:?}", pos, kind) } }, nom::Context::List(errors) => { let reason = errors.iter() .map(|(pos, kind)| format!("parsing failed at byte {:?}: parser {:?}", pos, kind)) .collect::<Vec<String>>() .join(": "); DexParserError::ParsingFailed { reason } } } }, nom::Err::Failure(ctx) => { match ctx { nom::Context::Code(pos, kind) => { DexParserError::ParsingFailed { reason: format!("parsing failed at byte {:?}: parser {:?}", pos, kind) } }, nom::Context::List(errors) => { let reason = errors.iter() .map(|(pos, kind)| format!("parsing failed at byte {:?}: parser {:?}", pos, kind)) .collect::<Vec<String>>() .join(": "); DexParserError::ParsingFailed { reason } } } } } } } impl From<&'static str> for DexParserError { fn from(e: &'static str) -> Self { DexParserError::ParsingFailed { reason: e.to_string() } } } impl From<String> for DexParserError { fn from(e: String) -> Self { DexParserError::ParsingFailed { reason: e } } } impl From<::std::string::FromUtf8Error> for DexParserError { fn from(_e: ::std::string::FromUtf8Error) -> Self { DexParserError::ParsingFailed { reason: "could not parse string as UTF8".to_string() } } } impl From<DexParserError> for nom::Err<&[u8]> { fn from(e: DexParserError) -> Self { // TODO - work out how to build a proper error here, or avoid converting back and forth nom::Err::Failure(nom::Context::Code(b"Failed to parse DEX file", nom::ErrorKind::Custom(0))) } }
true
cb712978afbc0706f1f5ae95e2eff047eaf4eb9e
Rust
tan-wei/genet
/genet-abi/src/error.rs
UTF-8
957
3.109375
3
[ "MIT" ]
permissive
use std::{error, fmt, str}; use string::SafeString; /// An error object. #[repr(C)] #[derive(Clone, PartialEq)] pub struct Error { desc: SafeString, } impl Error { /// Creates a new Error. pub fn new(desc: &str) -> Error { Self { desc: SafeString::from(desc), } } } impl fmt::Debug for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Error: {}", error::Error::description(self)) } } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", error::Error::description(self)) } } impl error::Error for Error { fn description(&self) -> &str { &self.desc } } #[cfg(test)] mod tests { use super::*; use std::error; #[test] fn description() { let msg = "out of bounds"; let err = Error::new(msg); assert_eq!(error::Error::description(&err), msg); } }
true
a096443d4c217615c253cfd8b5582e34f4dd06ab
Rust
ginglis13/rustutils
/env/src/main.rs
UTF-8
833
2.828125
3
[]
no_license
// env // written to work on Unix machines extern crate getopts; use getopts::Options; use std::env; fn usage(program: &str, opts: &Options) { let brief = format!("Usage: {} [OPTION] FILE", program); print!("{}", opts.usage(&brief)); } fn env() { for (k,v) in env::vars() { println!("{}={}", k, v); } } fn main() { // Read argv let args: Vec<String> = env::args().collect(); let program_name = args[0].clone(); // Create Options let mut opts = Options::new(); opts.optflag("h", "help", "print help information"); let matches = match opts.parse(&args[1..]) { Ok(m) => { m } Err(e) => { usage(&program_name, &opts); panic!(e.to_string()) } }; if matches.opt_present("h") { usage(&program_name, &opts); return; } env(); }
true
86058a6c5a5109988eb77647b35a5036b4df9c94
Rust
mbarbier/wasm-gl
/src/game.rs
UTF-8
2,693
2.71875
3
[]
no_license
use std::{cell::RefCell, rc::Rc}; use cgmath::{vec3, Deg, Matrix4, Point3, Quaternion, Rotation3, Transform}; use js_sys::Date; use wasm_bindgen::JsValue; use weblog::{console_error, console_log}; use crate::core::{ geometry::Geometry, graph::Node, material::Material, object3d::{Mesh, Object3d}, renderer::Renderer, scene::Scene, shapes, }; pub fn example1() -> Result<(Box<dyn FnMut(f64, f64) -> ()>, Box<dyn FnMut() -> ()>), JsValue> { console_log!("Starting example 1"); // Create cam // Create scene let mut scene = Scene::new(); // Add elements let cube0 = create_cube(2.5, String::from("cube0")); scene.add_child(&cube0); let cube1 = create_cube(1.5, String::from("cube1")); cube1.value.borrow_mut().transform.position = vec3(5.0, 0.0, 0.0); Node::add_child(&cube0, &cube1); // Create renderer let mut renderer = Renderer::new("canvas"); renderer.create()?; let renderer_rc = Rc::new(RefCell::new(renderer)); let renderer = renderer_rc.clone(); let resize_fn = move |width: f64, height: f64| { renderer.borrow_mut().set_size(width, height); }; let mut total_time: f32 = 0.0; let mut time = Date::now(); let renderer = renderer_rc.clone(); let camera = Matrix4::from_translation(vec3(0.0, 7.5, 15.0)) * Matrix4::from_angle_x(Deg(-25.0)); let update_fn = move || { let newtime = Date::now(); let ellapsed = ((newtime - time) / 1000.0) as f32; total_time = total_time + ellapsed; time = newtime; //rotate mesh { let mut m = cube0.value.borrow_mut(); m.transform.quaternion = Quaternion::from_angle_y(Deg(ellapsed * 90.0)) * m.transform.quaternion; } // Do rendering let res = renderer.borrow_mut().draw(&mut scene, &camera, ellapsed); if res.is_err() { console_error!(res.unwrap_err()); } }; Ok((Box::new(resize_fn), Box::new(update_fn))) } fn create_cube(size: f32, name: String) -> Rc<Node<Object3d>> { let cube = shapes::cube(size, size, size); let mut geometry = Geometry::new(); geometry.set_indexes(&cube.0); geometry.set_positions(&cube.1); geometry.set_normals(&cube.2); let mut material = Material::new(); material.vertex_shader = include_str!("core/shaders/vertex.glsl"); material.fragment_shader = include_str!("core/shaders/fragment.glsl"); let mesh0 = RefCell::new(Box::new(Mesh::new(material, geometry))); let node = Node::new_rc(Object3d::new()); node.value.borrow_mut().renderer.replace(mesh0); node.value.borrow_mut().name = Some(name); node }
true
0be7b5ebb92e3631124af0eea855fcb40b69c924
Rust
fisherdarling/asterix
/asterix-impl/src/visitor.rs
UTF-8
9,367
2.53125
3
[]
no_license
use std::collections::HashSet; use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quote, ToTokens, TokenStreamExt}; use syn::{spanned::Spanned, Ident}; use crate::context::{Context, EnumType, NewType}; pub struct Visitor<'c> { pub new_idents: HashSet<String>, context: &'c Context, } impl<'c> Visitor<'c> { pub fn new(context: &'c Context) -> Self { let new_idents: HashSet<String> = context .new_types .iter() .map(|n| n.name().to_string()) .collect(); Self { new_idents, context, } } pub fn create_visitor(&self) -> TokenStream { let mut tokens = TokenStream::default(); let func_impl = self.func_impl(); tokens.append_all(quote! { pub trait Visitor<'ast> where Self::Output: Default { type Output; #func_impl } }); tokens } pub fn func_impl(&self) -> TokenStream { let mut tokens = TokenStream::default(); let ast_type = NewType::Enum(EnumType { name: Ident::new("Ast", Span::call_site()), variants: self.context.variants.clone(), }); let functions: Vec<TokenStream> = self .context .new_types .iter() .map(|nt| self.single_func(nt)) .collect(); tokens.append_all(self.single_func(&ast_type)); tokens.extend(functions); tokens } pub fn single_func(&self, new_type: &NewType) -> TokenStream { let mut tokens = TokenStream::default(); match new_type { NewType::Enum(e) => { let name = &e.name; let name_lower = format_ident!("{}", name.to_string().to_lowercase(), span = name.span()); let visit_name = format_ident!( "visit_{}", name.to_string().to_lowercase(), span = name.span() ); // let variants = &e.variants; // Raw variants will be: visit_name_rawname() let raw_variants = e.variants.iter().filter(|v| v.ty.is_none()); // New Type variants will be: visit_newtype(newtype) // Basic Type variants will be: visit_name_variantname(basic_type); let (new_type_variants, basic_type_variants): (Vec<_>, Vec<_>) = e.variants.iter().filter(|v| v.ty.is_some()).partition(|v| { let type_string = v.ty.as_ref() .map(|t| { let mut tokens = TokenStream::default(); t.to_tokens(&mut tokens); tokens.to_string() }) .unwrap_or_default(); self.new_idents.contains(&type_string) }); let raw_idents = raw_variants.clone().map(|v| &v.name); let new_type_idents = new_type_variants.iter().map(|v| &v.name); let new_type_types = new_type_variants.iter().map(|v| &v.ty).flatten(); let basic_idents = basic_type_variants.iter().map(|v| &v.name); let basic_types = basic_type_variants.iter().map(|v| &v.ty).flatten(); let raw_visit = raw_idents.clone().map(|i| { format_ident!( "visit_{}_{}", name.to_string().to_lowercase(), i.to_string().to_lowercase(), span = i.span() ) }); let new_type_visit = new_type_types.clone().map(|ty| { let mut tokens = TokenStream::new(); ty.to_tokens(&mut tokens); format_ident!("visit_{}", tokens.to_string().to_lowercase()) }); let basic_visit = basic_idents.clone().map(|i| { format_ident!( "visit_{}_{}", name.to_string().to_lowercase(), i.to_string().to_lowercase(), span = i.span() ) }); let basic_visit_func = basic_visit.clone(); let basic_types_func = basic_types.clone(); let raw_visit_func = raw_visit.clone(); tokens.append_all(quote! { fn #visit_name(&mut self, #name_lower: &'ast #name) -> Self::Output where Self: Sized { match #name_lower { #( #name::#new_type_idents(v) => self.#new_type_visit(&v), )* #( #name::#basic_idents(v) => self.#basic_visit(&v), )* #( #name::#raw_idents => self.#raw_visit(), )* } } #( fn #basic_visit_func(&mut self, v: &'ast #basic_types_func) -> Self::Output where Self: Sized { Self::Output::default() } )* #( fn #raw_visit_func(&mut self) -> Self::Output where Self: Sized { Self::Output::default() } )* }); } NewType::Struct(s) => { let name = &s.name; let name_lower = format_ident!("{}", name.to_string().to_lowercase(), span = name.span()); let visit_name = format_ident!( "visit_{}", name.to_string().to_lowercase(), span = name.span() ); let (new_type_field_names, new_type_visit): (Vec<_>, Vec<_>) = s .fields .iter() .filter_map(|f| { let mut tokens = TokenStream::new(); f.ty.to_tokens(&mut tokens); if self.new_idents.contains(&tokens.to_string()) { Some(( &f.ident, format_ident!("visit_{}", tokens.to_string().to_lowercase()), )) } else { None } }) .unzip(); let _name_lower_func = name_lower.clone(); let name_lower_repeat = (0..new_type_field_names.len()).map(|_| &name_lower); tokens.append_all(quote! { fn #visit_name(&mut self, #name_lower: &'ast #name) -> Self::Output where Self: Sized { #( self.#new_type_visit(&#name_lower_repeat.#new_type_field_names); )* Self::Output::default() } }); } NewType::WrapperStruct(s) => { let name = &s.name; let name_lower = format_ident!("{}", name.to_string().to_lowercase(), span = name.span()); let visit_name = format_ident!( "visit_{}", name.to_string().to_lowercase(), span = name.span() ); let type_string = { let mut tokens = TokenStream::new(); s.ty.to_tokens(&mut tokens); tokens.to_string() }; let name_lower_inner = name_lower.clone(); let inner_call = if self.new_idents.contains(&type_string) { let visit_new_type = format_ident!("visit_{}", type_string.to_lowercase(), span = s.ty.span()); quote! { self.#visit_new_type(#name_lower_inner.inner()) } } else { quote! { Self::Output::default() } }; tokens.append_all(quote! { fn #visit_name(&mut self, #name_lower: &#name) -> Self::Output where Self: Sized { #inner_call } }); } } tokens } } #[cfg(test)] mod tests { use super::*; use syn::parse_quote; #[test] fn simple_enum() { let context: Context = parse_quote! { Lit |isize|, Expr |Lit|, Binop: struct Binop { lhs: Expr, rhs: Expr, }, E: enum E { Alpha(isize), // Basic type Beta(Ident), // New Type Gamma, // Raw Type } }; let visitor = Visitor::new(&context); let impl_tokens = visitor.create_visitor(); println!("{}", impl_tokens); } }
true
6bb0f2e3290db081b70e1df44ce561ba7ce26211
Rust
dmshvetsov/adventofcode
/2022/07/2.rs
UTF-8
2,689
3.046875
3
[]
no_license
use std::collections::HashMap; use std::fs::File; use std::io::{BufRead, BufReader}; const MAX: u64 = 70_000_000; const REQUIRED: u64 = 30_000_000; fn solution(input: BufReader<File>) -> u64 { let mut total = 0; let mut dir_stack: Vec<String> = Vec::new(); let mut dir_sizes = HashMap::new(); for line_result in input.lines() { match line_result .expect("failed to parse string") .split_once(" ") .expect("failed to split line") { ("$", "ls") => { /* do nothing */ } ("dir", _dir_name) => { /* do nothing */ } ("$", cmd) => { match cmd.split_once(" ") { Some(("cd", "/")) => { dir_sizes.insert("/", 0u64); // asume `$ cd /` called only once /* do nothing */ } Some(("cd", "..")) => { if let Some(current_dir_name) = dir_stack.pop() { if let (Some(parent_dir_name), Some(current_dir_size)) = (dir_stack.last(), dir_sizes.get(&current_dir_name as &str)) { dir_sizes .entry(parent_dir_name) .and_modify(|val| *val += current_dir_size); } } } Some(("cd", dir_name)) => { dir_sizes.insert("/", 0u64); dir_stack.push(dir_name.to_string()); } Some(val) => panic!("unhandled command: {:?}", val), None => panic!("failed to parse command"), } } (raw_num, _file_name) => { let file_size = raw_num.parse::<u64>().expect("failed to parse file line"); total += file_size; if let Some(current_dir_name) = dir_stack.last() { dir_sizes .entry(current_dir_name) .and_modify(|val| *val += file_size); } } } } *dir_sizes .values() .filter(|&&size| MAX - (total - size) >= REQUIRED) .min() .expect("solution not found") } fn main() { let test_file = File::open("./07/test.txt").unwrap(); assert_eq!(solution(BufReader::new(test_file)), 24933642); let input_file = File::open("./07/input.txt").unwrap(); println!("solution: {}", solution(BufReader::new(input_file))); // answer 1513699 }
true
5047827f79df5e7170ba639be28b7c94eeb22651
Rust
henkkuli/rp-hal
/rp2040-hal/src/pll.rs
UTF-8
8,579
3.09375
3
[ "Apache-2.0", "MIT" ]
permissive
//! Phase-Locked Loops (PLL) // See [Chapter 2 Section 18](https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf) for more details use core::{ convert::{Infallible, TryFrom, TryInto}, marker::PhantomData, ops::{Deref, Range, RangeInclusive}, }; use embedded_time::{ fixed_point::FixedPoint, rate::{Generic, Hertz, Rate}, }; use nb::Error::WouldBlock; use pac::RESETS; use crate::{clocks::ClocksManager, resets::SubsystemReset}; /// State of the PLL pub trait State {} /// PLL is disabled. pub struct Disabled { refdiv: u8, fbdiv: u16, post_div1: u8, post_div2: u8, frequency: Hertz, } /// PLL is configured, started and locking into its designated frequency. pub struct Locking { post_div1: u8, post_div2: u8, frequency: Hertz, } /// PLL is locked : it delivers a steady frequency. pub struct Locked { frequency: Hertz, } impl State for Disabled {} impl State for Locked {} impl State for Locking {} /// Trait to handle both underlying devices from the PAC (PLL_SYS & PLL_USB) pub trait PhaseLockedLoopDevice: Deref<Target = rp2040_pac::pll_sys::RegisterBlock> + SubsystemReset { } impl PhaseLockedLoopDevice for rp2040_pac::PLL_SYS {} impl PhaseLockedLoopDevice for rp2040_pac::PLL_USB {} /// A PLL. pub struct PhaseLockedLoop<S: State, D: PhaseLockedLoopDevice> { device: D, state: S, } impl<S: State, D: PhaseLockedLoopDevice> PhaseLockedLoop<S, D> { fn transition<To: State>(self, state: To) -> PhaseLockedLoop<To, D> { PhaseLockedLoop { device: self.device, state, } } /// Releases the underlying device. pub fn free(self) -> D { self.device } } /// Error type for the PLL module. /// See Chapter 2, Section 18 §2 for details on constraints triggering these errors. pub enum Error { /// Proposed VCO frequency is out of range. VcoFreqOutOfRange, /// Feedback Divider value is out of range. FeedbackDivOutOfRange, /// Post Divider value is out of range. PostDivOutOfRage, /// Reference Frequency is out of range. RefFreqOutOfRange, /// Bad argument : overflows, bad conversion, ... BadArgument, } /// Parameters for a PLL. pub struct PLLConfig<R: Rate> { /// Voltage Controlled Oscillator frequency. pub vco_freq: R, /// Reference divider pub refdiv: u8, /// Post Divider 1 pub post_div1: u8, /// Post Divider 2 pub post_div2: u8, } /// Common configs for the two PLLs. Both assume the XOSC is cadenced at 12MHz ! /// See Chapter 2, Section 18, §2 pub mod common_configs { use super::PLLConfig; use embedded_time::rate::Megahertz; /// Default, nominal configuration for PLL_SYS pub const PLL_SYS_125MHZ: PLLConfig<Megahertz> = PLLConfig { vco_freq: Megahertz(1500), refdiv: 1, post_div1: 6, post_div2: 2, }; /// Default, nominal configuration for PLL_USB. pub const PLL_USB_48MHZ: PLLConfig<Megahertz> = PLLConfig { vco_freq: Megahertz(480), refdiv: 1, post_div1: 5, post_div2: 2, }; } impl<D: PhaseLockedLoopDevice> PhaseLockedLoop<Disabled, D> { /// Instantiates a new Phase-Locked-Loop device. pub fn new<R: Rate>( dev: D, xosc_frequency: Generic<u32>, config: PLLConfig<R>, ) -> Result<PhaseLockedLoop<Disabled, D>, Error> where R: Into<Hertz<u64>>, { const VCO_FREQ_RANGE: RangeInclusive<Hertz<u32>> = Hertz(400_000_000)..=Hertz(1_600_000_000); const POSTDIV_RANGE: Range<u8> = 1..7; const FBDIV_RANGE: Range<u16> = 16..320; //First we convert our rate to Hertz<u64> as all other rates can be converted to that. let vco_freq: Hertz<u64> = config.vco_freq.into(); //Then we try to downscale to u32. let vco_freq: Hertz<u32> = vco_freq.try_into().map_err(|_| Error::BadArgument)?; if !VCO_FREQ_RANGE.contains(&vco_freq) { return Err(Error::VcoFreqOutOfRange); } if !POSTDIV_RANGE.contains(&config.post_div1) || !POSTDIV_RANGE.contains(&config.post_div2) { return Err(Error::PostDivOutOfRage); } let ref_freq_range: Range<Hertz<u32>> = Hertz(5_000_000)..vco_freq.div(16); let ref_freq_hz = Hertz::<u32>::try_from(xosc_frequency) .map_err(|_| Error::BadArgument)? .checked_div(&(config.refdiv as u32)) .ok_or(Error::BadArgument)?; if !ref_freq_range.contains(&ref_freq_hz) { return Err(Error::RefFreqOutOfRange); } let fbdiv = vco_freq .checked_div(&ref_freq_hz.integer()) .ok_or(Error::BadArgument)?; let fbdiv: u16 = (fbdiv.integer()) .try_into() .map_err(|_| Error::BadArgument)?; if !FBDIV_RANGE.contains(&fbdiv) { return Err(Error::FeedbackDivOutOfRange); } let refdiv = config.refdiv; let post_div1 = config.post_div1; let post_div2 = config.post_div2; let frequency: Hertz = (ref_freq_hz / refdiv as u32) * fbdiv as u32 / (post_div1 as u32 * post_div2 as u32); Ok(PhaseLockedLoop { state: Disabled { refdiv, fbdiv, post_div1, post_div2, frequency, }, device: dev, }) } /// Configures and starts the PLL : it switches to Locking state. pub fn initialize(self, resets: &mut rp2040_pac::RESETS) -> PhaseLockedLoop<Locking, D> { self.device.reset_bring_up(resets); // Turn off PLL in case it is already running self.device.pwr.reset(); self.device.fbdiv_int.reset(); self.device.cs.write(|w| unsafe { w.refdiv().bits(self.state.refdiv); w }); self.device.fbdiv_int.write(|w| unsafe { w.fbdiv_int().bits(self.state.fbdiv); w }); // Turn on PLL self.device.pwr.modify(|_, w| { w.pd().clear_bit(); w.vcopd().clear_bit(); w }); let post_div1 = self.state.post_div1; let post_div2 = self.state.post_div2; let frequency = self.state.frequency; self.transition(Locking { post_div1, post_div2, frequency, }) } } /// A token that's given when the PLL is properly locked, so we can safely transition to the next state. pub struct LockedPLLToken<D> { _private: PhantomData<D>, } impl<D: PhaseLockedLoopDevice> PhaseLockedLoop<Locking, D> { /// Awaits locking of the PLL. pub fn await_lock(&self) -> nb::Result<LockedPLLToken<D>, Infallible> { if self.device.cs.read().lock().bit_is_clear() { return Err(WouldBlock); } Ok(LockedPLLToken { _private: PhantomData, }) } /// Exchanges a token for a Locked PLL. pub fn get_locked(self, _token: LockedPLLToken<D>) -> PhaseLockedLoop<Locked, D> { // Set up post dividers self.device.prim.write(|w| unsafe { w.postdiv1().bits(self.state.post_div1); w.postdiv2().bits(self.state.post_div2); w }); // Turn on post divider self.device.pwr.modify(|_, w| { w.postdivpd().clear_bit(); w }); let frequency = self.state.frequency; self.transition(Locked { frequency }) } } impl<D: PhaseLockedLoopDevice> PhaseLockedLoop<Locked, D> { /// Get the operating frequency for the PLL pub fn operating_frequency(&self) -> Hertz { self.state.frequency } } /// Blocking helper method to setup the PLL without going through all the steps. pub fn setup_pll_blocking<D: PhaseLockedLoopDevice, R: Rate>( dev: D, xosc_frequency: Generic<u32>, config: PLLConfig<R>, clocks: &mut ClocksManager, resets: &mut RESETS, ) -> Result<PhaseLockedLoop<Locked, D>, Error> where R: Into<Hertz<u64>>, { // Before we touch PLLs, switch sys and ref cleanly away from their aux sources. nb::block!(clocks.system_clock.reset_source_await()).unwrap(); nb::block!(clocks.reference_clock.reset_source_await()).unwrap(); let initialized_pll = PhaseLockedLoop::new(dev, xosc_frequency, config)?.initialize(resets); let locked_pll_token = nb::block!(initialized_pll.await_lock()).unwrap(); Ok(initialized_pll.get_locked(locked_pll_token)) }
true
49d65521ee5adeddf4e4b0c8407f31b7ee30a8be
Rust
alishahusain/reserves
/src/context.rs
UTF-8
3,227
2.625
3
[ "CC0-1.0" ]
permissive
use std::fs; use clap; use protobuf; use protobuf::Message; use common; use protos; use utils; pub fn global_args<'a>() -> Vec<clap::Arg<'a, 'a>> { vec![ clap::Arg::with_name("verbose") .short("v") .multiple(true) .takes_value(false) .help("print verbose logging output to stderr") .global(true), clap::Arg::with_name("proof-file") .long("proof-file") .short("f") .help("the proof-of-reserves file to use") .takes_value(true) .default_value("reserves.proof") .global(true), clap::Arg::with_name("testnet") .long("testnet") .takes_value(false) .help("use the Bitcoin testnet network") .global(true), clap::Arg::with_name("dry-run") .short("n") .long("dry-run") .takes_value(false) .help("perform a dry run: no changes will be made to the proof file") .global(true), ] } pub struct Ctx<'a> { pub matches: &'a clap::ArgMatches<'a>, network: Option<protos::Network>, // lazily determine } impl<'a> Ctx<'a> { pub fn new(matches: &'a clap::ArgMatches) -> Ctx<'a> { Ctx { matches: matches, network: None, } } fn proof_file_path(&self) -> &str { self.matches.value_of("proof-file").expect("--proof-file cannot be empty") } pub fn load_proof_file(&mut self) -> common::ProofFile { let mut file = { let path = self.proof_file_path(); fs::File::open(path).expect(&format!("error opening file at '{}'", path)) }; let pf: protos::ProofOfReserves = protobuf::parse_from_reader(&mut file).expect("error parsing reserve file"); if pf.get_version() != 1 { panic!("Unknown proof file version: {}", pf.get_version()) } let proof_network = pf.get_network(); if let Some(args_network) = self.args_network() { if args_network != proof_network { panic!( "Proof file network ({}) incompatible with network from CLI flag ({})", utils::network_name(proof_network), utils::network_name(args_network) ); } } self.network = Some(proof_network); pf.into() } pub fn save_proof_file(&self, pf: common::ProofFile) { if self.dry_run() { println!("Dry-run: not writing proof file to disk."); return; } let path = self.proof_file_path(); let mut file = fs::File::create(path).expect(&format!("error opening file at '{}'", path)); let proto: protos::ProofOfReserves = pf.into(); proto.write_to_writer(&mut file).expect("error writing reserve file"); } pub fn command(&self) -> &'a clap::ArgMatches<'a> { self.matches.subcommand().1.unwrap() } pub fn verbosity(&self) -> usize { self.matches.occurrences_of("verbose") as usize } // The network explicitly specified by cli arguments. fn args_network(&self) -> Option<protos::Network> { if self.matches.is_present("testnet") { Some(protos::Network::BITCOIN_TESTNET) } else { None } } pub fn network(&self) -> protos::Network { match self.network { // use the one we found when loading the proof file Some(network) => network, // fallback to command line args None => match self.args_network() { Some(network) => network, // fallback to Bitcoin mainnet None => protos::Network::BITCOIN_MAINNET, }, } } pub fn dry_run(&self) -> bool { self.matches.is_present("dry-run") } }
true
8c219b80acfce5c1d7104e83a395a319f4149b5e
Rust
thomvil/job-manager-rs
/src/model/job.rs
UTF-8
3,469
3.28125
3
[]
no_license
use crate::prelude::*; #[derive(Clone, Debug)] pub struct Job { pub(crate) id: Option<usize>, pub(crate) load: String, pub(crate) difficulty: u8, pub(crate) started_at: Option<DateTime<Local>>, pub(crate) completed_at: Option<DateTime<Local>>, pub(crate) persistant: bool, pub(crate) started_by: Option<String>, pub(crate) result: Option<String>, } // Constructors impl Job { pub fn new<S: Into<String>>(load: S, difficulty: u8, persistant: bool) -> Self { Self { load: load.into(), difficulty, persistant, started_at: None, started_by: None, completed_at: None, result: None, id: None, } } pub fn start(mut self, by: &str) -> Self { self.started_at = Some(Local::now()); self.started_by = Some(by.into()); self } pub fn finish<S: Into<String>>(mut self, result: S) -> Self { self.result = Some(result.into()); self.completed_at = Some(Local::now()); self } } // Inspectors impl Job { pub fn is_started(&self) -> bool { self.started_by.is_some() } pub fn is_completed(&self) -> bool { self.is_started() && self.completed_at.is_some() } pub fn can_start(&self) -> bool { !self.is_started() || !self.persistant } pub fn is_db_stored(&self) -> bool { self.id.is_some() } } // To SQL strings impl Job { pub fn to_sql_insert(&self) -> String { format!("('{}',{},{})", self.load, self.difficulty, self.persistant) } // pub fn to_sql_update(&self) -> String { // format!( // "('{}',{},{},{},{},{},{})", // self.load, // self.difficulty, // self.persistant, // self.started_at.unwrap_or(""), // self.started_by.unwrap_or(""), // self.completed_at.unwrap_or(""), // self.result.unwrap_or("") // ) // } } #[cfg(test)] mod tests { use super::Job; #[test] fn construct() { let j1 = Job::new("{ load: 'test' }", 1, false); assert!(j1.id.is_none()); assert!(j1.started_at.is_none()); assert!(j1.started_by.is_none()); assert!(j1.completed_at.is_none()); assert!(j1.result.is_none()); } #[test] fn start() { let j1 = Job::new("{ load: 'test' }", 1, false); let j1_started = j1.start("foobar"); assert_eq!("foobar", j1_started.started_by.as_ref().unwrap()); assert!(j1_started.started_at.is_some()); assert!(j1_started.is_started()); } #[test] fn finish() { let j1 = Job::new("{ load: 'test' }", 1, false).start("foobar"); let j1_finished = j1.finish("{ load: 'test', result: 'baz'"); assert!(j1_finished.is_completed()); } #[test] fn can_start() { let j1 = Job::new("{ load: 'test' }", 1, false) .start("foo") .finish("bar"); assert!(j1.is_started()); assert!(!j1.persistant); assert!(j1.can_start()); let j2 = Job::new("{ load: 'test' }", 1, true); assert!(!j2.is_started()); assert!(j2.can_start()); let j3 = Job::new("{ load: 'test' }", 1, true).start("foo"); assert!(j3.is_started()); assert!(j3.persistant); assert!(!j3.can_start()); } }
true
383d1081bd84beb09e2d8bf438a76d6803e0dff2
Rust
carsonaco/chain
/client-core/src/key/private_key.rs
UTF-8
2,762
3
3
[ "Apache-2.0", "MIT" ]
permissive
use failure::ResultExt; use rand::rngs::OsRng; use secp256k1::{PublicKey as SecpPublicKey, SecretKey}; use zeroize::Zeroize; use client_common::{ErrorKind, Result}; use crate::{PublicKey, SECP}; /// Private key used in Crypto.com Chain #[derive(Debug, PartialEq)] pub struct PrivateKey(SecretKey); impl PrivateKey { /// Generates a new private key pub fn new() -> Result<PrivateKey> { let mut rng = OsRng::new().context(ErrorKind::KeyGenerationError)?; let secret_key = SecretKey::new(&mut rng); Ok(PrivateKey(secret_key)) } /// Serializes current private key pub fn serialize(&self) -> Result<Vec<u8>> { Ok(self.0[..].to_vec()) } /// Deserializes private key from bytes pub fn deserialize_from(bytes: &[u8]) -> Result<PrivateKey> { let secret_key: SecretKey = SecretKey::from_slice(bytes).context(ErrorKind::DeserializationError)?; Ok(PrivateKey(secret_key)) } } impl From<&PrivateKey> for PublicKey { fn from(private_key: &PrivateKey) -> Self { let secret_key = &private_key.0; let public_key = SECP.with(|secp| SecpPublicKey::from_secret_key(secp, secret_key)); public_key.into() } } impl Zeroize for PrivateKey { fn zeroize(&mut self) { self.0.zeroize() } } impl Drop for PrivateKey { fn drop(&mut self) { self.zeroize() } } #[cfg(test)] mod tests { use super::PrivateKey; #[test] fn check_serialization() { // Hex representation: "c553a03604235df8fcd14fc6d1e5b18a219fbcc6e93effcfcf768e2977a74ec2" let secret_arr: Vec<u8> = vec![ 197, 83, 160, 54, 4, 35, 93, 248, 252, 209, 79, 198, 209, 229, 177, 138, 33, 159, 188, 198, 233, 62, 255, 207, 207, 118, 142, 41, 119, 167, 78, 194, ]; let private_key = PrivateKey::deserialize_from(&secret_arr) .expect("Unable to deserialize private key from byte array"); let private_arr = private_key .serialize() .expect("Unable to serialize private key"); assert_eq!( secret_arr, private_arr, "Serialization / Deserialization is implemented incorrectly" ); } #[test] fn check_rng_serialization() { let private_key = PrivateKey::new().expect("Unable to generate private key"); let private_arr = private_key .serialize() .expect("Unable to serialize private key"); let secret_key = PrivateKey::deserialize_from(&private_arr).expect("Unable to deserialize private key"); assert_eq!( private_key, secret_key, "Serialization / Deserialization is implemented incorrectly" ); } }
true
2e72a688820cfadbf787deb8a9364990d8df2f80
Rust
touilleMan/orion
/src/high_level/kdf.rs
UTF-8
7,900
2.921875
3
[ "MIT" ]
permissive
// MIT License // Copyright (c) 2020-2021 The orion Developers // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. //! Key derivation. //! //! # Use case: //! `orion::kdf` can be used to derive higher-entropy keys from low-entropy //! keys. Also known as key stretching. //! //! An example of this could be deriving a key from a user-submitted password //! and using this derived key in disk encryption. //! //! # About: //! - Uses Argon2i. //! //! # Note: //! This implementation only supports a single thread/lane. //! //! # Parameters: //! - `password`: The low-entropy input key to be used in key derivation. //! - `salt`: The salt used for the key derivation. //! - `iterations`: Iterations cost parameter for Argon2i. //! - `memory`: Memory (in kibibytes (KiB)) cost parameter for Argon2i. //! - `length`: The desired length of the derived key. //! //! # Errors: //! An error will be returned if: //! - `iterations` is less than 3. //! - `length` is less than 4. //! - `memory` is less than 8. //! - The length of the `password` is greater than [`isize::MAX`]. //! - The length of the `salt` is greater than [`isize::MAX`] or less than `8`. //! //! # Security: //! - Choosing the correct cost parameters is important for security. Please refer to //! [libsodium's docs] for a description of how to do this. //! - The salt should always be generated using a CSPRNG. [`Salt::default()`] //! can be used for this, it will generate a [`Salt`] of 16 bytes. //! - The recommended minimum size for a salt is 16 bytes. //! - The recommended minimum size for a derived key is 16 bytes. //! //! # Example: //! ```rust //! use orion::kdf; //! //! let user_password = kdf::Password::from_slice(b"User password")?; //! let salt = kdf::Salt::default(); //! //! let derived_key = kdf::derive_key(&user_password, &salt, 3, 1<<16, 32)?; //! //! # Ok::<(), orion::errors::UnknownCryptoError>(()) //! ``` //! [libsodium's docs]: https://download.libsodium.org/doc/password_hashing/default_phf#guidelines-for-choosing-the-parameters pub use super::hltypes::{Password, Salt, SecretKey}; use crate::{errors::UnknownCryptoError, hazardous::kdf::argon2i, pwhash::MIN_ITERATIONS}; #[must_use = "SECURITY WARNING: Ignoring a Result can have real security implications."] /// Derive a key using Argon2i. pub fn derive_key( password: &Password, salt: &Salt, iterations: u32, memory: u32, length: u32, ) -> Result<SecretKey, UnknownCryptoError> { if iterations < MIN_ITERATIONS { return Err(UnknownCryptoError); } let mut dk = SecretKey::from_slice(&vec![0u8; length as usize])?; argon2i::derive_key( password.unprotected_as_bytes(), salt.as_ref(), iterations, memory, None, None, &mut dk.value, )?; Ok(dk) } // Testing public functions in the module. #[cfg(test)] mod public { use super::*; mod test_derive_key_and_verify { use super::*; #[test] fn test_derive_key() { let password = Password::from_slice(&[0u8; 64]).unwrap(); let salt = Salt::from_slice(&[0u8; 16]).unwrap(); let dk_first = derive_key(&password, &salt, 3, 1024, 32).unwrap(); let dk_second = derive_key(&password, &salt, 3, 1024, 32).unwrap(); assert_eq!(dk_first, dk_second); } #[test] fn test_derive_key_err_diff_iter() { let password = Password::from_slice(&[0u8; 64]).unwrap(); let salt = Salt::from_slice(&[0u8; 64]).unwrap(); let dk = derive_key(&password, &salt, 3, 1024, 32).unwrap(); let dk_diff_iter = derive_key(&password, &salt, 4, 1024, 32).unwrap(); assert_ne!(dk, dk_diff_iter); } #[test] fn test_derive_key_err_diff_mem() { let password = Password::from_slice(&[0u8; 64]).unwrap(); let salt = Salt::from_slice(&[0u8; 64]).unwrap(); let dk = derive_key(&password, &salt, 3, 1024, 32).unwrap(); let dk_diff_mem = derive_key(&password, &salt, 3, 512, 32).unwrap(); assert_ne!(dk, dk_diff_mem); } #[test] fn test_derive_key_err_diff_salt() { let password = Password::from_slice(&[0u8; 64]).unwrap(); let salt = Salt::from_slice(&[0u8; 64]).unwrap(); let dk = derive_key(&password, &salt, 3, 1024, 32).unwrap(); let dk_diff_salt = derive_key( &password, &Salt::from_slice(&[1u8; 64]).unwrap(), 3, 1024, 32, ) .unwrap(); assert_ne!(dk, dk_diff_salt); } #[test] fn test_derive_key_err_diff_len() { let password = Password::from_slice(&[0u8; 64]).unwrap(); let salt = Salt::from_slice(&[0u8; 64]).unwrap(); let dk = derive_key(&password, &salt, 3, 1024, 32).unwrap(); let dk_diff_len = derive_key(&password, &salt, 3, 1024, 64).unwrap(); assert_ne!(dk, dk_diff_len); } #[test] fn test_derive_key_err_diff_pass() { let password = Password::from_slice(&[0u8; 64]).unwrap(); let salt = Salt::from_slice(&[0u8; 64]).unwrap(); let dk = derive_key(&password, &salt, 3, 1024, 32).unwrap(); let dk_diff_pass = derive_key( &Password::from_slice(&[1u8; 64]).unwrap(), &salt, 3, 1024, 32, ) .unwrap(); assert_ne!(dk, dk_diff_pass); } #[test] fn test_derive_key_bad_length() { let password = Password::from_slice(&[0u8; 64]).unwrap(); let salt = Salt::from_slice(&[0u8; 64]).unwrap(); assert!(derive_key(&password, &salt, 3, 1024, 3).is_err()); assert!(derive_key(&password, &salt, 3, 1024, 4).is_ok()); assert!(derive_key(&password, &salt, 3, 1024, 5).is_ok()); } #[test] fn test_derive_key_bad_iter() { let password = Password::from_slice(&[0u8; 64]).unwrap(); let salt = Salt::from_slice(&[0u8; 16]).unwrap(); assert!(derive_key(&password, &salt, 2, 1024, 32).is_err()); assert!(derive_key(&password, &salt, 3, 1024, 32).is_ok()); assert!(derive_key(&password, &salt, 4, 1024, 32).is_ok()); } #[test] fn test_derive_key_bad_mem() { let password = Password::from_slice(&[0u8; 64]).unwrap(); let salt = Salt::from_slice(&[0u8; 16]).unwrap(); assert!(derive_key(&password, &salt, 3, 7, 32).is_err()); assert!(derive_key(&password, &salt, 3, 8, 32).is_ok()); assert!(derive_key(&password, &salt, 3, 9, 32).is_ok()); } } }
true
cdb78a2fe93f5fe9c52b6970911b26193672e319
Rust
barreiro/euler
/src/main/rust/euler/solver086.rs
UTF-8
3,087
3.015625
3
[ "MIT" ]
permissive
// COPYRIGHT (C) 2017 barreiro. All Rights Reserved. // Rust solvers for Project Euler problems use algorithm::cast::Cast; use algorithm::factor::proper_factors_of; use algorithm::root::square; use Solver; /// A spider, `S`, sits in one corner of a cuboid room, measuring `6` by `5` by `3`, and a fly, `F`, sits in the opposite corner. /// By travelling on the surfaces of the room the shortest "straight line" distance from `S` to `F` is `10` and the path is shown on the diagram. /// /// However, there are up to three "shortest" path candidates for any given cuboid and the shortest route doesn't always have integer length. /// /// It can be shown that there are exactly `2060` distinct cuboids, ignoring rotations, with integer dimensions, up to a maximum size of `M` by `M` by `M`, for which the shortest route has integer length when `M = 100`. /// This is the least value of `M` for which the number of solutions first exceeds two thousand; the number of solutions when `M = 99` is `1975`. /// /// Find the least value of `M` such that the number of solutions first exceeds one million. pub struct Solver086 { pub n: i64, } impl Default for Solver086 { fn default() -> Self { Self { n: 1_000_000 } } } #[allow(clippy::maybe_infinite_iter)] impl Solver for Solver086 { fn solve(&self) -> i64 { // for a cuboid a, b, c with a >= b >= c >= 1, the point of shortest path a_min (along the a side) is given by (b * a) / (c + b) // the length of the path d is sqrt(a_min^2 + b^2) + sqrt((a - a_min)^2 + c^2), substituting it simplifies to sqrt(a^2 + (b+c)^2) // we want to find the number of values s = (b + c) such that a^2 + s^2 is a square (with the constrain a >= b >= c >= 1) // we are after factor pairs of a^2 (because a^2 = d^2 - s^2 = (d + s)(d - s)) with parity (to generate integer solutions) // given one of these pairs x and y, there are two solutions s = (y + x) / 2 and s = (y - x) / 2 // since d > s, the only that conform to the bounds is s = (y - x) / 2 // there are s / 2 different ways for 2 numbers to add up to s and since a >= b >= c, s <= 2 * a // we must subtract to that the ways where one of the terms is bigger than a let (parity, average) = (|&(x, y): &(_, _)| x & 1 == y & 1, |(x, y)| (y - x) / 2); // return the number of cuboids with integer minimum distance == d and longest side == a let cuboids = |a| -> i64 { let (a_square, bound) = (square(a), |&s: &_| s < a * 2); let factor_pair = |x| (x, a_square / x); // skip the trivial sqrt solution where both factors are equal proper_factors_of(a_square).skip(1).map(factor_pair).filter(parity).map(average).take_while(bound).map(|s| (s >> 1) - 0.max(s - a - 1)).sum() }; // sum the contributions of the cuboids until it goes over the number of solutions required (1..).scan(0, |count, m| { *count += cuboids(m); Some(m + 1).filter(|_| *count <= self.n) }).last().as_i64() } }
true
b11372d58dabb97d94a43577b61d53adc13f6e3a
Rust
Isaac-Lozano/i3status-rs
/src/block/time.rs
UTF-8
589
3.1875
3
[ "MIT" ]
permissive
//! A quick time block. Spits out the output of strftime and updates once a //! second. use block::{Block, Status}; use chrono::offset::local::Local; use std::time::Duration; #[derive(Debug)] pub struct Time<'a> { format: &'a str, } impl<'a> Time<'a> { pub fn new(format: &'a str) -> Time<'a> { Time { format: format } } } impl<'a> Block for Time<'a> { fn update(&mut self) -> (Status, Duration) { let time = format!("{}", Local::now().format(self.format)); (Status::new(time), Duration::new(1, 0)) } fn click_callback(&mut self) {} }
true
a13461043540fa9fe531a7cdea2265376d286596
Rust
grogers0/advent_of_code
/2021/day16/src/main.rs
UTF-8
9,145
3.234375
3
[ "MIT" ]
permissive
use std::io::{self, Read}; struct BitString(Vec<u8>); impl BitString { fn from_hex(s: &str) -> Self { fn hex_ch(ch: u8) -> u8 { match ch { b'A'..=b'F' => ch - b'A' + 10, b'0'..=b'9' => ch - b'0', _ => panic!() } } let s = s.trim_end(); if s.len() % 2 != 0 { panic!() } let data = s.as_bytes() .chunks(2) .map(|pair| hex_ch(pair[0]) << 4 | hex_ch(pair[1])) .collect(); BitString(data) } fn iter<'a>(&'a self) -> BitStringIter<'a> { BitStringIter { data: &self.0, idx: 0 } } } struct BitStringIter<'a> { data: &'a [u8], idx: usize } impl <'a> Iterator for BitStringIter<'a> { type Item = bool; fn next(&mut self) -> Option<bool> { if self.idx / 8 >= self.data.len() { return None } let byte_idx = self.idx / 8; let bit_idx = 7 - (self.idx % 8); let ret = (self.data[byte_idx] & (1 << bit_idx)) != 0; self.idx += 1; Some(ret) } } impl <'a> BitStringIter<'a> { fn read_u8(&mut self, nbits: usize) -> u8 { assert!(nbits <= 8 && nbits > 0); let mut ret = 0; for _ in 0..nbits { ret = (ret << 1) | if self.next().unwrap() { 1 } else { 0 }; } ret } fn read_u16(&mut self, nbits: usize) -> u16 { assert!(nbits <= 16 && nbits > 0); let mut ret = 0; for _ in 0..nbits { ret = (ret << 1) | if self.next().unwrap() { 1 } else { 0 }; } ret } fn assert_padding(&mut self) { while let Some(bit) = self.next() { assert_eq!(false, bit); } } } struct Packet { version: u8, contents: PacketContents, } impl Packet { fn parse(puzzle_input: &str) -> Self { let bits = BitString::from_hex(puzzle_input); let mut bits = bits.iter(); let ret = Packet::parse_from_bits(&mut bits); bits.assert_padding(); ret } fn parse_from_bits(bits: &mut BitStringIter) -> Self { let version = bits.read_u8(3); let type_id = bits.read_u8(3); if type_id == 4 { let mut value = 0u64; loop { let group = bits.read_u8(5); value = (value << 4) | (group & 0xf) as u64; if (group & 0x10) == 0 { break } } let contents = PacketContents::Literal(value); Packet { version, contents } } else { let operator_type = OperatorType::from_type_id(type_id); let length_type = LengthType::parse_from_bits(bits); let length = match length_type { LengthType::TotalBits => bits.read_u16(15), LengthType::NumPackets => bits.read_u16(11), } as usize; let mut sub_packets = Vec::new(); match length_type { LengthType::NumPackets => { for _ in 0..length { sub_packets.push(Packet::parse_from_bits(bits)); } }, LengthType::TotalBits => { let stop_idx = bits.idx + length; while bits.idx < stop_idx { sub_packets.push(Packet::parse_from_bits(bits)); } assert_eq!(stop_idx, bits.idx); } } let contents = PacketContents::Operator(operator_type, sub_packets); Packet { version, contents } } } } enum PacketContents { Literal(u64), Operator(OperatorType, Vec<Packet>) } enum OperatorType { Sum, Product, Minimum, Maximum, GreaterThan, LessThan, EqualTo } impl OperatorType { fn from_type_id(type_id: u8) -> OperatorType { match type_id { 0 => OperatorType::Sum, 1 => OperatorType::Product, 2 => OperatorType::Minimum, 3 => OperatorType::Maximum, 5 => OperatorType::GreaterThan, 6 => OperatorType::LessThan, 7 => OperatorType::EqualTo, _ => panic!() } } } enum LengthType { TotalBits, NumPackets } impl LengthType { fn parse_from_bits(bits: &mut BitStringIter) -> LengthType { if bits.next().unwrap() { LengthType::NumPackets } else { LengthType::TotalBits } } } fn part1(puzzle_input: &str) -> u64 { fn sum_versions(packet: &Packet) -> u64 { let mut sum = packet.version as u64; if let PacketContents::Operator(_, ref sub_packets) = packet.contents { for sub_packet in sub_packets { sum += sum_versions(sub_packet); } } sum } let packet = Packet::parse(puzzle_input); sum_versions(&packet) } fn part2(puzzle_input: &str) -> u64 { fn calc_with_operators(packet: &Packet) -> u64 { match &packet.contents { PacketContents::Literal(val) => *val, PacketContents::Operator(OperatorType::Sum, sub_packets) => { sub_packets.iter().map(|p| calc_with_operators(p)).sum() }, PacketContents::Operator(OperatorType::Product, sub_packets) => { sub_packets.iter().map(|p| calc_with_operators(p)).product() }, PacketContents::Operator(OperatorType::Minimum, sub_packets) => { sub_packets.iter().map(|p| calc_with_operators(p)).min().unwrap() }, PacketContents::Operator(OperatorType::Maximum, sub_packets) => { sub_packets.iter().map(|p| calc_with_operators(p)).max().unwrap() }, PacketContents::Operator(cmp_op, sub_packets) => { assert_eq!(2, sub_packets.len()); let val_0 = calc_with_operators(&sub_packets[0]); let val_1 = calc_with_operators(&sub_packets[1]); let cmp_result = match cmp_op { OperatorType::GreaterThan => val_0 > val_1, OperatorType::LessThan => val_0 < val_1, OperatorType::EqualTo => val_0 == val_1, _ => panic!(), }; if cmp_result { 1 } else { 0 } }, } } let packet = Packet::parse(puzzle_input); calc_with_operators(&packet) } fn main() { let mut puzzle_input = String::new(); io::stdin().read_to_string(&mut puzzle_input).unwrap(); println!("{}", part1(&puzzle_input)); println!("{}", part2(&puzzle_input)); } #[cfg(test)] mod tests { use super::*; #[test] fn test_part1() { assert!(matches!( Packet::parse("D2FE28"), Packet { version: 6, contents: PacketContents::Literal(2021), })); assert!(matches!( Packet::parse("38006F45291200"), Packet { version: 1, contents: PacketContents::Operator(OperatorType::LessThan, sub_packets), } if matches!(sub_packets.as_slice(), &[ Packet { version: 6, contents: PacketContents::Literal(10), }, Packet { version: 2, contents: PacketContents::Literal(20), }, ]))); assert!(matches!( Packet::parse("EE00D40C823060"), Packet { version: 7, contents: PacketContents::Operator(OperatorType::Maximum, sub_packets), } if matches!(sub_packets.as_slice(), &[ Packet { version: 2, contents: PacketContents::Literal(1), }, Packet { version: 4, contents: PacketContents::Literal(2), }, Packet { version: 1, contents: PacketContents::Literal(3), }, ]))); assert_eq!(16, part1("8A004A801A8002F478")); assert_eq!(12, part1("620080001611562C8802118E34")); assert_eq!(23, part1("C0015000016115A2E0802F182340")); assert_eq!(31, part1("A0016C880162017C3686B18A3D4780")); } #[test] fn test_part2() { assert_eq!(3, part2("C200B40A82")); assert_eq!(54, part2("04005AC33890")); assert_eq!(7, part2("880086C3E88112")); assert_eq!(9, part2("CE00C43D881120")); assert_eq!(1, part2("D8005AC2A8F0")); assert_eq!(0, part2("F600BC2D8F")); assert_eq!(0, part2("9C005AC2F8F0")); assert_eq!(1, part2("9C0141080250320F1802104A08")); } }
true
2ed957ca65b508452238af74bda12846a610fab9
Rust
TheMindCompany/signedurl
/src/daemon/response.rs
UTF-8
1,369
2.828125
3
[ "MIT" ]
permissive
#[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct SignedUrlResponse { pub data: SignedUrlData, } impl SignedUrlResponse { pub fn new() -> SignedUrlResponse { Default::default() } pub fn set_attributes(&mut self, val: SignedUrlAttributes) { self.data.set_attributes(val); } } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct SignedUrlData { pub attributes: SignedUrlAttributes, } impl SignedUrlData { pub fn new() -> SignedUrlData { Default::default() } pub fn set_attributes(&mut self, val: SignedUrlAttributes) { self.attributes = val; } } #[derive(Serialize, Deserialize, Debug, Default, Clone)] pub struct SignedUrlAttributes { pub url: String, pub method: String, pub ttl: i64, pub engine: String, pub request: String, } impl SignedUrlAttributes { pub fn new() -> SignedUrlAttributes { Default::default() } pub fn set_url(&mut self, val: String) { self.url = val; } pub fn set_method(&mut self, val: String) { self.method = val; } pub fn set_ttl(&mut self, val: i64) { self.ttl = val; } pub fn set_engine(&mut self, val: String) { self.engine = val; } pub fn set_request(&mut self, val: String) { self.request = val; } }
true
a7b7adbb9f2e412a5afbaeaf5241cd3741310744
Rust
IThawk/rust-project
/rust-master/src/test/ui/privacy/private-impl-method.rs
UTF-8
311
2.890625
3
[ "Apache-2.0", "MIT", "LicenseRef-scancode-other-permissive", "BSD-3-Clause", "BSD-2-Clause", "NCSA" ]
permissive
mod a { pub struct Foo { pub x: isize } impl Foo { fn foo(&self) {} } } fn f() { impl a::Foo { fn bar(&self) {} // This should be visible outside `f` } } fn main() { let s = a::Foo { x: 1 }; s.bar(); s.foo(); //~ ERROR method `foo` is private }
true
0429763036368c39e39e8c7ca03ba88abaf47760
Rust
neoeinstein/advent-of-code-2019
/src/day12.rs
UTF-8
23,013
3.78125
4
[]
no_license
//! # Day 12: The N-Body Problem //! //! The space near Jupiter is not a very safe place; you need to be careful of a //! big distracting red spot, extreme radiation, and a whole lot of moons //! swirling around. You decide to start by tracking the four largest moons: Io, //! Europa, Ganymede, and Callisto. //! //! After a brief scan, you calculate the position of each moon (your puzzle //! input). You just need to simulate their motion so you can avoid them. //! //! Each moon has a 3-dimensional position (x, y, and z) and a 3-dimensional //! velocity. The position of each moon is given in your scan; the x, y, and z //! velocity of each moon starts at 0. //! //! Simulate the motion of the moons in time steps. Within each time step, first //! update the velocity of every moon by applying gravity. Then, once all moons' //! velocities have been updated, update the position of every moon by applying //! velocity. Time progresses by one step once all of the positions are updated. //! //! To apply gravity, consider every pair of moons. On each axis (x, y, and z), //! the velocity of each moon changes by exactly +1 or -1 to pull the moons //! together. For example, if Ganymede has an x position of 3, and Callisto has //! a x position of 5, then Ganymede's x velocity changes by +1 (because 5 > 3) //! and Callisto's x velocity changes by -1 (because 3 < 5). However, if the //! positions on a given axis are the same, the velocity on that axis does not //! change for that pair of moons. //! //! Once all gravity has been applied, apply velocity: simply add the velocity //! of each moon to its own position. For example, if Europa has a position of //! x=1, y=2, z=3 and a velocity of x=-2, y=0,z=3, then its new position would //! be x=-1, y=2, z=6. This process does not modify the velocity of any moon. //! //! For example, suppose your scan reveals the following positions: //! //! ```text //! <x=-1, y=0, z=2> //! <x=2, y=-10, z=-7> //! <x=4, y=-8, z=8> //! <x=3, y=5, z=-1> //! ``` //! //! Simulating the motion of these moons would produce the following: //! //! After 0 steps: //! //! ```text //! pos=<x=-1, y= 0, z= 2>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 2, y=-10, z=-7>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 4, y= -8, z= 8>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 3, y= 5, z=-1>, vel=<x= 0, y= 0, z= 0> //! ``` //! //! After 1 step: //! //! ```text //! pos=<x= 2, y=-1, z= 1>, vel=<x= 3, y=-1, z=-1> //! pos=<x= 3, y=-7, z=-4>, vel=<x= 1, y= 3, z= 3> //! pos=<x= 1, y=-7, z= 5>, vel=<x=-3, y= 1, z=-3> //! pos=<x= 2, y= 2, z= 0>, vel=<x=-1, y=-3, z= 1> //! ``` //! //! After 2 steps: //! //! ```text //! pos=<x= 5, y=-3, z=-1>, vel=<x= 3, y=-2, z=-2> //! pos=<x= 1, y=-2, z= 2>, vel=<x=-2, y= 5, z= 6> //! pos=<x= 1, y=-4, z=-1>, vel=<x= 0, y= 3, z=-6> //! pos=<x= 1, y=-4, z= 2>, vel=<x=-1, y=-6, z= 2> //! ``` //! //! After 3 steps: //! //! ```text //! pos=<x= 5, y=-6, z=-1>, vel=<x= 0, y=-3, z= 0> //! pos=<x= 0, y= 0, z= 6>, vel=<x=-1, y= 2, z= 4> //! pos=<x= 2, y= 1, z=-5>, vel=<x= 1, y= 5, z=-4> //! pos=<x= 1, y=-8, z= 2>, vel=<x= 0, y=-4, z= 0> //! ``` //! //! After 4 steps: //! //! ```text //! pos=<x= 2, y=-8, z= 0>, vel=<x=-3, y=-2, z= 1> //! pos=<x= 2, y= 1, z= 7>, vel=<x= 2, y= 1, z= 1> //! pos=<x= 2, y= 3, z=-6>, vel=<x= 0, y= 2, z=-1> //! pos=<x= 2, y=-9, z= 1>, vel=<x= 1, y=-1, z=-1> //! ``` //! //! After 5 steps: //! //! ```text //! pos=<x=-1, y=-9, z= 2>, vel=<x=-3, y=-1, z= 2> //! pos=<x= 4, y= 1, z= 5>, vel=<x= 2, y= 0, z=-2> //! pos=<x= 2, y= 2, z=-4>, vel=<x= 0, y=-1, z= 2> //! pos=<x= 3, y=-7, z=-1>, vel=<x= 1, y= 2, z=-2> //! ``` //! //! After 6 steps: //! //! ```text //! pos=<x=-1, y=-7, z= 3>, vel=<x= 0, y= 2, z= 1> //! pos=<x= 3, y= 0, z= 0>, vel=<x=-1, y=-1, z=-5> //! pos=<x= 3, y=-2, z= 1>, vel=<x= 1, y=-4, z= 5> //! pos=<x= 3, y=-4, z=-2>, vel=<x= 0, y= 3, z=-1> //! ``` //! //! After 7 steps: //! //! ```text //! pos=<x= 2, y=-2, z= 1>, vel=<x= 3, y= 5, z=-2> //! pos=<x= 1, y=-4, z=-4>, vel=<x=-2, y=-4, z=-4> //! pos=<x= 3, y=-7, z= 5>, vel=<x= 0, y=-5, z= 4> //! pos=<x= 2, y= 0, z= 0>, vel=<x=-1, y= 4, z= 2> //! ``` //! //! After 8 steps: //! //! ```text //! pos=<x= 5, y= 2, z=-2>, vel=<x= 3, y= 4, z=-3> //! pos=<x= 2, y=-7, z=-5>, vel=<x= 1, y=-3, z=-1> //! pos=<x= 0, y=-9, z= 6>, vel=<x=-3, y=-2, z= 1> //! pos=<x= 1, y= 1, z= 3>, vel=<x=-1, y= 1, z= 3> //! ``` //! //! After 9 steps: //! //! ```text //! pos=<x= 5, y= 3, z=-4>, vel=<x= 0, y= 1, z=-2> //! pos=<x= 2, y=-9, z=-3>, vel=<x= 0, y=-2, z= 2> //! pos=<x= 0, y=-8, z= 4>, vel=<x= 0, y= 1, z=-2> //! pos=<x= 1, y= 1, z= 5>, vel=<x= 0, y= 0, z= 2> //! ``` //! //! After 10 steps: //! //! ```text //! pos=<x= 2, y= 1, z=-3>, vel=<x=-3, y=-2, z= 1> //! pos=<x= 1, y=-8, z= 0>, vel=<x=-1, y= 1, z= 3> //! pos=<x= 3, y=-6, z= 1>, vel=<x= 3, y= 2, z=-3> //! pos=<x= 2, y= 0, z= 4>, vel=<x= 1, y=-1, z=-1> //! ``` //! //! Then, it might help to calculate the total energy in the system. The total //! energy for a single moon is its potential energy multiplied by its kinetic //! energy. A moon's potential energy is the sum of the absolute values of its //! x, y, and z position coordinates. A moon's kinetic energy is the sum of the //! absolute values of its velocity coordinates. Below, each line shows the //! calculations for a moon's potential energy (pot), kinetic energy (kin), and //! total energy: //! //! Energy after 10 steps: //! //! ```text //! pot: 2 + 1 + 3 = 6; kin: 3 + 2 + 1 = 6; total: 6 * 6 = 36 //! pot: 1 + 8 + 0 = 9; kin: 1 + 1 + 3 = 5; total: 9 * 5 = 45 //! pot: 3 + 6 + 1 = 10; kin: 3 + 2 + 3 = 8; total: 10 * 8 = 80 //! pot: 2 + 0 + 4 = 6; kin: 1 + 1 + 1 = 3; total: 6 * 3 = 18 //! Sum of total energy: 36 + 45 + 80 + 18 = 179 //! ``` //! //! In the above example, adding together the total energy for all moons after //! 10 steps produces the total energy in the system, 179. //! //! Here's a second example: //! //! ```text //! <x=-8, y=-10, z=0> //! <x=5, y=5, z=10> //! <x=2, y=-7, z=3> //! <x=9, y=-8, z=-3> //! ``` //! //! Every ten steps of simulation for 100 steps produces: //! //! After 0 steps: //! //! ```text //! pos=<x= -8, y=-10, z= 0>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 5, y= 5, z= 10>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 2, y= -7, z= 3>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 9, y= -8, z= -3>, vel=<x= 0, y= 0, z= 0> //! ``` //! //! After 10 steps: //! //! ```text //! pos=<x= -9, y=-10, z= 1>, vel=<x= -2, y= -2, z= -1> //! pos=<x= 4, y= 10, z= 9>, vel=<x= -3, y= 7, z= -2> //! pos=<x= 8, y=-10, z= -3>, vel=<x= 5, y= -1, z= -2> //! pos=<x= 5, y=-10, z= 3>, vel=<x= 0, y= -4, z= 5> //! ``` //! //! After 20 steps: //! //! ```text //! pos=<x=-10, y= 3, z= -4>, vel=<x= -5, y= 2, z= 0> //! pos=<x= 5, y=-25, z= 6>, vel=<x= 1, y= 1, z= -4> //! pos=<x= 13, y= 1, z= 1>, vel=<x= 5, y= -2, z= 2> //! pos=<x= 0, y= 1, z= 7>, vel=<x= -1, y= -1, z= 2> //! ``` //! //! After 30 steps: //! //! ```text //! pos=<x= 15, y= -6, z= -9>, vel=<x= -5, y= 4, z= 0> //! pos=<x= -4, y=-11, z= 3>, vel=<x= -3, y=-10, z= 0> //! pos=<x= 0, y= -1, z= 11>, vel=<x= 7, y= 4, z= 3> //! pos=<x= -3, y= -2, z= 5>, vel=<x= 1, y= 2, z= -3> //! ``` //! //! After 40 steps: //! //! ```text //! pos=<x= 14, y=-12, z= -4>, vel=<x= 11, y= 3, z= 0> //! pos=<x= -1, y= 18, z= 8>, vel=<x= -5, y= 2, z= 3> //! pos=<x= -5, y=-14, z= 8>, vel=<x= 1, y= -2, z= 0> //! pos=<x= 0, y=-12, z= -2>, vel=<x= -7, y= -3, z= -3> //! ``` //! //! After 50 steps: //! //! ```text //! pos=<x=-23, y= 4, z= 1>, vel=<x= -7, y= -1, z= 2> //! pos=<x= 20, y=-31, z= 13>, vel=<x= 5, y= 3, z= 4> //! pos=<x= -4, y= 6, z= 1>, vel=<x= -1, y= 1, z= -3> //! pos=<x= 15, y= 1, z= -5>, vel=<x= 3, y= -3, z= -3> //! ``` //! //! After 60 steps: //! //! ```text //! pos=<x= 36, y=-10, z= 6>, vel=<x= 5, y= 0, z= 3> //! pos=<x=-18, y= 10, z= 9>, vel=<x= -3, y= -7, z= 5> //! pos=<x= 8, y=-12, z= -3>, vel=<x= -2, y= 1, z= -7> //! pos=<x=-18, y= -8, z= -2>, vel=<x= 0, y= 6, z= -1> //! ``` //! //! After 70 steps: //! //! ```text //! pos=<x=-33, y= -6, z= 5>, vel=<x= -5, y= -4, z= 7> //! pos=<x= 13, y= -9, z= 2>, vel=<x= -2, y= 11, z= 3> //! pos=<x= 11, y= -8, z= 2>, vel=<x= 8, y= -6, z= -7> //! pos=<x= 17, y= 3, z= 1>, vel=<x= -1, y= -1, z= -3> //! ``` //! //! After 80 steps: //! //! ```text //! pos=<x= 30, y= -8, z= 3>, vel=<x= 3, y= 3, z= 0> //! pos=<x= -2, y= -4, z= 0>, vel=<x= 4, y=-13, z= 2> //! pos=<x=-18, y= -7, z= 15>, vel=<x= -8, y= 2, z= -2> //! pos=<x= -2, y= -1, z= -8>, vel=<x= 1, y= 8, z= 0> //! ``` //! //! After 90 steps: //! //! ```text //! pos=<x=-25, y= -1, z= 4>, vel=<x= 1, y= -3, z= 4> //! pos=<x= 2, y= -9, z= 0>, vel=<x= -3, y= 13, z= -1> //! pos=<x= 32, y= -8, z= 14>, vel=<x= 5, y= -4, z= 6> //! pos=<x= -1, y= -2, z= -8>, vel=<x= -3, y= -6, z= -9> //! ``` //! //! After 100 steps: //! //! ```text //! pos=<x= 8, y=-12, z= -9>, vel=<x= -7, y= 3, z= 0> //! pos=<x= 13, y= 16, z= -3>, vel=<x= 3, y=-11, z= -5> //! pos=<x=-29, y=-11, z= -1>, vel=<x= -3, y= 7, z= 4> //! pos=<x= 16, y=-13, z= 23>, vel=<x= 7, y= 1, z= 1> //! ``` //! //! Energy after 100 steps: //! //! ```text //! pot: 8 + 12 + 9 = 29; kin: 7 + 3 + 0 = 10; total: 29 * 10 = 290 //! pot: 13 + 16 + 3 = 32; kin: 3 + 11 + 5 = 19; total: 32 * 19 = 608 //! pot: 29 + 11 + 1 = 41; kin: 3 + 7 + 4 = 14; total: 41 * 14 = 574 //! pot: 16 + 13 + 23 = 52; kin: 7 + 1 + 1 = 9; total: 52 * 9 = 468 //! Sum of total energy: 290 + 608 + 574 + 468 = 1940 //! ``` //! //! What is the total energy in the system after simulating the moons given in //! your scan for 1000 steps? //! ## Part Two //! //! All this drifting around in space makes you wonder about the nature of the //! universe. Does history really repeat itself? You're curious whether the //! moons will ever return to a previous state. //! //! Determine the number of steps that must occur before all of the moons' //! positions and velocities exactly match a previous point in time. //! //! For example, the first example above takes 2772 steps before they exactly //! match a previous point in time; it eventually returns to the initial state: //! //! After 0 steps: //! //! ```text //! pos=<x= -1, y= 0, z= 2>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 2, y=-10, z= -7>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 4, y= -8, z= 8>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 3, y= 5, z= -1>, vel=<x= 0, y= 0, z= 0> //! ``` //! //! After 2770 steps: //! //! ```text //! pos=<x= 2, y= -1, z= 1>, vel=<x= -3, y= 2, z= 2> //! pos=<x= 3, y= -7, z= -4>, vel=<x= 2, y= -5, z= -6> //! pos=<x= 1, y= -7, z= 5>, vel=<x= 0, y= -3, z= 6> //! pos=<x= 2, y= 2, z= 0>, vel=<x= 1, y= 6, z= -2> //! ``` //! //! After 2771 steps: //! //! ```text //! pos=<x= -1, y= 0, z= 2>, vel=<x= -3, y= 1, z= 1> //! pos=<x= 2, y=-10, z= -7>, vel=<x= -1, y= -3, z= -3> //! pos=<x= 4, y= -8, z= 8>, vel=<x= 3, y= -1, z= 3> //! pos=<x= 3, y= 5, z= -1>, vel=<x= 1, y= 3, z= -1> //! ``` //! //! After 2772 steps: //! //! ```text //! pos=<x= -1, y= 0, z= 2>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 2, y=-10, z= -7>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 4, y= -8, z= 8>, vel=<x= 0, y= 0, z= 0> //! pos=<x= 3, y= 5, z= -1>, vel=<x= 0, y= 0, z= 0> //! ``` //! //! Of course, the universe might last for a very long time before repeating. //! Here's a copy of the second example from above: //! //! ```text //! <x=-8, y=-10, z=0> //! <x=5, y=5, z=10> //! <x=2, y=-7, z=3> //! <x=9, y=-8, z=-3> //! ``` //! //! This set of initial positions takes 4686774924 steps before it repeats a //! previous state! Clearly, you might need to find a more efficient way to //! simulate the universe. //! //! How many steps does it take to reach the first state that exactly matches a //! previous state? use lazy_static::lazy_static; use num_integer::Integer; use regex::Regex; pub const PUZZLE_INPUT: &str = include_str!("../inputs/input-12"); trait Energetic { fn energy(&self) -> usize; } #[derive(Clone, Copy, Debug, PartialEq, Eq)] struct Position3D { x: i16, y: i16, z: i16, } impl std::str::FromStr for Position3D { type Err = anyhow::Error; fn from_str(s: &str) -> Result<Self, Self::Err> { lazy_static! { static ref REGEX: Regex = Regex::new(r#"<x=(-?\d+), y=(-?\d+), z=(-?\d+)>"#).unwrap(); }; if let Some(c) = REGEX.captures(s) { Ok(Position3D { x: c.get(1).unwrap().as_str().parse()?, y: c.get(2).unwrap().as_str().parse()?, z: c.get(3).unwrap().as_str().parse()?, }) } else { Err(anyhow::anyhow!("Invalid input string")) } } } impl std::ops::Add<Velocity3D> for Position3D { type Output = Self; fn add(self, r: Velocity3D) -> Self::Output { Position3D { x: self.x + r.x, y: self.y + r.y, z: self.z + r.z, } } } impl std::ops::AddAssign<Velocity3D> for Position3D { fn add_assign(&mut self, v: Velocity3D) { self.x += v.x; self.y += v.y; self.z += v.z; } } impl Energetic for Position3D { fn energy(&self) -> usize { self.x.abs() as usize + self.y.abs() as usize + self.z.abs() as usize } } #[derive(Clone, Copy, Debug, PartialEq, Eq)] struct Velocity3D { x: i16, y: i16, z: i16, } impl Velocity3D { const ZERO: Velocity3D = Velocity3D { x: 0, y: 0, z: 0 }; } impl Default for Velocity3D { #[inline] fn default() -> Self { Self::ZERO } } impl std::ops::Add for Velocity3D { type Output = Self; fn add(self, r: Self) -> Self::Output { Velocity3D { x: self.x + r.x, y: self.y + r.y, z: self.z + r.z, } } } impl std::ops::AddAssign for Velocity3D { fn add_assign(&mut self, r: Self) { self.x += r.x; self.y += r.y; self.z += r.z; } } impl std::ops::Sub for Velocity3D { type Output = Self; fn sub(self, r: Self) -> Self::Output { Velocity3D { x: self.x - r.x, y: self.y - r.y, z: self.z - r.z, } } } impl std::ops::SubAssign for Velocity3D { fn sub_assign(&mut self, r: Self) { self.x -= r.x; self.y -= r.y; self.z -= r.z; } } impl Energetic for Velocity3D { fn energy(&self) -> usize { self.x.abs() as usize + self.y.abs() as usize + self.z.abs() as usize } } fn parse_input(input: &str) -> anyhow::Result<Vec<Position3D>> { use std::io::{BufRead, Cursor}; let positions = Cursor::new(input) .lines() .filter_map(|line_result| match line_result { Ok(line) => { let trimmed = line.trim(); if trimmed.is_empty() { None } else { Some(trimmed.parse().map_err(anyhow::Error::from)) } } Err(err) => Some(Err(anyhow::Error::from(err))), }) .collect::<anyhow::Result<Vec<_>>>()?; Ok(positions) } #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)] struct Axis { position: i16, velocity: i16, } impl Axis { fn new(position: i16) -> Self { Self { position, velocity: 0, } } fn step_velocity(&mut self, other: &mut Self) { use std::cmp::Ordering; let dv = match self.position.cmp(&other.position) { Ordering::Less => -1, Ordering::Greater => 1, Ordering::Equal => 0, }; self.velocity -= dv; other.velocity += dv; } fn step_position(&mut self) { self.position += self.velocity; } } #[derive(Clone, Copy, Debug, PartialEq, Eq)] struct Axis3D { x: Axis, y: Axis, z: Axis, } impl From<Position3D> for Axis3D { fn from(p: Position3D) -> Self { Self { x: Axis::new(p.x), y: Axis::new(p.y), z: Axis::new(p.z), } } } impl Axis3D { fn step_velocity(&mut self, other: &mut Self) { self.x.step_velocity(&mut other.x); self.y.step_velocity(&mut other.y); self.z.step_velocity(&mut other.z); } fn step_position(&mut self) { self.x.step_position(); self.y.step_position(); self.z.step_position(); } } impl From<Axis3D> for Position3D { fn from(a: Axis3D) -> Self { Self { x: a.x.position, y: a.y.position, z: a.z.position, } } } impl From<Axis3D> for Velocity3D { fn from(a: Axis3D) -> Self { Self { x: a.x.velocity, y: a.y.velocity, z: a.z.velocity, } } } impl Energetic for Axis3D { fn energy(&self) -> usize { let potential = self.x.position.abs() as usize + self.y.position.abs() as usize + self.z.position.abs() as usize; let kinetic = self.x.velocity.abs() as usize + self.y.velocity.abs() as usize + self.z.velocity.abs() as usize; potential * kinetic } } fn step_until_loop(initial: Vec<Axis>) -> usize { let mut steps = 0; let mut axes = initial.clone(); loop { for i in 0..(axes.len() - 1) { for j in (i + 1)..axes.len() { let (l, r) = axes.split_at_mut(j); l[i].step_velocity(&mut r[0]); } } for axis in &mut axes { axis.step_position(); } steps += 1; if axes == initial { break; } } steps } #[derive(Clone, Debug, PartialEq, Eq)] struct MoonField { moons: Vec<Axis3D>, } impl MoonField { pub fn new(initial_pos: Vec<Position3D>) -> Self { Self { moons: initial_pos.into_iter().map(Axis3D::from).collect(), } } fn x(&self) -> Vec<Axis> { self.moons.iter().copied().map(|m| m.x).collect() } fn y(&self) -> Vec<Axis> { self.moons.iter().copied().map(|m| m.y).collect() } fn z(&self) -> Vec<Axis> { self.moons.iter().copied().map(|m| m.z).collect() } #[cfg(test)] fn pos(&self) -> Vec<Position3D> { self.moons .iter() .copied() .map(Position3D::from) .collect::<Vec<_>>() } #[cfg(test)] fn vel(&self) -> Vec<Velocity3D> { self.moons .iter() .copied() .map(Velocity3D::from) .collect::<Vec<_>>() } fn step_velocity(&mut self) { for i in 0..(self.moons.len() - 1) { for j in (i + 1)..self.moons.len() { let (l, r) = self.moons.split_at_mut(j); l[i].step_velocity(&mut r[0]); } } } fn step_positions(&mut self) { for m in self.moons.iter_mut() { m.step_position(); } } pub fn step(&mut self) { self.step_velocity(); self.step_positions(); } fn cycle_time(&self) -> usize { let x_steps = step_until_loop(self.x()); log::info!("x steps: {}", x_steps); let y_steps = step_until_loop(self.y()); log::info!("y steps: {}", y_steps); let z_steps = step_until_loop(self.z()); log::info!("z steps: {}", z_steps); x_steps.lcm(&y_steps).lcm(&z_steps) } } impl Energetic for MoonField { fn energy(&self) -> usize { self.moons.iter().map(Energetic::energy).sum() } } impl Iterator for MoonField { type Item = usize; fn next(&mut self) -> Option<Self::Item> { self.step(); let energy = self.energy(); log::debug!("Current energy: {}", energy); if energy == 0 { None } else { Some(energy) } } } pub fn run() -> anyhow::Result<()> { let positions = parse_input(PUZZLE_INPUT)?; let mut field = MoonField::new(positions); println!( "Energy at step 1000: {}", field.nth(999).unwrap_or_default() ); println!("Steps to repeat initial condition: {}", field.cycle_time()); Ok(()) } #[cfg(test)] mod tests { use super::{parse_input, MoonField, Position3D, Velocity3D}; use anyhow::Result; use pretty_assertions::assert_eq; const EXAMPLE_INPUT_1: &str = " <x=-1, y=0, z=2> <x=2, y=-10, z=-7> <x=4, y=-8, z=8> <x=3, y=5, z=-1>"; #[test] fn verify_step_1() -> Result<()> { crate::init_logging(); let positions = parse_input(EXAMPLE_INPUT_1)?; let mut field = MoonField::new(positions); println!("{:#?}", field); field.step_velocity(); let expected_velocities = vec![ Velocity3D { x: 3, y: -1, z: -1 }, Velocity3D { x: 1, y: 3, z: 3 }, Velocity3D { x: -3, y: 1, z: -3 }, Velocity3D { x: -1, y: -3, z: 1 }, ]; assert_eq!(field.vel(), expected_velocities); field.step_positions(); let expected_positions = vec![ Position3D { x: 2, y: -1, z: 1 }, Position3D { x: 3, y: -7, z: -4 }, Position3D { x: 1, y: -7, z: 5 }, Position3D { x: 2, y: 2, z: 0 }, ]; assert_eq!(field.pos(), expected_positions); Ok(()) } #[test] fn verify_energy_after_step_10() -> Result<()> { crate::init_logging(); let positions = parse_input(EXAMPLE_INPUT_1)?; let mut field = MoonField::new(positions); println!("{:#?}", field); const EXPECTED: usize = 179; let energy = field.nth(9).unwrap_or_default(); println!("{:#?}", field); assert_eq!(energy, EXPECTED); Ok(()) } const EXAMPLE_INPUT_2: &str = " <x=-8, y=-10, z=0> <x=5, y=5, z=10> <x=2, y=-7, z=3> <x=9, y=-8, z=-3>"; #[test] fn verify_energy_after_step_100() -> Result<()> { crate::init_logging(); let positions = parse_input(EXAMPLE_INPUT_2)?; let mut field = MoonField::new(positions); println!("{:#?}", field); const EXPECTED: usize = 1940; let energy = field.nth(99).unwrap_or_default(); println!("{:#?}", field); assert_eq!(energy, EXPECTED); Ok(()) } #[test] fn find_cycle_time_1() -> Result<()> { crate::init_logging(); let positions = parse_input(EXAMPLE_INPUT_1)?; let field = MoonField::new(positions); const EXPECTED: usize = 2772; assert_eq!(field.cycle_time(), EXPECTED); Ok(()) } #[test] fn find_cycle_time_2() -> Result<()> { crate::init_logging(); let positions = parse_input(EXAMPLE_INPUT_2)?; let field = MoonField::new(positions); const EXPECTED: usize = 4_686_774_924; assert_eq!(field.cycle_time(), EXPECTED); Ok(()) } }
true
ee0c04f480e062a6bad7ac32fe0c6dde0277e706
Rust
zeerorg/A-I-Rust
/src/algo/dfid.rs
UTF-8
3,245
3.203125
3
[]
no_license
use std::hash::Hash; use std::collections::HashSet; use std::fmt::Display; use helper::node::*; pub fn dfid<T: PartialEq + Hash + Eq + Clone + Display> (start: &T, goal_function: &Fn(&T) -> bool, _functions: &Vec<&Fn(&T) -> T>) -> bool { let mut prev_node_count = 0; let mut depth_allowed = 1; loop { let (found, searched) = dfs_depth(start, goal_function, _functions, depth_allowed); println!("{} {}", found, searched); depth_allowed += 1; if found { return true; } if searched == prev_node_count { return false; } prev_node_count = searched; } } fn dfs_depth<T: PartialEq + Hash + Eq + Clone + Display> (start: &T, goal_function: &Fn(&T) -> bool, _functions: &Vec<&Fn(&T) -> T>, max_depth: i32) -> (bool, i32) { let mut open: Vec<NodeDepth<T>> = Vec::new(); let mut visited: HashSet<T> = HashSet::new(); open.push(NodeDepth::new(start.clone(), 0)); while !open.is_empty() { let to_visit = open.pop(); match to_visit { Some(val) => { let curr_depth = val.depth; let to_visit = val.node; print!("{} ", curr_depth); if visited.contains(&to_visit) { continue; } if goal_function(&to_visit) { return (true, visited.len() as i32); } if curr_depth < max_depth { visited.insert(to_visit.clone()); let mut nodes: Vec<NodeDepth<T>> = (&_functions).into_iter().map(|func| func(&to_visit)).map(|node_val| NodeDepth::new(node_val, curr_depth+1)).rev().collect(); open.append(&mut nodes); } } None => break } } return (false, visited.len() as i32); } #[cfg(test)] mod tests { use super::*; use problems::water_jug::*; use problems::eight_puzz::*; #[test] fn dfid_test() { let start_jug = Jugs::new(0, 0, 3, 4); fn goal_check(state: &Jugs) -> bool { return state.jug_b == 2 || state.jug_a == 2; } let (flag, _) = dfs_depth(&start_jug, &goal_check, &vec![&fill_a, &fill_b, &empty_a, &empty_b, &trn_a_to_b, &trn_b_to_a], 1000); assert_eq!(dfid(&start_jug, &goal_check, &vec![&fill_a, &fill_b, &empty_a, &empty_b, &trn_a_to_b, &trn_b_to_a]), true); assert_eq!(flag, true); } #[test] fn dfid_neq_test() { fn test_gt_2(x: &i32) -> bool { return *x > 2; } assert_eq!(dfid(&1, &test_gt_2, &vec![]), false); } #[test] fn dfid_8puzz_test() { let start_puzzle = Puzzle::new([ [1, 2, 3], [4, 5, 6], [7, 8, 0] ]); fn is_final(to_check: &Puzzle) -> bool { return (*to_check) == Puzzle::new([ [5, 2, 3], [8, 1, 6], [7, 0, 4] ]) } assert_eq!(dfid(&start_puzzle, &is_final, &vec![&from_down, &from_up, &from_right, &from_left]), true); } }
true
10e9166867cbef4f976a440f7350f264befc5618
Rust
kwyse/altitude
/src/delegator.rs
UTF-8
3,051
3.46875
3
[]
no_license
use sdl2::event::Event; use sdl2::keyboard::Keycode; use entities::{Position, Velocity}; /// Controls an entity, such as through user input or through AI. pub trait Delegator { /// The object that the delegator controls. type Delegate; /// The object controlling the delegate. type Delegator; /// Actions that will be taken to control the delegate. fn delegate(&mut self, delegator: &Self::Delegator, delegate: &mut Self::Delegate); } /// Captures input to control the player entity. pub struct PlayerInput { movement: MovementKeys, } impl PlayerInput { pub fn new() -> Self { Self { movement: MovementKeys { up: false, down: false, left: false, right: false, }, } } } impl<'ui> Delegator for PlayerInput { type Delegate = Velocity; type Delegator = Vec<Event>; fn delegate(&mut self, delegator: &Self::Delegator, delegate: &mut Self::Delegate) { for event in delegator.iter() { match event { &Event::KeyDown { keycode: Some(keycode), .. } => { match keycode { Keycode::W => self.movement.up = true, Keycode::S => self.movement.down = true, Keycode::A => self.movement.left = true, Keycode::D => self.movement.right = true, _ => { }, } }, &Event::KeyUp { keycode: Some(keycode), .. } => { match keycode { Keycode::W => self.movement.up = false, Keycode::S => self.movement.down = false, Keycode::A => self.movement.left = false, Keycode::D => self.movement.right = false, _ => { }, } }, _ => { }, } } let mut vel_y = delegate.y; if self.movement.up { vel_y = -1.0_f64.max(vel_y - 1.0); } else { vel_y = 0.0_f64.max(vel_y); } if self.movement.down { vel_y = 1.0_f64.min(vel_y + 1.0); } else { vel_y = 0.0_f64.min(vel_y); } let mut vel_x = delegate.x; if self.movement.left { vel_x = -1.0_f64.max(vel_x - 1.0); } else { vel_x = 0.0_f64.max(vel_x); } if self.movement.right { vel_x = 1.0_f64.min(vel_x + 1.0); } else { vel_x = 0.0_f64.min(vel_x); } delegate.x = vel_x; delegate.y = vel_y; println!("({}, {})", delegate.x, delegate.y); } } struct MovementKeys { up: bool, down: bool, left: bool, right: bool, } pub struct EnemyHeuristic; impl Delegator for EnemyHeuristic { type Delegate = Velocity; type Delegator = Position; fn delegate(&mut self, delegator: &Self::Delegator, delegate: &mut Self::Delegate) { if delegator.x < delegate.x { delegate.x = -1.0; } else { delegate.x = 1.0; } } }
true
fce188bf039f256cf3811815cef71a24b2620df0
Rust
tengrommel/lesson
/Algorithm/lesson1/ex-sorting/src/lib.rs
UTF-8
4,756
3.46875
3
[]
no_license
mod rand; use std::fmt::Debug; use rayon::prelude::*; pub fn bubble_sort<T: PartialOrd + Debug>(v: &mut [T]) { for p in 0..v.len() { // println!("{:?}", v); let mut sorted = true; for i in 0..(v.len()-1) - p{ if v[i] > v[i+1] { v.swap(i, i+1); sorted = false; } } if sorted { return; } } } pub fn merge_sort<T: PartialOrd + Debug>(mut v: Vec<T>) -> Vec<T> { // sort the left half // sort the right half O(n*ln(n)) // bring the sorted half together O(n) if v.len() <= 1 { return v; } let mut res = Vec::with_capacity(v.len()); let b = v.split_off(v.len()/2); let a = merge_sort(v); let b = merge_sort(b); // bring them together again add whichever is lowest the front of a or the front of b let mut a_it = a.into_iter(); let mut b_it = b.into_iter(); let mut a_peek = a_it.next(); let mut b_peek = b_it.next(); loop { match a_peek { Some(ref a_val) => match b_peek{ Some(ref b_val) =>{ if b_val < a_val { res.push(b_peek.take().unwrap()); b_peek = b_it.next(); } else { res.push(a_peek.take().unwrap()); a_peek = a_it.next(); } } None => { res.push(a_peek.take().unwrap()); res.extend(a_it); return res; } } None => { if let Some(b_val) = b_peek { res.push(b_val); } res.extend(b_it); return res; } } } } // Move first element to the correct place // Everything lower should be before it, // everything higher should be after it // return it's location pub fn pivot<T: PartialOrd>(v: &mut [T]) -> usize { let mut p = rand::read(v.len()); v.swap(p, 0); p = 0; for i in 1..v.len() { if v[i] < v[p] { // move our pivot forward 1, and put this element before it v.swap(p+1, i); v.swap(p, p+1); p += 1 } } p } pub fn quick_sort<T: PartialOrd + Debug>(v: &mut [T]) { if v.len() <= 1 { return; } let p = pivot(v); println!("{:?}", v); let (a, b) = v.split_at_mut(p); quick_sort(a); quick_sort(&mut b[1..]); } struct RawSend<T>(*mut [T]); // one element tuple unsafe impl<T> Send for RawSend<T>{} pub fn threaded_quick_sort<T: 'static + PartialOrd + Debug + Send>(v: &mut [T]) { if v.len() <= 1 { return; } let p = pivot(v); println!("{:?}", v); let (a, b) = v.split_at_mut(p); let raw_a = a as *mut [T]; let raw_s = RawSend(raw_a); unsafe { let handle = std::thread::spawn(move || { threaded_quick_sort(&mut *raw_s.0); }); threaded_quick_sort(&mut b[1..]); // compiler doesn't know that we join these // We do handle.join().ok(); } } pub fn quick_sort_rayon<T: Send + PartialOrd + Debug>(v: &mut[T]) { if v.len() <= 1 { return; } let p = pivot(v); println!("{:?}", v); let (a, b) = v.split_at_mut(p); // put f2 on queue then start f1; // if another thread is ready it will steal f2 // this works recursively recursively down the stack rayon::join(||quick_sort_rayon(a), || quick_sort_rayon(&mut b[1..])); } #[cfg(test)] mod tests { use super::*; #[test] fn test_bubble_sort() { let mut v = vec![4, 6, 1, 8, 11, 13, 3]; bubble_sort(&mut v); assert_eq!(v, vec![1,3,4,6,8,11,13]); } #[test] fn test_merge_sort() { let v = vec![4, 6, 1, 8, 11, 13, 3]; let v = merge_sort(v); assert_eq!(v, vec![1, 3, 4, 6, 8, 11, 13]); } #[test] fn test_pivot() { let mut v = vec![4, 6, 1, 19, 8, 11, 13, 3]; let p = pivot(&mut v); for x in 0..v.len() { assert_eq!(v[x] < v[p], x < p); } } #[test] fn test_quick_sort() { let mut v = vec![4, 6, 1, 8, 11, 13, 3]; quick_sort(&mut v); assert_eq!(v, vec![1, 3, 4, 6, 8, 11, 13]) } #[test] fn test_quick_sort_threaded() { let mut v = vec![4, 6, 1, 8, 11, 13, 3]; threaded_quick_sort(&mut v); assert_eq!(v, vec![1, 3, 4, 6, 8, 11, 13]) } #[test] fn test_quick_sort_rayon() { let mut v = vec![4, 6, 1, 8, 11, 13, 3]; quick_sort_rayon(&mut v); assert_eq!(v, vec![1, 3, 4, 6, 8, 11, 13]) } }
true
16c8f88a090c1088719d98d388a90e6f6c515118
Rust
carribus/rust-game-experiments
/ggez-test2/src/components.rs
UTF-8
467
2.734375
3
[]
no_license
use ggez::graphics::Color; #[derive(Debug, Copy, Clone, Default, PartialEq)] pub struct Position { pub x: f32, pub y: f32, } #[derive(Debug, Copy, Clone, Default, PartialEq)] pub struct Velocity { pub xv: f32, pub yv: f32, } #[derive(Debug, Copy, Clone, PartialEq)] pub enum ShapeType { Rectangle(f32, f32), Circle(f32), } #[derive(Debug, Copy, Clone, PartialEq)] pub struct Shape { pub shape_type: ShapeType, pub colour: Color, }
true
376013f1f1730af17eb85e5bb729afb50ae4f805
Rust
tarkah/nhl-notifier
/src/cli.rs
UTF-8
2,288
2.96875
3
[ "MIT" ]
permissive
use crate::config::{generate_empty_config, AppConfig}; use failure::{bail, Error, ResultExt}; use std::path::PathBuf; use structopt::StructOpt; #[derive(Debug, StructOpt)] #[structopt( name = "nhl-notifier", about = "Get live game updates via SMS for your favorite NHL team.", version = "0.1.0", author = "tarkah <[email protected]>" )] pub struct Opt { #[structopt(subcommand)] // Note that we mark a field as a subcommand pub cmd: Command, } #[derive(Debug, StructOpt)] pub enum Command { /// Run the program Run { #[structopt(short, long, parse(from_os_str))] /// Specify path to the config.yml file config: PathBuf, #[structopt(long = "twil-sid", env = "TWIL_ACCOUNT_SID")] twil_sid: Option<String>, #[structopt(long = "twil-token", env = "TWIL_AUTH_TOKEN", hide_env_values = true)] twil_token: Option<String>, #[structopt(long = "twil-from", env = "TWIL_FROM")] /// Specify the From number for twilio, must be formatted as '+15555555' twil_from: Option<String>, }, /// Generate an empty config.yml file to the current directory Generate, } pub fn parse_opts() -> Result<CliStatus, Error> { let opt = Opt::from_args(); log::debug!("Cli opts are: {:?}", opt); match opt.cmd { Command::Generate => { generate_empty_config().context("Failed to generate config")?; log::info!("config.yml generated"); Ok(CliStatus::Exit) } Command::Run { config, twil_sid, twil_token, twil_from, } => { if twil_sid.is_none() || twil_token.is_none() || twil_from.is_none() { bail!("TWIL_ACCOUNT_SID, TWIL_AUTH_TOKEN & TWIL_FROM env variables must be set, or passed via --twil-sid, --twil-token & --twil-from"); } let twil_sid = twil_sid.unwrap(); let twil_token = twil_token.unwrap(); let twil_from = twil_from.unwrap(); let app_config = AppConfig::new(config, twil_sid, twil_token, twil_from) .context("Failed to get config")?; Ok(CliStatus::Continue(app_config)) } } } pub enum CliStatus { Continue(AppConfig), Exit, }
true
87357fd50e310644a20f3dc6f1172c96f8c09296
Rust
horellana/yofi
/src/usage_cache.rs
UTF-8
2,583
3
3
[ "MIT" ]
permissive
use std::borrow::Borrow; use std::collections::HashMap; use std::fs::File; use std::hash::Hash; use std::io::{BufRead, BufReader, Write}; use std::path::Path; pub struct Usage(HashMap<String, usize>); impl Usage { pub fn from_path(path: impl AsRef<Path>) -> Self { let usage = crate::desktop::xdg_dirs() .place_cache_file(path) .and_then(File::open) .map_err(|e| { if e.kind() != std::io::ErrorKind::NotFound { log::error!("cannot open cache file: {}", e) } }) .map(BufReader::new) .into_iter() .flat_map(|rdr| { rdr.lines() .filter(|l| l.as_ref().map(|l| !l.is_empty()).unwrap_or(true)) .map(|l| { let line = l.map_err(|e| { log::error!("unable to read the line from cache: {}", e) })?; let mut iter = line.split(' '); let (count, entry) = (iter.next().ok_or(())?, iter.next().ok_or(())?); let count = count.parse().map_err(|e| { log::error!( "invalid cache file, unable to parse count (\"{}\"): {}", count, e ) })?; Ok((entry.to_string(), count)) }) }) .collect::<Result<_, ()>>() .unwrap_or_default(); Self(usage) } pub fn entry_count<Q: ?Sized>(&self, entry: &Q) -> usize where String: Borrow<Q>, Q: Hash + Eq, { self.0.get(entry).copied().unwrap_or(0) } pub fn increment_entry_usage(&mut self, entry: String) { *self.0.entry(entry).or_default() += 1; } pub fn try_update_cache(&self, path: impl AsRef<Path>) { if let Err(e) = crate::desktop::xdg_dirs() .place_cache_file(path) .and_then(File::create) .and_then(|mut f| { let mut buf = vec![]; for (entry, count) in &self.0 { let s = format!("{} ", count); buf.extend(s.as_bytes()); buf.extend(entry.as_bytes()); buf.push(b'\n'); } f.write_all(&buf) }) { log::error!("failed to update cache: {}", e); } } }
true
c3837bf90f14b1c57ff8c4f6a56041274bef63f1
Rust
nlicitra/best-friend
/src/utils.rs
UTF-8
1,410
3.171875
3
[ "MIT", "Apache-2.0" ]
permissive
#[allow(dead_code)] pub fn set_panic_hook() { // When the `console_error_panic_hook` feature is enabled, we can call the // `set_panic_hook` function at least once during initialization, and then // we will get better error messages if our code ever panics. // // For more details see // https://github.com/rustwasm/console_error_panic_hook#readme #[cfg(feature = "console_error_panic_hook")] console_error_panic_hook::set_once(); } pub fn mean(set: &[f32]) -> f32 { set.iter().sum::<f32>() / (set.len() as f32) } pub fn median(set: &[f32]) -> f32 { let mut copy = vec![0.; set.len()]; copy[..].clone_from_slice(set); copy.sort_by(|a, b| a.partial_cmp(b).unwrap()); let middle_index = copy.len() / 2; if copy.len() % 2 == 0 { return mean(&copy[middle_index - 1..middle_index]); } copy[middle_index] } #[cfg(test)] mod tests { use super::*; #[test] fn test_mean() { let set: &[f32] = &[1., 2., 3., 4.]; assert_eq!(mean(set), 2.5); } #[test] fn test_median_even() { let set: &[f32] = &[1., 2., 3., 4.]; assert_eq!(mean(set), 2.5); } #[test] fn test_median_odd() { let set: &[f32] = &[1., 2., 3.]; assert_eq!(mean(set), 2.); } #[test] fn test_median_one() { let set: &[f32] = &[1.]; assert_eq!(mean(set), 1.); } }
true
f5724096bc7f1e253812c42ae855edec5d0e1b16
Rust
dhconnelly/advent-of-code-2019
/rs/day4/src/main.rs
UTF-8
1,511
3.09375
3
[ "MIT" ]
permissive
use std::env; use std::error::Error; use std::fs; fn valid1(mut x: i32) -> bool { let mut prev = x % 10; let mut chain = 1; let mut two_chain = false; x /= 10; while x > 0 { let y = x % 10; if y > prev { return false; } if y == prev { chain += 1; } else { chain = 1; } if chain == 2 { two_chain = true; } prev = y; x /= 10; } two_chain } fn valid2(mut x: i32) -> bool { let mut prev = x % 10; let mut chain = 1; let mut two_chain = false; x /= 10; while x > 0 { let y = x % 10; if y > prev { return false; } if y == prev { chain += 1; } else { if chain == 2 { two_chain = true; } chain = 1; } prev = y; x /= 10; } two_chain || chain == 2 } fn count_valid<T: Fn(i32) -> bool>(from: i32, to: i32, valid: T) -> usize { (from..to + 1).filter(|x| valid(*x)).count() } fn main() -> Result<(), Box<dyn Error>> { let path = env::args().nth(1).ok_or("missing input path")?; let toks = fs::read_to_string(path)? .trim() .split('-') .map(|x| x.parse::<i32>()) .collect::<Result<Vec<_>, _>>()?; let (from, to) = (toks[0], toks[1]); println!("{}", count_valid(from, to, valid1)); println!("{}", count_valid(from, to, valid2)); Ok(()) }
true
0826d007207764da0e8be69d9cad02987b662c98
Rust
xychelsea/cglue
/cglue/src/tests/generics/associated.rs
UTF-8
3,497
2.78125
3
[ "MIT" ]
permissive
use super::super::simple::structs::*; use super::super::simple::trait_defs::*; use super::groups::*; use super::param::*; use cglue_macro::*; use core::ffi::c_void; #[cglue_trait] pub trait AssociatedReturn { #[wrap_with(*const c_void)] #[return_wrap(|ret| Box::leak(Box::new(ret)) as *mut _ as *const c_void)] type ReturnType; fn ar_1(&self) -> Self::ReturnType; } impl AssociatedReturn for SA { type ReturnType = usize; fn ar_1(&self) -> usize { 42 } } #[cglue_trait] pub trait ObjReturn { #[wrap_with_obj(TA)] type ReturnType: TA + 'static; fn or_1(&self) -> Self::ReturnType; } impl ObjReturn for SA { type ReturnType = SA; fn or_1(&self) -> SA { SA {} } } #[cglue_trait] #[int_result] pub trait ObjResultReturn { #[wrap_with_obj(TA)] type ReturnType: TA + 'static; fn orr_1(&self) -> Result<Self::ReturnType, ()>; #[no_int_result] fn orr_2(&self) -> Result<Self::ReturnType, ()> { self.orr_1() } } impl ObjResultReturn for SA { type ReturnType = SA; fn orr_1(&self) -> Result<SA, ()> { Ok(SA {}) } } #[cglue_trait] pub trait ObjUnboundedReturn { #[wrap_with_obj(TA)] type ReturnType: TA; fn our_1(&self) -> Self::ReturnType; } impl ObjUnboundedReturn for SA { type ReturnType = SB; fn our_1(&self) -> SB { SB {} } } #[cglue_trait] pub trait GenericReturn<T: 'static> { #[wrap_with_obj(GenericTrait<T>)] type ReturnType: GenericTrait<T>; fn gr_1(&self) -> Self::ReturnType; } impl GenericReturn<usize> for SA { type ReturnType = SA; fn gr_1(&self) -> SA { SA {} } } // TODO: generic return where T gets automatically bounded by cglue_trait #[cglue_trait] pub trait GenericGroupReturn<T: 'static + Eq> { #[wrap_with_group(GenericGroup<T>)] type ReturnType: GenericTrait<T>; fn ggr_1(&self) -> Self::ReturnType; } impl GenericGroupReturn<usize> for SA { type ReturnType = SA; fn ggr_1(&self) -> SA { SA {} } } #[cglue_trait] pub trait GenericConsumedGroupReturn<T: 'static + Eq> { #[wrap_with_group(GenericGroup<T>)] type ReturnType: GenericTrait<T>; fn gcgr_1(self) -> Self::ReturnType; } impl GenericConsumedGroupReturn<usize> for SA { type ReturnType = SA; fn gcgr_1(self) -> SA { self } } #[test] fn use_assoc_return() { let sa = SA {}; let obj = trait_obj!(sa as AssociatedReturn); let ret = obj.ar_1(); println!("{:?}", ret); assert_eq!(unsafe { *(ret as *const usize) }, 42); } #[test] fn use_obj_return() { let sa = SA {}; let obj = trait_obj!(sa as ObjReturn); let ta = obj.or_1(); assert_eq!(ta.ta_1(), 5); } #[test] fn use_gen_return() { let sa = SA {}; let obj = trait_obj!(sa as GenericReturn); let ta = obj.gr_1(); assert_eq!(ta.gt_1(), 27); } #[test] fn use_group_return() { let sa = SA {}; let obj = trait_obj!(sa as GenericGroupReturn); let group = obj.ggr_1(); let cast = cast!(group impl GenWithInlineClause).unwrap(); assert!(cast.gwi_1(&cast.gt_1())); assert!(!cast.gwi_1(&(cast.gt_1() + 1))); } #[test] fn use_consumed_group_return() { let sa = SA {}; let obj = trait_obj!(sa as GenericConsumedGroupReturn); let group = obj.gcgr_1(); let cast = cast!(group impl GenWithInlineClause).unwrap(); assert!(cast.gwi_1(&cast.gt_1())); assert!(!cast.gwi_1(&(cast.gt_1() + 1))); }
true
081dfde6b4400b5aae807e215cc180157d0d19c6
Rust
kroeckx/ruma
/crates/ruma-client-api/src/r0/account/get_username_availability.rs
UTF-8
1,142
3.140625
3
[ "MIT" ]
permissive
//! [GET /_matrix/client/r0/register/available](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available) use ruma_api::ruma_api; ruma_api! { metadata: { description: "Checks to see if a username is available, and valid, for the server.", method: GET, name: "get_username_availability", path: "/_matrix/client/r0/register/available", rate_limited: true, authentication: None, } request: { /// The username to check the availability of. #[ruma_api(query)] pub username: &'a str, } response: { /// A flag to indicate that the username is available. /// This should always be true when the server replies with 200 OK. pub available: bool, } error: crate::Error } impl<'a> Request<'a> { /// Creates a new `Request` with the given username. pub fn new(username: &'a str) -> Self { Self { username } } } impl Response { /// Creates a new `Response` with the given availability flag. pub fn new(available: bool) -> Self { Self { available } } }
true
60b7d06bc9353cd54f310aa34ef9c4de9fcb6d3e
Rust
gwierzchowski/cryptoexch
/src/zonda/trading_orderbook/csv.rs
UTF-8
2,364
2.828125
3
[ "MIT" ]
permissive
/*! * Implementation of CSV output format of trading/orderbook" API from "Zonda" module. */ use std::any::Any; use anyhow::Result; use async_trait::async_trait; use serde::Serialize; /// Record of output object. /// Output object depends on output format and is defined in respective sub-module. #[derive(Serialize, Debug)] struct OrderOut { timestamp: u64, sell_flg: u8, // use more compact 0/1 instead of bool which is represented in text false/true form by CSV serializer count: u16, rate: f32, curr_amt: f32, prev_amt: f32, start_amt: f32, } /// Output object implementation. #[derive(Serialize, Debug)] pub struct OrderbooksOut { orders: Vec<OrderOut>, } impl OrderbooksOut { pub fn new() -> Self { OrderbooksOut { orders: Vec::new() } } } #[async_trait] impl crate::common::OutputData for OrderbooksOut { fn add_data(&mut self, data: Box<dyn Any>) -> Result<()> { if let Ok(data) = data.downcast::<super::OrderbookIn>() { for ord in data.buy { self.orders.push( OrderOut { timestamp: data.timestamp, sell_flg: 0, count: ord.co, rate: ord.ra, curr_amt: ord.ca, prev_amt: ord.pa, start_amt: ord.sa, } ); } for ord in data.sell { self.orders.push( OrderOut { timestamp: data.timestamp, sell_flg: 1, count: ord.co, rate: ord.ra, curr_amt: ord.ca, prev_amt: ord.pa, start_amt: ord.sa, } ); } Ok(()) } else { bail!("Logical program error: data should be of trading_orderbook::OrderbookIn type") } } async fn save(&mut self, path: &str) -> Result<()> { let file = tokio::fs::File::create(path).await?; let mut wri = csv_async::AsyncSerializer::from_writer(file); for rec in &self.orders { wri.serialize(rec).await?; } self.orders.clear(); Ok(()) } }
true
9aa22aad4e630a85a5364dd8de6d2941fcb232fc
Rust
GarettCooper/gc_nes_emulator
/gc_nes_core/src/cartridge/mapper.rs
UTF-8
19,564
3.03125
3
[ "MIT" ]
permissive
//! The mapper module contains implementation code for the various //! types of mapping circuits that were present in NES cartridges. //! //! At present only iNES mappers 000 through 004 are supported. use super::*; /// Returns a boxed mapper based on the mapper_id argument pub(super) fn get_mapper(mapper_id: u16, submapper_id: u8) -> Result<Box<dyn Mapper>, Box<dyn Error>> { debug!("Getting mapper with id {}, submapper {}", mapper_id, submapper_id); match mapper_id { 0 => Ok(Box::new(Mapper000 {})), 1 => Ok(Box::new(Mapper001 { load_register: 0x10, control_register: 0x1c, character_bank_0_register: 0, character_bank_1_register: 0, program_bank_register: 0, })), 2 => Ok(Box::new(Mapper002 { bank_select: 0x00 })), 3 => Ok(Box::new(Mapper003 { bank_select: 0x00 })), 4 => Ok(Box::new(Mapper004 { bank_control: 0, bank_select: [0x00; 8], mirroring: Mirroring::Horizontal, program_ram_write_protect: false, program_ram_enabled: false, scanline_counter: 0, scanline_counter_reload: 0, scanline_counter_reload_flag: false, interrupt_request_enabled: false, pending_interrupt_request: false, })), _ => bail!("Mapper ID {:03} unsupported!", mapper_id), } } /// The circuit in the cartridge that is reponsible for mapping the addresses provided by the cpu to the onboard memory. /// ROM only for now. pub(super) trait Mapper { /// Read from the cartridge's program ROM/RAM through the cartridge's mapper fn program_read(&self, program_rom: &[u8], program_ram: &[u8], address: u16) -> u8 { match address { 0x0000..=0x5fff => { warn!("Mapper read from {:04X}", address); return 0x00; } 0x6000..=0x7fff => { if program_ram.is_empty() { 0x00 } else { program_ram[usize::from(address - 0x6000) % program_ram.len()] } } 0x8000..=0xffff => { if program_rom.is_empty() { 0x00 } else { program_rom[usize::from(address - 0x8000) % program_rom.len()] } } } } /// Read from the cartridge's character ROM/RAM through the cartridge's mapper fn character_read(&self, character_ram: &[u8], address: u16) -> u8 { return character_ram[usize::from(address)]; } /// Write to the cartridge's program RAM through the cartridge's mapper fn program_write(&mut self, program_ram: &mut [u8], address: u16, data: u8) { match address { 0x6000..=0x7fff => program_ram[usize::from(address - 0x6000)] = data, _ => warn!("Mapper::program_write called with invalid address 0x{:4X}", address), } } /// Write to the cartridge's character RAM through the cartridge's mapper fn character_write(&mut self, character_ram: &mut [u8], address: u16, data: u8) { character_ram[usize::from(address)] = data; } /// Get the mirroring mode from the cartridge fn get_mirroring(&mut self, mirroring: Mirroring) -> Mirroring { return mirroring; } /// Check if the cartridge is triggering an interrupt fn get_pending_interrupt_request(&mut self) -> bool { return false; } /// Called at the end of each scanline. Used by iNES Mapper 004 to /// trigger interrupt requests at specific times during screen rendering fn end_of_scanline(&mut self) {} } /// Mapper struct for the NROM Mapper, which is given the iNES id of 000 pub(super) struct Mapper000 {} impl Mapper for Mapper000 {} /// Mapper struct for the SxROM Mappers, which are given the iNES id of 001 pub(super) struct Mapper001 { load_register: u8, control_register: u8, character_bank_0_register: u8, character_bank_1_register: u8, program_bank_register: u8, } impl Mapper for Mapper001 { fn program_read(&self, program_rom: &[u8], program_ram: &[u8], address: u16) -> u8 { match address { 0x0000..=0x5fff => { warn!("Mapper001 read from {:04X}", address); return 0x00; } 0x6000..=0x7fff => { if self.program_bank_register & 0x10 > 0 && program_ram.is_empty() { 0x00 } else { program_ram[usize::from(address - 0x6000) % program_ram.len()] } } 0x8000..=0xffff => match ((self.control_register & 0x0c) >> 2, address) { (0, _) => program_rom[usize::from(address & 0x7fff)], (1, _) => program_rom[usize::from(address & 0x7fff) + ((self.program_bank_register as usize & 0x0e) * 0x4000)], (2, 0x8000..=0xbfff) => program_rom[usize::from(address & 0x3fff)], (2, 0xc000..=0xffff) => program_rom[usize::from(address & 0x3fff) + ((self.program_bank_register as usize & 0x0f) * 0x4000)], (3, 0x8000..=0xbfff) => program_rom[usize::from(address & 0x3fff) + ((self.program_bank_register as usize & 0x0f) * 0x4000)], (3, 0xc000..=0xffff) => { program_rom[(usize::from(address & 0x3fff) + ((program_rom.len() / 0x4000 - 1) * 0x4000)) % program_rom.len()] } _ => unreachable!(), }, } } fn character_read(&self, character_ram: &[u8], address: u16) -> u8 { return match (self.control_register & 0x10, address) { (0x00, 0x0000..=0x1fff) => character_ram[(address as usize) + ((self.character_bank_0_register as usize & 0x1e) * 0x1000)], (0x10, 0x0000..=0x0fff) => character_ram[(address & 0x0fff) as usize + (self.character_bank_0_register as usize * 0x1000)], (0x10, 0x1000..=0x1fff) => character_ram[(address & 0x0fff) as usize + (self.character_bank_1_register as usize * 0x1000)], _ => unreachable!(), }; } fn program_write(&mut self, program_ram: &mut [u8], address: u16, data: u8) { match address { 0x6000..=0x7fff => program_ram[usize::from(address - 0x6000)] = data, 0x8000..=0xffff => { if data & 0x80 == 0 { // Boolean to determine if the load register should be copied into the target register // after this bit is written. let copy = self.load_register & 1 > 0; self.load_register = (self.load_register >> 1) | ((data & 1) << 4); if copy { // Set one of the mapper registers based on the target address match (address & 0x6000) + 0x8000 { 0x8000 => self.control_register = self.load_register, 0xa000 => self.character_bank_0_register = self.load_register, 0xc000 => self.character_bank_1_register = self.load_register, 0xe000 => self.program_bank_register = self.load_register, _ => unreachable!(), } self.load_register = 0x10 } } else { // Reset the load register when the 7th bit isn't set self.load_register = 0x10 } } _ => warn!("Mapper000::program_write called with invalid address 0x{:4X}", address), } } fn character_write(&mut self, character_ram: &mut [u8], address: u16, data: u8) { match (self.control_register & 0x10, address) { (0x00, 0x0000..=0x1fff) => character_ram[(address as usize) + ((self.character_bank_0_register as usize & 0x1e) * 0x1000)] = data, (0x01, 0x0000..=0x0fff) => character_ram[(address & 0x0fff) as usize + (self.character_bank_0_register as usize * 0x1000)] = data, (0x01, 0x1000..=0x1fff) => character_ram[(address & 0x0fff) as usize + (self.character_bank_1_register as usize * 0x1000)] = data, _ => unreachable!(), } } fn get_mirroring(&mut self, _mirroring: Mirroring) -> Mirroring { return match self.control_register & 0b11 { 0b00 => Mirroring::OneScreenLower, 0b01 => Mirroring::OneScreenUpper, 0b10 => Mirroring::Vertical, 0b11 => Mirroring::Horizontal, _ => unreachable!(), }; } } /// Mapper struct for the UxROM Mappers, which are given the iNES id of 002 pub(super) struct Mapper002 { bank_select: u8, } impl Mapper for Mapper002 { fn program_read(&self, program_rom: &[u8], program_ram: &[u8], address: u16) -> u8 { match address { 0x0000..=0x5fff => { warn!("Mapper000 read from {:04X}", address); return 0x00; } 0x6000..=0x7fff => { if program_ram.is_empty() { 0x00 } else { program_ram[usize::from(address - 0x6000) % program_ram.len()] } } // Pick a bank based on the internal register 0x8000..=0xbfff => program_rom[usize::from(address & 0x3fff) + (self.bank_select as usize * 0x4000)], // Always points to the last program rom bank 0xc000..=0xffff => program_rom[usize::from(address & 0x3fff) + ((program_rom.len() / 0x4000 - 1) * 0x4000)], } } fn program_write(&mut self, program_ram: &mut [u8], address: u16, data: u8) { match address { 0x6000..=0x7fff => program_ram[usize::from(address - 0x6000)] = data, // Writes to the rom set the bank select register 0x8000..=0xffff => self.bank_select = data & 0x0f, _ => warn!("Mapper001::program_write called with invalid address 0x{:4X}", address), } } } /// Mapper struct for the CNROM Mapper, which is given the iNES id of 003 pub(super) struct Mapper003 { bank_select: u8, } impl Mapper for Mapper003 { fn character_read(&self, character_ram: &[u8], address: u16) -> u8 { return character_ram[usize::from(address & 0x1fff) | (self.bank_select as usize * 0x2000)]; } fn program_write(&mut self, program_ram: &mut [u8], address: u16, data: u8) { match address { 0x6000..=0x7fff => program_ram[usize::from(address - 0x6000)] = data, 0x8000..=0xffff => { // The real CNROM has two security bits, but I'm ignoring those self.bank_select = data & 0x03; } _ => warn!("Mapper003::program_write called with invalid address 0x{:4X}", address), } } fn character_write(&mut self, character_ram: &mut [u8], address: u16, data: u8) { character_ram[usize::from(address & 0x1fff) | (self.bank_select as usize * 0x2000)] = data; } } /// Mapper struct for the CxROM Mapper, which is given the iNES id of 003 pub(super) struct Mapper004 { bank_control: u8, bank_select: [u8; 8], mirroring: Mirroring, program_ram_write_protect: bool, program_ram_enabled: bool, scanline_counter: u8, scanline_counter_reload: u8, scanline_counter_reload_flag: bool, interrupt_request_enabled: bool, pending_interrupt_request: bool, } impl Mapper for Mapper004 { fn program_read(&self, program_rom: &[u8], program_ram: &[u8], address: u16) -> u8 { match address { 0x0000..=0x5fff => { warn!("Mapper read from {:04X}", address); return 0x00; } 0x6000..=0x7fff => { if program_ram.is_empty() { 0x00 } else { program_ram[usize::from(address - 0x6000) % program_ram.len()] } } 0x8000..=0xffff => match (address, self.bank_control & 0x40) { // Point to either the second last bank or the bank selected by the 6th bank selector (0x8000..=0x9fff, 0x00) => program_rom[usize::from(address & 0x1fff) + usize::from(self.bank_select[6]) * 0x2000], (0x8000..=0x9fff, 0x40) => program_rom[usize::from(address & 0x1fff) + ((program_rom.len() / 0x2000 - 2) * 0x2000)], // Always points to the bank selected by the 7th bank selector (0xa000..=0xbfff, _) => program_rom[usize::from(address & 0x1fff) + usize::from(self.bank_select[7]) * 0x2000], // Point to either the second last bank or the bank selected by the 6th bank selector (0xc000..=0xdfff, 0x00) => program_rom[usize::from(address & 0x1fff) + ((program_rom.len() / 0x2000 - 2) * 0x2000)], (0xc000..=0xdfff, 0x40) => program_rom[usize::from(address & 0x1fff) + usize::from(self.bank_select[6]) * 0x2000], // Always points to the last bank (0xe000..=0xffff, _) => program_rom[usize::from(address & 0x1fff) + ((program_rom.len() / 0x2000 - 1) * 0x2000)], _ => unreachable!(), }, } } fn character_read(&self, character_ram: &[u8], address: u16) -> u8 { return match (address, self.bank_control & 0x80) { (0x0000..=0x07ff, 0x00) => character_ram[usize::from(address & 0x07ff) + usize::from(self.bank_select[0]) * 0x0400], // TODO: Check if 0x03ff is the right increment for the 2kb banks (0x0800..=0x0fff, 0x00) => character_ram[usize::from(address & 0x07ff) + usize::from(self.bank_select[1]) * 0x0400], (0x1000..=0x13ff, 0x00) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[2]) * 0x0400], (0x1400..=0x17ff, 0x00) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[3]) * 0x0400], (0x1800..=0x1bff, 0x00) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[4]) * 0x0400], (0x1c00..=0x1fff, 0x00) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[5]) * 0x0400], // Bank Control 0x80 = data (0x0000..=0x03ff, 0x80) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[2]) * 0x0400], (0x0400..=0x07ff, 0x80) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[3]) * 0x0400], (0x0800..=0x0bff, 0x80) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[4]) * 0x0400], (0x0c00..=0x0fff, 0x80) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[5]) * 0x0400], (0x1000..=0x17ff, 0x80) => character_ram[usize::from(address & 0x07ff) + usize::from(self.bank_select[0]) * 0x0400], (0x1800..=0x1fff, 0x80) => character_ram[usize::from(address & 0x07ff) + usize::from(self.bank_select[1]) * 0x0400], _ => panic!("Mapper004::character_read called with invalid address: 0x{:04X}", address), }; } fn program_write(&mut self, program_ram: &mut [u8], address: u16, data: u8) { match address { 0x6000..=0x7fff => program_ram[usize::from(address - 0x6000)] = data, 0x8000..=0xffff => match (address, address & 0x01) { (0x8000..=0x9fff, 0) => self.bank_control = data, (0x8000..=0x9fff, 1) => self.bank_select[self.bank_control as usize & 0x07] = data, (0xa000..=0xbfff, 0) => { if data & 0x01 > 0 { self.mirroring = Mirroring::Horizontal } else { self.mirroring = Mirroring::Vertical } } (0xa000..=0xbfff, 1) => { self.program_ram_write_protect = data & 0x40 > 0; self.program_ram_enabled = data & 0x80 > 0; } (0xc000..=0xdfff, 0) => self.scanline_counter_reload = data, (0xc000..=0xdfff, 1) => { self.scanline_counter = self.scanline_counter_reload; self.scanline_counter_reload_flag = true; } (0xe000..=0xffff, 0) => { self.interrupt_request_enabled = false; self.pending_interrupt_request = false; } (0xe000..=0xffff, 1) => self.interrupt_request_enabled = true, _ => unreachable!(), }, _ => warn!("Mapper004::program_write called with invalid address 0x{:4X}", address), } } fn character_write(&mut self, character_ram: &mut [u8], address: u16, data: u8) { match (address, self.bank_control & 0x80) { (0x0000..=0x07ff, 0x00) => character_ram[usize::from(address & 0x07ff) + usize::from(self.bank_select[0]) * 0x0400] = data, // TODO: Check if 0x0400 is the right increment for the 2kb banks (0x0800..=0x0fff, 0x00) => character_ram[usize::from(address & 0x07ff) + usize::from(self.bank_select[1]) * 0x0400] = data, (0x1000..=0x13ff, 0x00) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[2]) * 0x0400] = data, (0x1400..=0x17ff, 0x00) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[3]) * 0x0400] = data, (0x1800..=0x1bff, 0x00) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[4]) * 0x0400] = data, (0x1c00..=0x1fff, 0x00) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[5]) * 0x0400] = data, // Bank Control 0x80 = data (0x0000..=0x03ff, 0x80) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[2]) * 0x0400] = data, (0x0400..=0x07ff, 0x80) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[3]) * 0x0400] = data, (0x0800..=0x0bff, 0x80) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[4]) * 0x0400] = data, (0x0c00..=0x0fff, 0x80) => character_ram[usize::from(address & 0x03ff) + usize::from(self.bank_select[5]) * 0x0400] = data, (0x1000..=0x17ff, 0x80) => character_ram[usize::from(address & 0x07ff) + usize::from(self.bank_select[0]) * 0x0400] = data, (0x1800..=0x1fff, 0x80) => character_ram[usize::from(address & 0x07ff) + usize::from(self.bank_select[1]) * 0x0400] = data, _ => warn!("Mapper004::character_write called with invalid address: 0x{:04X}", address), } } fn get_mirroring(&mut self, _mirroring: Mirroring) -> Mirroring { return self.mirroring; } fn get_pending_interrupt_request(&mut self) -> bool { let value = self.pending_interrupt_request; self.pending_interrupt_request = false; return value; } fn end_of_scanline(&mut self) { if self.scanline_counter == 0 && self.interrupt_request_enabled { self.pending_interrupt_request = true; } if self.scanline_counter == 0 || self.scanline_counter_reload_flag { self.scanline_counter = self.scanline_counter_reload; self.scanline_counter_reload_flag = false; } else { self.scanline_counter -= 1 } } }
true
b5ac66b03f39c3c91a9f13860a56ef1758a7d519
Rust
dylanleclair/atlas
/src/main.rs
UTF-8
3,363
3.1875
3
[]
no_license
use std::collections::HashMap; // used to parse command line args use std::env; // used to parse command line args use image::io::Reader as ImageReader; // imported to read images while binding them to atlas use image::{GenericImage}; // imported to support in textures use std::path::Path; use std::fs; const DEFAULT_WIDTH : &str = "32"; const DEFAULT_HEIGHT : &str = "32"; const DEFAULT_COLS : &str = "0"; fn main() { let args : Vec<String> = env::args().collect(); // iterate over, mapping pairs let parsed_args = parse_cmd_line(&args); // given target directory of files to stitch together into a texture // given width & height of the atlas // given width & height of each tile let w = parsed_args.get("-w").unwrap_or(&DEFAULT_WIDTH); // specifies width of tile let h = parsed_args.get("-h").unwrap_or(&DEFAULT_HEIGHT); // specifies height of tile let c = parsed_args.get("-c").unwrap_or(&DEFAULT_COLS); // specifies the desired # columns in atlas let width = w.parse::<u32>().unwrap(); let height = h.parse::<u32>().unwrap(); let dirname = parsed_args.get("-dir").unwrap(); // specifies the input directory // crawl through the directory, adding each file to the next calculated area let path = Path::new(dirname); // directory as specified let file_count = get_file_count(&path); // counts the files in the specified directory let mut cols = c.parse::<u32>().unwrap(); if cols == 0 { cols = (file_count as f32).sqrt().ceil() as u32; } // first, calculate the expected number of rows depending on size of dir let rows = ((file_count as f32) / (cols as f32).ceil()) as u32; // the number of rows needed to fit all images in let mut images_placed = 0; let mut atlas = image::ImageBuffer::new(width * cols, height * rows); // step through the files in the directory for entry in fs::read_dir(path).unwrap() { // ignore directories, process images let p = entry.unwrap().path(); if !p.is_dir() { // if it's a file, we want to merge it into the atlas // perform the insertion let img = ImageReader::open(&p).unwrap().decode().unwrap(); let x = (images_placed % cols) * width; let y = (images_placed / cols) * height; // place sub image into atlas atlas.copy_from(&img,x, y).unwrap(); images_placed+=1; } } atlas.save("atlas.png").unwrap(); } /// Parses the command line arguments into a HashMap fn parse_cmd_line(args: &Vec<String>) -> HashMap<String,&str> { let mut parsed_args = HashMap::new(); if (args.len() % 2) != 1 { panic!("Invalid input! Key without a pair identified."); } for i in (1..args.len()-1).step_by(2) { parsed_args.insert(args[i].clone(), args[i+1].as_ref()); // insert into map } parsed_args } fn get_file_count(path: &Path) -> i32 { let mut file_count = 0; // step through the files in the directory for entry in fs::read_dir(path).unwrap() { // ignore directories, process images let p = entry.unwrap().path(); if !p.is_dir() { // if it's a file, we want to merge it into the atlas // perform the insertion file_count +=1; } } file_count }
true
5716fab22cafe29f725cc555830f9a5f45b8b2a4
Rust
etrombly/bluepill
/src/clock.rs
UTF-8
821
2.609375
3
[ "MIT", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
//! Set Clock Speed use stm32f103xx::{Rcc, Flash}; /// Initializes SYSCLK to 72Mhz pub fn init(rcc: &Rcc, flash: &Flash) { // enable external clock rcc.cr.modify(|_,w| w.hseon().enabled()); while rcc.cr.read().hserdy().is_notready() {} // configure pll to external clock * 9 rcc.cfgr.modify(|_,w| w.pllsrc().external()); rcc.cfgr.modify(|_,w| w.pllmul().mul9()); // set apb1 to hclk / 2 rcc.cfgr.modify(|_,w| w.ppre1().div2()); // enable flash prefetch buffer flash.acr.modify(|_,w| w.prftbe().enabled()); // set flash latency to two flash.acr.modify(|_,w| w.latency().two()); // enable pll rcc.cr.modify(|_,w| w.pllon().enabled()); while rcc.cr.read().pllrdy().is_unlocked() {} // set system clock to pll rcc.cfgr.modify(|_,w| w.sw().pll()); }
true
b95968885b3bdfe485fd6fa4c420b735fa7f7f84
Rust
lRiaXl/public
/rust/tests/roman_numbers_test/src/main.rs
UTF-8
1,623
3.828125
4
[]
no_license
// # Instructions // Implement the From<u32> Trait to create a roman number from a u32 // the roman number should be in subtractive notation (the common way to write roman // number I, II, II, IV, V, VI, VII, VIII, IX, X ...) // For this start by defining the digits as `RomanDigit` with the values // I, V, X, L, C, D, M and Nulla for 0 // Next define RomanNumber as a wrapper to a vector of RomanDigit's // And implement the Trait From<u32> // Examples: // RomanNumber::from(32) = [X,X,X,I,I] // RomanNumber::from(9) = [I,X] // RomanNumber::from(45) = [X,L,V] // RomanNumber:;from(0) = [Nulla] #[allow(unused_imports)] use roman_numbers::RomanDigit::*; #[allow(unused_imports)] use roman_numbers::RomanNumber; #[allow(dead_code)] fn main() { println!("{:?}", RomanNumber::from(32)); println!("{:?}", RomanNumber::from(9)); println!("{:?}", RomanNumber::from(45)); println!("{:?}", RomanNumber::from(0)); } #[test] fn it_works() { assert_eq!(RomanNumber::from(3).0, [I, I, I]); assert_eq!(RomanNumber::from(6).0, [V, I]); assert_eq!(RomanNumber::from(15).0, [X, V]); assert_eq!(RomanNumber::from(30).0, [X, X, X]); assert_eq!(RomanNumber::from(150).0, [C, L]); assert_eq!(RomanNumber::from(200).0, [C, C]); assert_eq!(RomanNumber::from(600).0, [D, C]); assert_eq!(RomanNumber::from(1500).0, [M, D]); } #[test] fn substractive_notation() { assert_eq!(RomanNumber::from(4).0, [I, V]); assert_eq!(RomanNumber::from(44).0, [X, L, I, V]); assert_eq!(RomanNumber::from(3446).0, [M, M, M, C, D, X, L, V, I]); assert_eq!(RomanNumber::from(9).0, [I, X]); assert_eq!(RomanNumber::from(94).0, [X, C, I, V]); }
true
f20dbd220a37a9a599287c9f72cd39861fbd4a0f
Rust
sybila/biodivine-lib-std
/src/impl_id_state.rs
UTF-8
1,168
3.40625
3
[ "MIT" ]
permissive
use super::{IdState, State}; use std::fmt::{Display, Error, Formatter}; impl State for IdState {} impl From<usize> for IdState { fn from(val: usize) -> Self { return IdState(val); } } impl Into<usize> for IdState { fn into(self) -> usize { return self.0; } } impl Display for IdState { fn fmt(&self, f: &mut Formatter) -> Result<(), Error> { return write!(f, "State({})", self.0); } } impl IdState { /// Test if the bit at the given position is set or not. pub fn get_bit(self, bit: usize) -> bool { return (self.0 >> bit) & 1 == 1; } /// Flip the bit a the given position. pub fn flip_bit(self, bit: usize) -> IdState { return IdState(self.0 ^ (1 << bit)); } } #[cfg(test)] mod tests { use crate::IdState; #[test] fn id_state_test() { let state = IdState::from(0b10110); assert!(!state.get_bit(0)); assert!(state.get_bit(1)); assert!(state.get_bit(2)); assert!(!state.get_bit(3)); assert!(state.get_bit(4)); let flipped = state.flip_bit(3); assert_eq!(0b11110 as usize, flipped.into()); } }
true
082d63ffb45209e931c7fda49b68fddcdcddd8ce
Rust
sinclair20/cracking_the_coding_interview_6th_edition_rust
/src/c7_q2.rs
UTF-8
3,557
3.84375
4
[ "Apache-2.0" ]
permissive
// Call Center: Imagine you have a call center with three levels of employees: respondent, manager, // and director. An incoming telephone call must be first allocated to a respondent who is free. If the // respondent can't handle the call, he or she must escalate the call to a manager. If the manager is not // free or not able to handle it, then the call should be escalated to a director. Design the classes and // data structures for this problem. Implement a method dispatchCall() which assigns a call to // the first available employee. trait CallCenter { fn new(emps: Vec<Box<dyn Employee>>) -> Self; #[allow(clippy::borrowed_box)] fn dispatch_call(&mut self) -> Option<&Box<dyn Employee>>; } trait Employee { fn new(assigned: bool) -> Self where Self: Sized; fn is_free(&self) -> bool; fn assign(&mut self); fn lvl(&self) -> EmpLevel; } struct Respondent { assigned: bool, } struct Manager { assigned: bool, } struct Director { assigned: bool, } struct CCenter { emps: Vec<Box<dyn Employee>>, } #[derive(Debug, Eq, PartialEq)] enum EmpLevel { Respondent, Manager, Director, } impl EmpLevel { fn emp_lvl(&self) -> u8 { match *self { EmpLevel::Director => 3, EmpLevel::Manager => 2, EmpLevel::Respondent => 1, } } } impl Employee for Respondent { fn new(assigned: bool) -> Self { Respondent { assigned } } fn is_free(&self) -> bool { !self.assigned } fn assign(&mut self) { self.assigned = true } fn lvl(&self) -> EmpLevel { EmpLevel::Respondent } } impl Employee for Manager { fn new(assigned: bool) -> Self { Manager { assigned } } fn is_free(&self) -> bool { !self.assigned } fn assign(&mut self) { self.assigned = true } fn lvl(&self) -> EmpLevel { EmpLevel::Manager } } impl Employee for Director { fn new(assigned: bool) -> Self { Director { assigned } } fn is_free(&self) -> bool { !self.assigned } fn assign(&mut self) { self.assigned = true } fn lvl(&self) -> EmpLevel { EmpLevel::Director } } impl CallCenter for CCenter { fn new(mut emps: Vec<Box<dyn Employee>>) -> Self { emps.sort_by(|x, y| x.lvl().emp_lvl().cmp(&y.lvl().emp_lvl())); CCenter { emps } } #[allow(clippy::borrowed_box)] fn dispatch_call(&mut self) -> Option<&Box<dyn Employee>> { let emp = self.emps.iter_mut().find(|e| e.is_free()); if let Some(e) = emp { e.assign(); Some(e) } else { None } } } #[cfg(test)] mod tests { use super::*; #[test] fn should_dispatch_call_in_order() { let emps: Vec<Box<dyn Employee>> = vec![ Box::new(Director { assigned: false }), Box::new(Manager { assigned: false }), Box::new(Respondent { assigned: false }), ]; let mut cc = CCenter::new(emps); let res = cc.dispatch_call(); assert!(res.is_some()); assert_eq!(EmpLevel::Respondent, res.unwrap().lvl()); let res = cc.dispatch_call(); assert!(res.is_some()); assert_eq!(EmpLevel::Manager, res.unwrap().lvl()); let res = cc.dispatch_call(); assert!(res.is_some()); assert_eq!(EmpLevel::Director, res.unwrap().lvl()); let res = cc.dispatch_call(); assert!(res.is_none()); } }
true
fabfca92c20671bdcffffd1aea926fb39c08ab5c
Rust
stefan-k/finitediff
/src/pert.rs
UTF-8
1,116
2.625
3
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// Copyright 2018-2020 argmin developers // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. /// Perturbation Vector for the accelerated computation of the Jacobian. #[derive(Clone, Default)] pub struct PerturbationVector { /// x indices pub x_idx: Vec<usize>, /// correspoding function indices pub r_idx: Vec<Vec<usize>>, } impl PerturbationVector { /// Create a new empty `PerturbationVector` pub fn new() -> Self { PerturbationVector { x_idx: vec![], r_idx: vec![], } } /// Add an index `x_idx` and the corresponding function indices `r_idx` pub fn add(mut self, x_idx: usize, r_idx: Vec<usize>) -> Self { self.x_idx.push(x_idx); self.r_idx.push(r_idx); self } } /// A collection of `PerturbationVector`s pub type PerturbationVectors = Vec<PerturbationVector>;
true
0a469f4b2db05dff4ba8abc0b9f7c7bb533fcc20
Rust
mchesser/pchip
/src/dlx/codegen.rs
UTF-8
43,735
2.640625
3
[ "MIT" ]
permissive
use std::collections::{ hash_map::Entry::{Occupied, Vacant}, HashMap, }; use crate::{ ast, dlx::asm::{self, Instruction, LabelId, RegId}, dlx::types::{self, Type, TypeTable}, error::{InputSpan, Logger}, }; use self::{Ident::*, IdentId::*, Location::*}; const UNIT_TYPE: Type = types::Normal(0); const INT_TYPE: Type = types::Normal(1); const CHAR_TYPE: Type = types::Normal(2); const BOOL_TYPE: Type = types::Normal(3); // Special register that is always 0 const ZERO_REG: RegId = 0; // Frame pointer register const FRAME_POINTER: RegId = 30; // Stack pointer register const STACK_POINTER: RegId = 14; // Heap pointer register const _HEAP_POINTER: RegId = 15; // Return address register (set by jal) const RETURN_REG: RegId = 31; // Register used for storing the results of computations const RESULT_REG: RegId = 1; // Register used for temporary values const TEMP_REG: RegId = 2; // Register used for storing addresses const ADDR_REG: RegId = 3; // Register use for copying values const COPY_REG: RegId = 4; const DATA_SEGMENT: &str = " .seg data"; const CONST_DATA_SEGMENT: &str = " .seg constdata"; const CODE_SEGMENT: &str = " .seg code"; const PROGRAM_START: &str = " ; Allocate some dynamic memory for the program to use .seg data stack .space 800 heap .space 800 ; Manually start the program .seg code .start prgsrt prgsrt addui r14,r0,stack ; Give the program a stack addui r15,r0,heap ; Give the program a heap jal main ; Jump to the program entry point halt ; Stop the machine "; pub struct Function { ast: ast::FunctionDeclaration, arg_types: Vec<Type>, rtype: Type, location: LabelId, } impl Function { fn new( ast: ast::FunctionDeclaration, type_table: &TypeTable, scope: &Scope, location: LabelId, ) -> Function { let arg_types = ast.params.iter().map(|p| type_table.resolve_type(scope, &p.1)).collect(); let rtype = type_table.resolve_type(scope, &ast.rtype); Function { ast, arg_types, rtype, location } } } #[derive(Clone, Debug)] enum Location { Label(LabelId), Offset(i16), Register(RegId), } pub struct Variable { ast: ast::LetStatement, rtype: Type, is_const: bool, location: Location, } impl Variable { fn new(ast: ast::LetStatement, rtype: Type, location: Location, is_const: bool) -> Variable { Variable { ast, rtype, is_const, location } } } #[derive(Eq, PartialEq, Hash)] pub enum IdentId { FnIdentId(usize), VarIdentId(usize), } pub enum Ident<'a> { FnIdent(&'a Function), VarIdent(&'a Variable), } impl<'a> Ident<'a> { pub fn rtype(&self) -> Type { match *self { FnIdent(func) => func.rtype.clone(), VarIdent(var) => var.rtype.clone(), } } fn unwrap_var(self) -> &'a Variable { match self { FnIdent(..) => panic!("ICE attempted to unwrap function when attempting to get var"), VarIdent(var) => var, } } } pub struct Scope<'a> { functions: Vec<Function>, vars: Vec<Variable>, next_offset: i16, ident_table: HashMap<String, IdentId>, loop_ends: Vec<LabelId>, end_label: LabelId, parent: Option<&'a Scope<'a>>, } impl<'a> Scope<'a> { pub fn new(end_label: LabelId) -> Scope<'a> { Scope { functions: vec![], vars: vec![], // Note: first avalible offset is 8, (the first 8 bytes store the frame pointer of prev // stack frame, and return location). next_offset: 8, ident_table: HashMap::new(), loop_ends: vec![], end_label, parent: None, } } fn new_with_parent(parent: &'a Scope<'a>, end_label: LabelId) -> Scope<'a> { let mut scope = Scope::new(end_label); scope.parent = Some(parent); scope } /// Add an identifier to the scope fn add_ident(&mut self, ident_name: String, ident: IdentId, _span: InputSpan) { match self.ident_table.entry(ident_name) { Vacant(entry) => { entry.insert(ident); } // This identifier shadows an existing one. Variable shadowing is not supported. Occupied(..) => panic!("IDENT_SHADOW_ERROR, TODO: improve error message"), } } /// Get the identifier corresponding to an identifier name. pub fn get_ident(&self, ident_name: &String, span: InputSpan) -> Ident { match self.ident_table.get(ident_name) { Some(&FnIdentId(id)) => FnIdent(&self.functions[id]), Some(&VarIdentId(id)) => VarIdent(&self.vars[id]), None => { // If the identifier was not found in this scope, check the parent scope. match self.parent { Some(parent) => parent.get_ident(ident_name, span), None => { // Reached the top level scope, but still could not find the identifier // therefore it doesn't not exist at this location. panic!( "IDENT_NOT_FOUND_ERROR, ({}), TODO: improve error message {:?}", ident_name, span, ); } } } } } } pub fn codegen<'a>( program: ast::Program, logger: &'a Logger<'a>, add_prog_start: bool, ) -> Vec<Instruction> { let mut global = Scope::new("exit".to_string()); let mut data = CodeData { instructions: vec![], type_table: types::typegen(&program), label_count: 0, logger, add_to_address: false, const_mem: false, }; // Parse globals for item in program.items { match item { ast::FunctionItem(fn_item) => { let id = FnIdentId(global.functions.len()); let name = fn_item.name.clone(); let label = name.clone(); global.add_ident(name, id, fn_item.span); let function = Function::new(fn_item, &data.type_table, &global, label); global.functions.push(function); } ast::LetItem(let_item) => { let id = VarIdentId(global.vars.len()); let name = let_item.name.clone(); let label = name.clone(); global.add_ident(name, id, let_item.span); let rtype = data.resolve_type(&global, &let_item.var_type); let is_const = let_item.is_const; global.vars.push(Variable::new(let_item, rtype, Label(label), is_const)); } // Handled by type gen ast::StructItem(..) => {} } } data.instructions.push(asm::RawAsm(DATA_SEGMENT.to_string())); // Compile global variables for i in 0..global.vars.len() { data.compile_global_var(&global, i); } if add_prog_start { data.instructions.push(asm::RawAsm(PROGRAM_START.to_string())); } else { data.instructions.push(asm::RawAsm(CODE_SEGMENT.to_string())); } // Compile global functions for i in 0..global.functions.len() { data.compile_global_fn(&global, i); } data.instructions } struct CodeData<'a> { instructions: Vec<Instruction>, type_table: TypeTable, label_count: usize, logger: &'a Logger<'a>, add_to_address: bool, const_mem: bool, } impl<'a> CodeData<'a> { /// Codegen experienced a fatal error which must kill the program fn fatal_error(&self) -> ! { panic!(); } /// Generating a unique label id fn next_unique_id(&mut self) -> usize { self.label_count += 1; self.label_count - 1 } fn anon_label(&mut self) -> LabelId { format!("a{}", self.next_unique_id()) } /// Compile a global variable fn compile_global_var(&mut self, scope: &Scope, var_id: usize) { let is_const = scope.vars[var_id].is_const; if is_const != self.const_mem { if is_const { self.instructions.push(asm::RawAsm(CONST_DATA_SEGMENT.to_string())); } else { self.instructions.push(asm::RawAsm(DATA_SEGMENT.to_string())); } self.const_mem = is_const; } // Add the variable's label let label = match scope.vars[var_id].location { Label(ref s) => s.clone(), ref other => panic!("ICE: Location of global var is not a label, was {:?}", other), }; self.instructions.push(asm::Label(label)); // Allocate and initialize the variable let rtype = self.resolve_type(scope, &scope.vars[var_id].ast.var_type); match scope.vars[var_id].ast.assignment { // Initialized variables Some(ref expr) => { let rhs_expr: &ast::Expr = match *expr.rhs.expr { ast::CastExpr(ref inner) => &inner.expr, ref other => other, }; match *rhs_expr { ast::LitNumExpr(value) => { self.instructions.push(asm::AllocateWords(vec![value as i32])); } ast::StaticArrayExpr(ref inner) => { match *inner.elements[0].expr { // Array of integers ast::LitNumExpr(..) => { let mut unwrapped = vec![]; for element in &inner.elements { match *element.expr { ast::LitNumExpr(n) => unwrapped.push(n as i32), ref _invalid => panic!("Array has not literal value"), } } self.instructions.push(asm::AllocateWords(unwrapped)); } ref invalid => { panic!("Unable to statically resolve expression: `{:?}`", invalid) } } } ast::LitStringExpr(ref value) => { self.instructions.push(asm::AllocateAscii(value.clone())); if value.len() % 4 != 0 { self.instructions.push(asm::Align(2)); } } // TODO: Handle other types of static data ref invalid => { println!("{:?}", invalid); unimplemented!(); } } } // Uninitialized variables None => { let size = self.size_of(&rtype) as u32; self.instructions.push(asm::AllocateSpace(size)); } } } /// Compile a global function. fn compile_global_fn(&mut self, scope: &Scope, fn_id: usize) { // Add the functions label let label = scope.functions[fn_id].location.clone(); let span = scope.functions[fn_id].ast.span; self.instructions.push(asm::Label(label)); // Store caller's frame pointer and set current frame pointer self.instructions.push(asm::Store32(asm::Const(0), STACK_POINTER, FRAME_POINTER)); self.instructions.push(asm::AddUnsigned(FRAME_POINTER, STACK_POINTER, ZERO_REG)); // Store return location (this should be done by caller) self.instructions.push(asm::Store32(asm::Const(4), FRAME_POINTER, RETURN_REG)); // Create a local scope for this function let mut local = Scope::new_with_parent(scope, self.anon_label()); // Register function parameters as local variables // The input params are stored in negative offset before the frame pointer with the last // param stored at FRAME_POINTER[-1] let mut next_param_addr = 0_i32; for &(ref name, ref var_type) in scope.functions[fn_id].ast.params.iter().rev() { let var_ast = ast::LetStatement { name: name.clone(), var_type: var_type.clone(), assignment: None, is_const: false, span, }; let rtype = self.resolve_type(scope, &var_ast.var_type); next_param_addr -= self.size_of(&rtype) as i32; let var = Variable::new(var_ast, rtype, Offset(next_param_addr as i16), false); let id = VarIdentId(local.vars.len()); local.add_ident(name.clone(), id, span); local.vars.push(var); } // Reserve stack space for the function: // Note: since the stack space required is unknown at this point the total memory required // for the function is unknown, so the instruction is set to Nop, and changed after the // function has been fully compiled. The variable reserve_stack_index keeps track of the // index to the value we need to change. let reserve_stack_index = self.instructions.len(); self.instructions.push(asm::Nop); // Compile the body of the function self.compile_block(&mut local, &scope.functions[fn_id].ast.body); // Now set the amount of stack space to allocate let frame_size = local.next_offset; self.instructions[reserve_stack_index] = asm::AddUnsignedValue(STACK_POINTER, STACK_POINTER, frame_size as u16); self.instructions.push(asm::Label(local.end_label.clone())); // Remove this stack frame, and return to the previous one self.instructions.push(asm::Load32(RETURN_REG, asm::Const(4), FRAME_POINTER)); self.instructions.push(asm::AddUnsigned(STACK_POINTER, FRAME_POINTER, ZERO_REG)); self.instructions.push(asm::Load32(FRAME_POINTER, asm::Const(0), STACK_POINTER)); self.instructions.push(asm::JumpR(RETURN_REG)); // Insert a new line to make the output nicer to read self.instructions.push(asm::RawAsm("".to_string())); } fn compile_block(&mut self, scope: &mut Scope, block: &ast::Block) { for statement in &block.statements { self.compile_expression(scope, statement); } } fn compile_expression(&mut self, scope: &mut Scope, expression: &ast::Expression) { let span = expression.span; match *expression.expr { ast::RefExpr(ref inner) => { let valid_address = self.compile_address(scope, inner); if !valid_address { self.logger.report_error( "Cannot take reference to target expression".to_string(), span, ); self.fatal_error(); } } ast::DerefExpr(ref inner) => { // Check that we can dereference the expression let inner_type = self.resolve_type(scope, &inner.rtype); match inner_type { types::Pointer(..) => { // Evaluate the inner expression self.compile_expression(scope, inner); // Then dereference it self.load_var(inner_type.deref(), &Register(RESULT_REG)); } types::StaticArray(..) => { // Evaluate the inner expression self.compile_expression(scope, inner); // Since this is a static array we don't need to dereference it } _invalid => { self.logger.report_error( format!("type `{:?}` cannot be dereferenced", "FIXME"), span, ); self.fatal_error(); } } } ast::FieldRefExpr(ref inner) => { self.compile_field_ref(scope, inner); let inner_type = self.resolve_type(scope, &expression.rtype); self.load_var(&inner_type, &Register(RESULT_REG)); } ast::ArrayIndexExpr(ref inner) => { self.compile_array_index(scope, inner); let inner_type = self.resolve_type(scope, &expression.rtype); self.load_var(&inner_type, &Register(RESULT_REG)); } ast::IfExpr(ref inner) => self.compile_if(scope, inner), ast::ForLoopExpr(ref inner) => self.compile_for(scope, inner), ast::LoopExpr(ref inner) => self.compile_loop(scope, inner), ast::CallExpr(ref inner) => self.compile_call(scope, inner), ast::Break => match scope.loop_ends.last() { Some(label) => self.instructions.push(asm::Jump(label.clone())), None => { self.logger.report_error("`break` outside of loop".to_string(), span); self.fatal_error(); } }, ast::Return(ref inner) => { self.compile_expression(scope, inner); let return_label = scope.end_label.clone(); self.instructions.push(asm::Jump(return_label)); } ast::LetExpr(ref inner) => self.compile_let(scope, inner), ast::AssignExpr(ref inner) => self.compile_assign(scope, inner), ast::VariableExpr(ref name) => { let var = scope.get_ident(name, span).unwrap_var(); self.load_var(&var.rtype, &var.location); } ast::StaticArrayExpr(ref inner) => self.compile_static_array(scope, inner), ast::LitStringExpr(ref inner) => { // Convert the string into a byte array // FIXME: this should happen in the lexer/parser let mut bytes = vec![]; // The remaining characters left to parse in this expression let mut rem: &str = inner; while let Some(mut next) = rem.chars().next() { rem = &rem[next.len_utf8()..]; if next == '\\' { let escaped = rem.chars().next().expect("ICE, end of string was escaped"); rem = &rem[escaped.len_utf8()..]; match escaped { 'n' => next = '\n', '0' => next = '\0', invalid => panic!("Invalid escape char: {}", invalid), } } let expression = ast::Expression { expr: Box::new(ast::LitCharExpr(next)), rtype: ast::Primitive(ast::CharType), span, }; bytes.push(expression); } let static_array = ast::StaticArray { elements: bytes, span }; self.compile_static_array(scope, &static_array); } ast::StructInitExpr(ref inner) => self.compile_struct_init(scope, inner), ast::LitNumExpr(value) => { self.instructions.push(asm::AddSignedValue(RESULT_REG, ZERO_REG, value as i16)); } ast::LitCharExpr(value) => { self.instructions.push(asm::AddSignedValue(RESULT_REG, ZERO_REG, value as i16)); } ast::AsmOpExpr(ref inner) => { self.instructions.push(asm::RawAsm(inner.clone())); } ast::CastExpr(ref inner) => self.compile_expression(scope, inner), ast::EmptyExpr => {} } } fn compile_field_ref(&mut self, scope: &mut Scope, field_ref: &ast::FieldRef) { self.compile_expression(scope, &field_ref.target); let target_type = self.resolve_type(scope, &field_ref.target.rtype); let target_base_type = self.type_table.base_type(&target_type); let (field_offset, _) = self.find_field(target_base_type, &field_ref.field, field_ref.span); // Add the offset to the target address self.instructions.push(asm::AddUnsignedValue(RESULT_REG, RESULT_REG, field_offset)); } fn find_field( &self, target_type: &types::BaseType, field: &String, span: InputSpan, ) -> (u16, types::Type) { match *target_type { types::Composite(ref inner) => match inner.fields.get(field) { Some(&(offset, ref type_)) => (offset, type_.clone()), None => { self.logger.report_error( format!("type `{:?}` has no field {:?}", target_type, field), span, ); self.fatal_error(); } }, ref invalid => { self.logger .report_error(format!("type `{:?}` has no field {:?}", invalid, field), span); self.fatal_error(); } } } fn compile_array_index(&mut self, scope: &mut Scope, index_expr: &ast::ArrayIndex) { // Check that the type that we are indexing can be indexed let target_type = self.resolve_type(scope, &index_expr.target.rtype); match target_type { types::Pointer(..) | types::StaticArray(..) => {} _invalid => { self.logger.report_error( format!("type `{:?}` cannot be dereferenced", "FIXME"), index_expr.span, ); self.fatal_error(); } } // Evaluate the index self.compile_expression(scope, &index_expr.index); // Check that we are indexing with the correct type let index_type = self.resolve_type(scope, &index_expr.index.rtype); self.check_type(&index_type, &INT_TYPE, index_expr.index.span); // Multiply by the size of the target type let type_size = self.unaligned_size_of(target_type.deref()); self.multiply_by(type_size as usize); // Either replace or add to the current address if self.add_to_address { self.instructions.push(asm::AddUnsigned(ADDR_REG, RESULT_REG, ADDR_REG)); } else { self.instructions.push(asm::AddUnsigned(ADDR_REG, RESULT_REG, ZERO_REG)); } // Evaluate the target address self.add_to_address = true; self.compile_expression(scope, &index_expr.target); self.add_to_address = false; // Add the index to the target address self.instructions.push(asm::AddUnsigned(RESULT_REG, RESULT_REG, ADDR_REG)); } fn compile_if(&mut self, scope: &mut Scope, if_statement: &ast::IfStatement) { self.compile_expression(scope, &if_statement.condition); // Check that the expression returns a boolean type let cond_type = self.resolve_type(scope, &if_statement.condition.rtype); self.check_type(&cond_type, &BOOL_TYPE, if_statement.span); let else_label = self.anon_label(); let end_label = match if_statement.else_block { Some(..) => self.anon_label(), // If there is no else block, then the end label is equal to the else label None => else_label.clone(), }; self.instructions.push(asm::JumpIfZero(RESULT_REG, else_label.clone())); // Compile the then block self.compile_block(scope, &if_statement.body); let then_rtype = self.resolve_type(scope, &if_statement.body.rtype()); match if_statement.else_block { Some(ref block) => { // If there is an else block we need to add a jump from the then block to the // end label, and add a label for the else part self.instructions.push(asm::Jump(end_label.clone())); self.instructions.push(asm::Label(else_label)); // Then compile the else block self.compile_block(scope, block); // Check that both sides return the same type let else_rtype = self.resolve_type(scope, &block.rtype()); self.check_type(&else_rtype, &then_rtype, block.span); } None => { // If the else block was left unspecified, then the if statement must return the // unit type self.check_type(&then_rtype, &UNIT_TYPE, if_statement.span); } } // Add the end label self.instructions.push(asm::Label(end_label)); } /// Compile a for loop: /// Note: We directly compile for loops instead of de-sugaring them into a normal loop with an /// if break, for efficiency. fn compile_for(&mut self, scope: &mut Scope, for_statement: &ast::ForLoopStatement) { let var_size = self.size_of(&INT_TYPE) as u16; // Create a fake ast so the we can refer to the variable inside the loop let loop_var_name = for_statement.loop_var.clone(); let loop_var_ast = ast::LetStatement { name: loop_var_name.clone(), var_type: ast::Primitive(ast::IntType), assignment: None, is_const: false, span: for_statement.span, }; let loop_var_type = self.resolve_type(scope, &ast::Primitive(ast::IntType)); let loop_var = Variable::new(loop_var_ast, loop_var_type, Offset(scope.next_offset), false); scope.next_offset += var_size as i16 * 2; let loop_var_offset = scope.next_offset - 8; let end_var_offset = scope.next_offset - 4; let id = VarIdentId(scope.vars.len()); scope.add_ident(loop_var_name, id, for_statement.span); scope.vars.push(loop_var); // Compile the expression for the range end. The end range is written first, so that we have // the loop var ready in the RESULT_REG self.compile_expression(scope, &for_statement.end); // Write the end expression to the stack self.instructions.push(asm::Store32(asm::Const(end_var_offset), FRAME_POINTER, RESULT_REG)); // Check that the end expression has the correct type let end_type = self.resolve_type(scope, &for_statement.end.rtype); self.check_type(&end_type, &INT_TYPE, for_statement.end.span); // Compile the expression for the range start self.compile_expression(scope, &for_statement.start); // Write the start expression to the stack self.instructions.push(asm::Store32( asm::Const(loop_var_offset), FRAME_POINTER, RESULT_REG, )); // Check that the start expression has the correct type let start_type = self.resolve_type(scope, &for_statement.start.rtype); self.check_type(&start_type, &INT_TYPE, for_statement.start.span); let start_label = self.anon_label(); let cond_label = self.anon_label(); let end_label = self.anon_label(); scope.loop_ends.push(end_label); // Check the condition before we start by jumping to the condition label self.instructions.push(asm::Jump(cond_label.clone())); // Compile the main body of the loop self.instructions.push(asm::Label(start_label.clone())); self.compile_block(scope, &for_statement.body); // Increment the loop variable self.instructions.push(asm::Load32(RESULT_REG, asm::Const(loop_var_offset), FRAME_POINTER)); self.instructions.push(asm::AddUnsignedValue(RESULT_REG, RESULT_REG, 1)); self.instructions.push(asm::Store32( asm::Const(loop_var_offset), FRAME_POINTER, RESULT_REG, )); // Jump back to the start if we haven't finished the loop. // Note: The loop variable will be already loaded into RESULT_REG self.instructions.push(asm::Label(cond_label)); self.instructions.push(asm::Load32(TEMP_REG, asm::Const(end_var_offset), FRAME_POINTER)); self.instructions.push(asm::SetLt(RESULT_REG, RESULT_REG, TEMP_REG)); self.instructions.push(asm::JumpIfNotZero(RESULT_REG, start_label)); // Add end label let end_label = scope.loop_ends.pop().expect("ICE: Missing label after loop"); self.instructions.push(asm::Label(end_label)); // Check that the body of the loop returns the correct type let body_rtype = self.resolve_type(scope, &for_statement.body.rtype()); self.check_type(&body_rtype, &UNIT_TYPE, for_statement.span); } fn compile_loop(&mut self, scope: &mut Scope, loop_statement: &ast::LoopStatement) { let start_label = self.anon_label(); self.instructions.push(asm::Label(start_label.clone())); // Add the end label to the loop ends vector, so that it can be used by breaks let end_label = self.anon_label(); scope.loop_ends.push(end_label); self.compile_block(scope, &loop_statement.body); // Add jump to start self.instructions.push(asm::Jump(start_label)); // Add end label let end_label = scope.loop_ends.pop().expect("ICE: Missing label after loop"); self.instructions.push(asm::Label(end_label)); // Check that the body of the loop returns the correct type let body_rtype = self.resolve_type(scope, &loop_statement.body.rtype()); self.check_type(&body_rtype, &UNIT_TYPE, loop_statement.span); } fn compile_call(&mut self, scope: &mut Scope, call: &ast::FunctionCall) { let mut call_args = vec![]; // Keep track of the offset of the stack, so that we can restore it later. let mut stack_offset = 0; for arg in &call.args { let arg_type = self.resolve_type(scope, &arg.rtype); let arg_size = self.size_of(&arg_type); // Compile the expression self.compile_expression(scope, arg); // Write the result of the expression to the stack self.copy_var(&arg_type, RESULT_REG, STACK_POINTER); // Increment the stack self.instructions.push(asm::AddUnsignedValue( STACK_POINTER, STACK_POINTER, arg_size as u16, )); stack_offset += arg_size as i16; call_args.push(arg_type); } // Get the function corresponding to the call let function = match scope.get_ident(&call.name, call.span) { FnIdent(ident) => ident, VarIdent(..) => panic!("ERROR_EXPECTED_FUNCTION_FOUND_VAR, TODO: Improve this error"), }; // Check that the call args match the function args if call_args.len() != function.arg_types.len() { panic!("INCORRECT NUMBER OF ARGUMENTS"); } for (call_arg, fn_arg) in call_args.iter().zip(function.arg_types.iter()) { self.check_type(call_arg, fn_arg, call.span); } // Make the call self.instructions.push(asm::JumpStore(function.location.clone())); // Restore the stack if stack_offset != 0 { self.instructions.push(asm::SubUnsignedValue( STACK_POINTER, STACK_POINTER, stack_offset as u16, )); } } fn compile_let(&mut self, scope: &mut Scope, let_statement: &ast::LetStatement) { // Register this variable let id = VarIdentId(scope.vars.len()); scope.add_ident(let_statement.name.clone(), id, let_statement.span); let rtype = self.resolve_type(scope, &let_statement.var_type); let var = Variable::new( let_statement.clone(), rtype.clone(), Offset(scope.next_offset), let_statement.is_const, ); scope.next_offset += self.size_of(&rtype) as i16; scope.vars.push(var); // Compile optional assignment if let Some(assignment) = &let_statement.assignment { self.compile_assign(scope, assignment) } } fn compile_assign(&mut self, scope: &mut Scope, assignment: &ast::Assignment) { // Compile the rhs expression and store the result in the location found self.compile_expression(scope, &assignment.rhs); self.instructions.push(asm::AddSigned(TEMP_REG, RESULT_REG, ZERO_REG)); // Check that the rhs result matches the target let target_type = self.resolve_type(scope, &assignment.target.rtype); self.check_type( &self.resolve_type(scope, &assignment.rhs.rtype), &target_type, assignment.span, ); // Get the address of where we want to place the variable let valid_address = self.compile_address(scope, &assignment.target); if !valid_address { self.logger.report_error( "illegal left-hand side expression".to_string(), assignment.target.span, ); self.fatal_error(); }; // We now have the result of the rhs in TEMP_REG and the address we want to assign to in // RESULT_REG. The type of the variable is required so that we know how to copy the data. self.copy_var(&target_type, TEMP_REG, RESULT_REG); } fn compile_struct_init(&mut self, scope: &mut Scope, struct_init: &ast::StructInit) { // Determine the type of the struct let struct_type = self.resolve_type(scope, &ast::UserType(struct_init.type_name.clone())); let struct_base_type = self.type_table.base_type(&struct_type).clone(); let struct_size = self.size_of(&struct_type); // Reserve memory for the struct self.instructions.push(asm::AddUnsignedValue(STACK_POINTER, STACK_POINTER, struct_size)); for &(ref field_name, ref expression) in &struct_init.field_init { let (field_offset, field_type) = self.find_field(&struct_base_type, field_name, struct_init.span); self.compile_expression(scope, expression); // Check that the types match self.check_type( &self.resolve_type(scope, &expression.rtype), &field_type, struct_init.span, ); self.instructions.push(asm::AddSignedValue( TEMP_REG, STACK_POINTER, (field_offset as i16) - (struct_size as i16), )); self.copy_var(&field_type, RESULT_REG, TEMP_REG); } // Unreserve the memory from the struct self.instructions.push(asm::AddSignedValue( STACK_POINTER, STACK_POINTER, -(struct_size as i16), )); // Return a pointer to the struct self.instructions.push(asm::AddUnsigned(RESULT_REG, STACK_POINTER, ZERO_REG)); } fn compile_static_array(&mut self, scope: &mut Scope, array: &ast::StaticArray) { // Special case for a zero sized array if array.elements.is_empty() { self.instructions.push(asm::AddUnsigned(RESULT_REG, STACK_POINTER, ZERO_REG)); return; } // Compile the first element and add it to the start of the array. // NOTE: this needs to be done first so that we can properly resolve the type of the array // elements self.compile_expression(scope, &array.elements[0]); let element_type = self.resolve_type(scope, &array.elements[0].rtype); // Using the unaligned size for arrays allows us to efficiently store strings as byte arrays let element_size = self.unaligned_size_of(&element_type); self.copy_var(&element_type, RESULT_REG, STACK_POINTER); let mut offset = element_size as i16; self.instructions.push(asm::AddUnsignedValue(STACK_POINTER, STACK_POINTER, element_size)); for element in array.elements.iter().skip(1) { self.compile_expression(scope, element); self.copy_var(&element_type, RESULT_REG, STACK_POINTER); self.instructions.push(asm::AddUnsignedValue( STACK_POINTER, STACK_POINTER, element_size, )); offset += element_size as i16; } // Ensure that the stack pointer is correctly aligned if offset % 4 != 0 { let pad = 4 - (offset % 4); offset += pad; self.instructions.push(asm::AddUnsignedValue(STACK_POINTER, STACK_POINTER, pad as u16)); } // Unreserve the memory from the array self.instructions.push(asm::AddSignedValue(STACK_POINTER, STACK_POINTER, -offset)); // Return a pointer to the first element self.instructions.push(asm::AddUnsigned(RESULT_REG, STACK_POINTER, ZERO_REG)); } fn copy_var(&mut self, var_type: &types::Type, from: asm::RegId, to: asm::RegId) { match *var_type { CHAR_TYPE => { self.instructions.push(asm::Store8(asm::Const(0), to, from)); } // These types are a single word in size INT_TYPE | BOOL_TYPE | types::Pointer(..) => { self.instructions.push(asm::Store32(asm::Const(0), to, from)); } // Other types cannot be stored in a single word, and since there is no easy way to do // a memcopy in DLX we must manually copy all bytes. In this case, the from register // will store the location of the first byte ref other => { // The copy register should never be either of the input registers assert!(from != COPY_REG && to != COPY_REG); // NOTE: types *must* be word aligned let num_words = (self.size_of(other) / 4) as i16; // Perform a load and store for each of the words for i in 0..num_words { self.instructions.push(asm::Load32(COPY_REG, asm::Const(i * 4), from)); self.instructions.push(asm::Store32(asm::Const(i * 4), to, COPY_REG)); } } } } fn compile_address(&mut self, scope: &mut Scope, expression: &ast::Expression) -> bool { let span = expression.span; match *expression.expr { // Address of an ordinary variable ast::VariableExpr(ref name) => { let var = scope.get_ident(name, span).unwrap_var(); self.address_of(&var.location); } // Address of a dereference (aka don't dereference) ast::DerefExpr(ref inner) => self.compile_expression(scope, inner), // Address of an array index ast::ArrayIndexExpr(ref inner) => self.compile_array_index(scope, inner), // Address of a struct field ast::FieldRefExpr(ref inner) => self.compile_field_ref(scope, inner), // Nothing else has a proper address _ => return false, } true } fn load_var(&mut self, var_type: &types::Type, location: &Location) { match *var_type { // These types are byte sized CHAR_TYPE => { match *location { Label(ref _label) => { // HACK to allow us to access some extra memory self.address_of(location); self.instructions.push(asm::Load8(RESULT_REG, asm::Const(0), RESULT_REG)); //self.instructions.push(asm::Load8(RESULT_REG, // asm::Unknown(label.clone()), ZERO_REG)); } Offset(amount) => { self.instructions.push(asm::Load8( RESULT_REG, asm::Const(amount), FRAME_POINTER, )); } Register(id) => { self.instructions.push(asm::Load8(RESULT_REG, asm::Const(0), id)); } } } // These types are word sized INT_TYPE | BOOL_TYPE | types::Pointer(..) => { match *location { Label(ref _label) => { // HACK to allow us to access some extra memory self.address_of(location); self.instructions.push(asm::Load32(RESULT_REG, asm::Const(0), RESULT_REG)); //self.instructions.push(asm::Load32(RESULT_REG, // asm::Unknown(label.clone()), ZERO_REG)); } Offset(amount) => { self.instructions.push(asm::Load32( RESULT_REG, asm::Const(amount), FRAME_POINTER, )); } Register(id) => { self.instructions.push(asm::Load32(RESULT_REG, asm::Const(0), id)); } } } // These types cannot be stored in registers so we load their address into the result // reg _ => self.address_of(location), } } fn address_of(&mut self, var_location: &Location) { match *var_location { Label(ref label) => { let asm = format!(" addui r{},r{},{}", RESULT_REG, ZERO_REG, label); self.instructions.push(asm::RawAsm(asm)); } Offset(offset) => { self.instructions.push(asm::AddSignedValue(RESULT_REG, FRAME_POINTER, offset)); } Register(id) => { self.instructions.push(asm::AddUnsigned(RESULT_REG, id, ZERO_REG)); } } } fn multiply_by(&mut self, num: usize) { // Check if it is a power of 2 // TODO: Generate extra code for multiplications that are not a power of 2 if num & (num - 1) != 0 { panic!("ICE, error multiplying by a number that is not a power of 2"); } let lshift_amount = (num as f32).log2() as u16; if lshift_amount != 0 { self.instructions.push(asm::LShiftValue(RESULT_REG, RESULT_REG, lshift_amount)); } } /// Check that a type is the same as the expected type or one path never returns fn check_type(&self, input: &Type, expected: &Type, span: InputSpan) { if input != &types::Bottom && expected != &types::Bottom && input != expected { self.logger.report_error( format!("incorrect type, expected: {:?}, found: {:?}", expected, input), span, ); self.fatal_error(); } } fn size_of(&self, type_: &Type) -> u16 { self.type_table.size_of(type_) } fn unaligned_size_of(&self, type_: &Type) -> u16 { self.type_table.unaligned_size_of(type_) } fn resolve_type(&self, scope: &Scope, ast_type: &ast::Type) -> Type { self.type_table.resolve_type(scope, ast_type) } }
true
12553702c11784035e1fb99dfb556bdae583bec1
Rust
shayneofficer/Advent-of-Code-2019
/04-secure-container/01.rs
UTF-8
934
3.75
4
[]
no_license
fn main() { let input_max: u32 = 905157; let input_min: u32 = 372037; let mut total_possible_passwords: u32 = 0; for i in input_min..input_max { let sequence: Vec<u32> = number_to_vec(i); if is_non_decreasing(&sequence) && contains_pair(&sequence) { total_possible_passwords += 1; } } println!("{}", total_possible_passwords); // 481 } fn is_non_decreasing(sequence: &Vec<u32>) -> bool { for i in 0..sequence.len() - 1 { if sequence[i] > sequence[i + 1] { return false; } } return true; } fn contains_pair(sequence: &Vec<u32>) -> bool { for i in 0..sequence.len() - 1 { if sequence[i] == sequence[i + 1] { return true; } } return false; } fn number_to_vec(number: u32) -> Vec<u32> { number.to_string() .chars() .map(|c| c.to_digit(10).unwrap()) .collect() }
true
d21da06ef7dd04de0b1e2c4c6eab9184b1e74ac1
Rust
Restioson/spinny
/src/lib.rs
UTF-8
3,595
2.71875
3
[ "Apache-2.0", "MIT" ]
permissive
// MIT/Apache2 License //! Implementation of a basic spin-based RwLock #![no_std] #![warn(clippy::pedantic)] use core::sync::atomic::{spin_loop_hint, AtomicUsize, Ordering}; use lock_api::{GuardSend, RawRwLock, RawRwLockDowngrade, RawRwLockUpgrade, RwLock as LARwLock, RwLockReadGuard as LARwLockReadGuard, RwLockWriteGuard as LARwLockWriteGuard, RwLockUpgradableReadGuard as LARwLockUpgradableReadGuard}; /// Raw spinlock rwlock, wrapped in the lock_api RwLock struct. pub struct RawRwSpinlock(AtomicUsize); // flags stored in the usize struct const READER: usize = 1 << 2; const UPGRADED: usize = 1 << 1; const WRITER: usize = 1 << 0; unsafe impl RawRwLock for RawRwSpinlock { const INIT: RawRwSpinlock = RawRwSpinlock(AtomicUsize::new(0)); type GuardMarker = GuardSend; fn lock_shared(&self) { while !self.try_lock_shared() { spin_loop_hint() } } fn try_lock_shared(&self) -> bool { let value = self.0.fetch_add(READER, Ordering::Acquire); if value & (WRITER | UPGRADED) != 0 { self.0.fetch_sub(READER, Ordering::Relaxed); false } else { true } } fn try_lock_exclusive(&self) -> bool { self.0 .compare_exchange(0, WRITER, Ordering::Acquire, Ordering::Relaxed) .is_ok() } fn lock_exclusive(&self) { loop { match self .0 .compare_exchange_weak(0, WRITER, Ordering::Acquire, Ordering::Relaxed) { Ok(_) => return, Err(_) => spin_loop_hint(), } } } unsafe fn unlock_shared(&self) { self.0.fetch_sub(READER, Ordering::Release); } unsafe fn unlock_exclusive(&self) { self.0.fetch_and(!(WRITER | UPGRADED), Ordering::Release); } } unsafe impl RawRwLockUpgrade for RawRwSpinlock { fn lock_upgradable(&self) { while !self.try_lock_upgradable() { spin_loop_hint() } } fn try_lock_upgradable(&self) -> bool { self.0.fetch_or(UPGRADED, Ordering::Acquire) & (WRITER | UPGRADED) == 0 } unsafe fn try_upgrade(&self) -> bool { self.0 .compare_exchange(UPGRADED, WRITER, Ordering::Acquire, Ordering::Relaxed) .is_ok() } unsafe fn upgrade(&self) { loop { match self.0.compare_exchange_weak( UPGRADED, WRITER, Ordering::Acquire, Ordering::Relaxed, ) { Ok(_) => return, Err(_) => spin_loop_hint(), } } } unsafe fn unlock_upgradable(&self) { self.0.fetch_sub(UPGRADED, Ordering::AcqRel); } } unsafe impl RawRwLockDowngrade for RawRwSpinlock { unsafe fn downgrade(&self) { self.0.fetch_add(READER, Ordering::Acquire); self.unlock_exclusive(); } } /// A read-write lock that uses a spinlock internally. pub type RwLock<T> = LARwLock<RawRwSpinlock, T>; /// A read guard for the read-write lock. pub type RwLockReadGuard<'a, T> = LARwLockReadGuard<'a, RawRwSpinlock, T>; /// A write guard fo the read-write lock. pub type RwLockWriteGuard<'a, T> = LARwLockWriteGuard<'a, RawRwSpinlock, T>; /// An upgradable read guard for the read-write lock. pub type RwLockUpgradableReadGuard<'a, T> = LARwLockUpgradableReadGuard<'a, RawRwSpinlock, T>; #[test] fn basics() { let rwlock = RwLock::new(8); assert_eq!(*rwlock.read(), 8); *rwlock.write() = 7; assert_eq!(*rwlock.read(), 7); }
true
36968cdcaaa3c033e934e588b1492c6481799f8d
Rust
cjhopman/starlark-rust
/starlark/src/values/mutability.rs
UTF-8
9,775
3.015625
3
[ "Apache-2.0" ]
permissive
// Copyright 2018 The Starlark in Rust Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //! Mutability-related utilities. use crate::values::ValueError; use std::cell::{BorrowError, BorrowMutError, Cell, Ref, RefCell, RefMut}; use std::fmt; use std::ops::Deref; use std::rc::Rc; /// A helper enum for defining the level of mutability of an iterable. #[derive(PartialEq, Eq, Hash, Debug, Copy, Clone)] pub enum MutabilityState { Shared, Mutable, Frozen, FrozenForIteration(bool), } impl MutabilityState { /// Tests the mutability value and return the appropriate error /// /// This method is to be called simply `mutability.test()?` to return /// an error if the current container is no longer mutable. pub fn test(self) -> Result<(), ValueError> { match self { MutabilityState::Shared => Ok(()), MutabilityState::Mutable => Ok(()), MutabilityState::Frozen => Err(ValueError::CannotMutateFrozenValue), MutabilityState::FrozenForIteration(_) => Err(ValueError::MutationDuringIteration), } } } /// `std::cell::Ref<T>` or `&T` pub enum RefOrRef<'a, T: ?Sized + 'a> { Ptr(&'a T), Borrowed(Ref<'a, T>), } impl<'a, T: ?Sized + 'a> Deref for RefOrRef<'a, T> { type Target = T; fn deref(&self) -> &T { match self { RefOrRef::Ptr(p) => p, RefOrRef::Borrowed(p) => p.deref(), } } } impl<'a, T: ?Sized + 'a> RefOrRef<'a, T> { pub fn map<U: ?Sized, F>(orig: RefOrRef<'a, T>, f: F) -> RefOrRef<'a, U> where F: FnOnce(&T) -> &U, { match orig { RefOrRef::Ptr(p) => RefOrRef::Ptr(f(p)), RefOrRef::Borrowed(p) => RefOrRef::Borrowed(Ref::map(p, f)), } } } /// Container for data which is either `RefCell` or immutable data. pub trait ContentCell { type Content; const MUTABLE: bool; fn new(value: Self::Content) -> Self; fn borrow(&self) -> RefOrRef<'_, Self::Content>; fn try_borrow(&self) -> Result<RefOrRef<Self::Content>, BorrowError>; fn borrow_mut(&self) -> RefMut<'_, Self::Content>; fn try_borrow_mut(&self) -> Result<RefMut<'_, Self::Content>, ()>; fn shared(&self) -> Self; fn as_ptr(&self) -> *const Self::Content; fn test_mut(&self) -> Result<(), ValueError>; fn freeze(&self); fn freeze_for_iteration(&self); fn unfreeze_for_iteration(&self); } /// Container for immutable data #[derive(Debug, Clone)] pub struct ImmutableCell<T>(T); pub trait CloneForCell { fn clone_for_cell(&self) -> Self; } #[derive(Debug)] pub enum Sharable<T> { Uninit, Owned(T), Shared(Rc<T>), } impl<T> Sharable<T> { pub fn to_ref(&self) -> &T { match self { Sharable::Uninit => panic!(), Sharable::Owned(ref t) => t, Sharable::Shared(ref rc) => &*rc, } } pub fn to_ref_mut(&mut self) -> &mut T { match self { Sharable::Uninit => panic!(), Sharable::Owned(ref mut t) => t, Sharable::Shared(_) => panic!(), } } pub fn shared(&mut self) -> Sharable<T> { match self { Sharable::Uninit => panic!(), Sharable::Shared(ref rc) => Sharable::Shared(rc.clone()), Sharable::Owned(_) => { let mut taken = Sharable::Uninit; std::mem::swap(self, &mut taken); match taken { Sharable::Owned(t) => { let rc = Rc::new(t); let mut sharable = Sharable::Shared(rc.clone()); std::mem::swap(self, &mut sharable); Sharable::Shared(rc.clone()) } _ => unreachable!(), } } } } } #[derive(Debug)] pub struct MutableCell<T: CloneForCell> { state: Cell<MutabilityState>, val: RefCell<Sharable<T>>, } impl<T: CloneForCell> MutableCell<T> { pub fn ensure_owned(&self) { match self.state.get() { MutabilityState::Shared => { self.state.set(MutabilityState::Mutable); // println!("making owned"); let mut bw = self.val.borrow_mut(); let cl = match *bw { Sharable::Shared(ref rc) => rc.clone_for_cell(), _ => panic!(), }; *bw = Sharable::Owned(cl); } MutabilityState::Mutable => match *self.val.borrow() { Sharable::Owned(..) => {} _ => panic!(), }, MutabilityState::Frozen => panic!(), MutabilityState::FrozenForIteration(_) => panic!(), } } } impl<T: CloneForCell> ContentCell for MutableCell<T> { type Content = T; const MUTABLE: bool = true; fn new(value: T) -> Self { Self { state: Cell::new(MutabilityState::Mutable), val: RefCell::new(Sharable::Owned(value)), } } fn test_mut(&self) -> Result<(), ValueError> { self.state.get().test() } fn borrow(&self) -> RefOrRef<T> { RefOrRef::Borrowed(Ref::map(RefCell::borrow(&self.val), Sharable::to_ref)) } fn try_borrow(&self) -> Result<RefOrRef<T>, BorrowError> { RefCell::try_borrow(&self.val).map(|b| RefOrRef::Borrowed(Ref::map(b, Sharable::to_ref))) } fn borrow_mut(&self) -> RefMut<Self::Content> { self.ensure_owned(); RefMut::map(RefCell::borrow_mut(&self.val), Sharable::to_ref_mut) } fn try_borrow_mut(&self) -> Result<RefMut<Self::Content>, ()> { match self.state.get() { MutabilityState::Shared | MutabilityState::Mutable => { self.ensure_owned(); RefCell::try_borrow_mut(&self.val) .map(|b| RefMut::map(b, Sharable::to_ref_mut)) .map_err(|e| ()) } MutabilityState::Frozen => Err(()), MutabilityState::FrozenForIteration(_) => Err(()), } } fn as_ptr(&self) -> *const T { let ptr = RefCell::as_ptr(&self.val); unsafe { match *ptr { Sharable::Uninit => panic!(), Sharable::Owned(ref p) => &*p, Sharable::Shared(ref rc) => &**rc, } } } fn shared(&self) -> Self { match self.state.get() { MutabilityState::FrozenForIteration(_) => panic!("attempt to freeze during iteration"), MutabilityState::Frozen => {} MutabilityState::Mutable => { self.state.set(MutabilityState::Shared); } MutabilityState::Shared => {} } let shared = self.val.borrow_mut().shared(); Self { state: Cell::new(MutabilityState::Shared), val: RefCell::new(shared), } } fn freeze(&self) { match self.state.get() { MutabilityState::FrozenForIteration(_) => panic!("attempt to freeze during iteration"), MutabilityState::Frozen => {} MutabilityState::Mutable => self.state.set(MutabilityState::Frozen), MutabilityState::Shared => self.state.set(MutabilityState::Frozen), } } /// Freezes the current value for iterating over. fn freeze_for_iteration(&self) { match self.state.get() { MutabilityState::Frozen => {} MutabilityState::FrozenForIteration(_) => panic!("already frozen"), MutabilityState::Mutable => self.state.set(MutabilityState::FrozenForIteration(false)), MutabilityState::Shared => self.state.set(MutabilityState::FrozenForIteration(true)), } } /// Unfreezes the current value for iterating over. fn unfreeze_for_iteration(&self) { match self.state.get() { MutabilityState::Frozen => {} MutabilityState::FrozenForIteration(false) => self.state.set(MutabilityState::Mutable), MutabilityState::FrozenForIteration(true) => self.state.set(MutabilityState::Shared), MutabilityState::Mutable => panic!("not frozen"), MutabilityState::Shared => panic!("not frozen"), } } } impl<T> ContentCell for ImmutableCell<T> { type Content = T; const MUTABLE: bool = false; fn new(value: T) -> Self { ImmutableCell(value) } fn borrow(&self) -> RefOrRef<T> { RefOrRef::Ptr(&self.0) } fn try_borrow(&self) -> Result<RefOrRef<T>, BorrowError> { Ok(RefOrRef::Ptr(&self.0)) } fn borrow_mut(&self) -> RefMut<Self::Content> { panic!("immutable value cannot be mutably borrowed") } fn try_borrow_mut(&self) -> Result<RefMut<Self::Content>, ()> { Err(()) } fn as_ptr(&self) -> *const T { &self.0 as *const T } fn shared(&self) -> Self { unimplemented!("shared not impled for immutables") } fn test_mut(&self) -> Result<(), ValueError> { Err(ValueError::CannotMutateImmutableValue) } fn freeze(&self) {} fn freeze_for_iteration(&self) {} fn unfreeze_for_iteration(&self) {} }
true
425bb0d4c9eb93e77abd5659a9f5045b7951d283
Rust
18B01A05D8/ElitePrograms
/golf.rs
UTF-8
871
3.359375
3
[]
no_license
use std::collections::HashMap; fn main(){ let golf_scores: HashMap<&str, i32> = [("albatross", -3),("eagle", -2),("birdie", -1),("par",0),("bogey",1),("double-bogey",2),("triple-bogey",3)].iter().cloned().collect(); let input_list = ["eagle" , "bogey" , "par" , "bogey" , "double-bogey" , "birdie" ,"bogey" ,"par" , "birdie" ,"par" ,"par" ,"par", "par" ,"par" , "bogey" , "eagle" , "bogey" , "par"]; let mut sum = 0; for x in input_list.iter(){ match golf_scores.get::<str>(&x.to_string()){ Some(value) => { sum = sum + value; } None =>{ println!("something went wrong"); } } } if (sum > 0) { println!("{} over par",sum); } else if(sum == 0) { println!("par"); } else { println!("{} under par",sum); } }
true