blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
721
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
57
| license_type
stringclasses 2
values | repo_name
stringlengths 5
91
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 321
values | visit_date
timestamp[ns]date 2016-08-12 09:31:09
2023-09-06 10:45:07
| revision_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| committer_date
timestamp[ns]date 2010-09-28 14:01:40
2023-09-06 06:22:19
| github_id
int64 426
681M
| star_events_count
int64 101
243k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 23
values | gha_event_created_at
timestamp[ns]date 2012-06-28 18:51:49
2023-09-14 21:59:16
⌀ | gha_created_at
timestamp[ns]date 2008-02-11 22:55:26
2023-08-10 11:14:58
⌀ | gha_language
stringclasses 147
values | src_encoding
stringclasses 26
values | language
stringclasses 2
values | is_vendor
bool 2
classes | is_generated
bool 2
classes | length_bytes
int64 6
10.2M
| extension
stringclasses 115
values | filename
stringlengths 3
113
| content
stringlengths 6
10.2M
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9b180ac4a545dcf93d0a4a154525a8a3e4c29c9b
|
549270020f6c8724e2ef1b12e38d11b025579f8d
|
/recipes/shaderc/all/test_package/test_package_shaderc.c
|
6a83dd0f7a22f63fc1601a7da337d625ac12baf3
|
[
"MIT"
] |
permissive
|
conan-io/conan-center-index
|
1bcec065ccd65aa38b1fed93fbd94d9d5fe6bc43
|
3b17e69bb4e5601a850b6e006e44775e690bac33
|
refs/heads/master
| 2023-08-31T11:34:45.403978
| 2023-08-31T11:13:23
| 2023-08-31T11:13:23
| 204,671,232
| 844
| 1,820
|
MIT
| 2023-09-14T21:22:42
| 2019-08-27T09:43:58
|
Python
|
UTF-8
|
C
| false
| false
| 175
|
c
|
test_package_shaderc.c
|
#include <shaderc/shaderc.h>
int main() {
shaderc_compiler_t shaderc_compiler = shaderc_compiler_initialize();
shaderc_compiler_release(shaderc_compiler);
return 0;
}
|
538e920015a0ea433bdbf7fa6445ab2da93d1791
|
28d0f8c01599f8f6c711bdde0b59f9c2cd221203
|
/sys/arch/evbppc/pmppc/machdep.c
|
aab2b34cfd4a6b72db45823a290de6639192a4f2
|
[] |
no_license
|
NetBSD/src
|
1a9cbc22ed778be638b37869ed4fb5c8dd616166
|
23ee83f7c0aea0777bd89d8ebd7f0cde9880d13c
|
refs/heads/trunk
| 2023-08-31T13:24:58.105962
| 2023-08-27T15:50:47
| 2023-08-27T15:50:47
| 88,439,547
| 656
| 348
| null | 2023-07-20T20:07:24
| 2017-04-16T20:03:43
| null |
UTF-8
|
C
| false
| false
| 11,199
|
c
|
machdep.c
|
/* $NetBSD: machdep.c,v 1.14 2018/07/15 05:16:42 maxv Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Lennart Augustsson (lennart@augustsson.net) at Sandburst Corp.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
* Copyright (C) 1995, 1996 TooLs GmbH.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by TooLs GmbH.
* 4. The name of TooLs GmbH may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.14 2018/07/15 05:16:42 maxv Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
#include "opt_ddbparam.h"
#include "opt_inet.h"
#include "opt_ccitt.h"
#include "opt_ns.h"
#include <sys/param.h>
#include <sys/buf.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/exec.h>
#include <sys/extent.h>
#include <sys/intr.h>
#include <sys/kernel.h>
#include <sys/kgdb.h>
#include <sys/ksyms.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/mount.h>
#include <sys/msgbuf.h>
#include <sys/proc.h>
#include <sys/reboot.h>
#include <sys/syscallargs.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/systm.h>
#include <uvm/uvm_extern.h>
#include <machine/powerpc.h>
#include <machine/pmppc.h>
#include <powerpc/db_machdep.h>
#include <powerpc/pio.h>
#include <powerpc/pmap.h>
#include <powerpc/trap.h>
#include <powerpc/oea/bat.h>
#include <powerpc/pic/picvar.h>
#include <ddb/db_extern.h>
#include <dev/cons.h>
#include <dev/ic/cpc700reg.h>
#include <dev/ic/cpc700uic.h>
#include "com.h"
#if (NCOM > 0)
#include <sys/termios.h>
#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
#endif
#include "ksyms.h"
struct powerpc_bus_space pmppc_mem_tag = {
_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_MEM_TYPE,
0, 0, 0xffffffff,
NULL,
};
struct powerpc_bus_space pmppc_pci_io_tag = {
_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_MEM_TYPE,
0, CPC_PCI_IO_BASE, 0xffffffff,
NULL,
};
static char ex_storage[1][EXTENT_FIXED_STORAGE_SIZE(8)]
__attribute__((aligned(8)));
#ifdef KGDB
char kgdb_devname[] = KGDB_DEVNAME;
int comkgdbaddr = KGDB_DEVADDR;
int comkgdbrate = KGDB_DEVRATE;
#ifndef KGDB_DEVMODE
#define KGDB_DEVMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
#endif
int comkgdbmode = KGDB_DEVMODE;
void kgdb_port_init(void);
#endif /* KGDB */
/*
* Global variables used here and there
*/
struct mem_region physmemr[2], availmemr[2];
struct a_config a_config;
void initppc(u_int, u_int, u_int, void *); /* Called from locore */
void pmppc_setup(void);
void setleds(int leds);
void
initppc(u_int startkernel, u_int endkernel, u_int args, void *btinfo)
{
extern void consinit(void);
extern u_long ticks_per_sec;
extern unsigned char edata[], end[];
memset(&edata, 0, end - edata); /* clear BSS */
pmppc_setup();
physmemr[0].start = 0;
physmemr[0].size = a_config.a_mem_size;
physmemr[1].size = 0;
availmemr[0].start = (endkernel + PGOFSET) & ~PGOFSET;
availmemr[0].size = a_config.a_mem_size - availmemr[0].start;
availmemr[1].size = 0;
#ifdef BOOTHOWTO
/*
* boothowto
*/
boothowto = BOOTHOWTO;
#endif
if (bus_space_init(&pmppc_mem_tag, "iomem",
ex_storage[0], sizeof(ex_storage[0])))
panic("bus_space_init failed");
/*
* Initialize the BAT registers
*/
oea_batinit(
PMPPC_FLASH_BASE, BAT_BL_256M, /* flash (etc) memory 256M area */
CPC_PCI_MEM_BASE, BAT_BL_256M, /* PCI memory 256M area */
CPC_PCI_IO_BASE, BAT_BL_128M, /* PCI I/O 128M area */
0);
/*
* Set up trap vectors
*/
oea_init(NULL);
/*
* Get CPU clock
*/
ticks_per_sec = a_config.a_bus_freq;
ticks_per_sec /= 4; /* 4 cycles per DEC tick */
cpu_timebase = ticks_per_sec;
/*
* Set up console.
*/
consinit(); /* XXX should not be here */
printf("console set up\n");
uvm_md_init();
/*
* Initialize pmap module.
*/
pmap_bootstrap(startkernel, endkernel);
#ifdef KGDB
kgdb_port_init();
if (boothowto & RB_KDB) {
kgdb_debug_init = 1;
kgdb_connect(1);
}
#endif
}
void
mem_regions(struct mem_region **mem, struct mem_region **avail)
{
*mem = physmemr;
*avail = availmemr;
}
/*
* Machine dependent startup code.
*/
void
cpu_startup(void)
{
oea_startup(NULL);
/*
* Now that we have VM, malloc()s are OK in bus_space.
*/
bus_space_mallocok();
/* Set up the PCI bus tag. */
if (bus_space_init(&pmppc_pci_io_tag, "pcimem", NULL, 0))
panic("bus_space_init pci failed");
/* Set up interrupt controller */
cpc700_init_intr(&pmppc_mem_tag, CPC_UIC_BASE,
CPC_INTR_MASK(PMPPC_I_ETH_INT), 0);
pic_init();
(void)setup_cpc700();
oea_install_extint(pic_ext_intr);
#if 0
/* XXX doesn't seem to be needed anymore */
/*
* Now allow hardware interrupts.
*/
__asm volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0"
: "=r"(msr) : "K"(PSL_EE));
#endif
}
/*
* consinit
* Initialize system console.
*/
void
consinit(void)
{
static int initted;
#if (NCOM > 0)
bus_space_tag_t tag;
#endif
if (initted)
return;
initted = 1;
#if (NCOM > 0)
tag = &pmppc_mem_tag;
if(comcnattach(tag, CPC_COM0, 9600, CPC_COM_SPEED(a_config.a_bus_freq),
COM_TYPE_NORMAL,
((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8)))
panic("can't init serial console");
else
return;
#endif
panic("console device missing -- serial console not in kernel");
/* Of course, this is moot if there is no console... */
}
#ifdef KGDB
void
kgdb_port_init(void)
{
#if (NCOM > 0)
if(!strcmp(kgdb_devname, "com")) {
bus_space_tag_t tag = &pmppc_mem_tag;
com_kgdb_attach(tag, comkgdbaddr, comkgdbrate,
CPC_COM_SPEED(a_config.a_bus_freq),
COM_TYPE_NORMAL, comkgdbmode);
}
#endif
}
#endif
/*
* Halt or reboot the machine after syncing/dumping according to howto.
*/
void
cpu_reboot(int howto, char *what)
{
static int syncing;
static char str[256];
char *ap = str, *ap1 = ap;
extern void disable_intr(void);
boothowto = howto;
if (!cold && !(howto & RB_NOSYNC) && !syncing) {
syncing = 1;
vfs_shutdown(); /* sync */
resettodr(); /* set wall clock */
}
splhigh();
if (howto & RB_HALT) {
doshutdownhooks();
pmf_system_shutdown(boothowto);
printf("halted\n\n");
while(1);
}
if (!cold && (howto & RB_DUMP))
oea_dumpsys();
doshutdownhooks();
pmf_system_shutdown(boothowto);
printf("rebooting\n\n");
if (what && *what) {
if (strlen(what) > sizeof str - 5)
printf("boot string too large, ignored\n");
else {
strcpy(str, what);
ap1 = ap = str + strlen(str);
*ap++ = ' ';
}
}
*ap++ = '-';
if (howto & RB_SINGLE)
*ap++ = 's';
if (howto & RB_KDB)
*ap++ = 'd';
*ap++ = 0;
if (ap[-2] == '-')
*ap1 = 0;
disable_intr();
/* Write the two byte reset sequence to the reset register. */
out8(PMPPC_RESET, PMPPC_RESET_SEQ_STEP1);
out8(PMPPC_RESET, PMPPC_RESET_SEQ_STEP2);
while (1);
}
void
setleds(int leds)
{
out8(PMPPC_LEDS, leds);
}
void
pmppc_setup(void)
{
uint config0, config1;
config0 = in8(PMPPC_CONFIG0);
config1 = in8(PMPPC_CONFIG1);
/* from page 2-8 in the Artesyn User's manual */
a_config.a_boot_device = config1 & 0x80 ? A_BOOT_FLASH : A_BOOT_ROM;
a_config.a_has_ecc = (config1 & 0x40) != 0;
switch (config1 & 0x30) {
case 0x00: a_config.a_mem_size = 32 * 1024 * 1024; break;
case 0x10: a_config.a_mem_size = 64 * 1024 * 1024; break;
case 0x20: a_config.a_mem_size = 128 * 1024 * 1024; break;
case 0x30: a_config.a_mem_size = 256 * 1024 * 1024; break;
}
a_config.a_l2_cache = (config1 >> 2) & 3;
switch (config1 & 0x03) {
case 0x00: a_config.a_bus_freq = 66666666; break;
case 0x01: a_config.a_bus_freq = 83333333; break;
case 0x02: a_config.a_bus_freq = 100000000; break;
case 0x03: a_config.a_bus_freq = 0; break; /* XXX */
}
a_config.a_is_monarch = (config0 & 0x80) == 0;
a_config.a_has_eth = (config0 & 0x20) != 0;
a_config.a_has_rtc = (config0 & 0x10) == 0;
switch (config0 & 0x0c) {
case 0x00: a_config.a_flash_size = 256 * 1024 * 1024; break;
case 0x04: a_config.a_flash_size = 128 * 1024 * 1024; break;
case 0x08: a_config.a_flash_size = 64 * 1024 * 1024; break;
case 0x0c: a_config.a_flash_size = 32 * 1024 * 1024; break;
}
switch (config0 & 0x03) {
case 0x00: a_config.a_flash_width = 64; break;
case 0x01: a_config.a_flash_width = 32; break;
case 0x02: a_config.a_flash_width = 16; break;
case 0x03: a_config.a_flash_width = 0; break;
}
}
|
ad8e24a1c84fcff34c1a720c4c637eaa9d4cbfa8
|
e3e7da042dcef56cd654d6599898eee34e7f1a08
|
/test/memcachedmock.c
|
b6c2e6fceedf9c19cc16209534980083a94c9c0d
|
[
"BSD-4-Clause-UC",
"LicenseRef-scancode-rsa-md4",
"Zlib",
"Beerware",
"RSA-MD",
"LicenseRef-scancode-rsa-1990",
"BSD-4-Clause",
"ISC",
"LicenseRef-scancode-other-permissive",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-generic-export-compliance"
] |
permissive
|
apache/apr
|
1c202827c91de87043d342968be4c74d7d0ccd37
|
59341af138dd2c6fe9444ee9c865b769c0053bdd
|
refs/heads/trunk
| 2023-08-16T19:06:37.213299
| 2023-06-27T14:06:09
| 2023-06-27T14:06:09
| 160,997
| 419
| 215
|
Apache-2.0
| 2023-06-27T14:06:18
| 2009-03-27T15:41:55
|
C
|
UTF-8
|
C
| false
| false
| 2,371
|
c
|
memcachedmock.c
|
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
#include <stdlib.h>
#include "apr_network_io.h"
#include "apr_pools.h"
#include "apr_pools.h"
#include "testmemcache.h"
#define MOCK_REPLY "VERSION 1.5.22\r\n"
int main(int argc, char *argv[])
{
apr_pool_t *p;
apr_sockaddr_t *sa;
apr_socket_t *server;
apr_socket_t *server_connection;
apr_status_t rv;
apr_size_t length;
int i;
apr_initialize();
atexit(apr_terminate);
apr_pool_create(&p, NULL);
apr_sockaddr_info_get(&sa, MOCK_HOST, APR_UNSPEC, MOCK_PORT, 0, p);
apr_socket_create(&server, sa->family, SOCK_STREAM, 0, p);
apr_socket_opt_set(server, APR_SO_REUSEADDR, 1);
apr_socket_timeout_set(server, 0);
apr_socket_bind(server, sa);
apr_socket_listen(server, 5);
/* Do spin instead of a proper poll for sake of simplicity */
for (i = 0; i < 4; i++) {
rv = apr_socket_accept(&server_connection, server, p);
if (rv == APR_SUCCESS) {
break;
}
apr_sleep(apr_time_from_sec(1));
}
length = strlen(MOCK_REPLY);
apr_socket_send(server_connection, MOCK_REPLY, &length);
apr_socket_close(server_connection);
/* Do spin instead of a proper poll for sake of simplicity */
for (i = 0; i < 4; i++) {
rv = apr_socket_accept(&server_connection, server, p);
if (rv == APR_SUCCESS) {
break;
}
apr_sleep(apr_time_from_sec(1));
}
length = strlen(MOCK_REPLY);
apr_socket_send(server_connection, MOCK_REPLY, &length);
apr_socket_close(server_connection);
exit(0);
}
|
b5816ec8494715839243fbce73ec79be7576a384
|
5eff7a36d9a9917dce9111f0c3074375fe6f7656
|
/lib/mesa/src/vulkan/wsi/wsi_common_display.h
|
dd54b9b775fcb68d4cca9bab686bd37f81ad09d8
|
[] |
no_license
|
openbsd/xenocara
|
cb392d02ebba06f6ff7d826fd8a89aa3b8401779
|
a012b5de33ea0b977095d77316a521195b26cc6b
|
refs/heads/master
| 2023-08-25T12:16:58.862008
| 2023-08-12T16:16:25
| 2023-08-12T16:16:25
| 66,967,384
| 177
| 66
| null | 2023-07-22T18:12:37
| 2016-08-30T18:36:01
|
C
|
UTF-8
|
C
| false
| false
| 2,223
|
h
|
wsi_common_display.h
|
/*
* Copyright © 2017 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef WSI_COMMON_DISPLAY_H
#define WSI_COMMON_DISPLAY_H
#include "wsi_common.h"
#include <xf86drm.h>
#include <xf86drmMode.h>
struct vk_sync;
/* VK_EXT_display_control */
VkResult
wsi_register_device_event(VkDevice device,
struct wsi_device *wsi_device,
const VkDeviceEventInfoEXT *device_event_info,
const VkAllocationCallbacks *allocator,
struct vk_sync **sync,
int sync_fd);
VkResult
wsi_register_display_event(VkDevice device,
struct wsi_device *wsi_device,
VkDisplayKHR display,
const VkDisplayEventInfoEXT *display_event_info,
const VkAllocationCallbacks *allocator,
struct vk_sync **sync,
int sync_fd);
#endif
|
34f2313ee1afeccc8397cbcb54af2de8e8ba4a6f
|
5999474eb6a5d12efe7ca7bafc7e6e4048c65fc0
|
/src/pir.h
|
2e150120a989f9fff3054946f98906fb9bf4e682
|
[
"MIT"
] |
permissive
|
PetoiCamp/OpenCat
|
dd1c4bf857f7831f902aef812763581aeedb5d8e
|
335e0fe529f1acb405f879c5b6012398c835d953
|
refs/heads/main
| 2023-09-05T10:27:06.631580
| 2023-09-03T17:21:02
| 2023-09-03T17:21:02
| 326,441,188
| 2,374
| 315
|
MIT
| 2023-09-14T12:26:31
| 2021-01-03T15:42:00
|
C++
|
UTF-8
|
C
| false
| false
| 628
|
h
|
pir.h
|
#define PIR_PIN 8
bool previousPIR = false;
void createPirTask() { //this is an example task
tQueue->addTask('k', "sit");
tQueue->addTask('m', "0 -60 0 60", 2000);
char music[] = { 14, 8, 18, 16, 16, 16, 13, 16, 9, 16, 11, 16, 0, 4, 13, 8, 9, 4, '~' };
tQueue->addTask('B', music);
tQueue->addTask('k', "str", 2000);
tQueue->addTask('k', "up");
}
void read_PIR() {
bool currentPIR = digitalRead(PIR_PIN);
PTL(currentPIR);
if (currentPIR && !previousPIR) {
createPirTask();
previousPIR = 1;
} else if (!currentPIR && previousPIR) {
newCmdIdx = 5;
token = T_REST;
previousPIR = 0;
}
}
|
2fde9867f2f2dacdbae5fb6b2ec0f2dce1abba49
|
2898fa4f2ad766afa0495a837f59fe95daa081a7
|
/tests/unit-pass/anon-structs-5.c
|
9aabff04c0a289d0ff8c893f04518781b8b441ca
|
[
"NCSA"
] |
permissive
|
kframework/c-semantics
|
12fcc1b1bf1f7792636d1c37f6f7bb1b89a392b5
|
e6879d14455771aa0cb3e3d201131d4d763a73a2
|
refs/heads/master
| 2023-07-31T23:57:03.316456
| 2022-02-01T17:50:31
| 2022-02-01T17:50:31
| 11,747,541
| 312
| 52
|
NOASSERTION
| 2022-02-01T17:50:33
| 2013-07-29T19:13:25
|
C
|
UTF-8
|
C
| false
| false
| 170
|
c
|
anon-structs-5.c
|
#include <stdlib.h>
struct s { struct { int x; }; } foo;
struct s bar() {
foo.x = 7;
return foo;
}
int main() {
if (bar().x != 7) exit(EXIT_FAILURE);
return 0;
}
|
074b548f2767e3f7893a75aad9b0b957b59ac9f0
|
03666e5f961946fc1a0ac67781ac1425562ef0d7
|
/src/common/state/XMLNode.C
|
13c5ed2a0f3059f200c6e13e9b95139729131638
|
[
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
visit-dav/visit
|
e9f81b4d4b9b9930a0db9d5282cd1bcabf465e2e
|
601ae46e0bef2e18425b482a755d03490ade0493
|
refs/heads/develop
| 2023-09-06T08:19:38.397058
| 2023-09-05T21:29:32
| 2023-09-05T21:29:32
| 165,565,988
| 335
| 120
|
BSD-3-Clause
| 2023-09-14T00:53:37
| 2019-01-13T23:27:26
|
C
|
UTF-8
|
C
| false
| false
| 17,678
|
c
|
XMLNode.C
|
// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers. See the top-level LICENSE file for dates and other
// details. No copyright assignment is required to contribute to VisIt.
#include <XMLNode.h>
#include <visitstream.h>
#include <stack>
using namespace std;
string XMLNode::unset_str = "[unset]";
// ****************************************************************************
// Method: XMLNode::XMLNode
//
// Purpose:
//
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode::XMLNode()
: name(""), text("")
{;}
// ****************************************************************************
// Method: XMLNode::XMLNode
//
// Purpose:
//
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode::XMLNode(const string &xml_data)
: name(""), text("")
{
Parse(xml_data);
}
// ****************************************************************************
// Method: XMLNode::XMLNode
//
// Purpose:
//
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode::XMLNode(istream &iss)
: name(""), text("")
{
Parse(iss);
}
// ****************************************************************************
// Method: XMLNode::XMLNode
//
// Purpose:
//
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode::XMLNode(const XMLNode &node)
: name(""), text("")
{
Init(node);
}
// ****************************************************************************
// Method: XMLNode::operator=
//
// Purpose:
//
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode &
XMLNode::operator=(const XMLNode &node)
{
if(this != &node)
Init(node);
return *this;
}
// ****************************************************************************
// Method: XMLNode::~XMLNode
//
// Purpose:
// XMLNode destructor.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode::~XMLNode()
{
Cleanup();
}
// ****************************************************************************
// Method: XMLNode::Attribute
//
// Purpose:
// Gets attribute in a const safe way. If attribute is not set,
// returns "[unset]".
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
const string &
XMLNode::Attribute(const string &att_name) const
{
map<string,string>::const_iterator itr = attributes.find(att_name);
if(itr == attributes.end())
return unset_str;
else
return itr->second;
}
// ****************************************************************************
// Method: XMLNode::HasAttribute
//
// Purpose:
// Checks if the node has an attribute with the given name.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
bool
XMLNode::HasAttribute(const string &name) const
{
return attributes.find(name) != attributes.end();
}
// ****************************************************************************
// Method: XMLNode::DeleteAttribute
//
// Purpose:
// Removes attribute with the given name, if it exists. Return result
// indicates success.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
bool
XMLNode::DeleteAttribute(const string &name)
{
map<string,string>::iterator itr = attributes.find(name);
if(itr != attributes.end())
{
attributes.erase(itr);
return true;
}
else
{
return false;
}
}
// ****************************************************************************
// Method: XMLNode::GetAttributeNames
//
// Purpose:
// Enumerates the attribute names of this node.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
void
XMLNode::GetAttributeNames(stringVector &result) const
{
result.clear();
map<string,string>::const_iterator itr;
for(itr =attributes.begin(); itr != attributes.end();++itr)
result.push_back(itr->first);
}
// ****************************************************************************
// Method: XMLNode::GetAttributeNames
//
// Purpose:
// Gets pointer to child at given index, returns NULL if index is invalid.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode *
XMLNode::GetChild(int index) const
{
if(index < 0 || (size_t)index >= children.size())
return NULL;
return children[index];
}
// ****************************************************************************
// Method: XMLNode::AddChild
//
// Purpose:
// Creates a new child the given name, and returns its pointer.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode *
XMLNode::AddChild(const string &name)
{
XMLNode *child = new XMLNode();
child->Name() = name;
children.push_back(child);
return child;
}
// ****************************************************************************
// Method: XMLNode::AddChild
//
// Purpose:
// Creates copy of the passed node, adds it as a child and returns
// the new child's pointer.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode *
XMLNode::AddChild(const XMLNode &node)
{
XMLNode *child = new XMLNode(node);
children.push_back(child);
return child;
}
// ****************************************************************************
// Method: XMLNode::TakeChild
//
// Purpose:
// Removes the child node at given index from this node. After this
// the caller assumes responsiblity for deleting the returned node.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
XMLNode *
XMLNode::TakeChild(int index)
{
if(index < 0 || (size_t)index >= children.size())
return 0;
XMLNode *child = children[index];
children.erase(children.begin()+index);
return child;
}
// ****************************************************************************
// Method: XMLNode::DeleteChild
//
// Purpose:
// Removes the child node at given index. Result indicates success.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
bool
XMLNode::DeleteChild(int index)
{
if(index < 0 || (size_t)index >= children.size())
return false;
XMLNode *child = children[index];
delete child;
children.erase(children.begin()+index);
return true;
}
// ****************************************************************************
// Method: XMLNode::FindIndex
//
// Purpose:
// Finds the index of the first child with the given name, after the start
// index. -1 == failure.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// Modifications:
// Kathleen Bonnell, Wed Jan 2 08:15:07 PST 2008
// Fix compile error. (start = 0, instead of start ==0).
//
// ****************************************************************************
int
XMLNode::FindIndex(const string &name, int start) const
{
if(start < 0)
start = 0;
if((size_t)start > children.size())
return -1;
for(size_t i=start; i<children.size(); i++)
{
if(name == children[i]->Name())
return i;
}
return -1;
}
// ****************************************************************************
// Method: XMLNode::ToString
//
// Purpose:
// Creates an xml string from this node.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
string
XMLNode::ToString(const string &indent) const
{
ostringstream oss;
string esc_name =EscapeString(name);
oss << indent <<"<" << esc_name;
map<string,string>::const_iterator itr;
for(itr = attributes.begin(); itr != attributes.end(); ++itr)
{
oss << " " << EscapeString(itr->first) << "=\""
<< EscapeString(itr->second) << "\"";
}
oss << ">";
size_t nchildren = children.size();
if(nchildren == 0) // assume text node
{
// keep text nodes on a single line.
oss << EscapeString(text) << "</" << esc_name << ">" << endl;
}
else
{
oss << endl;
string child_indent = indent + " ";
// if we have a text value, save it out as a "text" child
// since nested & text xml nodes are not supposed to mix
if(text != "")
oss << child_indent << "<text>" << EscapeString(text)
<< "</text>" <<endl;
for(size_t i=0;i<nchildren;i++)
oss << children[i]->ToString(child_indent);
oss << indent << "</" << esc_name << ">" << endl;
}
return oss.str();
}
// ****************************************************************************
// Method: XMLNode::Parse
//
// Purpose:
// Parses an xml string into a node.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
void
XMLNode::Parse(const string &xml_data)
{
if(xml_data == "")
return;
istringstream iss;
iss.str(xml_data);
Parse(iss);
}
// ****************************************************************************
// Method: XMLNode::Parse
//
// Purpose:
// Parses an xml string into a node.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
void
XMLNode::Parse(istream &iss)
{
if(iss.eof())
return;
// eat any white space
iss >> ws;
Eat("<",iss);
name = GrabName(iss);
iss >> ws;
while(!Check(">",iss))
{
string att_name = GrabName(iss);
Eat("=",iss);
Eat("\"",iss);
string att_value = GrabString('\"',iss);
Eat("\"",iss);
iss >> ws;
attributes[att_name] = att_value;
}
Eat(">",iss);
// dont keep white space at beginning of new tag
iss >> ws;
if(!Check("</",iss)) // only continue if node isnt empty
{
if(Check("<",iss)) // get child nodes
{
while(!Check("</",iss))
{
XMLNode *child = new XMLNode(iss);
children.push_back(child);
iss >> ws;
}
}
else // text node
{
text = GrabString('<',iss);
}
}
Eat("</",iss);
GrabName(iss); // check?
Eat(">",iss);
}
// ****************************************************************************
// Method: XMLNode::Check
//
// Purpose:
// Checks if the passed characters exist at the front of the input stream.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
bool
XMLNode::Check(const string&str,istream &iss)
{
// see of first part of the string buffer == the input string
size_t i=0;
size_t str_len = str.size();
stack<unsigned char> buff;
while( !iss.eof() && i < str_len && str[i]==iss.peek())
{
buff.push(iss.get());
i++;
}
while(buff.size()>0)
{
iss.putback(buff.top());
buff.pop();
}
return i == str_len;
}
// ****************************************************************************
// Method: XMLNode::Eat
//
// Purpose:
// Eats passed characters from the input stream.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
void
XMLNode::Eat(const string &str,istream &iss)
{
// eat string from stream
size_t i=0;
size_t str_len = str.size();
while(!iss.eof() && i < str_len && str[i]==iss.peek())
{
iss.get();
i++;
}
}
// ****************************************************************************
// Method: XMLNode::GrabName
//
// Purpose:
// Grabs from input stream until [whitespace]=<> .
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
string
XMLNode::GrabName(istream &iss)
{
string res = "";
unsigned char c = iss.get();
while( !iss.eof() &&
c != ' ' && c != '\t' && c != '\n' &&
c != '=' && c != '<' && c != '>' )
{
res += c;
c = iss.get();
}
if(!iss.eof())
iss.putback(c);
return res;
}
// ****************************************************************************
// Method: XMLNode::GrabString
//
// Purpose:
// Grabs string data until it encounters passed terminating character.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
string
XMLNode::GrabString(unsigned char term,istream &iss)
{
string res = "";
unsigned char c = iss.get();
while( !iss.eof() && c != term)
{
// check for entity values
if(c == '&')
{res += GrabEntityValue(iss);}
else
{res.push_back(c);}
c = iss.get();
}
if(!iss.eof())
iss.putback(c);
return res;
}
// ****************************************************************************
// Method: XMLNode::GrabEntityValue
//
// Purpose:
// Reads in special xml encoded values. Assumes '&' has already been
// removed.
//
// Programmer: Cyrus Harrison
// Creation: December 17, 2007
//
// ****************************************************************************
string
XMLNode::GrabEntityValue(istream &iss)
{
// handles standard xml entities:
// < <
// > >
// & &
// ' '
// $quot; "
string val = "";
unsigned char c = iss.get();
while( !iss.eof() && c != ';')
{
val.push_back(c);
c = iss.get();
}
if(val == "lt")
{return "<";}
else if(val == "gt")
{return ">";}
else if(val == "amp")
{return "&";}
else if(val == "apos")
{return "'";}
else if(val == "quot")
{return "\"";}
else
{return "[<unsupported entity>]";}
}
// ****************************************************************************
// Method: XMLNode::EscapeString
//
// Purpose:
// Removes invalid xml characters and replaces them with proper xml
// entities values.
//
// Programmer: Cyrus Harrison
// Creation: December 17, 2007
//
// Modifications:
// Kathleen Biagas, Mon Jul 18 18:49:26 PDT 2011
// Changed ""e" to """.
//
// ****************************************************************************
string
XMLNode::EscapeString(const string &val)
{
// replace with standard xml entities:
// < <
// > >
// & &
// ' '
// " $quot;
string res="";
size_t ssize = val.size();
for(size_t i=0;i<ssize;i++)
{
if(val[i] == '<')
{res += string("<");}
else if(val[i] == '>')
{res += string(">");}
else if(val[i] == '&')
{res += string("&");}
else if(val[i] == '\'')
{res += string("'");}
else if(val[i] == '"')
{res += string(""");}
else
{res.push_back(val[i]);}
}
return res;
}
// ****************************************************************************
// Method: XMLNode::Init
//
// Purpose:
// Replicates the passed node.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
void
XMLNode::Init(const XMLNode &node)
{
if(children.size() > 0 || attributes.size() >0)
Cleanup();
name = node.name;
text = node.text;
attributes = node.attributes;
int nchildren = node.GetNumChildren();
for(int i=0;i<nchildren;i++)
children.push_back(new XMLNode(*node.children[i]));
}
// ****************************************************************************
// Method: XMLNode::Cleanup
//
// Purpose:
// Clean up child nodes.
//
// Programmer: Cyrus Harrison
// Creation: December 13, 2007
//
// ****************************************************************************
void
XMLNode::Cleanup()
{
int nchildren = GetNumChildren();
for(int i=0;i<nchildren;i++)
delete children[i];
children.clear();
attributes.clear();
}
|
64e26eed4c3345ce793ee4ac8fc6d859c4bc8ef0
|
79d343002bb63a44f8ab0dbac0c9f4ec54078c3a
|
/lib/libc/include/any-macos-any/xlocale.h
|
e89e3596200bf613e51f01839a68db3d6edae445
|
[
"MIT"
] |
permissive
|
ziglang/zig
|
4aa75d8d3bcc9e39bf61d265fd84b7f005623fc5
|
f4c9e19bc3213c2bc7e03d7b06d7129882f39f6c
|
refs/heads/master
| 2023-08-31T13:16:45.980913
| 2023-08-31T05:50:29
| 2023-08-31T05:50:29
| 40,276,274
| 25,560
| 2,399
|
MIT
| 2023-09-14T21:09:50
| 2015-08-06T00:51:28
|
Zig
|
UTF-8
|
C
| false
| false
| 3,086
|
h
|
xlocale.h
|
/*
* Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _XLOCALE_H_
#define _XLOCALE_H_
#include <sys/cdefs.h>
#ifndef _USE_EXTENDED_LOCALES_
#define _USE_EXTENDED_LOCALES_
#endif /* _USE_EXTENDED_LOCALES_ */
#include <_locale.h>
#include <_xlocale.h>
#define LC_ALL_MASK ( LC_COLLATE_MASK \
| LC_CTYPE_MASK \
| LC_MESSAGES_MASK \
| LC_MONETARY_MASK \
| LC_NUMERIC_MASK \
| LC_TIME_MASK )
#define LC_COLLATE_MASK (1 << 0)
#define LC_CTYPE_MASK (1 << 1)
#define LC_MESSAGES_MASK (1 << 2)
#define LC_MONETARY_MASK (1 << 3)
#define LC_NUMERIC_MASK (1 << 4)
#define LC_TIME_MASK (1 << 5)
#define _LC_NUM_MASK 6
#define _LC_LAST_MASK (1 << (_LC_NUM_MASK - 1))
#define LC_GLOBAL_LOCALE ((locale_t)-1)
#define LC_C_LOCALE ((locale_t)NULL)
#ifdef MB_CUR_MAX
#undef MB_CUR_MAX
#define MB_CUR_MAX (___mb_cur_max())
#ifndef MB_CUR_MAX_L
#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
#endif /* !MB_CUR_MAX_L */
#endif /* MB_CUR_MAX */
__BEGIN_DECLS
extern const locale_t _c_locale;
locale_t duplocale(locale_t);
int freelocale(locale_t);
struct lconv * localeconv_l(locale_t);
locale_t newlocale(int, __const char *, locale_t);
__const char * querylocale(int, locale_t);
locale_t uselocale(locale_t);
__END_DECLS
#ifdef _CTYPE_H_
#include <xlocale/_ctype.h>
#endif /* _CTYPE_H_ */
#ifdef __WCTYPE_H_
#include <xlocale/__wctype.h>
#endif /* __WCTYPE_H_ */
#ifdef _INTTYPES_H_
#include <xlocale/_inttypes.h>
#endif /* _INTTYPES_H_ */
#ifdef _LANGINFO_H_
#include <xlocale/_langinfo.h>
#endif /* _LANGINFO_H_ */
#ifdef _MONETARY_H_
#include <xlocale/_monetary.h>
#endif /* _MONETARY_H_ */
#ifdef _REGEX_H_
#include <xlocale/_regex.h>
#endif /* _REGEX_H_ */
#ifdef _STDIO_H_
#include <xlocale/_stdio.h>
#endif /* _STDIO_H_ */
#ifdef _STDLIB_H_
#include <xlocale/_stdlib.h>
#endif /* _STDLIB_H_ */
#ifdef _STRING_H_
#include <xlocale/_string.h>
#endif /*STRING_CTYPE_H_ */
#ifdef _TIME_H_
#include <xlocale/_time.h>
#endif /* _TIME_H_ */
#ifdef _WCHAR_H_
#include <xlocale/_wchar.h>
#endif /*WCHAR_CTYPE_H_ */
#ifdef _WCTYPE_H_
#include <xlocale/_wctype.h>
#endif /* _WCTYPE_H_ */
#endif /* _XLOCALE_H_ */
|
adbc20901b9f3baf53043b6e2874e6224c1085c6
|
2de62f6c56ade20febac37fbb1024168667f25cc
|
/core/rtw_rm_fsm.c
|
3e2dd8a24597bf292ad259231ab4995c899ed44f
|
[] |
no_license
|
clnhub/rtl8192eu-linux
|
1d388f60b4d88bbf3b2511c348172407253b085b
|
e3e43baa068794fb58d0fdd315a65a931b12ba6d
|
refs/heads/5.11.2.1
| 2023-07-20T09:10:51.896669
| 2023-07-15T16:48:16
| 2023-07-15T16:48:16
| 143,839,834
| 417
| 104
| null | 2023-06-12T13:07:04
| 2018-08-07T07:58:29
|
C
|
UTF-8
|
C
| false
| false
| 23,977
|
c
|
rtw_rm_fsm.c
|
/******************************************************************************
*
* Copyright(c) 2007 - 2017 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*****************************************************************************/
#include <drv_types.h>
#include <hal_data.h>
#ifdef CONFIG_RTW_80211K
#include "rtw_rm_fsm.h"
#include "rtw_rm_util.h"
struct fsm_state {
u8 *name;
int(*fsm_func)(struct rm_obj *prm, enum RM_EV_ID evid);
};
static void rm_state_initial(struct rm_obj *prm);
static void rm_state_goto(struct rm_obj *prm, enum RM_STATE rm_state);
static void rm_state_run(struct rm_obj *prm, enum RM_EV_ID evid);
static struct rm_event *rm_dequeue_ev(_queue *queue);
static struct rm_obj *rm_dequeue_rm(_queue *queue);
void rm_timer_callback(void *data)
{
int i;
_adapter *padapter = (_adapter *)data;
struct rm_priv *prmpriv = &padapter->rmpriv;
struct rm_clock *pclock;
/* deal with clock */
for (i=0;i<RM_TIMER_NUM;i++) {
pclock = &prmpriv->clock[i];
if (pclock->prm == NULL
||(ATOMIC_READ(&(pclock->counter)) == 0))
continue;
ATOMIC_DEC(&(pclock->counter));
if (ATOMIC_READ(&(pclock->counter)) == 0)
rm_post_event(pclock->prm->psta->padapter,
pclock->prm->rmid, prmpriv->clock[i].evid);
}
_set_timer(&prmpriv->rm_timer, CLOCK_UNIT);
}
int rtw_init_rm(_adapter *padapter)
{
struct rm_priv *prmpriv = &padapter->rmpriv;
RTW_INFO("RM: %s\n",__func__);
_rtw_init_queue(&(prmpriv->rm_queue));
_rtw_init_queue(&(prmpriv->ev_queue));
/* bit 0-7 */
prmpriv->rm_en_cap_def[0] = 0
| BIT(RM_LINK_MEAS_CAP_EN)
| BIT(RM_NB_REP_CAP_EN)
/*| BIT(RM_PARAL_MEAS_CAP_EN)*/
| BIT(RM_REPEAT_MEAS_CAP_EN)
| BIT(RM_BCN_PASSIVE_MEAS_CAP_EN)
| BIT(RM_BCN_ACTIVE_MEAS_CAP_EN)
| BIT(RM_BCN_TABLE_MEAS_CAP_EN)
/*| BIT(RM_BCN_MEAS_REP_COND_CAP_EN)*/;
/* bit 8-15 */
prmpriv->rm_en_cap_def[1] = 0
/*| BIT(RM_FRAME_MEAS_CAP_EN - 8)*/
#ifdef CONFIG_RTW_ACS
| BIT(RM_CH_LOAD_CAP_EN - 8)
| BIT(RM_NOISE_HISTO_CAP_EN - 8)
#endif
/*| BIT(RM_STATIS_MEAS_CAP_EN - 8)*/
/*| BIT(RM_LCI_MEAS_CAP_EN - 8)*/
/*| BIT(RM_LCI_AMIMUTH_CAP_EN - 8)*/
/*| BIT(RM_TRANS_STREAM_CAT_MEAS_CAP_EN - 8)*/
/*| BIT(RM_TRIG_TRANS_STREAM_CAT_MEAS_CAP_EN - 8)*/;
/* bit 16-23 */
prmpriv->rm_en_cap_def[2] = 0
/*| BIT(RM_AP_CH_REP_CAP_EN - 16)*/
/*| BIT(RM_RM_MIB_CAP_EN - 16)*/
/*| BIT(RM_OP_CH_MAX_MEAS_DUR0 - 16)*/
/*| BIT(RM_OP_CH_MAX_MEAS_DUR1 - 16)*/
/*| BIT(RM_OP_CH_MAX_MEAS_DUR2 - 16)*/
/*| BIT(RM_NONOP_CH_MAX_MEAS_DUR0 - 16)*/
/*| BIT(RM_NONOP_CH_MAX_MEAS_DUR1 - 16)*/
/*| BIT(RM_NONOP_CH_MAX_MEAS_DUR2 - 16)*/;
/* bit 24-31 */
prmpriv->rm_en_cap_def[3] = 0
/*| BIT(RM_MEAS_PILOT_CAP0 - 24)*/
/*| BIT(RM_MEAS_PILOT_CAP1 - 24)*/
/*| BIT(RM_MEAS_PILOT_CAP2 - 24)*/
/*| BIT(RM_MEAS_PILOT_TRANS_INFO_CAP_EN - 24)*/
/*| BIT(RM_NB_REP_TSF_OFFSET_CAP_EN - 24)*/
| BIT(RM_RCPI_MEAS_CAP_EN - 24)
| BIT(RM_RSNI_MEAS_CAP_EN - 24)
/*| BIT(RM_BSS_AVG_ACCESS_DELAY_CAP_EN - 24)*/;
/* bit 32-39 */
prmpriv->rm_en_cap_def[4] = 0
/*| BIT(RM_BSS_AVG_ACCESS_DELAY_CAP_EN - 32)*/
/*| BIT(RM_AVALB_ADMIS_CAPACITY_CAP_EN - 32)*/
/*| BIT(RM_ANT_CAP_EN - 32)*/;
prmpriv->enable = _TRUE;
/* clock timer */
rtw_init_timer(&prmpriv->rm_timer,
padapter, rm_timer_callback, padapter);
_set_timer(&prmpriv->rm_timer, CLOCK_UNIT);
return _SUCCESS;
}
int rtw_deinit_rm(_adapter *padapter)
{
struct rm_priv *prmpriv = &padapter->rmpriv;
struct rm_obj *prm;
struct rm_event *pev;
RTW_INFO("RM: %s\n",__func__);
prmpriv->enable = _FALSE;
_cancel_timer_ex(&prmpriv->rm_timer);
/* free all events and measurements */
while((pev = rm_dequeue_ev(&prmpriv->ev_queue)) != NULL)
rtw_mfree((void *)pev, sizeof(struct rm_event));
while((prm = rm_dequeue_rm(&prmpriv->rm_queue)) != NULL)
rm_state_run(prm, RM_EV_cancel);
_rtw_deinit_queue(&(prmpriv->rm_queue));
_rtw_deinit_queue(&(prmpriv->ev_queue));
return _SUCCESS;
}
int rtw_free_rm_priv(_adapter *padapter)
{
return rtw_deinit_rm(padapter);
}
static int rm_enqueue_ev(_queue *queue, struct rm_event *obj, bool to_head)
{
_irqL irqL;
if (obj == NULL)
return _FAIL;
_enter_critical(&queue->lock, &irqL);
if (to_head)
rtw_list_insert_head(&obj->list, &queue->queue);
else
rtw_list_insert_tail(&obj->list, &queue->queue);
_exit_critical(&queue->lock, &irqL);
return _SUCCESS;
}
static void rm_set_clock(struct rm_obj *prm, u32 ms, enum RM_EV_ID evid)
{
ATOMIC_SET(&(prm->pclock->counter), (ms/CLOCK_UNIT));
prm->pclock->evid = evid;
}
static struct rm_clock *rm_alloc_clock(_adapter *padapter, struct rm_obj *prm)
{
int i;
struct rm_priv *prmpriv = &padapter->rmpriv;
struct rm_clock *pclock = NULL;
for (i=0;i<RM_TIMER_NUM;i++) {
pclock = &prmpriv->clock[i];
if (pclock->prm == NULL) {
pclock->prm = prm;
ATOMIC_SET(&(pclock->counter), 0);
pclock->evid = RM_EV_max;
break;
}
}
return pclock;
}
static void rm_cancel_clock(struct rm_obj *prm)
{
ATOMIC_SET(&(prm->pclock->counter), 0);
prm->pclock->evid = RM_EV_max;
}
static void rm_free_clock(struct rm_clock *pclock)
{
pclock->prm = NULL;
ATOMIC_SET(&(pclock->counter), 0);
pclock->evid = RM_EV_max;
}
static int is_list_linked(const struct list_head *head)
{
return head->prev != NULL;
}
void rm_free_rmobj(struct rm_obj *prm)
{
if (is_list_linked(&prm->list))
rtw_list_delete(&prm->list);
if (prm->q.pssid)
rtw_mfree(prm->q.pssid, strlen(prm->q.pssid)+1);
if (prm->q.opt.bcn.req_start)
rtw_mfree(prm->q.opt.bcn.req_start,
prm->q.opt.bcn.req_len);
if (prm->pclock)
rm_free_clock(prm->pclock);
rtw_mfree((void *)prm, sizeof(struct rm_obj));
}
struct rm_obj *rm_alloc_rmobj(_adapter *padapter)
{
struct rm_obj *prm;
prm = (struct rm_obj *)rtw_malloc(sizeof(struct rm_obj));
if (prm == NULL)
return NULL;
_rtw_memset(prm, 0, sizeof(struct rm_obj));
/* alloc timer */
if ((prm->pclock = rm_alloc_clock(padapter, prm)) == NULL) {
rm_free_rmobj(prm);
return NULL;
}
return prm;
}
int rm_enqueue_rmobj(_adapter *padapter, struct rm_obj *prm, bool to_head)
{
_irqL irqL;
struct rm_priv *prmpriv = &padapter->rmpriv;
_queue *queue = &prmpriv->rm_queue;
if (prm == NULL)
return _FAIL;
_enter_critical(&queue->lock, &irqL);
if (to_head)
rtw_list_insert_head(&prm->list, &queue->queue);
else
rtw_list_insert_tail(&prm->list, &queue->queue);
_exit_critical(&queue->lock, &irqL);
rm_state_initial(prm);
return _SUCCESS;
}
static struct rm_obj *rm_dequeue_rm(_queue *queue)
{
_irqL irqL;
struct rm_obj *prm;
_enter_critical(&queue->lock, &irqL);
if (rtw_is_list_empty(&(queue->queue)))
prm = NULL;
else {
prm = LIST_CONTAINOR(get_next(&(queue->queue)),
struct rm_obj, list);
/* rtw_list_delete(&prm->list); */
}
_exit_critical(&queue->lock, &irqL);
return prm;
}
static struct rm_event *rm_dequeue_ev(_queue *queue)
{
_irqL irqL;
struct rm_event *ev;
_enter_critical(&queue->lock, &irqL);
if (rtw_is_list_empty(&(queue->queue)))
ev = NULL;
else {
ev = LIST_CONTAINOR(get_next(&(queue->queue)),
struct rm_event, list);
rtw_list_delete(&ev->list);
}
_exit_critical(&queue->lock, &irqL);
return ev;
}
static struct rm_obj *_rm_get_rmobj(_queue *queue, u32 rmid)
{
_irqL irqL;
_list *phead, *plist;
struct rm_obj *prm = NULL;
if (rmid == 0)
return NULL;
_enter_critical(&queue->lock, &irqL);
phead = get_list_head(queue);
plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
prm = LIST_CONTAINOR(plist, struct rm_obj, list);
if (rmid == (prm->rmid)) {
_exit_critical(&queue->lock, &irqL);
return prm;
}
plist = get_next(plist);
}
_exit_critical(&queue->lock, &irqL);
return NULL;
}
struct sta_info *rm_get_psta(_adapter *padapter, u32 rmid)
{
struct rm_priv *prmpriv = &padapter->rmpriv;
struct rm_obj *prm;
prm = _rm_get_rmobj(&prmpriv->rm_queue, rmid);
if (prm)
return prm->psta;
return NULL;
}
struct rm_obj *rm_get_rmobj(_adapter *padapter, u32 rmid)
{
struct rm_priv *prmpriv = &padapter->rmpriv;
return _rm_get_rmobj(&prmpriv->rm_queue, rmid);
}
u8 rtw_rm_post_envent_cmd(_adapter *padapter, u32 rmid, u8 evid)
{
struct cmd_obj *pcmd;
struct rm_event *pev;
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS;
pcmd = (struct cmd_obj *)rtw_zmalloc(sizeof(struct cmd_obj));
if (pcmd == NULL) {
res = _FAIL;
goto exit;
}
pev = (struct rm_event*)rtw_zmalloc(sizeof(struct rm_event));
if (pev == NULL) {
rtw_mfree((u8 *) pcmd, sizeof(struct cmd_obj));
res = _FAIL;
goto exit;
}
pev->rmid = rmid;
pev->evid = evid;
init_h2fwcmd_w_parm_no_rsp(pcmd, pev, CMD_RM_POST_EVENT);
res = rtw_enqueue_cmd(pcmdpriv, pcmd);
exit:
return res;
}
int rm_post_event(_adapter *padapter, u32 rmid, enum RM_EV_ID evid)
{
if (padapter->rmpriv.enable == _FALSE)
return _FALSE;
RTW_INFO("RM: post asyn %s to rmid=%x\n", rm_event_name(evid), rmid);
rtw_rm_post_envent_cmd(padapter, rmid, evid);
return _SUCCESS;
}
int _rm_post_event(_adapter *padapter, u32 rmid, enum RM_EV_ID evid)
{
struct rm_priv *prmpriv = &padapter->rmpriv;
struct rm_event *pev;
if (evid >= RM_EV_max || rmid == 0)
return _FALSE;
pev = (struct rm_event *)rtw_malloc(sizeof(struct rm_event));
if (pev == NULL)
return _FALSE;
pev->rmid = rmid;
pev->evid = evid;
RTW_INFO("RM: post sync %s to rmid=%x\n", rm_event_name(evid), rmid);
rm_enqueue_ev(&prmpriv->ev_queue, pev, FALSE);
return _SUCCESS;
}
static void rm_bcast_aid_handler(_adapter *padapter, struct rm_event *pev)
{
_irqL irqL;
_list *phead, *plist;
_queue *queue = &padapter->rmpriv.rm_queue;
struct rm_obj *prm;
_enter_critical(&queue->lock, &irqL);
phead = get_list_head(queue);
plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
prm = LIST_CONTAINOR(plist, struct rm_obj, list);
plist = get_next(plist);
if (RM_GET_AID(pev->rmid) == RM_GET_AID(prm->rmid)) {
_exit_critical(&queue->lock, &irqL);
rm_state_run(prm, pev->evid);
_enter_critical(&queue->lock, &irqL);
}
}
_exit_critical(&queue->lock, &irqL);
return;
}
/* main handler of RM (Resource Management) */
void rm_handler(_adapter *padapter, struct rm_event *pe)
{
int i;
struct rm_priv *prmpriv = &padapter->rmpriv;
struct rm_obj *prm;
struct rm_event *pev;
/* dequeue event */
while((pev = rm_dequeue_ev(&prmpriv->ev_queue)) != NULL)
{
if (RM_IS_ID_FOR_ALL(pev->rmid)) {
/* apply to all aid mateched measurement */
rm_bcast_aid_handler(padapter, pev);
rtw_mfree((void *)pev, sizeof(struct rm_event));
continue;
}
/* retrieve rmobj */
prm = _rm_get_rmobj(&prmpriv->rm_queue, pev->rmid);
if (prm == NULL) {
RTW_ERR("RM: rmid=%x event=%s doesn't find rm obj\n",
pev->rmid, rm_event_name(pev->evid));
rtw_mfree((void *)pev, sizeof(struct rm_event));
return;
}
/* run state machine */
rm_state_run(prm, pev->evid);
rtw_mfree((void *)pev, sizeof(struct rm_event));
}
}
static int rm_issue_meas_req(struct rm_obj *prm)
{
switch (prm->q.action_code) {
case RM_ACT_RADIO_MEAS_REQ:
switch (prm->q.m_type) {
case bcn_req:
case ch_load_req:
case noise_histo_req:
issue_radio_meas_req(prm);
break;
default:
break;
} /* meas_type */
break;
case RM_ACT_NB_REP_REQ:
/* issue neighbor request */
issue_nb_req(prm);
break;
case RM_ACT_LINK_MEAS_REQ:
issue_link_meas_req(prm);
break;
default:
return _FALSE;
} /* action_code */
return _SUCCESS;
}
/*
* RM state machine
*/
static int rm_state_idle(struct rm_obj *prm, enum RM_EV_ID evid)
{
_adapter *padapter = prm->psta->padapter;
u8 val8;
u32 val32;
prm->p.category = RTW_WLAN_CATEGORY_RADIO_MEAS;
switch (evid) {
case RM_EV_state_in:
switch (prm->q.action_code) {
case RM_ACT_RADIO_MEAS_REQ:
/* copy attrib from meas_req to meas_rep */
prm->p.action_code = RM_ACT_RADIO_MEAS_REP;
prm->p.diag_token = prm->q.diag_token;
prm->p.e_id = _MEAS_RSP_IE_;
prm->p.m_token = prm->q.m_token;
prm->p.m_type = prm->q.m_type;
prm->p.rpt = prm->q.rpt;
prm->p.ch_num = prm->q.ch_num;
prm->p.op_class = prm->q.op_class;
if (prm->q.m_type == ch_load_req
|| prm->q.m_type == noise_histo_req) {
/*
* phydm measure current ch periodically
* scan current ch is not necessary
*/
val8 = padapter->mlmeextpriv.cur_channel;
if (prm->q.ch_num == val8)
prm->poll_mode = 1;
}
RTW_INFO("RM: rmid=%x %s switch in repeat=%u\n",
prm->rmid, rm_type_req_name(prm->q.m_type),
prm->q.rpt);
break;
case RM_ACT_NB_REP_REQ:
prm->p.action_code = RM_ACT_NB_REP_RESP;
RTW_INFO("RM: rmid=%x Neighbor request switch in\n",
prm->rmid);
break;
case RM_ACT_LINK_MEAS_REQ:
prm->p.diag_token = prm->q.diag_token;
prm->p.action_code = RM_ACT_LINK_MEAS_REP;
RTW_INFO("RM: rmid=%x Link meas switch in\n",
prm->rmid);
break;
default:
prm->p.action_code = prm->q.action_code;
rm_set_rep_mode(prm, MEAS_REP_MOD_INCAP);
RTW_INFO("RM: rmid=%x recv unknown action %d\n",
prm->rmid,prm->p.action_code);
break;
} /* switch() */
if (prm->rmid & RM_MASTER) {
if (rm_issue_meas_req(prm) == _SUCCESS)
rm_state_goto(prm, RM_ST_WAIT_MEAS);
else
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
} else {
rm_state_goto(prm, RM_ST_DO_MEAS);
return _SUCCESS;
}
if (prm->p.m_mode) {
issue_null_reply(prm);
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
}
if (prm->q.rand_intvl) {
/* get low tsf to generate random interval */
val32 = rtw_read32(padapter, REG_TSFTR);
val32 = val32 % prm->q.rand_intvl;
RTW_INFO("RM: rmid=%x rand_intval=%d, rand=%d\n",
prm->rmid, (int)prm->q.rand_intvl,val32);
rm_set_clock(prm, prm->q.rand_intvl,
RM_EV_delay_timer_expire);
return _SUCCESS;
}
break;
case RM_EV_delay_timer_expire:
rm_state_goto(prm, RM_ST_DO_MEAS);
break;
case RM_EV_cancel:
rm_state_goto(prm, RM_ST_END);
break;
case RM_EV_state_out:
rm_cancel_clock(prm);
break;
default:
break;
}
return _SUCCESS;
}
/* we do the measuring */
static int rm_state_do_meas(struct rm_obj *prm, enum RM_EV_ID evid)
{
_adapter *padapter = prm->psta->padapter;
u8 val8;
u64 val64;
switch (evid) {
case RM_EV_state_in:
if (prm->q.action_code == RM_ACT_RADIO_MEAS_REQ) {
switch (prm->q.m_type) {
case bcn_req:
if (prm->q.m_mode == bcn_req_bcn_table) {
RTW_INFO("RM: rmid=%x Beacon table\n",
prm->rmid);
_rm_post_event(padapter, prm->rmid,
RM_EV_survey_done);
return _SUCCESS;
}
break;
case ch_load_req:
case noise_histo_req:
if (prm->poll_mode)
_rm_post_event(padapter, prm->rmid,
RM_EV_survey_done);
return _SUCCESS;
default:
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
}
if (!ready_for_scan(prm)) {
prm->wait_busy = RM_BUSY_TRAFFIC_TIMES;
RTW_INFO("RM: wait busy traffic - %d\n",
prm->wait_busy);
rm_set_clock(prm, RM_WAIT_BUSY_TIMEOUT,
RM_EV_busy_timer_expire);
return _SUCCESS;
}
} else if (prm->q.action_code == RM_ACT_LINK_MEAS_REQ) {
; /* do nothing */
rm_state_goto(prm, RM_ST_SEND_REPORT);
return _SUCCESS;
}
_rm_post_event(padapter, prm->rmid, RM_EV_start_meas);
break;
case RM_EV_start_meas:
if (prm->q.action_code == RM_ACT_RADIO_MEAS_REQ) {
/* resotre measurement start time */
prm->meas_start_time = rtw_hal_get_tsftr_by_port(padapter
, rtw_hal_get_port(padapter));
switch (prm->q.m_type) {
case bcn_req:
val8 = 1; /* Enable free run counter */
prm->free_run_counter_valid = rtw_hal_set_hwreg(
padapter, HW_VAR_FREECNT, &val8);
rm_sitesurvey(prm);
break;
case ch_load_req:
case noise_histo_req:
rm_sitesurvey(prm);
break;
default:
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
break;
}
}
/* handle measurement timeout */
rm_set_clock(prm, RM_MEAS_TIMEOUT, RM_EV_meas_timer_expire);
break;
case RM_EV_survey_done:
if (prm->q.action_code == RM_ACT_RADIO_MEAS_REQ) {
switch (prm->q.m_type) {
case bcn_req:
rm_cancel_clock(prm);
rm_state_goto(prm, RM_ST_SEND_REPORT);
return _SUCCESS;
case ch_load_req:
case noise_histo_req:
retrieve_radio_meas_result(prm);
if (rm_radio_meas_report_cond(prm) == _SUCCESS)
rm_state_goto(prm, RM_ST_SEND_REPORT);
else
rm_set_clock(prm, RM_COND_INTVL,
RM_EV_retry_timer_expire);
break;
default:
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
}
}
break;
case RM_EV_meas_timer_expire:
RTW_INFO("RM: rmid=%x measurement timeount\n",prm->rmid);
rm_set_rep_mode(prm, MEAS_REP_MOD_REFUSE);
issue_null_reply(prm);
rm_state_goto(prm, RM_ST_END);
break;
case RM_EV_busy_timer_expire:
if (!ready_for_scan(prm) && prm->wait_busy--) {
RTW_INFO("RM: wait busy - %d\n",prm->wait_busy);
rm_set_clock(prm, RM_WAIT_BUSY_TIMEOUT,
RM_EV_busy_timer_expire);
break;
}
else if (prm->wait_busy <= 0) {
RTW_INFO("RM: wait busy timeout\n");
rm_set_rep_mode(prm, MEAS_REP_MOD_REFUSE);
issue_null_reply(prm);
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
}
_rm_post_event(padapter, prm->rmid, RM_EV_start_meas);
break;
case RM_EV_request_timer_expire:
rm_set_rep_mode(prm, MEAS_REP_MOD_REFUSE);
issue_null_reply(prm);
rm_state_goto(prm, RM_ST_END);
break;
case RM_EV_retry_timer_expire:
/* expired due to meas condition mismatch, meas again */
_rm_post_event(padapter, prm->rmid, RM_EV_start_meas);
break;
case RM_EV_cancel:
rm_set_rep_mode(prm, MEAS_REP_MOD_REFUSE);
issue_null_reply(prm);
rm_state_goto(prm, RM_ST_END);
break;
case RM_EV_state_out:
rm_cancel_clock(prm);
/* resotre measurement end time */
prm->meas_end_time = rtw_hal_get_tsftr_by_port(padapter
, rtw_hal_get_port(padapter));
val8 = 0; /* Disable free run counter */
rtw_hal_set_hwreg(padapter, HW_VAR_FREECNT, &val8);
break;
default:
break;
}
return _SUCCESS;
}
static int rm_state_wait_meas(struct rm_obj *prm, enum RM_EV_ID evid)
{
u8 val8;
u64 val64;
switch (evid) {
case RM_EV_state_in:
/* we create meas_req, waiting for peer report */
rm_set_clock(prm, RM_REQ_TIMEOUT,
RM_EV_request_timer_expire);
break;
case RM_EV_recv_rep:
rm_state_goto(prm, RM_ST_RECV_REPORT);
break;
case RM_EV_request_timer_expire:
case RM_EV_cancel:
rm_state_goto(prm, RM_ST_END);
break;
case RM_EV_state_out:
rm_cancel_clock(prm);
break;
default:
break;
}
return _SUCCESS;
}
static int rm_state_send_report(struct rm_obj *prm, enum RM_EV_ID evid)
{
u8 val8;
switch (evid) {
case RM_EV_state_in:
/* we have to issue report */
if (prm->q.action_code == RM_ACT_RADIO_MEAS_REQ) {
switch (prm->q.m_type) {
case bcn_req:
issue_beacon_rep(prm);
break;
case ch_load_req:
case noise_histo_req:
issue_radio_meas_rep(prm);
break;
default:
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
}
} else if (prm->q.action_code == RM_ACT_LINK_MEAS_REQ) {
issue_link_meas_rep(prm);
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
} else {
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
}
/* check repeat */
if (prm->p.rpt) {
RTW_INFO("RM: rmid=%x repeat=%u/%u\n",
prm->rmid, prm->p.rpt,
prm->q.rpt);
prm->p.rpt--;
/*
* we recv meas_req,
* delay for a wihile and than meas again
*/
if (prm->poll_mode)
rm_set_clock(prm, RM_REPT_POLL_INTVL,
RM_EV_repeat_delay_expire);
else
rm_set_clock(prm, RM_REPT_SCAN_INTVL,
RM_EV_repeat_delay_expire);
return _SUCCESS;
}
/* we are done */
rm_state_goto(prm, RM_ST_END);
break;
case RM_EV_repeat_delay_expire:
rm_state_goto(prm, RM_ST_DO_MEAS);
break;
case RM_EV_cancel:
rm_state_goto(prm, RM_ST_END);
break;
case RM_EV_state_out:
rm_cancel_clock(prm);
break;
default:
break;
}
return _SUCCESS;
}
static int rm_state_recv_report(struct rm_obj *prm, enum RM_EV_ID evid)
{
u8 val8;
switch (evid) {
case RM_EV_state_in:
/* we issue meas_req, got peer's meas report */
switch (prm->p.action_code) {
case RM_ACT_RADIO_MEAS_REP:
/* check refuse, incapable and repeat */
val8 = prm->p.m_mode;
if (val8) {
RTW_INFO("RM: rmid=%x peer reject (%s repeat=%d)\n",
prm->rmid,
val8|MEAS_REP_MOD_INCAP?"INCAP":
val8|MEAS_REP_MOD_REFUSE?"REFUSE":
val8|MEAS_REP_MOD_LATE?"LATE":"",
prm->p.rpt);
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
}
break;
case RM_ACT_NB_REP_RESP:
/* report to upper layer if needing */
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
default:
rm_state_goto(prm, RM_ST_END);
return _SUCCESS;
}
/* check repeat */
if (prm->p.rpt) {
RTW_INFO("RM: rmid=%x repeat=%u/%u\n",
prm->rmid, prm->p.rpt,
prm->q.rpt);
prm->p.rpt--;
/* waitting more report */
rm_state_goto(prm, RM_ST_WAIT_MEAS);
break;
}
/* we are done */
rm_state_goto(prm, RM_ST_END);
break;
case RM_EV_cancel:
rm_state_goto(prm, RM_ST_END);
break;
case RM_EV_state_out:
rm_cancel_clock(prm);
break;
default:
break;
}
return _SUCCESS;
}
static int rm_state_end(struct rm_obj *prm, enum RM_EV_ID evid)
{
switch (evid) {
case RM_EV_state_in:
_rm_post_event(prm->psta->padapter, prm->rmid, RM_EV_state_out);
break;
case RM_EV_cancel:
case RM_EV_state_out:
default:
rm_free_rmobj(prm);
break;
}
return _SUCCESS;
}
struct fsm_state rm_fsm[] = {
{"RM_ST_IDLE", rm_state_idle},
{"RM_ST_DO_MEAS", rm_state_do_meas},
{"RM_ST_WAIT_MEAS", rm_state_wait_meas},
{"RM_ST_SEND_REPORT", rm_state_send_report},
{"RM_ST_RECV_REPORT", rm_state_recv_report},
{"RM_ST_END", rm_state_end}
};
char *rm_state_name(enum RM_STATE state)
{
return rm_fsm[state].name;
}
char *rm_event_name(enum RM_EV_ID evid)
{
switch(evid) {
case RM_EV_state_in:
return "RM_EV_state_in";
case RM_EV_busy_timer_expire:
return "RM_EV_busy_timer_expire";
case RM_EV_delay_timer_expire:
return "RM_EV_delay_timer_expire";
case RM_EV_meas_timer_expire:
return "RM_EV_meas_timer_expire";
case RM_EV_repeat_delay_expire:
return "RM_EV_repeat_delay_expire";
case RM_EV_retry_timer_expire:
return "RM_EV_retry_timer_expire";
case RM_EV_request_timer_expire:
return "RM_EV_request_timer_expire";
case RM_EV_wait_report:
return "RM_EV_wait_report";
case RM_EV_start_meas:
return "RM_EV_start_meas";
case RM_EV_survey_done:
return "RM_EV_survey_done";
case RM_EV_recv_rep:
return "RM_EV_recv_report";
case RM_EV_cancel:
return "RM_EV_cancel";
case RM_EV_state_out:
return "RM_EV_state_out";
case RM_EV_max:
return "RM_EV_max";
default:
return "RM_EV_unknown";
}
return "UNKNOWN";
}
static void rm_state_initial(struct rm_obj *prm)
{
prm->state = RM_ST_IDLE;
RTW_INFO("\n");
RTW_INFO("RM: rmid=%x %-18s -> %s\n",prm->rmid,
"new measurement", rm_fsm[prm->state].name);
rm_post_event(prm->psta->padapter, prm->rmid, RM_EV_state_in);
}
static void rm_state_run(struct rm_obj *prm, enum RM_EV_ID evid)
{
RTW_INFO("RM: rmid=%x %-18s %s\n",prm->rmid,
rm_fsm[prm->state].name,rm_event_name(evid));
rm_fsm[prm->state].fsm_func(prm, evid);
}
static void rm_state_goto(struct rm_obj *prm, enum RM_STATE rm_state)
{
if (prm->state == rm_state)
return;
rm_state_run(prm, RM_EV_state_out);
RTW_INFO("\n");
RTW_INFO("RM: rmid=%x %-18s -> %s\n",prm->rmid,
rm_fsm[prm->state].name, rm_fsm[rm_state].name);
prm->state = rm_state;
rm_state_run(prm, RM_EV_state_in);
}
#endif /* CONFIG_RTW_80211K */
|
17f2602052c2b72de5c2ee516b28d843a300c435
|
7f6c235b0598353549959c18f69eefd20b766907
|
/include/residos/package.h
|
f06a161cf1a0c53951460cbf3d87fd77ac5d9091
|
[
"ClArtistic"
] |
permissive
|
z88dk/z88dk
|
46dfd4905f36d99333173cadd0a660839befc9f0
|
8b07f37cc43c5d9ffe69b563c80763491d8faff7
|
refs/heads/master
| 2023-09-04T19:29:49.254958
| 2023-09-03T20:51:24
| 2023-09-03T20:51:24
| 54,035,569
| 820
| 263
|
NOASSERTION
| 2023-09-05T11:09:04
| 2016-03-16T13:48:16
|
Assembly
|
UTF-8
|
C
| false
| false
| 4,430
|
h
|
package.h
|
/*
* Header for defining Residos Packages
*
* $Id: package.h,v 1.2 2010-03-12 15:21:13 stefano Exp $
*/
#ifndef __RESIDOS_PACKAGE_H__
#define __RESIDOS_PACKAGE_H__
#ifdef MAKE_PACKAGE
#define PACKAGE_ADD(m) static void *package_## m= m
#define PACKAGE_END static char package_call_end = 0xff
#asm
INCLUDE "zxsysvar48.def"
; INSTALL has no entry parameters, and may corrupt any registers.
; Most packages simply return Fc=1 to indicate success. However, if your
; package needs extra resources (such as additional RAM banks) it may try
; to allocate them here. If it fails, after tidying up it should return
; Fc=0 and A=error code (such as A=brc_resi_noroom).
.Cpackage_install
#if PACKAGE_INSTALL_FUNC
jp PACKAGE_INSTALL_FUNC
#else
scf ; package always succeeds
ret
#endif
; BYE has no entry parameters, and may corrupt any registers.
; It should return Fc=1 to indicate it can safely be uninstalled.
; If some internal resources are in use by external programs, it should
; return Fc=0 and A=rc_resi_package_in_use.
.Cpackage_bye
#if PACKAGE_BYE_FUNC
jp PACKAGE_INSTALL_FUNC
#else
scf ; package always succeeds
ret
#endif
; INFO takes a reason code in A and returns package information appropriate,
; together with Fc=1 to indicate success.
; Unknown/unsupported reasons must return Fc=0 and A=rc_resi_unknown_reason.
; Reasons supported by this test package are:
; info_version - return version number in BC (binary-coded decimal)
; info_error - store text for error B in the printer buffer (terminate
; with bit 7 set)
.Cpackage_info
cp info_version
jr z,package_getversion
#ifdef PACKAGE_ERROR_FUNCTION
cp info_error
jr nz,package_badreason
ld l,b ; error code is in B
ld h,0
push hl
call PACKAGE_ERROR_FUNC
pop bc ; c = error code
ld a,h
or l
jr z, package_badreason
ld de,PR_BUFF-1 ; copy the error text to the printer buffer
ex de,hl
.package_error
ld a,(de)
and a
jr nz,package_error1
set 7,(hl) ; Last character should toggle bit 7
ld a,c ; package code
and a ; Fc=0, Fz=0
ret
.package_error1
inc hl
inc de
ld (hl),a
jr package_error
#endif
.package_badreason
ld a,rc_resi_unknown_reason ; other reasons unknown
and a
ret
.package_getversion
ld bc,PACKAGE_VERSION ; version number
scf ; success!
ret
; EXP takes a reason code in A and performs appropriate actions.
; Unknown/unsupported reasons must return Fc=0 and A=rc_resi_unknown_reason.
.Cpackage_exp
ld a,rc_resi_unknown_reason
and a ; no reasons are handled
ret
; The HOOK, CHANNELS, FS and NMI calls are used only for packages
; which register themselves with the appropriate capabilities.
; Packages not providing one or more of these calls should
; simply return Fc=0 and A=rc_resi_package_not_found.
; HOOK enters with H corrupted, L=hook code value. All other registers
; are as they were when the hook code was invoked, and so can be used
; as input parameters. All standard registers (including HL) and IX
; can be used as output parameters.
; It is probably good practice to use the convention of returning
; Fc=1 for success, or Fc=0 and A=error code. This is not required, though.
; None of them are implemented at the moment
.Cpackage_hook
.Cpackage_channels
.Cpackage_fs
.Cpackage_nmi
ld a,rc_resi_package_not_found
and a
ret
.package_call_table
defw Cpackage_install
defw Cpackage_bye
defw Cpackage_info
defw Cpackage_exp
defw Cpackage_hook
defw Cpackage_channels
defw Cpackage_fs
defw Cpackage_nmi
; User code should use PACKAGE_ADD straight after this and end with PACKAGE_END
#endasm
#endif /* MAKE_PACKAGE */
#endif /* __RESIDOS_PACKAGE_H__ */
|
256032f657455756eaf4f6991aa07ff04922aa5a
|
5ab69c8644a936a3d9dec1669a86c7369c911bf8
|
/arch/cpu/cc2538/dev/aes.c
|
7f40d8e1e43d7c1eb451426de7bd11a0c6839346
|
[
"BSD-3-Clause"
] |
permissive
|
contiki-ng/contiki-ng
|
393d36f68b98f5ee3544ea32502cf662ffb2fe9f
|
31fcaadf7a0dc8ceea07f438cd69db73174879e6
|
refs/heads/develop
| 2023-09-01T20:10:30.000765
| 2023-09-01T14:37:12
| 2023-09-01T14:37:12
| 91,191,972
| 1,242
| 788
|
BSD-3-Clause
| 2023-09-14T19:08:35
| 2017-05-13T17:37:59
|
C
|
UTF-8
|
C
| false
| false
| 11,662
|
c
|
aes.c
|
/*
* Original file:
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
* All rights reserved.
*
* Port to Contiki:
* Copyright (c) 2013, ADVANSEE - http://www.advansee.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* \addtogroup cc2538-aes
* @{
*
* \file
* Implementation of the cc2538 AES driver
*/
#include "contiki.h"
#include "dev/rom-util.h"
#include "dev/nvic.h"
#include "dev/aes.h"
#include "reg.h"
#include <stdbool.h>
#include <stdint.h>
/*---------------------------------------------------------------------------*/
uint8_t
aes_load_keys(const void *keys, uint8_t key_size, uint8_t count,
uint8_t start_area)
{
uint32_t aes_key_store_size;
uint32_t areas;
uint64_t aligned_keys[AES_KEY_AREAS * 128 / 8 / sizeof(uint64_t)];
int i;
if(REG(AES_CTRL_ALG_SEL) != 0x00000000) {
return CRYPTO_RESOURCE_IN_USE;
}
/* 192-bit keys must be padded to 256 bits */
if(key_size == AES_KEY_STORE_SIZE_KEY_SIZE_192) {
for(i = 0; i < count; i++) {
rom_util_memcpy(&aligned_keys[i << 2], &((const uint64_t *)keys)[i * 3],
192 / 8);
aligned_keys[(i << 2) + 3] = 0;
}
}
/* Change count to the number of 128-bit key areas */
if(key_size != AES_KEY_STORE_SIZE_KEY_SIZE_128) {
count <<= 1;
}
/* The keys base address needs to be 4-byte aligned */
if(key_size != AES_KEY_STORE_SIZE_KEY_SIZE_192) {
rom_util_memcpy(aligned_keys, keys, count << 4);
}
/* Workaround for AES registers not retained after PM2 */
REG(AES_CTRL_INT_CFG) = AES_CTRL_INT_CFG_LEVEL;
REG(AES_CTRL_INT_EN) = AES_CTRL_INT_EN_DMA_IN_DONE |
AES_CTRL_INT_EN_RESULT_AV;
/* Configure master control module */
REG(AES_CTRL_ALG_SEL) = AES_CTRL_ALG_SEL_KEYSTORE;
/* Clear any outstanding events */
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_DMA_IN_DONE |
AES_CTRL_INT_CLR_RESULT_AV;
/* Configure key store module (areas, size)
* Note that writing AES_KEY_STORE_SIZE deletes all stored keys */
aes_key_store_size = REG(AES_KEY_STORE_SIZE);
if((aes_key_store_size & AES_KEY_STORE_SIZE_KEY_SIZE_M) != key_size) {
REG(AES_KEY_STORE_SIZE) = (aes_key_store_size &
~AES_KEY_STORE_SIZE_KEY_SIZE_M) | key_size;
}
/* Free possibly already occupied key areas */
areas = ((0x00000001 << count) - 1) << start_area;
REG(AES_KEY_STORE_WRITTEN_AREA) = areas;
/* Enable key areas to write */
REG(AES_KEY_STORE_WRITE_AREA) = areas;
/* Configure DMAC
* Enable DMA channel 0 */
REG(AES_DMAC_CH0_CTRL) = AES_DMAC_CH_CTRL_EN;
/* Base address of the keys in ext. memory */
REG(AES_DMAC_CH0_EXTADDR) = (uint32_t)aligned_keys;
/* Total keys length in bytes (e.g. 16 for 1 x 128-bit key) */
REG(AES_DMAC_CH0_DMALENGTH) = (REG(AES_DMAC_CH0_DMALENGTH) &
~AES_DMAC_CH_DMALENGTH_DMALEN_M) |
(count << (4 + AES_DMAC_CH_DMALENGTH_DMALEN_S));
/* Wait for operation to complete */
while(!(REG(AES_CTRL_INT_STAT) & AES_CTRL_INT_STAT_RESULT_AV));
/* Clean up the keys */
REG(AES_DMAC_CH0_EXTADDR) = 0x00000000;
/* Check for absence of errors in DMA and key store */
if(REG(AES_CTRL_INT_STAT) & AES_CTRL_INT_STAT_DMA_BUS_ERR) {
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_DMA_BUS_ERR;
/* Disable master control / DMA clock */
REG(AES_CTRL_ALG_SEL) = 0x00000000;
return CRYPTO_DMA_BUS_ERROR;
}
if(REG(AES_CTRL_INT_STAT) & AES_CTRL_INT_STAT_KEY_ST_WR_ERR) {
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_KEY_ST_WR_ERR;
/* Disable master control / DMA clock */
REG(AES_CTRL_ALG_SEL) = 0x00000000;
return AES_KEYSTORE_WRITE_ERROR;
}
/* Acknowledge the interrupt */
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_DMA_IN_DONE |
AES_CTRL_INT_CLR_RESULT_AV;
/* Disable master control / DMA clock */
REG(AES_CTRL_ALG_SEL) = 0x00000000;
/* Check status, if error return error code */
if((REG(AES_KEY_STORE_WRITTEN_AREA) & areas) != areas) {
return AES_KEYSTORE_WRITE_ERROR;
}
return CRYPTO_SUCCESS;
}
/*---------------------------------------------------------------------------*/
uint8_t
aes_auth_crypt_start(uint32_t ctrl, uint8_t key_area, const void *iv,
const void *adata, uint16_t adata_len,
const void *data_in, void *data_out, uint16_t data_len,
struct process *process)
{
if(REG(AES_CTRL_ALG_SEL) != 0x00000000) {
return CRYPTO_RESOURCE_IN_USE;
}
/* Workaround for AES registers not retained after PM2 */
REG(AES_CTRL_INT_CFG) = AES_CTRL_INT_CFG_LEVEL;
REG(AES_CTRL_INT_EN) = AES_CTRL_INT_EN_DMA_IN_DONE |
AES_CTRL_INT_EN_RESULT_AV;
REG(AES_CTRL_ALG_SEL) = AES_CTRL_ALG_SEL_AES;
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_DMA_IN_DONE |
AES_CTRL_INT_CLR_RESULT_AV;
REG(AES_KEY_STORE_READ_AREA) = key_area;
/* Wait until key is loaded to the AES module */
while(REG(AES_KEY_STORE_READ_AREA) & AES_KEY_STORE_READ_AREA_BUSY);
/* Check for Key Store read error */
if(REG(AES_CTRL_INT_STAT) & AES_CTRL_INT_STAT_KEY_ST_RD_ERR) {
/* Clear the Keystore Read error bit */
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_KEY_ST_RD_ERR;
/* Disable the master control / DMA clock */
REG(AES_CTRL_ALG_SEL) = 0x00000000;
return AES_KEYSTORE_READ_ERROR;
}
if(iv != NULL) {
/* Write initialization vector */
REG(AES_AES_IV_0) = ((const uint32_t *)iv)[0];
REG(AES_AES_IV_1) = ((const uint32_t *)iv)[1];
REG(AES_AES_IV_2) = ((const uint32_t *)iv)[2];
REG(AES_AES_IV_3) = ((const uint32_t *)iv)[3];
}
/* Program AES authentication/crypto operation */
REG(AES_AES_CTRL) = ctrl;
/* Write the length of the payload block (lo) */
REG(AES_AES_C_LENGTH_0) = data_len;
/* Write the length of the payload block (hi) */
REG(AES_AES_C_LENGTH_1) = 0;
/* For combined modes only (CCM or GCM) */
if(ctrl & (AES_AES_CTRL_CCM | AES_AES_CTRL_GCM)) {
/* Write the length of the AAD data block (may be non-block size-aligned) */
REG(AES_AES_AUTH_LENGTH) = adata_len;
if(adata_len != 0) {
/* Configure DMAC to fetch the AAD data
* Enable DMA channel 0 */
REG(AES_DMAC_CH0_CTRL) = AES_DMAC_CH_CTRL_EN;
/* Base address of the AAD data buffer */
REG(AES_DMAC_CH0_EXTADDR) = (uint32_t)adata;
/* AAD data length in bytes */
REG(AES_DMAC_CH0_DMALENGTH) = adata_len;
/* Wait for completion of the AAD data transfer, DMA_IN_DONE */
while(!(REG(AES_CTRL_INT_STAT) & AES_CTRL_INT_STAT_DMA_IN_DONE));
/* Check for the absence of error */
if(REG(AES_CTRL_INT_STAT) & AES_CTRL_INT_STAT_DMA_BUS_ERR) {
/* Clear the DMA error */
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_DMA_BUS_ERR;
/* Disable the master control / DMA clock */
REG(AES_CTRL_ALG_SEL) = 0x00000000;
return CRYPTO_DMA_BUS_ERROR;
}
/* Clear interrupt status */
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_DMA_IN_DONE;
}
}
/* Enable result available bit in interrupt enable */
REG(AES_CTRL_INT_EN) = AES_CTRL_INT_EN_RESULT_AV;
if(process != NULL) {
crypto_register_process_notification(process);
NVIC_ClearPendingIRQ(AES_IRQn);
NVIC_EnableIRQ(AES_IRQn);
}
if(data_len != 0) {
/* Configure DMAC
* Enable DMA channel 0 */
REG(AES_DMAC_CH0_CTRL) = AES_DMAC_CH_CTRL_EN;
/* Base address of the input payload data buffer */
REG(AES_DMAC_CH0_EXTADDR) = (uint32_t)data_in;
/* Input payload data length in bytes */
REG(AES_DMAC_CH0_DMALENGTH) = data_len;
if(data_out != NULL) {
/* Enable DMA channel 1 */
REG(AES_DMAC_CH1_CTRL) = AES_DMAC_CH_CTRL_EN;
/* Base address of the output payload data buffer */
REG(AES_DMAC_CH1_EXTADDR) = (uint32_t)data_out;
/* Output payload data length in bytes */
REG(AES_DMAC_CH1_DMALENGTH) = data_len;
}
}
return CRYPTO_SUCCESS;
}
/*---------------------------------------------------------------------------*/
uint8_t
aes_auth_crypt_check_status(void)
{
return !!(REG(AES_CTRL_INT_STAT) &
(AES_CTRL_INT_STAT_DMA_BUS_ERR | AES_CTRL_INT_STAT_KEY_ST_WR_ERR |
AES_CTRL_INT_STAT_KEY_ST_RD_ERR | AES_CTRL_INT_STAT_RESULT_AV));
}
/*---------------------------------------------------------------------------*/
uint8_t
aes_auth_crypt_get_result(void *iv, void *tag)
{
uint32_t aes_ctrl_int_stat;
aes_ctrl_int_stat = REG(AES_CTRL_INT_STAT);
/* Clear the error bits */
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_DMA_BUS_ERR |
AES_CTRL_INT_CLR_KEY_ST_WR_ERR |
AES_CTRL_INT_CLR_KEY_ST_RD_ERR;
NVIC_DisableIRQ(AES_IRQn);
crypto_register_process_notification(NULL);
/* Disable the master control / DMA clock */
REG(AES_CTRL_ALG_SEL) = 0x00000000;
if(aes_ctrl_int_stat & AES_CTRL_INT_STAT_DMA_BUS_ERR) {
return CRYPTO_DMA_BUS_ERROR;
}
if(aes_ctrl_int_stat & AES_CTRL_INT_STAT_KEY_ST_WR_ERR) {
return AES_KEYSTORE_WRITE_ERROR;
}
if(aes_ctrl_int_stat & AES_CTRL_INT_STAT_KEY_ST_RD_ERR) {
return AES_KEYSTORE_READ_ERROR;
}
if(iv != NULL || tag != NULL) {
/* Read result
* Wait for the context ready bit */
while(!(REG(AES_AES_CTRL) & AES_AES_CTRL_SAVED_CONTEXT_READY));
if(iv != NULL) {
/* Read the initialization vector registers */
((uint32_t *)iv)[0] = REG(AES_AES_IV_0);
((uint32_t *)iv)[1] = REG(AES_AES_IV_1);
((uint32_t *)iv)[2] = REG(AES_AES_IV_2);
((uint32_t *)iv)[3] = REG(AES_AES_IV_3);
}
if(tag != NULL) {
/* Read the tag registers */
((uint32_t *)tag)[0] = REG(AES_AES_TAG_OUT_0);
((uint32_t *)tag)[1] = REG(AES_AES_TAG_OUT_1);
((uint32_t *)tag)[2] = REG(AES_AES_TAG_OUT_2);
((uint32_t *)tag)[3] = REG(AES_AES_TAG_OUT_3);
}
}
/* Clear the interrupt status */
REG(AES_CTRL_INT_CLR) = AES_CTRL_INT_CLR_DMA_IN_DONE |
AES_CTRL_INT_CLR_RESULT_AV;
return CRYPTO_SUCCESS;
}
/** @} */
|
d3924c6c1ae7c63add1017f5d70b514d5b6bb1ca
|
59864cbd213b5da6f50d6255b0a021564b3d5bd4
|
/challenges/Lazybox/src/shell.c
|
c38c5299f9a851d38d3fb386675466f3da840d9b
|
[
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-unknown",
"BSD-2-Clause"
] |
permissive
|
trailofbits/cb-multios
|
8af96a4fbc3b34644367faa135347f88e0e0d0a3
|
810d7b24b1f62f56ef49b148fe155b0d0629cad2
|
refs/heads/master
| 2023-09-05T03:56:20.229403
| 2022-12-27T15:47:54
| 2022-12-27T15:47:54
| 41,688,943
| 522
| 133
|
MIT
| 2023-06-29T02:47:13
| 2015-08-31T17:04:31
|
C
|
UTF-8
|
C
| false
| false
| 7,132
|
c
|
shell.c
|
/*
Author: Joe Rogers <joe@cromulence.com>
Copyright (c) 2015 Cromulence LLC
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.
*/
#include "libcgc.h"
#include "cgc_stdlib.h"
#include "cgc_stdio.h"
#include "cgc_string.h"
#include "cgc_stdint.h"
#include "cgc_shell.h"
#include "cgc_fs.h"
#include "cgc_screen.h"
// global shell environment
environment cgc_ENV;
void cgc_PrintPrompt(void) {
cgc_printf("$s@CB> ", cgc_ENV.User);
}
int32_t cgc_ParseCli(char *buf, Command *pCmd) {
char *tok;
uint8_t FoundQuote = 0;
if (!buf || !pCmd) {
return(0);
}
pCmd->argc = 0;
while ((tok = cgc_strtok(buf, " ")) && pCmd->argc <= MAX_ARGS) {
buf = NULL;
if (FoundQuote) {
if (tok[cgc_strlen(tok)-1] == '"') {
// found the close quote at the end of tok
// copy this token onto the argv and move on
tok[cgc_strlen(tok)-1] = '\0';
if (cgc_strlen(pCmd->argv[pCmd->argc]) + cgc_strlen(tok) + 1 > MAX_ARGLEN) {
// parse error
return(1);
}
cgc_strcat(pCmd->argv[pCmd->argc], " ");
cgc_strcat(pCmd->argv[pCmd->argc++], tok);
FoundQuote = 0;
continue;
}
if (tok[0] == '"' && tok[1] == '\0') {
// quote is the only thing in tok, so done with this argv
pCmd->argc++;
FoundQuote = 0;
continue;
}
if (cgc_strchr(tok, '"') == NULL) {
// add this tok to the argv
if (cgc_strlen(pCmd->argv[pCmd->argc]) + cgc_strlen(tok) + 1 > MAX_ARGLEN) {
// parse error
return(1);
}
cgc_strcat(pCmd->argv[pCmd->argc], " ");
cgc_strcat(pCmd->argv[pCmd->argc], tok);
continue;
} else {
// found the close quote in the middle of the tok
// parse error
return(1);
}
}
if (tok[0] == '\"') {
// found an open quote
if (tok[cgc_strlen(tok)-1] == '"') {
// found the end quote
tok[cgc_strlen(tok)-1] = '\0';
// copy everything between the quotes into the argv
cgc_strncpy(pCmd->argv[pCmd->argc++], tok+1, MAX_ARGLEN);
} else {
// this token doesn't end with a quote, so check that there are no mid-token quotes
if (cgc_strchr(tok+1, '"') != NULL) {
// parse error
return(1);
}
// make note that we're in a quoted argument
FoundQuote = 1;
// but copy what we have into the first part of the argv
cgc_strncpy(pCmd->argv[pCmd->argc], tok+1, MAX_ARGLEN);
}
continue;
}
// no quotes, just copy to an argv
cgc_strncpy(pCmd->argv[pCmd->argc++], tok, MAX_ARGLEN);
}
return(2);
}
int32_t cgc_HandleListFiles(Command *pCmd) {
if (!pCmd) {
return(0);
}
if (pCmd->argc != 1) {
cgc_puts("Invalid arguments");
return(0);
}
cgc_ListFiles();
return(1);
}
int32_t cgc_HandleExit(Command *pCmd) {
if (!pCmd) {
return(0);
}
if (pCmd->argc != 1) {
cgc_puts("Invalid arguments");
return(0);
}
cgc_puts("logout");
cgc__terminate(0);
}
int32_t cgc_HandleHelp(Command *pCmd) {
if (!pCmd) {
return(0);
}
if (pCmd->argc == 1) {
cgc_puts("Available commands:");
cgc_puts("chuser");
cgc_puts("chpw");
cgc_puts("exit");
cgc_puts("id");
cgc_puts("help");
cgc_puts("?");
cgc_puts("newuser");
cgc_puts("deluser");
cgc_puts("dump");
cgc_puts("print");
} else if (pCmd->argc == 2) {
if (!cgc_strcmp(pCmd->argv[1], "chuser")) {
cgc_puts("Usage: chuser <username>");
} else if (!cgc_strcmp(pCmd->argv[1], "passwd")) {
if (!cgc_strcmp(cgc_ENV.User, "root")) {
cgc_puts("Usage: passwd <username>");
} else {
cgc_puts("Usage: passwd");
}
} else if (!cgc_strcmp(pCmd->argv[1], "exit")) {
cgc_puts("Usage: exit");
} else if (!cgc_strcmp(pCmd->argv[1], "id")) {
cgc_puts("Usage: id");
} else if (!cgc_strcmp(pCmd->argv[1], "help")) {
cgc_puts("Usage: help <command>");
} else if (!cgc_strcmp(pCmd->argv[1], "?")) {
cgc_puts("Usage: ? <command>");
} else if (!cgc_strcmp(pCmd->argv[1], "newuser")) {
cgc_puts("Usage: newuser <username> <group>");
} else if (!cgc_strcmp(pCmd->argv[1], "deluser")) {
cgc_puts("Usage: deluser <username>");
} else if (!cgc_strcmp(pCmd->argv[1], "cat")) {
cgc_puts("Usage: dump <filename>");
} else if (!cgc_strcmp(pCmd->argv[1], "echo")) {
cgc_puts("Usage: print <text> [> file]");
} else {
cgc_printf("Unknown command: $s\n", pCmd->argv[1]);
}
}
return(1);
}
uint8_t cgc_HandleDump(Command *pCmd) {
FILE *stream;
if (!pCmd) {
return(0);
}
if (pCmd->argc != 2) {
cgc_puts("Input error");
cgc_puts("Usage: dump <filename>");
return(0);
}
return(cgc_Dump(pCmd->argv[1]));
}
uint8_t cgc_HandlePrint(Command *pCmd) {
FILE *stream;
char *RedirectFile = NULL;
uint32_t i;
if (!pCmd) {
return(0);
}
if (pCmd->argc < 2) {
cgc_puts("Input error");
cgc_puts("Usage: print \"<text>\" [> file]");
return(0);
}
// run through the args to see if we have a file redirect
for (i = 2; i < pCmd->argc; i++) {
if (pCmd->argv[i][0] == '>' && pCmd->argv[i][1] == '\0') {
// found a file redirect...and there should only be one more arg
if (i+1 != pCmd->argc-1) {
cgc_puts("Input error");
cgc_puts("Usage: print \"<text>\" [> file]");
return(0);
}
RedirectFile = pCmd->argv[i+1];
break;
}
}
if (RedirectFile) {
if ((stream = cgc_fopen(RedirectFile, "w", 0)) == NULL) {
cgc_printf("Unable to open file '$s'\n\r", RedirectFile);
return(0);
}
if (cgc_fwrite(pCmd->argv[1], cgc_strlen(pCmd->argv[1]), 1, stream) != cgc_strlen(pCmd->argv[1])) {
cgc_fclose(stream);
return(0);
}
cgc_fclose(stream);
} else {
// output to cgc_stdout
cgc_printf("$s", pCmd->argv[1]);
for (i = 2; i < pCmd->argc; i++) {
cgc_printf(" $s", pCmd->argv[i]);
}
cgc_puts("");
}
return(1);
}
void cgc_PrependCommandHistory(char *buf) {
uint8_t i;
cgc_ENV.NumCommandHistory = 0;
#ifdef PATCHED_2
for (i = MAX_CMD_HISTORY-1; i > 0; i--) {
#else
for (i = MAX_CMD_HISTORY; i > 0; i--) {
#endif
if (cgc_ENV.CommandHistory[i-1][0] != '\0') {
cgc_strcpy(cgc_ENV.CommandHistory[i], cgc_ENV.CommandHistory[i-1]);
if (cgc_ENV.NumCommandHistory == 0) {
cgc_ENV.NumCommandHistory = i;
}
}
}
cgc_strcpy(cgc_ENV.CommandHistory[0], buf);
cgc_ENV.NumCommandHistory++;
}
|
68e4e57def280588053f11b08377a21f6ff85945
|
0744dcc5394cebf57ebcba343747af6871b67017
|
/os/arch/xtensa/src/esp32/esp32_ledc.h
|
984badcf860c10c4186c48df00e38fde52f60471
|
[
"GPL-1.0-or-later",
"BSD-3-Clause",
"ISC",
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive",
"Apache-2.0"
] |
permissive
|
Samsung/TizenRT
|
96abf62f1853f61fcf91ff14671a5e0c6ca48fdb
|
1a5c2e00a4b1bbf4c505bbf5cc6a8259e926f686
|
refs/heads/master
| 2023-08-31T08:59:33.327998
| 2023-08-08T06:09:20
| 2023-08-31T04:38:20
| 82,517,252
| 590
| 719
|
Apache-2.0
| 2023-09-14T06:54:49
| 2017-02-20T04:38:30
|
C
|
UTF-8
|
C
| false
| false
| 17,502
|
h
|
esp32_ledc.h
|
/******************************************************************
*
* Copyright 2019 Samsung Electronics All Rights Reserved.
*
* 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.
*
******************************************************************/
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// 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.
#ifndef _DRIVER_LEDC_H_
#define _DRIVER_LEDC_H_
#ifdef __cplusplus
extern "C" {
#endif
#define LEDC_APB_CLK_HZ (APB_CLK_FREQ)
#define LEDC_REF_CLK_HZ (1*1000000)
#define LEDC_ERR_DUTY (0xFFFFFFFF)
#define LEDC_ERR_VAL (-1)
typedef enum {
LEDC_HIGH_SPEED_MODE = 0, /*!< LEDC high speed speed_mode */
LEDC_LOW_SPEED_MODE, /*!< LEDC low speed speed_mode */
LEDC_SPEED_MODE_MAX, /*!< LEDC speed limit */
}
ledc_mode_t;
typedef enum {
LEDC_INTR_DISABLE = 0, /*!< Disable LEDC interrupt */
LEDC_INTR_FADE_END, /*!< Enable LEDC interrupt */
} ledc_intr_type_t;
typedef enum {
LEDC_DUTY_DIR_DECREASE = 0, /*!< LEDC duty decrease direction */
LEDC_DUTY_DIR_INCREASE = 1, /*!< LEDC duty increase direction */
LEDC_DUTY_DIR_MAX,
} ledc_duty_direction_t;
typedef enum {
LEDC_REF_TICK = 0, /*!< LEDC timer clock divided from reference tick (1Mhz) */
LEDC_APB_CLK, /*!< LEDC timer clock divided from APB clock (80Mhz) */
} ledc_clk_src_t;
typedef enum {
LEDC_TIMER_0 = 0, /*!< LEDC timer 0 */
LEDC_TIMER_1, /*!< LEDC timer 1 */
LEDC_TIMER_2, /*!< LEDC timer 2 */
LEDC_TIMER_3, /*!< LEDC timer 3 */
LEDC_TIMER_MAX,
} ledc_timer_t;
typedef enum {
LEDC_CHANNEL_0 = 0, /*!< LEDC channel 0 */
LEDC_CHANNEL_1, /*!< LEDC channel 1 */
LEDC_CHANNEL_2, /*!< LEDC channel 2 */
LEDC_CHANNEL_3, /*!< LEDC channel 3 */
LEDC_CHANNEL_4, /*!< LEDC channel 4 */
LEDC_CHANNEL_5, /*!< LEDC channel 5 */
LEDC_CHANNEL_6, /*!< LEDC channel 6 */
LEDC_CHANNEL_7, /*!< LEDC channel 7 */
LEDC_CHANNEL_MAX,
} ledc_channel_t;
typedef enum {
LEDC_TIMER_1_BIT = 1, /*!< LEDC PWM duty resolution of 1 bits */
LEDC_TIMER_2_BIT, /*!< LEDC PWM duty resolution of 2 bits */
LEDC_TIMER_3_BIT, /*!< LEDC PWM duty resolution of 3 bits */
LEDC_TIMER_4_BIT, /*!< LEDC PWM duty resolution of 4 bits */
LEDC_TIMER_5_BIT, /*!< LEDC PWM duty resolution of 5 bits */
LEDC_TIMER_6_BIT, /*!< LEDC PWM duty resolution of 6 bits */
LEDC_TIMER_7_BIT, /*!< LEDC PWM duty resolution of 7 bits */
LEDC_TIMER_8_BIT, /*!< LEDC PWM duty resolution of 8 bits */
LEDC_TIMER_9_BIT, /*!< LEDC PWM duty resolution of 9 bits */
LEDC_TIMER_10_BIT, /*!< LEDC PWM duty resolution of 10 bits */
LEDC_TIMER_11_BIT, /*!< LEDC PWM duty resolution of 11 bits */
LEDC_TIMER_12_BIT, /*!< LEDC PWM duty resolution of 12 bits */
LEDC_TIMER_13_BIT, /*!< LEDC PWM duty resolution of 13 bits */
LEDC_TIMER_14_BIT, /*!< LEDC PWM duty resolution of 14 bits */
LEDC_TIMER_15_BIT, /*!< LEDC PWM duty resolution of 15 bits */
LEDC_TIMER_16_BIT, /*!< LEDC PWM duty resolution of 16 bits */
LEDC_TIMER_17_BIT, /*!< LEDC PWM duty resolution of 17 bits */
LEDC_TIMER_18_BIT, /*!< LEDC PWM duty resolution of 18 bits */
LEDC_TIMER_19_BIT, /*!< LEDC PWM duty resolution of 19 bits */
LEDC_TIMER_20_BIT, /*!< LEDC PWM duty resolution of 20 bits */
LEDC_TIMER_BIT_MAX,
} ledc_timer_bit_t;
typedef enum {
LEDC_FADE_NO_WAIT = 0, /*!< LEDC fade function will return immediately */
LEDC_FADE_WAIT_DONE, /*!< LEDC fade function will block until fading to the target duty */
LEDC_FADE_MAX,
} ledc_fade_mode_t;
/**
* @brief Configuration parameters of LEDC channel for ledc_channel_config function
*/
typedef struct {
int gpio_num; /*!< the LEDC output gpio_num, if you want to use gpio16, gpio_num = 16 */
ledc_mode_t speed_mode; /*!< LEDC speed speed_mode, high-speed mode or low-speed mode */
ledc_channel_t channel; /*!< LEDC channel (0 - 7) */
ledc_intr_type_t intr_type; /*!< configure interrupt, Fade interrupt enable or Fade interrupt disable */
ledc_timer_t timer_sel; /*!< Select the timer source of channel (0 - 3) */
uint32_t duty; /*!< LEDC channel duty, the range of duty setting is [0, (2**duty_resolution)] */
int hpoint; /*!< LEDC channel hpoint value, the max value is 0xfffff */
} ledc_channel_config_t;
/**
* @brief Configuration parameters of LEDC Timer timer for ledc_timer_config function
*/
typedef struct {
ledc_mode_t speed_mode; /*!< LEDC speed speed_mode, high-speed mode or low-speed mode */
union {
ledc_timer_bit_t duty_resolution; /*!< LEDC channel duty resolution */
ledc_timer_bit_t bit_num __attribute__((deprecated)); /*!< Deprecated in ESP-IDF 3.0. This is an alias to 'duty_resolution' for backward compatibility with ESP-IDF 2.1 */
};
ledc_timer_t timer_num; /*!< The timer source of channel (0 - 3) */
uint32_t freq_hz; /*!< LEDC timer frequency (Hz) */
} ledc_timer_config_t;
/**
* @brief LEDC channel configuration
* Configure LEDC channel with the given channel/output gpio_num/interrupt/source timer/frequency(Hz)/LEDC duty resolution
*
* @param ledc_conf Pointer of LEDC channel configure struct
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG Parameter error
*/
int ledc_channel_config(const ledc_channel_config_t *ledc_conf);
/**
* @brief LEDC timer configuration
* Configure LEDC timer with the given source timer/frequency(Hz)/duty_resolution
*
* @param timer_conf Pointer of LEDC timer configure struct
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG Parameter error
* - ESP_FAIL Can not find a proper pre-divider number base on the given frequency and the current duty_resolution.
*/
int ledc_timer_config(const ledc_timer_config_t *timer_conf);
/**
* @brief LEDC update channel parameters
* @note Call this function to activate the LEDC updated parameters.
* After ledc_set_duty, we need to call this function to update the settings.
* @note ledc_set_duty, ledc_set_duty_with_hpoint and ledc_update_duty are not thread-safe, do not call these functions to
* control one LEDC channel in different tasks at the same time.
* A thread-safe version of API is ledc_set_duty_and_update
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode,
* @param channel LEDC channel (0-7), select from ledc_channel_t
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG Parameter error
*
*/
int ledc_update_duty(ledc_mode_t speed_mode, ledc_channel_t channel);
/**
* @brief LEDC stop.
* Disable LEDC output, and set idle level
*
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param channel LEDC channel (0-7), select from ledc_channel_t
* @param idle_level Set output idle level after LEDC stops.
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG Parameter error
*/
int ledc_stop(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t idle_level);
/**
* @brief LEDC set duty and hpoint value
* Only after calling ledc_update_duty will the duty update.
* @note ledc_set_duty, ledc_set_duty_with_hpoint and ledc_update_duty are not thread-safe, do not call these functions to
* control one LEDC channel in different tasks at the same time.
* A thread-safe version of API is ledc_set_duty_and_update
* @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped.
* Other duty operations will have to wait until the fade operation has finished.
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param channel LEDC channel (0-7), select from ledc_channel_t
* @param duty Set the LEDC duty, the range of duty setting is [0, (2**duty_resolution)]
* @param hpoint Set the LEDC hpoint value(max: 0xfffff)
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG Parameter error
*/
int ledc_set_duty_with_hpoint(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, uint32_t hpoint);
/**
* @brief LEDC get hpoint value, the counter value when the output is set high level.
*
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param channel LEDC channel (0-7), select from ledc_channel_t
* @return
* - LEDC_ERR_VAL if parameter error
* - Others Current hpoint value of LEDC channel
*/
int ledc_get_hpoint(ledc_mode_t speed_mode, ledc_channel_t channel);
/**
* @brief LEDC set duty
* This function do not change the hpoint value of this channel. if needed, please call ledc_set_duty_with_hpoint.
* only after calling ledc_update_duty will the duty update.
* @note ledc_set_duty, ledc_set_duty_with_hpoint and ledc_update_duty are not thread-safe, do not call these functions to
* control one LEDC channel in different tasks at the same time.
* A thread-safe version of API is ledc_set_duty_and_update.
* @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped.
* Other duty operations will have to wait until the fade operation has finished.
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param channel LEDC channel (0-7), select from ledc_channel_t
* @param duty Set the LEDC duty, the range of duty setting is [0, (2**duty_resolution)]
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG Parameter error
*/
int ledc_set_duty(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty);
/**
* @brief LEDC get duty
*
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param channel LEDC channel (0-7), select from ledc_channel_t
*
* @return
* - LEDC_ERR_DUTY if parameter error
* - Others Current LEDC duty
*/
uint32_t ledc_get_duty(ledc_mode_t speed_mode, ledc_channel_t channel);
/**
* @brief LEDC set gradient
* Set LEDC gradient, After the function calls the ledc_update_duty function, the function can take effect.
* @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped.
* Other duty operations will have to wait until the fade operation has finished.
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param channel LEDC channel (0-7), select from ledc_channel_t
* @param duty Set the start of the gradient duty, the range of duty setting is [0, (2**duty_resolution)]
* @param fade_direction Set the direction of the gradient
* @param step_num Set the number of the gradient
* @param duty_cyle_num Set how many LEDC tick each time the gradient lasts
* @param duty_scale Set gradient change amplitude
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_ARG Parameter error
*/
int ledc_set_fade(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t duty, ledc_duty_direction_t fade_direction, uint32_t step_num, uint32_t duty_cyle_num, uint32_t duty_scale);
/**
* @brief Configure LEDC settings
*
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param timer_sel Timer index (0-3), there are 4 timers in LEDC module
* @param clock_divider Timer clock divide value, the timer clock is divided from the selected clock source
* @param duty_resolution Resolution of duty setting in number of bits. The range of duty values is [0, (2**duty_resolution)]
* @param clk_src Select LEDC source clock.
*
* @return
* - (-1) Parameter error
* - Other Current LEDC duty
*/
int ledc_timer_set(ledc_mode_t speed_mode, ledc_timer_t timer_sel, uint32_t clock_divider, uint32_t duty_resolution, ledc_clk_src_t clk_src);
/**
* @brief Reset LEDC timer
*
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param timer_sel LEDC timer index (0-3), select from ledc_timer_t
*
* @return
* - ESP_ERR_INVALID_ARG Parameter error
* - ESP_OK Success
*/
int ledc_timer_rst(ledc_mode_t speed_mode, uint32_t timer_sel);
/**
* @brief Bind LEDC channel with the selected timer
*
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param channel LEDC channel index (0-7), select from ledc_channel_t
* @param timer_idx LEDC timer index (0-3), select from ledc_timer_t
*
* @return
* - ESP_ERR_INVALID_ARG Parameter error
* - ESP_OK Success
*/
int ledc_bind_channel_timer(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t timer_idx);
/**
* @brief Set LEDC fade function.
* @note Call ledc_fade_func_install() once before calling this function.
* Call ledc_fade_start() after this to start fading.
* @note ledc_set_fade_with_step, ledc_set_fade_with_time and ledc_fade_start are not thread-safe, do not call these functions to
* control one LEDC channel in different tasks at the same time.
* A thread-safe version of API is ledc_set_fade_step_and_start
* @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped.
* Other duty operations will have to wait until the fade operation has finished.
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode,
* @param channel LEDC channel index (0-7), select from ledc_channel_t
* @param target_duty Target duty of fading [0, (2**duty_resolution) - 1]
* @param scale Controls the increase or decrease step scale.
* @param cycle_num increase or decrease the duty every cycle_num cycles
*
* @return
* - ESP_ERR_INVALID_ARG Parameter error
* - ESP_OK Success
* - ESP_ERR_INVALID_STATE Fade function not installed.
* - ESP_FAIL Fade function init error
*/
int ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, uint32_t scale, uint32_t cycle_num);
/**
* @brief Set LEDC fade function, with a limited time.
* @note Call ledc_fade_func_install() once before calling this function.
* Call ledc_fade_start() after this to start fading.
* @note ledc_set_fade_with_step, ledc_set_fade_with_time and ledc_fade_start are not thread-safe, do not call these functions to
* control one LEDC channel in different tasks at the same time.
* A thread-safe version of API is ledc_set_fade_step_and_start
* @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped.
* Other duty operations will have to wait until the fade operation has finished.
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode,
* @param channel LEDC channel index (0-7), select from ledc_channel_t
* @param target_duty Target duty of fading.( 0 - (2 ** duty_resolution - 1)))
* @param max_fade_time_ms The maximum time of the fading ( ms ).
*
* @return
* - ESP_ERR_INVALID_ARG Parameter error
* - ESP_OK Success
* - ESP_ERR_INVALID_STATE Fade function not installed.
* - ESP_FAIL Fade function init error
*/
int ledc_set_fade_with_time(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t target_duty, int max_fade_time_ms);
/**
* @brief Install LEDC fade function. This function will occupy interrupt of LEDC module.
* @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred)
* ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info.
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_STATE Fade function already installed.
*/
int ledc_fade_func_install(void);
/**
* @brief Uninstall LEDC fade function.
*
*/
void ledc_fade_func_uninstall(void);
/**
* @brief Start LEDC fading.
* @note Call ledc_fade_func_install() once before calling this function.
* Call this API right after ledc_set_fade_with_time or ledc_set_fade_with_step before to start fading.
* @note If a fade operation is running in progress on that channel, the driver would not allow it to be stopped.
* Other duty operations will have to wait until the fade operation has finished.
* @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode
* @param channel LEDC channel number
* @param fade_mode Whether to block until fading done.
*
* @return
* - ESP_OK Success
* - ESP_ERR_INVALID_STATE Fade function not installed.
* - ESP_ERR_INVALID_ARG Parameter error.
*/
int ledc_fade_start(ledc_mode_t speed_mode, ledc_channel_t channel, ledc_fade_mode_t fade_mode);
#ifdef __cplusplus
}
#endif
#endif /* _DRIVER_LEDC_H_ */
|
a87c7b5859d4e3e04fd046ce3b67e5daf6cd2e2b
|
73ff81df6bb050f7d0b44702da2311b24a75e616
|
/libsrc/ssdp/SSDPDescription.h
|
4bf3f76f868d7175beec9739c191286cade08541
|
[
"MIT",
"GPL-1.0-or-later",
"MPL-2.0",
"CC-BY-4.0",
"LicenseRef-scancode-protobuf",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"OFL-1.1",
"GPL-2.0-only",
"Apache-2.0",
"Hippocratic-2.1",
"BSD-2-Clause",
"GPL-2.0-or-later",
"LicenseRef-scancode-hidapi"
] |
permissive
|
hyperion-project/hyperion.ng
|
b7db4ec5027ae4a8e99962b756c8087591bc18ee
|
a5bb7e905ba153140c6563e88937e121ae3a88a9
|
refs/heads/master
| 2023-09-05T01:59:49.479565
| 2023-08-26T09:12:43
| 2023-08-26T09:12:43
| 61,202,664
| 2,589
| 531
|
MIT
| 2023-09-14T20:21:58
| 2016-06-15T11:24:38
|
C++
|
UTF-8
|
C
| false
| false
| 1,846
|
h
|
SSDPDescription.h
|
#pragma once
///
/// The xml to fill with data
/// %1 base url http://192.168.0.177:80/
/// %2 friendly name Hyperion 2.0.0 (192.168.0.177)
/// %3 modelNumber 2.0.0
/// %4 serialNumber / UDN (H ID) Fjsa723dD0....
///
/// def URN urn:schemas-upnp-org:device:Basic:1
static const QString SSDP_DESCRIPTION = "<?xml version=\"1.0\"?>"
"<root xmlns=\"urn:schemas-upnp-org:device-1-0\">"
"<specVersion>"
"<major>1</major>"
"<minor>0</minor>"
"</specVersion>"
"<URLBase>%1</URLBase>"
"<device>"
"<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>"
"<friendlyName>%2</friendlyName>"
"<manufacturer>Hyperion Open Source Ambient Lighting</manufacturer>"
"<manufacturerURL>https://www.hyperion-project.org</manufacturerURL>"
"<modelDescription>Hyperion Open Source Ambient Light</modelDescription>"
"<modelName>Hyperion</modelName>"
"<modelNumber>%3</modelNumber>"
"<modelURL>https://www.hyperion-project.org</modelURL>"
"<serialNumber>%4</serialNumber>"
"<UDN>uuid:%4</UDN>"
"<ports>"
"<jsonServer>%5</jsonServer>"
"<sslServer>%6</sslServer>"
"<protoBuffer>%7</protoBuffer>"
"<flatBuffer>%8</flatBuffer>"
"</ports>"
"<presentationURL>index.html</presentationURL>"
"<iconList>"
"<icon>"
"<mimetype>image/png</mimetype>"
"<height>100</height>"
"<width>100</width>"
"<depth>32</depth>"
"<url>img/hyperion/ssdp_icon.png</url>"
"</icon>"
"</iconList>"
"</device>"
"</root>";
|
67dd98e28844481ad787980a6af8be6d3e9b56c9
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/include/net/irda/irqueue.h
|
37f512bd673321e2fb0eed0bd8ce2653cfe7b850
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 3,125
|
h
|
irqueue.h
|
/*********************************************************************
*
* Filename: irqueue.h
* Version: 0.3
* Description: General queue implementation
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Tue Jun 9 13:26:50 1998
* Modified at: Thu Oct 7 13:25:16 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (C) 1998-1999, Aage Kvalnes <aage@cs.uit.no>
* Copyright (c) 1998, Dag Brattli
* All Rights Reserved.
*
* This code is taken from the Vortex Operating System written by Aage
* Kvalnes and has been ported to Linux and Linux/IR by Dag Brattli
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Neither Dag Brattli nor University of Tromsø admit liability nor
* provide warranty for any of this software. This material is
* provided "AS-IS" and at no charge.
*
********************************************************************/
#include <linux/types.h>
#include <linux/spinlock.h>
#ifndef IRDA_QUEUE_H
#define IRDA_QUEUE_H
#define NAME_SIZE 32
/*
* Hash types (some flags can be xored)
* See comments in irqueue.c for which one to use...
*/
#define HB_NOLOCK 0 /* No concurent access prevention */
#define HB_LOCK 1 /* Prevent concurent write with global lock */
/*
* Hash defines
*/
#define HASHBIN_SIZE 8
#define HASHBIN_MASK 0x7
#ifndef IRDA_ALIGN
#define IRDA_ALIGN __attribute__((aligned))
#endif
#define Q_NULL { NULL, NULL, "", 0 }
typedef void (*FREE_FUNC)(void *arg);
struct irda_queue {
struct irda_queue *q_next;
struct irda_queue *q_prev;
char q_name[NAME_SIZE];
long q_hash; /* Must be able to cast a (void *) */
};
typedef struct irda_queue irda_queue_t;
typedef struct hashbin_t {
__u32 magic;
int hb_type;
int hb_size;
spinlock_t hb_spinlock; /* HB_LOCK - Can be used by the user */
irda_queue_t* hb_queue[HASHBIN_SIZE] IRDA_ALIGN;
irda_queue_t* hb_current;
} hashbin_t;
hashbin_t *hashbin_new(int type);
int hashbin_delete(hashbin_t* hashbin, FREE_FUNC func);
int hashbin_clear(hashbin_t* hashbin, FREE_FUNC free_func);
void hashbin_insert(hashbin_t* hashbin, irda_queue_t* entry, long hashv,
const char* name);
void* hashbin_remove(hashbin_t* hashbin, long hashv, const char* name);
void* hashbin_remove_first(hashbin_t *hashbin);
void* hashbin_remove_this( hashbin_t* hashbin, irda_queue_t* entry);
void* hashbin_find(hashbin_t* hashbin, long hashv, const char* name);
void* hashbin_lock_find(hashbin_t* hashbin, long hashv, const char* name);
void* hashbin_find_next(hashbin_t* hashbin, long hashv, const char* name,
void ** pnext);
irda_queue_t *hashbin_get_first(hashbin_t *hashbin);
irda_queue_t *hashbin_get_next(hashbin_t *hashbin);
#define HASHBIN_GET_SIZE(hashbin) hashbin->hb_size
#endif
|
3b012b6a6d0656cd31adff394d9cc18df8a6cb24
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/u-boot_new/drivers/i2c/pca9564_i2c.c
|
313288dd112b0e8c3e6f1c553019697ec0346785
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"GPL-2.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 3,983
|
c
|
pca9564_i2c.c
|
/*
* File: drivers/i2c/pca9564.c
* Based on: drivers/i2c/s3c44b0_i2c.c
* Author:
*
* Created: 2009-06-23
* Description: PCA9564 i2c bridge driver
*
* Modified:
* Copyright 2009 CJSC "NII STT", http://www.niistt.ru/
*
* Bugs:
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <i2c.h>
#include <pca9564.h>
#include <asm/io.h>
#define PCA_STA (CONFIG_PCA9564_BASE + 0)
#define PCA_TO (CONFIG_PCA9564_BASE + 0)
#define PCA_DAT (CONFIG_PCA9564_BASE + (1 << 2))
#define PCA_ADR (CONFIG_PCA9564_BASE + (2 << 2))
#define PCA_CON (CONFIG_PCA9564_BASE + (3 << 2))
static unsigned char pca_read_reg(unsigned int reg)
{
return readb((void *)reg);
}
static void pca_write_reg(unsigned int reg, unsigned char value)
{
writeb(value, (void *)reg);
}
static int pca_wait_busy(void)
{
unsigned int timeout = 10000;
while (!(pca_read_reg(PCA_CON) & PCA_CON_SI) && --timeout)
udelay(1);
if (timeout == 0)
debug("I2C timeout!\n");
debug("CON = 0x%02x, STA = 0x%02x\n", pca_read_reg(PCA_CON),
pca_read_reg(PCA_STA));
return timeout ? 0 : 1;
}
/*=====================================================================*/
/* Public Functions */
/*=====================================================================*/
/*-----------------------------------------------------------------------
* Initialization
*/
void i2c_init(int speed, int slaveaddr)
{
pca_write_reg(PCA_CON, PCA_CON_ENSIO | speed);
}
/*
* Probe the given I2C chip address. Returns 0 if a chip responded,
* not 0 on failure.
*/
int i2c_probe(uchar chip)
{
unsigned char res;
pca_write_reg(PCA_CON, PCA_CON_STA | PCA_CON_ENSIO);
pca_wait_busy();
pca_write_reg(PCA_CON, PCA_CON_STA | PCA_CON_ENSIO);
pca_write_reg(PCA_DAT, (chip << 1) | 1);
res = pca_wait_busy();
if ((res == 0) && (pca_read_reg(PCA_STA) == 0x48))
res = 1;
pca_write_reg(PCA_CON, PCA_CON_STO | PCA_CON_ENSIO);
return res;
}
/*
* Read/Write interface:
* chip: I2C chip address, range 0..127
* addr: Memory (register) address within the chip
* alen: Number of bytes to use for addr (typically 1, 2 for larger
* memories, 0 for register type devices with only one
* register)
* buffer: Where to read/write the data
* len: How many bytes to read/write
*
* Returns: 0 on success, not 0 on failure
*/
int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
{
int i;
pca_write_reg(PCA_CON, PCA_CON_ENSIO | PCA_CON_STA);
pca_wait_busy();
pca_write_reg(PCA_CON, PCA_CON_ENSIO);
pca_write_reg(PCA_DAT, (chip << 1));
pca_wait_busy();
pca_write_reg(PCA_CON, PCA_CON_ENSIO);
if (alen > 0) {
pca_write_reg(PCA_DAT, addr);
pca_wait_busy();
pca_write_reg(PCA_CON, PCA_CON_ENSIO);
}
pca_write_reg(PCA_CON, PCA_CON_ENSIO | PCA_CON_STO);
udelay(500);
pca_write_reg(PCA_CON, PCA_CON_ENSIO | PCA_CON_STA);
pca_wait_busy();
pca_write_reg(PCA_CON, PCA_CON_ENSIO);
pca_write_reg(PCA_DAT, (chip << 1) | 1);
pca_wait_busy();
for (i = 0; i < len; ++i) {
if (i == len - 1)
pca_write_reg(PCA_CON, PCA_CON_ENSIO);
else
pca_write_reg(PCA_CON, PCA_CON_ENSIO | PCA_CON_AA);
pca_wait_busy();
buffer[i] = pca_read_reg(PCA_DAT);
}
pca_write_reg(PCA_CON, PCA_CON_ENSIO | PCA_CON_STO);
return 0;
}
int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
{
int i;
pca_write_reg(PCA_CON, PCA_CON_ENSIO | PCA_CON_STA);
pca_wait_busy();
pca_write_reg(PCA_CON, PCA_CON_ENSIO);
pca_write_reg(PCA_DAT, chip << 1);
pca_wait_busy();
pca_write_reg(PCA_CON, PCA_CON_ENSIO);
if (alen > 0) {
pca_write_reg(PCA_DAT, addr);
pca_wait_busy();
pca_write_reg(PCA_CON, PCA_CON_ENSIO);
}
for (i = 0; i < len; ++i) {
pca_write_reg(PCA_DAT, buffer[i]);
pca_wait_busy();
pca_write_reg(PCA_CON, PCA_CON_ENSIO);
}
pca_write_reg(PCA_CON, PCA_CON_STO | PCA_CON_ENSIO);
return 0;
}
|
ec791360f37a6274b3256230733b1273d91a24d1
|
2308899071a849a199e3b70806b4dd1c396efc8a
|
/0.76_My_PuTTY/minibidi.c
|
654f47ee56965227503a39d0b6398f3f28906b67
|
[
"MIT"
] |
permissive
|
cyd01/KiTTY
|
b0b06d771508668ccbd6316474382b538a65bac0
|
0e5d8582aad192db96ba240444a6840fa82ccf05
|
refs/heads/master
| 2023-08-10T21:25:06.926589
| 2023-05-23T17:23:03
| 2023-05-23T17:56:00
| 154,540,955
| 1,451
| 147
|
NOASSERTION
| 2023-05-30T17:16:10
| 2018-10-24T17:26:24
|
C
|
UTF-8
|
C
| false
| false
| 66,200
|
c
|
minibidi.c
|
/************************************************************************
*
* ------------
* Description:
* ------------
* This is an implementation of Unicode's Bidirectional Algorithm
* (known as UAX #9).
*
* http://www.unicode.org/reports/tr9/
*
* Author: Ahmad Khalifa
*
* (www.arabeyes.org - under MIT license)
*
************************************************************************/
/*
* TODO:
* =====
* - Explicit marks need to be handled (they are not 100% now)
* - Ligatures
*/
#include <stdlib.h> /* definition of wchar_t*/
#include "putty.h"
#include "misc.h"
#define LMASK 0x3F /* Embedding Level mask */
#define OMASK 0xC0 /* Override mask */
#define OISL 0x80 /* Override is L */
#define OISR 0x40 /* Override is R */
/* For standalone compilation in a testing mode.
* Still depends on the PuTTY headers for snewn and sfree, but can avoid
* _linking_ with any other PuTTY code. */
#ifdef TEST_GETTYPE
#define safemalloc malloc
#define safefree free
#endif
/* Shaping Helpers */
#define STYPE(xh) ((((xh) >= SHAPE_FIRST) && ((xh) <= SHAPE_LAST)) ? \
shapetypes[(xh)-SHAPE_FIRST].type : SU) /*))*/
#define SISOLATED(xh) (shapetypes[(xh)-SHAPE_FIRST].form_b)
#define SFINAL(xh) ((xh)+1)
#define SINITIAL(xh) ((xh)+2)
#define SMEDIAL(ch) ((ch)+3)
#define leastGreaterOdd(x) ( ((x)+1) | 1 )
#define leastGreaterEven(x) ( ((x)+2) &~ 1 )
/* function declarations */
static void flipThisRun(
bidi_char *from, unsigned char *level, int max, int count);
static int findIndexOfRun(
unsigned char *level, int start, int count, int tlevel);
static unsigned char getType(int ch);
static unsigned char setOverrideBits(
unsigned char level, unsigned char override);
static int getPreviousLevel(unsigned char *level, int from);
static void doMirror(unsigned int *ch);
/* character types */
enum {
L,
LRE,
LRO,
R,
AL,
RLE,
RLO,
PDF,
EN,
ES,
ET,
AN,
CS,
NSM,
BN,
B,
S,
WS,
ON
};
/* Shaping Types */
enum {
SL, /* Left-Joining, doesn't exist in U+0600 - U+06FF */
SR, /* Right-Joining, ie has Isolated, Final */
SD, /* Dual-Joining, ie has Isolated, Final, Initial, Medial */
SU, /* Non-Joining */
SC /* Join-Causing, like U+0640 (TATWEEL) */
};
typedef struct {
char type;
wchar_t form_b;
} shape_node;
/* Kept near the actual table, for verification. */
#define SHAPE_FIRST 0x621
#define SHAPE_LAST (SHAPE_FIRST + lenof(shapetypes) - 1)
static const shape_node shapetypes[] = {
/* index, Typ, Iso, Ligature Index*/
/* 621 */ {SU, 0xFE80},
/* 622 */ {SR, 0xFE81},
/* 623 */ {SR, 0xFE83},
/* 624 */ {SR, 0xFE85},
/* 625 */ {SR, 0xFE87},
/* 626 */ {SD, 0xFE89},
/* 627 */ {SR, 0xFE8D},
/* 628 */ {SD, 0xFE8F},
/* 629 */ {SR, 0xFE93},
/* 62A */ {SD, 0xFE95},
/* 62B */ {SD, 0xFE99},
/* 62C */ {SD, 0xFE9D},
/* 62D */ {SD, 0xFEA1},
/* 62E */ {SD, 0xFEA5},
/* 62F */ {SR, 0xFEA9},
/* 630 */ {SR, 0xFEAB},
/* 631 */ {SR, 0xFEAD},
/* 632 */ {SR, 0xFEAF},
/* 633 */ {SD, 0xFEB1},
/* 634 */ {SD, 0xFEB5},
/* 635 */ {SD, 0xFEB9},
/* 636 */ {SD, 0xFEBD},
/* 637 */ {SD, 0xFEC1},
/* 638 */ {SD, 0xFEC5},
/* 639 */ {SD, 0xFEC9},
/* 63A */ {SD, 0xFECD},
/* 63B */ {SU, 0x0},
/* 63C */ {SU, 0x0},
/* 63D */ {SU, 0x0},
/* 63E */ {SU, 0x0},
/* 63F */ {SU, 0x0},
/* 640 */ {SC, 0x0},
/* 641 */ {SD, 0xFED1},
/* 642 */ {SD, 0xFED5},
/* 643 */ {SD, 0xFED9},
/* 644 */ {SD, 0xFEDD},
/* 645 */ {SD, 0xFEE1},
/* 646 */ {SD, 0xFEE5},
/* 647 */ {SD, 0xFEE9},
/* 648 */ {SR, 0xFEED},
/* 649 */ {SR, 0xFEEF}, /* SD */
/* 64A */ {SD, 0xFEF1},
/* 64B */ {SU, 0x0},
/* 64C */ {SU, 0x0},
/* 64D */ {SU, 0x0},
/* 64E */ {SU, 0x0},
/* 64F */ {SU, 0x0},
/* 650 */ {SU, 0x0},
/* 651 */ {SU, 0x0},
/* 652 */ {SU, 0x0},
/* 653 */ {SU, 0x0},
/* 654 */ {SU, 0x0},
/* 655 */ {SU, 0x0},
/* 656 */ {SU, 0x0},
/* 657 */ {SU, 0x0},
/* 658 */ {SU, 0x0},
/* 659 */ {SU, 0x0},
/* 65A */ {SU, 0x0},
/* 65B */ {SU, 0x0},
/* 65C */ {SU, 0x0},
/* 65D */ {SU, 0x0},
/* 65E */ {SU, 0x0},
/* 65F */ {SU, 0x0},
/* 660 */ {SU, 0x0},
/* 661 */ {SU, 0x0},
/* 662 */ {SU, 0x0},
/* 663 */ {SU, 0x0},
/* 664 */ {SU, 0x0},
/* 665 */ {SU, 0x0},
/* 666 */ {SU, 0x0},
/* 667 */ {SU, 0x0},
/* 668 */ {SU, 0x0},
/* 669 */ {SU, 0x0},
/* 66A */ {SU, 0x0},
/* 66B */ {SU, 0x0},
/* 66C */ {SU, 0x0},
/* 66D */ {SU, 0x0},
/* 66E */ {SU, 0x0},
/* 66F */ {SU, 0x0},
/* 670 */ {SU, 0x0},
/* 671 */ {SR, 0xFB50},
/* 672 */ {SU, 0x0},
/* 673 */ {SU, 0x0},
/* 674 */ {SU, 0x0},
/* 675 */ {SU, 0x0},
/* 676 */ {SU, 0x0},
/* 677 */ {SU, 0x0},
/* 678 */ {SU, 0x0},
/* 679 */ {SD, 0xFB66},
/* 67A */ {SD, 0xFB5E},
/* 67B */ {SD, 0xFB52},
/* 67C */ {SU, 0x0},
/* 67D */ {SU, 0x0},
/* 67E */ {SD, 0xFB56},
/* 67F */ {SD, 0xFB62},
/* 680 */ {SD, 0xFB5A},
/* 681 */ {SU, 0x0},
/* 682 */ {SU, 0x0},
/* 683 */ {SD, 0xFB76},
/* 684 */ {SD, 0xFB72},
/* 685 */ {SU, 0x0},
/* 686 */ {SD, 0xFB7A},
/* 687 */ {SD, 0xFB7E},
/* 688 */ {SR, 0xFB88},
/* 689 */ {SU, 0x0},
/* 68A */ {SU, 0x0},
/* 68B */ {SU, 0x0},
/* 68C */ {SR, 0xFB84},
/* 68D */ {SR, 0xFB82},
/* 68E */ {SR, 0xFB86},
/* 68F */ {SU, 0x0},
/* 690 */ {SU, 0x0},
/* 691 */ {SR, 0xFB8C},
/* 692 */ {SU, 0x0},
/* 693 */ {SU, 0x0},
/* 694 */ {SU, 0x0},
/* 695 */ {SU, 0x0},
/* 696 */ {SU, 0x0},
/* 697 */ {SU, 0x0},
/* 698 */ {SR, 0xFB8A},
/* 699 */ {SU, 0x0},
/* 69A */ {SU, 0x0},
/* 69B */ {SU, 0x0},
/* 69C */ {SU, 0x0},
/* 69D */ {SU, 0x0},
/* 69E */ {SU, 0x0},
/* 69F */ {SU, 0x0},
/* 6A0 */ {SU, 0x0},
/* 6A1 */ {SU, 0x0},
/* 6A2 */ {SU, 0x0},
/* 6A3 */ {SU, 0x0},
/* 6A4 */ {SD, 0xFB6A},
/* 6A5 */ {SU, 0x0},
/* 6A6 */ {SD, 0xFB6E},
/* 6A7 */ {SU, 0x0},
/* 6A8 */ {SU, 0x0},
/* 6A9 */ {SD, 0xFB8E},
/* 6AA */ {SU, 0x0},
/* 6AB */ {SU, 0x0},
/* 6AC */ {SU, 0x0},
/* 6AD */ {SD, 0xFBD3},
/* 6AE */ {SU, 0x0},
/* 6AF */ {SD, 0xFB92},
/* 6B0 */ {SU, 0x0},
/* 6B1 */ {SD, 0xFB9A},
/* 6B2 */ {SU, 0x0},
/* 6B3 */ {SD, 0xFB96},
/* 6B4 */ {SU, 0x0},
/* 6B5 */ {SU, 0x0},
/* 6B6 */ {SU, 0x0},
/* 6B7 */ {SU, 0x0},
/* 6B8 */ {SU, 0x0},
/* 6B9 */ {SU, 0x0},
/* 6BA */ {SR, 0xFB9E},
/* 6BB */ {SD, 0xFBA0},
/* 6BC */ {SU, 0x0},
/* 6BD */ {SU, 0x0},
/* 6BE */ {SD, 0xFBAA},
/* 6BF */ {SU, 0x0},
/* 6C0 */ {SR, 0xFBA4},
/* 6C1 */ {SD, 0xFBA6},
/* 6C2 */ {SU, 0x0},
/* 6C3 */ {SU, 0x0},
/* 6C4 */ {SU, 0x0},
/* 6C5 */ {SR, 0xFBE0},
/* 6C6 */ {SR, 0xFBD9},
/* 6C7 */ {SR, 0xFBD7},
/* 6C8 */ {SR, 0xFBDB},
/* 6C9 */ {SR, 0xFBE2},
/* 6CA */ {SU, 0x0},
/* 6CB */ {SR, 0xFBDE},
/* 6CC */ {SD, 0xFBFC},
/* 6CD */ {SU, 0x0},
/* 6CE */ {SU, 0x0},
/* 6CF */ {SU, 0x0},
/* 6D0 */ {SU, 0x0},
/* 6D1 */ {SU, 0x0},
/* 6D2 */ {SR, 0xFBAE},
};
/*
* Flips the text buffer, according to max level, and
* all higher levels
*
* Input:
* from: text buffer, on which to apply flipping
* level: resolved levels buffer
* max: the maximum level found in this line (should be unsigned char)
* count: line size in bidi_char
*/
static void flipThisRun(
bidi_char *from, unsigned char *level, int max, int count)
{
int i, j, k, tlevel;
bidi_char temp;
j = i = 0;
while (i<count && j<count) {
/* find the start of the run of level=max */
tlevel = max;
i = j = findIndexOfRun(level, i, count, max);
/* find the end of the run */
while (i<count && tlevel <= level[i]) {
i++;
}
for (k = i - 1; k > j; k--, j++) {
temp = from[k];
from[k] = from[j];
from[j] = temp;
}
}
}
/*
* Finds the index of a run with level equals tlevel
*/
static int findIndexOfRun(
unsigned char *level , int start, int count, int tlevel)
{
int i;
for (i=start; i<count; i++) {
if (tlevel == level[i]) {
return i;
}
}
return count;
}
/*
* Returns the bidi character type of ch.
*
* The data table in this function is constructed from the Unicode
* Character Database, downloadable from unicode.org at the URL
*
* http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
*
* by the following fragment of Perl:
perl -ne 'split ";"; $num = hex $_[0]; $type = $_[4];' \
-e '$fl = ($_[1] =~ /First/ ? 1 : $_[1] =~ /Last/ ? 2 : 0);' \
-e 'if ($type eq $runtype and ($runend == $num-1 or ' \
-e ' ($fl==2 and $pfl==1))) {$runend = $num;} else { &reset; }' \
-e '$pfl=$fl; END { &reset }; sub reset {' \
-e 'printf" {0x%04x, 0x%04x, %s},\n",$runstart,$runend,$runtype' \
-e ' if defined $runstart and $runtype ne "ON";' \
-e '$runstart=$runend=$num; $runtype=$type;}' \
UnicodeData.txt
*/
static unsigned char getType(int ch)
{
static const struct {
int first, last, type;
} lookup[] = {
{0x0000, 0x0008, BN},
{0x0009, 0x0009, S},
{0x000a, 0x000a, B},
{0x000b, 0x000b, S},
{0x000c, 0x000c, WS},
{0x000d, 0x000d, B},
{0x000e, 0x001b, BN},
{0x001c, 0x001e, B},
{0x001f, 0x001f, S},
{0x0020, 0x0020, WS},
{0x0023, 0x0025, ET},
{0x002b, 0x002b, ES},
{0x002c, 0x002c, CS},
{0x002d, 0x002d, ES},
{0x002e, 0x002f, CS},
{0x0030, 0x0039, EN},
{0x003a, 0x003a, CS},
{0x0041, 0x005a, L},
{0x0061, 0x007a, L},
{0x007f, 0x0084, BN},
{0x0085, 0x0085, B},
{0x0086, 0x009f, BN},
{0x00a0, 0x00a0, CS},
{0x00a2, 0x00a5, ET},
{0x00aa, 0x00aa, L},
{0x00ad, 0x00ad, BN},
{0x00b0, 0x00b1, ET},
{0x00b2, 0x00b3, EN},
{0x00b5, 0x00b5, L},
{0x00b9, 0x00b9, EN},
{0x00ba, 0x00ba, L},
{0x00c0, 0x00d6, L},
{0x00d8, 0x00f6, L},
{0x00f8, 0x0236, L},
{0x0250, 0x02b8, L},
{0x02bb, 0x02c1, L},
{0x02d0, 0x02d1, L},
{0x02e0, 0x02e4, L},
{0x02ee, 0x02ee, L},
{0x0300, 0x0357, NSM},
{0x035d, 0x036f, NSM},
{0x037a, 0x037a, L},
{0x0386, 0x0386, L},
{0x0388, 0x038a, L},
{0x038c, 0x038c, L},
{0x038e, 0x03a1, L},
{0x03a3, 0x03ce, L},
{0x03d0, 0x03f5, L},
{0x03f7, 0x03fb, L},
{0x0400, 0x0482, L},
{0x0483, 0x0486, NSM},
{0x0488, 0x0489, NSM},
{0x048a, 0x04ce, L},
{0x04d0, 0x04f5, L},
{0x04f8, 0x04f9, L},
{0x0500, 0x050f, L},
{0x0531, 0x0556, L},
{0x0559, 0x055f, L},
{0x0561, 0x0587, L},
{0x0589, 0x0589, L},
{0x0591, 0x05a1, NSM},
{0x05a3, 0x05b9, NSM},
{0x05bb, 0x05bd, NSM},
{0x05be, 0x05be, R},
{0x05bf, 0x05bf, NSM},
{0x05c0, 0x05c0, R},
{0x05c1, 0x05c2, NSM},
{0x05c3, 0x05c3, R},
{0x05c4, 0x05c4, NSM},
{0x05d0, 0x05ea, R},
{0x05f0, 0x05f4, R},
{0x0600, 0x0603, AL},
{0x060c, 0x060c, CS},
{0x060d, 0x060d, AL},
{0x0610, 0x0615, NSM},
{0x061b, 0x061b, AL},
{0x061f, 0x061f, AL},
{0x0621, 0x063a, AL},
{0x0640, 0x064a, AL},
{0x064b, 0x0658, NSM},
{0x0660, 0x0669, AN},
{0x066a, 0x066a, ET},
{0x066b, 0x066c, AN},
{0x066d, 0x066f, AL},
{0x0670, 0x0670, NSM},
{0x0671, 0x06d5, AL},
{0x06d6, 0x06dc, NSM},
{0x06dd, 0x06dd, AL},
{0x06de, 0x06e4, NSM},
{0x06e5, 0x06e6, AL},
{0x06e7, 0x06e8, NSM},
{0x06ea, 0x06ed, NSM},
{0x06ee, 0x06ef, AL},
{0x06f0, 0x06f9, EN},
{0x06fa, 0x070d, AL},
{0x070f, 0x070f, BN},
{0x0710, 0x0710, AL},
{0x0711, 0x0711, NSM},
{0x0712, 0x072f, AL},
{0x0730, 0x074a, NSM},
{0x074d, 0x074f, AL},
{0x0780, 0x07a5, AL},
{0x07a6, 0x07b0, NSM},
{0x07b1, 0x07b1, AL},
{0x0901, 0x0902, NSM},
{0x0903, 0x0939, L},
{0x093c, 0x093c, NSM},
{0x093d, 0x0940, L},
{0x0941, 0x0948, NSM},
{0x0949, 0x094c, L},
{0x094d, 0x094d, NSM},
{0x0950, 0x0950, L},
{0x0951, 0x0954, NSM},
{0x0958, 0x0961, L},
{0x0962, 0x0963, NSM},
{0x0964, 0x0970, L},
{0x0981, 0x0981, NSM},
{0x0982, 0x0983, L},
{0x0985, 0x098c, L},
{0x098f, 0x0990, L},
{0x0993, 0x09a8, L},
{0x09aa, 0x09b0, L},
{0x09b2, 0x09b2, L},
{0x09b6, 0x09b9, L},
{0x09bc, 0x09bc, NSM},
{0x09bd, 0x09c0, L},
{0x09c1, 0x09c4, NSM},
{0x09c7, 0x09c8, L},
{0x09cb, 0x09cc, L},
{0x09cd, 0x09cd, NSM},
{0x09d7, 0x09d7, L},
{0x09dc, 0x09dd, L},
{0x09df, 0x09e1, L},
{0x09e2, 0x09e3, NSM},
{0x09e6, 0x09f1, L},
{0x09f2, 0x09f3, ET},
{0x09f4, 0x09fa, L},
{0x0a01, 0x0a02, NSM},
{0x0a03, 0x0a03, L},
{0x0a05, 0x0a0a, L},
{0x0a0f, 0x0a10, L},
{0x0a13, 0x0a28, L},
{0x0a2a, 0x0a30, L},
{0x0a32, 0x0a33, L},
{0x0a35, 0x0a36, L},
{0x0a38, 0x0a39, L},
{0x0a3c, 0x0a3c, NSM},
{0x0a3e, 0x0a40, L},
{0x0a41, 0x0a42, NSM},
{0x0a47, 0x0a48, NSM},
{0x0a4b, 0x0a4d, NSM},
{0x0a59, 0x0a5c, L},
{0x0a5e, 0x0a5e, L},
{0x0a66, 0x0a6f, L},
{0x0a70, 0x0a71, NSM},
{0x0a72, 0x0a74, L},
{0x0a81, 0x0a82, NSM},
{0x0a83, 0x0a83, L},
{0x0a85, 0x0a8d, L},
{0x0a8f, 0x0a91, L},
{0x0a93, 0x0aa8, L},
{0x0aaa, 0x0ab0, L},
{0x0ab2, 0x0ab3, L},
{0x0ab5, 0x0ab9, L},
{0x0abc, 0x0abc, NSM},
{0x0abd, 0x0ac0, L},
{0x0ac1, 0x0ac5, NSM},
{0x0ac7, 0x0ac8, NSM},
{0x0ac9, 0x0ac9, L},
{0x0acb, 0x0acc, L},
{0x0acd, 0x0acd, NSM},
{0x0ad0, 0x0ad0, L},
{0x0ae0, 0x0ae1, L},
{0x0ae2, 0x0ae3, NSM},
{0x0ae6, 0x0aef, L},
{0x0af1, 0x0af1, ET},
{0x0b01, 0x0b01, NSM},
{0x0b02, 0x0b03, L},
{0x0b05, 0x0b0c, L},
{0x0b0f, 0x0b10, L},
{0x0b13, 0x0b28, L},
{0x0b2a, 0x0b30, L},
{0x0b32, 0x0b33, L},
{0x0b35, 0x0b39, L},
{0x0b3c, 0x0b3c, NSM},
{0x0b3d, 0x0b3e, L},
{0x0b3f, 0x0b3f, NSM},
{0x0b40, 0x0b40, L},
{0x0b41, 0x0b43, NSM},
{0x0b47, 0x0b48, L},
{0x0b4b, 0x0b4c, L},
{0x0b4d, 0x0b4d, NSM},
{0x0b56, 0x0b56, NSM},
{0x0b57, 0x0b57, L},
{0x0b5c, 0x0b5d, L},
{0x0b5f, 0x0b61, L},
{0x0b66, 0x0b71, L},
{0x0b82, 0x0b82, NSM},
{0x0b83, 0x0b83, L},
{0x0b85, 0x0b8a, L},
{0x0b8e, 0x0b90, L},
{0x0b92, 0x0b95, L},
{0x0b99, 0x0b9a, L},
{0x0b9c, 0x0b9c, L},
{0x0b9e, 0x0b9f, L},
{0x0ba3, 0x0ba4, L},
{0x0ba8, 0x0baa, L},
{0x0bae, 0x0bb5, L},
{0x0bb7, 0x0bb9, L},
{0x0bbe, 0x0bbf, L},
{0x0bc0, 0x0bc0, NSM},
{0x0bc1, 0x0bc2, L},
{0x0bc6, 0x0bc8, L},
{0x0bca, 0x0bcc, L},
{0x0bcd, 0x0bcd, NSM},
{0x0bd7, 0x0bd7, L},
{0x0be7, 0x0bf2, L},
{0x0bf9, 0x0bf9, ET},
{0x0c01, 0x0c03, L},
{0x0c05, 0x0c0c, L},
{0x0c0e, 0x0c10, L},
{0x0c12, 0x0c28, L},
{0x0c2a, 0x0c33, L},
{0x0c35, 0x0c39, L},
{0x0c3e, 0x0c40, NSM},
{0x0c41, 0x0c44, L},
{0x0c46, 0x0c48, NSM},
{0x0c4a, 0x0c4d, NSM},
{0x0c55, 0x0c56, NSM},
{0x0c60, 0x0c61, L},
{0x0c66, 0x0c6f, L},
{0x0c82, 0x0c83, L},
{0x0c85, 0x0c8c, L},
{0x0c8e, 0x0c90, L},
{0x0c92, 0x0ca8, L},
{0x0caa, 0x0cb3, L},
{0x0cb5, 0x0cb9, L},
{0x0cbc, 0x0cbc, NSM},
{0x0cbd, 0x0cc4, L},
{0x0cc6, 0x0cc8, L},
{0x0cca, 0x0ccb, L},
{0x0ccc, 0x0ccd, NSM},
{0x0cd5, 0x0cd6, L},
{0x0cde, 0x0cde, L},
{0x0ce0, 0x0ce1, L},
{0x0ce6, 0x0cef, L},
{0x0d02, 0x0d03, L},
{0x0d05, 0x0d0c, L},
{0x0d0e, 0x0d10, L},
{0x0d12, 0x0d28, L},
{0x0d2a, 0x0d39, L},
{0x0d3e, 0x0d40, L},
{0x0d41, 0x0d43, NSM},
{0x0d46, 0x0d48, L},
{0x0d4a, 0x0d4c, L},
{0x0d4d, 0x0d4d, NSM},
{0x0d57, 0x0d57, L},
{0x0d60, 0x0d61, L},
{0x0d66, 0x0d6f, L},
{0x0d82, 0x0d83, L},
{0x0d85, 0x0d96, L},
{0x0d9a, 0x0db1, L},
{0x0db3, 0x0dbb, L},
{0x0dbd, 0x0dbd, L},
{0x0dc0, 0x0dc6, L},
{0x0dca, 0x0dca, NSM},
{0x0dcf, 0x0dd1, L},
{0x0dd2, 0x0dd4, NSM},
{0x0dd6, 0x0dd6, NSM},
{0x0dd8, 0x0ddf, L},
{0x0df2, 0x0df4, L},
{0x0e01, 0x0e30, L},
{0x0e31, 0x0e31, NSM},
{0x0e32, 0x0e33, L},
{0x0e34, 0x0e3a, NSM},
{0x0e3f, 0x0e3f, ET},
{0x0e40, 0x0e46, L},
{0x0e47, 0x0e4e, NSM},
{0x0e4f, 0x0e5b, L},
{0x0e81, 0x0e82, L},
{0x0e84, 0x0e84, L},
{0x0e87, 0x0e88, L},
{0x0e8a, 0x0e8a, L},
{0x0e8d, 0x0e8d, L},
{0x0e94, 0x0e97, L},
{0x0e99, 0x0e9f, L},
{0x0ea1, 0x0ea3, L},
{0x0ea5, 0x0ea5, L},
{0x0ea7, 0x0ea7, L},
{0x0eaa, 0x0eab, L},
{0x0ead, 0x0eb0, L},
{0x0eb1, 0x0eb1, NSM},
{0x0eb2, 0x0eb3, L},
{0x0eb4, 0x0eb9, NSM},
{0x0ebb, 0x0ebc, NSM},
{0x0ebd, 0x0ebd, L},
{0x0ec0, 0x0ec4, L},
{0x0ec6, 0x0ec6, L},
{0x0ec8, 0x0ecd, NSM},
{0x0ed0, 0x0ed9, L},
{0x0edc, 0x0edd, L},
{0x0f00, 0x0f17, L},
{0x0f18, 0x0f19, NSM},
{0x0f1a, 0x0f34, L},
{0x0f35, 0x0f35, NSM},
{0x0f36, 0x0f36, L},
{0x0f37, 0x0f37, NSM},
{0x0f38, 0x0f38, L},
{0x0f39, 0x0f39, NSM},
{0x0f3e, 0x0f47, L},
{0x0f49, 0x0f6a, L},
{0x0f71, 0x0f7e, NSM},
{0x0f7f, 0x0f7f, L},
{0x0f80, 0x0f84, NSM},
{0x0f85, 0x0f85, L},
{0x0f86, 0x0f87, NSM},
{0x0f88, 0x0f8b, L},
{0x0f90, 0x0f97, NSM},
{0x0f99, 0x0fbc, NSM},
{0x0fbe, 0x0fc5, L},
{0x0fc6, 0x0fc6, NSM},
{0x0fc7, 0x0fcc, L},
{0x0fcf, 0x0fcf, L},
{0x1000, 0x1021, L},
{0x1023, 0x1027, L},
{0x1029, 0x102a, L},
{0x102c, 0x102c, L},
{0x102d, 0x1030, NSM},
{0x1031, 0x1031, L},
{0x1032, 0x1032, NSM},
{0x1036, 0x1037, NSM},
{0x1038, 0x1038, L},
{0x1039, 0x1039, NSM},
{0x1040, 0x1057, L},
{0x1058, 0x1059, NSM},
{0x10a0, 0x10c5, L},
{0x10d0, 0x10f8, L},
{0x10fb, 0x10fb, L},
{0x1100, 0x1159, L},
{0x115f, 0x11a2, L},
{0x11a8, 0x11f9, L},
{0x1200, 0x1206, L},
{0x1208, 0x1246, L},
{0x1248, 0x1248, L},
{0x124a, 0x124d, L},
{0x1250, 0x1256, L},
{0x1258, 0x1258, L},
{0x125a, 0x125d, L},
{0x1260, 0x1286, L},
{0x1288, 0x1288, L},
{0x128a, 0x128d, L},
{0x1290, 0x12ae, L},
{0x12b0, 0x12b0, L},
{0x12b2, 0x12b5, L},
{0x12b8, 0x12be, L},
{0x12c0, 0x12c0, L},
{0x12c2, 0x12c5, L},
{0x12c8, 0x12ce, L},
{0x12d0, 0x12d6, L},
{0x12d8, 0x12ee, L},
{0x12f0, 0x130e, L},
{0x1310, 0x1310, L},
{0x1312, 0x1315, L},
{0x1318, 0x131e, L},
{0x1320, 0x1346, L},
{0x1348, 0x135a, L},
{0x1361, 0x137c, L},
{0x13a0, 0x13f4, L},
{0x1401, 0x1676, L},
{0x1680, 0x1680, WS},
{0x1681, 0x169a, L},
{0x16a0, 0x16f0, L},
{0x1700, 0x170c, L},
{0x170e, 0x1711, L},
{0x1712, 0x1714, NSM},
{0x1720, 0x1731, L},
{0x1732, 0x1734, NSM},
{0x1735, 0x1736, L},
{0x1740, 0x1751, L},
{0x1752, 0x1753, NSM},
{0x1760, 0x176c, L},
{0x176e, 0x1770, L},
{0x1772, 0x1773, NSM},
{0x1780, 0x17b6, L},
{0x17b7, 0x17bd, NSM},
{0x17be, 0x17c5, L},
{0x17c6, 0x17c6, NSM},
{0x17c7, 0x17c8, L},
{0x17c9, 0x17d3, NSM},
{0x17d4, 0x17da, L},
{0x17db, 0x17db, ET},
{0x17dc, 0x17dc, L},
{0x17dd, 0x17dd, NSM},
{0x17e0, 0x17e9, L},
{0x180b, 0x180d, NSM},
{0x180e, 0x180e, WS},
{0x1810, 0x1819, L},
{0x1820, 0x1877, L},
{0x1880, 0x18a8, L},
{0x18a9, 0x18a9, NSM},
{0x1900, 0x191c, L},
{0x1920, 0x1922, NSM},
{0x1923, 0x1926, L},
{0x1927, 0x192b, NSM},
{0x1930, 0x1931, L},
{0x1932, 0x1932, NSM},
{0x1933, 0x1938, L},
{0x1939, 0x193b, NSM},
{0x1946, 0x196d, L},
{0x1970, 0x1974, L},
{0x1d00, 0x1d6b, L},
{0x1e00, 0x1e9b, L},
{0x1ea0, 0x1ef9, L},
{0x1f00, 0x1f15, L},
{0x1f18, 0x1f1d, L},
{0x1f20, 0x1f45, L},
{0x1f48, 0x1f4d, L},
{0x1f50, 0x1f57, L},
{0x1f59, 0x1f59, L},
{0x1f5b, 0x1f5b, L},
{0x1f5d, 0x1f5d, L},
{0x1f5f, 0x1f7d, L},
{0x1f80, 0x1fb4, L},
{0x1fb6, 0x1fbc, L},
{0x1fbe, 0x1fbe, L},
{0x1fc2, 0x1fc4, L},
{0x1fc6, 0x1fcc, L},
{0x1fd0, 0x1fd3, L},
{0x1fd6, 0x1fdb, L},
{0x1fe0, 0x1fec, L},
{0x1ff2, 0x1ff4, L},
{0x1ff6, 0x1ffc, L},
{0x2000, 0x200a, WS},
{0x200b, 0x200d, BN},
{0x200e, 0x200e, L},
{0x200f, 0x200f, R},
{0x2028, 0x2028, WS},
{0x2029, 0x2029, B},
{0x202a, 0x202a, LRE},
{0x202b, 0x202b, RLE},
{0x202c, 0x202c, PDF},
{0x202d, 0x202d, LRO},
{0x202e, 0x202e, RLO},
{0x202f, 0x202f, WS},
{0x2030, 0x2034, ET},
{0x2044, 0x2044, CS},
{0x205f, 0x205f, WS},
{0x2060, 0x2063, BN},
{0x206a, 0x206f, BN},
{0x2070, 0x2070, EN},
{0x2071, 0x2071, L},
{0x2074, 0x2079, EN},
{0x207a, 0x207b, ET},
{0x207f, 0x207f, L},
{0x2080, 0x2089, EN},
{0x208a, 0x208b, ET},
{0x20a0, 0x20b1, ET},
{0x20d0, 0x20ea, NSM},
{0x2102, 0x2102, L},
{0x2107, 0x2107, L},
{0x210a, 0x2113, L},
{0x2115, 0x2115, L},
{0x2119, 0x211d, L},
{0x2124, 0x2124, L},
{0x2126, 0x2126, L},
{0x2128, 0x2128, L},
{0x212a, 0x212d, L},
{0x212e, 0x212e, ET},
{0x212f, 0x2131, L},
{0x2133, 0x2139, L},
{0x213d, 0x213f, L},
{0x2145, 0x2149, L},
{0x2160, 0x2183, L},
{0x2212, 0x2213, ET},
{0x2336, 0x237a, L},
{0x2395, 0x2395, L},
{0x2488, 0x249b, EN},
{0x249c, 0x24e9, L},
{0x2800, 0x28ff, L},
{0x3000, 0x3000, WS},
{0x3005, 0x3007, L},
{0x3021, 0x3029, L},
{0x302a, 0x302f, NSM},
{0x3031, 0x3035, L},
{0x3038, 0x303c, L},
{0x3041, 0x3096, L},
{0x3099, 0x309a, NSM},
{0x309d, 0x309f, L},
{0x30a1, 0x30fa, L},
{0x30fc, 0x30ff, L},
{0x3105, 0x312c, L},
{0x3131, 0x318e, L},
{0x3190, 0x31b7, L},
{0x31f0, 0x321c, L},
{0x3220, 0x3243, L},
{0x3260, 0x327b, L},
{0x327f, 0x32b0, L},
{0x32c0, 0x32cb, L},
{0x32d0, 0x32fe, L},
{0x3300, 0x3376, L},
{0x337b, 0x33dd, L},
{0x33e0, 0x33fe, L},
{0x3400, 0x4db5, L},
{0x4e00, 0x9fa5, L},
{0xa000, 0xa48c, L},
{0xac00, 0xd7a3, L},
{0xd800, 0xdff7, L},
{0xe000, 0xfa2d, L},
{0xfa30, 0xfa6a, L},
{0xfb00, 0xfb06, L},
{0xfb13, 0xfb17, L},
{0xfb1d, 0xfb1d, R},
{0xfb1e, 0xfb1e, NSM},
{0xfb1f, 0xfb28, R},
{0xfb29, 0xfb29, ET},
{0xfb2a, 0xfb36, R},
{0xfb38, 0xfb3c, R},
{0xfb3e, 0xfb3e, R},
{0xfb40, 0xfb41, R},
{0xfb43, 0xfb44, R},
{0xfb46, 0xfb4f, R},
{0xfb50, 0xfbb1, AL},
{0xfbd3, 0xfd3d, AL},
{0xfd50, 0xfd8f, AL},
{0xfd92, 0xfdc7, AL},
{0xfdf0, 0xfdfc, AL},
{0xfe00, 0xfe0f, NSM},
{0xfe20, 0xfe23, NSM},
{0xfe50, 0xfe50, CS},
{0xfe52, 0xfe52, CS},
{0xfe55, 0xfe55, CS},
{0xfe5f, 0xfe5f, ET},
{0xfe62, 0xfe63, ET},
{0xfe69, 0xfe6a, ET},
{0xfe70, 0xfe74, AL},
{0xfe76, 0xfefc, AL},
{0xfeff, 0xfeff, BN},
{0xff03, 0xff05, ET},
{0xff0b, 0xff0b, ET},
{0xff0c, 0xff0c, CS},
{0xff0d, 0xff0d, ET},
{0xff0e, 0xff0e, CS},
{0xff0f, 0xff0f, ES},
{0xff10, 0xff19, EN},
{0xff1a, 0xff1a, CS},
{0xff21, 0xff3a, L},
{0xff41, 0xff5a, L},
{0xff66, 0xffbe, L},
{0xffc2, 0xffc7, L},
{0xffca, 0xffcf, L},
{0xffd2, 0xffd7, L},
{0xffda, 0xffdc, L},
{0xffe0, 0xffe1, ET},
{0xffe5, 0xffe6, ET},
{0x10000, 0x1000b, L},
{0x1000d, 0x10026, L},
{0x10028, 0x1003a, L},
{0x1003c, 0x1003d, L},
{0x1003f, 0x1004d, L},
{0x10050, 0x1005d, L},
{0x10080, 0x100fa, L},
{0x10100, 0x10100, L},
{0x10102, 0x10102, L},
{0x10107, 0x10133, L},
{0x10137, 0x1013f, L},
{0x10300, 0x1031e, L},
{0x10320, 0x10323, L},
{0x10330, 0x1034a, L},
{0x10380, 0x1039d, L},
{0x1039f, 0x1039f, L},
{0x10400, 0x1049d, L},
{0x104a0, 0x104a9, L},
{0x10800, 0x10805, R},
{0x10808, 0x10808, R},
{0x1080a, 0x10835, R},
{0x10837, 0x10838, R},
{0x1083c, 0x1083c, R},
{0x1083f, 0x1083f, R},
{0x1d000, 0x1d0f5, L},
{0x1d100, 0x1d126, L},
{0x1d12a, 0x1d166, L},
{0x1d167, 0x1d169, NSM},
{0x1d16a, 0x1d172, L},
{0x1d173, 0x1d17a, BN},
{0x1d17b, 0x1d182, NSM},
{0x1d183, 0x1d184, L},
{0x1d185, 0x1d18b, NSM},
{0x1d18c, 0x1d1a9, L},
{0x1d1aa, 0x1d1ad, NSM},
{0x1d1ae, 0x1d1dd, L},
{0x1d400, 0x1d454, L},
{0x1d456, 0x1d49c, L},
{0x1d49e, 0x1d49f, L},
{0x1d4a2, 0x1d4a2, L},
{0x1d4a5, 0x1d4a6, L},
{0x1d4a9, 0x1d4ac, L},
{0x1d4ae, 0x1d4b9, L},
{0x1d4bb, 0x1d4bb, L},
{0x1d4bd, 0x1d4c3, L},
{0x1d4c5, 0x1d505, L},
{0x1d507, 0x1d50a, L},
{0x1d50d, 0x1d514, L},
{0x1d516, 0x1d51c, L},
{0x1d51e, 0x1d539, L},
{0x1d53b, 0x1d53e, L},
{0x1d540, 0x1d544, L},
{0x1d546, 0x1d546, L},
{0x1d54a, 0x1d550, L},
{0x1d552, 0x1d6a3, L},
{0x1d6a8, 0x1d7c9, L},
{0x1d7ce, 0x1d7ff, EN},
{0x20000, 0x2a6d6, L},
{0x2f800, 0x2fa1d, L},
{0xe0001, 0xe0001, BN},
{0xe0020, 0xe007f, BN},
{0xe0100, 0xe01ef, NSM},
{0xf0000, 0xffffd, L},
{0x100000, 0x10fffd, L}
};
int i, j, k;
i = -1;
j = lenof(lookup);
while (j - i > 1) {
k = (i + j) / 2;
if (ch < lookup[k].first)
j = k;
else if (ch > lookup[k].last)
i = k;
else
return lookup[k].type;
}
/*
* If we reach here, the character was not in any of the
* intervals listed in the lookup table. This means we return
* ON (`Other Neutrals'). This is the appropriate code for any
* character genuinely not listed in the Unicode table, and
* also the table above has deliberately left out any
* characters _explicitly_ listed as ON (to save space!).
*/
return ON;
}
/*
* Function exported to front ends to allow them to identify
* bidi-active characters (in case, for example, the platform's
* text display function can't conveniently be prevented from doing
* its own bidi and so special treatment is required for characters
* that would cause the bidi algorithm to activate).
*
* This function is passed a single Unicode code point, and returns
* nonzero if the presence of this code point can possibly cause
* the bidi algorithm to do any reordering. Thus, any string
* composed entirely of characters for which is_rtl() returns zero
* should be safe to pass to a bidi-active platform display
* function without fear.
*
* (is_rtl() must therefore also return true for any character
* which would be affected by Arabic shaping, but this isn't
* important because all such characters are right-to-left so it
* would have flagged them anyway.)
*/
bool is_rtl(int c)
{
/*
* After careful reading of the Unicode bidi algorithm (URL as
* given at the top of this file) I believe that the only
* character classes which can possibly cause trouble are R,
* AL, RLE and RLO. I think that any string containing no
* character in any of those classes will be displayed
* uniformly left-to-right by the Unicode bidi algorithm.
*/
const int mask = (1<<R) | (1<<AL) | (1<<RLE) | (1<<RLO);
return mask & (1 << (getType(c)));
}
/*
* The most significant 2 bits of each level are used to store
* Override status of each character
* This function sets the override bits of level according
* to the value in override, and reurns the new byte.
*/
static unsigned char setOverrideBits(
unsigned char level, unsigned char override)
{
if (override == ON)
return level;
else if (override == R)
return level | OISR;
else if (override == L)
return level | OISL;
return level;
}
/*
* Find the most recent run of the same value in `level', and
* return the value _before_ it. Used to process U+202C POP
* DIRECTIONAL FORMATTING.
*/
static int getPreviousLevel(unsigned char *level, int from)
{
if (from > 0) {
unsigned char current = level[--from];
while (from >= 0 && level[from] == current)
from--;
if (from >= 0)
return level[from];
return -1;
} else
return -1;
}
/* The Main shaping function, and the only one to be used
* by the outside world.
*
* line: buffer to apply shaping to. this must be passed by doBidi() first
* to: output buffer for the shaped data
* count: number of characters in line
*/
int do_shape(bidi_char *line, bidi_char *to, int count)
{
int i, tempShape;
bool ligFlag = false;
for (i=0; i<count; i++) {
to[i] = line[i];
tempShape = STYPE(line[i].wc);
switch (tempShape) {
case SC:
break;
case SU:
break;
case SR:
tempShape = (i+1 < count ? STYPE(line[i+1].wc) : SU);
if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC))
to[i].wc = SFINAL((SISOLATED(line[i].wc)));
else
to[i].wc = SISOLATED(line[i].wc);
break;
case SD:
/* Make Ligatures */
tempShape = (i+1 < count ? STYPE(line[i+1].wc) : SU);
if (line[i].wc == 0x644) {
if (i > 0) switch (line[i-1].wc) {
case 0x622:
ligFlag = true;
if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC))
to[i].wc = 0xFEF6;
else
to[i].wc = 0xFEF5;
break;
case 0x623:
ligFlag = true;
if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC))
to[i].wc = 0xFEF8;
else
to[i].wc = 0xFEF7;
break;
case 0x625:
ligFlag = true;
if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC))
to[i].wc = 0xFEFA;
else
to[i].wc = 0xFEF9;
break;
case 0x627:
ligFlag = true;
if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC))
to[i].wc = 0xFEFC;
else
to[i].wc = 0xFEFB;
break;
}
if (ligFlag) {
to[i-1].wc = 0x20;
ligFlag = false;
break;
}
}
if ((tempShape == SL) || (tempShape == SD) || (tempShape == SC)) {
tempShape = (i > 0 ? STYPE(line[i-1].wc) : SU);
if ((tempShape == SR) || (tempShape == SD) || (tempShape == SC))
to[i].wc = SMEDIAL((SISOLATED(line[i].wc)));
else
to[i].wc = SFINAL((SISOLATED(line[i].wc)));
break;
}
tempShape = (i > 0 ? STYPE(line[i-1].wc) : SU);
if ((tempShape == SR) || (tempShape == SD) || (tempShape == SC))
to[i].wc = SINITIAL((SISOLATED(line[i].wc)));
else
to[i].wc = SISOLATED(line[i].wc);
break;
}
}
return 1;
}
/*
* The Main Bidi Function, and the only function that should
* be used by the outside world.
*
* line: a buffer of size count containing text to apply
* the Bidirectional algorithm to.
*/
int do_bidi(bidi_char *line, int count)
{
unsigned char* types;
unsigned char* levels;
unsigned char paragraphLevel;
unsigned char currentEmbedding;
unsigned char currentOverride;
unsigned char tempType;
int i, j;
bool yes, bover;
/* Check the presence of R or AL types as optimization */
yes = false;
for (i=0; i<count; i++) {
int type = getType(line[i].wc);
if (type == R || type == AL) {
yes = true;
break;
}
}
if (!yes)
return L;
/* Initialize types, levels */
types = snewn(count, unsigned char);
levels = snewn(count, unsigned char);
/* Rule (P1) NOT IMPLEMENTED
* P1. Split the text into separate paragraphs. A paragraph separator is
* kept with the previous paragraph. Within each paragraph, apply all the
* other rules of this algorithm.
*/
/* Rule (P2), (P3)
* P2. In each paragraph, find the first character of type L, AL, or R.
* P3. If a character is found in P2 and it is of type AL or R, then set
* the paragraph embedding level to one; otherwise, set it to zero.
*/
paragraphLevel = 0;
for (i=0; i<count ; i++) {
int type = getType(line[i].wc);
if (type == R || type == AL) {
paragraphLevel = 1;
break;
} else if (type == L)
break;
}
/* Rule (X1)
* X1. Begin by setting the current embedding level to the paragraph
* embedding level. Set the directional override status to neutral.
*/
currentEmbedding = paragraphLevel;
currentOverride = ON;
/* Rule (X2), (X3), (X4), (X5), (X6), (X7), (X8)
* X2. With each RLE, compute the least greater odd embedding level.
* X3. With each LRE, compute the least greater even embedding level.
* X4. With each RLO, compute the least greater odd embedding level.
* X5. With each LRO, compute the least greater even embedding level.
* X6. For all types besides RLE, LRE, RLO, LRO, and PDF:
* a. Set the level of the current character to the current
* embedding level.
* b. Whenever the directional override status is not neutral,
* reset the current character type to the directional
* override status.
* X7. With each PDF, determine the matching embedding or override code.
* If there was a valid matching code, restore (pop) the last
* remembered (pushed) embedding level and directional override.
* X8. All explicit directional embeddings and overrides are completely
* terminated at the end of each paragraph. Paragraph separators are not
* included in the embedding. (Useless here) NOT IMPLEMENTED
*/
bover = false;
for (i=0; i<count; i++) {
tempType = getType(line[i].wc);
switch (tempType) {
case RLE:
currentEmbedding = levels[i] = leastGreaterOdd(currentEmbedding);
levels[i] = setOverrideBits(levels[i], currentOverride);
currentOverride = ON;
break;
case LRE:
currentEmbedding = levels[i] = leastGreaterEven(currentEmbedding);
levels[i] = setOverrideBits(levels[i], currentOverride);
currentOverride = ON;
break;
case RLO:
currentEmbedding = levels[i] = leastGreaterOdd(currentEmbedding);
tempType = currentOverride = R;
bover = true;
break;
case LRO:
currentEmbedding = levels[i] = leastGreaterEven(currentEmbedding);
tempType = currentOverride = L;
bover = true;
break;
case PDF: {
int prevlevel = getPreviousLevel(levels, i);
if (prevlevel == -1) {
currentEmbedding = paragraphLevel;
currentOverride = ON;
} else {
currentOverride = currentEmbedding & OMASK;
currentEmbedding = currentEmbedding & ~OMASK;
}
levels[i] = currentEmbedding;
break;
}
/* Whitespace is treated as neutral for now */
case WS:
case S:
levels[i] = currentEmbedding;
tempType = ON;
if (currentOverride != ON)
tempType = currentOverride;
break;
default:
levels[i] = currentEmbedding;
if (currentOverride != ON)
tempType = currentOverride;
break;
}
types[i] = tempType;
}
/* this clears out all overrides, so we can use levels safely... */
/* checks bover first */
if (bover)
for (i=0; i<count; i++)
levels[i] = levels[i] & LMASK;
/* Rule (X9)
* X9. Remove all RLE, LRE, RLO, LRO, PDF, and BN codes.
* Here, they're converted to BN.
*/
for (i=0; i<count; i++) {
switch (types[i]) {
case RLE:
case LRE:
case RLO:
case LRO:
case PDF:
types[i] = BN;
break;
}
}
/* Rule (W1)
* W1. Examine each non-spacing mark (NSM) in the level run, and change
* the type of the NSM to the type of the previous character. If the NSM
* is at the start of the level run, it will get the type of sor.
*/
if (types[0] == NSM)
types[0] = paragraphLevel;
for (i=1; i<count; i++) {
if (types[i] == NSM)
types[i] = types[i-1];
/* Is this a safe assumption?
* I assumed the previous, IS a character.
*/
}
/* Rule (W2)
* W2. Search backwards from each instance of a European number until the
* first strong type (R, L, AL, or sor) is found. If an AL is found,
* change the type of the European number to Arabic number.
*/
for (i=0; i<count; i++) {
if (types[i] == EN) {
j=i;
while (j >= 0) {
if (types[j] == AL) {
types[i] = AN;
break;
} else if (types[j] == R || types[j] == L) {
break;
}
j--;
}
}
}
/* Rule (W3)
* W3. Change all ALs to R.
*
* Optimization: on Rule Xn, we might set a flag on AL type
* to prevent this loop in L R lines only...
*/
for (i=0; i<count; i++) {
if (types[i] == AL)
types[i] = R;
}
/* Rule (W4)
* W4. A single European separator between two European numbers changes
* to a European number. A single common separator between two numbers
* of the same type changes to that type.
*/
for (i=1; i<(count-1); i++) {
if (types[i] == ES) {
if (types[i-1] == EN && types[i+1] == EN)
types[i] = EN;
} else if (types[i] == CS) {
if (types[i-1] == EN && types[i+1] == EN)
types[i] = EN;
else if (types[i-1] == AN && types[i+1] == AN)
types[i] = AN;
}
}
/* Rule (W5)
* W5. A sequence of European terminators adjacent to European numbers
* changes to all European numbers.
*
* Optimization: lots here... else ifs need rearrangement
*/
for (i=0; i<count; i++) {
if (types[i] == ET) {
if (i > 0 && types[i-1] == EN) {
types[i] = EN;
continue;
} else if (i < count-1 && types[i+1] == EN) {
types[i] = EN;
continue;
} else if (i < count-1 && types[i+1] == ET) {
j=i;
while (j < count-1 && types[j] == ET) {
j++;
}
if (types[j] == EN)
types[i] = EN;
}
}
}
/* Rule (W6)
* W6. Otherwise, separators and terminators change to Other Neutral:
*/
for (i=0; i<count; i++) {
switch (types[i]) {
case ES:
case ET:
case CS:
types[i] = ON;
break;
}
}
/* Rule (W7)
* W7. Search backwards from each instance of a European number until
* the first strong type (R, L, or sor) is found. If an L is found,
* then change the type of the European number to L.
*/
for (i=0; i<count; i++) {
if (types[i] == EN) {
j=i;
while (j >= 0) {
if (types[j] == L) {
types[i] = L;
break;
} else if (types[j] == R || types[j] == AL) {
break;
}
j--;
}
}
}
/* Rule (N1)
* N1. A sequence of neutrals takes the direction of the surrounding
* strong text if the text on both sides has the same direction. European
* and Arabic numbers are treated as though they were R.
*/
if (count >= 2 && types[0] == ON) {
if ((types[1] == R) || (types[1] == EN) || (types[1] == AN))
types[0] = R;
else if (types[1] == L)
types[0] = L;
}
for (i=1; i<(count-1); i++) {
if (types[i] == ON) {
if (types[i-1] == L) {
j=i;
while (j<(count-1) && types[j] == ON) {
j++;
}
if (types[j] == L) {
while (i<j) {
types[i] = L;
i++;
}
}
} else if ((types[i-1] == R) ||
(types[i-1] == EN) ||
(types[i-1] == AN)) {
j=i;
while (j<(count-1) && types[j] == ON) {
j++;
}
if ((types[j] == R) ||
(types[j] == EN) ||
(types[j] == AN)) {
while (i<j) {
types[i] = R;
i++;
}
}
}
}
}
if (count >= 2 && types[count-1] == ON) {
if (types[count-2] == R || types[count-2] == EN || types[count-2] == AN)
types[count-1] = R;
else if (types[count-2] == L)
types[count-1] = L;
}
/* Rule (N2)
* N2. Any remaining neutrals take the embedding direction.
*/
for (i=0; i<count; i++) {
if (types[i] == ON) {
if ((levels[i] % 2) == 0)
types[i] = L;
else
types[i] = R;
}
}
/* Rule (I1)
* I1. For all characters with an even (left-to-right) embedding
* direction, those of type R go up one level and those of type AN or
* EN go up two levels.
*/
for (i=0; i<count; i++) {
if ((levels[i] % 2) == 0) {
if (types[i] == R)
levels[i] += 1;
else if (types[i] == AN || types[i] == EN)
levels[i] += 2;
}
}
/* Rule (I2)
* I2. For all characters with an odd (right-to-left) embedding direction,
* those of type L, EN or AN go up one level.
*/
for (i=0; i<count; i++) {
if ((levels[i] % 2) == 1) {
if (types[i] == L || types[i] == EN || types[i] == AN)
levels[i] += 1;
}
}
/* Rule (L1)
* L1. On each line, reset the embedding level of the following characters
* to the paragraph embedding level:
* (1)segment separators, (2)paragraph separators,
* (3)any sequence of whitespace characters preceding
* a segment separator or paragraph separator,
* (4)and any sequence of white space characters
* at the end of the line.
* The types of characters used here are the original types, not those
* modified by the previous phase.
*/
j=count-1;
while (j>0 && (getType(line[j].wc) == WS)) {
j--;
}
if (j < (count-1)) {
for (j++; j<count; j++)
levels[j] = paragraphLevel;
}
for (i=0; i<count; i++) {
tempType = getType(line[i].wc);
if (tempType == WS) {
j=i;
while (j<count && (getType(line[j].wc) == WS)) {
j++;
}
if (j==count || getType(line[j].wc) == B ||
getType(line[j].wc) == S) {
for (j--; j>=i ; j--) {
levels[j] = paragraphLevel;
}
}
} else if (tempType == B || tempType == S) {
levels[i] = paragraphLevel;
}
}
/* Rule (L4) NOT IMPLEMENTED
* L4. A character that possesses the mirrored property as specified by
* Section 4.7, Mirrored, must be depicted by a mirrored glyph if the
* resolved directionality of that character is R.
*/
/* Note: this is implemented before L2 for efficiency */
for (i=0; i<count; i++)
if ((levels[i] % 2) == 1)
doMirror(&line[i].wc);
/* Rule (L2)
* L2. From the highest level found in the text to the lowest odd level on
* each line, including intermediate levels not actually present in the
* text, reverse any contiguous sequence of characters that are at that
* level or higher
*/
/* we flip the character string and leave the level array */
i=0;
tempType = levels[0];
while (i < count) {
if (levels[i] > tempType)
tempType = levels[i];
i++;
}
/* maximum level in tempType. */
while (tempType > 0) { /* loop from highest level to the least odd, */
/* which i assume is 1 */
flipThisRun(line, levels, tempType, count);
tempType--;
}
/* Rule (L3) NOT IMPLEMENTED
* L3. Combining marks applied to a right-to-left base character will at
* this point precede their base character. If the rendering engine
* expects them to follow the base characters in the final display
* process, then the ordering of the marks and the base character must
* be reversed.
*/
sfree(types);
sfree(levels);
return R;
}
/*
* Bad, Horrible function
* takes a pointer to a character that is checked for
* having a mirror glyph.
*/
static void doMirror(unsigned int *ch)
{
if ((*ch & 0xFF00) == 0) {
switch (*ch) {
case 0x0028: *ch = 0x0029; break;
case 0x0029: *ch = 0x0028; break;
case 0x003C: *ch = 0x003E; break;
case 0x003E: *ch = 0x003C; break;
case 0x005B: *ch = 0x005D; break;
case 0x005D: *ch = 0x005B; break;
case 0x007B: *ch = 0x007D; break;
case 0x007D: *ch = 0x007B; break;
case 0x00AB: *ch = 0x00BB; break;
case 0x00BB: *ch = 0x00AB; break;
}
} else if ((*ch & 0xFF00) == 0x2000) {
switch (*ch) {
case 0x2039: *ch = 0x203A; break;
case 0x203A: *ch = 0x2039; break;
case 0x2045: *ch = 0x2046; break;
case 0x2046: *ch = 0x2045; break;
case 0x207D: *ch = 0x207E; break;
case 0x207E: *ch = 0x207D; break;
case 0x208D: *ch = 0x208E; break;
case 0x208E: *ch = 0x208D; break;
}
} else if ((*ch & 0xFF00) == 0x2200) {
switch (*ch) {
case 0x2208: *ch = 0x220B; break;
case 0x2209: *ch = 0x220C; break;
case 0x220A: *ch = 0x220D; break;
case 0x220B: *ch = 0x2208; break;
case 0x220C: *ch = 0x2209; break;
case 0x220D: *ch = 0x220A; break;
case 0x2215: *ch = 0x29F5; break;
case 0x223C: *ch = 0x223D; break;
case 0x223D: *ch = 0x223C; break;
case 0x2243: *ch = 0x22CD; break;
case 0x2252: *ch = 0x2253; break;
case 0x2253: *ch = 0x2252; break;
case 0x2254: *ch = 0x2255; break;
case 0x2255: *ch = 0x2254; break;
case 0x2264: *ch = 0x2265; break;
case 0x2265: *ch = 0x2264; break;
case 0x2266: *ch = 0x2267; break;
case 0x2267: *ch = 0x2266; break;
case 0x2268: *ch = 0x2269; break;
case 0x2269: *ch = 0x2268; break;
case 0x226A: *ch = 0x226B; break;
case 0x226B: *ch = 0x226A; break;
case 0x226E: *ch = 0x226F; break;
case 0x226F: *ch = 0x226E; break;
case 0x2270: *ch = 0x2271; break;
case 0x2271: *ch = 0x2270; break;
case 0x2272: *ch = 0x2273; break;
case 0x2273: *ch = 0x2272; break;
case 0x2274: *ch = 0x2275; break;
case 0x2275: *ch = 0x2274; break;
case 0x2276: *ch = 0x2277; break;
case 0x2277: *ch = 0x2276; break;
case 0x2278: *ch = 0x2279; break;
case 0x2279: *ch = 0x2278; break;
case 0x227A: *ch = 0x227B; break;
case 0x227B: *ch = 0x227A; break;
case 0x227C: *ch = 0x227D; break;
case 0x227D: *ch = 0x227C; break;
case 0x227E: *ch = 0x227F; break;
case 0x227F: *ch = 0x227E; break;
case 0x2280: *ch = 0x2281; break;
case 0x2281: *ch = 0x2280; break;
case 0x2282: *ch = 0x2283; break;
case 0x2283: *ch = 0x2282; break;
case 0x2284: *ch = 0x2285; break;
case 0x2285: *ch = 0x2284; break;
case 0x2286: *ch = 0x2287; break;
case 0x2287: *ch = 0x2286; break;
case 0x2288: *ch = 0x2289; break;
case 0x2289: *ch = 0x2288; break;
case 0x228A: *ch = 0x228B; break;
case 0x228B: *ch = 0x228A; break;
case 0x228F: *ch = 0x2290; break;
case 0x2290: *ch = 0x228F; break;
case 0x2291: *ch = 0x2292; break;
case 0x2292: *ch = 0x2291; break;
case 0x2298: *ch = 0x29B8; break;
case 0x22A2: *ch = 0x22A3; break;
case 0x22A3: *ch = 0x22A2; break;
case 0x22A6: *ch = 0x2ADE; break;
case 0x22A8: *ch = 0x2AE4; break;
case 0x22A9: *ch = 0x2AE3; break;
case 0x22AB: *ch = 0x2AE5; break;
case 0x22B0: *ch = 0x22B1; break;
case 0x22B1: *ch = 0x22B0; break;
case 0x22B2: *ch = 0x22B3; break;
case 0x22B3: *ch = 0x22B2; break;
case 0x22B4: *ch = 0x22B5; break;
case 0x22B5: *ch = 0x22B4; break;
case 0x22B6: *ch = 0x22B7; break;
case 0x22B7: *ch = 0x22B6; break;
case 0x22C9: *ch = 0x22CA; break;
case 0x22CA: *ch = 0x22C9; break;
case 0x22CB: *ch = 0x22CC; break;
case 0x22CC: *ch = 0x22CB; break;
case 0x22CD: *ch = 0x2243; break;
case 0x22D0: *ch = 0x22D1; break;
case 0x22D1: *ch = 0x22D0; break;
case 0x22D6: *ch = 0x22D7; break;
case 0x22D7: *ch = 0x22D6; break;
case 0x22D8: *ch = 0x22D9; break;
case 0x22D9: *ch = 0x22D8; break;
case 0x22DA: *ch = 0x22DB; break;
case 0x22DB: *ch = 0x22DA; break;
case 0x22DC: *ch = 0x22DD; break;
case 0x22DD: *ch = 0x22DC; break;
case 0x22DE: *ch = 0x22DF; break;
case 0x22DF: *ch = 0x22DE; break;
case 0x22E0: *ch = 0x22E1; break;
case 0x22E1: *ch = 0x22E0; break;
case 0x22E2: *ch = 0x22E3; break;
case 0x22E3: *ch = 0x22E2; break;
case 0x22E4: *ch = 0x22E5; break;
case 0x22E5: *ch = 0x22E4; break;
case 0x22E6: *ch = 0x22E7; break;
case 0x22E7: *ch = 0x22E6; break;
case 0x22E8: *ch = 0x22E9; break;
case 0x22E9: *ch = 0x22E8; break;
case 0x22EA: *ch = 0x22EB; break;
case 0x22EB: *ch = 0x22EA; break;
case 0x22EC: *ch = 0x22ED; break;
case 0x22ED: *ch = 0x22EC; break;
case 0x22F0: *ch = 0x22F1; break;
case 0x22F1: *ch = 0x22F0; break;
case 0x22F2: *ch = 0x22FA; break;
case 0x22F3: *ch = 0x22FB; break;
case 0x22F4: *ch = 0x22FC; break;
case 0x22F6: *ch = 0x22FD; break;
case 0x22F7: *ch = 0x22FE; break;
case 0x22FA: *ch = 0x22F2; break;
case 0x22FB: *ch = 0x22F3; break;
case 0x22FC: *ch = 0x22F4; break;
case 0x22FD: *ch = 0x22F6; break;
case 0x22FE: *ch = 0x22F7; break;
}
} else if ((*ch & 0xFF00) == 0x2300) {
switch (*ch) {
case 0x2308: *ch = 0x2309; break;
case 0x2309: *ch = 0x2308; break;
case 0x230A: *ch = 0x230B; break;
case 0x230B: *ch = 0x230A; break;
case 0x2329: *ch = 0x232A; break;
case 0x232A: *ch = 0x2329; break;
}
} else if ((*ch & 0xFF00) == 0x2700) {
switch (*ch) {
case 0x2768: *ch = 0x2769; break;
case 0x2769: *ch = 0x2768; break;
case 0x276A: *ch = 0x276B; break;
case 0x276B: *ch = 0x276A; break;
case 0x276C: *ch = 0x276D; break;
case 0x276D: *ch = 0x276C; break;
case 0x276E: *ch = 0x276F; break;
case 0x276F: *ch = 0x276E; break;
case 0x2770: *ch = 0x2771; break;
case 0x2771: *ch = 0x2770; break;
case 0x2772: *ch = 0x2773; break;
case 0x2773: *ch = 0x2772; break;
case 0x2774: *ch = 0x2775; break;
case 0x2775: *ch = 0x2774; break;
case 0x27D5: *ch = 0x27D6; break;
case 0x27D6: *ch = 0x27D5; break;
case 0x27DD: *ch = 0x27DE; break;
case 0x27DE: *ch = 0x27DD; break;
case 0x27E2: *ch = 0x27E3; break;
case 0x27E3: *ch = 0x27E2; break;
case 0x27E4: *ch = 0x27E5; break;
case 0x27E5: *ch = 0x27E4; break;
case 0x27E6: *ch = 0x27E7; break;
case 0x27E7: *ch = 0x27E6; break;
case 0x27E8: *ch = 0x27E9; break;
case 0x27E9: *ch = 0x27E8; break;
case 0x27EA: *ch = 0x27EB; break;
case 0x27EB: *ch = 0x27EA; break;
}
} else if ((*ch & 0xFF00) == 0x2900) {
switch (*ch) {
case 0x2983: *ch = 0x2984; break;
case 0x2984: *ch = 0x2983; break;
case 0x2985: *ch = 0x2986; break;
case 0x2986: *ch = 0x2985; break;
case 0x2987: *ch = 0x2988; break;
case 0x2988: *ch = 0x2987; break;
case 0x2989: *ch = 0x298A; break;
case 0x298A: *ch = 0x2989; break;
case 0x298B: *ch = 0x298C; break;
case 0x298C: *ch = 0x298B; break;
case 0x298D: *ch = 0x2990; break;
case 0x298E: *ch = 0x298F; break;
case 0x298F: *ch = 0x298E; break;
case 0x2990: *ch = 0x298D; break;
case 0x2991: *ch = 0x2992; break;
case 0x2992: *ch = 0x2991; break;
case 0x2993: *ch = 0x2994; break;
case 0x2994: *ch = 0x2993; break;
case 0x2995: *ch = 0x2996; break;
case 0x2996: *ch = 0x2995; break;
case 0x2997: *ch = 0x2998; break;
case 0x2998: *ch = 0x2997; break;
case 0x29B8: *ch = 0x2298; break;
case 0x29C0: *ch = 0x29C1; break;
case 0x29C1: *ch = 0x29C0; break;
case 0x29C4: *ch = 0x29C5; break;
case 0x29C5: *ch = 0x29C4; break;
case 0x29CF: *ch = 0x29D0; break;
case 0x29D0: *ch = 0x29CF; break;
case 0x29D1: *ch = 0x29D2; break;
case 0x29D2: *ch = 0x29D1; break;
case 0x29D4: *ch = 0x29D5; break;
case 0x29D5: *ch = 0x29D4; break;
case 0x29D8: *ch = 0x29D9; break;
case 0x29D9: *ch = 0x29D8; break;
case 0x29DA: *ch = 0x29DB; break;
case 0x29DB: *ch = 0x29DA; break;
case 0x29F5: *ch = 0x2215; break;
case 0x29F8: *ch = 0x29F9; break;
case 0x29F9: *ch = 0x29F8; break;
case 0x29FC: *ch = 0x29FD; break;
case 0x29FD: *ch = 0x29FC; break;
}
} else if ((*ch & 0xFF00) == 0x2A00) {
switch (*ch) {
case 0x2A2B: *ch = 0x2A2C; break;
case 0x2A2C: *ch = 0x2A2B; break;
case 0x2A2D: *ch = 0x2A2C; break;
case 0x2A2E: *ch = 0x2A2D; break;
case 0x2A34: *ch = 0x2A35; break;
case 0x2A35: *ch = 0x2A34; break;
case 0x2A3C: *ch = 0x2A3D; break;
case 0x2A3D: *ch = 0x2A3C; break;
case 0x2A64: *ch = 0x2A65; break;
case 0x2A65: *ch = 0x2A64; break;
case 0x2A79: *ch = 0x2A7A; break;
case 0x2A7A: *ch = 0x2A79; break;
case 0x2A7D: *ch = 0x2A7E; break;
case 0x2A7E: *ch = 0x2A7D; break;
case 0x2A7F: *ch = 0x2A80; break;
case 0x2A80: *ch = 0x2A7F; break;
case 0x2A81: *ch = 0x2A82; break;
case 0x2A82: *ch = 0x2A81; break;
case 0x2A83: *ch = 0x2A84; break;
case 0x2A84: *ch = 0x2A83; break;
case 0x2A8B: *ch = 0x2A8C; break;
case 0x2A8C: *ch = 0x2A8B; break;
case 0x2A91: *ch = 0x2A92; break;
case 0x2A92: *ch = 0x2A91; break;
case 0x2A93: *ch = 0x2A94; break;
case 0x2A94: *ch = 0x2A93; break;
case 0x2A95: *ch = 0x2A96; break;
case 0x2A96: *ch = 0x2A95; break;
case 0x2A97: *ch = 0x2A98; break;
case 0x2A98: *ch = 0x2A97; break;
case 0x2A99: *ch = 0x2A9A; break;
case 0x2A9A: *ch = 0x2A99; break;
case 0x2A9B: *ch = 0x2A9C; break;
case 0x2A9C: *ch = 0x2A9B; break;
case 0x2AA1: *ch = 0x2AA2; break;
case 0x2AA2: *ch = 0x2AA1; break;
case 0x2AA6: *ch = 0x2AA7; break;
case 0x2AA7: *ch = 0x2AA6; break;
case 0x2AA8: *ch = 0x2AA9; break;
case 0x2AA9: *ch = 0x2AA8; break;
case 0x2AAA: *ch = 0x2AAB; break;
case 0x2AAB: *ch = 0x2AAA; break;
case 0x2AAC: *ch = 0x2AAD; break;
case 0x2AAD: *ch = 0x2AAC; break;
case 0x2AAF: *ch = 0x2AB0; break;
case 0x2AB0: *ch = 0x2AAF; break;
case 0x2AB3: *ch = 0x2AB4; break;
case 0x2AB4: *ch = 0x2AB3; break;
case 0x2ABB: *ch = 0x2ABC; break;
case 0x2ABC: *ch = 0x2ABB; break;
case 0x2ABD: *ch = 0x2ABE; break;
case 0x2ABE: *ch = 0x2ABD; break;
case 0x2ABF: *ch = 0x2AC0; break;
case 0x2AC0: *ch = 0x2ABF; break;
case 0x2AC1: *ch = 0x2AC2; break;
case 0x2AC2: *ch = 0x2AC1; break;
case 0x2AC3: *ch = 0x2AC4; break;
case 0x2AC4: *ch = 0x2AC3; break;
case 0x2AC5: *ch = 0x2AC6; break;
case 0x2AC6: *ch = 0x2AC5; break;
case 0x2ACD: *ch = 0x2ACE; break;
case 0x2ACE: *ch = 0x2ACD; break;
case 0x2ACF: *ch = 0x2AD0; break;
case 0x2AD0: *ch = 0x2ACF; break;
case 0x2AD1: *ch = 0x2AD2; break;
case 0x2AD2: *ch = 0x2AD1; break;
case 0x2AD3: *ch = 0x2AD4; break;
case 0x2AD4: *ch = 0x2AD3; break;
case 0x2AD5: *ch = 0x2AD6; break;
case 0x2AD6: *ch = 0x2AD5; break;
case 0x2ADE: *ch = 0x22A6; break;
case 0x2AE3: *ch = 0x22A9; break;
case 0x2AE4: *ch = 0x22A8; break;
case 0x2AE5: *ch = 0x22AB; break;
case 0x2AEC: *ch = 0x2AED; break;
case 0x2AED: *ch = 0x2AEC; break;
case 0x2AF7: *ch = 0x2AF8; break;
case 0x2AF8: *ch = 0x2AF7; break;
case 0x2AF9: *ch = 0x2AFA; break;
case 0x2AFA: *ch = 0x2AF9; break;
}
} else if ((*ch & 0xFF00) == 0x3000) {
switch (*ch) {
case 0x3008: *ch = 0x3009; break;
case 0x3009: *ch = 0x3008; break;
case 0x300A: *ch = 0x300B; break;
case 0x300B: *ch = 0x300A; break;
case 0x300C: *ch = 0x300D; break;
case 0x300D: *ch = 0x300C; break;
case 0x300E: *ch = 0x300F; break;
case 0x300F: *ch = 0x300E; break;
case 0x3010: *ch = 0x3011; break;
case 0x3011: *ch = 0x3010; break;
case 0x3014: *ch = 0x3015; break;
case 0x3015: *ch = 0x3014; break;
case 0x3016: *ch = 0x3017; break;
case 0x3017: *ch = 0x3016; break;
case 0x3018: *ch = 0x3019; break;
case 0x3019: *ch = 0x3018; break;
case 0x301A: *ch = 0x301B; break;
case 0x301B: *ch = 0x301A; break;
}
} else if ((*ch & 0xFF00) == 0xFF00) {
switch (*ch) {
case 0xFF08: *ch = 0xFF09; break;
case 0xFF09: *ch = 0xFF08; break;
case 0xFF1C: *ch = 0xFF1E; break;
case 0xFF1E: *ch = 0xFF1C; break;
case 0xFF3B: *ch = 0xFF3D; break;
case 0xFF3D: *ch = 0xFF3B; break;
case 0xFF5B: *ch = 0xFF5D; break;
case 0xFF5D: *ch = 0xFF5B; break;
case 0xFF5F: *ch = 0xFF60; break;
case 0xFF60: *ch = 0xFF5F; break;
case 0xFF62: *ch = 0xFF63; break;
case 0xFF63: *ch = 0xFF62; break;
}
}
}
#ifdef TEST_GETTYPE
#include <stdio.h>
#include <assert.h>
int main(int argc, char **argv)
{
static const struct { int type; char *name; } typetoname[] = {
#define TYPETONAME(X) { X , #X }
TYPETONAME(L),
TYPETONAME(LRE),
TYPETONAME(LRO),
TYPETONAME(R),
TYPETONAME(AL),
TYPETONAME(RLE),
TYPETONAME(RLO),
TYPETONAME(PDF),
TYPETONAME(EN),
TYPETONAME(ES),
TYPETONAME(ET),
TYPETONAME(AN),
TYPETONAME(CS),
TYPETONAME(NSM),
TYPETONAME(BN),
TYPETONAME(B),
TYPETONAME(S),
TYPETONAME(WS),
TYPETONAME(ON),
#undef TYPETONAME
};
int i;
for (i = 1; i < argc; i++) {
unsigned long chr = strtoul(argv[i], NULL, 0);
int type = getType(chr);
assert(typetoname[type].type == type);
printf("U+%04x: %s\n", (unsigned)chr, typetoname[type].name);
}
return 0;
}
#endif
|
f99c685a0deea9fb768f12c69e0e42dc43bae96c
|
1890895aacd59a774084201ff55d7bc5a2f40b0f
|
/c/src/dynamixel_sdk/packet_handler.c
|
fe4c00831602453a61718c270fc7236181cf2858
|
[
"Apache-2.0"
] |
permissive
|
ROBOTIS-GIT/DynamixelSDK
|
ae6e9ceb53284cd7f0f4f247a182f6ed9f1d19be
|
3450c7078917b262d9b36042c15444047aae226e
|
refs/heads/master
| 2023-08-29T01:37:10.572910
| 2023-07-28T04:01:53
| 2023-07-28T04:01:53
| 53,405,301
| 438
| 417
|
Apache-2.0
| 2023-07-28T04:01:55
| 2016-03-08T10:57:49
|
C#
|
UTF-8
|
C
| false
| false
| 11,645
|
c
|
packet_handler.c
|
/*******************************************************************************
* Copyright 2017 ROBOTIS CO., LTD.
*
* 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.
*******************************************************************************/
/* Author: Ryu Woon Jung (Leon) */
#include <stdlib.h>
#if defined(__linux__)
#include "packet_handler.h"
#include "protocol1_packet_handler.h"
#include "protocol2_packet_handler.h"
#elif defined(__APPLE__)
#include "packet_handler.h"
#include "protocol1_packet_handler.h"
#include "protocol2_packet_handler.h"
#elif defined(_WIN32) || defined(_WIN64)
#define WINDLLEXPORT
#include "packet_handler.h"
#include "protocol1_packet_handler.h"
#include "protocol2_packet_handler.h"
#endif
void packetHandler()
{
int port_num;
if (packetData == NULL)
packetData = (PacketData*)malloc(1 * sizeof(PacketData));
packetData = (PacketData*)realloc(packetData, g_used_port_num * sizeof(PacketData));
for (port_num = 0; port_num < g_used_port_num; port_num++)
{
packetData[port_num].data_write = (uint8_t *)calloc(1, sizeof(uint8_t));
packetData[port_num].data_read = (uint8_t *)calloc(1, sizeof(uint8_t));
packetData[port_num].tx_packet = (uint8_t *)calloc(1, sizeof(uint8_t));
packetData[port_num].rx_packet = (uint8_t *)calloc(1, sizeof(uint8_t));
packetData[port_num].error = 0;
packetData[port_num].communication_result = 0;
}
}
const char *getTxRxResult(int protocol_version, int result)
{
if (protocol_version == 1)
{
return getTxRxResult1(result);
}
else
{
return getTxRxResult2(result);
}
}
const char *getRxPacketError(int protocol_version, uint8_t error)
{
if (protocol_version == 1)
{
return getRxPacketError1(error);
}
else
{
return getRxPacketError2(error);
}
}
int getLastTxRxResult(int port_num, int protocol_version)
{
if (protocol_version == 1)
{
return getLastTxRxResult1(port_num);
}
else
{
return getLastTxRxResult2(port_num);
}
}
uint8_t getLastRxPacketError(int port_num, int protocol_version)
{
if (protocol_version == 1)
{
return getLastRxPacketError1(port_num);
}
else
{
return getLastRxPacketError2(port_num);
}
}
void setDataWrite(int port_num, int protocol_version, uint16_t data_length, uint16_t data_pos, uint32_t data)
{
if (protocol_version == 1)
{
setDataWrite1(port_num, data_length, data_pos, data);
}
else
{
setDataWrite2(port_num, data_length, data_pos, data);
}
}
uint32_t getDataRead(int port_num, int protocol_version, uint16_t data_length, uint16_t data_pos)
{
if (protocol_version == 1)
{
return getDataRead1(port_num, data_length, data_pos);
}
else
{
return getDataRead2(port_num, data_length, data_pos);
}
}
void txPacket(int port_num, int protocol_version)
{
if (protocol_version == 1)
{
txPacket1(port_num);
}
else
{
txPacket2(port_num);
}
}
void rxPacket(int port_num, int protocol_version)
{
if (protocol_version == 1)
{
rxPacket1(port_num);
}
else
{
rxPacket2(port_num);
}
}
void txRxPacket(int port_num, int protocol_version)
{
if (protocol_version == 1)
{
txRxPacket1(port_num);
}
else
{
txRxPacket2(port_num);
}
}
void ping(int port_num, int protocol_version, uint8_t id)
{
if (protocol_version == 1)
{
ping1(port_num, id);
}
else
{
ping2(port_num, id);
}
}
uint16_t pingGetModelNum(int port_num, int protocol_version, uint8_t id)
{
if (protocol_version == 1)
{
return pingGetModelNum1(port_num, id);
}
else
{
return pingGetModelNum2(port_num, id);
}
}
// broadcastPing
void broadcastPing(int port_num, int protocol_version)
{
if (protocol_version == 1)
{
broadcastPing1(port_num);
}
else
{
broadcastPing2(port_num);
}
}
uint8_t getBroadcastPingResult(int port_num, int protocol_version, int id)
{
if (protocol_version == 1)
{
return getBroadcastPingResult1(port_num, id);
}
else
{
return getBroadcastPingResult2(port_num, id);
}
}
#if defined(__APPLE__)
void rebootDXL(int port_num, int protocol_version, uint8_t id)
#else
void reboot(int port_num, int protocol_version, uint8_t id)
#endif
{
if (protocol_version == 1)
{
reboot1(port_num, id);
}
else
{
reboot2(port_num, id);
}
}
void clearMultiTurn(int port_num, int protocol_version, uint8_t id)
{
if (protocol_version == 1)
{
clearMultiTurn1(port_num, id);
}
else
{
clearMultiTurn2(port_num, id);
}
}
void factoryReset(int port_num, int protocol_version, uint8_t id, uint8_t option)
{
if (protocol_version == 1)
{
factoryReset1(port_num, id, option);
}
else
{
factoryReset2(port_num, id, option);
}
}
void readTx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
{
if (protocol_version == 1)
{
readTx1(port_num, id, address, length);
}
else
{
readTx2(port_num, id, address, length);
}
}
void readRx(int port_num, int protocol_version, uint16_t length)
{
if (protocol_version == 1)
{
readRx1(port_num, length);
}
else
{
readRx2(port_num, length);
}
}
void readTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
{
if (protocol_version == 1)
{
readTxRx1(port_num, id, address, length);
}
else
{
readTxRx2(port_num, id, address, length);
}
}
void read1ByteTx(int port_num, int protocol_version, uint8_t id, uint16_t address)
{
if (protocol_version == 1)
{
read1ByteTx1(port_num, id, address);
}
else
{
read1ByteTx2(port_num, id, address);
}
}
uint8_t read1ByteRx(int port_num, int protocol_version)
{
if (protocol_version == 1)
{
return read1ByteRx1(port_num);
}
else
{
return read1ByteRx2(port_num);
}
}
uint8_t read1ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address)
{
if (protocol_version == 1)
{
return read1ByteTxRx1(port_num, id, address);
}
else
{
return read1ByteTxRx2(port_num, id, address);
}
}
void read2ByteTx(int port_num, int protocol_version, uint8_t id, uint16_t address)
{
if (protocol_version == 1)
{
read2ByteTx1(port_num, id, address);
}
else
{
read2ByteTx2(port_num, id, address);
}
}
uint16_t read2ByteRx(int port_num, int protocol_version)
{
if (protocol_version == 1)
{
return read2ByteRx1(port_num);
}
else
{
return read2ByteRx2(port_num);
}
}
uint16_t read2ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address)
{
if (protocol_version == 1)
{
return read2ByteTxRx1(port_num, id, address);
}
else
{
return read2ByteTxRx2(port_num, id, address);
}
}
void read4ByteTx(int port_num, int protocol_version, uint8_t id, uint16_t address)
{
if (protocol_version == 1)
{
read4ByteTx1(port_num, id, address);
}
else
{
read4ByteTx2(port_num, id, address);
}
}
uint32_t read4ByteRx(int port_num, int protocol_version)
{
if (protocol_version == 1)
{
return read4ByteRx1(port_num);
}
else
{
return read4ByteRx2(port_num);
}
}
uint32_t read4ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address)
{
if (protocol_version == 1)
{
return read4ByteTxRx1(port_num, id, address);
}
else
{
return read4ByteTxRx2(port_num, id, address);
}
}
void writeTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
{
if (protocol_version == 1)
{
writeTxOnly1(port_num, id, address, length);
}
else
{
writeTxOnly2(port_num, id, address, length);
}
}
void writeTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
{
if (protocol_version == 1)
{
writeTxRx1(port_num, id, address, length);
}
else
{
writeTxRx2(port_num, id, address, length);
}
}
void write1ByteTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint8_t data)
{
if (protocol_version == 1)
{
write1ByteTxOnly1(port_num, id, address, data);
}
else
{
write1ByteTxOnly2(port_num, id, address, data);
}
}
void write1ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint8_t data)
{
if (protocol_version == 1)
{
write1ByteTxRx1(port_num, id, address, data);
}
else
{
write1ByteTxRx2(port_num, id, address, data);
}
}
void write2ByteTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t data)
{
if (protocol_version == 1)
{
write2ByteTxOnly1(port_num, id, address, data);
}
else
{
write2ByteTxOnly2(port_num, id, address, data);
}
}
void write2ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t data)
{
if (protocol_version == 1)
{
write2ByteTxRx1(port_num, id, address, data);
}
else
{
write2ByteTxRx2(port_num, id, address, data);
}
}
void write4ByteTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint32_t data)
{
if (protocol_version == 1)
{
write4ByteTxOnly1(port_num, id, address, data);
}
else
{
write4ByteTxOnly2(port_num, id, address, data);
}
}
void write4ByteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint32_t data)
{
if (protocol_version == 1)
{
write4ByteTxRx1(port_num, id, address, data);
}
else
{
write4ByteTxRx2(port_num, id, address, data);
}
}
void regWriteTxOnly(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
{
if (protocol_version == 1)
{
regWriteTxOnly1(port_num, id, address, length);
}
else
{
regWriteTxOnly2(port_num, id, address, length);
}
}
void regWriteTxRx(int port_num, int protocol_version, uint8_t id, uint16_t address, uint16_t length)
{
if (protocol_version == 1)
{
regWriteTxRx1(port_num, id, address, length);
}
else
{
regWriteTxRx2(port_num, id, address, length);
}
}
void syncReadTx(int port_num, int protocol_version, uint16_t start_address, uint16_t data_length, uint16_t param_length)
{
if (protocol_version == 1)
{
syncReadTx1(port_num, start_address, data_length, param_length);
}
else
{
syncReadTx2(port_num, start_address, data_length, param_length);
}
}
// syncReadRx -> GroupSyncRead
// syncReadTxRx -> GroupSyncRead
void syncWriteTxOnly(int port_num, int protocol_version, uint16_t start_address, uint16_t data_length, uint16_t param_length)
{
if (protocol_version == 1)
{
syncWriteTxOnly1(port_num, start_address, data_length, param_length);
}
else
{
syncWriteTxOnly2(port_num, start_address, data_length, param_length);
}
}
void bulkReadTx(int port_num, int protocol_version, uint16_t param_length)
{
if (protocol_version == 1)
{
bulkReadTx1(port_num, param_length);
}
else
{
bulkReadTx2(port_num, param_length);
}
}
// bulkReadRx -> GroupBulkRead
// bulkReadTxRx -> GroupBulkRead
void bulkWriteTxOnly(int port_num, int protocol_version, uint16_t param_length)
{
if (protocol_version == 1)
{
bulkWriteTxOnly1(port_num, param_length);
}
else
{
bulkWriteTxOnly2(port_num, param_length);
}
}
|
8df07dcc3e8b541bf508fdbb6bdb3a4946aa21d4
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/msp432e401y-LaunchPad/libraries/Drivers/CMSIS/Include/cmsis_ccs.h
|
187fab47bbdb7a3b563f5aa701be403557349f8a
|
[
"Apache-2.0",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 13,275
|
h
|
cmsis_ccs.h
|
//*****************************************************************************
//
// Copyright (C) 2012 - 2017 Texas Instruments Incorporated - http://www.ti.com/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// MSP432 Family CMSIS Definitions
//
//****************************************************************************
#ifndef CMSIS_CCS_H_
#define CMSIS_CCS_H_
#ifndef __TI_ARM__
#error This file should only be compiled by TI compiler (minimum version 15.12.x)
#endif
/** CMSIS compiler control architecture macros */
#if defined ( __TI_ARM_V6M0__ )
#define __ARM_ARCH_6M__ 1
#endif
#if defined ( __TI_ARM_V7M3__ )
#define __ARM_ARCH_7M__ 1
#endif
#if defined ( __TI_ARM_V7M4__ )
#define __ARM_ARCH_7EM__ 1
#endif
/* ########################### Core Function Access ########################### */
/** \ingroup CMSIS_Core_FunctionInterface
* \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
* @{
*/
/**
* \brief Enable IRQ Interrupts
* \details Enables IRQ interrupts by clearing the I-bit in the CPSR.
* Can only be executed in Privileged modes.
*/
#define __enable_irq _enable_IRQ
/**
* \brief Disable IRQ Interrupts
* \details Disables IRQ interrupts by setting the I-bit in the CPSR.
* Can only be executed in Privileged modes.
*/
#define __disable_irq _disable_IRQ
/** @} */ /* end of CMSIS_Core_RegAccFunctions */
/* ########################## Core Instruction Access ######################### */
/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
* Access to dedicated instructions
* @{
*/
/**
* \brief Count leading zeros
* \details Counts the number of leading zeros of a data value.
* \param [in] VAL Value to count the leading zeros
* \return number of leading zeros in value
*/
#define __CLZ(VAL) ((unsigned char)__clz(VAL))
/**
* \brief Signed Saturate
* \details Saturates a signed value.
* \param [in] VAL Value to be saturated
* \param [in] BITPOS Bit position to saturate to (1..32)
* \return Saturated value
*/
#define __SSAT(VAL, BITPOS) _ssatl(VAL, 0, BITPOS)
/**
* \brief No Operation
* \details No Operation does nothing. This instruction can be used for code alignment purposes.
*/
#define __NOP __nop
/**
* \brief Wait For Interrupt
* \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
*/
#define __WFI __wfi
/**
* \brief Wait For Event
* \details Wait For Event is a hint instruction that permits the processor to enter
* a low-power state until one of a number of events occurs.
*/
#define __WFE __wfe
/**
* \brief Data Synchronization Barrier
* \details Acts as a special kind of Data Memory Barrier.
* It completes when all explicit memory accesses before this instruction complete.
*/
#define __DSB _dsb
/**
* \brief Instruction Synchronization Barrier
* \details Instruction Synchronization Barrier flushes the pipeline in the processor,
* so that all instructions following the ISB are fetched from cache or memory,
* after the instruction has been completed.
*/
#define __ISB _isb
/**
\brief Data Memory Barrier
\details Ensures the apparent order of the explicit memory operations before
and after the instruction, without ensuring their completion.
*/
#define __DMB _dmb
/**
* \brief Rotate Right in unsigned value (32 bit)
* \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
* \param [in] VAL Value to rotate
* \param [in] SHIFT Number of Bits to rotate
* \return Rotated value
*/
#define __ROR(VAL, SHIFT) ((unsigned int)__ror(VAL, SHIFT))
/** @} */ /* end of group CMSIS_Core_InstructionInterface */
/* ################### Compiler specific Intrinsics ########################### */
/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
* Access to dedicated SIMD instructions
* @{
*/
#if (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1))
#define __SADD8(VAL1, VAL2) ((unsigned int)_sadd8(VAL1, VAL2))
#define __QADD8(VAL1, VAL2) ((unsigned int)_qadd8(VAL1, VAL2))
#define __SHADD8(VAL1, VAL2) ((unsigned int)_shadd8(VAL1, VAL2))
#define __UADD8(VAL1, VAL2) ((unsigned int)_uadd8(VAL1, VAL2))
#define __UQADD8(VAL1, VAL2) ((unsigned int)_uqadd8(VAL1, VAL2))
#define __UHADD8(VAL1, VAL2) ((unsigned int)_uhadd8(VAL1, VAL2))
#define __SSUB8(VAL1, VAL2) ((unsigned int)_ssub8(VAL1, VAL2))
#define __QSUB8(VAL1, VAL2) ((unsigned int)_qsub8(VAL1, VAL2))
#define __SHSUB8(VAL1, VAL2) ((unsigned int)_shsub8(VAL1, VAL2))
#define __USUB8(VAL1, VAL2) ((unsigned int)_usub8(VAL1, VAL2))
#define __UQSUB8(VAL1, VAL2) ((unsigned int)_uqsub8(VAL1, VAL2))
#define __UHSUB8(VAL1, VAL2) ((unsigned int)_uhsub8(VAL1, VAL2))
#define __SADD16(VAL1, VAL2) ((unsigned int)_sadd16(VAL1, VAL2))
#define __QADD16(VAL1, VAL2) ((unsigned int)_qadd16(VAL1, VAL2))
#define __SHADD16(VAL1, VAL2) ((unsigned int)_shadd16(VAL1, VAL2))
#define __UADD16(VAL1, VAL2) ((unsigned int)_uadd16(VAL1, VAL2))
#define __UQADD16(VAL1, VAL2) ((unsigned int)_uqadd16(VAL1, VAL2))
#define __UHADD16(VAL1, VAL2) ((unsigned int)_uhadd16(VAL1, VAL2))
#define __SSUB16(VAL1, VAL2) ((unsigned int)_ssub16(VAL1, VAL2))
#define __QSUB16(VAL1, VAL2) ((unsigned int)_qsub16(VAL1, VAL2))
#define __SHSUB16(VAL1, VAL2) ((unsigned int)_shsub16(VAL1, VAL2))
#define __USUB16(VAL1, VAL2) ((unsigned int)_usub16(VAL1, VAL2))
#define __UQSUB16(VAL1, VAL2) ((unsigned int)_uqsub16(VAL1, VAL2))
#define __UHSUB16(VAL1, VAL2) ((unsigned int)_uhsub16(VAL1, VAL2))
#define __SASX(VAL1, VAL2) ((unsigned int)_saddsubx(VAL1, VAL2))
#define __QASX(VAL1, VAL2) ((unsigned int)_qaddsubx(VAL1, VAL2))
#define __SHASX(VAL1, VAL2) ((unsigned int)_shaddsubx(VAL1, VAL2))
#define __UASX(VAL1, VAL2) ((unsigned int)_uaddsubx(VAL1, VAL2))
#define __UQASX(VAL1, VAL2) ((unsigned int)_uqaddsubx(VAL1, VAL2))
#define __UHASX(VAL1, VAL2) ((unsigned int)_uhaddsubx(VAL1, VAL2)))
#define __SSAX(VAL1, VAL2) ((unsigned int)_ssubaddx(VAL1, VAL2))
#define __QSAX(VAL1, VAL2) ((unsigned int)_qsubaddx(VAL1, VAL2))
#define __SHSAX(VAL1, VAL2) ((unsigned int)_shsubaddx(VAL1, VAL2))
#define __USAX(VAL1, VAL2) ((unsigned int)_usubaddx(VAL1, VAL2))
#define __UQSAX(VAL1, VAL2) ((unsigned int)_uqsubaddx(VAL1, VAL2))
#define __UHSAX(VAL1, VAL2) ((unsigned int)_uhsubaddx(VAL1, VAL2))
#define __USAD8(VAL1, VAL2) ((unsigned int)_usad8(VAL1, VAL2))
#define __USADA8(VAL1, VAL2, VAL3) ((unsigned int)_usada8(VAL1, VAL2, VAL3))
#define __SSAT16(VAL, BITPOS) ((unsigned int)_ssat16(VAL, BITPOS))
#define __USAT16(VAL, BITPOS) ((unsigned int)_usat16(VAL, BITPOS))
#define __UXTB16(VAL) ((unsigned int)_uxtb16(VAL, 0))
#define __UXTAB16(VAL1, VAL2) ((unsigned int)_uxtab16(VAL1, VAL2, 0))
#define __SXTB16(VAL) ((unsigned int)_sxtb16(VAL, 0))
#define __SXTAB16(VAL1, VAL2) ((unsigned int)_sxtab16(VAL1, VAL2, 0))
#define __SMUAD(VAL1, VAL2) ((unsigned int)_smuad(VAL1, VAL2))
#define __SMUADX(VAL1, VAL2) ((unsigned int)_smuadx(VAL1, VAL2))
#define __SMLAD(VAL1, VAL2, ACCUMULATOR) ((unsigned int)_smlad(VAL1, VAL2, ACCUMULATOR))
#define __SMLADX(VAL1, VAL2, ACCUMULATOR) ((unsigned int)_smladx(VAL1, VAL2, ACCUMULATOR))
#define __SMLALD(VAL1, VAL2, ACCUMULATOR) ((unsigned long long)_smlald(ACCUMULATOR, VAL1, VAL2))
#define __SMLALDX(VAL1, VAL2, ACCUMULATOR) ((unsigned long long)_smlaldx(ACCUMULATOR, VAL1, VAL2))
#define __SMUSD(VAL1, VAL2) ((unsigned int)_smusd(VAL1, VAL2))
#define __SMUSDX(VAL1, VAL2) ((unsigned int)_smusdx(VAL1, VAL2))
#define __SMLSD(VAL1, VAL2, ACCUMULATOR) ((unsigned int)_smlsd(VAL1, VAL2, ACCUMULATOR))
#define __SMLSDX(VAL1, VAL2, ACCUMULATOR) ((unsigned int)_smlsdx(VAL1, VAL2, ACCUMULATOR))
#define __SMLSLD(VAL1, VAL2, ACCUMULATOR) ((unsigned long long)_smlsld(ACCUMULATOR, VAL1, VAL2))
#define __SMLSLDX(VAL1, VAL2, ACCUMULATOR) ((unsigned long long)_smlsldx(ACCUMULATOR, VAL1, VAL2))
#define __SEL(VAL1, VAL2) ((unsigned int)_sel(VAL1, VAL2))
#define __QADD _sadd
#define __QSUB _ssub
#define __PKHBT _pkhbt
#define __PKHTB _pkhtb
#define __SMMLA _smmla
#define __QDADD _sdadd
#define __QDSUB _sdsub
#define __SMLABB _smlabb
#define __SMLABT _smlabt
#define __SMLALBB _smlalbb
#define __SMLALBT _smlalbt
#define __SMLALTB _smlaltb
#define __SMLALTT _smlaltt
#define __SMLATB _smlatb
#define __SMLATT _smlatt
#define __SMLAWB _smlawb
#define __SMLAWT _smlawt
#define __SMULBB _smulbb
#define __SMULBT _smulbt
#define __SMULTB _smultb
#define __SMULTT _smultt
#define __SMULWB _smulwb
#define __SMULWT _smulwt
#define __SMMLAR _smmlar
#define __SMMLS _smmls
#define __SMMLSR _smmlsr
#define __SMMUL _smmul
#define __SMMULR _smmulr
#define __SXTAB _sxtab
#define __SXTAH _sxtah
#define __UMAAL _umaal
#define __UXTAB _uxtab
#define __UXTAH _uxtah
#define __SUBC _subc
#endif /* (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) */
#if (defined (__ARM_ARCH_6M__) && (__ARM_ARCH_6M__ == 1))
#define __SXTB _sxtb
#define __SXTH _sxth
#define __UXTB _uxtb
#define __UXTH _uxth
#endif /* (defined (__ARM_ARCH_6M__) && (__ARM_ARCH_6M__ == 1)) */
/** @} */ /* end of group CMSIS_SIMD_intrinsics */
#endif /* CMSIS_CCS_H_ */
|
8dbc6b1651b246e6f672ed5381b6dbab534da999
|
f268b50cfc676024734009a0678825d01fa78a57
|
/src/renderer/gl33/shader_program.c
|
7cc02192e3dcbcfc3933855be6c90421e0dce9ab
|
[
"LicenseRef-scancode-warranty-disclaimer",
"CC-BY-4.0",
"LicenseRef-scancode-public-domain",
"MIT"
] |
permissive
|
taisei-project/taisei
|
90a1358567c77555eabfdb340bb6adeb913e2ced
|
f1c156cacdb579e66d4bc1776d4d1809e93014d2
|
refs/heads/master
| 2023-09-04T06:25:18.445412
| 2023-09-02T17:31:06
| 2023-09-02T17:31:06
| 977,986
| 785
| 87
|
NOASSERTION
| 2023-04-29T18:16:47
| 2010-10-11T07:31:32
|
C
|
UTF-8
|
C
| false
| false
| 20,863
|
c
|
shader_program.c
|
/*
* This software is licensed under the terms of the MIT License.
* See COPYING for further information.
* ---
* Copyright (c) 2011-2019, Lukas Weber <laochailan@web.de>.
* Copyright (c) 2012-2019, Andrei Alexeyev <akari@taisei-project.org>.
*/
#include "taisei.h"
#include "gl33.h"
#include "shader_program.h"
#include "shader_object.h"
#include "texture.h"
#include "../glcommon/debug.h"
#include "../api.h"
static Uniform *sampler_uniforms;
Uniform *gl33_shader_uniform(ShaderProgram *prog, const char *uniform_name, hash_t uniform_name_hash) {
return ht_get_prehashed(&prog->uniforms, uniform_name, uniform_name_hash, NULL);
}
UniformType gl33_uniform_type(Uniform *uniform) {
return uniform->type;
}
static void uset_float(Uniform *uniform, uint offset, uint count, const void *data) {
glUniform1fv(uniform->location + offset, count, (float*)data);
}
static void uget_float(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformfv(uniform->prog->gl_handle, uniform->location + i, ((GLfloat*)data) + i);
}
}
static void uset_vec2(Uniform *uniform, uint offset, uint count, const void *data) {
glUniform2fv(uniform->location + offset, count, (float*)data);
}
static void uget_vec2(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformfv(uniform->prog->gl_handle, uniform->location + i, ((GLfloat*)data) + i * 2);
}
}
static void uset_vec3(Uniform *uniform, uint offset, uint count, const void *data) {
glUniform3fv(uniform->location + offset, count, (float*)data);
}
static void uget_vec3(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformfv(uniform->prog->gl_handle, uniform->location + i, ((GLfloat*)data) + i * 3);
}
}
static void uset_vec4(Uniform *uniform, uint offset, uint count, const void *data) {
glUniform4fv(uniform->location + offset, count, (float*)data);
}
static void uget_vec4(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformfv(uniform->prog->gl_handle, uniform->location + i, ((GLfloat*)data) + i * 4);
}
}
static void uset_int(Uniform *uniform, uint offset, uint count, const void *data) {
glUniform1iv(uniform->location + offset, count, (int*)data);
}
static void uget_int(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformiv(uniform->prog->gl_handle, uniform->location + i, ((GLint*)data) + i);
}
}
static void uset_ivec2(Uniform *uniform, uint offset, uint count, const void *data) {
glUniform2iv(uniform->location + offset, count, (int*)data);
}
static void uget_ivec2(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformiv(uniform->prog->gl_handle, uniform->location + i, ((GLint*)data) + i * 2);
}
}
static void uset_ivec3(Uniform *uniform, uint offset, uint count, const void *data) {
glUniform3iv(uniform->location + offset, count, (int*)data);
}
static void uget_ivec3(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformiv(uniform->prog->gl_handle, uniform->location + i, ((GLint*)data) + i * 3);
}
}
static void uset_ivec4(Uniform *uniform, uint offset, uint count, const void *data) {
glUniform4iv(uniform->location + offset, count, (int*)data);
}
static void uget_ivec4(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformiv(uniform->prog->gl_handle, uniform->location + i, ((GLint*)data) + i * 4);
}
}
static void uset_mat3(Uniform *uniform, uint offset, uint count, const void *data) {
glUniformMatrix3fv(uniform->location + offset, count, false, (float*)data);
}
static void uget_mat3(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformfv(uniform->prog->gl_handle, uniform->location + i, ((GLfloat*)data) + i * 9);
}
}
static void uset_mat4(Uniform *uniform, uint offset, uint count, const void *data) {
glUniformMatrix4fv(uniform->location + offset, count, false, (float*)data);
}
static void uget_mat4(Uniform *uniform, uint count, void *data) {
for(uint i = 0; i < count; ++i) {
glGetUniformfv(uniform->prog->gl_handle, uniform->location + i, ((GLfloat*)data) + i * 16);
}
}
static struct {
void (*setter)(Uniform *uniform, uint offset, uint count, const void *data);
void (*getter)(Uniform *uniform, uint count, void *data);
} type_to_accessors[] = {
[UNIFORM_FLOAT] = { uset_float, uget_float },
[UNIFORM_VEC2] = { uset_vec2, uget_vec2 },
[UNIFORM_VEC3] = { uset_vec3, uget_vec3 },
[UNIFORM_VEC4] = { uset_vec4, uget_vec4 },
[UNIFORM_INT] = { uset_int, uget_int },
[UNIFORM_IVEC2] = { uset_ivec2, uget_ivec2 },
[UNIFORM_IVEC3] = { uset_ivec3, uget_ivec3 },
[UNIFORM_IVEC4] = { uset_ivec4, uget_ivec4 },
[UNIFORM_SAMPLER_2D] = { uset_int, uget_int },
[UNIFORM_SAMPLER_CUBE] = { uset_int, uget_int },
[UNIFORM_MAT3] = { uset_mat3, uget_mat3 },
[UNIFORM_MAT4] = { uset_mat4, uget_mat4 },
};
typedef struct MagicUniformSpec {
const char *name;
const char *typename;
UniformType type;
} MagicUniformSpec;
static MagicUniformSpec magic_unfiroms[] = {
[UMAGIC_MATRIX_MV] = { "r_modelViewMatrix", "mat4", UNIFORM_MAT4 },
[UMAGIC_MATRIX_PROJ] = { "r_projectionMatrix", "mat4", UNIFORM_MAT4 },
[UMAGIC_MATRIX_TEX] = { "r_textureMatrix", "mat4", UNIFORM_MAT4 },
[UMAGIC_COLOR] = { "r_color", "vec4", UNIFORM_VEC4 },
[UMAGIC_VIEWPORT] = { "r_viewport", "vec4", UNIFORM_VEC4 },
[UMAGIC_COLOR_OUT_SIZES] = { "r_colorOutputSizes[0]", "vec2", UNIFORM_VEC2 },
[UMAGIC_DEPTH_OUT_SIZE] = { "r_depthOutputSize", "vec2", UNIFORM_VEC2 },
};
static_assert(ARRAY_SIZE(magic_unfiroms) == NUM_MAGIC_UNIFORMS);
static void gl33_update_uniform(Uniform *uniform, uint offset, uint count, const void *data) {
// these are validated properly in gl33_uniform
assert(offset < uniform->array_size);
assert(offset + count <= uniform->array_size);
uint idx_first = offset;
uint idx_last = offset + count - 1;
assert(idx_last < uniform->array_size);
assert(idx_first <= idx_last);
memcpy(uniform->cache.pending + offset * uniform->elem_size, data, count * uniform->elem_size);
if(idx_first < uniform->cache.update_first_idx) {
uniform->cache.update_first_idx = idx_first;
}
if(idx_last > uniform->cache.update_last_idx) {
uniform->cache.update_last_idx = idx_last;
}
}
static void gl33_commit_uniform(Uniform *uniform) {
if(uniform->cache.update_first_idx > uniform->cache.update_last_idx) {
return;
}
uint update_count = uniform->cache.update_last_idx - uniform->cache.update_first_idx + 1;
size_t update_ofs = uniform->cache.update_first_idx * uniform->elem_size;
size_t update_sz = update_count * uniform->elem_size;
assert(update_sz + update_ofs <= uniform->elem_size * uniform->array_size);
if(memcmp(uniform->cache.commited + update_ofs, uniform->cache.pending + update_ofs, update_sz)) {
memcpy(uniform->cache.commited + update_ofs, uniform->cache.pending + update_ofs, update_sz);
type_to_accessors[uniform->type].setter(
uniform,
uniform->cache.update_first_idx,
update_count,
uniform->cache.commited + update_ofs
);
}
uniform->cache.update_first_idx = uniform->array_size;
uniform->cache.update_last_idx = 0;
}
static GLuint get_texture_target(Texture *tex, UniformType utype) {
if(tex) {
return tex->bind_target;
}
switch(utype) {
case UNIFORM_SAMPLER_2D: return GL_TEXTURE_2D;
case UNIFORM_SAMPLER_CUBE: return GL_TEXTURE_CUBE_MAP;
default: UNREACHABLE;
}
}
static void *gl33_sync_uniform(const char *key, void *value, void *arg) {
Uniform *uniform = value;
// special case: for sampler uniforms, we have to construct the actual data from the texture pointers array.
UniformType utype = uniform->type;
if(UNIFORM_TYPE_IS_SAMPLER(utype)) {
Uniform *size_uniform = uniform->size_uniform;
for(uint i = 0; i < uniform->array_size; ++i) {
Texture *tex = uniform->textures[i];
GLuint preferred_unit = CASTPTR_ASSUME_ALIGNED(uniform->cache.pending, int)[i];
GLuint unit = gl33_bind_texture(tex, get_texture_target(tex, utype), preferred_unit);
if(unit != preferred_unit) {
gl33_update_uniform(uniform, i, 1, &unit);
}
if(size_uniform) {
uint w, h;
if(tex) {
r_texture_get_size(tex, 0, &w, &h);
} else {
w = h = 0;
}
vec2_noalign size = { w, h };
gl33_update_uniform(size_uniform, i, 1, &size);
gl33_commit_uniform(size_uniform);
}
}
}
gl33_commit_uniform(uniform);
return NULL;
}
void gl33_sync_uniforms(ShaderProgram *prog) {
ht_foreach(&prog->uniforms, gl33_sync_uniform, NULL);
}
void gl33_uniform(Uniform *uniform, uint offset, uint count, const void *data) {
assert(count > 0);
assert(uniform != NULL);
assert(uniform->prog != NULL);
assert(uniform->type >= 0 && uniform->type < sizeof(type_to_accessors)/sizeof(*type_to_accessors));
if(offset >= uniform->array_size) {
// completely out of range
return;
}
if(offset + count > uniform->array_size) {
// partially out of range
count = uniform->array_size - offset;
}
// special case: for sampler uniforms, data is an array of Texture pointers that we'll have to bind later.
if(UNIFORM_TYPE_IS_SAMPLER(uniform->type)) {
Texture **textures = (Texture**)data;
for(uint i = 0; i < count; ++i) {
if(textures[i]) {
assert(gl33_texture_sampler_compatible(textures[i], uniform->type));
}
}
memcpy(uniform->textures + offset, textures, sizeof(Texture*) * count);
} else {
gl33_update_uniform(uniform, offset, count, data);
}
}
static bool cache_uniforms(ShaderProgram *prog) {
int maxlen = 0;
GLint unicount;
ht_create(&prog->uniforms);
glGetProgramiv(prog->gl_handle, GL_ACTIVE_UNIFORMS, &unicount);
glGetProgramiv(prog->gl_handle, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxlen);
if(maxlen < 1 || unicount < 1) {
return true;
}
char name[maxlen];
int sampler_binding = 0;
for(int i = 0; i < unicount; ++i) {
GLenum type;
GLint size, loc;
Uniform uni = { .prog = prog };
glGetActiveUniform(prog->gl_handle, i, maxlen, NULL, &size, &type, name);
loc = glGetUniformLocation(prog->gl_handle, name);
if(loc < 0) {
// builtin uniform
continue;
}
switch(type) {
case GL_FLOAT: uni.type = UNIFORM_FLOAT; break;
case GL_FLOAT_VEC2: uni.type = UNIFORM_VEC2; break;
case GL_FLOAT_VEC3: uni.type = UNIFORM_VEC3; break;
case GL_FLOAT_VEC4: uni.type = UNIFORM_VEC4; break;
case GL_INT: uni.type = UNIFORM_INT; break;
case GL_INT_VEC2: uni.type = UNIFORM_IVEC2; break;
case GL_INT_VEC3: uni.type = UNIFORM_IVEC3; break;
case GL_INT_VEC4: uni.type = UNIFORM_IVEC4; break;
case GL_SAMPLER_2D: uni.type = UNIFORM_SAMPLER_2D; break;
case GL_SAMPLER_CUBE: uni.type = UNIFORM_SAMPLER_CUBE; break;
case GL_FLOAT_MAT3: uni.type = UNIFORM_MAT3; break;
case GL_FLOAT_MAT4: uni.type = UNIFORM_MAT4; break;
default:
log_warn("Uniform '%s' is of an unsupported type 0x%04x and will be ignored.", name, type);
continue;
}
MagicUniformIndex magic_index = UMAGIC_INVALID;
for(int j = 0; j < ARRAY_SIZE(magic_unfiroms); ++j) {
MagicUniformSpec *m = magic_unfiroms + j;
if(strcmp(name, m->name)) {
continue;
}
if(uni.type != m->type) {
log_error("Magic uniform '%s' must be of type '%s'", name, m->typename);
return false;
}
magic_index = j;
break;
}
const UniformTypeInfo *typeinfo = r_uniform_type_info(uni.type);
uni.location = loc;
uni.array_size = size;
if(UNIFORM_TYPE_IS_SAMPLER(uni.type)) {
uni.elem_size = sizeof(GLint);
uni.textures = ALLOC_ARRAY(uni.array_size, typeof(*uni.textures));
} else {
uni.elem_size = typeinfo->element_size * typeinfo->elements;
}
uni.cache.commited = mem_alloc_array(uni.array_size, uni.elem_size);
uni.cache.pending = mem_alloc_array(uni.array_size, uni.elem_size);
uni.cache.update_first_idx = uni.array_size;
if(glext.version.is_webgl) {
// Some browsers are pedantic about getting a null in GLctx.getUniform(),
// so we'd have to be very careful and query each array index with
// glGetUniformLocation in order to avoid an exception. Which is too much
// hassle, so instead here's a hack that fills initial cache state with
// some garbage that we'll not likely want to actually set.
//
// TODO: Might want to fix this properly if this issue ever actually
// affects cases where we write to an array with an offset. But that's
// probably not going to happen.
memset(uni.cache.commited, 0xf0, uni.array_size * uni.elem_size);
} else {
type_to_accessors[uni.type].getter(&uni, size, uni.cache.commited);
}
Uniform *new_uni = memdup(&uni, sizeof(uni));
if(UNIFORM_TYPE_IS_SAMPLER(uni.type)) {
list_push(&sampler_uniforms, new_uni);
if(glext.issues.avoid_sampler_uniform_updates) {
// Bind each sampler to a different texturing unit.
// This way we can change textures by binding them to the right texturing units, and never update the shader's samplers again.
int payload[new_uni->array_size];
assert(sizeof(payload) == new_uni->array_size * new_uni->elem_size);
for(int j = 0; j < ARRAY_SIZE(payload); ++j) {
payload[j] = sampler_binding++;
}
gl33_update_uniform(new_uni, 0, new_uni->array_size, payload);
}
}
if(magic_index != UMAGIC_INVALID) {
assume((uint)magic_index < ARRAY_SIZE(prog->magic_uniforms));
assert(prog->magic_uniforms[magic_index] == NULL);
prog->magic_uniforms[magic_index] = new_uni;
}
ht_set(&prog->uniforms, name, new_uni);
log_debug("%s = %i [array elements: %i; size: %zi bytes]", name, loc, uni.array_size, uni.array_size * uni.elem_size);
}
ht_str2ptr_iter_t iter;
ht_iter_begin(&prog->uniforms, &iter);
while(iter.has_data) {
Uniform *u = iter.value;
if(UNIFORM_TYPE_IS_SAMPLER(u->type)) {
const char *sampler_name = iter.key;
const char size_suffix[] = "_SIZE";
char size_uniform_name[strlen(sampler_name) + sizeof(size_suffix)];
snprintf(size_uniform_name, sizeof(size_uniform_name), "%s%s", sampler_name, size_suffix);
u->size_uniform = ht_get(&prog->uniforms, size_uniform_name, NULL);
if(u->size_uniform) {
Uniform *size_uniform = u->size_uniform;
if(size_uniform->type != UNIFORM_VEC2) {
log_warn("Size uniform %s has invalid type (should be vec2), ignoring", size_uniform_name);
u->size_uniform = NULL;
} else if(size_uniform->array_size != u->array_size) {
log_warn("Size uniform %s has invalid array size (should be %i), ignoring", size_uniform_name, u->array_size);
u->size_uniform = NULL;
} else {
log_debug("Bound size uniform: %s --> %s", sampler_name, size_uniform_name);
}
assert(u->size_uniform != NULL); // fix your shader!
}
}
ht_iter_next(&iter);
}
ht_iter_end(&iter);
return true;
}
void gl33_unref_texture_from_samplers(Texture *tex) {
for(Uniform *u = sampler_uniforms; u; u = u->next) {
assert(UNIFORM_TYPE_IS_SAMPLER(u->type));
if(!u->textures) {
continue;
}
for(Texture **slot = u->textures; slot < u->textures + u->array_size; ++slot) {
assert(slot != NULL);
if(*slot == tex) {
*slot = NULL;
}
}
}
}
void gl33_uniforms_handle_texture_pointer_renamed(Texture *pold, Texture *pnew) {
for(Uniform *u = sampler_uniforms; u; u = u->next) {
assert(UNIFORM_TYPE_IS_SAMPLER(u->type));
for(Texture **slot = u->textures; slot < u->textures + u->array_size; ++slot) {
assert(slot != NULL);
if(*slot == pold) {
*slot = pnew;
}
}
}
}
static void print_info_log(GLuint prog) {
GLint len = 0, alen = 0;
glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &len);
if(len > 1) {
char log[len];
memset(log, 0, len);
glGetProgramInfoLog(prog, len, &alen, log);
log_warn(
"\n== Shader program linkage log (%u) ==\n%s\n== End of shader program linkage log (%u) ==",
prog, log, prog
);
}
}
static void *free_uniform(const char *key, void *data, void *arg) {
Uniform *uniform = data;
if(UNIFORM_TYPE_IS_SAMPLER(uniform->type)) {
list_unlink(&sampler_uniforms, uniform);
}
mem_free(uniform->textures);
mem_free(uniform->cache.commited);
mem_free(uniform->cache.pending);
mem_free(uniform);
return NULL;
}
void gl33_shader_program_destroy(ShaderProgram *prog) {
gl33_shader_deleted(prog);
glDeleteProgram(prog->gl_handle);
ht_foreach(&prog->uniforms, free_uniform, NULL);
ht_destroy(&prog->uniforms);
mem_free(prog);
}
ShaderProgram *gl33_shader_program_link(uint num_objects, ShaderObject *shobjs[num_objects]) {
auto prog = ALLOC(ShaderProgram);
prog->gl_handle = glCreateProgram();
snprintf(prog->debug_label, sizeof(prog->debug_label), "Shader program #%i", prog->gl_handle);
for(int i = 0; i < num_objects; ++i) {
ShaderObject *shobj = shobjs[i];
glAttachShader(prog->gl_handle, shobj->gl_handle);
for(int a = 0; a < shobj->num_attribs; ++a) {
GLSLAttribute *attr = shobj->attribs + a;
log_debug("Binding attribute %s to location %i", attr->name, attr->location);
glBindAttribLocation(prog->gl_handle, attr->location, attr->name);
}
}
glLinkProgram(prog->gl_handle);
print_info_log(prog->gl_handle);
GLint link_status;
glGetProgramiv(prog->gl_handle, GL_LINK_STATUS, &link_status);
if(!link_status) {
log_error("Failed to link the shader program");
glDeleteProgram(prog->gl_handle);
mem_free(prog);
return NULL;
}
if(!cache_uniforms(prog)) {
gl33_shader_program_destroy(prog);
return NULL;
}
return prog;
}
void gl33_shader_program_set_debug_label(ShaderProgram *prog, const char *label) {
glcommon_set_debug_label(prog->debug_label, "Shader program", GL_PROGRAM, prog->gl_handle, label);
}
const char *gl33_shader_program_get_debug_label(ShaderProgram *prog) {
return prog->debug_label;
}
bool gl33_shader_program_transfer(ShaderProgram *dst, ShaderProgram *src) {
ht_ptr2ptr_t old_new_map; // bidirectional
ht_create(&old_new_map);
ht_str2ptr_iter_t iter;
ht_iter_begin(&src->uniforms, &iter);
bool fail = false;
for(; iter.has_data; ht_iter_next(&iter)) {
Uniform *unew = NOT_NULL(iter.value);
Uniform *uold = ht_get(&dst->uniforms, iter.key, NULL);
if(!uold) {
continue;
}
if(unew->type != uold->type || unew->elem_size != uold->elem_size) {
log_error(
"Can't update shader program '%s': uniform %s changed type",
dst->debug_label, iter.key
);
fail = true;
break;
}
ht_set(&old_new_map, uold, unew);
ht_set(&old_new_map, unew, uold);
}
ht_iter_end(&iter);
if(fail) {
ht_destroy(&old_new_map);
gl33_shader_program_destroy(src);
return false;
}
// Update existing uniforms
ht_iter_begin(&dst->uniforms, &iter);
for(; iter.has_data; ht_iter_next(&iter)) {
Uniform *uold = NOT_NULL(iter.value);
Uniform *unew = ht_get(&old_new_map, uold, NULL);
mem_free(uold->textures);
mem_free(uold->cache.pending);
mem_free(uold->cache.commited);
if(unew) {
uold->textures = unew->textures;
assert(uold->elem_size == unew->elem_size);
uold->array_size = unew->array_size;
uold->location = unew->location;
assert(uold->type == unew->type);
uold->size_uniform = ht_get(&old_new_map, unew->size_uniform, unew->size_uniform);
uold->cache = unew->cache;
if(UNIFORM_TYPE_IS_SAMPLER(unew->type)) {
list_unlink(&sampler_uniforms, unew);
}
ht_unset(&src->uniforms, iter.key);
mem_free(unew);
} else {
// Deactivate, but keep the object around, because user code may be referencing it.
// We also need to keep type information, in case the uniform gets re-introduced.
uold->location = INVALID_UNIFORM_LOCATION;
uold->size_uniform = NULL;
uold->array_size = 0;
uold->textures = NULL;
uold->cache.pending = NULL;
uold->cache.commited = NULL;
}
}
ht_iter_end(&iter);
// Add new uniforms
ht_iter_begin(&src->uniforms, &iter);
for(; iter.has_data; ht_iter_next(&iter)) {
Uniform *unew = NOT_NULL(iter.value);
assert(ht_get(&old_new_map, unew, NULL) == NULL);
assert(ht_get(&dst->uniforms, iter.key, NULL) == NULL);
unew->prog = dst;
unew->size_uniform = ht_get(&old_new_map, unew->size_uniform, unew->size_uniform);
ht_set(&dst->uniforms, iter.key, unew);
}
ht_iter_end(&iter);
dst->gl_handle = src->gl_handle;
memcpy(dst->debug_label, src->debug_label, sizeof(dst->debug_label));
for(int i = 0; i < ARRAY_SIZE(dst->magic_uniforms); ++i) {
Uniform *unew = src->magic_uniforms[i];
dst->magic_uniforms[i] = ht_get(&old_new_map, unew, unew);
}
ht_destroy(&old_new_map);
ht_destroy(&src->uniforms);
mem_free(src);
return true;
}
|
b21d4fd5fccbec8aeda9b5822abdd361e9e47af8
|
ab64ef79f1e89fd8e7879902645f3f8461f353a9
|
/contrib/SeqLib/bwa/bwa.h
|
1541c1c2a78d4abc2966314b0a01f6ba682a3814
|
[
"Apache-2.0",
"MIT"
] |
permissive
|
freebayes/freebayes
|
af6e148cc765f50e639ef81fa11cec9541630d09
|
b44a91932715c4e1893ccdf9b7e6f17eb2ecf733
|
refs/heads/master
| 2023-08-16T04:23:14.778600
| 2023-02-13T14:04:57
| 2023-02-13T14:04:57
| 985,260
| 211
| 56
|
MIT
| 2023-02-13T14:04:59
| 2010-10-13T21:34:33
|
C++
|
UTF-8
|
C
| false
| false
| 1,859
|
h
|
bwa.h
|
#ifndef BWA_H_
#define BWA_H_
#include <stdint.h>
#include "bntseq.h"
#include "bwt.h"
#define BWA_IDX_BWT 0x1
#define BWA_IDX_BNS 0x2
#define BWA_IDX_PAC 0x4
#define BWA_IDX_ALL 0x7
#define BWA_CTL_SIZE 0x10000
typedef struct {
bwt_t *bwt; // FM-index
bntseq_t *bns; // information on the reference sequences
uint8_t *pac; // the actual 2-bit encoded reference sequences with 'N' converted to a random base
int is_shm;
int64_t l_mem;
uint8_t *mem;
} bwaidx_t;
typedef struct {
int l_seq, id;
char *name, *comment, *seq, *qual, *sam;
} bseq1_t;
extern int bwa_verbose;
extern char bwa_rg_id[256];
#ifdef __cplusplus
extern "C" {
#endif
bseq1_t *bseq_read(int chunk_size, int *n_, void *ks1_, void *ks2_);
void bseq_classify(int n, bseq1_t *seqs, int m[2], bseq1_t *sep[2]);
void bwa_fill_scmat(int a, int b, int8_t mat[25]);
uint32_t *bwa_gen_cigar(const int8_t mat[25], int q, int r, int w_, int64_t l_pac, const uint8_t *pac, int l_query, uint8_t *query, int64_t rb, int64_t re, int *score, int *n_cigar, int *NM);
uint32_t *bwa_gen_cigar2(const int8_t mat[25], int o_del, int e_del, int o_ins, int e_ins, int w_, int64_t l_pac, const uint8_t *pac, int l_query, uint8_t *query, int64_t rb, int64_t re, int *score, int *n_cigar, int *NM);
char *bwa_idx_infer_prefix(const char *hint);
bwt_t *bwa_idx_load_bwt(const char *hint);
bwaidx_t *bwa_idx_load_from_shm(const char *hint);
bwaidx_t *bwa_idx_load_from_disk(const char *hint, int which);
bwaidx_t *bwa_idx_load(const char *hint, int which);
void bwa_idx_destroy(bwaidx_t *idx);
int bwa_idx2mem(bwaidx_t *idx);
int bwa_mem2idx(int64_t l_mem, uint8_t *mem, bwaidx_t *idx);
void bwa_print_sam_hdr(const bntseq_t *bns, const char *hdr_line);
char *bwa_set_rg(const char *s);
char *bwa_insert_header(const char *s, char *hdr);
#ifdef __cplusplus
}
#endif
#endif
|
3c0208c2da349043bc739bd4d9671ce7a0d4f19e
|
8103be19acbdffb336f2cf8b72ec8fe86dcc9ab6
|
/input.h
|
ec880b86da268780a119fc5375bf24c55d5a0eb2
|
[
"MIT"
] |
permissive
|
libretro/libretro-lutro
|
29157570ea4a68b9154b74062989ef73d3d0cff3
|
09a134eccad87127ec757503f736d6e4f9d06d4c
|
refs/heads/master
| 2023-06-09T02:03:23.399836
| 2023-05-29T19:28:28
| 2023-05-29T19:28:28
| 30,933,195
| 156
| 61
|
MIT
| 2023-05-29T19:27:37
| 2015-02-17T19:22:13
|
C
|
UTF-8
|
C
| false
| false
| 307
|
h
|
input.h
|
#ifndef INPUT_H
#define INPUT_H
#include "runtime.h"
extern const struct int_const_map {
long value;
const char *name;
} joystick_enum[17];
int lutro_input_preload(lua_State *L);
int input_joypad(lua_State *L);
const char* input_find_name(const struct int_const_map*, unsigned);
#endif // INPUT_H
|
09ef217aef19be582cba0e957f57ee22e9c77cad
|
9ceacf33fd96913cac7ef15492c126d96cae6911
|
/sys/arch/i386/include/mpbiosvar.h
|
b22fbd823f9b0285d85802f9fc89af76fb61cd16
|
[] |
no_license
|
openbsd/src
|
ab97ef834fd2d5a7f6729814665e9782b586c130
|
9e79f3a0ebd11a25b4bff61e900cb6de9e7795e9
|
refs/heads/master
| 2023-09-02T18:54:56.624627
| 2023-09-02T15:16:12
| 2023-09-02T15:16:12
| 66,966,208
| 3,394
| 1,235
| null | 2023-08-08T02:42:25
| 2016-08-30T18:18:25
|
C
|
UTF-8
|
C
| false
| false
| 2,858
|
h
|
mpbiosvar.h
|
/* $OpenBSD: mpbiosvar.h,v 1.12 2016/05/18 03:45:11 mlarkin Exp $ */
/* $NetBSD: mpbiosvar.h,v 1.1.2.3 2000/02/29 13:17:20 sommerfeld Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by RedBack Networks Inc.
*
* Author: Bill Sommerfeld
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _MACHINE_MPBIOSVAR_H_
#define _MACHINE_MPBIOSVAR_H_
#define MP_TRAMPOLINE (16 * PAGE_SIZE)
#define MP_TRAMP_DATA (17 * PAGE_SIZE)
#if !defined(_LOCORE)
#include <machine/mpbiosreg.h>
struct mp_bus
{
char *mb_name; /* XXX bus name */
int mb_idx; /* XXX bus index */
void (*mb_intr_print) (int);
void (*mb_intr_cfg)(const struct mpbios_int *, u_int32_t *);
struct mp_intr_map *mb_intrs;
u_int32_t mb_data; /* random bus-specific datum. */
};
struct mp_intr_map
{
struct mp_intr_map *next;
struct mp_bus *bus;
int bus_pin;
struct ioapic_softc *ioapic;
int ioapic_pin;
int ioapic_ih; /* int handle, for apic_intr_est */
int type; /* from mp spec intr record */
int flags; /* from mp spec intr record */
u_int32_t redir;
int cpu_id;
};
#if defined(_KERNEL)
extern int mp_verbose;
extern struct mp_bus *mp_busses;
extern int mp_nbusses;
extern struct mp_intr_map *mp_intrs;
extern int mp_nintrs;
extern struct mp_bus *mp_isa_bus;
extern struct mp_bus *mp_eisa_bus;
void mpbios_scan(struct device *);
int mpbios_probe(struct device *);
int mpbios_invent(int, int, int);
void mpbios_intr_fixup(void);
#endif
#endif
#endif /* !_MACHINE_MPBIOSVAR_H_ */
|
585a3d829cfcdaedc52e33b98c8abae028e93a7f
|
88ae8695987ada722184307301e221e1ba3cc2fa
|
/third_party/ffmpeg/libavutil/xtea.c
|
6f376c365c39de275c12d5712829f21908152037
|
[
"Apache-2.0",
"LGPL-2.0-or-later",
"MIT",
"GPL-1.0-or-later",
"BSD-3-Clause",
"LGPL-2.1-only",
"LGPL-3.0-only",
"GPL-2.0-only",
"LGPL-2.1-or-later",
"GPL-3.0-or-later",
"LGPL-3.0-or-later",
"IJG",
"LicenseRef-scancode-other-permissive",
"GPL-2.0-or-later",
"GPL-3.0-only"
] |
permissive
|
iridium-browser/iridium-browser
|
71d9c5ff76e014e6900b825f67389ab0ccd01329
|
5ee297f53dc7f8e70183031cff62f37b0f19d25f
|
refs/heads/master
| 2023-08-03T16:44:16.844552
| 2023-07-20T15:17:00
| 2023-07-23T16:09:30
| 220,016,632
| 341
| 40
|
BSD-3-Clause
| 2021-08-13T13:54:45
| 2019-11-06T14:32:31
| null |
UTF-8
|
C
| false
| false
| 7,568
|
c
|
xtea.c
|
/*
* A 32-bit implementation of the XTEA algorithm
* Copyright (c) 2012 Samuel Pitoiset
*
* loosely based on the implementation of David Wheeler and Roger Needham
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* @brief XTEA 32-bit implementation
* @author Samuel Pitoiset
* @ingroup lavu_xtea
*/
#include <string.h>
#include "config.h"
#include "intreadwrite.h"
#include "mem.h"
#include "xtea.h"
AVXTEA *av_xtea_alloc(void)
{
return av_mallocz(sizeof(struct AVXTEA));
}
void av_xtea_init(AVXTEA *ctx, const uint8_t key[16])
{
int i;
for (i = 0; i < 4; i++)
ctx->key[i] = AV_RB32(key + (i << 2));
}
void av_xtea_le_init(AVXTEA *ctx, const uint8_t key[16])
{
int i;
for (i = 0; i < 4; i++)
ctx->key[i] = AV_RL32(key + (i << 2));
}
static void xtea_crypt_ecb(AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
int decrypt, uint8_t *iv)
{
uint32_t v0, v1;
#if !CONFIG_SMALL
uint32_t k0 = ctx->key[0];
uint32_t k1 = ctx->key[1];
uint32_t k2 = ctx->key[2];
uint32_t k3 = ctx->key[3];
#endif
v0 = AV_RB32(src);
v1 = AV_RB32(src + 4);
if (decrypt) {
#if CONFIG_SMALL
int i;
uint32_t delta = 0x9E3779B9U, sum = delta * 32;
for (i = 0; i < 32; i++) {
v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + ctx->key[(sum >> 11) & 3]);
sum -= delta;
v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + ctx->key[sum & 3]);
}
#else
#define DSTEP(SUM, K0, K1) \
v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (SUM + K0); \
v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (SUM - 0x9E3779B9U + K1)
DSTEP(0xC6EF3720U, k2, k3);
DSTEP(0x28B7BD67U, k3, k2);
DSTEP(0x8A8043AEU, k0, k1);
DSTEP(0xEC48C9F5U, k1, k0);
DSTEP(0x4E11503CU, k2, k3);
DSTEP(0xAFD9D683U, k2, k2);
DSTEP(0x11A25CCAU, k3, k1);
DSTEP(0x736AE311U, k0, k0);
DSTEP(0xD5336958U, k1, k3);
DSTEP(0x36FBEF9FU, k1, k2);
DSTEP(0x98C475E6U, k2, k1);
DSTEP(0xFA8CFC2DU, k3, k0);
DSTEP(0x5C558274U, k0, k3);
DSTEP(0xBE1E08BBU, k1, k2);
DSTEP(0x1FE68F02U, k1, k1);
DSTEP(0x81AF1549U, k2, k0);
DSTEP(0xE3779B90U, k3, k3);
DSTEP(0x454021D7U, k0, k2);
DSTEP(0xA708A81EU, k1, k1);
DSTEP(0x08D12E65U, k1, k0);
DSTEP(0x6A99B4ACU, k2, k3);
DSTEP(0xCC623AF3U, k3, k2);
DSTEP(0x2E2AC13AU, k0, k1);
DSTEP(0x8FF34781U, k0, k0);
DSTEP(0xF1BBCDC8U, k1, k3);
DSTEP(0x5384540FU, k2, k2);
DSTEP(0xB54CDA56U, k3, k1);
DSTEP(0x1715609DU, k0, k0);
DSTEP(0x78DDE6E4U, k0, k3);
DSTEP(0xDAA66D2BU, k1, k2);
DSTEP(0x3C6EF372U, k2, k1);
DSTEP(0x9E3779B9U, k3, k0);
#endif
if (iv) {
v0 ^= AV_RB32(iv);
v1 ^= AV_RB32(iv + 4);
memcpy(iv, src, 8);
}
} else {
#if CONFIG_SMALL
int i;
uint32_t sum = 0, delta = 0x9E3779B9U;
for (i = 0; i < 32; i++) {
v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + ctx->key[sum & 3]);
sum += delta;
v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + ctx->key[(sum >> 11) & 3]);
}
#else
#define ESTEP(SUM, K0, K1) \
v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (SUM + K0);\
v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (SUM + 0x9E3779B9U + K1)
ESTEP(0x00000000U, k0, k3);
ESTEP(0x9E3779B9U, k1, k2);
ESTEP(0x3C6EF372U, k2, k1);
ESTEP(0xDAA66D2BU, k3, k0);
ESTEP(0x78DDE6E4U, k0, k0);
ESTEP(0x1715609DU, k1, k3);
ESTEP(0xB54CDA56U, k2, k2);
ESTEP(0x5384540FU, k3, k1);
ESTEP(0xF1BBCDC8U, k0, k0);
ESTEP(0x8FF34781U, k1, k0);
ESTEP(0x2E2AC13AU, k2, k3);
ESTEP(0xCC623AF3U, k3, k2);
ESTEP(0x6A99B4ACU, k0, k1);
ESTEP(0x08D12E65U, k1, k1);
ESTEP(0xA708A81EU, k2, k0);
ESTEP(0x454021D7U, k3, k3);
ESTEP(0xE3779B90U, k0, k2);
ESTEP(0x81AF1549U, k1, k1);
ESTEP(0x1FE68F02U, k2, k1);
ESTEP(0xBE1E08BBU, k3, k0);
ESTEP(0x5C558274U, k0, k3);
ESTEP(0xFA8CFC2DU, k1, k2);
ESTEP(0x98C475E6U, k2, k1);
ESTEP(0x36FBEF9FU, k3, k1);
ESTEP(0xD5336958U, k0, k0);
ESTEP(0x736AE311U, k1, k3);
ESTEP(0x11A25CCAU, k2, k2);
ESTEP(0xAFD9D683U, k3, k2);
ESTEP(0x4E11503CU, k0, k1);
ESTEP(0xEC48C9F5U, k1, k0);
ESTEP(0x8A8043AEU, k2, k3);
ESTEP(0x28B7BD67U, k3, k2);
#endif
}
AV_WB32(dst, v0);
AV_WB32(dst + 4, v1);
}
static void xtea_le_crypt_ecb(AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
int decrypt, uint8_t *iv)
{
uint32_t v0, v1;
int i;
v0 = AV_RL32(src);
v1 = AV_RL32(src + 4);
if (decrypt) {
uint32_t delta = 0x9E3779B9, sum = delta * 32;
for (i = 0; i < 32; i++) {
v1 -= (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + ctx->key[(sum >> 11) & 3]);
sum -= delta;
v0 -= (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + ctx->key[sum & 3]);
}
if (iv) {
v0 ^= AV_RL32(iv);
v1 ^= AV_RL32(iv + 4);
memcpy(iv, src, 8);
}
} else {
uint32_t sum = 0, delta = 0x9E3779B9;
for (i = 0; i < 32; i++) {
v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + ctx->key[sum & 3]);
sum += delta;
v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + ctx->key[(sum >> 11) & 3]);
}
}
AV_WL32(dst, v0);
AV_WL32(dst + 4, v1);
}
static void xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
uint8_t *iv, int decrypt,
void (*crypt)(AVXTEA *, uint8_t *, const uint8_t *, int, uint8_t *))
{
int i;
if (decrypt) {
while (count--) {
crypt(ctx, dst, src, decrypt, iv);
src += 8;
dst += 8;
}
} else {
while (count--) {
if (iv) {
for (i = 0; i < 8; i++)
dst[i] = src[i] ^ iv[i];
crypt(ctx, dst, dst, decrypt, NULL);
memcpy(iv, dst, 8);
} else {
crypt(ctx, dst, src, decrypt, NULL);
}
src += 8;
dst += 8;
}
}
}
void av_xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
uint8_t *iv, int decrypt)
{
xtea_crypt(ctx, dst, src, count, iv, decrypt, xtea_crypt_ecb);
}
void av_xtea_le_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count,
uint8_t *iv, int decrypt)
{
xtea_crypt(ctx, dst, src, count, iv, decrypt, xtea_le_crypt_ecb);
}
|
773a8391ae3f633b97361dee7cfc4087800f9d60
|
2d5743a0cc3b0ca82856d12e5576949868630031
|
/lib/dynamodb/dynamodb_request_queue.h
|
64ea19f963031a64b945f49bac9887c89ddb5100
|
[
"BSD-2-Clause"
] |
permissive
|
Tarsnap/kivaloo
|
20dfd70438375c7b8f8ea00a928b87c9299ae8be
|
1b4fffe65e8bdc789cb47a6191b4df33613a98e0
|
refs/heads/master
| 2023-09-03T01:26:01.625376
| 2023-08-26T18:52:14
| 2023-08-26T18:52:14
| 36,057,493
| 207
| 22
|
NOASSERTION
| 2023-08-29T18:49:29
| 2015-05-22T07:05:37
|
C
|
UTF-8
|
C
| false
| false
| 3,025
|
h
|
dynamodb_request_queue.h
|
#ifndef DYNAMODB_REQUEST_QUEUE_H_
#define DYNAMODB_REQUEST_QUEUE_H_
#include <stddef.h>
/* Opaque types. */
struct dynamodb_request_queue;
struct http_response;
struct logging_file;
struct serverpool;
/**
* dynamodb_request_queue_init(key_id, key_secret, region, SP):
* Create a DynamoDB request queue using AWS key id ${key_id} and secret key
* ${key_secret} to make requests to DynamoDB in ${region}. Obtain target
* addresses from the pool ${SP}.
*/
struct dynamodb_request_queue * dynamodb_request_queue_init(const char *,
const char *, const char *, struct serverpool *);
/**
* dynamodb_request_queue_log(Q, F):
* Log all requests performed by the queue ${Q} to the log file ${F}.
*/
void dynamodb_request_queue_log(struct dynamodb_request_queue *,
struct logging_file *);
/**
* dynamodb_request_queue_setcapacity(Q, capacity):
* Set the capacity of the DyanamoDB request queue to ${capacity} capacity
* units per second; use this value (along with ConsumedCapacity fields from
* DynamoDB responses) to rate-limit requests after seeing a "Throughput
* Exceeded" exception. If passed a capacity of 0, the request rate will
* not be limited.
*/
void dynamodb_request_queue_setcapacity(struct dynamodb_request_queue *, long);
/**
* dynamodb_request_queue(Q, prio, op, body, maxrlen, logstr, callback, cookie):
* Using the DynamoDB request queue ${Q}, queue the DynamoDB request
* contained in ${body} for the operation ${op}. Read a response with a body
* of up to ${maxrlen} bytes and invoke the callback with the provided cookie,
* the HTTP response, and (for HTTP 400 responses) the DynamoDB error string.
* The strings ${op} and ${body} must remain valid until the callback is
* invoked or the queue is flushed. For accurate rate limiting, on tables
* with "provisioned" capacity requests must elicit ConsumedCapacity fields
* in their responses.
*
* HTTP 5xx errors and HTTP 400 "Throughput Exceeded" errors will be
* automatically retried; other errors are passed back.
*
* Requests will be served starting with the lowest ${prio}, breaking ties
* according to the queue arrival time.
*
* If dynamodb_request_queue_log() has been called, ${logstr} will be included
* when this request is logged. (This could be used to identify the target
* of the ${op} operation, for example.)
*/
int dynamodb_request_queue(struct dynamodb_request_queue *, int, const char *,
const char *, size_t, const char *,
int (*)(void *, struct http_response *, const char *), void *);
/**
* dynamodb_request_queue_flush(Q):
* Flush the DynamoDB request queue ${Q}. Any queued requests will be
* dropped; no callbacks will be performed.
*/
void dynamodb_request_queue_flush(struct dynamodb_request_queue *);
/**
* dynamodb_request_queue_free(Q):
* Free the DynamoDB request queue ${Q}. Any queued requests will be
* dropped; no callbacks will be performed.
*/
void dynamodb_request_queue_free(struct dynamodb_request_queue *);
#endif /* !DYNAMODB_REQUEST_QUEUE_H_ */
|
06105b218d46919fa7f2363add16e4891ea1c8fc
|
971b2cea2d1c3001aadc8ca1a48110b7db1ed5f2
|
/deps/abc/src/aig/gia/giaBalMap.c
|
b285daea1794b7084ad029fb950248f43d68b0b6
|
[
"LicenseRef-scancode-warranty-disclaimer",
"MIT",
"MIT-Modern-Variant"
] |
permissive
|
emsec/hal
|
70ad2921739967d914dd458984bd7d6d497d3b0a
|
e4fae37bec9168a61100eacfda37a1f291b4d0be
|
refs/heads/master
| 2023-09-02T20:27:32.909426
| 2023-09-01T13:03:24
| 2023-09-01T13:03:24
| 169,076,171
| 510
| 72
|
MIT
| 2023-09-01T13:03:26
| 2019-02-04T12:37:20
|
C++
|
UTF-8
|
C
| false
| false
| 10,354
|
c
|
giaBalMap.c
|
/**CFile****************************************************************
FileName [giaSopb.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Scalable AIG package.]
Synopsis [SOP balancing for a window.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [$Id: giaSopb.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "gia.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Gia_ManHighlight_rec( Gia_Man_t * p, int iObj )
{
Gia_Obj_t * pObj;
if ( Gia_ObjIsTravIdCurrentId(p, iObj) )
return;
Gia_ObjSetTravIdCurrentId(p, iObj);
pObj = Gia_ManObj( p, iObj );
if ( Gia_ObjIsAnd(pObj) )
Gia_ManHighlight_rec( p, Gia_ObjFaninId0(pObj, iObj) );
if ( Gia_ObjIsAnd(pObj) )
Gia_ManHighlight_rec( p, Gia_ObjFaninId1(pObj, iObj) );
}
void Gia_ManPrepareWin( Gia_Man_t * p, Vec_Int_t * vOuts, Vec_Int_t ** pvPis, Vec_Int_t ** pvPos, Vec_Int_t ** pvAnds, int fPoOnly )
{
Gia_Obj_t * pObj;
int i;
// mark the section
Gia_ManIncrementTravId( p );
Gia_ManForEachCoVec( vOuts, p, pObj, i )
Gia_ManHighlight_rec( p, Gia_ObjFaninId0p(p, pObj) );
// mark fanins of the outside area
Gia_ManCleanMark0( p );
if ( fPoOnly )
{
Gia_ManForEachCoVec( vOuts, p, pObj, i )
Gia_ObjFanin0(pObj)->fMark0 = 1;
}
else
{
Gia_ManForEachObj1( p, pObj, i )
{
if ( Gia_ObjIsCi(pObj) )
continue;
if ( Gia_ObjIsAnd(pObj) && !Gia_ObjIsTravIdCurrentId(p, i) )
continue;
Gia_ObjFanin0(pObj)->fMark0 = 1;
if ( Gia_ObjIsAnd(pObj) )
Gia_ObjFanin1(pObj)->fMark0 = 1;
}
}
// collect pointed nodes
*pvPis = Vec_IntAlloc( 1000 );
*pvPos = Vec_IntAlloc( 1000 );
*pvAnds = Vec_IntAlloc( 1000 );
Gia_ManForEachObj1( p, pObj, i )
{
if ( !Gia_ObjIsTravIdCurrentId(p, i) )
continue;
if ( Gia_ObjIsCi(pObj) )
Vec_IntPush( *pvPis, i );
else if ( pObj->fMark0 )
Vec_IntPush( *pvPos, i );
if ( Gia_ObjIsAnd(pObj) )
Vec_IntPush( *pvAnds, i );
}
Gia_ManCleanMark0( p );
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t * Gia_ManExtractWin( Gia_Man_t * p, Vec_Int_t * vOuts, int fPoOnly )
{
Vec_Int_t * vPis, * vPos, * vAnds;
Gia_Man_t * pNew;
Gia_Obj_t * pObj;
int i;
Gia_ManPrepareWin( p, vOuts, &vPis, &vPos, &vAnds, fPoOnly );
// create AIG
pNew = Gia_ManStart( Vec_IntSize(vPis) + Vec_IntSize(vPos) + Vec_IntSize(vAnds) + 1 );
pNew->pName = Abc_UtilStrsav( p->pName );
Gia_ManConst0(p)->Value = 0;
Gia_ManForEachObjVec( vPis, p, pObj, i )
pObj->Value = Gia_ManAppendCi( pNew );
Gia_ManForEachObjVec( vAnds, p, pObj, i )
pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
Gia_ManForEachObjVec( vPos, p, pObj, i )
Gia_ManAppendCo( pNew, pObj->Value );
Vec_IntFree( vPis );
Vec_IntFree( vPos );
Vec_IntFree( vAnds );
return pNew;
}
Gia_Man_t * Gia_ManInsertWin( Gia_Man_t * p, Vec_Int_t * vOuts, Gia_Man_t * pWin )
{
Vec_Int_t * vPos, * vPis, * vAnds;
Gia_Man_t * pNew, * pTemp;
Gia_Obj_t * pObj;
int i;
Gia_ManPrepareWin( p, vOuts, &vPis, &vPos, &vAnds, 0 );
// create AIG
pNew = Gia_ManStart( Gia_ManObjNum(p) - Vec_IntSize(vAnds) + Gia_ManAndNum(pWin) );
pNew->pName = Abc_UtilStrsav( p->pName );
pNew->pSpec = Abc_UtilStrsav( p->pSpec );
// inputs
Gia_ManConst0(p)->Value = 0;
Gia_ManForEachCi( p, pObj, i )
pObj->Value = Gia_ManAppendCi( pNew );
Gia_ManConst0(pWin)->Value = 0;
Gia_ManForEachCi( pWin, pObj, i )
pObj->Value = Gia_ManObj(p, Vec_IntEntry(vPis, i))->Value;
// internal nodes
Gia_ManHashAlloc( pNew );
Gia_ManForEachAnd( pWin, pObj, i )
pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
Gia_ManForEachCo( pWin, pObj, i )
Gia_ManObj( p, Vec_IntEntry(vPos, i) )->Value = Gia_ObjFanin0Copy(pObj);
Gia_ManForEachAnd( p, pObj, i )
if ( !Gia_ObjIsTravIdCurrentId(p, i) )
pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
Gia_ManForEachCo( p, pObj, i )
Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
Gia_ManHashStop( pNew );
// cleanup
Vec_IntFree( vPis );
Vec_IntFree( vPos );
Vec_IntFree( vAnds );
pNew = Gia_ManCleanup( pTemp = pNew );
Gia_ManStop( pTemp );
return pNew;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Int_t * Gia_ManFindLatest( Gia_Man_t * p, int LevelMax, int nTimeWindow )
{
Gia_Obj_t * pObj;
Vec_Int_t * vOuts;
vOuts = Vec_IntAlloc( 1000 );
if ( Gia_ManHasMapping(p) )
{
int i, k, iFan, nLevels = 0;
int * pLevels = ABC_CALLOC( int, Gia_ManObjNum(p) );
Gia_ManForEachLut( p, i )
{
Gia_LutForEachFanin( p, i, iFan, k )
pLevels[i] = Abc_MaxInt( pLevels[i], pLevels[iFan] );
pLevels[i]++;
nLevels = Abc_MaxInt( nLevels, pLevels[i] );
}
if ( nTimeWindow )
LevelMax = (int)((1.0 - 0.01 * nTimeWindow) * nLevels);
if ( nLevels < LevelMax )
printf( "The maximum mapped level (%d) is less than the target level (%d).\n", nLevels, LevelMax );
Gia_ManForEachCo( p, pObj, i )
if ( pLevels[Gia_ObjFaninId0p(p, pObj)] >= LevelMax )
Vec_IntPush( vOuts, i );
ABC_FREE( pLevels );
}
else
{
int i, nLevels = Gia_ManLevelNum( p );
if ( nTimeWindow )
LevelMax = (int)((1.0 - 0.01 * nTimeWindow) * nLevels);
if ( nLevels < LevelMax )
printf( "The maximum AIG level (%d) is less than the target level (%d).\n", nLevels, LevelMax );
Gia_ManForEachCo( p, pObj, i )
if ( Gia_ObjLevel(p, pObj) >= LevelMax )
Vec_IntPush( vOuts, i );
}
return vOuts;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t * Gia_ManExtractWindow( Gia_Man_t * p, int LevelMax, int nTimeWindow, int fVerbose )
{
Vec_Int_t * vOuts;
Gia_Man_t * pWin;
assert( !LevelMax != !nTimeWindow );
vOuts = Gia_ManFindLatest( p, LevelMax, nTimeWindow );
if ( fVerbose )
printf( "Collected %d outputs to extract.\n", Vec_IntSize(vOuts) );
if ( Vec_IntSize(vOuts) == 0 )
{
Vec_IntFree( vOuts );
return Gia_ManDup( p );
}
pWin = Gia_ManExtractWin( p, vOuts, 1 );
Vec_IntFree( vOuts );
return pWin;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t * Gia_ManPerformSopBalanceWin( Gia_Man_t * p, int LevelMax, int nTimeWindow, int nCutNum, int nRelaxRatio, int fVerbose )
{
Vec_Int_t * vOuts;
Gia_Man_t * pNew, * pWin, * pWinNew;
assert( !LevelMax != !nTimeWindow );
vOuts = Gia_ManFindLatest( p, LevelMax, nTimeWindow );
if ( fVerbose )
printf( "Collected %d outputs to extract.\n", Vec_IntSize(vOuts) );
if ( Vec_IntSize(vOuts) == 0 )
{
Vec_IntFree( vOuts );
return Gia_ManDup( p );
}
pWin = Gia_ManExtractWin( p, vOuts, 0 );
pWinNew = Gia_ManPerformSopBalance( pWin, nCutNum, nRelaxRatio, fVerbose );
Gia_ManStop( pWin );
pNew = Gia_ManInsertWin( p, vOuts, pWinNew );
Gia_ManStop( pWinNew );
Vec_IntFree( vOuts );
return pNew;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t * Gia_ManPerformDsdBalanceWin( Gia_Man_t * p, int LevelMax, int nTimeWindow, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose )
{
Vec_Int_t * vOuts;
Gia_Man_t * pNew, * pWin, * pWinNew;
assert( !LevelMax != !nTimeWindow );
vOuts = Gia_ManFindLatest( p, LevelMax, nTimeWindow );
if ( fVerbose )
printf( "Collected %d outputs to extract.\n", Vec_IntSize(vOuts) );
if ( Vec_IntSize(vOuts) == 0 )
{
Vec_IntFree( vOuts );
return Gia_ManDup( p );
}
pWin = Gia_ManExtractWin( p, vOuts, 0 );
pWinNew = Gia_ManPerformDsdBalance( pWin, nLutSize, nCutNum, nRelaxRatio, fVerbose );
Gia_ManStop( pWin );
pNew = Gia_ManInsertWin( p, vOuts, pWinNew );
Gia_ManStop( pWinNew );
Vec_IntFree( vOuts );
return pNew;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
|
d977e34947e9f8a84d217e9d24ccc4059b888bc4
|
248f9d022d678a8e12e84b9ed004d1f544b1962d
|
/lib_standard_app/base58.h
|
f214afd82437abeccd8e0ab2664fe59c2d42657b
|
[
"Apache-2.0"
] |
permissive
|
LedgerHQ/nanos-secure-sdk
|
09893a7ed38adb1d814bec75216f6dc137e212e8
|
12e5f6f875bf5deb9464b944f50079aaca1a3b98
|
refs/heads/master
| 2023-09-04T10:38:06.237940
| 2023-09-01T11:37:06
| 2023-09-01T11:37:06
| 64,407,069
| 102
| 69
|
Apache-2.0
| 2023-06-28T07:13:03
| 2016-07-28T15:30:40
|
C
|
UTF-8
|
C
| false
| false
| 1,277
|
h
|
base58.h
|
#pragma once
#include <stddef.h> // size_t
#include <stdint.h> // uint*_t
#include <stdbool.h> // bool
/**
* Maximum length of input when decoding in base 58.
*/
#define MAX_DEC_INPUT_SIZE 164
/**
* Maximum length of input when encoding in base 58.
*/
#define MAX_ENC_INPUT_SIZE 120
/**
* Decode input string in base 58.
*
* @see https://tools.ietf.org/html/draft-msporny-base58-02
*
* @param[in] in
* Pointer to input string buffer.
* @param[in] in_len
* Length of the input string buffer.
* @param[out] out
* Pointer to output byte buffer.
* @param[in] out_len
* Maximum length to write in output byte buffer.
*
* @return number of bytes decoded, -1 otherwise.
*
*/
int base58_decode(const char *in, size_t in_len, uint8_t *out, size_t out_len);
/**
* Encode input bytes in base 58.
*
* @see https://tools.ietf.org/html/draft-msporny-base58-02
*
* @param[in] in
* Pointer to input byte buffer.
* @param[in] in_len
* Length of the input byte buffer.
* @param[out] out
* Pointer to output string buffer.
* @param[in] out_len
* Maximum length to write in output byte buffer.
*
* @return number of bytes encoded, -1 otherwise.
*
*/
int base58_encode(const uint8_t *in, size_t in_len, char *out, size_t out_len);
|
15589d962e3db2262db79a41b5fb8ecbf2a5c9e6
|
ff44afc42082479d929e59c0100457f63cdf1028
|
/dart-impl/base/include/dash/dart/base/atomic.h
|
57264ddf7ff97363f52b89d0a3e6a14662f3604b
|
[
"BSD-3-Clause"
] |
permissive
|
dash-project/dash
|
122f3f3106c4d6b0215908a3a28c565d46d66f56
|
99f299572bbb42f6668fbe704b179b9b5d0da92b
|
refs/heads/development
| 2021-08-19T13:28:46.595300
| 2021-04-28T08:24:20
| 2021-04-28T08:24:20
| 45,930,061
| 178
| 47
|
NOASSERTION
| 2021-06-09T12:24:54
| 2015-11-10T17:56:37
|
C++
|
UTF-8
|
C
| false
| false
| 12,219
|
h
|
atomic.h
|
/*
* \file atomic.h
*
* Provides atomic operations on basic integer data types.
* Feel free to add operations you may require.
*
* See the URL below for details on the operations:
* https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html#g_t_005f_005fsync-Builtins
*
* See also the file kmp_os.h of the Clang OpenMP library, which served as inspiration.
*
* TODO: Check that all compilers support these intrinsics, esp. Cray?
*/
#ifndef DASH_DART_BASE_ATOMIC_H_
#define DASH_DART_BASE_ATOMIC_H_
#include <stdint.h>
#if DART_HAVE_SYNC_BUILTINS
/**
* Atomic operations using the __sync* builtin functions.
*
* All macros are specialized for 64, 32, 16, and 8 bit wide integers
* as well as for pointer types.
*
* See https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html#g_t_005f_005fsync-Builtins
* for details.
*
* Fall-back options are provided as unsafe options in case the built-in
* functions are not available.
*/
#define DART_FETCH64(ptr) \
DART_FETCH_AND_ADD64(ptr, 0)
#define DART_FETCH32(ptr) \
DART_FETCH_AND_ADD32(ptr, 0)
#define DART_FETCH16(ptr) \
DART_FETCH_AND_ADD16(ptr, 0)
#define DART_FETCH8(ptr) \
DART_FETCH_AND_ADD8(ptr, 0)
#define DART_FETCHPTR(ptr) \
DART_FETCH_AND_ADDPTR(ptr, 0)
#define DART_FETCH_AND_ADD64(ptr, val) \
__sync_fetch_and_add((int64_t *)(ptr), (val))
#define DART_FETCH_AND_ADD32(ptr, val) \
__sync_fetch_and_add((int32_t *)(ptr), (val))
#define DART_FETCH_AND_ADD16(ptr, val) \
__sync_fetch_and_add((int16_t *)(ptr), (val))
#define DART_FETCH_AND_ADD8(ptr, val) \
__sync_fetch_and_add((int8_t *)(ptr), (val))
#define DART_FETCH_AND_SUB64(ptr, val) \
__sync_fetch_and_sub((int64_t *)(ptr), (val))
#define DART_FETCH_AND_SUB32(ptr, val) \
__sync_fetch_and_sub((int32_t *)(ptr), (val))
#define DART_FETCH_AND_SUB16(ptr, val) \
__sync_fetch_and_sub((int16_t *)(ptr), (val))
#define DART_FETCH_AND_SUB8(ptr, val) \
__sync_fetch_and_sub((int8_t *)(ptr), (val))
#define DART_FETCH_AND_INC64(ptr) \
__sync_fetch_and_add((int64_t *)(ptr), 1LL)
#define DART_FETCH_AND_INC32(ptr) \
__sync_fetch_and_add((int32_t *)(ptr), 1)
#define DART_FETCH_AND_INC16(ptr) \
__sync_fetch_and_add((int16_t *)(ptr), 1)
#define DART_FETCH_AND_INC8(ptr) \
__sync_fetch_and_add((int8_t *)(ptr), 1)
#define DART_FETCH_AND_INCPTR(ptr) \
__sync_fetch_and_add((void **)(ptr), sizeof(**(ptr)))
#define DART_FETCH_AND_DEC64(ptr) \
__sync_fetch_and_sub((int64_t *)(ptr), 1LL)
#define DART_FETCH_AND_DEC32(ptr) \
__sync_fetch_and_sub((int32_t *)(ptr), 1)
#define DART_FETCH_AND_DEC16(ptr) \
__sync_fetch_and_sub((int16_t *)(ptr), 1)
#define DART_FETCH_AND_DEC8(ptr) \
__sync_fetch_and_sub((int8_t *)(ptr), 1)
#define DART_FETCH_AND_DECPTR(ptr) \
__sync_fetch_and_sub((void **)(ptr), sizeof(**(ptr)))
#define DART_ADD_AND_FETCH64(ptr, val) \
__sync_add_and_fetch((int64_t *)(ptr), (val))
#define DART_ADD_AND_FETCH32(ptr, val) \
__sync_add_and_fetch((int32_t *)(ptr), (val))
#define DART_ADD_AND_FETCH16(ptr, val) \
__sync_add_and_fetch((int16_t *)(ptr), (val))
#define DART_ADD_AND_FETCH8(ptr, val) \
__sync_add_and_fetch((int8_t *)(ptr), (val))
#define DART_ADD_AND_FETCHPTR(ptr, cnt) \
__sync_fetch_and_sub((void **)(ptr), (cnt) * sizeof(**(ptr)))
#define DART_SUB_AND_FETCH64(ptr, val) \
__sync_sub_and_fetch((int64_t *)(ptr), (val))
#define DART_SUB_AND_FETCH32(ptr, val) \
__sync_sub_and_fetch((int32_t *)(ptr), (val))
#define DART_SUB_AND_FETCH16(ptr, val) \
__sync_sub_and_fetch((int16_t *)(ptr), (val))
#define DART_SUB_AND_FETCH8(ptr, val) \
__sync_sub_and_fetch((int8_t *)(ptr), (val))
#define DART_SUB_AND_FETCHPTR(ptr, cnt) \
__sync_sub_and_fetch((void **)(ptr), (cnt) * sizeof(**(ptr)))
#define DART_INC_AND_FETCH64(ptr) \
__sync_add_and_fetch((int64_t *)(ptr), 1LL)
#define DART_INC_AND_FETCH32(ptr) \
__sync_add_and_fetch((int32_t *)(ptr), 1)
#define DART_INC_AND_FETCH16(ptr) \
__sync_add_and_fetch((int16_t *)(ptr), 1)
#define DART_INC_AND_FETCH8(ptr) \
__sync_add_and_fetch((int8_t *)(ptr), 1)
#define DART_INC_AND_FETCHPTR(ptr) \
__sync_add_and_fetch((void **)(ptr), sizeof(**(ptr)))
#define DART_DEC_AND_FETCH64(ptr) \
__sync_sub_and_fetch((int64_t *)(ptr), 1LL)
#define DART_DEC_AND_FETCH32(ptr) \
__sync_sub_and_fetch((int32_t *)(ptr), 1)
#define DART_DEC_AND_FETCH16(ptr) \
__sync_sub_and_fetch((int16_t *)(ptr), 1)
#define DART_DEC_AND_FETCH8(ptr) \
__sync_sub_and_fetch((int8_t *)(ptr), 1)
#define DART_DEC_AND_FETCHPTR(ptr) \
__sync_sub_and_fetch((void **)(ptr), sizeof(**(ptr)))
#define DART_COMPARE_AND_SWAP64(ptr, oldval, newval) \
__sync_val_compare_and_swap((int64_t *)(ptr), \
(int64_t )(oldval), \
(int64_t )(newval))
#define DART_COMPARE_AND_SWAP32(ptr, oldval, newval) \
__sync_val_compare_and_swap((int32_t *)(ptr), \
(int32_t )(oldval), \
(int32_t )(newval))
#define DART_COMPARE_AND_SWAP16(ptr, oldval, newval) \
__sync_val_compare_and_swap((int16_t *)(ptr), \
(int16_t )(oldval), \
(int16_t )(newval))
#define DART_COMPARE_AND_SWAP8(ptr, oldval, newval) \
__sync_val_compare_and_swap((int8_t *)(ptr), \
(int8_t )(oldval), \
(int8_t )(newval))
#define DART_COMPARE_AND_SWAPPTR(ptr, oldval, newval) \
__sync_val_compare_and_swap((void **)(ptr), \
(void *)(oldval), \
(void *)(newval))
#else
#define DART_MAYBE_UNUSED __attribute__((unused))
/**
* Fall-back version in case __sync* functions are not available.
*
* These surrogates are NOT THREADSAFE!
*/
static inline int64_t
DART_MAYBE_UNUSED
__fetch_and_add64(int64_t *ptr, int64_t val) {
int64_t res = *ptr;
*ptr += val;
return res;
}
static inline int32_t
DART_MAYBE_UNUSED
__fetch_and_add32(int32_t *ptr, int32_t val) {
int32_t res = *ptr;
*ptr += val;
return res;
}
static inline int16_t
DART_MAYBE_UNUSED
__fetch_and_add16(int16_t *ptr, int16_t val) {
int16_t res = *ptr;
*ptr += val;
return res;
}
static inline int8_t
DART_MAYBE_UNUSED
__fetch_and_add8(int8_t *ptr, int8_t val) {
int8_t res = *ptr;
*ptr += val;
return res;
}
static inline void *
DART_MAYBE_UNUSED
__fetch_and_addptr(char **ptr, int64_t val) {
char * res = *ptr;
*ptr += val;
return res;
}
#define DART_FETCH_AND_ADD64(ptr, val) \
__fetch_and_add64((ptr), (val))
#define DART_FETCH_AND_ADD32(ptr, val) \
__fetch_and_add32((ptr), (val))
#define DART_FETCH_AND_ADD16(ptr, val) \
__fetch_and_add16((ptr), (val))
#define DART_FETCH_AND_ADD8(ptr, val) \
__fetch_and_add8((ptr), (val))
#define DART_FETCH_AND_SUB64(ptr, val) \
__fetch_and_add64((ptr), (-1) * (val))
#define DART_FETCH_AND_SUB32(ptr, val) \
__fetch_and_add32((ptr), (-1) * (val))
#define DART_FETCH_AND_SUB16(ptr, val) \
__fetch_and_add16((ptr), (-1) * (val))
#define DART_FETCH_AND_SUB8(ptr, val) \
__fetch_and_add8((ptr), (-1) * (val))
#define DART_FETCH_AND_INC64(ptr) \
((*(int64_t *)ptr)++)
#define DART_FETCH_AND_INC32(ptr) \
((*(int64_t *)ptr)++)
#define DART_FETCH_AND_INC16(ptr) \
((*(int64_t *)ptr)++)
#define DART_FETCH_AND_INC8(ptr) \
((*(int64_t *)ptr)++)
#define DART_FETCH_AND_INCPTR(ptr) \
__fetch_and_addptr((void **)(ptr), sizeof(**(ptr)))
#define DART_FETCH_AND_DEC64(ptr) \
((*(int64_t *)ptr)--)
#define DART_FETCH_AND_DEC32(ptr) \
((*(int32_t *)ptr)--)
#define DART_FETCH_AND_DEC16(ptr) \
((*(int16_t *)ptr)--)
#define DART_FETCH_AND_DEC8(ptr) \
((*(int8_t *)ptr)--)
#define DART_FETCH_AND_DECPTR(ptr) \
__fetch_and_addptr((char **)(ptr), (-1) * sizeof(**(ptr)))
#define DART_ADD_AND_FETCH64(ptr, val) \
(*(int64_t *)ptr += (val))
#define DART_ADD_AND_FETCH32(ptr, val) \
(*(int32_t *)ptr += (val))
#define DART_ADD_AND_FETCH16(ptr, val) \
(*(int16_t *)ptr += (val))
#define DART_ADD_AND_FETCH8(ptr, val) \
(*(int8_t *)ptr += (val))
#define DART_ADD_AND_FETCHPTR(ptr, cnt) \
(void*)(*(char **)ptr += (cnt) * sizeof(**(ptr)))
#define DART_SUB_AND_FETCH64(ptr, val) \
(*(int64_t *)(ptr) -= (val))
#define DART_SUB_AND_FETCH32(ptr, val) \
(*(int32_t *)(ptr) -= (val))
#define DART_SUB_AND_FETCH16(ptr, val) \
(*(int16_t *)(ptr) -= (val))
#define DART_SUB_AND_FETCH8(ptr, val) \
(*(int8_t *)(ptr) -= (val))
#define DART_SUB_AND_FETCHPTR(ptr, cnt) \
(void*)(*(char **)(ptr) -= (cnt) * sizeof(**(ptr)))
#define DART_INC_AND_FETCH64(ptr) \
(++(*(int64_t *)(ptr)))
#define DART_INC_AND_FETCH32(ptr) \
(++(*(int32_t *)(ptr)))
#define DART_INC_AND_FETCH16(ptr) \
(++(*(int16_t *)(ptr)))
#define DART_INC_AND_FETCH8(ptr) \
(++(*(int8_t *)(ptr)))
#define DART_INC_AND_FETCHPTR(ptr) \
(++(*(void **)(ptr)))
#define DART_DEC_AND_FETCH64(ptr) \
(--(*(int64_t *)(ptr)))
#define DART_DEC_AND_FETCH32(ptr) \
(--(*(int32_t *)(ptr)))
#define DART_DEC_AND_FETCH16(ptr) \
(--(*(int16_t *)(ptr)))
#define DART_DEC_AND_FETCH8(ptr) \
(--(*(int8_t *)(ptr)))
#define DART_DEC_AND_FETCHPTR(ptr) \
(--(*(void **)(ptr)))
static inline int64_t
DART_MAYBE_UNUSED
__compare_and_swap64(int64_t *ptr, int64_t oldval, int64_t newval) {
int64_t res = *ptr;
if (*ptr == oldval) {
*ptr = newval;
}
return res;
}
static inline int32_t
DART_MAYBE_UNUSED
__compare_and_swap32(int32_t *ptr, int32_t oldval, int32_t newval) {
int32_t res = *ptr;
if (*ptr == oldval) {
*ptr = newval;
}
return res;
}
static inline int16_t
DART_MAYBE_UNUSED
__compare_and_swap16(int16_t *ptr, int16_t oldval, int16_t newval) {
int16_t res = *ptr;
if (*ptr == oldval) {
*ptr = newval;
}
return res;
}
static inline int8_t
DART_MAYBE_UNUSED
__compare_and_swap8(int8_t *ptr, int8_t oldval, int8_t newval) {
int8_t res = *ptr;
if (*ptr == oldval) {
*ptr = newval;
}
return res;
}
static inline void*
DART_MAYBE_UNUSED
__compare_and_swapptr(void **ptr, void *oldval, void *newval) {
void *res = *ptr;
if (*ptr == oldval) {
*ptr = newval;
}
return res;
}
#define DART_COMPARE_AND_SWAP64(ptr, oldval, newval) \
__compare_and_swap64((int64_t *)(ptr), \
(int64_t )(oldval), \
(int64_t )(newval))
#define DART_COMPARE_AND_SWAP32(ptr, oldval, newval) \
__compare_and_swap32((int32_t *)(ptr), \
(int32_t )(oldval), \
(int32_t )(newval))
#define DART_COMPARE_AND_SWAP16(ptr, oldval, newval) \
__compare_and_swap16((int16_t *)(ptr), \
(int16_t )(oldval), \
(int16_t )(newval))
#define DART_COMPARE_AND_SWAP8(ptr, oldval, newval) \
__compare_and_swap8((int8_t *)(ptr), \
(int8_t )(oldval), \
(int8_t )(newval))
#define DART_COMPARE_AND_SWAPPTR(ptr, oldval, newval) \
__compare_and_swapptr((void **)(ptr), \
(void *)(oldval), \
(void *)(newval))
#endif /* DART_HAVE_SYNC_BUILTINS */
#endif /* DASH_DART_BASE_ATOMIC_H_ */
|
c04d982e55e776f9adb2c5a06e7b98a007dca74f
|
4ed2d6d3646dbcc3676aed7ed6297cc827048876
|
/Core/debugger.c
|
5142111a655eeea5223c85868573549260a196c4
|
[
"MIT"
] |
permissive
|
LIJI32/SameBoy
|
6ece0d745887e66078ae71080eb52415fbb872fb
|
7542de74e750738d3405f496eca0c5fbc6108c5b
|
refs/heads/master
| 2023-08-29T05:10:29.296103
| 2023-08-19T14:05:02
| 2023-08-19T14:05:02
| 55,260,928
| 1,424
| 233
|
MIT
| 2023-09-04T18:53:12
| 2016-04-01T20:39:14
|
C
|
UTF-8
|
C
| false
| false
| 103,901
|
c
|
debugger.c
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "gb.h"
typedef struct {
bool has_bank;
uint16_t bank:9;
uint16_t value;
} value_t;
typedef struct {
enum {
LVALUE_MEMORY,
LVALUE_MEMORY16,
LVALUE_REG16,
LVALUE_REG_H,
LVALUE_REG_L,
} kind;
union {
uint16_t *register_address;
value_t memory_address;
};
} lvalue_t;
#define VALUE_16(x) ((value_t){false, 0, (x)})
struct GB_breakpoint_s {
unsigned id;
union {
struct {
uint16_t addr;
uint16_t bank; /* -1 = any bank*/
};
uint32_t key; /* For sorting and comparing */
};
char *condition;
bool is_jump_to;
uint16_t length;
bool inclusive;
};
#define BP_KEY(x) (((struct GB_breakpoint_s){.addr = ((x).value), .bank = (x).has_bank? (x).bank : -1 }).key)
#define WATCHPOINT_READ (1)
#define WATCHPOINT_WRITE (2)
struct GB_watchpoint_s {
unsigned id;
union {
struct {
uint16_t addr;
uint16_t bank; /* -1 = any bank*/
};
uint32_t key; /* For sorting and comparing */
};
char *condition;
uint8_t flags;
uint16_t length;
bool inclusive;
};
#define WP_KEY(x) (((struct GB_watchpoint_s){.addr = ((x).value), .bank = (x).has_bank? (x).bank : -1 }).key)
static uint16_t bank_for_addr(GB_gameboy_t *gb, uint16_t addr)
{
if (addr < 0x4000) {
return gb->mbc_rom0_bank;
}
if (addr < 0x8000) {
return gb->mbc_rom_bank;
}
if (addr < 0xD000) {
return 0;
}
if (addr < 0xE000) {
return gb->cgb_ram_bank;
}
return 0;
}
typedef struct {
uint16_t rom0_bank;
uint16_t rom_bank;
uint8_t mbc_ram_bank;
bool mbc_ram_enable;
uint8_t ram_bank;
uint8_t vram_bank;
} banking_state_t;
static inline void save_banking_state(GB_gameboy_t *gb, banking_state_t *state)
{
state->rom0_bank = gb->mbc_rom0_bank;
state->rom_bank = gb->mbc_rom_bank;
state->mbc_ram_bank = gb->mbc_ram_bank;
state->mbc_ram_enable = gb->mbc_ram_enable;
state->ram_bank = gb->cgb_ram_bank;
state->vram_bank = gb->cgb_vram_bank;
}
static inline void restore_banking_state(GB_gameboy_t *gb, banking_state_t *state)
{
gb->mbc_rom0_bank = state->rom0_bank;
gb->mbc_rom_bank = state->rom_bank;
gb->mbc_ram_bank = state->mbc_ram_bank;
gb->mbc_ram_enable = state->mbc_ram_enable;
gb->cgb_ram_bank = state->ram_bank;
gb->cgb_vram_bank = state->vram_bank;
}
static inline void switch_banking_state(GB_gameboy_t *gb, uint16_t bank)
{
gb->mbc_rom0_bank = bank;
gb->mbc_rom_bank = bank;
gb->mbc_ram_bank = bank;
gb->mbc_ram_enable = true;
if (GB_is_cgb(gb)) {
gb->cgb_ram_bank = bank & 7;
gb->cgb_vram_bank = bank & 1;
if (gb->cgb_ram_bank == 0) {
gb->cgb_ram_bank = 1;
}
}
}
static const char *value_to_string(GB_gameboy_t *gb, uint16_t value, bool prefer_name, bool prefer_local)
{
static __thread char output[256];
const GB_bank_symbol_t *symbol = GB_debugger_find_symbol(gb, value, prefer_local);
if (symbol && (value - symbol->addr > 0x1000 || symbol->addr == 0) ) {
symbol = NULL;
}
if (!symbol) {
snprintf(output, sizeof(output), "$%04x", value);
}
else if (symbol->addr == value) {
if (prefer_name) {
snprintf(output, sizeof(output), "%s ($%04x)", symbol->name, value);
}
else {
snprintf(output, sizeof(output), "$%04x (%s)", value, symbol->name);
}
}
else {
if (prefer_name) {
snprintf(output, sizeof(output), "%s+$%03x ($%04x)", symbol->name, value - symbol->addr, value);
}
else {
snprintf(output, sizeof(output), "$%04x (%s+$%03x)", value, symbol->name, value - symbol->addr);
}
}
return output;
}
static GB_symbol_map_t *get_symbol_map(GB_gameboy_t *gb, uint16_t bank)
{
if (bank >= gb->n_symbol_maps) {
return NULL;
}
return gb->bank_symbols[bank];
}
static const char *debugger_value_to_string(GB_gameboy_t *gb, value_t value, bool prefer_name, bool prefer_local)
{
if (!value.has_bank) return value_to_string(gb, value.value, prefer_name, prefer_local);
static __thread char output[256];
const GB_bank_symbol_t *symbol = GB_map_find_symbol(get_symbol_map(gb, value.bank), value.value, prefer_local);
if (symbol && (value.value - symbol->addr > 0x1000 || symbol->addr == 0) ) {
symbol = NULL;
}
if (!symbol) {
snprintf(output, sizeof(output), "$%02x:$%04x", value.bank, value.value);
}
else if (symbol->addr == value.value) {
if (prefer_name) {
snprintf(output, sizeof(output), "%s ($%02x:$%04x)", symbol->name, value.bank, value.value);
}
else {
snprintf(output, sizeof(output), "$%02x:$%04x (%s)", value.bank, value.value, symbol->name);
}
}
else {
if (prefer_name) {
snprintf(output, sizeof(output), "%s+$%03x ($%02x:$%04x)", symbol->name, value.value - symbol->addr, value.bank, value.value);
}
else {
snprintf(output, sizeof(output), "$%02x:$%04x (%s+$%03x)", value.bank, value.value, symbol->name, value.value - symbol->addr);
}
}
return output;
}
static value_t read_lvalue(GB_gameboy_t *gb, lvalue_t lvalue)
{
/* Not used until we add support for operators like += */
switch (lvalue.kind) {
case LVALUE_MEMORY:
if (lvalue.memory_address.has_bank) {
banking_state_t state;
save_banking_state(gb, &state);
switch_banking_state(gb, lvalue.memory_address.bank);
value_t r = VALUE_16(GB_read_memory(gb, lvalue.memory_address.value));
restore_banking_state(gb, &state);
return r;
}
return VALUE_16(GB_read_memory(gb, lvalue.memory_address.value));
case LVALUE_MEMORY16:
if (lvalue.memory_address.has_bank) {
banking_state_t state;
save_banking_state(gb, &state);
switch_banking_state(gb, lvalue.memory_address.bank);
value_t r = VALUE_16(GB_read_memory(gb, lvalue.memory_address.value) |
(GB_read_memory(gb, lvalue.memory_address.value + 1) * 0x100));
restore_banking_state(gb, &state);
return r;
}
return VALUE_16(GB_read_memory(gb, lvalue.memory_address.value) |
(GB_read_memory(gb, lvalue.memory_address.value + 1) * 0x100));
case LVALUE_REG16:
return VALUE_16(*lvalue.register_address);
case LVALUE_REG_L:
return VALUE_16(*lvalue.register_address & 0x00FF);
case LVALUE_REG_H:
return VALUE_16(*lvalue.register_address >> 8);
}
return VALUE_16(0);
}
static void write_lvalue(GB_gameboy_t *gb, lvalue_t lvalue, uint16_t value)
{
switch (lvalue.kind) {
case LVALUE_MEMORY:
if (lvalue.memory_address.has_bank) {
banking_state_t state;
save_banking_state(gb, &state);
switch_banking_state(gb, lvalue.memory_address.bank);
GB_write_memory(gb, lvalue.memory_address.value, value);
restore_banking_state(gb, &state);
return;
}
GB_write_memory(gb, lvalue.memory_address.value, value);
return;
case LVALUE_MEMORY16:
if (lvalue.memory_address.has_bank) {
banking_state_t state;
save_banking_state(gb, &state);
switch_banking_state(gb, lvalue.memory_address.bank);
GB_write_memory(gb, lvalue.memory_address.value, value);
GB_write_memory(gb, lvalue.memory_address.value + 1, value >> 8);
restore_banking_state(gb, &state);
return;
}
GB_write_memory(gb, lvalue.memory_address.value, value);
GB_write_memory(gb, lvalue.memory_address.value + 1, value >> 8);
return;
case LVALUE_REG16:
*lvalue.register_address = value;
return;
case LVALUE_REG_L:
*lvalue.register_address &= 0xFF00;
*lvalue.register_address |= value & 0xFF;
return;
case LVALUE_REG_H:
*lvalue.register_address &= 0x00FF;
*lvalue.register_address |= value << 8;
return;
}
}
/* 16 bit value <op> 16 bit value = 16 bit value
25 bit address <op> 16 bit value = 25 bit address
16 bit value <op> 25 bit address = 25 bit address
25 bit address <op> 25 bit address = 16 bit value (since adding pointers, for examples, makes no sense)
Boolean operators always return a 16-bit value
*/
#define FIX_BANK(x) ((value_t){a.has_bank ^ b.has_bank, a.has_bank? a.bank : b.bank, (x)})
static value_t add(value_t a, value_t b) {return FIX_BANK(a.value + b.value);}
static value_t sub(value_t a, value_t b) {return FIX_BANK(a.value - b.value);}
static value_t mul(value_t a, value_t b) {return FIX_BANK(a.value * b.value);}
static value_t _div(value_t a, value_t b)
{
if (b.value == 0) {
return FIX_BANK(0);
}
return FIX_BANK(a.value / b.value);
};
static value_t mod(value_t a, value_t b)
{
if (b.value == 0) {
return FIX_BANK(0);
}
return FIX_BANK(a.value % b.value);
};
static value_t and(value_t a, value_t b) {return FIX_BANK(a.value & b.value);}
static value_t or(value_t a, value_t b) {return FIX_BANK(a.value | b.value);}
static value_t xor(value_t a, value_t b) {return FIX_BANK(a.value ^ b.value);}
static value_t shleft(value_t a, value_t b) {return FIX_BANK(a.value << b.value);}
static value_t shright(value_t a, value_t b) {return FIX_BANK(a.value >> b.value);}
static value_t assign(GB_gameboy_t *gb, lvalue_t a, uint16_t b)
{
write_lvalue(gb, a, b);
return read_lvalue(gb, a);
}
static value_t bool_and(value_t a, value_t b) {return VALUE_16(a.value && b.value);}
static value_t bool_or(value_t a, value_t b) {return VALUE_16(a.value || b.value);}
static value_t equals(value_t a, value_t b) {return VALUE_16(a.value == b.value);}
static value_t different(value_t a, value_t b) {return VALUE_16(a.value != b.value);}
static value_t lower(value_t a, value_t b) {return VALUE_16(a.value < b.value);}
static value_t greater(value_t a, value_t b) {return VALUE_16(a.value > b.value);}
static value_t lower_equals(value_t a, value_t b) {return VALUE_16(a.value <= b.value);}
static value_t greater_equals(value_t a, value_t b) {return VALUE_16(a.value >= b.value);}
static value_t bank(value_t a, value_t b) {return (value_t) {true, a.value, b.value};}
static struct {
const char *string;
int8_t priority;
value_t (*operator)(value_t, value_t);
value_t (*lvalue_operator)(GB_gameboy_t *, lvalue_t, uint16_t);
} operators[] =
{
// Yes. This is not C-like. But it makes much more sense.
// Deal with it.
{"+", 0, add},
{"-", 0, sub},
{"||", 0, bool_or},
{"|", 0, or},
{"*", 1, mul},
{"/", 1, _div},
{"%", 1, mod},
{"&&", 1, bool_and},
{"&", 1, and},
{"^", 1, xor},
{"<<", 2, shleft},
{"<=", 3, lower_equals},
{"<", 3, lower},
{">>", 2, shright},
{">=", 3, greater_equals},
{">", 3, greater},
{"==", 3, equals},
{"=", -1, NULL, assign},
{"!=", 3, different},
{":", 4, bank},
};
value_t debugger_evaluate(GB_gameboy_t *gb, const char *string,
size_t length, bool *error,
uint16_t *watchpoint_address, uint8_t *watchpoint_new_value);
static lvalue_t debugger_evaluate_lvalue(GB_gameboy_t *gb, const char *string,
size_t length, bool *error,
uint16_t *watchpoint_address, uint8_t *watchpoint_new_value)
{
*error = false;
// Strip whitespace
while (length && (string[0] == ' ' || string[0] == '\n' || string[0] == '\r' || string[0] == '\t')) {
string++;
length--;
}
while (length && (string[length-1] == ' ' || string[length-1] == '\n' || string[length-1] == '\r' || string[length-1] == '\t')) {
length--;
}
if (length == 0) {
GB_log(gb, "Expected expression.\n");
*error = true;
return (lvalue_t){0,};
}
if (string[0] == '(' && string[length - 1] == ')') {
// Attempt to strip parentheses
signed depth = 0;
for (unsigned i = 0; i < length; i++) {
if (string[i] == '(') depth++;
if (depth == 0) {
// First and last are not matching
depth = 1;
break;
}
if (string[i] == ')') depth--;
}
if (depth == 0) return debugger_evaluate_lvalue(gb, string + 1, length - 2, error, watchpoint_address, watchpoint_new_value);
}
else if (string[0] == '[' && string[length - 1] == ']') {
// Attempt to strip square parentheses (memory dereference)
signed depth = 0;
for (unsigned i = 0; i < length; i++) {
if (string[i] == '[') depth++;
if (depth == 0) {
// First and last are not matching
depth = 1;
break;
}
if (string[i] == ']') depth--;
}
if (depth == 0) {
return (lvalue_t){LVALUE_MEMORY, .memory_address = debugger_evaluate(gb, string + 1, length - 2, error, watchpoint_address, watchpoint_new_value)};
}
}
else if (string[0] == '{' && string[length - 1] == '}') {
// Attempt to strip curly parentheses (memory dereference)
signed depth = 0;
for (unsigned i = 0; i < length; i++) {
if (string[i] == '{') depth++;
if (depth == 0) {
// First and last are not matching
depth = 1;
break;
}
if (string[i] == '}') depth--;
}
if (depth == 0) {
return (lvalue_t){LVALUE_MEMORY16, .memory_address = debugger_evaluate(gb, string + 1, length - 2, error, watchpoint_address, watchpoint_new_value)};
}
}
// Registers
if (string[0] != '$' && (string[0] < '0' || string[0] > '9')) {
if (length == 1) {
switch (string[0]) {
case 'a': return (lvalue_t){LVALUE_REG_H, .register_address = &gb->af};
case 'f': return (lvalue_t){LVALUE_REG_L, .register_address = &gb->af};
case 'b': return (lvalue_t){LVALUE_REG_H, .register_address = &gb->bc};
case 'c': return (lvalue_t){LVALUE_REG_L, .register_address = &gb->bc};
case 'd': return (lvalue_t){LVALUE_REG_H, .register_address = &gb->de};
case 'e': return (lvalue_t){LVALUE_REG_L, .register_address = &gb->de};
case 'h': return (lvalue_t){LVALUE_REG_H, .register_address = &gb->hl};
case 'l': return (lvalue_t){LVALUE_REG_L, .register_address = &gb->hl};
}
}
else if (length == 2) {
switch (string[0]) {
case 'a': if (string[1] == 'f') return (lvalue_t){LVALUE_REG16, .register_address = &gb->af};
case 'b': if (string[1] == 'c') return (lvalue_t){LVALUE_REG16, .register_address = &gb->bc};
case 'd': if (string[1] == 'e') return (lvalue_t){LVALUE_REG16, .register_address = &gb->de};
case 'h': if (string[1] == 'l') return (lvalue_t){LVALUE_REG16, .register_address = &gb->hl};
case 's': if (string[1] == 'p') return (lvalue_t){LVALUE_REG16, .register_address = &gb->sp};
case 'p': if (string[1] == 'c') return (lvalue_t){LVALUE_REG16, .register_address = &gb->pc};
}
}
GB_log(gb, "Unknown register: %.*s\n", (unsigned) length, string);
*error = true;
return (lvalue_t){0,};
}
GB_log(gb, "Expression is not an lvalue: %.*s\n", (unsigned) length, string);
*error = true;
return (lvalue_t){0,};
}
#define ERROR ((value_t){0,})
value_t debugger_evaluate(GB_gameboy_t *gb, const char *string,
size_t length, bool *error,
uint16_t *watchpoint_address, uint8_t *watchpoint_new_value)
{
/* Disable watchpoints while evaluating expressions */
uint16_t n_watchpoints = gb->n_watchpoints;
gb->n_watchpoints = 0;
value_t ret = ERROR;
*error = false;
// Strip whitespace
while (length && (string[0] == ' ' || string[0] == '\n' || string[0] == '\r' || string[0] == '\t')) {
string++;
length--;
}
while (length && (string[length-1] == ' ' || string[length-1] == '\n' || string[length-1] == '\r' || string[length-1] == '\t')) {
length--;
}
if (length == 0) {
GB_log(gb, "Expected expression.\n");
*error = true;
goto exit;
}
if (string[0] == '(' && string[length - 1] == ')') {
// Attempt to strip parentheses
signed depth = 0;
for (unsigned i = 0; i < length; i++) {
if (string[i] == '(') depth++;
if (depth == 0) {
// First and last are not matching
depth = 1;
break;
}
if (string[i] == ')') depth--;
}
if (depth == 0) {
ret = debugger_evaluate(gb, string + 1, length - 2, error, watchpoint_address, watchpoint_new_value);
goto exit;
}
}
else if (string[0] == '[' && string[length - 1] == ']') {
// Attempt to strip square parentheses (memory dereference)
signed depth = 0;
for (unsigned i = 0; i < length; i++) {
if (string[i] == '[') depth++;
if (depth == 0) {
// First and last are not matching
depth = 1;
break;
}
if (string[i] == ']') depth--;
}
if (depth == 0) {
value_t addr = debugger_evaluate(gb, string + 1, length - 2, error, watchpoint_address, watchpoint_new_value);
banking_state_t state;
if (addr.bank) {
save_banking_state(gb, &state);
switch_banking_state(gb, addr.bank);
}
ret = VALUE_16(GB_read_memory(gb, addr.value));
if (addr.bank) {
restore_banking_state(gb, &state);
}
goto exit;
}
}
else if (string[0] == '{' && string[length - 1] == '}') {
// Attempt to strip curly parentheses (memory dereference)
signed depth = 0;
for (unsigned i = 0; i < length; i++) {
if (string[i] == '{') depth++;
if (depth == 0) {
// First and last are not matching
depth = 1;
break;
}
if (string[i] == '}') depth--;
}
if (depth == 0) {
value_t addr = debugger_evaluate(gb, string + 1, length - 2, error, watchpoint_address, watchpoint_new_value);
banking_state_t state;
if (addr.bank) {
save_banking_state(gb, &state);
switch_banking_state(gb, addr.bank);
}
ret = VALUE_16(GB_read_memory(gb, addr.value) | (GB_read_memory(gb, addr.value + 1) * 0x100));
if (addr.bank) {
restore_banking_state(gb, &state);
}
goto exit;
}
}
// Search for lowest priority operator
signed depth = 0;
unsigned operator_index = -1;
unsigned operator_pos = 0;
for (unsigned i = 0; i < length; i++) {
if (string[i] == '(') depth++;
else if (string[i] == ')') depth--;
else if (string[i] == '[') depth++;
else if (string[i] == ']') depth--;
else if (depth == 0) {
for (unsigned j = 0; j < sizeof(operators) / sizeof(operators[0]); j++) {
unsigned operator_length = strlen(operators[j].string);
if (operator_length > length - i) continue; // Operator too long
if (memcmp(string + i, operators[j].string, operator_length) == 0) {
if (operator_index != -1 && operators[operator_index].priority < operators[j].priority) {
/* for supporting = vs ==, etc*/
i += operator_length - 1;
break;
}
// Found an operator!
operator_pos = i;
operator_index = j;
/* for supporting = vs ==, etc*/
i += operator_length - 1;
break;
}
}
}
}
if (operator_index != -1) {
unsigned right_start = (unsigned)(operator_pos + strlen(operators[operator_index].string));
value_t right = debugger_evaluate(gb, string + right_start, length - right_start, error, watchpoint_address, watchpoint_new_value);
if (*error) goto exit;
if (operators[operator_index].lvalue_operator) {
lvalue_t left = debugger_evaluate_lvalue(gb, string, operator_pos, error, watchpoint_address, watchpoint_new_value);
if (*error) goto exit;
ret = operators[operator_index].lvalue_operator(gb, left, right.value);
goto exit;
}
value_t left = debugger_evaluate(gb, string, operator_pos, error, watchpoint_address, watchpoint_new_value);
if (*error) goto exit;
ret = operators[operator_index].operator(left, right);
goto exit;
}
// Not an expression - must be a register or a literal
// Registers
if (string[0] != '$' && (string[0] < '0' || string[0] > '9')) {
if (length == 1) {
switch (string[0]) {
case 'a': ret = VALUE_16(gb->af >> 8); goto exit;
case 'f': ret = VALUE_16(gb->af & 0xFF); goto exit;
case 'b': ret = VALUE_16(gb->bc >> 8); goto exit;
case 'c': ret = VALUE_16(gb->bc & 0xFF); goto exit;
case 'd': ret = VALUE_16(gb->de >> 8); goto exit;
case 'e': ret = VALUE_16(gb->de & 0xFF); goto exit;
case 'h': ret = VALUE_16(gb->hl >> 8); goto exit;
case 'l': ret = VALUE_16(gb->hl & 0xFF); goto exit;
}
}
else if (length == 2) {
switch (string[0]) {
case 'a': if (string[1] == 'f') {ret = VALUE_16(gb->af); goto exit;}
case 'b': if (string[1] == 'c') {ret = VALUE_16(gb->bc); goto exit;}
case 'd': if (string[1] == 'e') {ret = VALUE_16(gb->de); goto exit;}
case 'h': if (string[1] == 'l') {ret = VALUE_16(gb->hl); goto exit;}
case 's': if (string[1] == 'p') {ret = VALUE_16(gb->sp); goto exit;}
case 'p': if (string[1] == 'c') {ret = (value_t){true, bank_for_addr(gb, gb->pc), gb->pc}; goto exit;}
}
}
else if (length == 3) {
if (watchpoint_address && memcmp(string, "old", 3) == 0) {
ret = VALUE_16(GB_read_memory(gb, *watchpoint_address));
goto exit;
}
if (watchpoint_new_value && memcmp(string, "new", 3) == 0) {
ret = VALUE_16(*watchpoint_new_value);
goto exit;
}
/* $new is identical to $old in read conditions */
if (watchpoint_address && memcmp(string, "new", 3) == 0) {
ret = VALUE_16(GB_read_memory(gb, *watchpoint_address));
goto exit;
}
}
char symbol_name[length + 1];
memcpy(symbol_name, string, length);
symbol_name[length] = 0;
const GB_symbol_t *symbol = GB_reversed_map_find_symbol(&gb->reversed_symbol_map, symbol_name);
if (symbol) {
ret = (value_t){true, symbol->bank, symbol->addr};
goto exit;
}
GB_log(gb, "Unknown register or symbol: %.*s\n", (unsigned) length, string);
*error = true;
goto exit;
}
char *end;
unsigned base = 10;
if (string[0] == '$') {
string++;
base = 16;
length--;
}
uint16_t literal = (uint16_t) (strtol(string, &end, base));
if (end != string + length) {
GB_log(gb, "Failed to parse: %.*s\n", (unsigned) length, string);
*error = true;
goto exit;
}
ret = VALUE_16(literal);
exit:
gb->n_watchpoints = n_watchpoints;
return ret;
}
static void update_debug_active(GB_gameboy_t *gb)
{
gb->debug_active = !gb->debug_disable && (gb->debug_stopped || gb->debug_fin_command || gb->debug_next_command || gb->breakpoints);
}
struct debugger_command_s;
typedef bool debugger_command_imp_t(GB_gameboy_t *gb, char *arguments, char *modifiers, const struct debugger_command_s *command);
typedef char *debugger_completer_imp_t(GB_gameboy_t *gb, const char *string, uintptr_t *context);
typedef struct debugger_command_s {
const char *command;
uint8_t min_length;
debugger_command_imp_t *implementation;
const char *help_string; // Null if should not appear in help
const char *arguments_format; // For usage message
const char *modifiers_format; // For usage message
debugger_completer_imp_t *argument_completer;
debugger_completer_imp_t *modifiers_completer;
} debugger_command_t;
static const char *lstrip(const char *str)
{
while (*str == ' ' || *str == '\t') {
str++;
}
return str;
}
#define STOPPED_ONLY \
if (!gb->debug_stopped) { \
GB_log(gb, "Program is running, use 'interrupt' to stop execution.\n"); \
return false; \
}
#define NO_MODIFIERS \
if (modifiers) { \
print_usage(gb, command); \
return true; \
}
static void print_usage(GB_gameboy_t *gb, const debugger_command_t *command)
{
GB_log(gb, "Usage: %s", command->command);
if (command->modifiers_format) {
GB_log(gb, "[/%s]", command->modifiers_format);
}
if (command->arguments_format) {
GB_log(gb, " %s", command->arguments_format);
}
GB_log(gb, "\n");
}
static bool cont(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
STOPPED_ONLY
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
gb->debug_stopped = false;
return false;
}
static bool interrupt(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
if (gb->debug_stopped) {
GB_log(gb, "Program already stopped.\n");
return true;
}
GB_debugger_break(gb);
return true;
}
static char *reset_completer(GB_gameboy_t *gb, const char *string, uintptr_t *context)
{
size_t length = strlen(string);
const char *suggestions[] = {"quick", "reload"};
while (*context < sizeof(suggestions) / sizeof(suggestions[0])) {
if (strncmp(string, suggestions[*context], length) == 0) {
return strdup(suggestions[(*context)++] + length);
}
(*context)++;
}
return NULL;
}
static bool reset(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
const char *stripped_argument = lstrip(arguments);
if (stripped_argument[0] == 0) {
GB_reset(gb);
if (gb->debug_stopped) {
GB_cpu_disassemble(gb, gb->pc, 5);
}
return true;
}
if (strcmp(stripped_argument, "quick") == 0) {
GB_quick_reset(gb);
if (gb->debug_stopped) {
GB_cpu_disassemble(gb, gb->pc, 5);
}
return true;
}
if (strcmp(stripped_argument, "reload") == 0) {
if (gb->debugger_reload_callback) {
gb->debugger_reload_callback(gb);
if (gb->undo_state) {
free(gb->undo_state);
gb->undo_state = NULL;
}
if (gb->debug_stopped) {
GB_cpu_disassemble(gb, gb->pc, 5);
}
return true;
}
GB_log(gb, "ROM reloading via the debugger is not supported in this frontend.\n");
return true;
}
print_usage(gb, command);
return true;
}
static bool next(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
STOPPED_ONLY
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
gb->debug_stopped = false;
gb->debug_next_command = true;
gb->debug_call_depth = 0;
return false;
}
static bool step(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
STOPPED_ONLY
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
return false;
}
static bool finish(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
STOPPED_ONLY
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
gb->debug_stopped = false;
gb->debug_fin_command = true;
gb->debug_call_depth = 0;
return false;
}
static bool registers(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
GB_log(gb, "AF = $%04x (%c%c%c%c)\n", gb->af, /* AF can't really be an address */
(gb->f & GB_CARRY_FLAG)? 'C' : '-',
(gb->f & GB_HALF_CARRY_FLAG)? 'H' : '-',
(gb->f & GB_SUBTRACT_FLAG)? 'N' : '-',
(gb->f & GB_ZERO_FLAG)? 'Z' : '-');
GB_log(gb, "BC = %s\n", value_to_string(gb, gb->bc, false, false));
GB_log(gb, "DE = %s\n", value_to_string(gb, gb->de, false, false));
GB_log(gb, "HL = %s\n", value_to_string(gb, gb->hl, false, false));
GB_log(gb, "SP = %s\n", value_to_string(gb, gb->sp, false, false));
GB_log(gb, "PC = %s\n", value_to_string(gb, gb->pc, false, false));
GB_log(gb, "IME = %s\n", gb->ime? "Enabled" : "Disabled");
return true;
}
static char *on_off_completer(GB_gameboy_t *gb, const char *string, uintptr_t *context)
{
size_t length = strlen(string);
const char *suggestions[] = {"on", "off"};
while (*context < sizeof(suggestions) / sizeof(suggestions[0])) {
if (strncmp(string, suggestions[*context], length) == 0) {
return strdup(suggestions[(*context)++] + length);
}
(*context)++;
}
return NULL;
}
/* Enable or disable software breakpoints */
static bool softbreak(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strcmp(lstrip(arguments), "on") == 0 || !strlen(lstrip(arguments))) {
gb->has_software_breakpoints = true;
}
else if (strcmp(lstrip(arguments), "off") == 0) {
gb->has_software_breakpoints = false;
}
else {
print_usage(gb, command);
}
return true;
}
static inline bool is_legal_symbol_char(char c)
{
if (c >= '0' && c <= '9') return true;
if (c >= 'A' && c <= 'Z') return true;
if (c >= 'a' && c <= 'z') return true;
if (c == '_') return true;
if (c == '.') return true;
return false;
}
static char *symbol_completer(GB_gameboy_t *gb, const char *string, uintptr_t *_context)
{
const char *symbol_prefix = string;
while (*string) {
if (!is_legal_symbol_char(*string)) {
symbol_prefix = string + 1;
}
string++;
}
if (*symbol_prefix == '$') {
return NULL;
}
struct {
uint16_t bank;
uint32_t symbol;
} *context = (void *)_context;
size_t length = strlen(symbol_prefix);
while (context->bank < 0x200) {
GB_symbol_map_t *map = get_symbol_map(gb, context->bank);
if (map == NULL ||
context->symbol >= map->n_symbols) {
context->bank++;
context->symbol = 0;
continue;
}
const char *candidate = map->symbols[context->symbol++].name;
if (strncmp(symbol_prefix, candidate, length) == 0) {
return strdup(candidate + length);
}
}
return NULL;
}
static char *j_completer(GB_gameboy_t *gb, const char *string, uintptr_t *context)
{
size_t length = strlen(string);
const char *suggestions[] = {"j"};
while (*context < sizeof(suggestions) / sizeof(suggestions[0])) {
if (strncmp(string, suggestions[*context], length) == 0) {
return strdup(suggestions[(*context)++] + length);
}
(*context)++;
}
return NULL;
}
static bool check_inclusive(char *to)
{
size_t length = strlen(to);
while (length > strlen("inclusive")) {
if (to[length - 1] == ' ') {
to[length - 1] = 0;
length--;
continue;
}
if (strcmp(to + length - strlen("inclusive"), "inclusive") == 0) {
to[length - strlen("inclusive")] = 0;
return true;
}
return false;
}
return false;
}
static bool breakpoint(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
bool is_jump_to = true;
if (!modifiers) {
is_jump_to = false;
}
else if (strcmp(modifiers, "j") != 0) {
print_usage(gb, command);
return true;
}
if (strlen(lstrip(arguments)) == 0) {
print_usage(gb, command);
return true;
}
if (gb->n_breakpoints == (typeof(gb->n_breakpoints)) -1) {
GB_log(gb, "Too many breakpoints set\n");
return true;
}
char *condition = NULL;
if ((condition = strstr(arguments, " if "))) {
*condition = 0;
condition += strlen(" if ");
/* Verify condition is sane (Todo: This might have side effects!) */
bool error;
debugger_evaluate(gb, condition, (unsigned)strlen(condition), &error, NULL, NULL);
if (error) return true;
}
char *to = NULL;
bool inclusive = false;
if ((to = strstr(arguments, " to "))) {
*to = 0;
to += strlen(" to ");
inclusive = check_inclusive(to);
}
bool error;
value_t result = debugger_evaluate(gb, arguments, (unsigned)strlen(arguments), &error, NULL, NULL);
if (error) return true;
uint16_t length = 0;
value_t end = result;
if (to) {
end = debugger_evaluate(gb, to, (unsigned)strlen(to), &error, NULL, NULL);
if (error) return true;
if (end.has_bank && result.has_bank && end.bank != result.bank) {
GB_log(gb, "Breakpoint range start and end points have different banks\n");
return true;
}
if (end.value <= result.value) {
GB_log(gb, "Breakpoint range end point must be grater than the start point\n");
return true;
}
length = end.value - result.value - 1;
}
uint32_t key = BP_KEY(result);
gb->breakpoints = realloc(gb->breakpoints, (gb->n_breakpoints + 1) * sizeof(gb->breakpoints[0]));
unsigned id = 1;
if (gb->n_breakpoints) {
id = gb->breakpoints[gb->n_breakpoints - 1].id + 1;
}
gb->breakpoints[gb->n_breakpoints++] = (struct GB_breakpoint_s){
.id = id,
.key = key,
.condition = condition? strdup(condition) : NULL,
.is_jump_to = is_jump_to,
.length = length,
.inclusive = inclusive,
};
if (is_jump_to) {
gb->has_jump_to_breakpoints = true;
}
GB_log(gb, "Breakpoint %u set at %s", id, debugger_value_to_string(gb, result, true, false));
if (length) {
GB_log(gb, " - %s%s\n", debugger_value_to_string(gb, end, true, true), inclusive? " (inclusive)" : "");
}
else {
GB_log(gb, "\n");
}
return true;
}
static bool delete(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments)) == 0) {
for (unsigned i = gb->n_breakpoints; i--;) {
if (gb->breakpoints[i].condition) {
free(gb->breakpoints[i].condition);
}
}
free(gb->breakpoints);
gb->breakpoints = NULL;
gb->n_breakpoints = 0;
gb->has_jump_to_breakpoints = false;
return true;
}
char *end;
unsigned id = strtol(arguments, &end, 10);
if (*end) {
print_usage(gb, command);
return true;
}
for (unsigned i = 0; i < gb->n_breakpoints; i++) {
if (gb->breakpoints[i].id != id) continue;
if (gb->breakpoints[i].condition) {
free(gb->breakpoints[i].condition);
}
if (gb->breakpoints[i].is_jump_to) {
gb->has_jump_to_breakpoints = false;
for (unsigned j = 0; j < gb->n_breakpoints; j++) {
if (j == i) continue;
if (gb->breakpoints[j].is_jump_to) {
gb->has_jump_to_breakpoints = true;
break;
}
}
}
memmove(&gb->breakpoints[i], &gb->breakpoints[i + 1], (gb->n_breakpoints - i - 1) * sizeof(gb->breakpoints[0]));
gb->n_breakpoints--;
gb->breakpoints = realloc(gb->breakpoints, gb->n_breakpoints * sizeof(gb->breakpoints[0]));
value_t addr = (value_t){gb->breakpoints[i].bank != (uint16_t)-1, gb->breakpoints[i].bank, gb->breakpoints[i].addr};
GB_log(gb, "Breakpoint %u removed from %s\n", id, debugger_value_to_string(gb, addr, addr.has_bank, false));
return true;
}
GB_log(gb, "Breakpoint %u was not found\n", id);
return true;
}
static char *rw_completer(GB_gameboy_t *gb, const char *string, uintptr_t *context)
{
size_t length = strlen(string);
const char *suggestions[] = {"r", "rw", "w"};
while (*context < sizeof(suggestions) / sizeof(suggestions[0])) {
if (strncmp(string, suggestions[*context], length) == 0) {
return strdup(suggestions[(*context)++] + length);
}
(*context)++;
}
return NULL;
}
static bool watch(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
if (strlen(lstrip(arguments)) == 0) {
print_usage(gb, command);
return true;
}
if (gb->n_watchpoints == (typeof(gb->n_watchpoints)) -1) {
GB_log(gb, "Too many watchpoints set\n");
return true;
}
if (!modifiers) {
modifiers = "w";
}
uint8_t flags = 0;
while (*modifiers) {
switch (*modifiers) {
case 'r':
flags |= WATCHPOINT_READ;
break;
case 'w':
flags |= WATCHPOINT_WRITE;
break;
default:
print_usage(gb, command);
return true;
}
modifiers++;
}
if (!flags) {
print_usage(gb, command);
return true;
}
char *condition = NULL;
if ((condition = strstr(arguments, " if "))) {
*condition = 0;
condition += strlen(" if ");
/* Verify condition is sane (Todo: This might have side effects!) */
bool error;
/* To make new and old legal */
uint16_t dummy = 0;
uint8_t dummy2 = 0;
debugger_evaluate(gb, condition, (unsigned)strlen(condition), &error, &dummy, &dummy2);
if (error) return true;
}
char *to = NULL;
bool inclusive = false;
if ((to = strstr(arguments, " to "))) {
*to = 0;
to += strlen(" to ");
inclusive = check_inclusive(to);
}
bool error;
value_t result = debugger_evaluate(gb, arguments, (unsigned)strlen(arguments), &error, NULL, NULL);
uint32_t key = WP_KEY(result);
uint16_t length = 0;
value_t end = result;
if (to) {
end = debugger_evaluate(gb, to, (unsigned)strlen(to), &error, NULL, NULL);
if (error) return true;
if (end.has_bank && result.has_bank && end.bank != result.bank) {
GB_log(gb, "Watchpoint range start and end points have different banks\n");
return true;
}
if (end.value <= result.value) {
GB_log(gb, "Watchpoint range end point must be grater than the start point\n");
return true;
}
length = end.value - result.value - 1;
}
if (error) return true;
unsigned id = 1;
if (gb->n_watchpoints) {
id = gb->watchpoints[gb->n_watchpoints - 1].id + 1;
}
gb->watchpoints = realloc(gb->watchpoints, (gb->n_watchpoints + 1) * sizeof(gb->watchpoints[0]));
gb->watchpoints[gb->n_watchpoints++] = (struct GB_watchpoint_s){
.id = id,
.key = key,
.condition = condition? strdup(condition) : NULL,
.flags = flags,
.length = length,
.inclusive = inclusive,
};
GB_log(gb, "Watchpoint %u set at %s", id, debugger_value_to_string(gb, result, true, false));
if (length) {
GB_log(gb, " - %s%s\n", debugger_value_to_string(gb, end, true, true), inclusive? " (inclusive)" : "");
}
else {
GB_log(gb, "\n");
}
return true;
}
static bool unwatch(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments)) == 0) {
for (unsigned i = gb->n_watchpoints; i--;) {
if (gb->watchpoints[i].condition) {
free(gb->watchpoints[i].condition);
}
}
free(gb->watchpoints);
gb->watchpoints = NULL;
gb->n_watchpoints = 0;
return true;
}
char *end;
unsigned id = strtol(arguments, &end, 10);
if (*end) {
print_usage(gb, command);
return true;
}
for (unsigned i = 0; i < gb->n_watchpoints; i++) {
if (gb->watchpoints[i].id != id) continue;
if (gb->watchpoints[i].condition) {
free(gb->watchpoints[i].condition);
}
memmove(&gb->watchpoints[i], &gb->watchpoints[i + 1], (gb->n_watchpoints - i - 1) * sizeof(gb->watchpoints[0]));
gb->n_watchpoints--;
gb->watchpoints = realloc(gb->watchpoints, gb->n_watchpoints * sizeof(gb->watchpoints[0]));
value_t addr = (value_t){gb->watchpoints[i].bank != (uint16_t)-1, gb->watchpoints[i].bank, gb->watchpoints[i].addr};
GB_log(gb, "Watchpoint %u removed from %s\n", id, debugger_value_to_string(gb, addr, addr.has_bank, false));
return true;
}
GB_log(gb, "Watchpoint %u was not found\n", id);
return true;
}
static bool list(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
if (gb->n_breakpoints == 0) {
GB_log(gb, "No breakpoints set.\n");
}
else {
GB_log(gb, "%d breakpoint(s) set:\n", gb->n_breakpoints);
for (uint16_t i = 0; i < gb->n_breakpoints; i++) {
value_t addr = (value_t){gb->breakpoints[i].bank != (uint16_t)-1, gb->breakpoints[i].bank, gb->breakpoints[i].addr};
char *end_string = NULL;
if (gb->breakpoints[i].length) {
value_t end = addr;
end.value += gb->breakpoints[i].length + 1;
end_string = strdup(debugger_value_to_string(gb, end, addr.has_bank, true));
}
if (gb->breakpoints[i].condition) {
GB_log(gb, " %d. %s%s%s%s (%sCondition: %s)\n", gb->breakpoints[i].id,
debugger_value_to_string(gb, addr, addr.has_bank, false),
end_string? " - " : "",
end_string ?: "",
gb->breakpoints[i].inclusive? " (inclusive)" : "",
gb->breakpoints[i].is_jump_to? "Jump to, ": "",
gb->breakpoints[i].condition);
}
else {
GB_log(gb, " %d. %s%s%s%s%s\n", gb->breakpoints[i].id,
debugger_value_to_string(gb, addr, addr.has_bank, false),
end_string? " - " : "",
end_string ?: "",
gb->breakpoints[i].inclusive? " (inclusive)" : "",
gb->breakpoints[i].is_jump_to? " (Jump to)" : "");
}
if (end_string) {
free(end_string);
}
}
}
if (gb->n_watchpoints == 0) {
GB_log(gb, "No watchpoints set.\n");
}
else {
GB_log(gb, "%d watchpoint(s) set:\n", gb->n_watchpoints);
for (uint16_t i = 0; i < gb->n_watchpoints; i++) {
value_t addr = (value_t){gb->watchpoints[i].bank != (uint16_t)-1, gb->watchpoints[i].bank, gb->watchpoints[i].addr};
char *end_string = NULL;
if (gb->watchpoints[i].length) {
value_t end = addr;
end.value += gb->watchpoints[i].length + 1;
end_string = strdup(debugger_value_to_string(gb, end, addr.has_bank, true));
}
if (gb->watchpoints[i].condition) {
GB_log(gb, " %d. %s%s%s%s (%c%c, Condition: %s)\n", gb->watchpoints[i].id, debugger_value_to_string(gb, addr, addr.has_bank, false),
end_string? " - " : "", end_string ?: "",
gb->watchpoints[i].inclusive? " (inclusive)" : "",
(gb->watchpoints[i].flags & WATCHPOINT_READ)? 'r' : '-',
(gb->watchpoints[i].flags & WATCHPOINT_WRITE)? 'w' : '-',
gb->watchpoints[i].condition);
}
else {
GB_log(gb, " %d. %s%s%s%s (%c%c)\n", gb->watchpoints[i].id, debugger_value_to_string(gb, addr, addr.has_bank, false),
end_string? " - " : "", end_string ?: "",
gb->watchpoints[i].inclusive? " (inclusive)" : "",
(gb->watchpoints[i].flags & WATCHPOINT_READ)? 'r' : '-',
(gb->watchpoints[i].flags & WATCHPOINT_WRITE)? 'w' : '-');
}
}
}
return true;
}
// Returns the id or 0
static unsigned should_break(GB_gameboy_t *gb, uint16_t addr, bool jump_to)
{
if (unlikely(gb->backstep_instructions)) return false;
uint16_t bank = bank_for_addr(gb, addr);
for (unsigned i = 0; i < gb->n_breakpoints; i++) {
struct GB_breakpoint_s *breakpoint = &gb->breakpoints[i];
if (breakpoint->bank != (uint16_t)-1) {
if (breakpoint->bank != bank) continue;
if (!gb->boot_rom_finished) continue;
}
if (breakpoint->is_jump_to != jump_to) continue;
if (addr < breakpoint->addr) continue;
if (addr > (uint32_t)breakpoint->addr + breakpoint->length + breakpoint->inclusive) continue;
if (!breakpoint->condition) return breakpoint->id;
bool error;
bool condition = debugger_evaluate(gb, breakpoint->condition,
(unsigned)strlen(breakpoint->condition),
&error, NULL, NULL).value;
if (error) {
GB_log(gb, "The condition for breakpoint %u is no longer a valid expression\n", breakpoint->id);
return breakpoint->id;
}
if (condition) return breakpoint->id;
}
return 0;
}
static char *format_completer(GB_gameboy_t *gb, const char *string, uintptr_t *context)
{
size_t length = strlen(string);
const char *suggestions[] = {"a", "b", "d", "o", "x"};
while (*context < sizeof(suggestions) / sizeof(suggestions[0])) {
if (strncmp(string, suggestions[*context], length) == 0) {
return strdup(suggestions[(*context)++] + length);
}
(*context)++;
}
return NULL;
}
static bool print(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
if (strlen(lstrip(arguments)) == 0) {
print_usage(gb, command);
return true;
}
if (!modifiers || !modifiers[0]) {
modifiers = "a";
}
else if (modifiers[1]) {
print_usage(gb, command);
return true;
}
bool error;
value_t result = debugger_evaluate(gb, arguments, (unsigned)strlen(arguments), &error, NULL, NULL);
if (!error) {
switch (modifiers[0]) {
case 'a':
GB_log(gb, "=%s\n", debugger_value_to_string(gb, result, false, false));
break;
case 'd':
GB_log(gb, "=%d\n", result.value);
break;
case 'x':
GB_log(gb, "=$%x\n", result.value);
break;
case 'o':
GB_log(gb, "=0%o\n", result.value);
break;
case 'b':
{
if (!result.value) {
GB_log(gb, "=%%0\n");
break;
}
char binary[17];
binary[16] = 0;
char *ptr = &binary[16];
while (result.value) {
*(--ptr) = (result.value & 1)? '1' : '0';
result.value >>= 1;
}
GB_log(gb, "=%%%s\n", ptr);
break;
}
default:
break;
}
}
return true;
}
static bool examine(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
if (strlen(lstrip(arguments)) == 0) {
print_usage(gb, command);
return true;
}
bool error;
value_t addr = debugger_evaluate(gb, arguments, (unsigned)strlen(arguments), &error, NULL, NULL);
uint16_t count = 32;
if (modifiers) {
char *end;
count = (uint16_t) (strtol(modifiers, &end, 10));
if (*end) {
print_usage(gb, command);
return true;
}
}
if (!error) {
if (addr.has_bank) {
banking_state_t old_state;
save_banking_state(gb, &old_state);
switch_banking_state(gb, addr.bank);
while (count) {
GB_log(gb, "%02x:%04x: ", addr.bank, addr.value);
for (unsigned i = 0; i < 16 && count; i++) {
GB_log(gb, "%02x ", GB_safe_read_memory(gb, addr.value + i));
count--;
}
addr.value += 16;
GB_log(gb, "\n");
}
restore_banking_state(gb, &old_state);
}
else {
while (count) {
GB_log(gb, "%04x: ", addr.value);
for (unsigned i = 0; i < 16 && count; i++) {
GB_log(gb, "%02x ", GB_safe_read_memory(gb, addr.value + i));
count--;
}
addr.value += 16;
GB_log(gb, "\n");
}
}
}
return true;
}
static bool disassemble(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
if (strlen(lstrip(arguments)) == 0) {
arguments = "pc";
}
bool error;
value_t addr = debugger_evaluate(gb, arguments, (unsigned)strlen(arguments), &error, NULL, NULL);
uint16_t count = 5;
if (modifiers) {
char *end;
count = (uint16_t) (strtol(modifiers, &end, 10));
if (*end) {
print_usage(gb, command);
return true;
}
}
if (!error) {
if (addr.has_bank) {
banking_state_t old_state;
save_banking_state(gb, &old_state);
switch_banking_state(gb, addr.bank);
GB_cpu_disassemble(gb, addr.value, count);
restore_banking_state(gb, &old_state);
}
else {
GB_cpu_disassemble(gb, addr.value, count);
}
}
return true;
}
static bool mbc(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
const GB_cartridge_t *cartridge = gb->cartridge_type;
if (cartridge->has_ram) {
bool has_battery = gb->cartridge_type->has_battery &&
(gb->cartridge_type->mbc_type != GB_TPP1 || (gb->rom[0x153] & 8));
GB_log(gb, "Cartridge includes%s RAM: $%x bytes\n", has_battery? " battery-backed": "", gb->mbc_ram_size);
}
else {
GB_log(gb, "No cartridge RAM\n");
}
if (cartridge->mbc_type) {
if (gb->is_mbc30) {
GB_log(gb, "MBC30\n");
}
else {
static const char *const mapper_names[] = {
[GB_MBC1] = "MBC1",
[GB_MBC2] = "MBC2",
[GB_MBC3] = "MBC3",
[GB_MBC5] = "MBC5",
[GB_MBC7] = "MBC7",
[GB_MMM01] = "MMM01",
[GB_HUC1] = "HUC-1",
[GB_HUC3] = "HUC-3",
[GB_CAMERA] = "MAC-GBD",
};
GB_log(gb, "%s\n", mapper_names[cartridge->mbc_type]);
}
if (cartridge->mbc_type == GB_MMM01 || cartridge->mbc_type == GB_MBC1) {
GB_log(gb, "Current mapped ROM0 bank: %x\n", gb->mbc_rom0_bank);
}
GB_log(gb, "Current mapped ROM bank: %x\n", gb->mbc_rom_bank);
if (cartridge->has_ram) {
GB_log(gb, "Current mapped RAM bank: %x\n", gb->mbc_ram_bank);
if (gb->cartridge_type->mbc_type != GB_HUC1) {
GB_log(gb, "RAM is currently %s\n", gb->mbc_ram_enable? "enabled" : "disabled");
}
}
if (cartridge->mbc_type == GB_MBC1 && gb->mbc1_wiring == GB_STANDARD_MBC1_WIRING) {
GB_log(gb, "MBC1 banking mode is %s\n", gb->mbc1.mode == 1 ? "RAM" : "ROM");
}
if (cartridge->mbc_type == GB_MBC1 && gb->mbc1_wiring == GB_MBC1M_WIRING) {
GB_log(gb, "MBC1 uses MBC1M wiring. \n");
GB_log(gb, "Current mapped ROM0 bank: %x\n", gb->mbc_rom0_bank);
GB_log(gb, "MBC1 multicart banking mode is %s\n", gb->mbc1.mode == 1 ? "enabled" : "disabled");
}
}
else {
GB_log(gb, "No MBC\n");
}
if (gb->cartridge_type->has_rumble &&
(gb->cartridge_type->mbc_type != GB_TPP1 || (gb->rom[0x153] & 1))) {
GB_log(gb, "Cart contains a Rumble Pak\n");
}
if (cartridge->has_rtc) {
GB_log(gb, "Cart contains a real time clock\n");
}
return true;
}
static bool backtrace(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
GB_log(gb, " 1. %s\n", debugger_value_to_string(gb, (value_t){true, bank_for_addr(gb, gb->pc), gb->pc}, true, false));
for (unsigned i = gb->backtrace_size; i--;) {
GB_log(gb, "%3d. %s\n", gb->backtrace_size - i + 1, debugger_value_to_string(gb, (value_t){true, gb->backtrace_returns[i].bank, gb->backtrace_returns[i].addr}, true, false));
}
return true;
}
static char *keep_completer(GB_gameboy_t *gb, const char *string, uintptr_t *context)
{
size_t length = strlen(string);
const char *suggestions[] = {"keep"};
while (*context < sizeof(suggestions) / sizeof(suggestions[0])) {
if (strncmp(string, suggestions[*context], length) == 0) {
return strdup(suggestions[(*context)++] + length);
}
(*context)++;
}
return NULL;
}
static bool ticks(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
STOPPED_ONLY
bool keep = false;
if (strcmp(lstrip(arguments), "keep") == 0) {
keep = true;
}
else if (lstrip(arguments)[0]) {
print_usage(gb, command);
return true;
}
GB_log(gb, "T-cycles: %llu\n", (unsigned long long)gb->debugger_ticks);
GB_log(gb, "M-cycles: %llu\n", (unsigned long long)gb->debugger_ticks / 4);
GB_log(gb, "Absolute 8MHz ticks: %llu\n", (unsigned long long)gb->absolute_debugger_ticks);
GB_log(gb, "Tick count reset.\n");
if (!keep) {
gb->debugger_ticks = 0;
gb->absolute_debugger_ticks = 0;
}
return true;
}
static bool palettes(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
if (!GB_is_cgb(gb)) {
GB_log(gb, "Not available on a DMG.\n");
return true;
}
GB_log(gb, "Background palettes: \n");
for (unsigned i = 0; i < 32; i++) {
GB_log(gb, "%04x ", ((uint16_t *)&gb->background_palettes_data)[i]);
if (i % 4 == 3) {
GB_log(gb, "\n");
}
}
GB_log(gb, "Object palettes: \n");
for (unsigned i = 0; i < 32; i++) {
GB_log(gb, "%04x ", ((uint16_t *)&gb->object_palettes_data)[i]);
if (i % 4 == 3) {
GB_log(gb, "\n");
}
}
return true;
}
static bool dma(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
if (!GB_is_dma_active(gb)) {
GB_log(gb, "DMA is inactive\n");
return true;
}
if (gb->dma_current_dest == 0xFF) {
GB_log(gb, "DMA warming up\n"); // Shouldn't actually happen, as it only lasts 2 T-cycles
return true;
}
GB_log(gb, "Next DMA write: [$FE%02X] = [$%04X]\n", gb->dma_current_dest, gb->dma_current_src);
return true;
}
static bool lcd(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
GB_log(gb, "LCDC:\n");
GB_log(gb, " LCD enabled: %s\n",(gb->io_registers[GB_IO_LCDC] & GB_LCDC_ENABLE)? "Enabled" : "Disabled");
GB_log(gb, " %s: %s\n", (gb->cgb_mode? "Object priority flags" : "Background and Window"),
(gb->io_registers[GB_IO_LCDC] & GB_LCDC_BG_EN)? "Enabled" : "Disabled");
GB_log(gb, " Objects: %s\n", (gb->io_registers[GB_IO_LCDC] & GB_LCDC_OBJ_EN)? "Enabled" : "Disabled");
GB_log(gb, " Object size: %s\n", (gb->io_registers[GB_IO_LCDC] & GB_LCDC_OBJ_SIZE)? "8x16" : "8x8");
GB_log(gb, " Background tilemap: %s\n", (gb->io_registers[GB_IO_LCDC] & GB_LCDC_BG_MAP)? "$9C00" : "$9800");
GB_log(gb, " Background and Window Tileset: %s\n", (gb->io_registers[GB_IO_LCDC] & GB_LCDC_TILE_SEL)? "$8000" : "$8800");
GB_log(gb, " Window: %s\n", (gb->io_registers[GB_IO_LCDC] & GB_LCDC_WIN_ENABLE)? "Enabled" : "Disabled");
GB_log(gb, " Window tilemap: %s\n", (gb->io_registers[GB_IO_LCDC] & GB_LCDC_WIN_MAP)? "$9C00" : "$9800");
GB_log(gb, "\nSTAT:\n");
static const char *modes[] = {"Mode 0, H-Blank", "Mode 1, V-Blank", "Mode 2, OAM", "Mode 3, Rendering"};
GB_log(gb, " Current mode: %s\n", modes[gb->io_registers[GB_IO_STAT] & 3]);
GB_log(gb, " LYC flag: %s\n", (gb->io_registers[GB_IO_STAT] & 4)? "On" : "Off");
GB_log(gb, " H-Blank interrupt: %s\n", (gb->io_registers[GB_IO_STAT] & 8)? "Enabled" : "Disabled");
GB_log(gb, " V-Blank interrupt: %s\n", (gb->io_registers[GB_IO_STAT] & 16)? "Enabled" : "Disabled");
GB_log(gb, " OAM interrupt: %s\n", (gb->io_registers[GB_IO_STAT] & 32)? "Enabled" : "Disabled");
GB_log(gb, " LYC interrupt: %s\n", (gb->io_registers[GB_IO_STAT] & 64)? "Enabled" : "Disabled");
GB_log(gb, "\nCurrent line: %d\n", gb->current_line);
GB_log(gb, "Current state: ");
if (!(gb->io_registers[GB_IO_LCDC] & GB_LCDC_ENABLE)) {
GB_log(gb, "Off\n");
}
else if (gb->display_state == 7 || gb->display_state == 8) {
GB_log(gb, "Reading OAM data (%d/40)\n", gb->display_state == 8? gb->oam_search_index : 0);
}
else if (gb->display_state <= 3 || gb->display_state == 24 || gb->display_state == 31) {
GB_log(gb, "Glitched line 0 OAM mode (%d cycles to next event)\n", -gb->display_cycles / 2);
}
else if (gb->mode_for_interrupt == 3) {
if (((uint8_t)(gb->position_in_line + 16) < 8)) {
GB_log(gb, "Adjusting for scrolling (%d/%d)\n", gb->position_in_line & 7, gb->io_registers[GB_IO_SCX] & 7);
}
else {
signed pixel = gb->position_in_line > 160? (int8_t) gb->position_in_line : gb->position_in_line;
GB_log(gb, "Rendering pixel (%d/160)\n", pixel);
}
}
else {
GB_log(gb, "Sleeping (%d cycles to next event)\n", -gb->display_cycles / 2);
}
GB_log(gb, "LY: %d\n", gb->io_registers[GB_IO_LY]);
GB_log(gb, "LYC: %d\n", gb->io_registers[GB_IO_LYC]);
GB_log(gb, "Window position: %d, %d\n", (signed) gb->io_registers[GB_IO_WX] - 7, gb->io_registers[GB_IO_WY]);
GB_log(gb, "Interrupt line: %s\n", gb->stat_interrupt_line? "On" : "Off");
GB_log(gb, "Background shifter size: %d\n", gb->bg_fifo.size);
GB_log(gb, "Background fetcher state: %s\n", inline_const(const char *[], {
"Tile (1/2)",
"Tile (2/2)",
"Low data (1/2)",
"Low data (2/2)",
"High data (1/2)",
"High data (2/2)",
"Push (1/2)",
"Push (2/2)",
})[gb->fetcher_state & 7]);
return true;
}
static bool apu(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
const char *stripped = lstrip(arguments);
if (strlen(stripped)) {
if (stripped[0] != 0 && (stripped[0] < '1' || stripped[0] > '5')) {
print_usage(gb, command);
return true;
}
}
if (stripped[0] == 0 || stripped[0] == '5') {
GB_log(gb, "Current state: ");
if (!gb->apu.global_enable) {
GB_log(gb, "Disabled\n");
}
else {
GB_log(gb, "Enabled\n");
for (uint8_t channel = 0; channel < GB_N_CHANNELS; channel++) {
GB_log(gb, "CH%u is %s, DAC %s; current sample = 0x%x\n", channel + 1,
gb->apu.is_active[channel] ? "active " : "inactive",
GB_apu_is_DAC_enabled(gb, channel) ? "active " : "inactive",
gb->apu.samples[channel]);
}
}
GB_log(gb, "SO1 (left output): volume %u,", gb->io_registers[GB_IO_NR50] & 0x07);
if (gb->io_registers[GB_IO_NR51] & 0x0F) {
for (uint8_t channel = 0, mask = 0x01; channel < GB_N_CHANNELS; channel++, mask <<= 1) {
if (gb->io_registers[GB_IO_NR51] & mask) {
GB_log(gb, " CH%u", channel + 1);
}
}
}
else {
GB_log(gb, " no channels");
}
GB_log(gb, "%s\n", gb->io_registers[GB_IO_NR50] & 0x80 ? " VIN": "");
GB_log(gb, "SO2 (right output): volume %u,", gb->io_registers[GB_IO_NR50] & 0x70 >> 4);
if (gb->io_registers[GB_IO_NR51] & 0xF0) {
for (uint8_t channel = 0, mask = 0x10; channel < GB_N_CHANNELS; channel++, mask <<= 1) {
if (gb->io_registers[GB_IO_NR51] & mask) {
GB_log(gb, " CH%u", channel + 1);
}
}
}
else {
GB_log(gb, " no channels");
}
GB_log(gb, "%s\n", gb->io_registers[GB_IO_NR50] & 0x80 ? " VIN": "");
}
for (uint8_t channel = GB_SQUARE_1; channel <= GB_SQUARE_2; channel++) {
if (stripped[0] != 0 && stripped[0] != ('1') + channel) continue;
GB_log(gb, "\nCH%u:\n", channel + 1);
GB_log(gb, " Current volume: %u, current sample length: %u APU ticks (next in %u ticks)\n",
gb->apu.square_channels[channel].current_volume,
(gb->apu.square_channels[channel].sample_length ^ 0x7FF) * 2 + 1,
gb->apu.square_channels[channel].sample_countdown);
uint8_t nrx2 = gb->io_registers[channel == GB_SQUARE_1? GB_IO_NR12 : GB_IO_NR22];
GB_log(gb, " %u 256 Hz ticks till next volume %screase (out of %u)\n",
gb->apu.square_channels[channel].volume_countdown,
nrx2 & 8 ? "in" : "de",
nrx2 & 7);
uint8_t duty = gb->io_registers[channel == GB_SQUARE_1? GB_IO_NR11 :GB_IO_NR21] >> 6;
GB_log(gb, " Duty cycle %s%% (%s), current index %u/8%s\n",
duty > 3? "" : inline_const(const char *[], {"12.5", " 25", " 50", " 75"})[duty],
duty > 3? "" : inline_const(const char *[], {"_______-", "-______-", "-____---", "_------_"})[duty],
gb->apu.square_channels[channel].current_sample_index,
gb->apu.square_channels[channel].sample_surpressed ? " (suppressed)" : "");
if (channel == GB_SQUARE_1) {
GB_log(gb, " Frequency sweep %s and %s\n",
((gb->io_registers[GB_IO_NR10] & 0x7) && (gb->io_registers[GB_IO_NR10] & 0x70))? "active" : "inactive",
(gb->io_registers[GB_IO_NR10] & 0x8) ? "decreasing" : "increasing");
if (gb->apu.square_sweep_calculate_countdown) {
GB_log(gb, " On going frequency calculation will be ready in %u APU ticks\n",
gb->apu.square_sweep_calculate_countdown);
}
else {
GB_log(gb, " Shadow frequency register: 0x%03x\n", gb->apu.shadow_sweep_sample_length);
GB_log(gb, " Sweep addend register: 0x%03x\n", gb->apu.sweep_length_addend);
}
}
if (gb->apu.square_channels[channel].length_enabled) {
GB_log(gb, " Channel will end in %u 256 Hz ticks\n",
gb->apu.square_channels[channel].pulse_length);
}
}
if (stripped[0] == 0 || stripped[0] == '3') {
GB_log(gb, "\nCH3:\n");
GB_log(gb, " Wave:");
for (uint8_t i = 0; i < 16; i++) {
GB_log(gb, "%s%X", i % 2? "" : " ", gb->io_registers[GB_IO_WAV_START + i] >> 4);
GB_log(gb, "%X", gb->io_registers[GB_IO_WAV_START + i] & 0xF);
}
GB_log(gb, "\n");
GB_log(gb, " Current position: %u\n", gb->apu.wave_channel.current_sample_index);
GB_log(gb, " Volume %s (right-shifted %u times)\n",
gb->apu.wave_channel.shift > 4? "" : inline_const(const char *[], {"100%", "50%", "25%", "", "muted"})[gb->apu.wave_channel.shift],
gb->apu.wave_channel.shift);
GB_log(gb, " Current sample length: %u APU ticks (next in %u ticks)\n",
gb->apu.wave_channel.sample_length ^ 0x7FF,
gb->apu.wave_channel.sample_countdown);
if (gb->apu.wave_channel.length_enabled) {
GB_log(gb, " Channel will end in %u 256 Hz ticks\n",
gb->apu.wave_channel.pulse_length);
}
}
if (stripped[0] == 0 || stripped[0] == '4') {
GB_log(gb, "\nCH4:\n");
GB_log(gb, " Current volume: %u, current internal counter: 0x%04x (next increase in %u ticks)\n",
gb->apu.noise_channel.current_volume,
gb->apu.noise_channel.counter,
gb->apu.noise_channel.counter_countdown);
GB_log(gb, " %u 256 Hz ticks till next volume %screase (out of %u)\n",
gb->apu.noise_channel.volume_countdown,
gb->io_registers[GB_IO_NR42] & 8 ? "in" : "de",
gb->io_registers[GB_IO_NR42] & 7);
GB_log(gb, " LFSR in %u-step mode, current value ",
gb->apu.noise_channel.narrow? 7 : 15);
nounroll for (uint16_t lfsr = gb->apu.noise_channel.lfsr, i = 15; i--; lfsr <<= 1) {
GB_log(gb, "%u%s", (lfsr >> 14) & 1, i%4 ? "" : " ");
}
if (gb->apu.noise_channel.length_enabled) {
GB_log(gb, " Channel will end in %u 256 Hz ticks\n",
gb->apu.noise_channel.pulse_length);
}
}
GB_log(gb, "\n\nReminder: APU ticks are @ 2 MiHz\n");
return true;
}
static char *wave_completer(GB_gameboy_t *gb, const char *string, uintptr_t *context)
{
size_t length = strlen(string);
const char *suggestions[] = {"c", "f", "l"};
while (*context < sizeof(suggestions) / sizeof(suggestions[0])) {
if (strncmp(string, suggestions[*context], length) == 0) {
return strdup(suggestions[(*context)++] + length);
}
(*context)++;
}
return NULL;
}
static bool wave(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
if (strlen(lstrip(arguments)) || (modifiers && !strchr("fcl", modifiers[0]))) {
print_usage(gb, command);
return true;
}
uint8_t shift_amount = 1, mask;
if (modifiers) {
switch (modifiers[0]) {
case 'c':
shift_amount = 2;
break;
case 'l':
shift_amount = 8;
break;
}
}
mask = (0xF << (shift_amount - 1)) & 0xF;
for (int8_t cur_val = 0xF & mask; cur_val >= 0; cur_val -= shift_amount) {
for (uint8_t i = 0; i < 32; i++) {
uint8_t sample = i & 1?
(gb->io_registers[GB_IO_WAV_START + i / 2] & 0xF) :
(gb->io_registers[GB_IO_WAV_START + i / 2] >> 4);
if ((sample & mask) == cur_val) {
GB_log(gb, "%X", sample);
}
else {
GB_log(gb, "%c", i % 4 == 2 ? '-' : ' ');
}
}
GB_log(gb, "\n");
}
return true;
}
static bool undo(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
STOPPED_ONLY
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
if (!gb->undo_label) {
GB_log(gb, "No undo state available\n");
return true;
}
uint16_t pc = gb->pc;
GB_load_state_from_buffer(gb, gb->undo_state, GB_get_save_state_size_no_bess(gb));
GB_log(gb, "Reverted a \"%s\" command.\n", gb->undo_label);
if (pc != gb->pc) {
GB_cpu_disassemble(gb, gb->pc, 5);
}
gb->undo_label = NULL;
return true;
}
#ifndef DISABLE_REWIND
static bool backstep(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command)
{
NO_MODIFIERS
STOPPED_ONLY
if (strlen(lstrip(arguments))) {
print_usage(gb, command);
return true;
}
bool didPop = false;
retry:;
typeof(gb->rewind_sequences[0]) *sequence = &gb->rewind_sequences[gb->rewind_pos];
if (!gb->rewind_sequences || !sequence->key_state) {
if (gb->rewind_buffer_length == 0) {
GB_log(gb, "Backstepping requires enabling rewinding\n");
}
else {
GB_log(gb, "Reached the end of the rewind buffer\n");
if (didPop) {
GB_rewind_push(gb);
sequence = &gb->rewind_sequences[gb->rewind_pos];
sequence->instruction_count[sequence->pos] = 1;
}
}
return true;
}
gb->backstep_instructions = sequence->instruction_count[sequence->pos] - 2;
if (gb->backstep_instructions == (uint32_t)-1) { // This frame was just pushed, pop it and try again
GB_rewind_pop(gb);
gb->backstep_instructions = 0;
didPop = true;
goto retry;
}
else if (gb->backstep_instructions > 0x20000) {
GB_log(gb, "Backstepping is currently not available\n");
gb->backstep_instructions = 0;
return true;
}
GB_rewind_pop(gb);
GB_rewind_push(gb);
sequence = &gb->rewind_sequences[gb->rewind_pos];
sequence->instruction_count[sequence->pos] = 1;
while (gb->backstep_instructions) {
GB_run(gb);
}
GB_cpu_disassemble(gb, gb->pc, 5);
return true;
}
#endif
static bool help(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *command);
/* Commands without implementations are aliases of the previous non-alias commands */
static const debugger_command_t commands[] = {
{"continue", 1, cont, "Continue running until next stop"},
{"interrupt", 1, interrupt, "Interrupt the program execution"},
{"reset", 3, reset, "Reset the program execution. "
"Add 'quick' as an argument to perform a quick reset that does not reset RAM. "
"Add 'reload' as an argument to reload the ROM and symbols before resetting.",
"[quick|reload]", .argument_completer = reset_completer},
{"next", 1, next, "Run the next instruction, skipping over function calls"},
{"step", 1, step, "Run the next instruction, stepping into function calls"},
{"finish", 1, finish, "Run until the current function returns"},
#ifndef DISABLE_REWIND
{"backstep", 5, backstep, "Step one instruction backwards, assuming constant inputs"},
{"bs", 2, }, /* Alias */
#endif
{"undo", 1, undo, "Revert the last command"},
{"registers", 1, registers, "Print values of processor registers and other important registers"},
{"backtrace", 2, backtrace, "Display the current call stack"},
{"bt", 2, }, /* Alias */
{"print", 1, print, "Evaluate and print an expression. "
"Use modifier to format as an address (a, default) or as a number in "
"decimal (d), hexadecimal (x), octal (o) or binary (b).",
"<expression>", "format", .argument_completer = symbol_completer, .modifiers_completer = format_completer},
{"eval", 2, }, /* Alias */
{"examine", 2, examine, "Examine values at address", "<expression>", "count", .argument_completer = symbol_completer},
{"x", 1, }, /* Alias */
{"disassemble", 1, disassemble, "Disassemble instructions at address", "<expression>", "count", .argument_completer = symbol_completer},
{"breakpoint", 1, breakpoint, "Add a new breakpoint at the specified address/expression or range. "
"Ranges are exlusive by default, unless \"inclusive\" is used. "
"If the j modifier is used, the breakpoint will occur just before "
"jumping to the target.",
"<expression> [to <end expression> [inclusive]] [if <condition expression>]", "j",
.argument_completer = symbol_completer, .modifiers_completer = j_completer},
{"delete", 2, delete, "Delete a breakpoint by its identifier, or all breakpoints", "[<breakpoint id>]"},
{"watch", 1, watch, "Add a new watchpoint at the specified address/expression or range. "
"Ranges are exlusive by default, unless \"inclusive\" is used. "
"The default watchpoint type is write-only.",
"<expression> [to <end expression> [inclusive]] [if <condition expression>]", "(r|w|rw)",
.argument_completer = symbol_completer, .modifiers_completer = rw_completer
},
{"unwatch", 3, unwatch, "Delete a watchpoint by its identifier, or all watchpoints", "[<watchpoint id>]"},
{"softbreak", 2, softbreak, "Enable or disable software breakpoints ('ld b, b' opcodes)", "(on|off)", .argument_completer = on_off_completer},
{"list", 1, list, "List all set breakpoints and watchpoints"},
{"ticks", 2, ticks, "Display the number of CPU ticks since the last time 'ticks' was "
"used. Use 'keep' as an argument to display ticks without reseeting "
"the count.", "(keep)", .argument_completer = keep_completer},
{"cartridge", 2, mbc, "Display information about the MBC and cartridge"},
{"mbc", 3, }, /* Alias */
{"apu", 3, apu, "Display information about the current state of the audio processing unit",
"[channel (1-4, 5 for NR5x)]"},
{"wave", 3, wave, "Print a visual representation of the wave RAM. "
"Modifiers can be used for a (f)ull print (the default), "
"a more (c)ompact one, or a one-(l)iner", "", "(f|c|l)", .modifiers_completer = wave_completer},
{"lcd", 3, lcd, "Display information about the current state of the LCD controller"},
{"palettes", 3, palettes, "Display the current CGB palettes"},
{"dma", 3, dma, "Display the current OAM DMA status"},
{"help", 1, help, "List available commands or show help for the specified command", "[<command>]"},
{NULL,}, /* Null terminator */
};
static const debugger_command_t *find_command(const char *string)
{
size_t length = strlen(string);
for (const debugger_command_t *command = commands; command->command; command++) {
if (command->min_length > length) continue;
if (strncmp(command->command, string, length) == 0) { /* Is a substring? */
/* Aliases */
while (!command->implementation) {
command--;
}
return command;
}
}
return NULL;
}
static void print_command_shortcut(GB_gameboy_t *gb, const debugger_command_t *command)
{
GB_attributed_log(gb, GB_LOG_BOLD | GB_LOG_UNDERLINE, "%.*s", command->min_length, command->command);
GB_attributed_log(gb, GB_LOG_BOLD, "%s", command->command + command->min_length);
}
static void print_command_description(GB_gameboy_t *gb, const debugger_command_t *command)
{
print_command_shortcut(gb, command);
GB_log(gb, ": ");
GB_log(gb, "%s", (const char *)&" " + strlen(command->command));
const char *string = command->help_string;
const unsigned width = 80 - 13;
nounroll while (strlen(string) > width) {
const char *space = string + width;
nounroll while (*space != ' ') {
space--;
if (space == string) {
// This help string has some extra long word? Abort line-breaking, it's going to break anyway.
GB_log(gb, "%s\n", string);
return;
}
}
GB_log(gb, "%.*s\n ", (unsigned)(space - string), string);
string = space + 1;
}
GB_log(gb, "%s\n", string);
}
static bool help(GB_gameboy_t *gb, char *arguments, char *modifiers, const debugger_command_t *ignored)
{
const debugger_command_t *command = find_command(arguments);
if (command) {
print_command_description(gb, command);
GB_log(gb, "\n");
print_usage(gb, command);
command++;
if (command->command && !command->implementation) { /* Command has aliases*/
GB_log(gb, "\nAliases: ");
do {
print_command_shortcut(gb, command);
GB_log(gb, " ");
command++;
} while (command->command && !command->implementation);
GB_log(gb, "\n");
}
return true;
}
nounroll for (command = commands; command->command; command++) {
if (command->help_string) {
print_command_description(gb, command);
}
}
return true;
}
void GB_debugger_call_hook(GB_gameboy_t *gb, uint16_t call_addr)
{
/* Called just after the CPU calls a function/enters an interrupt/etc... */
if (gb->backtrace_size < sizeof(gb->backtrace_sps) / sizeof(gb->backtrace_sps[0])) {
while (gb->backtrace_size) {
if (gb->backtrace_sps[gb->backtrace_size - 1] <= gb->sp) {
gb->backtrace_size--;
gb->debug_call_depth--;
}
else {
break;
}
}
gb->backtrace_sps[gb->backtrace_size] = gb->sp;
gb->backtrace_returns[gb->backtrace_size].bank = bank_for_addr(gb, call_addr);
gb->backtrace_returns[gb->backtrace_size].addr = call_addr;
gb->backtrace_size++;
gb->debug_call_depth++;
}
}
void GB_debugger_ret_hook(GB_gameboy_t *gb)
{
/* Called just before the CPU runs ret/reti */
while (gb->backtrace_size) {
if (gb->backtrace_sps[gb->backtrace_size - 1] <= gb->sp) {
gb->backtrace_size--;
gb->debug_call_depth--;
}
else {
break;
}
}
}
// Returns the id or 0
static void test_watchpoint(GB_gameboy_t *gb, uint16_t addr, uint8_t flags, uint8_t value)
{
if (unlikely(gb->backstep_instructions)) return;
uint16_t bank = bank_for_addr(gb, addr);
for (unsigned i = 0; i < gb->n_watchpoints; i++) {
struct GB_watchpoint_s *watchpoint = &gb->watchpoints[i];
if (watchpoint->bank != (uint16_t)-1) {
if (watchpoint->bank != bank) continue;
}
if (!(watchpoint->flags & flags)) continue;
if (addr < watchpoint->addr) continue;
if (addr > (uint32_t)watchpoint->addr + watchpoint->length + watchpoint->inclusive) continue;
if (!watchpoint->condition) {
condition_ok:
GB_debugger_break(gb);
if (flags == WATCHPOINT_READ) {
GB_log(gb, "Watchpoint %u: [%s]\n", watchpoint->id, value_to_string(gb, addr, true, false));
}
else {
GB_log(gb, "Watchpoint %u: [%s] = $%02x\n", watchpoint->id, value_to_string(gb, addr, true, false), value);
}
return;
}
bool error;
bool condition = debugger_evaluate(gb, watchpoint->condition,
(unsigned)strlen(watchpoint->condition),
&error, &addr, flags == WATCHPOINT_WRITE? &value : NULL).value;
if (error) {
GB_log(gb, "The condition for watchpoint %u is no longer a valid expression\n", watchpoint->id);
GB_debugger_break(gb);
}
if (condition) {
goto condition_ok;
}
}
}
void GB_debugger_test_write_watchpoint(GB_gameboy_t *gb, uint16_t addr, uint8_t value)
{
if (gb->debug_stopped) return;
test_watchpoint(gb, addr, WATCHPOINT_WRITE, value);
}
void GB_debugger_test_read_watchpoint(GB_gameboy_t *gb, uint16_t addr)
{
if (gb->debug_stopped) return;
test_watchpoint(gb, addr, WATCHPOINT_READ, 0);
}
/* Returns true if debugger waits for more commands */
bool GB_debugger_execute_command(GB_gameboy_t *gb, char *input)
{
GB_ASSERT_NOT_RUNNING_OTHER_THREAD(gb)
while (*input == ' ') {
input++;
}
if (!input[0]) {
return true;
}
GB_display_sync(gb);
GB_apu_run(gb, true);
char *command_string = input;
char *arguments = strchr(input, ' ');
if (arguments) {
/* Actually "split" the string. */
arguments[0] = 0;
arguments++;
}
else {
arguments = "";
}
char *modifiers = strchr(command_string, '/');
if (modifiers) {
/* Actually "split" the string. */
modifiers[0] = 0;
modifiers++;
}
gb->help_shown = true;
const debugger_command_t *command = find_command(command_string);
if (command) {
uint8_t *old_state = malloc(GB_get_save_state_size_no_bess(gb));
GB_save_state_to_buffer_no_bess(gb, old_state);
bool ret = command->implementation(gb, arguments, modifiers, command);
if (!ret) { // Command continues, save state in any case
free(gb->undo_state);
gb->undo_state = old_state;
gb->undo_label = command->command;
}
else {
uint8_t *new_state = malloc(GB_get_save_state_size_no_bess(gb));
GB_save_state_to_buffer_no_bess(gb, new_state);
if (memcmp(new_state, old_state, GB_get_save_state_size_no_bess(gb)) != 0) {
// State changed, save the old state as the new undo state
free(gb->undo_state);
gb->undo_state = old_state;
gb->undo_label = command->command;
}
else {
// Nothing changed, just free the old state
free(old_state);
}
free(new_state);
}
return ret;
}
else {
GB_log(gb, "%s: no such command. Type 'help' to list the available debugger commands.\n", command_string);
return true;
}
}
char *GB_debugger_complete_substring(GB_gameboy_t *gb, char *input, uintptr_t *context)
{
char *command_string = input;
char *arguments = strchr(input, ' ');
if (arguments) {
/* Actually "split" the string. */
arguments[0] = 0;
arguments++;
}
char *modifiers = strchr(command_string, '/');
if (modifiers) {
/* Actually "split" the string. */
modifiers[0] = 0;
modifiers++;
}
const debugger_command_t *command = find_command(command_string);
if (command && command->implementation == help && arguments) {
command_string = arguments;
arguments = NULL;
}
/* No commands and no modifiers, complete the command */
if (!arguments && !modifiers) {
size_t length = strlen(command_string);
if (*context >= sizeof(commands) / sizeof(commands[0])) {
return NULL;
}
for (const debugger_command_t *command = &commands[*context]; command->command; command++) {
(*context)++;
if (strncmp(command->command, command_string, length) == 0) { /* Is a substring? */
return strdup(command->command + length);
}
}
return NULL;
}
if (command) {
if (arguments) {
if (command->argument_completer) {
return command->argument_completer(gb, arguments, context);
}
return NULL;
}
if (modifiers) {
if (command->modifiers_completer) {
return command->modifiers_completer(gb, modifiers, context);
}
return NULL;
}
}
return NULL;
}
typedef enum {
JUMP_TO_NONE,
JUMP_TO_BREAK,
JUMP_TO_NONTRIVIAL,
} jump_to_return_t;
static jump_to_return_t test_jump_to_breakpoints(GB_gameboy_t *gb, uint16_t *address, unsigned *breakpoint_id);
static void noinline debugger_run(GB_gameboy_t *gb)
{
if (!gb->undo_state) {
gb->undo_state = malloc(GB_get_save_state_size_no_bess(gb));
GB_save_state_to_buffer_no_bess(gb, gb->undo_state);
}
char *input = NULL;
if (gb->debug_next_command && gb->debug_call_depth <= 0 && !gb->halted) {
GB_debugger_break(gb);
}
if (gb->debug_fin_command && gb->debug_call_depth <= -1) {
GB_debugger_break(gb);
}
if (gb->debug_stopped) {
if (!gb->help_shown) {
gb->help_shown = true;
GB_log(gb, "Type 'help' to list the available debugger commands.\n");
}
GB_cpu_disassemble(gb, gb->pc, 5);
}
next_command:
if (input) {
free(input);
}
unsigned breakpoint_id = 0;
if (gb->breakpoints && !gb->debug_stopped && (breakpoint_id = should_break(gb, gb->pc, false))) {
GB_debugger_break(gb);
GB_log(gb, "Breakpoint %u: PC = %s\n", breakpoint_id, value_to_string(gb, gb->pc, true, false));
GB_cpu_disassemble(gb, gb->pc, 5);
}
if (gb->breakpoints && !gb->debug_stopped) {
uint16_t address = 0;
jump_to_return_t jump_to_result = test_jump_to_breakpoints(gb, &address, &breakpoint_id);
bool should_delete_state = true;
if (jump_to_result == JUMP_TO_BREAK) {
GB_debugger_break(gb);
GB_log(gb, "Jumping to breakpoint %u: %s\n", breakpoint_id, value_to_string(gb, address, true, false));
GB_cpu_disassemble(gb, gb->pc, 5);
gb->non_trivial_jump_breakpoint_occured = false;
}
else if (gb->nontrivial_jump_state && (breakpoint_id = should_break(gb, gb->pc, true))) {
if (gb->non_trivial_jump_breakpoint_occured) {
gb->non_trivial_jump_breakpoint_occured = false;
}
else {
gb->non_trivial_jump_breakpoint_occured = true;
GB_log(gb, "Jumping to breakpoint %u: %s\n", breakpoint_id, value_to_string(gb, gb->pc, true, false));
GB_load_state_from_buffer(gb, gb->nontrivial_jump_state, -1);
GB_rewind_push(gb);
GB_cpu_disassemble(gb, gb->pc, 5);
GB_debugger_break(gb);
}
}
else if (jump_to_result == JUMP_TO_NONTRIVIAL) {
if (!gb->nontrivial_jump_state) {
gb->nontrivial_jump_state = malloc(GB_get_save_state_size_no_bess(gb));
}
GB_save_state_to_buffer_no_bess(gb, gb->nontrivial_jump_state);
gb->non_trivial_jump_breakpoint_occured = false;
should_delete_state = false;
}
else {
gb->non_trivial_jump_breakpoint_occured = false;
}
if (should_delete_state) {
if (gb->nontrivial_jump_state) {
free(gb->nontrivial_jump_state);
gb->nontrivial_jump_state = NULL;
}
}
}
if (gb->debug_stopped && !gb->debug_disable) {
gb->debug_next_command = false;
gb->debug_fin_command = false;
input = gb->input_callback(gb);
if (input == NULL) {
/* Debugging is no currently available, continue running */
gb->debug_stopped = false;
update_debug_active(gb);
return;
}
if (GB_debugger_execute_command(gb, input)) {
goto next_command;
}
free(input);
}
update_debug_active(gb);
}
void GB_debugger_run(GB_gameboy_t *gb)
{
#ifndef DISABLE_REWIND
if (gb->rewind_sequences && gb->rewind_sequences[gb->rewind_pos].key_state) {
typeof(gb->rewind_sequences[0]) *sequence = &gb->rewind_sequences[gb->rewind_pos];
sequence->instruction_count[sequence->pos]++;
}
if (unlikely(gb->backstep_instructions)) {
gb->backstep_instructions--;
return;
}
#endif
if (likely(!gb->debug_active)) return;
debugger_run(gb);
}
void GB_debugger_handle_async_commands(GB_gameboy_t *gb)
{
char *input = NULL;
while (gb->async_input_callback && (input = gb->async_input_callback(gb))) {
GB_debugger_execute_command(gb, input);
update_debug_active(gb);
free(input);
}
}
void GB_debugger_add_symbol(GB_gameboy_t *gb, uint16_t bank, uint16_t address, const char *symbol)
{
if (bank >= gb->n_symbol_maps) {
gb->bank_symbols = realloc(gb->bank_symbols, (bank + 1) * sizeof(*gb->bank_symbols));
while (bank >= gb->n_symbol_maps) {
gb->bank_symbols[gb->n_symbol_maps++] = NULL;
}
}
if (!gb->bank_symbols[bank]) {
gb->bank_symbols[bank] = GB_map_alloc();
}
GB_bank_symbol_t *allocated_symbol = GB_map_add_symbol(gb->bank_symbols[bank], address, symbol);
if (allocated_symbol) {
GB_reversed_map_add_symbol(&gb->reversed_symbol_map, bank, allocated_symbol);
}
}
void GB_debugger_load_symbol_file(GB_gameboy_t *gb, const char *path)
{
FILE *f = fopen(path, "r");
if (!f) return;
char *line = NULL;
size_t size = 0;
size_t length = 0;
while ((length = getline(&line, &size, f)) != -1) {
for (unsigned i = 0; i < length; i++) {
if (line[i] == ';' || line[i] == '\n' || line[i] == '\r') {
line[i] = 0;
length = i;
break;
}
}
if (length == 0) continue;
unsigned bank, address;
char symbol[length];
if (sscanf(line, "%x:%x %s", &bank, &address, symbol) == 3) {
GB_debugger_add_symbol(gb, bank, address, symbol);
}
}
free(line);
fclose(f);
}
void GB_debugger_clear_symbols(GB_gameboy_t *gb)
{
for (unsigned i = gb->n_symbol_maps; i--;) {
if (gb->bank_symbols[i]) {
GB_map_free(gb->bank_symbols[i]);
gb->bank_symbols[i] = 0;
}
}
for (unsigned i = sizeof(gb->reversed_symbol_map.buckets) / sizeof(gb->reversed_symbol_map.buckets[0]); i--;) {
while (gb->reversed_symbol_map.buckets[i]) {
GB_symbol_t *next = gb->reversed_symbol_map.buckets[i]->next;
free(gb->reversed_symbol_map.buckets[i]);
gb->reversed_symbol_map.buckets[i] = next;
}
}
gb->n_symbol_maps = 0;
if (gb->bank_symbols) {
free(gb->bank_symbols);
gb->bank_symbols = NULL;
}
}
const GB_bank_symbol_t *GB_debugger_find_symbol(GB_gameboy_t *gb, uint16_t addr, bool prefer_local)
{
uint16_t bank = bank_for_addr(gb, addr);
const GB_bank_symbol_t *symbol = GB_map_find_symbol(get_symbol_map(gb, bank), addr, prefer_local);
if (symbol) return symbol;
if (bank != 0) return GB_map_find_symbol(get_symbol_map(gb, 0), addr, prefer_local); /* Maybe the symbol incorrectly uses bank 0? */
return NULL;
}
const char *GB_debugger_name_for_address(GB_gameboy_t *gb, uint16_t addr)
{
return GB_debugger_describe_address(gb, addr, -1, true, false);
}
const char *GB_debugger_describe_address(GB_gameboy_t *gb,
uint16_t addr, uint16_t bank,
bool exact_match, bool prefer_local)
{
if (bank == (uint16_t)-1) {
bank = bank_for_addr(gb, addr);
}
if (exact_match) {
const GB_bank_symbol_t *symbol = GB_map_find_symbol(get_symbol_map(gb, bank), addr, prefer_local);
if (symbol && symbol->addr == addr) return symbol->name;
if (bank != 0) symbol = GB_map_find_symbol(get_symbol_map(gb, 0), addr, prefer_local); /* Maybe the symbol incorrectly uses bank 0? */
if (symbol && symbol->addr == addr) return symbol->name;
return NULL;
}
return debugger_value_to_string(gb, (value_t){
.value = addr,
.bank = bank,
.has_bank = true,
}, true, prefer_local);
}
/* The public version of debugger_evaluate */
bool GB_debugger_evaluate(GB_gameboy_t *gb, const char *string, uint16_t *result, uint16_t *result_bank)
{
GB_ASSERT_NOT_RUNNING_OTHER_THREAD(gb)
bool error = false;
value_t value = debugger_evaluate(gb, string, strlen(string), &error, NULL, NULL);
if (result) {
*result = value.value;
}
if (result_bank) {
*result_bank = value.has_bank? value.bank : -1;
}
return error;
}
void GB_debugger_break(GB_gameboy_t *gb)
{
gb->debug_stopped = true;
update_debug_active(gb);
}
bool GB_debugger_is_stopped(GB_gameboy_t *gb)
{
return gb->debug_stopped;
}
void GB_debugger_set_disabled(GB_gameboy_t *gb, bool disabled)
{
gb->debug_disable = disabled;
update_debug_active(gb);
}
/* Jump-to breakpoints */
static bool is_in_trivial_memory(uint16_t addr)
{
/* ROM */
if (addr < 0x8000) {
return true;
}
/* HRAM */
if (addr >= 0xFF80 && addr < 0xFFFF) {
return true;
}
/* RAM */
if (addr >= 0xC000 && addr < 0xE000) {
return true;
}
return false;
}
typedef uint16_t opcode_address_getter_t(GB_gameboy_t *gb, uint8_t opcode);
static uint16_t trivial_1(GB_gameboy_t *gb, uint8_t opcode)
{
return gb->pc + 1;
}
static uint16_t trivial_2(GB_gameboy_t *gb, uint8_t opcode)
{
return gb->pc + 2;
}
static uint16_t trivial_3(GB_gameboy_t *gb, uint8_t opcode)
{
return gb->pc + 3;
}
static uint16_t jr_r8(GB_gameboy_t *gb, uint8_t opcode)
{
return gb->pc + 2 + (int8_t)GB_read_memory(gb, gb->pc + 1);
}
static bool condition_code(GB_gameboy_t *gb, uint8_t opcode)
{
switch ((opcode >> 3) & 0x3) {
case 0:
return !(gb->af & GB_ZERO_FLAG);
case 1:
return (gb->af & GB_ZERO_FLAG);
case 2:
return !(gb->af & GB_CARRY_FLAG);
case 3:
return (gb->af & GB_CARRY_FLAG);
}
return false;
}
static uint16_t jr_cc_r8(GB_gameboy_t *gb, uint8_t opcode)
{
if (!condition_code(gb, opcode)) {
return gb->pc + 2;
}
return gb->pc + 2 + (int8_t)GB_read_memory(gb, gb->pc + 1);
}
static uint16_t ret(GB_gameboy_t *gb, uint8_t opcode)
{
return GB_read_memory(gb, gb->sp) |
(GB_read_memory(gb, gb->sp + 1) << 8);
}
static uint16_t ret_cc(GB_gameboy_t *gb, uint8_t opcode)
{
if (condition_code(gb, opcode)) {
return ret(gb, opcode);
}
else {
return gb->pc + 1;
}
}
static uint16_t jp_a16(GB_gameboy_t *gb, uint8_t opcode)
{
return GB_read_memory(gb, gb->pc + 1) |
(GB_read_memory(gb, gb->pc + 2) << 8);
}
static uint16_t jp_cc_a16(GB_gameboy_t *gb, uint8_t opcode)
{
if (condition_code(gb, opcode)) {
return jp_a16(gb, opcode);
}
else {
return gb->pc + 3;
}
}
static uint16_t rst(GB_gameboy_t *gb, uint8_t opcode)
{
return opcode ^ 0xC7;
}
static uint16_t jp_hl(GB_gameboy_t *gb, uint8_t opcode)
{
return gb->hl;
}
static opcode_address_getter_t *opcodes[256] = {
/* X0 X1 X2 X3 X4 X5 X6 X7 */
/* X8 X9 Xa Xb Xc Xd Xe Xf */
trivial_1, trivial_3, trivial_1, trivial_1, trivial_1, trivial_1, trivial_2, trivial_1, /* 0X */
trivial_3, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_2, trivial_1,
trivial_2, trivial_3, trivial_1, trivial_1, trivial_1, trivial_1, trivial_2, trivial_1, /* 1X */
jr_r8, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_2, trivial_1,
jr_cc_r8, trivial_3, trivial_1, trivial_1, trivial_1, trivial_1, trivial_2, trivial_1, /* 2X */
jr_cc_r8, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_2, trivial_1,
jr_cc_r8, trivial_3, trivial_1, trivial_1, trivial_1, trivial_1, trivial_2, trivial_1, /* 3X */
jr_cc_r8, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_2, trivial_1,
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, /* 4X */
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1,
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, /* 5X */
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1,
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, /* 6X */
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1,
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, NULL, trivial_1, /* 7X */
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1,
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, /* 8X */
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1,
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, /* 9X */
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1,
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, /* aX */
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1,
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, /* bX */
trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1, trivial_1,
ret_cc, trivial_1, jp_cc_a16, jp_a16, jp_cc_a16, trivial_1, trivial_2, rst, /* cX */
ret_cc, ret, jp_cc_a16, trivial_2, jp_cc_a16, jp_a16, trivial_2, rst,
ret_cc, trivial_1, jp_cc_a16, NULL, jp_cc_a16, trivial_1, trivial_2, rst, /* dX */
ret_cc, ret, jp_cc_a16, NULL, jp_cc_a16, NULL, trivial_2, rst,
trivial_2, trivial_1, trivial_1, NULL, NULL, trivial_1, trivial_2, rst, /* eX */
trivial_2, jp_hl, trivial_3, NULL, NULL, NULL, trivial_2, rst,
trivial_2, trivial_1, trivial_1, trivial_1, NULL, trivial_1, trivial_2, rst, /* fX */
trivial_2, trivial_1, trivial_3, trivial_1, NULL, NULL, trivial_2, rst,
};
static jump_to_return_t test_jump_to_breakpoints(GB_gameboy_t *gb, uint16_t *address, unsigned *breakpoint_id)
{
if (!gb->has_jump_to_breakpoints) return JUMP_TO_NONE;
if (!is_in_trivial_memory(gb->pc) || !is_in_trivial_memory(gb->pc + 2) ||
!is_in_trivial_memory(gb->sp) || !is_in_trivial_memory(gb->sp - 1)) {
return JUMP_TO_NONTRIVIAL;
}
/* Interrupts */
if (gb->ime) {
for (unsigned i = 0; i < 5; i++) {
if ((gb->interrupt_enable & (1 << i)) && (gb->io_registers[GB_IO_IF] & (1 << i))) {
if ((*breakpoint_id = should_break(gb, 0x40 + i * 8, true))) {
if (address) {
*address = 0x40 + i * 8;
}
return JUMP_TO_BREAK;
}
}
}
}
uint16_t n_watchpoints = gb->n_watchpoints;
gb->n_watchpoints = 0;
uint8_t opcode = GB_read_memory(gb, gb->pc);
if (opcode == 0x76) {
gb->n_watchpoints = n_watchpoints;
if (gb->ime) { /* Already handled in above */
return JUMP_TO_NONE;
}
if (gb->interrupt_enable & gb->io_registers[GB_IO_IF] & 0x1F) {
return JUMP_TO_NONTRIVIAL; /* HALT bug could occur */
}
return JUMP_TO_NONE;
}
opcode_address_getter_t *getter = opcodes[opcode];
if (!getter) {
gb->n_watchpoints = n_watchpoints;
return JUMP_TO_NONE;
}
uint16_t new_pc = getter(gb, opcode);
gb->n_watchpoints = n_watchpoints;
if (address) {
*address = new_pc;
}
return (*breakpoint_id = should_break(gb, new_pc, true)) ? JUMP_TO_BREAK : JUMP_TO_NONE;
}
|
1bc85f405580d796f083977346e8b7e87b5b4c23
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/arch/s390/mm/dump_pagetables.c
|
3ad65b04ac1508a62290e57e7a7013d4edbe994d
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 6,258
|
c
|
dump_pagetables.c
|
#include <linux/seq_file.h>
#include <linux/debugfs.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <asm/sections.h>
#include <asm/pgtable.h>
static unsigned long max_addr;
struct addr_marker {
unsigned long start_address;
const char *name;
};
enum address_markers_idx {
IDENTITY_NR = 0,
KERNEL_START_NR,
KERNEL_END_NR,
VMEMMAP_NR,
VMALLOC_NR,
#ifdef CONFIG_64BIT
MODULES_NR,
#endif
};
static struct addr_marker address_markers[] = {
[IDENTITY_NR] = {0, "Identity Mapping"},
[KERNEL_START_NR] = {(unsigned long)&_stext, "Kernel Image Start"},
[KERNEL_END_NR] = {(unsigned long)&_end, "Kernel Image End"},
[VMEMMAP_NR] = {0, "vmemmap Area"},
[VMALLOC_NR] = {0, "vmalloc Area"},
#ifdef CONFIG_64BIT
[MODULES_NR] = {0, "Modules Area"},
#endif
{ -1, NULL }
};
struct pg_state {
int level;
unsigned int current_prot;
unsigned long start_address;
unsigned long current_address;
const struct addr_marker *marker;
};
static void print_prot(struct seq_file *m, unsigned int pr, int level)
{
static const char * const level_name[] =
{ "ASCE", "PGD", "PUD", "PMD", "PTE" };
seq_printf(m, "%s ", level_name[level]);
if (pr & _PAGE_INVALID) {
seq_printf(m, "I\n");
return;
}
seq_printf(m, "%s", pr & _PAGE_RO ? "RO " : "RW ");
seq_printf(m, "%s", pr & _PAGE_CO ? "CO " : " ");
seq_putc(m, '\n');
}
static void note_page(struct seq_file *m, struct pg_state *st,
unsigned int new_prot, int level)
{
static const char units[] = "KMGTPE";
int width = sizeof(unsigned long) * 2;
const char *unit = units;
unsigned int prot, cur;
unsigned long delta;
/*
* If we have a "break" in the series, we need to flush the state
* that we have now. "break" is either changing perms, levels or
* address space marker.
*/
prot = new_prot;
cur = st->current_prot;
if (!st->level) {
/* First entry */
st->current_prot = new_prot;
st->level = level;
st->marker = address_markers;
seq_printf(m, "---[ %s ]---\n", st->marker->name);
} else if (prot != cur || level != st->level ||
st->current_address >= st->marker[1].start_address) {
/* Print the actual finished series */
seq_printf(m, "0x%0*lx-0x%0*lx",
width, st->start_address,
width, st->current_address);
delta = (st->current_address - st->start_address) >> 10;
while (!(delta & 0x3ff) && unit[1]) {
delta >>= 10;
unit++;
}
seq_printf(m, "%9lu%c ", delta, *unit);
print_prot(m, st->current_prot, st->level);
if (st->current_address >= st->marker[1].start_address) {
st->marker++;
seq_printf(m, "---[ %s ]---\n", st->marker->name);
}
st->start_address = st->current_address;
st->current_prot = new_prot;
st->level = level;
}
}
/*
* The actual page table walker functions. In order to keep the implementation
* of print_prot() short, we only check and pass _PAGE_INVALID and _PAGE_RO
* flags to note_page() if a region, segment or page table entry is invalid or
* read-only.
* After all it's just a hint that the current level being walked contains an
* invalid or read-only entry.
*/
static void walk_pte_level(struct seq_file *m, struct pg_state *st,
pmd_t *pmd, unsigned long addr)
{
unsigned int prot;
pte_t *pte;
int i;
for (i = 0; i < PTRS_PER_PTE && addr < max_addr; i++) {
st->current_address = addr;
pte = pte_offset_kernel(pmd, addr);
prot = pte_val(*pte) & (_PAGE_RO | _PAGE_INVALID);
note_page(m, st, prot, 4);
addr += PAGE_SIZE;
}
}
#ifdef CONFIG_64BIT
#define _PMD_PROT_MASK (_SEGMENT_ENTRY_RO | _SEGMENT_ENTRY_CO)
#else
#define _PMD_PROT_MASK 0
#endif
static void walk_pmd_level(struct seq_file *m, struct pg_state *st,
pud_t *pud, unsigned long addr)
{
unsigned int prot;
pmd_t *pmd;
int i;
for (i = 0; i < PTRS_PER_PMD && addr < max_addr; i++) {
st->current_address = addr;
pmd = pmd_offset(pud, addr);
if (!pmd_none(*pmd)) {
if (pmd_large(*pmd)) {
prot = pmd_val(*pmd) & _PMD_PROT_MASK;
note_page(m, st, prot, 3);
} else
walk_pte_level(m, st, pmd, addr);
} else
note_page(m, st, _PAGE_INVALID, 3);
addr += PMD_SIZE;
}
}
#ifdef CONFIG_64BIT
#define _PUD_PROT_MASK (_REGION3_ENTRY_RO | _REGION3_ENTRY_CO)
#else
#define _PUD_PROT_MASK 0
#endif
static void walk_pud_level(struct seq_file *m, struct pg_state *st,
pgd_t *pgd, unsigned long addr)
{
unsigned int prot;
pud_t *pud;
int i;
for (i = 0; i < PTRS_PER_PUD && addr < max_addr; i++) {
st->current_address = addr;
pud = pud_offset(pgd, addr);
if (!pud_none(*pud))
if (pud_large(*pud)) {
prot = pud_val(*pud) & _PUD_PROT_MASK;
note_page(m, st, prot, 2);
} else
walk_pmd_level(m, st, pud, addr);
else
note_page(m, st, _PAGE_INVALID, 2);
addr += PUD_SIZE;
}
}
static void walk_pgd_level(struct seq_file *m)
{
unsigned long addr = 0;
struct pg_state st;
pgd_t *pgd;
int i;
memset(&st, 0, sizeof(st));
for (i = 0; i < PTRS_PER_PGD && addr < max_addr; i++) {
st.current_address = addr;
pgd = pgd_offset_k(addr);
if (!pgd_none(*pgd))
walk_pud_level(m, &st, pgd, addr);
else
note_page(m, &st, _PAGE_INVALID, 1);
addr += PGDIR_SIZE;
}
/* Flush out the last page */
st.current_address = max_addr;
note_page(m, &st, 0, 0);
}
static int ptdump_show(struct seq_file *m, void *v)
{
walk_pgd_level(m);
return 0;
}
static int ptdump_open(struct inode *inode, struct file *filp)
{
return single_open(filp, ptdump_show, NULL);
}
static const struct file_operations ptdump_fops = {
.open = ptdump_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static int pt_dump_init(void)
{
/*
* Figure out the maximum virtual address being accessible with the
* kernel ASCE. We need this to keep the page table walker functions
* from accessing non-existent entries.
*/
#ifdef CONFIG_32BIT
max_addr = 1UL << 31;
#else
max_addr = (S390_lowcore.kernel_asce & _REGION_ENTRY_TYPE_MASK) >> 2;
max_addr = 1UL << (max_addr * 11 + 31);
address_markers[MODULES_NR].start_address = MODULES_VADDR;
#endif
address_markers[VMEMMAP_NR].start_address = (unsigned long) vmemmap;
address_markers[VMALLOC_NR].start_address = VMALLOC_START;
debugfs_create_file("kernel_page_tables", 0400, NULL, NULL, &ptdump_fops);
return 0;
}
device_initcall(pt_dump_init);
|
8f1eb0a441303e7c4d06b98ef7477eb95fbd34ac
|
7f6c235b0598353549959c18f69eefd20b766907
|
/include/_DEVELOPMENT/clang/z88dk.h
|
4974d16d9e1bf6627eb0d112832e5f0e5eaa755a
|
[
"ClArtistic"
] |
permissive
|
z88dk/z88dk
|
46dfd4905f36d99333173cadd0a660839befc9f0
|
8b07f37cc43c5d9ffe69b563c80763491d8faff7
|
refs/heads/master
| 2023-09-04T19:29:49.254958
| 2023-09-03T20:51:24
| 2023-09-03T20:51:24
| 54,035,569
| 820
| 263
|
NOASSERTION
| 2023-09-05T11:09:04
| 2016-03-16T13:48:16
|
Assembly
|
UTF-8
|
C
| false
| false
| 1,768
|
h
|
z88dk.h
|
// automatically generated by m4 from headers in proto subdir
#ifndef __Z88DK_H__
#define __Z88DK_H__
#include <arch.h>
// z88dk version
// 1990 = 1.99A
// 1991 = 1.99B
// 1992 = 1.99C
// 2000 = 2.00
#define Z88DK_VERSION __Z88DK
// section information
#define SECTION_ORG(sec) ((unsigned int)SECTION_ORG_##sec())
#define SECTION_END(sec) ((unsigned int)SECTION_END_##sec())
#define SECTION_SIZE(sec) ((unsigned int)SECTION_SIZE_##sec())
extern unsigned char _CODE_head[];
extern unsigned char _DATA_head[];
extern unsigned char _BSS_head[];
#define SECTION_CODE_ORG() ((unsigned int)_CODE_head)
#define SECTION_DATA_ORG() ((unsigned int)_DATA_head)
#define SECTION_BSS_ORG() ((unsigned int)_BSS_head)
extern unsigned char _CODE_END_tail[];
extern unsigned char _DATA_END_tail[];
extern unsigned char _BSS_UNINITIALIZED_head[];
#define SECTION_CODE_END() ((unsigned int)_CODE_END_tail)
#define SECTION_DATA_END() ((unsigned int)_DATA_END_tail)
#define SECTION_BSS_END() ((unsigned int)_BSS_UNINITIALIZED_head)
#if __CLANG
extern unsigned int SECTION_SIZE_CODE(void);
extern unsigned int SECTION_SIZE_DATA(void);
extern unsigned int SECTION_SIZE_BSS(void);
#endif
#if __SDCC
extern unsigned int SECTION_SIZE_CODE(void) __preserves_regs(a,b,c,d,e,iyl,iyh);
extern unsigned int SECTION_SIZE_DATA(void) __preserves_regs(a,b,c,d,e,iyl,iyh);
extern unsigned int SECTION_SIZE_BSS(void) __preserves_regs(a,b,c,d,e,iyl,iyh);
#endif
#if __SCCZ80
extern unsigned int SECTION_SIZE_CODE(void);
extern unsigned int SECTION_SIZE_DATA(void);
extern unsigned int SECTION_SIZE_BSS(void);
#endif
#define SECTION_CODE_SIZE() SECTION_SIZE_CODE()
#define SECTION_DATA_SIZE() SECTION_SIZE_DATA()
#define SECTION_BSS_SIZE() SECTION_SIZE_BSS()
#endif
|
7579fd1ca384917da66e35820a4d7cb9f0524403
|
66fc3d58e94e8340a0d825501776a1dea37c0198
|
/vendor/aftereffects/vc/vc15/utils/Half.h
|
503575071b5e91d64e8626940118c3a20d79e37c
|
[
"BSD-3-Clause",
"CC-BY-4.0"
] |
permissive
|
AcademySoftwareFoundation/OpenColorIO
|
dad370b54be147ae94f18ed6414d53bd76e9ef74
|
96f528fdfb7f9fb24388e33f6a968d29a3909cf8
|
refs/heads/main
| 2023-08-29T08:51:45.625957
| 2023-08-29T01:42:37
| 2023-08-29T01:42:37
| 775,131
| 843
| 236
|
BSD-3-Clause
| 2023-09-14T02:56:01
| 2010-07-14T18:22:06
|
C++
|
UTF-8
|
C
| false
| false
| 290
|
h
|
Half.h
|
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenColorIO Project.
#ifndef INCLUDED_OCIO_IMATH_H
#define INCLUDED_OCIO_IMATH_H
#define OCIO_USE_IMATH_HALF 0
#if OCIO_USE_IMATH_HALF
# include <Imath/half.h>
#else
# include <OpenEXR/half.h>
#endif
#endif
|
ef1f236896fde8c31b2ee966cbe0618700dd8433
|
961024a89ad28f2b54f6f05139a55b772b0d1077
|
/src/pokemon_icon.c
|
0014469738043e549a5d0ac471b7ee57af271c3d
|
[] |
no_license
|
BuffelSaft/pokeemerald
|
61ac3140a2f7d85baa426671a3b10abb4c8bcb13
|
93e96730fb3c771f7f08f9623ae36f0643c52d3d
|
refs/heads/master
| 2023-04-13T03:57:24.336111
| 2022-12-16T08:12:24
| 2022-12-16T08:12:24
| 216,335,931
| 143
| 55
| null | 2022-11-05T23:39:10
| 2019-10-20T09:18:38
|
C
|
UTF-8
|
C
| false
| false
| 102,362
|
c
|
pokemon_icon.c
|
#include "global.h"
#include "graphics.h"
#include "mail.h"
#include "palette.h"
#include "pokemon_icon.h"
#include "sprite.h"
#include "data.h"
#define POKE_ICON_BASE_PAL_TAG 56000
#define INVALID_ICON_SPECIES SPECIES_NONE // Oddly specific, used when an icon should be a ?. Any of the 'old unown' would work
struct MonIconSpriteTemplate
{
const struct OamData *oam;
const u8 *image;
const union AnimCmd *const *anims;
const union AffineAnimCmd *const *affineAnims;
void (*callback)(struct Sprite *);
u16 paletteTag;
};
// static functions
static u8 CreateMonIconSprite(struct MonIconSpriteTemplate *, s16, s16, u8);
// .rodata
const u8 *const gMonIconTable[] =
{
[SPECIES_NONE] = gMonIcon_Bulbasaur,
[SPECIES_BULBASAUR] = gMonIcon_Bulbasaur,
[SPECIES_IVYSAUR] = gMonIcon_Ivysaur,
[SPECIES_VENUSAUR] = gMonIcon_Venusaur,
[SPECIES_CHARMANDER] = gMonIcon_Charmander,
[SPECIES_CHARMELEON] = gMonIcon_Charmeleon,
[SPECIES_CHARIZARD] = gMonIcon_Charizard,
[SPECIES_SQUIRTLE] = gMonIcon_Squirtle,
[SPECIES_WARTORTLE] = gMonIcon_Wartortle,
[SPECIES_BLASTOISE] = gMonIcon_Blastoise,
[SPECIES_CATERPIE] = gMonIcon_Caterpie,
[SPECIES_METAPOD] = gMonIcon_Metapod,
[SPECIES_BUTTERFREE] = gMonIcon_Butterfree,
[SPECIES_WEEDLE] = gMonIcon_Weedle,
[SPECIES_KAKUNA] = gMonIcon_Kakuna,
[SPECIES_BEEDRILL] = gMonIcon_Beedrill,
[SPECIES_PIDGEY] = gMonIcon_Pidgey,
[SPECIES_PIDGEOTTO] = gMonIcon_Pidgeotto,
[SPECIES_PIDGEOT] = gMonIcon_Pidgeot,
[SPECIES_RATTATA] = gMonIcon_Rattata,
[SPECIES_RATICATE] = gMonIcon_Raticate,
[SPECIES_SPEAROW] = gMonIcon_Spearow,
[SPECIES_FEAROW] = gMonIcon_Fearow,
[SPECIES_EKANS] = gMonIcon_Ekans,
[SPECIES_ARBOK] = gMonIcon_Arbok,
[SPECIES_PIKACHU] = gMonIcon_Pikachu,
[SPECIES_RAICHU] = gMonIcon_Raichu,
[SPECIES_SANDSHREW] = gMonIcon_Sandshrew,
[SPECIES_SANDSLASH] = gMonIcon_Sandslash,
[SPECIES_NIDORAN_F] = gMonIcon_NidoranF,
[SPECIES_NIDORINA] = gMonIcon_Nidorina,
[SPECIES_NIDOQUEEN] = gMonIcon_Nidoqueen,
[SPECIES_NIDORAN_M] = gMonIcon_NidoranM,
[SPECIES_NIDORINO] = gMonIcon_Nidorino,
[SPECIES_NIDOKING] = gMonIcon_Nidoking,
[SPECIES_CLEFAIRY] = gMonIcon_Clefairy,
[SPECIES_CLEFABLE] = gMonIcon_Clefable,
[SPECIES_VULPIX] = gMonIcon_Vulpix,
[SPECIES_NINETALES] = gMonIcon_Ninetales,
[SPECIES_JIGGLYPUFF] = gMonIcon_Jigglypuff,
[SPECIES_WIGGLYTUFF] = gMonIcon_Wigglytuff,
[SPECIES_ZUBAT] = gMonIcon_Zubat,
[SPECIES_GOLBAT] = gMonIcon_Golbat,
[SPECIES_ODDISH] = gMonIcon_Oddish,
[SPECIES_GLOOM] = gMonIcon_Gloom,
[SPECIES_VILEPLUME] = gMonIcon_Vileplume,
[SPECIES_PARAS] = gMonIcon_Paras,
[SPECIES_PARASECT] = gMonIcon_Parasect,
[SPECIES_VENONAT] = gMonIcon_Venonat,
[SPECIES_VENOMOTH] = gMonIcon_Venomoth,
[SPECIES_DIGLETT] = gMonIcon_Diglett,
[SPECIES_DUGTRIO] = gMonIcon_Dugtrio,
[SPECIES_MEOWTH] = gMonIcon_Meowth,
[SPECIES_PERSIAN] = gMonIcon_Persian,
[SPECIES_PSYDUCK] = gMonIcon_Psyduck,
[SPECIES_GOLDUCK] = gMonIcon_Golduck,
[SPECIES_MANKEY] = gMonIcon_Mankey,
[SPECIES_PRIMEAPE] = gMonIcon_Primeape,
[SPECIES_GROWLITHE] = gMonIcon_Growlithe,
[SPECIES_ARCANINE] = gMonIcon_Arcanine,
[SPECIES_POLIWAG] = gMonIcon_Poliwag,
[SPECIES_POLIWHIRL] = gMonIcon_Poliwhirl,
[SPECIES_POLIWRATH] = gMonIcon_Poliwrath,
[SPECIES_ABRA] = gMonIcon_Abra,
[SPECIES_KADABRA] = gMonIcon_Kadabra,
[SPECIES_ALAKAZAM] = gMonIcon_Alakazam,
[SPECIES_MACHOP] = gMonIcon_Machop,
[SPECIES_MACHOKE] = gMonIcon_Machoke,
[SPECIES_MACHAMP] = gMonIcon_Machamp,
[SPECIES_BELLSPROUT] = gMonIcon_Bellsprout,
[SPECIES_WEEPINBELL] = gMonIcon_Weepinbell,
[SPECIES_VICTREEBEL] = gMonIcon_Victreebel,
[SPECIES_TENTACOOL] = gMonIcon_Tentacool,
[SPECIES_TENTACRUEL] = gMonIcon_Tentacruel,
[SPECIES_GEODUDE] = gMonIcon_Geodude,
[SPECIES_GRAVELER] = gMonIcon_Graveler,
[SPECIES_GOLEM] = gMonIcon_Golem,
[SPECIES_PONYTA] = gMonIcon_Ponyta,
[SPECIES_RAPIDASH] = gMonIcon_Rapidash,
[SPECIES_SLOWPOKE] = gMonIcon_Slowpoke,
[SPECIES_SLOWBRO] = gMonIcon_Slowbro,
[SPECIES_MAGNEMITE] = gMonIcon_Magnemite,
[SPECIES_MAGNETON] = gMonIcon_Magneton,
[SPECIES_FARFETCHD] = gMonIcon_Farfetchd,
[SPECIES_DODUO] = gMonIcon_Doduo,
[SPECIES_DODRIO] = gMonIcon_Dodrio,
[SPECIES_SEEL] = gMonIcon_Seel,
[SPECIES_DEWGONG] = gMonIcon_Dewgong,
[SPECIES_GRIMER] = gMonIcon_Grimer,
[SPECIES_MUK] = gMonIcon_Muk,
[SPECIES_SHELLDER] = gMonIcon_Shellder,
[SPECIES_CLOYSTER] = gMonIcon_Cloyster,
[SPECIES_GASTLY] = gMonIcon_Gastly,
[SPECIES_HAUNTER] = gMonIcon_Haunter,
[SPECIES_GENGAR] = gMonIcon_Gengar,
[SPECIES_ONIX] = gMonIcon_Onix,
[SPECIES_DROWZEE] = gMonIcon_Drowzee,
[SPECIES_HYPNO] = gMonIcon_Hypno,
[SPECIES_KRABBY] = gMonIcon_Krabby,
[SPECIES_KINGLER] = gMonIcon_Kingler,
[SPECIES_VOLTORB] = gMonIcon_Voltorb,
[SPECIES_ELECTRODE] = gMonIcon_Electrode,
[SPECIES_EXEGGCUTE] = gMonIcon_Exeggcute,
[SPECIES_EXEGGUTOR] = gMonIcon_Exeggutor,
[SPECIES_CUBONE] = gMonIcon_Cubone,
[SPECIES_MAROWAK] = gMonIcon_Marowak,
[SPECIES_HITMONLEE] = gMonIcon_Hitmonlee,
[SPECIES_HITMONCHAN] = gMonIcon_Hitmonchan,
[SPECIES_LICKITUNG] = gMonIcon_Lickitung,
[SPECIES_KOFFING] = gMonIcon_Koffing,
[SPECIES_WEEZING] = gMonIcon_Weezing,
[SPECIES_RHYHORN] = gMonIcon_Rhyhorn,
[SPECIES_RHYDON] = gMonIcon_Rhydon,
[SPECIES_CHANSEY] = gMonIcon_Chansey,
[SPECIES_TANGELA] = gMonIcon_Tangela,
[SPECIES_KANGASKHAN] = gMonIcon_Kangaskhan,
[SPECIES_HORSEA] = gMonIcon_Horsea,
[SPECIES_SEADRA] = gMonIcon_Seadra,
[SPECIES_GOLDEEN] = gMonIcon_Goldeen,
[SPECIES_SEAKING] = gMonIcon_Seaking,
[SPECIES_STARYU] = gMonIcon_Staryu,
[SPECIES_STARMIE] = gMonIcon_Starmie,
[SPECIES_MR_MIME] = gMonIcon_MrMime,
[SPECIES_SCYTHER] = gMonIcon_Scyther,
[SPECIES_JYNX] = gMonIcon_Jynx,
[SPECIES_ELECTABUZZ] = gMonIcon_Electabuzz,
[SPECIES_MAGMAR] = gMonIcon_Magmar,
[SPECIES_PINSIR] = gMonIcon_Pinsir,
[SPECIES_TAUROS] = gMonIcon_Tauros,
[SPECIES_MAGIKARP] = gMonIcon_Magikarp,
[SPECIES_GYARADOS] = gMonIcon_Gyarados,
[SPECIES_LAPRAS] = gMonIcon_Lapras,
[SPECIES_DITTO] = gMonIcon_Ditto,
[SPECIES_EEVEE] = gMonIcon_Eevee,
[SPECIES_VAPOREON] = gMonIcon_Vaporeon,
[SPECIES_JOLTEON] = gMonIcon_Jolteon,
[SPECIES_FLAREON] = gMonIcon_Flareon,
[SPECIES_PORYGON] = gMonIcon_Porygon,
[SPECIES_OMANYTE] = gMonIcon_Omanyte,
[SPECIES_OMASTAR] = gMonIcon_Omastar,
[SPECIES_KABUTO] = gMonIcon_Kabuto,
[SPECIES_KABUTOPS] = gMonIcon_Kabutops,
[SPECIES_AERODACTYL] = gMonIcon_Aerodactyl,
[SPECIES_SNORLAX] = gMonIcon_Snorlax,
[SPECIES_ARTICUNO] = gMonIcon_Articuno,
[SPECIES_ZAPDOS] = gMonIcon_Zapdos,
[SPECIES_MOLTRES] = gMonIcon_Moltres,
[SPECIES_DRATINI] = gMonIcon_Dratini,
[SPECIES_DRAGONAIR] = gMonIcon_Dragonair,
[SPECIES_DRAGONITE] = gMonIcon_Dragonite,
[SPECIES_MEWTWO] = gMonIcon_Mewtwo,
[SPECIES_MEW] = gMonIcon_Mew,
[SPECIES_CHIKORITA] = gMonIcon_Chikorita,
[SPECIES_BAYLEEF] = gMonIcon_Bayleef,
[SPECIES_MEGANIUM] = gMonIcon_Meganium,
[SPECIES_CYNDAQUIL] = gMonIcon_Cyndaquil,
[SPECIES_QUILAVA] = gMonIcon_Quilava,
[SPECIES_TYPHLOSION] = gMonIcon_Typhlosion,
[SPECIES_TOTODILE] = gMonIcon_Totodile,
[SPECIES_CROCONAW] = gMonIcon_Croconaw,
[SPECIES_FERALIGATR] = gMonIcon_Feraligatr,
[SPECIES_SENTRET] = gMonIcon_Sentret,
[SPECIES_FURRET] = gMonIcon_Furret,
[SPECIES_HOOTHOOT] = gMonIcon_Hoothoot,
[SPECIES_NOCTOWL] = gMonIcon_Noctowl,
[SPECIES_LEDYBA] = gMonIcon_Ledyba,
[SPECIES_LEDIAN] = gMonIcon_Ledian,
[SPECIES_SPINARAK] = gMonIcon_Spinarak,
[SPECIES_ARIADOS] = gMonIcon_Ariados,
[SPECIES_CROBAT] = gMonIcon_Crobat,
[SPECIES_CHINCHOU] = gMonIcon_Chinchou,
[SPECIES_LANTURN] = gMonIcon_Lanturn,
[SPECIES_PICHU] = gMonIcon_Pichu,
[SPECIES_CLEFFA] = gMonIcon_Cleffa,
[SPECIES_IGGLYBUFF] = gMonIcon_Igglybuff,
[SPECIES_TOGEPI] = gMonIcon_Togepi,
[SPECIES_TOGETIC] = gMonIcon_Togetic,
[SPECIES_NATU] = gMonIcon_Natu,
[SPECIES_XATU] = gMonIcon_Xatu,
[SPECIES_MAREEP] = gMonIcon_Mareep,
[SPECIES_FLAAFFY] = gMonIcon_Flaaffy,
[SPECIES_AMPHAROS] = gMonIcon_Ampharos,
[SPECIES_BELLOSSOM] = gMonIcon_Bellossom,
[SPECIES_MARILL] = gMonIcon_Marill,
[SPECIES_AZUMARILL] = gMonIcon_Azumarill,
[SPECIES_SUDOWOODO] = gMonIcon_Sudowoodo,
[SPECIES_POLITOED] = gMonIcon_Politoed,
[SPECIES_HOPPIP] = gMonIcon_Hoppip,
[SPECIES_SKIPLOOM] = gMonIcon_Skiploom,
[SPECIES_JUMPLUFF] = gMonIcon_Jumpluff,
[SPECIES_AIPOM] = gMonIcon_Aipom,
[SPECIES_SUNKERN] = gMonIcon_Sunkern,
[SPECIES_SUNFLORA] = gMonIcon_Sunflora,
[SPECIES_YANMA] = gMonIcon_Yanma,
[SPECIES_WOOPER] = gMonIcon_Wooper,
[SPECIES_QUAGSIRE] = gMonIcon_Quagsire,
[SPECIES_ESPEON] = gMonIcon_Espeon,
[SPECIES_UMBREON] = gMonIcon_Umbreon,
[SPECIES_MURKROW] = gMonIcon_Murkrow,
[SPECIES_SLOWKING] = gMonIcon_Slowking,
[SPECIES_MISDREAVUS] = gMonIcon_Misdreavus,
[SPECIES_UNOWN] = gMonIcon_Unown,
[SPECIES_WOBBUFFET] = gMonIcon_Wobbuffet,
[SPECIES_GIRAFARIG] = gMonIcon_Girafarig,
[SPECIES_PINECO] = gMonIcon_Pineco,
[SPECIES_FORRETRESS] = gMonIcon_Forretress,
[SPECIES_DUNSPARCE] = gMonIcon_Dunsparce,
[SPECIES_GLIGAR] = gMonIcon_Gligar,
[SPECIES_STEELIX] = gMonIcon_Steelix,
[SPECIES_SNUBBULL] = gMonIcon_Snubbull,
[SPECIES_GRANBULL] = gMonIcon_Granbull,
[SPECIES_QWILFISH] = gMonIcon_Qwilfish,
[SPECIES_SCIZOR] = gMonIcon_Scizor,
[SPECIES_SHUCKLE] = gMonIcon_Shuckle,
[SPECIES_HERACROSS] = gMonIcon_Heracross,
[SPECIES_SNEASEL] = gMonIcon_Sneasel,
[SPECIES_TEDDIURSA] = gMonIcon_Teddiursa,
[SPECIES_URSARING] = gMonIcon_Ursaring,
[SPECIES_SLUGMA] = gMonIcon_Slugma,
[SPECIES_MAGCARGO] = gMonIcon_Magcargo,
[SPECIES_SWINUB] = gMonIcon_Swinub,
[SPECIES_PILOSWINE] = gMonIcon_Piloswine,
[SPECIES_CORSOLA] = gMonIcon_Corsola,
[SPECIES_REMORAID] = gMonIcon_Remoraid,
[SPECIES_OCTILLERY] = gMonIcon_Octillery,
[SPECIES_DELIBIRD] = gMonIcon_Delibird,
[SPECIES_MANTINE] = gMonIcon_Mantine,
[SPECIES_SKARMORY] = gMonIcon_Skarmory,
[SPECIES_HOUNDOUR] = gMonIcon_Houndour,
[SPECIES_HOUNDOOM] = gMonIcon_Houndoom,
[SPECIES_KINGDRA] = gMonIcon_Kingdra,
[SPECIES_PHANPY] = gMonIcon_Phanpy,
[SPECIES_DONPHAN] = gMonIcon_Donphan,
[SPECIES_PORYGON2] = gMonIcon_Porygon2,
[SPECIES_STANTLER] = gMonIcon_Stantler,
[SPECIES_SMEARGLE] = gMonIcon_Smeargle,
[SPECIES_TYROGUE] = gMonIcon_Tyrogue,
[SPECIES_HITMONTOP] = gMonIcon_Hitmontop,
[SPECIES_SMOOCHUM] = gMonIcon_Smoochum,
[SPECIES_ELEKID] = gMonIcon_Elekid,
[SPECIES_MAGBY] = gMonIcon_Magby,
[SPECIES_MILTANK] = gMonIcon_Miltank,
[SPECIES_BLISSEY] = gMonIcon_Blissey,
[SPECIES_RAIKOU] = gMonIcon_Raikou,
[SPECIES_ENTEI] = gMonIcon_Entei,
[SPECIES_SUICUNE] = gMonIcon_Suicune,
[SPECIES_LARVITAR] = gMonIcon_Larvitar,
[SPECIES_PUPITAR] = gMonIcon_Pupitar,
[SPECIES_TYRANITAR] = gMonIcon_Tyranitar,
[SPECIES_LUGIA] = gMonIcon_Lugia,
[SPECIES_HO_OH] = gMonIcon_HoOh,
[SPECIES_CELEBI] = gMonIcon_Celebi,
[SPECIES_TREECKO] = gMonIcon_Treecko,
[SPECIES_GROVYLE] = gMonIcon_Grovyle,
[SPECIES_SCEPTILE] = gMonIcon_Sceptile,
[SPECIES_TORCHIC] = gMonIcon_Torchic,
[SPECIES_COMBUSKEN] = gMonIcon_Combusken,
[SPECIES_BLAZIKEN] = gMonIcon_Blaziken,
[SPECIES_MUDKIP] = gMonIcon_Mudkip,
[SPECIES_MARSHTOMP] = gMonIcon_Marshtomp,
[SPECIES_SWAMPERT] = gMonIcon_Swampert,
[SPECIES_POOCHYENA] = gMonIcon_Poochyena,
[SPECIES_MIGHTYENA] = gMonIcon_Mightyena,
[SPECIES_ZIGZAGOON] = gMonIcon_Zigzagoon,
[SPECIES_LINOONE] = gMonIcon_Linoone,
[SPECIES_WURMPLE] = gMonIcon_Wurmple,
[SPECIES_SILCOON] = gMonIcon_Silcoon,
[SPECIES_BEAUTIFLY] = gMonIcon_Beautifly,
[SPECIES_CASCOON] = gMonIcon_Cascoon,
[SPECIES_DUSTOX] = gMonIcon_Dustox,
[SPECIES_LOTAD] = gMonIcon_Lotad,
[SPECIES_LOMBRE] = gMonIcon_Lombre,
[SPECIES_LUDICOLO] = gMonIcon_Ludicolo,
[SPECIES_SEEDOT] = gMonIcon_Seedot,
[SPECIES_NUZLEAF] = gMonIcon_Nuzleaf,
[SPECIES_SHIFTRY] = gMonIcon_Shiftry,
[SPECIES_NINCADA] = gMonIcon_Nincada,
[SPECIES_NINJASK] = gMonIcon_Ninjask,
[SPECIES_SHEDINJA] = gMonIcon_Shedinja,
[SPECIES_TAILLOW] = gMonIcon_Taillow,
[SPECIES_SWELLOW] = gMonIcon_Swellow,
[SPECIES_SHROOMISH] = gMonIcon_Shroomish,
[SPECIES_BRELOOM] = gMonIcon_Breloom,
[SPECIES_SPINDA] = gMonIcon_Spinda,
[SPECIES_WINGULL] = gMonIcon_Wingull,
[SPECIES_PELIPPER] = gMonIcon_Pelipper,
[SPECIES_SURSKIT] = gMonIcon_Surskit,
[SPECIES_MASQUERAIN] = gMonIcon_Masquerain,
[SPECIES_WAILMER] = gMonIcon_Wailmer,
[SPECIES_WAILORD] = gMonIcon_Wailord,
[SPECIES_SKITTY] = gMonIcon_Skitty,
[SPECIES_DELCATTY] = gMonIcon_Delcatty,
[SPECIES_KECLEON] = gMonIcon_Kecleon,
[SPECIES_BALTOY] = gMonIcon_Baltoy,
[SPECIES_CLAYDOL] = gMonIcon_Claydol,
[SPECIES_NOSEPASS] = gMonIcon_Nosepass,
[SPECIES_TORKOAL] = gMonIcon_Torkoal,
[SPECIES_SABLEYE] = gMonIcon_Sableye,
[SPECIES_BARBOACH] = gMonIcon_Barboach,
[SPECIES_WHISCASH] = gMonIcon_Whiscash,
[SPECIES_LUVDISC] = gMonIcon_Luvdisc,
[SPECIES_CORPHISH] = gMonIcon_Corphish,
[SPECIES_CRAWDAUNT] = gMonIcon_Crawdaunt,
[SPECIES_FEEBAS] = gMonIcon_Feebas,
[SPECIES_MILOTIC] = gMonIcon_Milotic,
[SPECIES_CARVANHA] = gMonIcon_Carvanha,
[SPECIES_SHARPEDO] = gMonIcon_Sharpedo,
[SPECIES_TRAPINCH] = gMonIcon_Trapinch,
[SPECIES_VIBRAVA] = gMonIcon_Vibrava,
[SPECIES_FLYGON] = gMonIcon_Flygon,
[SPECIES_MAKUHITA] = gMonIcon_Makuhita,
[SPECIES_HARIYAMA] = gMonIcon_Hariyama,
[SPECIES_ELECTRIKE] = gMonIcon_Electrike,
[SPECIES_MANECTRIC] = gMonIcon_Manectric,
[SPECIES_NUMEL] = gMonIcon_Numel,
[SPECIES_CAMERUPT] = gMonIcon_Camerupt,
[SPECIES_SPHEAL] = gMonIcon_Spheal,
[SPECIES_SEALEO] = gMonIcon_Sealeo,
[SPECIES_WALREIN] = gMonIcon_Walrein,
[SPECIES_CACNEA] = gMonIcon_Cacnea,
[SPECIES_CACTURNE] = gMonIcon_Cacturne,
[SPECIES_SNORUNT] = gMonIcon_Snorunt,
[SPECIES_GLALIE] = gMonIcon_Glalie,
[SPECIES_LUNATONE] = gMonIcon_Lunatone,
[SPECIES_SOLROCK] = gMonIcon_Solrock,
[SPECIES_AZURILL] = gMonIcon_Azurill,
[SPECIES_SPOINK] = gMonIcon_Spoink,
[SPECIES_GRUMPIG] = gMonIcon_Grumpig,
[SPECIES_PLUSLE] = gMonIcon_Plusle,
[SPECIES_MINUN] = gMonIcon_Minun,
[SPECIES_MAWILE] = gMonIcon_Mawile,
[SPECIES_MEDITITE] = gMonIcon_Meditite,
[SPECIES_MEDICHAM] = gMonIcon_Medicham,
[SPECIES_SWABLU] = gMonIcon_Swablu,
[SPECIES_ALTARIA] = gMonIcon_Altaria,
[SPECIES_WYNAUT] = gMonIcon_Wynaut,
[SPECIES_DUSKULL] = gMonIcon_Duskull,
[SPECIES_DUSCLOPS] = gMonIcon_Dusclops,
[SPECIES_ROSELIA] = gMonIcon_Roselia,
[SPECIES_SLAKOTH] = gMonIcon_Slakoth,
[SPECIES_VIGOROTH] = gMonIcon_Vigoroth,
[SPECIES_SLAKING] = gMonIcon_Slaking,
[SPECIES_GULPIN] = gMonIcon_Gulpin,
[SPECIES_SWALOT] = gMonIcon_Swalot,
[SPECIES_TROPIUS] = gMonIcon_Tropius,
[SPECIES_WHISMUR] = gMonIcon_Whismur,
[SPECIES_LOUDRED] = gMonIcon_Loudred,
[SPECIES_EXPLOUD] = gMonIcon_Exploud,
[SPECIES_CLAMPERL] = gMonIcon_Clamperl,
[SPECIES_HUNTAIL] = gMonIcon_Huntail,
[SPECIES_GOREBYSS] = gMonIcon_Gorebyss,
[SPECIES_ABSOL] = gMonIcon_Absol,
[SPECIES_SHUPPET] = gMonIcon_Shuppet,
[SPECIES_BANETTE] = gMonIcon_Banette,
[SPECIES_SEVIPER] = gMonIcon_Seviper,
[SPECIES_ZANGOOSE] = gMonIcon_Zangoose,
[SPECIES_RELICANTH] = gMonIcon_Relicanth,
[SPECIES_ARON] = gMonIcon_Aron,
[SPECIES_LAIRON] = gMonIcon_Lairon,
[SPECIES_AGGRON] = gMonIcon_Aggron,
[SPECIES_CASTFORM] = gMonIcon_Castform,
[SPECIES_VOLBEAT] = gMonIcon_Volbeat,
[SPECIES_ILLUMISE] = gMonIcon_Illumise,
[SPECIES_LILEEP] = gMonIcon_Lileep,
[SPECIES_CRADILY] = gMonIcon_Cradily,
[SPECIES_ANORITH] = gMonIcon_Anorith,
[SPECIES_ARMALDO] = gMonIcon_Armaldo,
[SPECIES_RALTS] = gMonIcon_Ralts,
[SPECIES_KIRLIA] = gMonIcon_Kirlia,
[SPECIES_GARDEVOIR] = gMonIcon_Gardevoir,
[SPECIES_BAGON] = gMonIcon_Bagon,
[SPECIES_SHELGON] = gMonIcon_Shelgon,
[SPECIES_SALAMENCE] = gMonIcon_Salamence,
[SPECIES_BELDUM] = gMonIcon_Beldum,
[SPECIES_METANG] = gMonIcon_Metang,
[SPECIES_METAGROSS] = gMonIcon_Metagross,
[SPECIES_REGIROCK] = gMonIcon_Regirock,
[SPECIES_REGICE] = gMonIcon_Regice,
[SPECIES_REGISTEEL] = gMonIcon_Registeel,
[SPECIES_KYOGRE] = gMonIcon_Kyogre,
[SPECIES_GROUDON] = gMonIcon_Groudon,
[SPECIES_RAYQUAZA] = gMonIcon_Rayquaza,
[SPECIES_LATIAS] = gMonIcon_Latias,
[SPECIES_LATIOS] = gMonIcon_Latios,
[SPECIES_JIRACHI] = gMonIcon_Jirachi,
[SPECIES_DEOXYS] = gMonIcon_Deoxys,
[SPECIES_CHIMECHO] = gMonIcon_Chimecho,
[SPECIES_TURTWIG] = gMonIcon_Turtwig,
[SPECIES_GROTLE] = gMonIcon_Grotle,
[SPECIES_TORTERRA] = gMonIcon_Torterra,
[SPECIES_CHIMCHAR] = gMonIcon_Chimchar,
[SPECIES_MONFERNO] = gMonIcon_Monferno,
[SPECIES_INFERNAPE] = gMonIcon_Infernape,
[SPECIES_PIPLUP] = gMonIcon_Piplup,
[SPECIES_PRINPLUP] = gMonIcon_Prinplup,
[SPECIES_EMPOLEON] = gMonIcon_Empoleon,
[SPECIES_STARLY] = gMonIcon_Starly,
[SPECIES_STARAVIA] = gMonIcon_Staravia,
[SPECIES_STARAPTOR] = gMonIcon_Staraptor,
[SPECIES_BIDOOF] = gMonIcon_Bidoof,
[SPECIES_BIBAREL] = gMonIcon_Bibarel,
[SPECIES_KRICKETOT] = gMonIcon_Kricketot,
[SPECIES_KRICKETUNE] = gMonIcon_Kricketune,
[SPECIES_SHINX] = gMonIcon_Shinx,
[SPECIES_LUXIO] = gMonIcon_Luxio,
[SPECIES_LUXRAY] = gMonIcon_Luxray,
[SPECIES_BUDEW] = gMonIcon_Budew,
[SPECIES_ROSERADE] = gMonIcon_Roserade,
[SPECIES_CRANIDOS] = gMonIcon_Cranidos,
[SPECIES_RAMPARDOS] = gMonIcon_Rampardos,
[SPECIES_SHIELDON] = gMonIcon_Shieldon,
[SPECIES_BASTIODON] = gMonIcon_Bastiodon,
[SPECIES_BURMY] = gMonIcon_Burmy,
[SPECIES_WORMADAM] = gMonIcon_Wormadam,
[SPECIES_MOTHIM] = gMonIcon_Mothim,
[SPECIES_COMBEE] = gMonIcon_Combee,
[SPECIES_VESPIQUEN] = gMonIcon_Vespiquen,
[SPECIES_PACHIRISU] = gMonIcon_Pachirisu,
[SPECIES_BUIZEL] = gMonIcon_Buizel,
[SPECIES_FLOATZEL] = gMonIcon_Floatzel,
[SPECIES_CHERUBI] = gMonIcon_Cherubi,
[SPECIES_CHERRIM] = gMonIcon_Cherrim,
[SPECIES_SHELLOS] = gMonIcon_Shellos,
[SPECIES_GASTRODON] = gMonIcon_Gastrodon,
[SPECIES_AMBIPOM] = gMonIcon_Ambipom,
[SPECIES_DRIFLOON] = gMonIcon_Drifloon,
[SPECIES_DRIFBLIM] = gMonIcon_Drifblim,
[SPECIES_BUNEARY] = gMonIcon_Buneary,
[SPECIES_LOPUNNY] = gMonIcon_Lopunny,
[SPECIES_MISMAGIUS] = gMonIcon_Mismagius,
[SPECIES_HONCHKROW] = gMonIcon_Honchkrow,
[SPECIES_GLAMEOW] = gMonIcon_Glameow,
[SPECIES_PURUGLY] = gMonIcon_Purugly,
[SPECIES_CHINGLING] = gMonIcon_Chingling,
[SPECIES_STUNKY] = gMonIcon_Stunky,
[SPECIES_SKUNTANK] = gMonIcon_Skuntank,
[SPECIES_BRONZOR] = gMonIcon_Bronzor,
[SPECIES_BRONZONG] = gMonIcon_Bronzong,
[SPECIES_BONSLY] = gMonIcon_Bonsly,
[SPECIES_MIME_JR] = gMonIcon_MimeJr,
[SPECIES_HAPPINY] = gMonIcon_Happiny,
[SPECIES_CHATOT] = gMonIcon_Chatot,
[SPECIES_SPIRITOMB] = gMonIcon_Spiritomb,
[SPECIES_GIBLE] = gMonIcon_Gible,
[SPECIES_GABITE] = gMonIcon_Gabite,
[SPECIES_GARCHOMP] = gMonIcon_Garchomp,
[SPECIES_MUNCHLAX] = gMonIcon_Munchlax,
[SPECIES_RIOLU] = gMonIcon_Riolu,
[SPECIES_LUCARIO] = gMonIcon_Lucario,
[SPECIES_HIPPOPOTAS] = gMonIcon_Hippopotas,
[SPECIES_HIPPOWDON] = gMonIcon_Hippowdon,
[SPECIES_SKORUPI] = gMonIcon_Skorupi,
[SPECIES_DRAPION] = gMonIcon_Drapion,
[SPECIES_CROAGUNK] = gMonIcon_Croagunk,
[SPECIES_TOXICROAK] = gMonIcon_Toxicroak,
[SPECIES_CARNIVINE] = gMonIcon_Carnivine,
[SPECIES_FINNEON] = gMonIcon_Finneon,
[SPECIES_LUMINEON] = gMonIcon_Lumineon,
[SPECIES_MANTYKE] = gMonIcon_Mantyke,
[SPECIES_SNOVER] = gMonIcon_Snover,
[SPECIES_ABOMASNOW] = gMonIcon_Abomasnow,
[SPECIES_WEAVILE] = gMonIcon_Weavile,
[SPECIES_MAGNEZONE] = gMonIcon_Magnezone,
[SPECIES_LICKILICKY] = gMonIcon_Lickilicky,
[SPECIES_RHYPERIOR] = gMonIcon_Rhyperior,
[SPECIES_TANGROWTH] = gMonIcon_Tangrowth,
[SPECIES_ELECTIVIRE] = gMonIcon_Electivire,
[SPECIES_MAGMORTAR] = gMonIcon_Magmortar,
[SPECIES_TOGEKISS] = gMonIcon_Togekiss,
[SPECIES_YANMEGA] = gMonIcon_Yanmega,
[SPECIES_LEAFEON] = gMonIcon_Leafeon,
[SPECIES_GLACEON] = gMonIcon_Glaceon,
[SPECIES_GLISCOR] = gMonIcon_Gliscor,
[SPECIES_MAMOSWINE] = gMonIcon_Mamoswine,
[SPECIES_PORYGON_Z] = gMonIcon_Porygon_Z,
[SPECIES_GALLADE] = gMonIcon_Gallade,
[SPECIES_PROBOPASS] = gMonIcon_Probopass,
[SPECIES_DUSKNOIR] = gMonIcon_Dusknoir,
[SPECIES_FROSLASS] = gMonIcon_Froslass,
[SPECIES_ROTOM] = gMonIcon_Rotom,
[SPECIES_UXIE] = gMonIcon_Uxie,
[SPECIES_MESPRIT] = gMonIcon_Mesprit,
[SPECIES_AZELF] = gMonIcon_Azelf,
[SPECIES_DIALGA] = gMonIcon_Dialga,
[SPECIES_PALKIA] = gMonIcon_Palkia,
[SPECIES_HEATRAN] = gMonIcon_Heatran,
[SPECIES_REGIGIGAS] = gMonIcon_Regigigas,
[SPECIES_GIRATINA] = gMonIcon_Giratina,
[SPECIES_CRESSELIA] = gMonIcon_Cresselia,
[SPECIES_PHIONE] = gMonIcon_Phione,
[SPECIES_MANAPHY] = gMonIcon_Manaphy,
[SPECIES_DARKRAI] = gMonIcon_Darkrai,
[SPECIES_SHAYMIN] = gMonIcon_Shaymin,
[SPECIES_ARCEUS] = gMonIcon_Arceus,
[SPECIES_VICTINI] = gMonIcon_Victini,
[SPECIES_SNIVY] = gMonIcon_Snivy,
[SPECIES_SERVINE] = gMonIcon_Servine,
[SPECIES_SERPERIOR] = gMonIcon_Serperior,
[SPECIES_TEPIG] = gMonIcon_Tepig,
[SPECIES_PIGNITE] = gMonIcon_Pignite,
[SPECIES_EMBOAR] = gMonIcon_Emboar,
[SPECIES_OSHAWOTT] = gMonIcon_Oshawott,
[SPECIES_DEWOTT] = gMonIcon_Dewott,
[SPECIES_SAMUROTT] = gMonIcon_Samurott,
[SPECIES_PATRAT] = gMonIcon_Patrat,
[SPECIES_WATCHOG] = gMonIcon_Watchog,
[SPECIES_LILLIPUP] = gMonIcon_Lillipup,
[SPECIES_HERDIER] = gMonIcon_Herdier,
[SPECIES_STOUTLAND] = gMonIcon_Stoutland,
[SPECIES_PURRLOIN] = gMonIcon_Purrloin,
[SPECIES_LIEPARD] = gMonIcon_Liepard,
[SPECIES_PANSAGE] = gMonIcon_Pansage,
[SPECIES_SIMISAGE] = gMonIcon_Simisage,
[SPECIES_PANSEAR] = gMonIcon_Pansear,
[SPECIES_SIMISEAR] = gMonIcon_Simisear,
[SPECIES_PANPOUR] = gMonIcon_Panpour,
[SPECIES_SIMIPOUR] = gMonIcon_Simipour,
[SPECIES_MUNNA] = gMonIcon_Munna,
[SPECIES_MUSHARNA] = gMonIcon_Musharna,
[SPECIES_PIDOVE] = gMonIcon_Pidove,
[SPECIES_TRANQUILL] = gMonIcon_Tranquill,
[SPECIES_UNFEZANT] = gMonIcon_Unfezant,
[SPECIES_BLITZLE] = gMonIcon_Blitzle,
[SPECIES_ZEBSTRIKA] = gMonIcon_Zebstrika,
[SPECIES_ROGGENROLA] = gMonIcon_Roggenrola,
[SPECIES_BOLDORE] = gMonIcon_Boldore,
[SPECIES_GIGALITH] = gMonIcon_Gigalith,
[SPECIES_WOOBAT] = gMonIcon_Woobat,
[SPECIES_SWOOBAT] = gMonIcon_Swoobat,
[SPECIES_DRILBUR] = gMonIcon_Drilbur,
[SPECIES_EXCADRILL] = gMonIcon_Excadrill,
[SPECIES_AUDINO] = gMonIcon_Audino,
[SPECIES_TIMBURR] = gMonIcon_Timburr,
[SPECIES_GURDURR] = gMonIcon_Gurdurr,
[SPECIES_CONKELDURR] = gMonIcon_Conkeldurr,
[SPECIES_TYMPOLE] = gMonIcon_Tympole,
[SPECIES_PALPITOAD] = gMonIcon_Palpitoad,
[SPECIES_SEISMITOAD] = gMonIcon_Seismitoad,
[SPECIES_THROH] = gMonIcon_Throh,
[SPECIES_SAWK] = gMonIcon_Sawk,
[SPECIES_SEWADDLE] = gMonIcon_Sewaddle,
[SPECIES_SWADLOON] = gMonIcon_Swadloon,
[SPECIES_LEAVANNY] = gMonIcon_Leavanny,
[SPECIES_VENIPEDE] = gMonIcon_Venipede,
[SPECIES_WHIRLIPEDE] = gMonIcon_Whirlipede,
[SPECIES_SCOLIPEDE] = gMonIcon_Scolipede,
[SPECIES_COTTONEE] = gMonIcon_Cottonee,
[SPECIES_WHIMSICOTT] = gMonIcon_Whimsicott,
[SPECIES_PETILIL] = gMonIcon_Petilil,
[SPECIES_LILLIGANT] = gMonIcon_Lilligant,
[SPECIES_BASCULIN] = gMonIcon_Basculin,
[SPECIES_SANDILE] = gMonIcon_Sandile,
[SPECIES_KROKOROK] = gMonIcon_Krokorok,
[SPECIES_KROOKODILE] = gMonIcon_Krookodile,
[SPECIES_DARUMAKA] = gMonIcon_Darumaka,
[SPECIES_DARMANITAN] = gMonIcon_Darmanitan,
[SPECIES_MARACTUS] = gMonIcon_Maractus,
[SPECIES_DWEBBLE] = gMonIcon_Dwebble,
[SPECIES_CRUSTLE] = gMonIcon_Crustle,
[SPECIES_SCRAGGY] = gMonIcon_Scraggy,
[SPECIES_SCRAFTY] = gMonIcon_Scrafty,
[SPECIES_SIGILYPH] = gMonIcon_Sigilyph,
[SPECIES_YAMASK] = gMonIcon_Yamask,
[SPECIES_COFAGRIGUS] = gMonIcon_Cofagrigus,
[SPECIES_TIRTOUGA] = gMonIcon_Tirtouga,
[SPECIES_CARRACOSTA] = gMonIcon_Carracosta,
[SPECIES_ARCHEN] = gMonIcon_Archen,
[SPECIES_ARCHEOPS] = gMonIcon_Archeops,
[SPECIES_TRUBBISH] = gMonIcon_Trubbish,
[SPECIES_GARBODOR] = gMonIcon_Garbodor,
[SPECIES_ZORUA] = gMonIcon_Zorua,
[SPECIES_ZOROARK] = gMonIcon_Zoroark,
[SPECIES_MINCCINO] = gMonIcon_Minccino,
[SPECIES_CINCCINO] = gMonIcon_Cinccino,
[SPECIES_GOTHITA] = gMonIcon_Gothita,
[SPECIES_GOTHORITA] = gMonIcon_Gothorita,
[SPECIES_GOTHITELLE] = gMonIcon_Gothitelle,
[SPECIES_SOLOSIS] = gMonIcon_Solosis,
[SPECIES_DUOSION] = gMonIcon_Duosion,
[SPECIES_REUNICLUS] = gMonIcon_Reuniclus,
[SPECIES_DUCKLETT] = gMonIcon_Ducklett,
[SPECIES_SWANNA] = gMonIcon_Swanna,
[SPECIES_VANILLITE] = gMonIcon_Vanillite,
[SPECIES_VANILLISH] = gMonIcon_Vanillish,
[SPECIES_VANILLUXE] = gMonIcon_Vanilluxe,
[SPECIES_DEERLING] = gMonIcon_Deerling,
[SPECIES_SAWSBUCK] = gMonIcon_Sawsbuck,
[SPECIES_EMOLGA] = gMonIcon_Emolga,
[SPECIES_KARRABLAST] = gMonIcon_Karrablast,
[SPECIES_ESCAVALIER] = gMonIcon_Escavalier,
[SPECIES_FOONGUS] = gMonIcon_Foongus,
[SPECIES_AMOONGUSS] = gMonIcon_Amoonguss,
[SPECIES_FRILLISH] = gMonIcon_Frillish,
[SPECIES_JELLICENT] = gMonIcon_Jellicent,
[SPECIES_ALOMOMOLA] = gMonIcon_Alomomola,
[SPECIES_JOLTIK] = gMonIcon_Joltik,
[SPECIES_GALVANTULA] = gMonIcon_Galvantula,
[SPECIES_FERROSEED] = gMonIcon_Ferroseed,
[SPECIES_FERROTHORN] = gMonIcon_Ferrothorn,
[SPECIES_KLINK] = gMonIcon_Klink,
[SPECIES_KLANG] = gMonIcon_Klang,
[SPECIES_KLINKLANG] = gMonIcon_Klinklang,
[SPECIES_TYNAMO] = gMonIcon_Tynamo,
[SPECIES_EELEKTRIK] = gMonIcon_Eelektrik,
[SPECIES_EELEKTROSS] = gMonIcon_Eelektross,
[SPECIES_ELGYEM] = gMonIcon_Elgyem,
[SPECIES_BEHEEYEM] = gMonIcon_Beheeyem,
[SPECIES_LITWICK] = gMonIcon_Litwick,
[SPECIES_LAMPENT] = gMonIcon_Lampent,
[SPECIES_CHANDELURE] = gMonIcon_Chandelure,
[SPECIES_AXEW] = gMonIcon_Axew,
[SPECIES_FRAXURE] = gMonIcon_Fraxure,
[SPECIES_HAXORUS] = gMonIcon_Haxorus,
[SPECIES_CUBCHOO] = gMonIcon_Cubchoo,
[SPECIES_BEARTIC] = gMonIcon_Beartic,
[SPECIES_CRYOGONAL] = gMonIcon_Cryogonal,
[SPECIES_SHELMET] = gMonIcon_Shelmet,
[SPECIES_ACCELGOR] = gMonIcon_Accelgor,
[SPECIES_STUNFISK] = gMonIcon_Stunfisk,
[SPECIES_MIENFOO] = gMonIcon_Mienfoo,
[SPECIES_MIENSHAO] = gMonIcon_Mienshao,
[SPECIES_DRUDDIGON] = gMonIcon_Druddigon,
[SPECIES_GOLETT] = gMonIcon_Golett,
[SPECIES_GOLURK] = gMonIcon_Golurk,
[SPECIES_PAWNIARD] = gMonIcon_Pawniard,
[SPECIES_BISHARP] = gMonIcon_Bisharp,
[SPECIES_BOUFFALANT] = gMonIcon_Bouffalant,
[SPECIES_RUFFLET] = gMonIcon_Rufflet,
[SPECIES_BRAVIARY] = gMonIcon_Braviary,
[SPECIES_VULLABY] = gMonIcon_Vullaby,
[SPECIES_MANDIBUZZ] = gMonIcon_Mandibuzz,
[SPECIES_HEATMOR] = gMonIcon_Heatmor,
[SPECIES_DURANT] = gMonIcon_Durant,
[SPECIES_DEINO] = gMonIcon_Deino,
[SPECIES_ZWEILOUS] = gMonIcon_Zweilous,
[SPECIES_HYDREIGON] = gMonIcon_Hydreigon,
[SPECIES_LARVESTA] = gMonIcon_Larvesta,
[SPECIES_VOLCARONA] = gMonIcon_Volcarona,
[SPECIES_COBALION] = gMonIcon_Cobalion,
[SPECIES_TERRAKION] = gMonIcon_Terrakion,
[SPECIES_VIRIZION] = gMonIcon_Virizion,
[SPECIES_TORNADUS] = gMonIcon_Tornadus,
[SPECIES_THUNDURUS] = gMonIcon_Thundurus,
[SPECIES_RESHIRAM] = gMonIcon_Reshiram,
[SPECIES_ZEKROM] = gMonIcon_Zekrom,
[SPECIES_LANDORUS] = gMonIcon_Landorus,
[SPECIES_KYUREM] = gMonIcon_Kyurem,
[SPECIES_KELDEO] = gMonIcon_Keldeo,
[SPECIES_MELOETTA] = gMonIcon_Meloetta,
[SPECIES_GENESECT] = gMonIcon_Genesect,
[SPECIES_CHESPIN] = gMonIcon_Chespin,
[SPECIES_QUILLADIN] = gMonIcon_Quilladin,
[SPECIES_CHESNAUGHT] = gMonIcon_Chesnaught,
[SPECIES_FENNEKIN] = gMonIcon_Fennekin,
[SPECIES_BRAIXEN] = gMonIcon_Braixen,
[SPECIES_DELPHOX] = gMonIcon_Delphox,
[SPECIES_FROAKIE] = gMonIcon_Froakie,
[SPECIES_FROGADIER] = gMonIcon_Frogadier,
[SPECIES_GRENINJA] = gMonIcon_Greninja,
[SPECIES_BUNNELBY] = gMonIcon_Bunnelby,
[SPECIES_DIGGERSBY] = gMonIcon_Diggersby,
[SPECIES_FLETCHLING] = gMonIcon_Fletchling,
[SPECIES_FLETCHINDER] = gMonIcon_Fletchinder,
[SPECIES_TALONFLAME] = gMonIcon_Talonflame,
[SPECIES_SCATTERBUG] = gMonIcon_Scatterbug,
[SPECIES_SPEWPA] = gMonIcon_Spewpa,
[SPECIES_VIVILLON] = gMonIcon_Vivillon,
[SPECIES_LITLEO] = gMonIcon_Litleo,
[SPECIES_PYROAR] = gMonIcon_Pyroar,
[SPECIES_FLABEBE] = gMonIcon_Flabebe,
[SPECIES_FLOETTE] = gMonIcon_Floette,
[SPECIES_FLORGES] = gMonIcon_Florges,
[SPECIES_SKIDDO] = gMonIcon_Skiddo,
[SPECIES_GOGOAT] = gMonIcon_Gogoat,
[SPECIES_PANCHAM] = gMonIcon_Pancham,
[SPECIES_PANGORO] = gMonIcon_Pangoro,
[SPECIES_FURFROU] = gMonIcon_Furfrou,
[SPECIES_ESPURR] = gMonIcon_Espurr,
[SPECIES_MEOWSTIC] = gMonIcon_Meowstic,
[SPECIES_HONEDGE] = gMonIcon_Honedge,
[SPECIES_DOUBLADE] = gMonIcon_Doublade,
[SPECIES_AEGISLASH] = gMonIcon_Aegislash,
[SPECIES_SPRITZEE] = gMonIcon_Spritzee,
[SPECIES_AROMATISSE] = gMonIcon_Aromatisse,
[SPECIES_SWIRLIX] = gMonIcon_Swirlix,
[SPECIES_SLURPUFF] = gMonIcon_Slurpuff,
[SPECIES_INKAY] = gMonIcon_Inkay,
[SPECIES_MALAMAR] = gMonIcon_Malamar,
[SPECIES_BINACLE] = gMonIcon_Binacle,
[SPECIES_BARBARACLE] = gMonIcon_Barbaracle,
[SPECIES_SKRELP] = gMonIcon_Skrelp,
[SPECIES_DRAGALGE] = gMonIcon_Dragalge,
[SPECIES_CLAUNCHER] = gMonIcon_Clauncher,
[SPECIES_CLAWITZER] = gMonIcon_Clawitzer,
[SPECIES_HELIOPTILE] = gMonIcon_Helioptile,
[SPECIES_HELIOLISK] = gMonIcon_Heliolisk,
[SPECIES_TYRUNT] = gMonIcon_Tyrunt,
[SPECIES_TYRANTRUM] = gMonIcon_Tyrantrum,
[SPECIES_AMAURA] = gMonIcon_Amaura,
[SPECIES_AURORUS] = gMonIcon_Aurorus,
[SPECIES_SYLVEON] = gMonIcon_Sylveon,
[SPECIES_HAWLUCHA] = gMonIcon_Hawlucha,
[SPECIES_DEDENNE] = gMonIcon_Dedenne,
[SPECIES_CARBINK] = gMonIcon_Carbink,
[SPECIES_GOOMY] = gMonIcon_Goomy,
[SPECIES_SLIGGOO] = gMonIcon_Sliggoo,
[SPECIES_GOODRA] = gMonIcon_Goodra,
[SPECIES_KLEFKI] = gMonIcon_Klefki,
[SPECIES_PHANTUMP] = gMonIcon_Phantump,
[SPECIES_TREVENANT] = gMonIcon_Trevenant,
[SPECIES_PUMPKABOO] = gMonIcon_Pumpkaboo,
[SPECIES_GOURGEIST] = gMonIcon_Gourgeist,
[SPECIES_BERGMITE] = gMonIcon_Bergmite,
[SPECIES_AVALUGG] = gMonIcon_Avalugg,
[SPECIES_NOIBAT] = gMonIcon_Noibat,
[SPECIES_NOIVERN] = gMonIcon_Noivern,
[SPECIES_XERNEAS] = gMonIcon_Xerneas,
[SPECIES_YVELTAL] = gMonIcon_Yveltal,
[SPECIES_ZYGARDE] = gMonIcon_Zygarde,
[SPECIES_DIANCIE] = gMonIcon_Diancie,
[SPECIES_HOOPA] = gMonIcon_Hoopa,
[SPECIES_VOLCANION] = gMonIcon_Volcanion,
[SPECIES_ROWLET] = gMonIcon_Rowlet,
[SPECIES_DARTRIX] = gMonIcon_Dartrix,
[SPECIES_DECIDUEYE] = gMonIcon_Decidueye,
[SPECIES_LITTEN] = gMonIcon_Litten,
[SPECIES_TORRACAT] = gMonIcon_Torracat,
[SPECIES_INCINEROAR] = gMonIcon_Incineroar,
[SPECIES_POPPLIO] = gMonIcon_Popplio,
[SPECIES_BRIONNE] = gMonIcon_Brionne,
[SPECIES_PRIMARINA] = gMonIcon_Primarina,
[SPECIES_PIKIPEK] = gMonIcon_Pikipek,
[SPECIES_TRUMBEAK] = gMonIcon_Trumbeak,
[SPECIES_TOUCANNON] = gMonIcon_Toucannon,
[SPECIES_YUNGOOS] = gMonIcon_Yungoos,
[SPECIES_GUMSHOOS] = gMonIcon_Gumshoos,
[SPECIES_GRUBBIN] = gMonIcon_Grubbin,
[SPECIES_CHARJABUG] = gMonIcon_Charjabug,
[SPECIES_VIKAVOLT] = gMonIcon_Vikavolt,
[SPECIES_CRABRAWLER] = gMonIcon_Crabrawler,
[SPECIES_CRABOMINABLE] = gMonIcon_Crabominable,
[SPECIES_ORICORIO] = gMonIcon_Oricorio,
[SPECIES_CUTIEFLY] = gMonIcon_Cutiefly,
[SPECIES_RIBOMBEE] = gMonIcon_Ribombee,
[SPECIES_ROCKRUFF] = gMonIcon_Rockruff,
[SPECIES_LYCANROC] = gMonIcon_Lycanroc,
[SPECIES_WISHIWASHI] = gMonIcon_Wishiwashi,
[SPECIES_MAREANIE] = gMonIcon_Mareanie,
[SPECIES_TOXAPEX] = gMonIcon_Toxapex,
[SPECIES_MUDBRAY] = gMonIcon_Mudbray,
[SPECIES_MUDSDALE] = gMonIcon_Mudsdale,
[SPECIES_DEWPIDER] = gMonIcon_Dewpider,
[SPECIES_ARAQUANID] = gMonIcon_Araquanid,
[SPECIES_FOMANTIS] = gMonIcon_Fomantis,
[SPECIES_LURANTIS] = gMonIcon_Lurantis,
[SPECIES_MORELULL] = gMonIcon_Morelull,
[SPECIES_SHIINOTIC] = gMonIcon_Shiinotic,
[SPECIES_SALANDIT] = gMonIcon_Salandit,
[SPECIES_SALAZZLE] = gMonIcon_Salazzle,
[SPECIES_STUFFUL] = gMonIcon_Stufful,
[SPECIES_BEWEAR] = gMonIcon_Bewear,
[SPECIES_BOUNSWEET] = gMonIcon_Bounsweet,
[SPECIES_STEENEE] = gMonIcon_Steenee,
[SPECIES_TSAREENA] = gMonIcon_Tsareena,
[SPECIES_COMFEY] = gMonIcon_Comfey,
[SPECIES_ORANGURU] = gMonIcon_Oranguru,
[SPECIES_PASSIMIAN] = gMonIcon_Passimian,
[SPECIES_WIMPOD] = gMonIcon_Wimpod,
[SPECIES_GOLISOPOD] = gMonIcon_Golisopod,
[SPECIES_SANDYGAST] = gMonIcon_Sandygast,
[SPECIES_PALOSSAND] = gMonIcon_Palossand,
[SPECIES_PYUKUMUKU] = gMonIcon_Pyukumuku,
[SPECIES_TYPE_NULL] = gMonIcon_TypeNull,
[SPECIES_SILVALLY] = gMonIcon_Silvally,
[SPECIES_MINIOR] = gMonIcon_Minior,
[SPECIES_KOMALA] = gMonIcon_Komala,
[SPECIES_TURTONATOR] = gMonIcon_Turtonator,
[SPECIES_TOGEDEMARU] = gMonIcon_Togedemaru,
[SPECIES_MIMIKYU] = gMonIcon_Mimikyu,
[SPECIES_BRUXISH] = gMonIcon_Bruxish,
[SPECIES_DRAMPA] = gMonIcon_Drampa,
[SPECIES_DHELMISE] = gMonIcon_Dhelmise,
[SPECIES_JANGMO_O] = gMonIcon_Jangmoo,
[SPECIES_HAKAMO_O] = gMonIcon_Hakamoo,
[SPECIES_KOMMO_O] = gMonIcon_Kommoo,
[SPECIES_TAPU_KOKO] = gMonIcon_TapuKoko,
[SPECIES_TAPU_LELE] = gMonIcon_TapuLele,
[SPECIES_TAPU_BULU] = gMonIcon_TapuBulu,
[SPECIES_TAPU_FINI] = gMonIcon_TapuFini,
[SPECIES_COSMOG] = gMonIcon_Cosmog,
[SPECIES_COSMOEM] = gMonIcon_Cosmoem,
[SPECIES_SOLGALEO] = gMonIcon_Solgaleo,
[SPECIES_LUNALA] = gMonIcon_Lunala,
[SPECIES_NIHILEGO] = gMonIcon_Nihilego,
[SPECIES_BUZZWOLE] = gMonIcon_Buzzwole,
[SPECIES_PHEROMOSA] = gMonIcon_Pheromosa,
[SPECIES_XURKITREE] = gMonIcon_Xurkitree,
[SPECIES_CELESTEELA] = gMonIcon_Celesteela,
[SPECIES_KARTANA] = gMonIcon_Kartana,
[SPECIES_GUZZLORD] = gMonIcon_Guzzlord,
[SPECIES_NECROZMA] = gMonIcon_Necrozma,
[SPECIES_MAGEARNA] = gMonIcon_Magearna,
[SPECIES_MARSHADOW] = gMonIcon_Marshadow,
[SPECIES_POIPOLE] = gMonIcon_Poipole,
[SPECIES_NAGANADEL] = gMonIcon_Naganadel,
[SPECIES_STAKATAKA] = gMonIcon_Stakataka,
[SPECIES_BLACEPHALON] = gMonIcon_Blacephalon,
[SPECIES_ZERAORA] = gMonIcon_Zeraora,
[SPECIES_MELTAN] = gMonIcon_Meltan,
[SPECIES_MELMETAL] = gMonIcon_Melmetal,
[SPECIES_GROOKEY] = gMonIcon_Grookey,
[SPECIES_THWACKEY] = gMonIcon_Thwackey,
[SPECIES_RILLABOOM] = gMonIcon_Rillaboom,
[SPECIES_SCORBUNNY] = gMonIcon_Scorbunny,
[SPECIES_RABOOT] = gMonIcon_Raboot,
[SPECIES_CINDERACE] = gMonIcon_Cinderace,
[SPECIES_SOBBLE] = gMonIcon_Sobble,
[SPECIES_DRIZZILE] = gMonIcon_Drizzile,
[SPECIES_INTELEON] = gMonIcon_Inteleon,
[SPECIES_SKWOVET] = gMonIcon_Skwovet,
[SPECIES_GREEDENT] = gMonIcon_Greedent,
[SPECIES_ROOKIDEE] = gMonIcon_Rookidee,
[SPECIES_CORVISQUIRE] = gMonIcon_Corvisquire,
[SPECIES_CORVIKNIGHT] = gMonIcon_Corviknight,
[SPECIES_BLIPBUG] = gMonIcon_Blipbug,
[SPECIES_DOTTLER] = gMonIcon_Dottler,
[SPECIES_ORBEETLE] = gMonIcon_Orbeetle,
[SPECIES_NICKIT] = gMonIcon_Nickit,
[SPECIES_THIEVUL] = gMonIcon_Thievul,
[SPECIES_GOSSIFLEUR] = gMonIcon_Gossifleur,
[SPECIES_ELDEGOSS] = gMonIcon_Eldegoss,
[SPECIES_WOOLOO] = gMonIcon_Wooloo,
[SPECIES_DUBWOOL] = gMonIcon_Dubwool,
[SPECIES_CHEWTLE] = gMonIcon_Chewtle,
[SPECIES_DREDNAW] = gMonIcon_Drednaw,
[SPECIES_YAMPER] = gMonIcon_Yamper,
[SPECIES_BOLTUND] = gMonIcon_Boltund,
[SPECIES_ROLYCOLY] = gMonIcon_Rolycoly,
[SPECIES_CARKOL] = gMonIcon_Carkol,
[SPECIES_COALOSSAL] = gMonIcon_Coalossal,
[SPECIES_APPLIN] = gMonIcon_Applin,
[SPECIES_FLAPPLE] = gMonIcon_Flapple,
[SPECIES_APPLETUN] = gMonIcon_Appletun,
[SPECIES_SILICOBRA] = gMonIcon_Silicobra,
[SPECIES_SANDACONDA] = gMonIcon_Sandaconda,
[SPECIES_CRAMORANT] = gMonIcon_Cramorant,
[SPECIES_ARROKUDA] = gMonIcon_Arrokuda,
[SPECIES_BARRASKEWDA] = gMonIcon_Barraskewda,
[SPECIES_TOXEL] = gMonIcon_Toxel,
[SPECIES_TOXTRICITY] = gMonIcon_Toxtricity,
[SPECIES_SIZZLIPEDE] = gMonIcon_Sizzlipede,
[SPECIES_CENTISKORCH] = gMonIcon_Centiskorch,
[SPECIES_CLOBBOPUS] = gMonIcon_Clobbopus,
[SPECIES_GRAPPLOCT] = gMonIcon_Grapploct,
[SPECIES_SINISTEA] = gMonIcon_Sinistea,
[SPECIES_POLTEAGEIST] = gMonIcon_Polteageist,
[SPECIES_HATENNA] = gMonIcon_Hatenna,
[SPECIES_HATTREM] = gMonIcon_Hattrem,
[SPECIES_HATTERENE] = gMonIcon_Hatterene,
[SPECIES_IMPIDIMP] = gMonIcon_Impidimp,
[SPECIES_MORGREM] = gMonIcon_Morgrem,
[SPECIES_GRIMMSNARL] = gMonIcon_Grimmsnarl,
[SPECIES_OBSTAGOON] = gMonIcon_Obstagoon,
[SPECIES_PERRSERKER] = gMonIcon_Perrserker,
[SPECIES_CURSOLA] = gMonIcon_Cursola,
[SPECIES_SIRFETCHD] = gMonIcon_Sirfetchd,
[SPECIES_MR_RIME] = gMonIcon_MrRime,
[SPECIES_RUNERIGUS] = gMonIcon_Runerigus,
[SPECIES_MILCERY] = gMonIcon_Milcery,
[SPECIES_ALCREMIE] = gMonIcon_Alcremie,
[SPECIES_FALINKS] = gMonIcon_Falinks,
[SPECIES_PINCURCHIN] = gMonIcon_Pincurchin,
[SPECIES_SNOM] = gMonIcon_Snom,
[SPECIES_FROSMOTH] = gMonIcon_Frosmoth,
[SPECIES_STONJOURNER] = gMonIcon_Stonjourner,
[SPECIES_EISCUE] = gMonIcon_Eiscue,
[SPECIES_INDEEDEE] = gMonIcon_Indeedee,
[SPECIES_MORPEKO] = gMonIcon_Morpeko,
[SPECIES_CUFANT] = gMonIcon_Cufant,
[SPECIES_COPPERAJAH] = gMonIcon_Copperajah,
[SPECIES_DRACOZOLT] = gMonIcon_Dracozolt,
[SPECIES_ARCTOZOLT] = gMonIcon_Arctozolt,
[SPECIES_DRACOVISH] = gMonIcon_Dracovish,
[SPECIES_ARCTOVISH] = gMonIcon_Arctovish,
[SPECIES_DURALUDON] = gMonIcon_Duraludon,
[SPECIES_DREEPY] = gMonIcon_Dreepy,
[SPECIES_DRAKLOAK] = gMonIcon_Drakloak,
[SPECIES_DRAGAPULT] = gMonIcon_Dragapult,
[SPECIES_ZACIAN] = gMonIcon_Zacian,
[SPECIES_ZAMAZENTA] = gMonIcon_Zamazenta,
[SPECIES_ETERNATUS] = gMonIcon_Eternatus,
[SPECIES_KUBFU] = gMonIcon_Kubfu,
[SPECIES_URSHIFU] = gMonIcon_Urshifu,
[SPECIES_ZARUDE] = gMonIcon_Zarude,
[SPECIES_REGIELEKI] = gMonIcon_Regieleki,
[SPECIES_REGIDRAGO] = gMonIcon_Regidrago,
[SPECIES_GLASTRIER] = gMonIcon_Glastrier,
[SPECIES_SPECTRIER] = gMonIcon_Spectrier,
[SPECIES_CALYREX] = gMonIcon_QuestionMark,//gMonIcon_Calyrex,
[SPECIES_VENUSAUR_MEGA] = gMonIcon_VenusaurMega,
[SPECIES_CHARIZARD_MEGA_X] = gMonIcon_CharizardMegaX,
[SPECIES_CHARIZARD_MEGA_Y] = gMonIcon_CharizardMegaY,
[SPECIES_BLASTOISE_MEGA] = gMonIcon_BlastoiseMega,
[SPECIES_BEEDRILL_MEGA] = gMonIcon_BeedrillMega,
[SPECIES_PIDGEOT_MEGA] = gMonIcon_PidgeotMega,
[SPECIES_ALAKAZAM_MEGA] = gMonIcon_AlakazamMega,
[SPECIES_SLOWBRO_MEGA] = gMonIcon_SlowbroMega,
[SPECIES_GENGAR_MEGA] = gMonIcon_GengarMega,
[SPECIES_KANGASKHAN_MEGA] = gMonIcon_KangaskhanMega,
[SPECIES_PINSIR_MEGA] = gMonIcon_PinsirMega,
[SPECIES_GYARADOS_MEGA] = gMonIcon_GyaradosMega,
[SPECIES_AERODACTYL_MEGA] = gMonIcon_AerodactylMega,
[SPECIES_MEWTWO_MEGA_X] = gMonIcon_MewtwoMegaX,
[SPECIES_MEWTWO_MEGA_Y] = gMonIcon_MewtwoMegaY,
[SPECIES_AMPHAROS_MEGA] = gMonIcon_AmpharosMega,
[SPECIES_STEELIX_MEGA] = gMonIcon_SteelixMega,
[SPECIES_SCIZOR_MEGA] = gMonIcon_ScizorMega,
[SPECIES_HERACROSS_MEGA] = gMonIcon_HeracrossMega,
[SPECIES_HOUNDOOM_MEGA] = gMonIcon_HoundoomMega,
[SPECIES_TYRANITAR_MEGA] = gMonIcon_TyranitarMega,
[SPECIES_SCEPTILE_MEGA] = gMonIcon_SceptileMega,
[SPECIES_BLAZIKEN_MEGA] = gMonIcon_BlazikenMega,
[SPECIES_SWAMPERT_MEGA] = gMonIcon_SwampertMega,
[SPECIES_GARDEVOIR_MEGA] = gMonIcon_GardevoirMega,
[SPECIES_SABLEYE_MEGA] = gMonIcon_SableyeMega,
[SPECIES_MAWILE_MEGA] = gMonIcon_MawileMega,
[SPECIES_AGGRON_MEGA] = gMonIcon_AggronMega,
[SPECIES_MEDICHAM_MEGA] = gMonIcon_MedichamMega,
[SPECIES_MANECTRIC_MEGA] = gMonIcon_ManectricMega,
[SPECIES_SHARPEDO_MEGA] = gMonIcon_SharpedoMega,
[SPECIES_CAMERUPT_MEGA] = gMonIcon_CameruptMega,
[SPECIES_ALTARIA_MEGA] = gMonIcon_AltariaMega,
[SPECIES_BANETTE_MEGA] = gMonIcon_BanetteMega,
[SPECIES_ABSOL_MEGA] = gMonIcon_AbsolMega,
[SPECIES_GLALIE_MEGA] = gMonIcon_GlalieMega,
[SPECIES_SALAMENCE_MEGA] = gMonIcon_SalamenceMega,
[SPECIES_METAGROSS_MEGA] = gMonIcon_MetagrossMega,
[SPECIES_LATIAS_MEGA] = gMonIcon_LatiasMega,
[SPECIES_LATIOS_MEGA] = gMonIcon_LatiosMega,
[SPECIES_LOPUNNY_MEGA] = gMonIcon_LopunnyMega,
[SPECIES_GARCHOMP_MEGA] = gMonIcon_GarchompMega,
[SPECIES_LUCARIO_MEGA] = gMonIcon_LucarioMega,
[SPECIES_ABOMASNOW_MEGA] = gMonIcon_AbomasnowMega,
[SPECIES_GALLADE_MEGA] = gMonIcon_GalladeMega,
[SPECIES_AUDINO_MEGA] = gMonIcon_AudinoMega,
[SPECIES_DIANCIE_MEGA] = gMonIcon_DiancieMega,
[SPECIES_MILOTIC_MEGA] = gMonIcon_MiloticMega,
[SPECIES_BUTTERFREE_MEGA] = gMonIcon_ButterfreeMega,
[SPECIES_MACHAMP_MEGA] = gMonIcon_MachampMega,
[SPECIES_KINGLER_MEGA] = gMonIcon_KinglerMega,
[SPECIES_LAPRAS_MEGA] = gMonIcon_LaprasMega,
[SPECIES_FLYGON_MEGA] = gMonIcon_FlygonMega,
[SPECIES_KINGDRA_MEGA] = gMonIcon_KingdraMega,
[SPECIES_RAYQUAZA_MEGA] = gMonIcon_RayquazaMega,
[SPECIES_KYOGRE_PRIMAL] = gMonIcon_KyogrePrimal,
[SPECIES_GROUDON_PRIMAL] = gMonIcon_GroudonPrimal,
[SPECIES_RATTATA_ALOLAN] = gMonIcon_RattataAlolan,
[SPECIES_RATICATE_ALOLAN] = gMonIcon_RaticateAlolan,
[SPECIES_RAICHU_ALOLAN] = gMonIcon_RaichuAlolan,
[SPECIES_SANDSHREW_ALOLAN] = gMonIcon_SandshrewAlolan,
[SPECIES_SANDSLASH_ALOLAN] = gMonIcon_SandslashAlolan,
[SPECIES_VULPIX_ALOLAN] = gMonIcon_VulpixAlolan,
[SPECIES_NINETALES_ALOLAN] = gMonIcon_NinetalesAlolan,
[SPECIES_DIGLETT_ALOLAN] = gMonIcon_DiglettAlolan,
[SPECIES_DUGTRIO_ALOLAN] = gMonIcon_DugtrioAlolan,
[SPECIES_MEOWTH_ALOLAN] = gMonIcon_MeowthAlolan,
[SPECIES_PERSIAN_ALOLAN] = gMonIcon_PersianAlolan,
[SPECIES_GEODUDE_ALOLAN] = gMonIcon_GeodudeAlolan,
[SPECIES_GRAVELER_ALOLAN] = gMonIcon_GravelerAlolan,
[SPECIES_GOLEM_ALOLAN] = gMonIcon_GolemAlolan,
[SPECIES_GRIMER_ALOLAN] = gMonIcon_GrimerAlolan,
[SPECIES_MUK_ALOLAN] = gMonIcon_MukAlolan,
[SPECIES_EXEGGUTOR_ALOLAN] = gMonIcon_ExeggutorAlolan,
[SPECIES_MAROWAK_ALOLAN] = gMonIcon_MarowakAlolan,
[SPECIES_MEOWTH_GALARIAN] = gMonIcon_MeowthGalarian,
[SPECIES_PONYTA_GALARIAN] = gMonIcon_PonytaGalarian,
[SPECIES_RAPIDASH_GALARIAN] = gMonIcon_RapidashGalarian,
[SPECIES_SLOWPOKE_GALARIAN] = gMonIcon_SlowpokeGalarian,
[SPECIES_SLOWBRO_GALARIAN] = gMonIcon_SlowbroGalarian,
[SPECIES_FARFETCHD_GALARIAN] = gMonIcon_FarfetchdGalarian,
[SPECIES_WEEZING_GALARIAN] = gMonIcon_WeezingGalarian,
[SPECIES_MR_MIME_GALARIAN] = gMonIcon_MrMimeGalarian,
[SPECIES_ARTICUNO_GALARIAN] = gMonIcon_ArticunoGalarian,
[SPECIES_ZAPDOS_GALARIAN] = gMonIcon_ZapdosGalarian,
[SPECIES_MOLTRES_GALARIAN] = gMonIcon_MoltresGalarian,
[SPECIES_SLOWKING_GALARIAN] = gMonIcon_SlowkingGalarian,
[SPECIES_CORSOLA_GALARIAN] = gMonIcon_CorsolaGalarian,
[SPECIES_ZIGZAGOON_GALARIAN] = gMonIcon_ZigzagoonGalarian,
[SPECIES_LINOONE_GALARIAN] = gMonIcon_LinooneGalarian,
[SPECIES_DARUMAKA_GALARIAN] = gMonIcon_DarumakaGalarian,
[SPECIES_DARMANITAN_GALARIAN] = gMonIcon_DarmanitanGalarian,
[SPECIES_YAMASK_GALARIAN] = gMonIcon_YamaskGalarian,
[SPECIES_STUNFISK_GALARIAN] = gMonIcon_StunfiskGalarian,
[SPECIES_PIKACHU_COSPLAY] = gMonIcon_PikachuCosplay,
[SPECIES_PIKACHU_ROCK_STAR] = gMonIcon_PikachuRockStar,
[SPECIES_PIKACHU_BELLE] = gMonIcon_PikachuBelle,
[SPECIES_PIKACHU_POP_STAR] = gMonIcon_PikachuPopStar,
[SPECIES_PIKACHU_PH_D] = gMonIcon_PikachuPhD,
[SPECIES_PIKACHU_LIBRE] = gMonIcon_PikachuLibre,
[SPECIES_PIKACHU_ORIGINAL_CAP] = gMonIcon_PikachuOriginalCap,
[SPECIES_PIKACHU_HOENN_CAP] = gMonIcon_PikachuHoennCap,
[SPECIES_PIKACHU_SINNOH_CAP] = gMonIcon_PikachuSinnohCap,
[SPECIES_PIKACHU_UNOVA_CAP] = gMonIcon_PikachuUnovaCap,
[SPECIES_PIKACHU_KALOS_CAP] = gMonIcon_PikachuKalosCap,
[SPECIES_PIKACHU_ALOLA_CAP] = gMonIcon_PikachuAlolaCap,
[SPECIES_PIKACHU_PARTNER_CAP] = gMonIcon_PikachuPartnerCap,
[SPECIES_PIKACHU_WORLD_CAP] = gMonIcon_QuestionMark,
[SPECIES_PICHU_SPIKY_EARED] = gMonIcon_PichuSpikyEared,
[SPECIES_UNOWN_B] = gMonIcon_UnownB,
[SPECIES_UNOWN_C] = gMonIcon_UnownC,
[SPECIES_UNOWN_D] = gMonIcon_UnownD,
[SPECIES_UNOWN_E] = gMonIcon_UnownE,
[SPECIES_UNOWN_F] = gMonIcon_UnownF,
[SPECIES_UNOWN_G] = gMonIcon_UnownG,
[SPECIES_UNOWN_H] = gMonIcon_UnownH,
[SPECIES_UNOWN_I] = gMonIcon_UnownI,
[SPECIES_UNOWN_J] = gMonIcon_UnownJ,
[SPECIES_UNOWN_K] = gMonIcon_UnownK,
[SPECIES_UNOWN_L] = gMonIcon_UnownL,
[SPECIES_UNOWN_M] = gMonIcon_UnownM,
[SPECIES_UNOWN_N] = gMonIcon_UnownN,
[SPECIES_UNOWN_O] = gMonIcon_UnownO,
[SPECIES_UNOWN_P] = gMonIcon_UnownP,
[SPECIES_UNOWN_Q] = gMonIcon_UnownQ,
[SPECIES_UNOWN_R] = gMonIcon_UnownR,
[SPECIES_UNOWN_S] = gMonIcon_UnownS,
[SPECIES_UNOWN_T] = gMonIcon_UnownT,
[SPECIES_UNOWN_U] = gMonIcon_UnownU,
[SPECIES_UNOWN_V] = gMonIcon_UnownV,
[SPECIES_UNOWN_W] = gMonIcon_UnownW,
[SPECIES_UNOWN_X] = gMonIcon_UnownX,
[SPECIES_UNOWN_Y] = gMonIcon_UnownY,
[SPECIES_UNOWN_Z] = gMonIcon_UnownZ,
[SPECIES_UNOWN_EMARK] = gMonIcon_UnownExclamationMark,
[SPECIES_UNOWN_QMARK] = gMonIcon_UnownQuestionMark,
[SPECIES_CASTFORM_SUNNY] = gMonIcon_CastformSunny,
[SPECIES_CASTFORM_RAINY] = gMonIcon_CastformRainy,
[SPECIES_CASTFORM_SNOWY] = gMonIcon_CastformSnowy,
[SPECIES_DEOXYS_ATTACK] = gMonIcon_DeoxysAttack,
[SPECIES_DEOXYS_DEFENSE] = gMonIcon_DeoxysDefense,
[SPECIES_DEOXYS_SPEED] = gMonIcon_DeoxysSpeed,
[SPECIES_BURMY_SANDY_CLOAK] = gMonIcon_BurmySandyCloak,
[SPECIES_BURMY_TRASH_CLOAK] = gMonIcon_BurmyTrashCloak,
[SPECIES_WORMADAM_SANDY_CLOAK] = gMonIcon_WormadamSandyCloak,
[SPECIES_WORMADAM_TRASH_CLOAK] = gMonIcon_WormadamTrashCloak,
[SPECIES_CHERRIM_SUNSHINE] = gMonIcon_CherrimSunshine,
[SPECIES_SHELLOS_EAST_SEA] = gMonIcon_ShellosEastSea,
[SPECIES_GASTRODON_EAST_SEA] = gMonIcon_GastrodonEastSea,
[SPECIES_ROTOM_HEAT] = gMonIcon_RotomHeat,
[SPECIES_ROTOM_WASH] = gMonIcon_RotomWash,
[SPECIES_ROTOM_FROST] = gMonIcon_RotomFrost,
[SPECIES_ROTOM_FAN] = gMonIcon_RotomFan,
[SPECIES_ROTOM_MOW] = gMonIcon_RotomMow,
[SPECIES_GIRATINA_ORIGIN] = gMonIcon_GiratinaOrigin,
[SPECIES_SHAYMIN_SKY] = gMonIcon_ShayminSky,
[SPECIES_ARCEUS_FIGHTING] = gMonIcon_Arceus,
[SPECIES_ARCEUS_FLYING] = gMonIcon_Arceus,
[SPECIES_ARCEUS_POISON] = gMonIcon_Arceus,
[SPECIES_ARCEUS_GROUND] = gMonIcon_Arceus,
[SPECIES_ARCEUS_ROCK] = gMonIcon_Arceus,
[SPECIES_ARCEUS_BUG] = gMonIcon_Arceus,
[SPECIES_ARCEUS_GHOST] = gMonIcon_Arceus,
[SPECIES_ARCEUS_STEEL] = gMonIcon_Arceus,
[SPECIES_ARCEUS_FIRE] = gMonIcon_Arceus,
[SPECIES_ARCEUS_WATER] = gMonIcon_Arceus,
[SPECIES_ARCEUS_GRASS] = gMonIcon_Arceus,
[SPECIES_ARCEUS_ELECTRIC] = gMonIcon_Arceus,
[SPECIES_ARCEUS_PSYCHIC] = gMonIcon_Arceus,
[SPECIES_ARCEUS_ICE] = gMonIcon_Arceus,
[SPECIES_ARCEUS_DRAGON] = gMonIcon_Arceus,
[SPECIES_ARCEUS_DARK] = gMonIcon_Arceus,
[SPECIES_ARCEUS_FAIRY] = gMonIcon_Arceus,
[SPECIES_BASCULIN_BLUE_STRIPED] = gMonIcon_BasculinBlueStriped,
[SPECIES_DARMANITAN_ZEN_MODE] = gMonIcon_DarmanitanZenMode,
[SPECIES_DARMANITAN_ZEN_MODE_GALARIAN] = gMonIcon_DarmanitanZenModeGalarian,
[SPECIES_DEERLING_SUMMER] = gMonIcon_DeerlingSummer,
[SPECIES_DEERLING_AUTUMN] = gMonIcon_DeerlingAutumn,
[SPECIES_DEERLING_WINTER] = gMonIcon_DeerlingWinter,
[SPECIES_SAWSBUCK_SUMMER] = gMonIcon_SawsbuckSummer,
[SPECIES_SAWSBUCK_AUTUMN] = gMonIcon_SawsbuckAutumn,
[SPECIES_SAWSBUCK_WINTER] = gMonIcon_SawsbuckWinter,
[SPECIES_TORNADUS_THERIAN] = gMonIcon_TornadusTherian,
[SPECIES_THUNDURUS_THERIAN] = gMonIcon_ThundurusTherian,
[SPECIES_LANDORUS_THERIAN] = gMonIcon_LandorusTherian,
[SPECIES_KYUREM_WHITE] = gMonIcon_KyuremWhite,
[SPECIES_KYUREM_BLACK] = gMonIcon_KyuremBlack,
[SPECIES_KELDEO_RESOLUTE] = gMonIcon_KeldeoResolute,
[SPECIES_MELOETTA_PIROUETTE] = gMonIcon_MeloettaPirouette,
[SPECIES_GENESECT_DOUSE_DRIVE] = gMonIcon_Genesect,
[SPECIES_GENESECT_SHOCK_DRIVE] = gMonIcon_Genesect,
[SPECIES_GENESECT_BURN_DRIVE] = gMonIcon_Genesect,
[SPECIES_GENESECT_CHILL_DRIVE] = gMonIcon_Genesect,
[SPECIES_GRENINJA_BATTLE_BOND] = gMonIcon_Greninja,
[SPECIES_GRENINJA_ASH] = gMonIcon_GreninjaAsh,
[SPECIES_VIVILLON_POLAR] = gMonIcon_VivillonPolar,
[SPECIES_VIVILLON_TUNDRA] = gMonIcon_VivillonTundra,
[SPECIES_VIVILLON_CONTINENTAL] = gMonIcon_VivillonContinental,
[SPECIES_VIVILLON_GARDEN] = gMonIcon_VivillonGarden,
[SPECIES_VIVILLON_ELEGANT] = gMonIcon_VivillonElegant,
[SPECIES_VIVILLON_MEADOW] = gMonIcon_VivillonMeadow,
[SPECIES_VIVILLON_MODERN] = gMonIcon_VivillonModern,
[SPECIES_VIVILLON_MARINE] = gMonIcon_VivillonMarine,
[SPECIES_VIVILLON_ARCHIPELAGO] = gMonIcon_VivillonArchipelago,
[SPECIES_VIVILLON_HIGH_PLAINS] = gMonIcon_VivillonHighPlains,
[SPECIES_VIVILLON_SANDSTORM] = gMonIcon_VivillonSandstorm,
[SPECIES_VIVILLON_RIVER] = gMonIcon_VivillonRiver,
[SPECIES_VIVILLON_MONSOON] = gMonIcon_VivillonMonsoon,
[SPECIES_VIVILLON_SAVANNA] = gMonIcon_VivillonSavanna,
[SPECIES_VIVILLON_SUN] = gMonIcon_VivillonSun,
[SPECIES_VIVILLON_OCEAN] = gMonIcon_VivillonOcean,
[SPECIES_VIVILLON_JUNGLE] = gMonIcon_VivillonJungle,
[SPECIES_VIVILLON_FANCY] = gMonIcon_VivillonFancy,
[SPECIES_VIVILLON_POKE_BALL] = gMonIcon_VivillonPokeBall,
[SPECIES_FLABEBE_YELLOW_FLOWER] = gMonIcon_FlabebeYellowFlower,
[SPECIES_FLABEBE_ORANGE_FLOWER] = gMonIcon_FlabebeOrangeFlower,
[SPECIES_FLABEBE_BLUE_FLOWER] = gMonIcon_FlabebeBlueFlower,
[SPECIES_FLABEBE_WHITE_FLOWER] = gMonIcon_FlabebeWhiteFlower,
[SPECIES_FLOETTE_YELLOW_FLOWER] = gMonIcon_FloetteYellowFlower,
[SPECIES_FLOETTE_ORANGE_FLOWER] = gMonIcon_FloetteOrangeFlower,
[SPECIES_FLOETTE_BLUE_FLOWER] = gMonIcon_FloetteBlueFlower,
[SPECIES_FLOETTE_WHITE_FLOWER] = gMonIcon_FloetteWhiteFlower,
[SPECIES_FLOETTE_ETERNAL_FLOWER] = gMonIcon_FloetteEternalFlower,
[SPECIES_FLORGES_YELLOW_FLOWER] = gMonIcon_FlorgesYellowFlower,
[SPECIES_FLORGES_ORANGE_FLOWER] = gMonIcon_FlorgesOrangeFlower,
[SPECIES_FLORGES_BLUE_FLOWER] = gMonIcon_FlorgesBlueFlower,
[SPECIES_FLORGES_WHITE_FLOWER] = gMonIcon_FlorgesWhiteFlower,
[SPECIES_FURFROU_HEART_TRIM] = gMonIcon_FurfrouHeartTrim,
[SPECIES_FURFROU_STAR_TRIM] = gMonIcon_FurfrouStarTrim,
[SPECIES_FURFROU_DIAMOND_TRIM] = gMonIcon_FurfrouDiamondTrim,
[SPECIES_FURFROU_DEBUTANTE_TRIM] = gMonIcon_FurfrouDebutanteTrim,
[SPECIES_FURFROU_MATRON_TRIM] = gMonIcon_FurfrouMatronTrim,
[SPECIES_FURFROU_DANDY_TRIM] = gMonIcon_FurfrouDandyTrim,
[SPECIES_FURFROU_LA_REINE_TRIM] = gMonIcon_FurfrouLaReineTrim,
[SPECIES_FURFROU_KABUKI_TRIM] = gMonIcon_FurfrouKabukiTrim,
[SPECIES_FURFROU_PHARAOH_TRIM] = gMonIcon_FurfrouPharaohTrim,
[SPECIES_MEOWSTIC_FEMALE] = gMonIcon_MeowsticFemale,
[SPECIES_AEGISLASH_BLADE] = gMonIcon_AegislashBlade,
[SPECIES_PUMPKABOO_SMALL] = gMonIcon_Pumpkaboo,
[SPECIES_PUMPKABOO_LARGE] = gMonIcon_Pumpkaboo,
[SPECIES_PUMPKABOO_SUPER] = gMonIcon_Pumpkaboo,
[SPECIES_GOURGEIST_SMALL] = gMonIcon_Gourgeist,
[SPECIES_GOURGEIST_LARGE] = gMonIcon_Gourgeist,
[SPECIES_GOURGEIST_SUPER] = gMonIcon_Gourgeist,
[SPECIES_XERNEAS_ACTIVE] = gMonIcon_XerneasActive,
[SPECIES_ZYGARDE_10] = gMonIcon_Zygarde10,
[SPECIES_ZYGARDE_10_POWER_CONSTRUCT] = gMonIcon_Zygarde10,
[SPECIES_ZYGARDE_50_POWER_CONSTRUCT] = gMonIcon_Zygarde,
[SPECIES_ZYGARDE_COMPLETE] = gMonIcon_ZygardeComplete,
[SPECIES_HOOPA_UNBOUND] = gMonIcon_HoopaUnbound,
[SPECIES_ORICORIO_POM_POM] = gMonIcon_OricorioPomPom,
[SPECIES_ORICORIO_PAU] = gMonIcon_OricorioPau,
[SPECIES_ORICORIO_SENSU] = gMonIcon_OricorioSensu,
[SPECIES_ROCKRUFF_OWN_TEMPO] = gMonIcon_Rockruff,
[SPECIES_LYCANROC_MIDNIGHT] = gMonIcon_LycanrocMidnight,
[SPECIES_LYCANROC_DUSK] = gMonIcon_LycanrocDusk,
[SPECIES_WISHIWASHI_SCHOOL] = gMonIcon_WishiwashiSchool,
[SPECIES_SILVALLY_FIGHTING] = gMonIcon_Silvally,
[SPECIES_SILVALLY_FLYING] = gMonIcon_Silvally,
[SPECIES_SILVALLY_POISON] = gMonIcon_Silvally,
[SPECIES_SILVALLY_GROUND] = gMonIcon_Silvally,
[SPECIES_SILVALLY_ROCK] = gMonIcon_Silvally,
[SPECIES_SILVALLY_BUG] = gMonIcon_Silvally,
[SPECIES_SILVALLY_GHOST] = gMonIcon_Silvally,
[SPECIES_SILVALLY_STEEL] = gMonIcon_Silvally,
[SPECIES_SILVALLY_FIRE] = gMonIcon_Silvally,
[SPECIES_SILVALLY_WATER] = gMonIcon_Silvally,
[SPECIES_SILVALLY_GRASS] = gMonIcon_Silvally,
[SPECIES_SILVALLY_ELECTRIC] = gMonIcon_Silvally,
[SPECIES_SILVALLY_PSYCHIC] = gMonIcon_Silvally,
[SPECIES_SILVALLY_ICE] = gMonIcon_Silvally,
[SPECIES_SILVALLY_DRAGON] = gMonIcon_Silvally,
[SPECIES_SILVALLY_DARK] = gMonIcon_Silvally,
[SPECIES_SILVALLY_FAIRY] = gMonIcon_Silvally,
[SPECIES_MINIOR_METEOR_ORANGE] = gMonIcon_Minior,
[SPECIES_MINIOR_METEOR_YELLOW] = gMonIcon_Minior,
[SPECIES_MINIOR_METEOR_GREEN] = gMonIcon_Minior,
[SPECIES_MINIOR_METEOR_BLUE] = gMonIcon_Minior,
[SPECIES_MINIOR_METEOR_INDIGO] = gMonIcon_Minior,
[SPECIES_MINIOR_METEOR_VIOLET] = gMonIcon_Minior,
[SPECIES_MINIOR_CORE_RED] = gMonIcon_MiniorCoreRed,
[SPECIES_MINIOR_CORE_ORANGE] = gMonIcon_MiniorCoreOrange,
[SPECIES_MINIOR_CORE_YELLOW] = gMonIcon_MiniorCoreYellow,
[SPECIES_MINIOR_CORE_GREEN] = gMonIcon_MiniorCoreGreen,
[SPECIES_MINIOR_CORE_BLUE] = gMonIcon_MiniorCoreBlue,
[SPECIES_MINIOR_CORE_INDIGO] = gMonIcon_MiniorCoreIndigo,
[SPECIES_MINIOR_CORE_VIOLET] = gMonIcon_MiniorCoreViolet,
[SPECIES_MIMIKYU_BUSTED] = gMonIcon_MimikyuBusted,
[SPECIES_NECROZMA_DUSK_MANE] = gMonIcon_NecrozmaDuskMane,
[SPECIES_NECROZMA_DAWN_WINGS] = gMonIcon_NecrozmaDawnWings,
[SPECIES_NECROZMA_ULTRA] = gMonIcon_NecrozmaUltra,
[SPECIES_MAGEARNA_ORIGINAL_COLOR] = gMonIcon_MagearnaOriginalColor,
[SPECIES_CRAMORANT_GULPING] = gMonIcon_CramorantGulping,
[SPECIES_CRAMORANT_GORGING] = gMonIcon_CramorantGorging,
[SPECIES_TOXTRICITY_LOW_KEY] = gMonIcon_ToxtricityLowKey,
[SPECIES_SINISTEA_ANTIQUE] = gMonIcon_Sinistea,
[SPECIES_POLTEAGEIST_ANTIQUE] = gMonIcon_Polteageist,
[SPECIES_ALCREMIE_RUBY_CREAM] = gMonIcon_QuestionMark,//gMonIcon_AlcremieRubyCream,
[SPECIES_ALCREMIE_MATCHA_CREAM] = gMonIcon_QuestionMark,//gMonIcon_AlcremieMatchaCream,
[SPECIES_ALCREMIE_MINT_CREAM] = gMonIcon_QuestionMark,//gMonIcon_AlcremieMintCream,
[SPECIES_ALCREMIE_LEMON_CREAM] = gMonIcon_QuestionMark,//gMonIcon_AlcremieLemonCream,
[SPECIES_ALCREMIE_SALTED_CREAM] = gMonIcon_QuestionMark,//gMonIcon_AlcremieSaltedCream,
[SPECIES_ALCREMIE_RUBY_SWIRL] = gMonIcon_QuestionMark,//gMonIcon_AlcremieRubySwirl,
[SPECIES_ALCREMIE_CARAMEL_SWIRL] = gMonIcon_QuestionMark,//gMonIcon_AlcremieCaramelSwirl,
[SPECIES_ALCREMIE_RAINBOW_SWIRL] = gMonIcon_QuestionMark,//gMonIcon_AlcremieRainbowSwirl,
[SPECIES_EISCUE_NOICE_FACE] = gMonIcon_EiscueNoiceFace,
[SPECIES_INDEEDEE_FEMALE] = gMonIcon_IndeedeeFemale,
[SPECIES_MORPEKO_HANGRY] = gMonIcon_MorpekoHangry,
[SPECIES_ZACIAN_CROWNED_SWORD] = gMonIcon_ZacianCrownedSword,
[SPECIES_ZAMAZENTA_CROWNED_SHIELD] = gMonIcon_ZamazentaCrownedShield,
[SPECIES_ETERNATUS_ETERNAMAX] = gMonIcon_EternatusEternamax,
[SPECIES_URSHIFU_RAPID_STRIKE_STYLE] = gMonIcon_Urshifu,
[SPECIES_ZARUDE_DADA] = gMonIcon_ZarudeDada,
[SPECIES_CALYREX_ICE_RIDER] = gMonIcon_QuestionMark,//gMonIcon_CalyrexIceRider,
[SPECIES_CALYREX_SHADOW_RIDER] = gMonIcon_QuestionMark,//gMonIcon_CalyrexShadowRider,
[SPECIES_EGG] = gMonIcon_Egg,
};
const u8 *const gMonIconTableFemale[] =
{
[SPECIES_EEVEE] = gMonIcon_Eevee,
[SPECIES_COMBEE] = gMonIcon_Combee,
[SPECIES_HIPPOPOTAS] = gMonIcon_Hippopotas,
[SPECIES_HIPPOWDON] = gMonIcon_Hippowdon,
[SPECIES_UNFEZANT] = gMonIcon_UnfezantF,
[SPECIES_FRILLISH] = gMonIcon_FrillishF,
[SPECIES_JELLICENT] = gMonIcon_JellicentF,
[SPECIES_PYROAR] = gMonIcon_PyroarF,
};
const u8 gMonIconPaletteIndices[] =
{
[SPECIES_BULBASAUR] = 4,
[SPECIES_IVYSAUR] = 4,
[SPECIES_VENUSAUR] = 4,
[SPECIES_CHARMANDER] = 0,
[SPECIES_CHARMELEON] = 0,
[SPECIES_CHARIZARD] = 0,
[SPECIES_SQUIRTLE] = 0,
[SPECIES_WARTORTLE] = 2,
[SPECIES_BLASTOISE] = 2,
[SPECIES_CATERPIE] = 1,
[SPECIES_METAPOD] = 1,
[SPECIES_BUTTERFREE] = 0,
[SPECIES_WEEDLE] = 2,
[SPECIES_KAKUNA] = 2,
[SPECIES_BEEDRILL] = 2,
[SPECIES_PIDGEY] = 0,
[SPECIES_PIDGEOTTO] = 0,
[SPECIES_PIDGEOT] = 0,
[SPECIES_RATTATA] = 2,
[SPECIES_RATICATE] = 2,
[SPECIES_SPEAROW] = 0,
[SPECIES_FEAROW] = 0,
[SPECIES_EKANS] = 2,
[SPECIES_ARBOK] = 2,
[SPECIES_PIKACHU] = 2,
[SPECIES_RAICHU] = 0,
[SPECIES_SANDSHREW] = 2,
[SPECIES_SANDSLASH] = 2,
[SPECIES_NIDORAN_F] = 0,
[SPECIES_NIDORINA] = 0,
[SPECIES_NIDOQUEEN] = 2,
[SPECIES_NIDORAN_M] = 2,
[SPECIES_NIDORINO] = 2,
[SPECIES_NIDOKING] = 2,
[SPECIES_CLEFAIRY] = 0,
[SPECIES_CLEFABLE] = 0,
[SPECIES_VULPIX] = 5,
[SPECIES_NINETALES] = 3,
[SPECIES_JIGGLYPUFF] = 0,
[SPECIES_WIGGLYTUFF] = 0,
[SPECIES_ZUBAT] = 2,
[SPECIES_GOLBAT] = 2,
[SPECIES_ODDISH] = 4,
[SPECIES_GLOOM] = 0,
[SPECIES_VILEPLUME] = 0,
[SPECIES_PARAS] = 0,
[SPECIES_PARASECT] = 0,
[SPECIES_VENONAT] = 2,
[SPECIES_VENOMOTH] = 2,
[SPECIES_DIGLETT] = 2,
[SPECIES_DUGTRIO] = 2,
[SPECIES_MEOWTH] = 1,
[SPECIES_PERSIAN] = 1,
[SPECIES_PSYDUCK] = 1,
[SPECIES_GOLDUCK] = 0,
[SPECIES_MANKEY] = 1,
[SPECIES_PRIMEAPE] = 2,
[SPECIES_GROWLITHE] = 3,
[SPECIES_ARCANINE] = 3,
[SPECIES_POLIWAG] = 0,
[SPECIES_POLIWHIRL] = 0,
[SPECIES_POLIWRATH] = 0,
[SPECIES_ABRA] = 2,
[SPECIES_KADABRA] = 2,
[SPECIES_ALAKAZAM] = 2,
[SPECIES_MACHOP] = 0,
[SPECIES_MACHOKE] = 2,
[SPECIES_MACHAMP] = 0,
[SPECIES_BELLSPROUT] = 1,
[SPECIES_WEEPINBELL] = 1,
[SPECIES_VICTREEBEL] = 1,
[SPECIES_TENTACOOL] = 0,
[SPECIES_TENTACRUEL] = 0,
[SPECIES_GEODUDE] = 1,
[SPECIES_GRAVELER] = 1,
[SPECIES_GOLEM] = 2,
[SPECIES_PONYTA] = 3,
[SPECIES_RAPIDASH] = 3,
[SPECIES_SLOWPOKE] = 0,
[SPECIES_SLOWBRO] = 0,
[SPECIES_MAGNEMITE] = 0,
[SPECIES_MAGNETON] = 0,
[SPECIES_FARFETCHD] = 1,
[SPECIES_DODUO] = 2,
[SPECIES_DODRIO] = 2,
[SPECIES_SEEL] = 0,
[SPECIES_DEWGONG] = 2,
[SPECIES_GRIMER] = 2,
[SPECIES_MUK] = 2,
[SPECIES_SHELLDER] = 2,
[SPECIES_CLOYSTER] = 2,
[SPECIES_GASTLY] = 2,
[SPECIES_HAUNTER] = 2,
[SPECIES_GENGAR] = 2,
[SPECIES_ONIX] = 2,
[SPECIES_DROWZEE] = 2,
[SPECIES_HYPNO] = 2,
[SPECIES_KRABBY] = 0,
[SPECIES_KINGLER] = 0,
[SPECIES_VOLTORB] = 0,
[SPECIES_ELECTRODE] = 0,
[SPECIES_EXEGGCUTE] = 0,
[SPECIES_EXEGGUTOR] = 1,
[SPECIES_CUBONE] = 2,
[SPECIES_MAROWAK] = 2,
[SPECIES_HITMONLEE] = 2,
[SPECIES_HITMONCHAN] = 2,
[SPECIES_LICKITUNG] = 0,
[SPECIES_KOFFING] = 2,
[SPECIES_WEEZING] = 2,
[SPECIES_RHYHORN] = 1,
[SPECIES_RHYDON] = 1,
[SPECIES_CHANSEY] = 0,
[SPECIES_TANGELA] = 0,
[SPECIES_KANGASKHAN] = 2,
[SPECIES_HORSEA] = 0,
[SPECIES_SEADRA] = 0,
[SPECIES_GOLDEEN] = 0,
[SPECIES_SEAKING] = 0,
[SPECIES_STARYU] = 2,
[SPECIES_STARMIE] = 2,
[SPECIES_MR_MIME] = 0,
[SPECIES_SCYTHER] = 1,
[SPECIES_JYNX] = 2,
[SPECIES_ELECTABUZZ] = 1,
[SPECIES_MAGMAR] = 0,
[SPECIES_PINSIR] = 2,
[SPECIES_TAUROS] = 2,
[SPECIES_MAGIKARP] = 0,
[SPECIES_GYARADOS] = 0,
[SPECIES_LAPRAS] = 2,
[SPECIES_DITTO] = 2,
[SPECIES_EEVEE] = 2,
[SPECIES_VAPOREON] = 0,
[SPECIES_JOLTEON] = 2,
[SPECIES_FLAREON] = 3,
[SPECIES_PORYGON] = 0,
[SPECIES_OMANYTE] = 0,
[SPECIES_OMASTAR] = 0,
[SPECIES_KABUTO] = 2,
[SPECIES_KABUTOPS] = 2,
[SPECIES_AERODACTYL] = 2,
[SPECIES_SNORLAX] = 3,
[SPECIES_ARTICUNO] = 2,
[SPECIES_ZAPDOS] = 0,
[SPECIES_MOLTRES] = 0,
[SPECIES_DRATINI] = 0,
[SPECIES_DRAGONAIR] = 0,
[SPECIES_DRAGONITE] = 2,
[SPECIES_MEWTWO] = 2,
[SPECIES_MEW] = 0,
[SPECIES_CHIKORITA] = 1,
[SPECIES_BAYLEEF] = 1,
[SPECIES_MEGANIUM] = 1,
[SPECIES_CYNDAQUIL] = 3,
[SPECIES_QUILAVA] = 3,
[SPECIES_TYPHLOSION] = 3,
[SPECIES_TOTODILE] = 0,
[SPECIES_CROCONAW] = 0,
[SPECIES_FERALIGATR] = 0,
[SPECIES_SENTRET] = 2,
[SPECIES_FURRET] = 2,
[SPECIES_HOOTHOOT] = 2,
[SPECIES_NOCTOWL] = 2,
[SPECIES_LEDYBA] = 0,
[SPECIES_LEDIAN] = 0,
[SPECIES_SPINARAK] = 1,
[SPECIES_ARIADOS] = 0,
[SPECIES_CROBAT] = 2,
[SPECIES_CHINCHOU] = 2,
[SPECIES_LANTURN] = 0,
[SPECIES_PICHU] = 1,
[SPECIES_CLEFFA] = 0,
[SPECIES_IGGLYBUFF] = 1,
[SPECIES_TOGEPI] = 0,
[SPECIES_TOGETIC] = 0,
[SPECIES_NATU] = 1,
[SPECIES_XATU] = 1,
[SPECIES_MAREEP] = 0,
[SPECIES_FLAAFFY] = 0,
[SPECIES_AMPHAROS] = 0,
[SPECIES_BELLOSSOM] = 1,
[SPECIES_MARILL] = 0,
[SPECIES_AZUMARILL] = 0,
[SPECIES_SUDOWOODO] = 1,
[SPECIES_POLITOED] = 1,
[SPECIES_HOPPIP] = 1,
[SPECIES_SKIPLOOM] = 1,
[SPECIES_JUMPLUFF] = 2,
[SPECIES_AIPOM] = 2,
[SPECIES_SUNKERN] = 1,
[SPECIES_SUNFLORA] = 1,
[SPECIES_YANMA] = 1,
[SPECIES_WOOPER] = 0,
[SPECIES_QUAGSIRE] = 0,
[SPECIES_ESPEON] = 2,
[SPECIES_UMBREON] = 0,
[SPECIES_MURKROW] = 2,
[SPECIES_SLOWKING] = 0,
[SPECIES_MISDREAVUS] = 0,
[SPECIES_UNOWN] = 0,
[SPECIES_WOBBUFFET] = 0,
[SPECIES_GIRAFARIG] = 1,
[SPECIES_PINECO] = 0,
[SPECIES_FORRETRESS] = 2,
[SPECIES_DUNSPARCE] = 0,
[SPECIES_GLIGAR] = 0,
[SPECIES_STEELIX] = 0,
[SPECIES_SNUBBULL] = 0,
[SPECIES_GRANBULL] = 2,
[SPECIES_QWILFISH] = 0,
[SPECIES_SCIZOR] = 0,
[SPECIES_SHUCKLE] = 1,
[SPECIES_HERACROSS] = 0,
[SPECIES_SNEASEL] = 0,
[SPECIES_TEDDIURSA] = 0,
[SPECIES_URSARING] = 2,
[SPECIES_SLUGMA] = 0,
[SPECIES_MAGCARGO] = 0,
[SPECIES_SWINUB] = 2,
[SPECIES_PILOSWINE] = 2,
[SPECIES_CORSOLA] = 0,
[SPECIES_REMORAID] = 0,
[SPECIES_OCTILLERY] = 0,
[SPECIES_DELIBIRD] = 1,
[SPECIES_MANTINE] = 2,
[SPECIES_SKARMORY] = 0,
[SPECIES_HOUNDOUR] = 0,
[SPECIES_HOUNDOOM] = 0,
[SPECIES_KINGDRA] = 0,
[SPECIES_PHANPY] = 0,
[SPECIES_DONPHAN] = 0,
[SPECIES_PORYGON2] = 0,
[SPECIES_STANTLER] = 2,
[SPECIES_SMEARGLE] = 1,
[SPECIES_TYROGUE] = 2,
[SPECIES_HITMONTOP] = 2,
[SPECIES_SMOOCHUM] = 1,
[SPECIES_ELEKID] = 1,
[SPECIES_MAGBY] = 0,
[SPECIES_MILTANK] = 0,
[SPECIES_BLISSEY] = 0,
[SPECIES_RAIKOU] = 2,
[SPECIES_ENTEI] = 2,
[SPECIES_SUICUNE] = 2,
[SPECIES_LARVITAR] = 1,
[SPECIES_PUPITAR] = 2,
[SPECIES_TYRANITAR] = 4,
[SPECIES_LUGIA] = 0,
[SPECIES_HO_OH] = 1,
[SPECIES_CELEBI] = 1,
[SPECIES_TREECKO] = 1,
[SPECIES_GROVYLE] = 1,
[SPECIES_SCEPTILE] = 1,
[SPECIES_TORCHIC] = 0,
[SPECIES_COMBUSKEN] = 0,
[SPECIES_BLAZIKEN] = 0,
[SPECIES_MUDKIP] = 0,
[SPECIES_MARSHTOMP] = 0,
[SPECIES_SWAMPERT] = 0,
[SPECIES_POOCHYENA] = 2,
[SPECIES_MIGHTYENA] = 2,
[SPECIES_ZIGZAGOON] = 2,
[SPECIES_LINOONE] = 2,
[SPECIES_WURMPLE] = 0,
[SPECIES_SILCOON] = 2,
[SPECIES_BEAUTIFLY] = 0,
[SPECIES_CASCOON] = 2,
[SPECIES_DUSTOX] = 5,
[SPECIES_LOTAD] = 4,
[SPECIES_LOMBRE] = 1,
[SPECIES_LUDICOLO] = 1,
[SPECIES_SEEDOT] = 2,
[SPECIES_NUZLEAF] = 1,
[SPECIES_SHIFTRY] = 5,
[SPECIES_NINCADA] = 1,
[SPECIES_NINJASK] = 1,
[SPECIES_SHEDINJA] = 1,
[SPECIES_TAILLOW] = 2,
[SPECIES_SWELLOW] = 2,
[SPECIES_SHROOMISH] = 1,
[SPECIES_BRELOOM] = 1,
[SPECIES_SPINDA] = 1,
[SPECIES_WINGULL] = 0,
[SPECIES_PELIPPER] = 2,
[SPECIES_SURSKIT] = 0,
[SPECIES_MASQUERAIN] = 0,
[SPECIES_WAILMER] = 2,
[SPECIES_WAILORD] = 0,
[SPECIES_SKITTY] = 0,
[SPECIES_DELCATTY] = 2,
[SPECIES_KECLEON] = 1,
[SPECIES_BALTOY] = 2,
[SPECIES_CLAYDOL] = 0,
[SPECIES_NOSEPASS] = 0,
[SPECIES_TORKOAL] = 2,
[SPECIES_SABLEYE] = 2,
[SPECIES_BARBOACH] = 0,
[SPECIES_WHISCASH] = 0,
[SPECIES_LUVDISC] = 0,
[SPECIES_CORPHISH] = 0,
[SPECIES_CRAWDAUNT] = 0,
[SPECIES_FEEBAS] = 2,
[SPECIES_MILOTIC] = 2,
[SPECIES_CARVANHA] = 0,
[SPECIES_SHARPEDO] = 0,
[SPECIES_TRAPINCH] = 0,
[SPECIES_VIBRAVA] = 1,
[SPECIES_FLYGON] = 1,
[SPECIES_MAKUHITA] = 1,
[SPECIES_HARIYAMA] = 2,
[SPECIES_ELECTRIKE] = 1,
[SPECIES_MANECTRIC] = 0,
[SPECIES_NUMEL] = 1,
[SPECIES_CAMERUPT] = 0,
[SPECIES_SPHEAL] = 2,
[SPECIES_SEALEO] = 2,
[SPECIES_WALREIN] = 0,
[SPECIES_CACNEA] = 1,
[SPECIES_CACTURNE] = 1,
[SPECIES_SNORUNT] = 2,
[SPECIES_GLALIE] = 0,
[SPECIES_LUNATONE] = 1,
[SPECIES_SOLROCK] = 0,
[SPECIES_AZURILL] = 0,
[SPECIES_SPOINK] = 0,
[SPECIES_GRUMPIG] = 2,
[SPECIES_PLUSLE] = 0,
[SPECIES_MINUN] = 0,
[SPECIES_MAWILE] = 2,
[SPECIES_MEDITITE] = 0,
[SPECIES_MEDICHAM] = 0,
[SPECIES_SWABLU] = 0,
[SPECIES_ALTARIA] = 0,
[SPECIES_WYNAUT] = 0,
[SPECIES_DUSKULL] = 0,
[SPECIES_DUSCLOPS] = 0,
[SPECIES_ROSELIA] = 4,
[SPECIES_SLAKOTH] = 2,
[SPECIES_VIGOROTH] = 2,
[SPECIES_SLAKING] = 2,
[SPECIES_GULPIN] = 1,
[SPECIES_SWALOT] = 2,
[SPECIES_TROPIUS] = 1,
[SPECIES_WHISMUR] = 1,
[SPECIES_LOUDRED] = 2,
[SPECIES_EXPLOUD] = 2,
[SPECIES_CLAMPERL] = 0,
[SPECIES_HUNTAIL] = 0,
[SPECIES_GOREBYSS] = 0,
[SPECIES_ABSOL] = 0,
[SPECIES_SHUPPET] = 0,
[SPECIES_BANETTE] = 0,
[SPECIES_SEVIPER] = 2,
[SPECIES_ZANGOOSE] = 0,
[SPECIES_RELICANTH] = 2,
[SPECIES_ARON] = 2,
[SPECIES_LAIRON] = 2,
[SPECIES_AGGRON] = 2,
[SPECIES_CASTFORM] = 0,
[SPECIES_VOLBEAT] = 0,
[SPECIES_ILLUMISE] = 2,
[SPECIES_LILEEP] = 2,
[SPECIES_CRADILY] = 1,
[SPECIES_ANORITH] = 0,
[SPECIES_ARMALDO] = 2,
[SPECIES_RALTS] = 1,
[SPECIES_KIRLIA] = 1,
[SPECIES_GARDEVOIR] = 1,
[SPECIES_BAGON] = 0,
[SPECIES_SHELGON] = 2,
[SPECIES_SALAMENCE] = 0,
[SPECIES_BELDUM] = 0,
[SPECIES_METANG] = 0,
[SPECIES_METAGROSS] = 0,
[SPECIES_REGIROCK] = 2,
[SPECIES_REGICE] = 0,
[SPECIES_REGISTEEL] = 2,
[SPECIES_KYOGRE] = 2,
[SPECIES_GROUDON] = 0,
[SPECIES_RAYQUAZA] = 1,
[SPECIES_LATIAS] = 0,
[SPECIES_LATIOS] = 0,
[SPECIES_JIRACHI] = 0,
[SPECIES_DEOXYS] = 0,
[SPECIES_CHIMECHO] = 0,
[SPECIES_TURTWIG] = 1,
[SPECIES_GROTLE] = 1,
[SPECIES_TORTERRA] = 1,
[SPECIES_CHIMCHAR] = 1,
[SPECIES_MONFERNO] = 0,
[SPECIES_INFERNAPE] = 0,
[SPECIES_PIPLUP] = 0,
[SPECIES_PRINPLUP] = 0,
[SPECIES_EMPOLEON] = 0,
[SPECIES_STARLY] = 0,
[SPECIES_STARAVIA] = 0,
[SPECIES_STARAPTOR] = 0,
[SPECIES_BIDOOF] = 2,
[SPECIES_BIBAREL] = 2,
[SPECIES_KRICKETOT] = 2,
[SPECIES_KRICKETUNE] = 2,
[SPECIES_SHINX] = 0,
[SPECIES_LUXIO] = 0,
[SPECIES_LUXRAY] = 0,
[SPECIES_BUDEW] = 1,
[SPECIES_ROSERADE] = 0,
[SPECIES_CRANIDOS] = 0,
[SPECIES_RAMPARDOS] = 0,
[SPECIES_SHIELDON] = 1,
[SPECIES_BASTIODON] = 1,
[SPECIES_BURMY] = 1,
[SPECIES_WORMADAM] = 1,
[SPECIES_MOTHIM] = 0,
[SPECIES_COMBEE] = 0,
[SPECIES_VESPIQUEN] = 0,
[SPECIES_PACHIRISU] = 0,
[SPECIES_BUIZEL] = 0,
[SPECIES_FLOATZEL] = 0,
[SPECIES_CHERUBI] = 1,
[SPECIES_CHERRIM] = 0,
[SPECIES_SHELLOS] = 0,
[SPECIES_GASTRODON] = 0,
[SPECIES_AMBIPOM] = 2,
[SPECIES_DRIFLOON] = 2,
[SPECIES_DRIFBLIM] = 2,
[SPECIES_BUNEARY] = 2,
[SPECIES_LOPUNNY] = 2,
[SPECIES_MISMAGIUS] = 2,
[SPECIES_HONCHKROW] = 2,
[SPECIES_GLAMEOW] = 0,
[SPECIES_PURUGLY] = 0,
[SPECIES_CHINGLING] = 1,
[SPECIES_STUNKY] = 2,
[SPECIES_SKUNTANK] = 2,
[SPECIES_BRONZOR] = 0,
[SPECIES_BRONZONG] = 0,
[SPECIES_BONSLY] = 1,
[SPECIES_MIME_JR] = 0,
[SPECIES_HAPPINY] = 0,
[SPECIES_CHATOT] = 0,
[SPECIES_SPIRITOMB] = 5,
[SPECIES_GIBLE] = 0,
[SPECIES_GABITE] = 0,
[SPECIES_GARCHOMP] = 0,
[SPECIES_MUNCHLAX] = 3,
[SPECIES_RIOLU] = 2,
[SPECIES_LUCARIO] = 2,
[SPECIES_HIPPOPOTAS] = 1,
[SPECIES_HIPPOWDON] = 1,
[SPECIES_SKORUPI] = 0,
[SPECIES_DRAPION] = 2,
[SPECIES_CROAGUNK] = 0,
[SPECIES_TOXICROAK] = 0,
[SPECIES_CARNIVINE] = 1,
[SPECIES_FINNEON] = 0,
[SPECIES_LUMINEON] = 0,
[SPECIES_MANTYKE] = 0,
[SPECIES_SNOVER] = 1,
[SPECIES_ABOMASNOW] = 1,
[SPECIES_WEAVILE] = 0,
[SPECIES_MAGNEZONE] = 0,
[SPECIES_LICKILICKY] = 1,
[SPECIES_RHYPERIOR] = 0,
[SPECIES_TANGROWTH] = 0,
[SPECIES_ELECTIVIRE] = 1,
[SPECIES_MAGMORTAR] = 0,
[SPECIES_TOGEKISS] = 2,
[SPECIES_YANMEGA] = 1,
[SPECIES_LEAFEON] = 1,
[SPECIES_GLACEON] = 0,
[SPECIES_GLISCOR] = 2,
[SPECIES_MAMOSWINE] = 2,
[SPECIES_PORYGON_Z] = 0,
[SPECIES_GALLADE] = 1,
[SPECIES_PROBOPASS] = 0,
[SPECIES_DUSKNOIR] = 2,
[SPECIES_FROSLASS] = 0,
[SPECIES_ROTOM] = 0,
[SPECIES_UXIE] = 0,
[SPECIES_MESPRIT] = 0,
[SPECIES_AZELF] = 0,
[SPECIES_DIALGA] = 2,
[SPECIES_PALKIA] = 2,
[SPECIES_HEATRAN] = 0,
[SPECIES_REGIGIGAS] = 0,
[SPECIES_GIRATINA] = 0,
[SPECIES_CRESSELIA] = 0,
[SPECIES_PHIONE] = 0,
[SPECIES_MANAPHY] = 0,
[SPECIES_DARKRAI] = 0,
[SPECIES_SHAYMIN] = 1,
[SPECIES_ARCEUS] = 1,
[SPECIES_VICTINI] = 0,
[SPECIES_SNIVY] = 1,
[SPECIES_SERVINE] = 1,
[SPECIES_SERPERIOR] = 1,
[SPECIES_TEPIG] = 0,
[SPECIES_PIGNITE] = 0,
[SPECIES_EMBOAR] = 0,
[SPECIES_OSHAWOTT] = 0,
[SPECIES_DEWOTT] = 0,
[SPECIES_SAMUROTT] = 2,
[SPECIES_PATRAT] = 2,
[SPECIES_WATCHOG] = 2,
[SPECIES_LILLIPUP] = 2,
[SPECIES_HERDIER] = 2,
[SPECIES_STOUTLAND] = 2,
[SPECIES_PURRLOIN] = 0,
[SPECIES_LIEPARD] = 0,
[SPECIES_PANSAGE] = 1,
[SPECIES_SIMISAGE] = 1,
[SPECIES_PANSEAR] = 2,
[SPECIES_SIMISEAR] = 2,
[SPECIES_PANPOUR] = 2,
[SPECIES_SIMIPOUR] = 2,
[SPECIES_MUNNA] = 0,
[SPECIES_MUSHARNA] = 0,
[SPECIES_PIDOVE] = 0,
[SPECIES_TRANQUILL] = 0,
[SPECIES_UNFEZANT] = 1,
[SPECIES_BLITZLE] = 2,
[SPECIES_ZEBSTRIKA] = 2,
[SPECIES_ROGGENROLA] = 2,
[SPECIES_BOLDORE] = 0,
[SPECIES_GIGALITH] = 0,
[SPECIES_WOOBAT] = 0,
[SPECIES_SWOOBAT] = 0,
[SPECIES_DRILBUR] = 0,
[SPECIES_EXCADRILL] = 0,
[SPECIES_AUDINO] = 1,
[SPECIES_TIMBURR] = 1,
[SPECIES_GURDURR] = 1,
[SPECIES_CONKELDURR] = 1,
[SPECIES_TYMPOLE] = 2,
[SPECIES_PALPITOAD] = 2,
[SPECIES_SEISMITOAD] = 0,
[SPECIES_THROH] = 0,
[SPECIES_SAWK] = 0,
[SPECIES_SEWADDLE] = 1,
[SPECIES_SWADLOON] = 1,
[SPECIES_LEAVANNY] = 1,
[SPECIES_VENIPEDE] = 1,
[SPECIES_WHIRLIPEDE] = 2,
[SPECIES_SCOLIPEDE] = 2,
[SPECIES_COTTONEE] = 1,
[SPECIES_WHIMSICOTT] = 1,
[SPECIES_PETILIL] = 1,
[SPECIES_LILLIGANT] = 1,
[SPECIES_BASCULIN] = 1,
[SPECIES_SANDILE] = 1,
[SPECIES_KROKOROK] = 1,
[SPECIES_KROOKODILE] = 0,
[SPECIES_DARUMAKA] = 0,
[SPECIES_DARMANITAN] = 0,
[SPECIES_MARACTUS] = 1,
[SPECIES_DWEBBLE] = 0,
[SPECIES_CRUSTLE] = 2,
[SPECIES_SCRAGGY] = 2,
[SPECIES_SCRAFTY] = 0,
[SPECIES_SIGILYPH] = 0,
[SPECIES_YAMASK] = 0,
[SPECIES_COFAGRIGUS] = 0,
[SPECIES_TIRTOUGA] = 2,
[SPECIES_CARRACOSTA] = 2,
[SPECIES_ARCHEN] = 0,
[SPECIES_ARCHEOPS] = 0,
[SPECIES_TRUBBISH] = 1,
[SPECIES_GARBODOR] = 1,
[SPECIES_ZORUA] = 0,
[SPECIES_ZOROARK] = 0,
[SPECIES_MINCCINO] = 0,
[SPECIES_CINCCINO] = 0,
[SPECIES_GOTHITA] = 2,
[SPECIES_GOTHORITA] = 2,
[SPECIES_GOTHITELLE] = 2,
[SPECIES_SOLOSIS] = 1,
[SPECIES_DUOSION] = 1,
[SPECIES_REUNICLUS] = 1,
[SPECIES_DUCKLETT] = 0,
[SPECIES_SWANNA] = 2,
[SPECIES_VANILLITE] = 0,
[SPECIES_VANILLISH] = 2,
[SPECIES_VANILLUXE] = 2,
[SPECIES_DEERLING] = 1,
[SPECIES_SAWSBUCK] = 1,
[SPECIES_EMOLGA] = 2,
[SPECIES_KARRABLAST] = 0,
[SPECIES_ESCAVALIER] = 0,
[SPECIES_FOONGUS] = 0,
[SPECIES_AMOONGUSS] = 1,
[SPECIES_FRILLISH] = 0,
[SPECIES_JELLICENT] = 0,
[SPECIES_ALOMOMOLA] = 0,
[SPECIES_JOLTIK] = 0,
[SPECIES_GALVANTULA] = 2,
[SPECIES_FERROSEED] = 1,
[SPECIES_FERROTHORN] = 1,
[SPECIES_KLINK] = 0,
[SPECIES_KLANG] = 0,
[SPECIES_KLINKLANG] = 0,
[SPECIES_TYNAMO] = 0,
[SPECIES_EELEKTRIK] = 0,
[SPECIES_EELEKTROSS] = 0,
[SPECIES_ELGYEM] = 0,
[SPECIES_BEHEEYEM] = 2,
[SPECIES_LITWICK] = 2,
[SPECIES_LAMPENT] = 2,
[SPECIES_CHANDELURE] = 2,
[SPECIES_AXEW] = 1,
[SPECIES_FRAXURE] = 1,
[SPECIES_HAXORUS] = 2,
[SPECIES_CUBCHOO] = 0,
[SPECIES_BEARTIC] = 0,
[SPECIES_CRYOGONAL] = 0,
[SPECIES_SHELMET] = 1,
[SPECIES_ACCELGOR] = 1,
[SPECIES_STUNFISK] = 2,
[SPECIES_MIENFOO] = 1,
[SPECIES_MIENSHAO] = 2,
[SPECIES_DRUDDIGON] = 0,
[SPECIES_GOLETT] = 0,
[SPECIES_GOLURK] = 0,
[SPECIES_PAWNIARD] = 0,
[SPECIES_BISHARP] = 0,
[SPECIES_BOUFFALANT] = 2,
[SPECIES_RUFFLET] = 2,
[SPECIES_BRAVIARY] = 0,
[SPECIES_VULLABY] = 0,
[SPECIES_MANDIBUZZ] = 1,
[SPECIES_HEATMOR] = 2,
[SPECIES_DURANT] = 0,
[SPECIES_DEINO] = 2,
[SPECIES_ZWEILOUS] = 2,
[SPECIES_HYDREIGON] = 2,
[SPECIES_LARVESTA] = 0,
[SPECIES_VOLCARONA] = 0,
[SPECIES_COBALION] = 0,
[SPECIES_TERRAKION] = 2,
[SPECIES_VIRIZION] = 1,
[SPECIES_TORNADUS] = 1,
[SPECIES_THUNDURUS] = 0,
[SPECIES_RESHIRAM] = 0,
[SPECIES_ZEKROM] = 2,
[SPECIES_LANDORUS] = 0,
[SPECIES_KYUREM] = 0,
[SPECIES_KELDEO] = 0,
[SPECIES_MELOETTA] = 4,
[SPECIES_GENESECT] = 2,
[SPECIES_CHESPIN] = 1,
[SPECIES_QUILLADIN] = 1,
[SPECIES_CHESNAUGHT] = 1,
[SPECIES_FENNEKIN] = 0,
[SPECIES_BRAIXEN] = 0,
[SPECIES_DELPHOX] = 0,
[SPECIES_FROAKIE] = 0,
[SPECIES_FROGADIER] = 0,
[SPECIES_GRENINJA] = 0,
[SPECIES_BUNNELBY] = 2,
[SPECIES_DIGGERSBY] = 2,
[SPECIES_FLETCHLING] = 2,
[SPECIES_FLETCHINDER] = 2,
[SPECIES_TALONFLAME] = 2,
[SPECIES_SCATTERBUG] = 1,
[SPECIES_SPEWPA] = 1,
[SPECIES_VIVILLON] = 0,
[SPECIES_LITLEO] = 2,
[SPECIES_PYROAR] = 2,
[SPECIES_FLABEBE] = 1,
[SPECIES_FLOETTE] = 1,
[SPECIES_FLORGES] = 0,
[SPECIES_SKIDDO] = 1,
[SPECIES_GOGOAT] = 1,
[SPECIES_PANCHAM] = 1,
[SPECIES_PANGORO] = 1,
[SPECIES_FURFROU] = 0,
[SPECIES_ESPURR] = 2,
[SPECIES_MEOWSTIC] = 0,
[SPECIES_HONEDGE] = 2,
[SPECIES_DOUBLADE] = 2,
[SPECIES_AEGISLASH] = 2,
[SPECIES_SPRITZEE] = 0,
[SPECIES_AROMATISSE] = 0,
[SPECIES_SWIRLIX] = 1,
[SPECIES_SLURPUFF] = 1,
[SPECIES_INKAY] = 0,
[SPECIES_MALAMAR] = 2,
[SPECIES_BINACLE] = 2,
[SPECIES_BARBARACLE] = 2,
[SPECIES_SKRELP] = 2,
[SPECIES_DRAGALGE] = 5,
[SPECIES_CLAUNCHER] = 0,
[SPECIES_CLAWITZER] = 0,
[SPECIES_HELIOPTILE] = 2,
[SPECIES_HELIOLISK] = 2,
[SPECIES_TYRUNT] = 2,
[SPECIES_TYRANTRUM] = 0,
[SPECIES_AMAURA] = 0,
[SPECIES_AURORUS] = 0,
[SPECIES_SYLVEON] = 0,
[SPECIES_HAWLUCHA] = 0,
[SPECIES_DEDENNE] = 0,
[SPECIES_CARBINK] = 2,
[SPECIES_GOOMY] = 5,
[SPECIES_SLIGGOO] = 5,
[SPECIES_GOODRA] = 5,
[SPECIES_KLEFKI] = 0,
[SPECIES_PHANTUMP] = 1,
[SPECIES_TREVENANT] = 1,
[SPECIES_PUMPKABOO] = 2,
[SPECIES_GOURGEIST] = 2,
[SPECIES_BERGMITE] = 0,
[SPECIES_AVALUGG] = 0,
[SPECIES_NOIBAT] = 2,
[SPECIES_NOIVERN] = 2,
[SPECIES_XERNEAS] = 0,
[SPECIES_YVELTAL] = 0,
[SPECIES_ZYGARDE] = 1,
[SPECIES_DIANCIE] = 1,
[SPECIES_HOOPA] = 0,
[SPECIES_VOLCANION] = 0,
[SPECIES_ROWLET] = 0,
[SPECIES_DARTRIX] = 1,
[SPECIES_DECIDUEYE] = 1,
[SPECIES_LITTEN] = 0,
[SPECIES_TORRACAT] = 0,
[SPECIES_INCINEROAR] = 0,
[SPECIES_POPPLIO] = 0,
[SPECIES_BRIONNE] = 0,
[SPECIES_PRIMARINA] = 0,
[SPECIES_PIKIPEK] = 2,
[SPECIES_TRUMBEAK] = 0,
[SPECIES_TOUCANNON] = 0,
[SPECIES_YUNGOOS] = 2,
[SPECIES_GUMSHOOS] = 2,
[SPECIES_GRUBBIN] = 0,
[SPECIES_CHARJABUG] = 1,
[SPECIES_VIKAVOLT] = 0,
[SPECIES_CRABRAWLER] = 2,
[SPECIES_CRABOMINABLE] = 2,
[SPECIES_ORICORIO] = 0,
[SPECIES_CUTIEFLY] = 2,
[SPECIES_RIBOMBEE] = 2,
[SPECIES_ROCKRUFF] = 2,
[SPECIES_LYCANROC] = 2,
[SPECIES_WISHIWASHI] = 2,
[SPECIES_MAREANIE] = 2,
[SPECIES_TOXAPEX] = 0,
[SPECIES_MUDBRAY] = 2,
[SPECIES_MUDSDALE] = 0,
[SPECIES_DEWPIDER] = 0,
[SPECIES_ARAQUANID] = 2,
[SPECIES_FOMANTIS] = 1,
[SPECIES_LURANTIS] = 1,
[SPECIES_MORELULL] = 0,
[SPECIES_SHIINOTIC] = 1,
[SPECIES_SALANDIT] = 2,
[SPECIES_SALAZZLE] = 0,
[SPECIES_STUFFUL] = 0,
[SPECIES_BEWEAR] = 0,
[SPECIES_BOUNSWEET] = 1,
[SPECIES_STEENEE] = 1,
[SPECIES_TSAREENA] = 1,
[SPECIES_COMFEY] = 1,
[SPECIES_ORANGURU] = 0,
[SPECIES_PASSIMIAN] = 1,
[SPECIES_WIMPOD] = 2,
[SPECIES_GOLISOPOD] = 2,
[SPECIES_SANDYGAST] = 1,
[SPECIES_PALOSSAND] = 2,
[SPECIES_PYUKUMUKU] = 0,
[SPECIES_TYPE_NULL] = 0,
[SPECIES_SILVALLY] = 0,
[SPECIES_MINIOR] = 2,
[SPECIES_KOMALA] = 2,
[SPECIES_TURTONATOR] = 0,
[SPECIES_TOGEDEMARU] = 2,
[SPECIES_MIMIKYU] = 1,
[SPECIES_BRUXISH] = 0,
[SPECIES_DRAMPA] = 0,
[SPECIES_DHELMISE] = 1,
[SPECIES_JANGMO_O] = 2,
[SPECIES_HAKAMO_O] = 2,
[SPECIES_KOMMO_O] = 2,
[SPECIES_TAPU_KOKO] = 0,
[SPECIES_TAPU_LELE] = 0,
[SPECIES_TAPU_BULU] = 2,
[SPECIES_TAPU_FINI] = 0,
[SPECIES_COSMOG] = 2,
[SPECIES_COSMOEM] = 0,
[SPECIES_SOLGALEO] = 0,
[SPECIES_LUNALA] = 2,
[SPECIES_NIHILEGO] = 0,
[SPECIES_BUZZWOLE] = 0,
[SPECIES_PHEROMOSA] = 2,
[SPECIES_XURKITREE] = 0,
[SPECIES_CELESTEELA] = 0,
[SPECIES_KARTANA] = 0,
[SPECIES_GUZZLORD] = 0,
[SPECIES_NECROZMA] = 0,
[SPECIES_MAGEARNA] = 0,
[SPECIES_MARSHADOW] = 0,
[SPECIES_POIPOLE] = 0,
[SPECIES_NAGANADEL] = 0,
[SPECIES_STAKATAKA] = 0,
[SPECIES_BLACEPHALON] = 0,
[SPECIES_ZERAORA] = 0,
[SPECIES_MELTAN] = 2,
[SPECIES_MELMETAL] = 2,
[SPECIES_GROOKEY] = 1,
[SPECIES_THWACKEY] = 1,
[SPECIES_RILLABOOM] = 1,
[SPECIES_SCORBUNNY] = 0,
[SPECIES_RABOOT] = 0,
[SPECIES_CINDERACE] = 0,
[SPECIES_SOBBLE] = 2,
[SPECIES_DRIZZILE] = 2,
[SPECIES_INTELEON] = 0,
[SPECIES_SKWOVET] = 2,
[SPECIES_GREEDENT] = 0,
[SPECIES_ROOKIDEE] = 0,
[SPECIES_CORVISQUIRE] = 0,
[SPECIES_CORVIKNIGHT] = 0,
[SPECIES_BLIPBUG] = 0,
[SPECIES_DOTTLER] = 2,
[SPECIES_ORBEETLE] = 0,
[SPECIES_NICKIT] = 2,
[SPECIES_THIEVUL] = 2,
[SPECIES_GOSSIFLEUR] = 1,
[SPECIES_ELDEGOSS] = 1,
[SPECIES_WOOLOO] = 0,
[SPECIES_DUBWOOL] = 2,
[SPECIES_CHEWTLE] = 0,
[SPECIES_DREDNAW] = 0,
[SPECIES_YAMPER] = 1,
[SPECIES_BOLTUND] = 1,
[SPECIES_ROLYCOLY] = 0,
[SPECIES_CARKOL] = 0,
[SPECIES_COALOSSAL] = 0,
[SPECIES_APPLIN] = 1,
[SPECIES_FLAPPLE] = 1,
[SPECIES_APPLETUN] = 1,
[SPECIES_SILICOBRA] = 1,
[SPECIES_SANDACONDA] = 1,
[SPECIES_CRAMORANT] = 0,
[SPECIES_ARROKUDA] = 2,
[SPECIES_BARRASKEWDA] = 2,
[SPECIES_TOXEL] = 2,
[SPECIES_TOXTRICITY] = 2,
[SPECIES_SIZZLIPEDE] = 0,
[SPECIES_CENTISKORCH] = 0,
[SPECIES_CLOBBOPUS] = 0,
[SPECIES_GRAPPLOCT] = 2,
[SPECIES_SINISTEA] = 2,
[SPECIES_POLTEAGEIST] = 2,
[SPECIES_HATENNA] = 0,
[SPECIES_HATTREM] = 0,
[SPECIES_HATTERENE] = 0,
[SPECIES_IMPIDIMP] = 0,
[SPECIES_MORGREM] = 0,
[SPECIES_GRIMMSNARL] = 0,
[SPECIES_OBSTAGOON] = 0,
[SPECIES_PERRSERKER] = 2,
[SPECIES_CURSOLA] = 0,
[SPECIES_SIRFETCHD] = 1,
[SPECIES_MR_RIME] = 0,
[SPECIES_RUNERIGUS] = 2,
[SPECIES_MILCERY] = 1,
[SPECIES_ALCREMIE] = 1,
[SPECIES_FALINKS] = 0,
[SPECIES_PINCURCHIN] = 0,
[SPECIES_SNOM] = 0,
[SPECIES_FROSMOTH] = 0,
[SPECIES_STONJOURNER] = 2,
[SPECIES_EISCUE] = 0,
[SPECIES_INDEEDEE] = 2,
[SPECIES_MORPEKO] = 2,
[SPECIES_CUFANT] = 0,
[SPECIES_COPPERAJAH] = 0,
[SPECIES_DRACOZOLT] = 1,
[SPECIES_ARCTOZOLT] = 2,
[SPECIES_DRACOVISH] = 0,
[SPECIES_ARCTOVISH] = 0,
[SPECIES_DURALUDON] = 0,
[SPECIES_DREEPY] = 0,
[SPECIES_DRAKLOAK] = 0,
[SPECIES_DRAGAPULT] = 0,
[SPECIES_ZACIAN] = 2,
[SPECIES_ZAMAZENTA] = 2,
[SPECIES_ETERNATUS] = 0,
[SPECIES_KUBFU] = 1,
[SPECIES_URSHIFU] = 2,
[SPECIES_ZARUDE] = 1,
[SPECIES_REGIELEKI] = 0,
[SPECIES_REGIDRAGO] = 2,
[SPECIES_GLASTRIER] = 0,
[SPECIES_SPECTRIER] = 0,
[SPECIES_CALYREX] = 0,
[SPECIES_VENUSAUR_MEGA] = 1,
[SPECIES_CHARIZARD_MEGA_X] = 0,
[SPECIES_CHARIZARD_MEGA_Y] = 0,
[SPECIES_BLASTOISE_MEGA] = 2,
[SPECIES_BEEDRILL_MEGA] = 2,
[SPECIES_PIDGEOT_MEGA] = 0,
[SPECIES_ALAKAZAM_MEGA] = 2,
[SPECIES_SLOWBRO_MEGA] = 0,
[SPECIES_GENGAR_MEGA] = 2,
[SPECIES_KANGASKHAN_MEGA] = 2,
[SPECIES_PINSIR_MEGA] = 2,
[SPECIES_GYARADOS_MEGA] = 0,
[SPECIES_AERODACTYL_MEGA] = 2,
[SPECIES_MEWTWO_MEGA_X] = 2,
[SPECIES_MEWTWO_MEGA_Y] = 2,
[SPECIES_AMPHAROS_MEGA] = 0,
[SPECIES_STEELIX_MEGA] = 0,
[SPECIES_SCIZOR_MEGA] = 0,
[SPECIES_HERACROSS_MEGA] = 0,
[SPECIES_HOUNDOOM_MEGA] = 0,
[SPECIES_TYRANITAR_MEGA] = 1,
[SPECIES_SCEPTILE_MEGA] = 1,
[SPECIES_BLAZIKEN_MEGA] = 0,
[SPECIES_SWAMPERT_MEGA] = 0,
[SPECIES_GARDEVOIR_MEGA] = 1,
[SPECIES_SABLEYE_MEGA] = 2,
[SPECIES_MAWILE_MEGA] = 0,
[SPECIES_AGGRON_MEGA] = 2,
[SPECIES_MEDICHAM_MEGA] = 0,
[SPECIES_MANECTRIC_MEGA] = 0,
[SPECIES_SHARPEDO_MEGA] = 0,
[SPECIES_CAMERUPT_MEGA] = 0,
[SPECIES_ALTARIA_MEGA] = 0,
[SPECIES_BANETTE_MEGA] = 0,
[SPECIES_ABSOL_MEGA] = 0,
[SPECIES_GLALIE_MEGA] = 0,
[SPECIES_SALAMENCE_MEGA] = 0,
[SPECIES_METAGROSS_MEGA] = 0,
[SPECIES_LATIAS_MEGA] = 2,
[SPECIES_LATIOS_MEGA] = 2,
[SPECIES_KYOGRE_PRIMAL] = 0,
[SPECIES_GROUDON_PRIMAL] = 0,
[SPECIES_RAYQUAZA_MEGA] = 1,
[SPECIES_LOPUNNY_MEGA] = 2,
[SPECIES_GARCHOMP_MEGA] = 0,
[SPECIES_LUCARIO_MEGA] = 2,
[SPECIES_ABOMASNOW_MEGA] = 1,
[SPECIES_GALLADE_MEGA] = 1,
[SPECIES_AUDINO_MEGA] = 1,
[SPECIES_DIANCIE_MEGA] = 0,
[SPECIES_MILOTIC_MEGA] = 2,
[SPECIES_BUTTERFREE_MEGA] = 0,
[SPECIES_MACHAMP_MEGA] = 0,
[SPECIES_KINGLER_MEGA] = 0,
[SPECIES_LAPRAS_MEGA] = 2,
[SPECIES_FLYGON_MEGA] = 1,
[SPECIES_KINGDRA_MEGA] = 0,
[SPECIES_RATTATA_ALOLAN] = 2,
[SPECIES_RATICATE_ALOLAN] = 2,
[SPECIES_RAICHU_ALOLAN] = 2,
[SPECIES_SANDSHREW_ALOLAN] = 0,
[SPECIES_SANDSLASH_ALOLAN] = 0,
[SPECIES_VULPIX_ALOLAN] = 2,
[SPECIES_NINETALES_ALOLAN] = 2,
[SPECIES_DIGLETT_ALOLAN] = 2,
[SPECIES_DUGTRIO_ALOLAN] = 2,
[SPECIES_MEOWTH_ALOLAN] = 2,
[SPECIES_PERSIAN_ALOLAN] = 2,
[SPECIES_GEODUDE_ALOLAN] = 2,
[SPECIES_GRAVELER_ALOLAN] = 2,
[SPECIES_GOLEM_ALOLAN] = 2,
[SPECIES_GRIMER_ALOLAN] = 1,
[SPECIES_MUK_ALOLAN] = 0,
[SPECIES_EXEGGUTOR_ALOLAN] = 1,
[SPECIES_MAROWAK_ALOLAN] = 1,
[SPECIES_MEOWTH_GALARIAN] = 0,
[SPECIES_PONYTA_GALARIAN] = 2,
[SPECIES_RAPIDASH_GALARIAN] = 2,
[SPECIES_SLOWPOKE_GALARIAN] = 1,
[SPECIES_SLOWBRO_GALARIAN] = 0,
[SPECIES_FARFETCHD_GALARIAN] = 1,
[SPECIES_WEEZING_GALARIAN] = 1,
[SPECIES_MR_MIME_GALARIAN] = 0,
[SPECIES_ARTICUNO_GALARIAN] = 2,
[SPECIES_ZAPDOS_GALARIAN] = 0,
[SPECIES_MOLTRES_GALARIAN] = 0,
[SPECIES_SLOWKING_GALARIAN] = 2,
[SPECIES_CORSOLA_GALARIAN] = 0,
[SPECIES_ZIGZAGOON_GALARIAN] = 0,
[SPECIES_LINOONE_GALARIAN] = 0,
[SPECIES_DARUMAKA_GALARIAN] = 0,
[SPECIES_DARMANITAN_GALARIAN] = 0,
[SPECIES_YAMASK_GALARIAN] = 2,
[SPECIES_STUNFISK_GALARIAN] = 1,
[SPECIES_PIKACHU_COSPLAY] = 2,
[SPECIES_PIKACHU_ROCK_STAR] = 1,
[SPECIES_PIKACHU_BELLE] = 0,
[SPECIES_PIKACHU_POP_STAR] = 0,
[SPECIES_PIKACHU_PH_D] = 1,
[SPECIES_PIKACHU_LIBRE] = 0,
[SPECIES_PIKACHU_ORIGINAL_CAP] = 0,
[SPECIES_PIKACHU_HOENN_CAP] = 0,
[SPECIES_PIKACHU_SINNOH_CAP] = 0,
[SPECIES_PIKACHU_UNOVA_CAP] = 0,
[SPECIES_PIKACHU_KALOS_CAP] = 0,
[SPECIES_PIKACHU_ALOLA_CAP] = 0,
[SPECIES_PIKACHU_PARTNER_CAP] = 0,
[SPECIES_PIKACHU_WORLD_CAP] = 0,
[SPECIES_PICHU_SPIKY_EARED] = 1,
[SPECIES_UNOWN_B ... SPECIES_UNOWN_QMARK] = 0,
[SPECIES_CASTFORM_SUNNY] = 0,
[SPECIES_CASTFORM_RAINY] = 0,
[SPECIES_CASTFORM_SNOWY] = 0,
[SPECIES_BURMY_SANDY_CLOAK] = 1,
[SPECIES_BURMY_TRASH_CLOAK] = 0,
[SPECIES_WORMADAM_SANDY_CLOAK] = 1,
[SPECIES_WORMADAM_TRASH_CLOAK] = 0,
[SPECIES_CHERRIM_SUNSHINE] = 1,
[SPECIES_SHELLOS_EAST_SEA] = 0,
[SPECIES_GASTRODON_EAST_SEA] = 0,
[SPECIES_ROTOM_HEAT] = 0,
[SPECIES_ROTOM_WASH] = 0,
[SPECIES_ROTOM_FROST] = 5,
[SPECIES_ROTOM_FAN] = 0,
[SPECIES_ROTOM_MOW] = 0,
[SPECIES_GIRATINA_ORIGIN] = 0,
[SPECIES_SHAYMIN_SKY] = 1,
[SPECIES_ARCEUS_FIGHTING] = 1,
[SPECIES_ARCEUS_FLYING] = 1,
[SPECIES_ARCEUS_POISON] = 1,
[SPECIES_ARCEUS_GROUND] = 1,
[SPECIES_ARCEUS_ROCK] = 1,
[SPECIES_ARCEUS_BUG] = 1,
[SPECIES_ARCEUS_GHOST] = 1,
[SPECIES_ARCEUS_STEEL] = 1,
[SPECIES_ARCEUS_FIRE] = 1,
[SPECIES_ARCEUS_WATER] = 1,
[SPECIES_ARCEUS_GRASS] = 1,
[SPECIES_ARCEUS_ELECTRIC] = 1,
[SPECIES_ARCEUS_PSYCHIC] = 1,
[SPECIES_ARCEUS_ICE] = 1,
[SPECIES_ARCEUS_DRAGON] = 1,
[SPECIES_ARCEUS_DARK] = 1,
[SPECIES_ARCEUS_FAIRY] = 1,
[SPECIES_BASCULIN_BLUE_STRIPED] = 0,
[SPECIES_DARMANITAN_ZEN_MODE] = 0,
[SPECIES_DARMANITAN_ZEN_MODE_GALARIAN] = 0,
[SPECIES_DEERLING_SUMMER] = 1,
[SPECIES_DEERLING_AUTUMN] = 0,
[SPECIES_DEERLING_WINTER] = 2,
[SPECIES_SAWSBUCK_SUMMER] = 1,
[SPECIES_SAWSBUCK_AUTUMN] = 1,
[SPECIES_SAWSBUCK_WINTER] = 1,
[SPECIES_TORNADUS_THERIAN] = 1,
[SPECIES_THUNDURUS_THERIAN] = 0,
[SPECIES_LANDORUS_THERIAN] = 0,
[SPECIES_KYUREM_WHITE] = 0,
[SPECIES_KYUREM_BLACK] = 0,
[SPECIES_KELDEO_RESOLUTE] = 0,
[SPECIES_MELOETTA_PIROUETTE] = 0,
[SPECIES_GENESECT_DOUSE_DRIVE] = 2,
[SPECIES_GENESECT_SHOCK_DRIVE] = 2,
[SPECIES_GENESECT_BURN_DRIVE] = 2,
[SPECIES_GENESECT_CHILL_DRIVE] = 2,
[SPECIES_GRENINJA_BATTLE_BOND] = 0,
[SPECIES_GRENINJA_ASH] = 0,
[SPECIES_VIVILLON_POLAR] = 0,
[SPECIES_VIVILLON_TUNDRA] = 0,
[SPECIES_VIVILLON_CONTINENTAL] = 2,
[SPECIES_VIVILLON_GARDEN] = 1,
[SPECIES_VIVILLON_ELEGANT] = 0,
[SPECIES_VIVILLON_MEADOW] = 0,
[SPECIES_VIVILLON_MODERN] = 2,
[SPECIES_VIVILLON_MARINE] = 0,
[SPECIES_VIVILLON_ARCHIPELAGO] = 0,
[SPECIES_VIVILLON_HIGH_PLAINS] = 0,
[SPECIES_VIVILLON_SANDSTORM] = 1,
[SPECIES_VIVILLON_RIVER] = 2,
[SPECIES_VIVILLON_MONSOON] = 0,
[SPECIES_VIVILLON_SAVANNA] = 0,
[SPECIES_VIVILLON_SUN] = 0,
[SPECIES_VIVILLON_OCEAN] = 0,
[SPECIES_VIVILLON_JUNGLE] = 0,
[SPECIES_VIVILLON_FANCY] = 1,
[SPECIES_VIVILLON_POKE_BALL] = 2,
[SPECIES_FLABEBE_YELLOW_FLOWER] = 1,
[SPECIES_FLABEBE_ORANGE_FLOWER] = 0,
[SPECIES_FLABEBE_BLUE_FLOWER] = 0,
[SPECIES_FLABEBE_WHITE_FLOWER] = 1,
[SPECIES_FLOETTE_YELLOW_FLOWER] = 1,
[SPECIES_FLOETTE_ORANGE_FLOWER] = 0,
[SPECIES_FLOETTE_BLUE_FLOWER] = 0,
[SPECIES_FLOETTE_WHITE_FLOWER] = 1,
[SPECIES_FLOETTE_ETERNAL_FLOWER] = 0,
[SPECIES_FLORGES_YELLOW_FLOWER] = 1,
[SPECIES_FLORGES_ORANGE_FLOWER] = 0,
[SPECIES_FLORGES_BLUE_FLOWER] = 0,
[SPECIES_FLORGES_WHITE_FLOWER] = 0,
[SPECIES_FURFROU_HEART_TRIM] = 0,
[SPECIES_FURFROU_STAR_TRIM] = 0,
[SPECIES_FURFROU_DIAMOND_TRIM] = 0,
[SPECIES_FURFROU_DEBUTANTE_TRIM] = 2,
[SPECIES_FURFROU_MATRON_TRIM] = 2,
[SPECIES_FURFROU_DANDY_TRIM] = 1,
[SPECIES_FURFROU_LA_REINE_TRIM] = 0,
[SPECIES_FURFROU_KABUKI_TRIM] = 0,
[SPECIES_FURFROU_PHARAOH_TRIM] = 0,
[SPECIES_MEOWSTIC_FEMALE] = 0,
[SPECIES_AEGISLASH_BLADE] = 2,
[SPECIES_PUMPKABOO_SMALL] = 2,
[SPECIES_PUMPKABOO_LARGE] = 2,
[SPECIES_PUMPKABOO_SUPER] = 2,
[SPECIES_GOURGEIST_SMALL] = 2,
[SPECIES_GOURGEIST_LARGE] = 2,
[SPECIES_GOURGEIST_SUPER] = 2,
[SPECIES_XERNEAS_ACTIVE] = 0,
[SPECIES_ZYGARDE_10] = 1,
[SPECIES_ZYGARDE_10_POWER_CONSTRUCT] = 1,
[SPECIES_ZYGARDE_50_POWER_CONSTRUCT] = 1,
[SPECIES_ZYGARDE_COMPLETE] = 1,
[SPECIES_HOOPA_UNBOUND] = 0,
[SPECIES_ORICORIO_POM_POM] = 1,
[SPECIES_ORICORIO_PAU] = 1,
[SPECIES_ORICORIO_SENSU] = 0,
[SPECIES_ROCKRUFF_OWN_TEMPO] = 2,
[SPECIES_LYCANROC_MIDNIGHT] = 0,
[SPECIES_LYCANROC_DUSK] = 0,
[SPECIES_WISHIWASHI_SCHOOL] = 0,
[SPECIES_SILVALLY_FIGHTING] = 0,
[SPECIES_SILVALLY_FLYING] = 0,
[SPECIES_SILVALLY_POISON] = 0,
[SPECIES_SILVALLY_GROUND] = 0,
[SPECIES_SILVALLY_ROCK] = 0,
[SPECIES_SILVALLY_BUG] = 0,
[SPECIES_SILVALLY_GHOST] = 0,
[SPECIES_SILVALLY_STEEL] = 0,
[SPECIES_SILVALLY_FIRE] = 0,
[SPECIES_SILVALLY_WATER] = 0,
[SPECIES_SILVALLY_GRASS] = 0,
[SPECIES_SILVALLY_ELECTRIC] = 0,
[SPECIES_SILVALLY_PSYCHIC] = 0,
[SPECIES_SILVALLY_ICE] = 0,
[SPECIES_SILVALLY_DRAGON] = 0,
[SPECIES_SILVALLY_DARK] = 0,
[SPECIES_SILVALLY_FAIRY] = 0,
[SPECIES_MINIOR_CORE_RED] = 0,
[SPECIES_MINIOR_CORE_ORANGE] = 0,
[SPECIES_MINIOR_CORE_YELLOW] = 0,
[SPECIES_MINIOR_CORE_GREEN] = 1,
[SPECIES_MINIOR_CORE_BLUE] = 0,
[SPECIES_MINIOR_CORE_INDIGO] = 0,
[SPECIES_MINIOR_CORE_VIOLET] = 2,
[SPECIES_MIMIKYU_BUSTED] = 1,
[SPECIES_NECROZMA_DUSK_MANE] = 0,
[SPECIES_NECROZMA_DAWN_WINGS] = 0,
[SPECIES_NECROZMA_ULTRA] = 2,
[SPECIES_MAGEARNA_ORIGINAL_COLOR] = 0,
[SPECIES_CRAMORANT_GULPING] = 0,
[SPECIES_CRAMORANT_GORGING] = 0,
[SPECIES_TOXTRICITY_LOW_KEY] = 2,
[SPECIES_SINISTEA_ANTIQUE] = 2,
[SPECIES_POLTEAGEIST_ANTIQUE] = 2,
[SPECIES_ALCREMIE_RUBY_CREAM] = 0,
[SPECIES_ALCREMIE_MATCHA_CREAM] = 0,
[SPECIES_ALCREMIE_MINT_CREAM] = 0,
[SPECIES_ALCREMIE_LEMON_CREAM] = 0,
[SPECIES_ALCREMIE_SALTED_CREAM] = 0,
[SPECIES_ALCREMIE_RUBY_SWIRL] = 0,
[SPECIES_ALCREMIE_CARAMEL_SWIRL] = 0,
[SPECIES_ALCREMIE_RAINBOW_SWIRL] = 0,
[SPECIES_EISCUE_NOICE_FACE] = 0,
[SPECIES_INDEEDEE_FEMALE] = 2,
[SPECIES_MORPEKO_HANGRY] = 2,
[SPECIES_ZACIAN_CROWNED_SWORD] = 2,
[SPECIES_ZAMAZENTA_CROWNED_SHIELD] = 2,
[SPECIES_ETERNATUS_ETERNAMAX] = 0,
[SPECIES_URSHIFU_RAPID_STRIKE_STYLE] = 2,
[SPECIES_ZARUDE_DADA] = 1,
[SPECIES_CALYREX_ICE_RIDER] = 0,
[SPECIES_CALYREX_SHADOW_RIDER] = 0,
[SPECIES_EGG] = 1,
};
const u8 gMonIconPaletteIndicesFemale[] =
{
[SPECIES_EEVEE] = 2,
[SPECIES_COMBEE] = 0,
[SPECIES_HIPPOPOTAS] = 1,
[SPECIES_HIPPOWDON] = 1,
[SPECIES_UNFEZANT] = 1,
[SPECIES_FRILLISH] = 1,
[SPECIES_JELLICENT] = 1,
[SPECIES_PYROAR] = 2,
};
const struct SpritePalette gMonIconPaletteTable[] =
{
{ gMonIconPalettes[0], POKE_ICON_BASE_PAL_TAG + 0 },
{ gMonIconPalettes[1], POKE_ICON_BASE_PAL_TAG + 1 },
{ gMonIconPalettes[2], POKE_ICON_BASE_PAL_TAG + 2 },
{ gMonIconPalettes[3], POKE_ICON_BASE_PAL_TAG + 3 },
{ gMonIconPalettes[4], POKE_ICON_BASE_PAL_TAG + 4 },
{ gMonIconPalettes[5], POKE_ICON_BASE_PAL_TAG + 5 },
};
const struct OamData sMonIconOamData =
{
.y = 0,
.affineMode = ST_OAM_AFFINE_OFF,
.objMode = ST_OAM_OBJ_NORMAL,
.bpp = ST_OAM_4BPP,
.shape = SPRITE_SHAPE(32x32),
.x = 0,
.size = SPRITE_SIZE(32x32),
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
};
// fastest to slowest
static const union AnimCmd sAnim_0[] =
{
ANIMCMD_FRAME(0, 6),
ANIMCMD_FRAME(1, 6),
ANIMCMD_JUMP(0),
};
static const union AnimCmd sAnim_1[] =
{
ANIMCMD_FRAME(0, 8),
ANIMCMD_FRAME(1, 8),
ANIMCMD_JUMP(0),
};
static const union AnimCmd sAnim_2[] =
{
ANIMCMD_FRAME(0, 14),
ANIMCMD_FRAME(1, 14),
ANIMCMD_JUMP(0),
};
static const union AnimCmd sAnim_3[] =
{
ANIMCMD_FRAME(0, 22),
ANIMCMD_FRAME(1, 22),
ANIMCMD_JUMP(0),
};
static const union AnimCmd sAnim_4[] =
{
ANIMCMD_FRAME(0, 29),
ANIMCMD_FRAME(0, 29), // frame 0 is repeated
ANIMCMD_JUMP(0),
};
const union AnimCmd *const sMonIconAnims[] =
{
sAnim_0,
sAnim_1,
sAnim_2,
sAnim_3,
sAnim_4,
};
static const union AffineAnimCmd sAffineAnim_0[] =
{
AFFINEANIMCMD_FRAME(0, 0, 0, 10),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd sAffineAnim_1[] =
{
AFFINEANIMCMD_FRAME(-2, -2, 0, 122),
AFFINEANIMCMD_END,
};
const union AffineAnimCmd *const sMonIconAffineAnims[] =
{
sAffineAnim_0,
sAffineAnim_1,
};
const u16 sSpriteImageSizes[3][4] =
{
[ST_OAM_SQUARE] =
{
[SPRITE_SIZE(8x8)] = 0x20,
[SPRITE_SIZE(16x16)] = 0x80,
[SPRITE_SIZE(32x32)] = 0x200,
[SPRITE_SIZE(64x64)] = 0x800,
},
[ST_OAM_H_RECTANGLE] =
{
[SPRITE_SIZE(16x8)] = 0x40,
[SPRITE_SIZE(32x8)] = 0x80,
[SPRITE_SIZE(32x16)] = 0x100,
[SPRITE_SIZE(64x32)] = 0x400,
},
[ST_OAM_V_RECTANGLE] =
{
[SPRITE_SIZE(8x16)] = 0x40,
[SPRITE_SIZE(8x32)] = 0x80,
[SPRITE_SIZE(16x32)] = 0x100,
[SPRITE_SIZE(32x64)] = 0x400,
},
};
u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality)
{
u8 spriteId;
struct MonIconSpriteTemplate iconTemplate =
{
.oam = &sMonIconOamData,
.image = GetMonIconPtr(species, personality),
.anims = sMonIconAnims,
.affineAnims = sMonIconAffineAnims,
.callback = callback,
.paletteTag = POKE_ICON_BASE_PAL_TAG + gMonIconPaletteIndices[species],
};
if (species > NUM_SPECIES)
iconTemplate.paletteTag = POKE_ICON_BASE_PAL_TAG;
else if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
iconTemplate.paletteTag = POKE_ICON_BASE_PAL_TAG + gMonIconPaletteIndicesFemale[species];
spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority);
UpdateMonIconFrame(&gSprites[spriteId]);
return spriteId;
}
u8 CreateMonIconNoPersonality(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority)
{
u8 spriteId;
struct MonIconSpriteTemplate iconTemplate =
{
.oam = &sMonIconOamData,
.image = NULL,
.anims = sMonIconAnims,
.affineAnims = sMonIconAffineAnims,
.callback = callback,
.paletteTag = POKE_ICON_BASE_PAL_TAG + gMonIconPaletteIndices[species],
};
iconTemplate.image = GetMonIconTiles(species, 0);
spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority);
UpdateMonIconFrame(&gSprites[spriteId]);
return spriteId;
}
u16 GetIconSpecies(u16 species, u32 personality)
{
u16 result;
if (species == SPECIES_UNOWN)
{
result = GetUnownSpeciesId(personality);
}
else
{
if (species > NUM_SPECIES)
result = INVALID_ICON_SPECIES;
else
result = species;
}
return result;
}
u16 GetUnownLetterByPersonality(u32 personality)
{
if (!personality)
return 0;
else
return GET_UNOWN_LETTER(personality);
}
u16 GetIconSpeciesNoPersonality(u16 species)
{
u16 value;
if (MailSpeciesToSpecies(species, &value) == SPECIES_UNOWN)
{
value += SPECIES_UNOWN_B; // TODO
return value;
}
else
{
if (species > NUM_SPECIES)
species = INVALID_ICON_SPECIES;
return GetIconSpecies(species, 0);
}
}
const u8 *GetMonIconPtr(u16 species, u32 personality)
{
return GetMonIconTiles(GetIconSpecies(species, personality), personality);
}
void FreeAndDestroyMonIconSprite(struct Sprite *sprite)
{
sub_80D328C(sprite);
}
void LoadMonIconPalettes(void)
{
u8 i;
for (i = 0; i < ARRAY_COUNT(gMonIconPaletteTable); i++)
LoadSpritePalette(&gMonIconPaletteTable[i]);
}
// unused
void SafeLoadMonIconPalette(u16 species)
{
u8 palIndex;
if (species > NUM_SPECIES)
species = INVALID_ICON_SPECIES;
palIndex = gMonIconPaletteIndices[species];
if (IndexOfSpritePaletteTag(gMonIconPaletteTable[palIndex].tag) == 0xFF)
LoadSpritePalette(&gMonIconPaletteTable[palIndex]);
}
void LoadMonIconPalette(u16 species)
{
u8 palIndex = gMonIconPaletteIndices[species];
if (IndexOfSpritePaletteTag(gMonIconPaletteTable[palIndex].tag) == 0xFF)
LoadSpritePalette(&gMonIconPaletteTable[palIndex]);
}
void FreeMonIconPalettes(void)
{
u8 i;
for (i = 0; i < ARRAY_COUNT(gMonIconPaletteTable); i++)
FreeSpritePaletteByTag(gMonIconPaletteTable[i].tag);
}
// unused
void SafeFreeMonIconPalette(u16 species)
{
u8 palIndex;
if (species > NUM_SPECIES)
species = INVALID_ICON_SPECIES;
palIndex = gMonIconPaletteIndices[species];
FreeSpritePaletteByTag(gMonIconPaletteTable[palIndex].tag);
}
void FreeMonIconPalette(u16 species)
{
u8 palIndex;
palIndex = gMonIconPaletteIndices[species];
FreeSpritePaletteByTag(gMonIconPaletteTable[palIndex].tag);
}
void SpriteCB_MonIcon(struct Sprite *sprite)
{
UpdateMonIconFrame(sprite);
}
const u8* GetMonIconTiles(u16 species, u32 personality)
{
const u8* iconSprite = gMonIconTable[species];
if (SpeciesHasGenderDifference[species] && GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE)
{
iconSprite = gMonIconTableFemale[species];
}
return iconSprite;
}
void sub_80D304C(u16 offset)
{
s32 i;
const struct SpritePalette* monIconPalettePtr;
if (offset <= 0xA0)
{
monIconPalettePtr = gMonIconPaletteTable;
for(i = 5; i >= 0; i--)
{
LoadPalette(monIconPalettePtr->data, offset, 0x20);
offset += 0x10;
monIconPalettePtr++;
}
}
}
u8 GetValidMonIconPalIndex(u16 species)
{
if (species > NUM_SPECIES)
species = INVALID_ICON_SPECIES;
return gMonIconPaletteIndices[species];
}
u8 GetMonIconPaletteIndexFromSpecies(u16 species)
{
return gMonIconPaletteIndices[species];
}
const u16* GetValidMonIconPalettePtr(u16 species)
{
if (species > NUM_SPECIES)
species = INVALID_ICON_SPECIES;
return gMonIconPaletteTable[gMonIconPaletteIndices[species]].data;
}
u8 UpdateMonIconFrame(struct Sprite *sprite)
{
u8 result = 0;
if (sprite->animDelayCounter == 0)
{
s16 frame = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.imageValue;
switch (frame)
{
case -1:
break;
case -2:
sprite->animCmdIndex = 0;
break;
default:
RequestSpriteCopy(
// pointer arithmetic is needed to get the correct pointer to perform the sprite copy on.
// because sprite->images is a struct def, it has to be casted to (u8 *) before any
// arithmetic can be performed.
(u8 *)sprite->images + (sSpriteImageSizes[sprite->oam.shape][sprite->oam.size] * frame),
(u8 *)(OBJ_VRAM0 + sprite->oam.tileNum * TILE_SIZE_4BPP),
sSpriteImageSizes[sprite->oam.shape][sprite->oam.size]);
sprite->animDelayCounter = sprite->anims[sprite->animNum][sprite->animCmdIndex].frame.duration & 0xFF;
sprite->animCmdIndex++;
result = sprite->animCmdIndex;
break;
}
}
else
{
sprite->animDelayCounter--;
}
return result;
}
static u8 CreateMonIconSprite(struct MonIconSpriteTemplate *iconTemplate, s16 x, s16 y, u8 subpriority)
{
u8 spriteId;
struct SpriteFrameImage image = { NULL, sSpriteImageSizes[iconTemplate->oam->shape][iconTemplate->oam->size] };
struct SpriteTemplate spriteTemplate =
{
.tileTag = 0xFFFF,
.paletteTag = iconTemplate->paletteTag,
.oam = iconTemplate->oam,
.anims = iconTemplate->anims,
.images = &image,
.affineAnims = iconTemplate->affineAnims,
.callback = iconTemplate->callback,
};
spriteId = CreateSprite(&spriteTemplate, x, y, subpriority);
gSprites[spriteId].animPaused = TRUE;
gSprites[spriteId].animBeginning = FALSE;
gSprites[spriteId].images = (const struct SpriteFrameImage *)iconTemplate->image;
return spriteId;
}
void sub_80D328C(struct Sprite *sprite)
{
struct SpriteFrameImage image = { NULL, sSpriteImageSizes[sprite->oam.shape][sprite->oam.size] };
sprite->images = ℑ
DestroySprite(sprite);
}
void SetPartyHPBarSprite(struct Sprite *sprite, u8 animNum)
{
sprite->animNum = animNum;
sprite->animDelayCounter = 0;
sprite->animCmdIndex = 0;
}
|
4117a464c9c5ff8bea57dd5f82b6d65ffc6b072b
|
d83db66cdcf44da6507be7f1e030b89453109e3d
|
/src/save.h
|
9b0bea74687e9b04d87b2c10c8c691dd9b2f4ea2
|
[
"MIT"
] |
permissive
|
alewmoose/2048-in-terminal
|
252e73f6bcdf59c57ef565c1192d4087bf6e1dee
|
bf22f868a2e0e572f22153468585ec0226a4b8b2
|
refs/heads/master
| 2023-04-14T13:42:03.894641
| 2022-06-13T16:57:08
| 2022-06-13T16:57:08
| 24,562,088
| 157
| 35
|
MIT
| 2023-06-24T04:05:43
| 2014-09-28T15:00:41
|
C
|
UTF-8
|
C
| false
| false
| 324
|
h
|
save.h
|
#ifndef SAVE_H
#define SAVE_H
#include "common.h"
/* load_game and save_game return 0 on success and -1 on failure.
* If several instances of the game are running, only the first
* one will write the save file */
int load_game(Board *board, Stats *stats);
int save_game(const Board *board, const Stats *stats);
#endif
|
8b089f6d03c7b000880644af0ac8130ee1cae18e
|
fbe68d84e97262d6d26dd65c704a7b50af2b3943
|
/third_party/virtualbox/src/VBox/Additions/os2/VBoxSF/VBoxSFInternal.h
|
f9ed01add37dd312c91de5073ae10011625aaa05
|
[
"MIT",
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"CDDL-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"GPL-2.0-or-later",
"MPL-1.0",
"LicenseRef-scancode-generic-exception",
"Apache-2.0",
"OpenSSL"
] |
permissive
|
thalium/icebox
|
c4e6573f2b4f0973b6c7bb0bf068fe9e795fdcfb
|
6f78952d58da52ea4f0e55b2ab297f28e80c1160
|
refs/heads/master
| 2022-08-14T00:19:36.984579
| 2022-02-22T13:10:31
| 2022-02-22T13:10:31
| 190,019,914
| 585
| 109
|
MIT
| 2022-01-13T20:58:15
| 2019-06-03T14:18:12
|
C++
|
UTF-8
|
C
| false
| false
| 2,852
|
h
|
VBoxSFInternal.h
|
/** $Id: VBoxSFInternal.h $ */
/** @file
* VBoxSF - OS/2 Shared Folder IFS, Internal Header.
*/
/*
* Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
*
* 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.
*/
#ifndef ___VBoxSFInternal_h___
#define ___VBoxSFInternal_h___
#define INCL_BASE
#define INCL_ERROR
#define INCL_LONGLONG
#include <os2.h>
#include <os2ddk/bsekee.h>
#include <os2ddk/devhlp.h>
#include <os2ddk/unikern.h>
#include <os2ddk/fsd.h>
#undef RT_MAX
#include <iprt/types.h>
#include <iprt/assert.h>
/**
* VBoxSF Volume Parameter Structure.
*
* @remark Overlays the 36 byte VPFSD structure (fsd.h).
*/
typedef struct VBOXSFVP
{
uint32_t u32Dummy;
} VBOXSFVP;
AssertCompile(sizeof(VBOXSFVP) <= sizeof(VPFSD));
/** Pointer to a VBOXSFVP struct. */
typedef VBOXSFVP *PVBOXSFVP;
/**
* VBoxSF Current Directory Structure.
*
* @remark Overlays the 8 byte CDFSD structure (fsd.h).
*/
typedef struct VBOXSFCD
{
uint32_t u32Dummy;
} VBOXSFCD;
AssertCompile(sizeof(VBOXSFCD) <= sizeof(CDFSD));
/** Pointer to a VBOXSFCD struct. */
typedef VBOXSFCD *PVBOXSFCD;
/**
* VBoxSF System File Structure.
*
* @remark Overlays the 30 byte SFFSD structure (fsd.h).
*/
typedef struct VBOXSFFSD
{
/** Self pointer for quick 16:16 to flat translation. */
struct VBOXSFFSD *pSelf;
} VBOXSFFSD;
AssertCompile(sizeof(VBOXSFFSD) <= sizeof(SFFSD));
/** Pointer to a VBOXSFFSD struct. */
typedef VBOXSFFSD *PVBOXSFFSD;
/**
* VBoxSF File Search Structure.
*
* @remark Overlays the 24 byte FSFSD structure (fsd.h).
*/
typedef struct VBOXSFFS
{
/** Self pointer for quick 16:16 to flat translation. */
struct VBOXSFFS *pSelf;
} VBOXSFFS;
AssertCompile(sizeof(VBOXSFFS) <= sizeof(FSFSD));
/** Pointer to a VBOXSFFS struct. */
typedef VBOXSFFS *PVBOXSFFS;
#endif
|
e6bf3bd0eb2c990eda243389ea892a0dc40978aa
|
9907672fcd81ab73ac63b2a83422a82bf31eadde
|
/atcoder/tyama_atcoderk2pcC.c
|
97d2da3230c84c4d89cddcf412d1085501c391eb
|
[
"0BSD"
] |
permissive
|
cielavenir/procon
|
bbe1974b9bddb51b76d58722a0686a5b477c4456
|
746e1a91f574f20647e8aaaac0d9e6173f741176
|
refs/heads/master
| 2023-06-21T23:11:24.562546
| 2023-06-11T13:15:15
| 2023-06-11T13:15:15
| 7,557,464
| 137
| 136
| null | 2020-10-20T09:35:52
| 2013-01-11T09:40:26
|
C++
|
UTF-8
|
C
| false
| false
| 311
|
c
|
tyama_atcoderk2pcC.c
|
#include <stdio.h>
int a[50000];
int main(){
int i,j,A=0,B=0;
for(i=0;i<50000;i++)a[i]=i*(i+1)/2+1;
int v[2];
scanf("%d%d",v,v+1);
for(j=0;j<2;j++){
for(i=0;i<50000;i++){
if(a[i]>v[j]){
int x=a[i]-v[j];
A+=x,B+=i+1-x;
break;
}
}
}
int x=A+B-2;
printf("%d\n",a[x]+B-1);
return 0;
}
|
5ec37000a8d80f48524a55890eb361ab9711a2a7
|
2247493654c160426c1655281aa7f1dca2bc98dd
|
/src/MomentumMassBDF2NodeSuppAlg.C
|
47c2773517be4ab4ce03a594a65d0a7ae224562d
|
[
"BSD-2-Clause"
] |
permissive
|
NaluCFD/Nalu
|
12999b0e3b76dbeab8fc184f38b65a13b1180bce
|
3286651e494894ac5948c41bf985f987d20c2370
|
refs/heads/master
| 2023-08-10T02:48:04.179859
| 2023-08-02T19:02:46
| 2023-08-02T19:02:46
| 69,712,764
| 138
| 185
|
NOASSERTION
| 2023-09-14T16:42:19
| 2016-10-01T01:25:20
|
C
|
UTF-8
|
C
| false
| false
| 4,298
|
c
|
MomentumMassBDF2NodeSuppAlg.C
|
/*------------------------------------------------------------------------*/
/* Copyright 2014 Sandia Corporation. */
/* This software is released under the license detailed */
/* in the file, LICENSE, which is located in the top-level Nalu */
/* directory structure */
/*------------------------------------------------------------------------*/
#include <MomentumMassBDF2NodeSuppAlg.h>
#include <SupplementalAlgorithm.h>
#include <FieldTypeDef.h>
#include <Realm.h>
// stk_mesh/base/fem
#include <stk_mesh/base/Entity.hpp>
#include <stk_mesh/base/MetaData.hpp>
#include <stk_mesh/base/BulkData.hpp>
#include <stk_mesh/base/Field.hpp>
namespace sierra{
namespace nalu{
//==========================================================================
// Class Definition
//==========================================================================
// MomentumMassBDF2NodeSuppAlg - lumped mass BDF2
//==========================================================================
//--------------------------------------------------------------------------
//-------- constructor -----------------------------------------------------
//--------------------------------------------------------------------------
MomentumMassBDF2NodeSuppAlg::MomentumMassBDF2NodeSuppAlg(
Realm &realm)
: SupplementalAlgorithm(realm),
velocityNm1_(NULL),
velocityN_(NULL),
velocityNp1_(NULL),
densityNm1_(NULL),
densityN_(NULL),
densityNp1_(NULL),
dpdx_(NULL),
dualNodalVolume_(NULL),
dt_(0.0),
nDim_(1),
gamma1_(0.0),
gamma2_(0.0),
gamma3_(0.0)
{
// save off fields
stk::mesh::MetaData & meta_data = realm_.meta_data();
VectorFieldType *velocity = meta_data.get_field<double>(stk::topology::NODE_RANK, "velocity");
velocityNm1_ = &(velocity->field_of_state(stk::mesh::StateNM1));
velocityN_ = &(velocity->field_of_state(stk::mesh::StateN));
velocityNp1_ = &(velocity->field_of_state(stk::mesh::StateNP1));
ScalarFieldType *density = meta_data.get_field<double>(stk::topology::NODE_RANK, "density");
densityNm1_ = &(density->field_of_state(stk::mesh::StateNM1));
densityN_ = &(density->field_of_state(stk::mesh::StateN));
densityNp1_ = &(density->field_of_state(stk::mesh::StateNP1));
dpdx_ = meta_data.get_field<double>(stk::topology::NODE_RANK, "dpdx");
dualNodalVolume_ = meta_data.get_field<double>(stk::topology::NODE_RANK, "dual_nodal_volume");
nDim_ = meta_data.spatial_dimension();
}
//--------------------------------------------------------------------------
//-------- setup -----------------------------------------------------------
//--------------------------------------------------------------------------
void
MomentumMassBDF2NodeSuppAlg::setup()
{
dt_ = realm_.get_time_step();
gamma1_ = realm_.get_gamma1();
gamma2_ = realm_.get_gamma2();
gamma3_ = realm_.get_gamma3();
}
//--------------------------------------------------------------------------
//-------- node_execute ----------------------------------------------------
//--------------------------------------------------------------------------
void
MomentumMassBDF2NodeSuppAlg::node_execute(
double *lhs,
double *rhs,
stk::mesh::Entity node)
{
// deal with lumped mass matrix (diagonal matrix)
const double *uNm1 = stk::mesh::field_data(*velocityNm1_, node);
const double *uN = stk::mesh::field_data(*velocityN_, node);
const double *uNp1 = stk::mesh::field_data(*velocityNp1_, node);
const double rhoNm1 = *stk::mesh::field_data(*densityNm1_, node);
const double rhoN = *stk::mesh::field_data(*densityN_, node);
const double rhoNp1 = *stk::mesh::field_data(*densityNp1_, node);
const double dualVolume = *stk::mesh::field_data(*dualNodalVolume_, node);
const double *dpdx = stk::mesh::field_data(*dpdx_, node);
const double lhsfac = gamma1_*rhoNp1*dualVolume/dt_;
const int nDim = nDim_;
for ( int i = 0; i < nDim; ++i ) {
rhs[i] += -(gamma1_*rhoNp1*uNp1[i] + gamma2_*rhoN*uN[i] + gamma3_*rhoNm1*uNm1[i])*dualVolume/dt_
- dpdx[i]*dualVolume;
const int row = i*nDim;
lhs[row+i] += lhsfac;
}
}
} // namespace nalu
} // namespace Sierra
|
fb96c5672a11238ecb32b13199a8516863260977
|
59864cbd213b5da6f50d6255b0a021564b3d5bd4
|
/challenges/Checkmate/src/bitboard.c
|
358145f1e61e90da6c649b0db799e37c2550128d
|
[
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-unknown",
"BSD-2-Clause"
] |
permissive
|
trailofbits/cb-multios
|
8af96a4fbc3b34644367faa135347f88e0e0d0a3
|
810d7b24b1f62f56ef49b148fe155b0d0629cad2
|
refs/heads/master
| 2023-09-05T03:56:20.229403
| 2022-12-27T15:47:54
| 2022-12-27T15:47:54
| 41,688,943
| 522
| 133
|
MIT
| 2023-06-29T02:47:13
| 2015-08-31T17:04:31
|
C
|
UTF-8
|
C
| false
| false
| 25,398
|
c
|
bitboard.c
|
/*
* Copyright (C) Narf Industries <info@narfindustries.com>
*
* 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.
*/
#include "cgc_stdio.h"
#include "cgc_string.h"
#include "cgc_bitboard.h"
#define PIECE_TO_INDEX(piece) ((piece.type) << 1 | (piece.color))
#define INDEX_TO_PIECE(index) make_piece(index & 1, index >> 1)
static struct piece make_piece(enum color, enum type);
static unsigned long long cgc_pawn_moves(struct bitboard *, enum color, int, int);
static unsigned long long cgc_rook_moves(struct bitboard *, enum color, int, int);
static unsigned long long cgc_knight_moves(struct bitboard *, enum color, int, int);
static unsigned long long cgc_bishop_moves(struct bitboard *, enum color, int, int);
static unsigned long long cgc_queen_moves(struct bitboard *, enum color, int, int);
static unsigned long long cgc_king_moves(struct bitboard *, enum color, int, int);
static unsigned long long (*piece_moves[])(struct bitboard *, enum color, int, int) = {
cgc_pawn_moves,
cgc_rook_moves,
cgc_knight_moves,
cgc_bishop_moves,
cgc_queen_moves,
cgc_king_moves
};
static int is_at_risk(struct bitboard *, enum color, int, int, int);
static int is_checkmate(struct bitboard *, enum color, int, int);
static int is_stalemate(struct bitboard *, enum color);
static int infer_src(struct bitboard *, struct move *);
static int can_castle(struct bitboard *, enum color, enum castle_type);
static int validate_move(struct bitboard *, struct move *);
static struct piece
make_piece(enum color color, enum type type)
{
struct piece ret = {
color,
type
};
return ret;
}
void
cgc_init_bitboard(struct bitboard *board)
{
enum color color;
unsigned int i;
cgc_memset(board, '\0', sizeof(struct bitboard));
board->can_castle[WHITE][KINGSIDE] = board->can_castle[BLACK][KINGSIDE] = 1;
board->can_castle[WHITE][QUEENSIDE] = board->can_castle[BLACK][QUEENSIDE] = 1;
board->ep_row = board->ep_col = -1;
for (color = WHITE; color < NUM_COLORS; color++) {
cgc_set_piece(board, 7 * color, 0, make_piece(color, ROOK));
cgc_set_piece(board, 7 * color, 1, make_piece(color, KNIGHT));
cgc_set_piece(board, 7 * color, 2, make_piece(color, BISHOP));
cgc_set_piece(board, 7 * color, 3, make_piece(color, QUEEN));
cgc_set_piece(board, 7 * color, 4, make_piece(color, KING));
cgc_set_piece(board, 7 * color, 5, make_piece(color, BISHOP));
cgc_set_piece(board, 7 * color, 6, make_piece(color, KNIGHT));
cgc_set_piece(board, 7 * color, 7, make_piece(color, ROOK));
for (i = 0; i < BOARD_SIZE; i++)
cgc_set_piece(board, color ? 6 : 1, i, make_piece(color, PAWN));
}
}
void
cgc_print_bitboard(struct bitboard *board, enum color color)
{
char *c;
int i, j, row, col;
struct piece piece;
#define COLOR(color, square) colors[((square) << 1 | (color))]
char *colors[] = {
// White on white
"\033[1;36;47m",
// Black on white
"\033[1;35;47m",
// White on black
"\033[1;36;40m",
// Black on black
"\033[1;35;40m"
};
char *reset = "\033[0m";
#define PIECE(color, type) types[((type) << 1 | (color))]
char *types[] = {
// White pawn
"\xe2\x99\x99\x20",
// Black pawn
"\xe2\x99\x9f\x20",
// White rook
"\xe2\x99\x96\x20",
// Black rook
"\xe2\x99\x9c\x20",
// White knight
"\xe2\x99\x98\x20",
// Black knight
"\xe2\x99\x9e\x20",
// White bishop
"\xe2\x99\x97\x20",
// Black bishop
"\xe2\x99\x9d\x20",
// White queen
"\xe2\x99\x95\x20",
// Black queen
"\xe2\x99\x9b\x20",
// White king
"\xe2\x99\x94\x20",
// Black king
"\xe2\x99\x9a\x20"
};
for (i = 0; i < BOARD_SIZE; i++) {
row = color == WHITE ? i : BOARD_SIZE - i - 1;
cgc_printf("%d ", BOARD_SIZE - row);
for (j = 0; j < BOARD_SIZE; j++) {
col = color == WHITE ? j : BOARD_SIZE - j - 1;
if (cgc_get_piece(board, (BOARD_SIZE - row - 1), col, &piece) == 1)
cgc_printf("%s%s%s", COLOR(piece.color, ((row % 2) + (col % 2)) % 2),
PIECE(piece.color, piece.type), reset);
else
cgc_printf("%s %s", COLOR(0, ((row % 2) + (col % 2)) % 2), reset);
}
cgc_printf("\n");
}
cgc_printf(" ");
c = "abcdefgh";
for (c += (color == WHITE ? 0 : 7); *c; c += (color == WHITE ? 1 : -1))
cgc_printf("%c ", *c);
cgc_printf("\n");
#undef COLOR
#undef PIECE
}
int
cgc_set_piece(struct bitboard *board, int row, int col,
struct piece piece)
{
if (row < 0 || col < 0 || row >= BOARD_SIZE || col >= BOARD_SIZE)
return -1;
board->boards[PIECE_TO_INDEX(piece)] |= (1ull << (row * BOARD_SIZE + col));
return 0;
}
int
cgc_clear_piece(struct bitboard *board, int row, int col)
{
unsigned int i;
if (row < 0 || col < 0 || row >= BOARD_SIZE || col >= BOARD_SIZE)
return -1;
for (i = 0; i < sizeof(board->boards) / sizeof(board->boards[0]); i++)
board->boards[i] &= ~(1ull << (row * BOARD_SIZE + col));
return 0;
}
int
cgc_get_piece(struct bitboard *board, int row, int col,
struct piece *piece)
{
unsigned int i;
if (row < 0 || col < 0 || row >= BOARD_SIZE || col >= BOARD_SIZE)
return -1;
for (i = 0; i < sizeof(board->boards) / sizeof(board->boards[0]); i++)
if (board->boards[i] & 1ull << (row * BOARD_SIZE + col)) {
*piece = INDEX_TO_PIECE(i);
return 1;
}
return 0;
}
static unsigned long long
cgc_pawn_moves(struct bitboard *board, enum color color, int row, int col)
{
unsigned long long ret = 0;
struct piece piece;
// Move one forward
if (cgc_get_piece(board, row + (color == WHITE ? 1 : -1), col, &piece) == 0)
ret |= 1ull << ((row + (color == WHITE ? 1 : -1)) * BOARD_SIZE + col);
// Move two forward
if (ret && row == (color == WHITE ? 1 : 6) &&
cgc_get_piece(board, row + (color == WHITE ? 2 : -2), col, &piece) == 0)
ret |= 1ull << ((row + (color == WHITE ? 2 : -2)) * BOARD_SIZE + col);
// Capture
if (cgc_get_piece(board, row + (color == WHITE ? 1 : -1), col - 1, &piece) == 1 &&
piece.color != color)
ret |= 1ull << ((row + (color == WHITE ? 1 : -1)) * BOARD_SIZE + col - 1);
if (cgc_get_piece(board, row + (color == WHITE ? 1 : -1), col + 1, &piece) == 1 &&
piece.color != color)
ret |= 1ull << ((row + (color == WHITE ? 1 : -1)) * BOARD_SIZE + col + 1);
// En passant
if (board->ep_row == row + (color == WHITE ? 1 : -1) && board->ep_col == col - 1)
ret |= 1ull << ((row + (color == WHITE ? 1 : -1)) * BOARD_SIZE + col - 1);
if (board->ep_row == row + (color == WHITE ? 1 : -1) && board->ep_col == col + 1)
ret |= 1ull << ((row + (color == WHITE ? 1 : -1)) * BOARD_SIZE + col + 1);
return ret;
}
static unsigned long long
cgc_rook_moves(struct bitboard *board, enum color color, int row, int col)
{
unsigned int i;
int j, k, found;
unsigned long long ret = 0;
struct piece piece;
int directions[][2] = {
{ 1, 0 },
{ -1, 0 },
{ 0, 1 },
{ 0, -1 }
};
for (i = 0; i < sizeof(directions) / sizeof(directions[0]); i++) {
j = row + directions[i][0];
k = col + directions[i][1];
while ((found = cgc_get_piece(board, j, k, &piece)) == 0) {
ret |= 1ull << (j * BOARD_SIZE + k);
j += directions[i][0];
k += directions[i][1];
}
if (found == 1 && piece.color != color)
ret |= 1ull << (j * BOARD_SIZE + k);
}
return ret;
}
static unsigned long long
cgc_knight_moves(struct bitboard *board, enum color color, int row, int col)
{
unsigned int i;
int found;
unsigned long long ret = 0;
struct piece piece;
int moves[][2] = {
{ 2, 1 },
{ 1, 2 },
{ 1, -2},
{ -2, 1 },
{ -2, -1 },
{ -1, -2 },
{ -1, 2 },
{ 2, -1 }
};
for (i = 0; i < sizeof(moves) / sizeof(moves[0]); i++) {
found = cgc_get_piece(board, row + moves[i][0], col + moves[i][1], &piece);
if (found == 0 || (found == 1 && piece.color != color))
ret |= 1ull << ((row + moves[i][0]) * BOARD_SIZE + col + moves[i][1]);
}
return ret;
}
static unsigned long long
cgc_bishop_moves(struct bitboard *board, enum color color, int row, int col)
{
unsigned int i;
int j, k, found;
unsigned long long ret = 0;
struct piece piece;
int directions[][2] = {
{ 1, 1 },
{ -1, 1 },
{ 1, -1 },
{ -1, -1 }
};
for (i = 0; i < sizeof(directions) / sizeof(directions[0]); i++) {
j = row + directions[i][0];
k = col + directions[i][1];
while ((found = cgc_get_piece(board, j, k, &piece)) == 0) {
ret |= 1ull << (j * BOARD_SIZE + k);
j += directions[i][0];
k += directions[i][1];
}
if (found == 1 && piece.color != color)
ret |= 1ull << (j * BOARD_SIZE + k);
}
return ret;
}
static unsigned long long
cgc_queen_moves(struct bitboard *board, enum color color, int row, int col)
{
return cgc_bishop_moves(board, color, row, col) | cgc_rook_moves(board, color, row, col);
}
static unsigned long long
cgc_king_moves(struct bitboard *board, enum color color, int row, int col)
{
unsigned int i;
int found;
unsigned long long ret = 0;
struct piece piece;
int moves[][2] = {
{ 1, 1 },
{ 0, 1 },
{ -1, 1},
{ -1, 0 },
{ -1, -1 },
{ 0, -1 },
{ 1, -1 },
{ 1, 0 }
};
for (i = 0; i < sizeof(moves) / sizeof(moves[0]); i++) {
found = cgc_get_piece(board, row + moves[i][0], col + moves[i][1], &piece);
if (found == 0 || (found == 1 && piece.color != color))
if (!is_at_risk(board, color, row + moves[i][0], col + moves[i][1], 1) &&
row + moves[i][0] >= 0 && row + moves[i][0] < BOARD_SIZE &&
col + moves[i][1] >= 0 && col + moves[i][1] < BOARD_SIZE)
ret |= 1ull << ((row + moves[i][0]) * BOARD_SIZE + col + moves[i][1]);
}
return ret;
}
static int
is_at_risk(struct bitboard *board, enum color color, int row, int col, int skip_kings)
{
unsigned int i;
unsigned long long b, moves;
struct piece piece;
piece.color = color == WHITE ? BLACK : WHITE;
for (piece.type = PAWN; piece.type < (skip_kings ? KING: NUM_TYPES); piece.type++) {
b = board->boards[PIECE_TO_INDEX(piece)];
for (i = 0; i < BOARD_SIZE * BOARD_SIZE; i++) {
if (b & (1ull << i)) {
// Special case for pawns
if (piece.type == PAWN && (i % BOARD_SIZE) == col)
continue;
moves = piece_moves[piece.type](board, piece.color,
i / BOARD_SIZE, i % BOARD_SIZE);
if (moves & (1ull << (row * BOARD_SIZE + col)))
return 1;
}
}
}
return 0;
}
static int
is_checkmate(struct bitboard *board, enum color color, int row, int col)
{
// BUG: Doesn't check if checkmate can be avoidided by blocking with another
// friendly piece, shouldn't meaningfully affect CB behavior.
return is_at_risk(board, color, row, col, 0) == 1 &&
cgc_king_moves(board, color, row, col) == 0;
}
static int
is_stalemate(struct bitboard *board, enum color color)
{
unsigned int i;
unsigned long long b, moves = 0;
struct piece piece;
if (board->stalemate_ctr >= 2 * STALEMATE_MOVES)
return 1;
piece.color = color == WHITE ? BLACK : WHITE;
for (piece.type = PAWN; piece.type < NUM_TYPES; piece.type++) {
b = board->boards[PIECE_TO_INDEX(piece)];
for (i = 0; i < BOARD_SIZE * BOARD_SIZE; i++) {
if (b & (1ull << i)) {
moves |= piece_moves[piece.type](board, piece.color,
i / BOARD_SIZE, i % BOARD_SIZE);
}
}
}
return moves == 0;
}
static int
infer_src(struct bitboard *board, struct move *move)
{
unsigned int i;
unsigned long long moves, b = board->boards[PIECE_TO_INDEX(move->piece)];
if (move->dst_row == -1 || move->dst_col == -1)
return -1;
for (i = 0; i < BOARD_SIZE * BOARD_SIZE; i++) {
if (b & (1ull << i)) {
moves = piece_moves[move->piece.type](board, move->piece.color,
i / BOARD_SIZE, i % BOARD_SIZE);
if (moves & (1ull << (move->dst_row * BOARD_SIZE + move->dst_col))) {
if ((move->src_row != -1 && move->src_row != i / BOARD_SIZE) ||
(move->src_col != -1 && move->src_col != i % BOARD_SIZE))
continue;
move->src_row = i / BOARD_SIZE;
move->src_col = i % BOARD_SIZE;
return 0;
}
}
}
return -1;
}
static int
can_castle(struct bitboard *board, enum color color, enum castle_type castle_type)
{
unsigned int i, start_col, end_col;
int row, king_col, rook_col;
struct piece piece;
king_col = 4;
rook_col = castle_type == KINGSIDE ? 7 : 0;
row = (color == WHITE ? 0 : 7);
if (!board->can_castle[color][castle_type])
return 0;
if (cgc_get_piece(board, row, king_col, &piece) != 1 || piece.type != KING)
return 0;
if (cgc_get_piece(board, row, rook_col, &piece) != 1 || piece.type != ROOK)
return 0;
start_col = MIN(king_col, rook_col) + (castle_type == KINGSIDE ? 1 : 2);
end_col = MAX(king_col, rook_col);
for (i = start_col; i < end_col; i++)
if (cgc_get_piece(board, row, i, &piece) != 0 ||
is_at_risk(board, color, row, i, 0))
return 0;
return 1;
}
static int
validate_move(struct bitboard *board, struct move *move)
{
unsigned long long moves;
struct piece piece;
if (move->src_row == -1 || move->src_col == -1 ||
move->dst_row == -1 || move->dst_col == -1)
return 0;
if (cgc_get_piece(board, move->src_row, move->src_col, &piece) != 1 ||
move->piece.color != piece.color || move->piece.type != piece.type)
return 0;
if (move->is_promotion && (move->piece.type != PAWN ||
move->dst_row != (move->piece.color == WHITE ? 7 : 0) ||
(move->promotion_type > PAWN && move->promotion_type < QUEEN)))
return 0;
if ((move->is_check || move->is_checkmate) && move->piece.type == KING)
return 0;
if (move->is_castle_kingside || move->is_castle_queenside)
return can_castle(board, move->piece.color,
move->is_castle_kingside ? KINGSIDE : QUEENSIDE);
if (move->is_capture && (cgc_get_piece(board, move->dst_row, move->dst_col, &piece) != 1 ||
piece.color == move->piece.color)) {
// Check if this is a possible en passant
if (move->piece.type != PAWN || move->dst_row != board->ep_row ||
move->dst_col != board->ep_col)
return 0;
}
moves = piece_moves[move->piece.type](board, move->piece.color,
move->src_row, move->src_col);
if (moves & (1ull << (move->dst_row * BOARD_SIZE + move->dst_col)))
return 1;
return 0;
}
enum result
cgc_make_move(struct bitboard *board, struct move *move)
{
unsigned int i;
unsigned long long b;
struct piece piece;
if (!validate_move(board, move))
return ERROR;
if (move->piece.type == PAWN ||
(cgc_get_piece(board, move->dst_row, move->dst_col, &piece) == 1 &&
piece.color != move->piece.color))
board->stalemate_ctr = 0;
else
board->stalemate_ctr++;
if (move->is_castle_kingside) {
cgc_clear_piece(board, move->piece.color == WHITE ? 0 : 7, 4);
cgc_clear_piece(board, move->piece.color == WHITE ? 0 : 7, 7);
cgc_set_piece(board, move->piece.color == WHITE ? 0 : 7, 6,
make_piece(move->piece.color, KING));
cgc_set_piece(board, move->piece.color == WHITE ? 0 : 7, 5,
make_piece(move->piece.color, ROOK));
board->can_castle[move->piece.color][KINGSIDE] = 0;
board->can_castle[move->piece.color][QUEENSIDE] = 0;
} else if (move->is_castle_queenside) {
cgc_clear_piece(board, move->piece.color == WHITE ? 0 : 7, 4);
cgc_clear_piece(board, move->piece.color == WHITE ? 0 : 7, 0);
cgc_set_piece(board, move->piece.color == WHITE ? 0 : 7, 2,
make_piece(move->piece.color, KING));
cgc_set_piece(board, move->piece.color == WHITE ? 0 : 7, 3,
make_piece(move->piece.color, ROOK));
board->can_castle[move->piece.color][KINGSIDE] = 0;
board->can_castle[move->piece.color][QUEENSIDE] = 0;
} else {
// BUG: If you take the other player's king, call it game over. This
// shouldn't meaningfully affect CB behavior
if (cgc_get_piece(board, move->dst_row, move->dst_col, &piece) == 1 &&
piece.color != move->piece.color && piece.type == KING)
return CHECKMATE;
cgc_clear_piece(board, move->src_row, move->src_col);
cgc_clear_piece(board, move->dst_row, move->dst_col);
if (move->is_promotion)
cgc_set_piece(board, move->dst_row, move->dst_col,
make_piece(move->piece.color, move->promotion_type));
else
cgc_set_piece(board, move->dst_row, move->dst_col, move->piece);
if (move->piece.type == KING) {
board->can_castle[move->piece.color][KINGSIDE] = 0;
board->can_castle[move->piece.color][QUEENSIDE] = 0;
}
if (move->piece.type == ROOK) {
if (move->src_row == (move->piece.color == WHITE ? 0 : 7) && move->src_col == 7)
board->can_castle[move->piece.color][KINGSIDE] = 0;
else if (move->src_row == (move->piece.color == WHITE ? 0 : 7) && move->src_col == 0)
board->can_castle[move->piece.color][QUEENSIDE] = 0;
}
if (move->piece.type == PAWN &&
move->dst_row == board->ep_row && move->dst_col == board->ep_col) {
if (move->dst_row > move->src_row &&
cgc_get_piece(board, move->dst_row - 1, move->dst_col, &piece) == 1 &&
piece.type == PAWN && piece.color != move->piece.color)
cgc_clear_piece(board, move->dst_row - 1, move->dst_col);
else if (move->src_row > move->dst_row &&
cgc_get_piece(board, move->dst_row + 1, move->dst_col, &piece) == 1 &&
piece.type == PAWN && piece.color != move->piece.color)
cgc_clear_piece(board, move->dst_row + 1, move->dst_col);
}
if (move->piece.type == PAWN && (move->dst_row - move->src_row == 2 ||
move->dst_row - move->src_row == -2)) {
board->ep_row = (move->dst_row + move->src_row) / 2;
board->ep_col = move->dst_col;
} else {
board->ep_row = board->ep_col = -1;
}
}
if (is_stalemate(board, move->piece.color))
return STALEMATE;
piece = make_piece(move->piece.color == WHITE ? BLACK : WHITE, KING);
b = board->boards[PIECE_TO_INDEX(piece)];
for (i = 0; i < BOARD_SIZE * BOARD_SIZE; i++)
if (b & (1ull << i))
break;
if (is_at_risk(board, piece.color, i / BOARD_SIZE, i % BOARD_SIZE, 0) == 1) {
if (is_checkmate(board, piece.color, i / BOARD_SIZE, i % BOARD_SIZE))
return CHECKMATE;
else
return CHECK;
}
return CONTINUE;
}
int
cgc_parse_san(struct bitboard *board, enum color color, char *san, struct move *move)
{
char c;
int processed_capture = 0;
enum {
PIECE,
COL,
ROW,
CAPTURE,
PROMOTION,
CHECK,
CHECKMATE,
DONE
} state = PIECE;
cgc_memset(move, '\0', sizeof(struct move));
move->piece.color = color;
move->src_row = move->src_col = -1;
move->dst_row = move->dst_col = -1;
// Castle kingside
if (cgc_strcmp(san, "O-O") == 0) {
move->piece.type = KING;
move->is_castle_kingside = 1;
move->src_row = color ? 7 : 0;
move->dst_row = move->src_row;
move->src_col = 4;
move->dst_col = 6;
return 0;
}
if (cgc_strcmp(san, "O-O-O") == 0) {
move->piece.type = KING;
move->is_castle_queenside = 1;
move->src_row = color ? 7 : 0;
move->dst_row = move->src_row;
move->src_col = 4;
move->dst_col = 2;
return 0;
}
while ((c = *san) && state != DONE) {
switch (state) {
case PIECE:
switch (c) {
case 'R':
move->piece.type = ROOK;
break;
case 'N':
move->piece.type = KNIGHT;
break;
case 'B':
move->piece.type = BISHOP;
break;
case 'Q':
move->piece.type = QUEEN;
break;
case 'K':
move->piece.type = KING;
break;
case 'P':
move->piece.type = PAWN;
break;
case 'a' ... 'h':
move->piece.type = PAWN;
move->dst_col = c - 'a';
break;
default:
return -1;
}
state = move->dst_col == -1 ? COL : ROW;
san++;
break;
case COL:
if (c >= 'a' && c <= 'h') {
move->src_col = move->dst_col;
move->dst_col = c - 'a';
state = ROW;
san++;
} else {
state = processed_capture ? PROMOTION : CAPTURE;
}
break;
case ROW:
if (c >= '1' && c <= '8') {
move->src_row = move->dst_row;
move->dst_row = c - '1';
san++;
} else if (c >= 'a' && c <= 'h') {
state = COL;
continue;
}
state = processed_capture ? PROMOTION : CAPTURE;
break;
case CAPTURE:
if (c == 'x') {
move->is_capture = 1;
san++;
}
processed_capture = 1;
state = COL;
break;
case PROMOTION:
if (c == '=' && move->piece.type == PAWN) {
move->is_promotion = 1;
move->promotion_type = QUEEN;
} else if (move->is_promotion) {
state = CHECK;
switch (c) {
case 'R':
move->promotion_type = ROOK;
break;
case 'N':
move->promotion_type = KNIGHT;
break;
case 'B':
move->promotion_type = BISHOP;
break;
case 'Q':
move->promotion_type = QUEEN;
break;
default:
continue;
}
} else {
state = CHECK;
}
san++;
break;
case CHECK:
if (c == '+')
move->is_check = 1;
state = move->is_check ? DONE : CHECKMATE;
break;
case CHECKMATE:
if (c == '#')
move->is_checkmate = 1;
state = DONE;
break;
case DONE:
default:
// Should never get here
return -1;
}
}
if (move->dst_row == -1 || move->dst_col == -1)
return -1;
if (move->src_row == -1 || move->dst_col == -1)
if (infer_src(board, move) != 0)
return -1;
return 0;
}
|
388783e957ed3d24a475a288e5a96b51ec377936
|
e3acfc4f06840e23ef1185dcf367f40d3e3f59b4
|
/tests/regression/04-mutex/36-trylock_nr.c
|
b259fee80cf6d5708f15c9ce8b2161816fffa178
|
[
"MIT"
] |
permissive
|
goblint/analyzer
|
d62d3c610b86ed288849371b41c330c30678abc7
|
69ee7163eef0bfbfd6a4f3b9fda7cea5ce9ab79f
|
refs/heads/master
| 2023-08-16T21:58:53.013737
| 2023-08-16T08:49:18
| 2023-08-16T08:49:18
| 2,066,905
| 141
| 62
|
MIT
| 2023-09-14T18:48:34
| 2011-07-18T15:10:56
|
OCaml
|
UTF-8
|
C
| false
| false
| 2,228
|
c
|
36-trylock_nr.c
|
// PARAM: --set sem.lock.fail true
/* Based on trylock.c in Butenof's Programming with Posix C. */
#include <pthread.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#define err_abort(code,text) do { \
fprintf (stderr, "%s at \"%s\":%d: %s\n", \
text, __FILE__, __LINE__, strerror (code)); \
abort (); \
} while (0)
#define SPIN 10000000
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
long counter;
time_t end_time;
void *counter_thread (void *arg) {
int status;
int spin;
while (time (NULL) < end_time) {
status = pthread_mutex_lock (&mutex);
if (status != 0)
err_abort (status, "Lock mutex");
for (spin = 0; spin < SPIN; spin++)
counter++; // NORACE
status = pthread_mutex_unlock (&mutex);
if (status != 0)
err_abort (status, "Unlock mutex");
sleep (1);
}
// printf ("Counter is %#lx\n", counter); <-- interesting test for thread IDs.
return NULL;
}
void *monitor_thread (void *arg) {
int status;
int misses = 0;
while (time (NULL) < end_time) {
sleep (3);
status = pthread_mutex_trylock (&mutex);
if (status != EBUSY) {
if (status != 0)
err_abort (status, "Trylock mutex");
printf ("Counter is %ld\n", counter/SPIN); // NORACE
status = pthread_mutex_unlock (&mutex);
if (status != 0)
err_abort (status, "Unlock mutex");
} else
misses++;
}
printf ("Monitor thread missed update %d times.\n", misses);
return NULL;
}
int main (int argc, char *argv[]) {
int status;
pthread_t counter_thread_id;
pthread_t monitor_thread_id;
end_time = time (NULL) + 60;
status = pthread_create (&counter_thread_id, NULL, counter_thread, NULL);
if (status != 0)
err_abort (status, "Create counter thread");
status = pthread_create (&monitor_thread_id, NULL, monitor_thread, NULL);
if (status != 0)
err_abort (status, "Create monitor thread");
status = pthread_join (counter_thread_id, NULL);
if (status != 0)
err_abort (status, "Join counter thread");
status = pthread_join (monitor_thread_id, NULL);
if (status != 0)
err_abort (status, "Join monitor thread");
return 0;
}
|
c89fee6fdd6d3a76027193733baa8579d9097cf8
|
61da6274995cf914291af51bd02e60f408fdfedd
|
/src/fftrot.c
|
b238187241bfcf434cef6aeac83e6e9acd768e34
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] |
permissive
|
mrirecon/bart
|
360d518b4c79836d506803aa4a77e8e252ab820b
|
a3c9dc313f79c4c52f1ba3e617d5831ef088ddf7
|
refs/heads/master
| 2023-08-31T11:01:08.932824
| 2023-08-30T12:15:35
| 2023-08-30T13:51:18
| 23,212,230
| 264
| 185
|
BSD-3-Clause
| 2023-08-03T18:43:36
| 2014-08-22T03:57:09
|
C
|
UTF-8
|
C
| false
| false
| 2,562
|
c
|
fftrot.c
|
/* Copyright 2018. Martin Uecker.
* All rights reserved. Use of this source code is governed by
* a BSD-style license which can be found in the LICENSE file.
*
* Authors:
* 2018 Martin Uecker <martin.uecker@med.uni-goettingen.de>
*/
#include <stdbool.h>
#include <complex.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include "num/init.h"
#include "num/fft.h"
#include "num/flpmath.h"
#include "num/multind.h"
#include "misc/opts.h"
#include "misc/misc.h"
#include "misc/mmio.h"
#ifndef DIMS
#define DIMS 16
#endif
static const char help_str[] = "Performs a rotation using Fourier transform (FFT) along selected dimensions.";
int main_fftrot(int argc, char* argv[argc])
{
int dim1 = -1;
int dim2 = -1;
float theta = 0.f;
const char* in_file = NULL;
const char* out_file = NULL;
struct arg_s args[] = {
ARG_INT(true, &dim1, "dim1"),
ARG_INT(true, &dim2, "dim2"),
ARG_FLOAT(true, &theta, "theta"),
ARG_INFILE(true, &in_file, "input"),
ARG_OUTFILE(true, &out_file, "output"),
};
const struct opt_s opts[] = { };
cmdline(&argc, argv, ARRAY_SIZE(args), args, help_str, ARRAY_SIZE(opts), opts);
num_init();
int N = DIMS;
long dims[N];
complex float* idata = load_cfl(in_file, N, dims);
complex float* odata = create_cfl(out_file, N, dims);
assert(dim1 != dim2);
if (dim1 > dim2) {
int tmp = dim1;
dim1 = dim2;
dim2 = tmp;
}
float alpha = -tanf(theta / 2.);
float beta = sinf(theta);
unsigned long flags = (1UL << dim1) | (1UL << dim2);
long phdims[N];
md_select_dims(N, flags, phdims, dims);
complex float* phx = md_alloc(N, phdims, CFL_SIZE);
complex float* phy = md_alloc(N, phdims, CFL_SIZE);
int X = phdims[dim1];
int Y = phdims[dim2];
for (int i = 0; i < X; i++) {
for (int j = 0; j < Y; j++) {
phx[i + X * j] = cexpf(+2.i * M_PI * ((j - Y / 2.) * alpha * (i - X / 2.) / (float)(X)));
phy[i + X * j] = cexpf(-2.i * M_PI * ((j - Y / 2.) * beta * (i - X / 2.) / (float)(Y)));
}
}
long strs[N];
md_calc_strides(N, strs, dims, CFL_SIZE);
long phstrs[N];
md_calc_strides(N, phstrs, phdims, CFL_SIZE);
fftuc(N, dims, (1u << dim1), odata, idata);
md_zmul2(N, dims, strs, odata, strs, odata, phstrs, phx);
ifftuc(N, dims, flags, odata, odata);
md_zmul2(N, dims, strs, odata, strs, odata, phstrs, phy);
fftuc(N, dims, flags, odata, odata);
md_zmul2(N, dims, strs, odata, strs, odata, phstrs, phx);
ifftuc(N, dims, (1u << dim1), odata, odata);
md_free(phx);
md_free(phy);
unmap_cfl(N, dims, idata);
unmap_cfl(N, dims, odata);
return 0;
}
|
7228aed0c75910185d9c9ab0425831a8b2792357
|
8666bf68be0190e61d01087e31b81f4154698764
|
/CommonHeaders/ProviderInterface/IUnityGraphics.h
|
fb6b37e5e9ebf1f880684c132c2a501639ff2021
|
[
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] |
permissive
|
ValveSoftware/unity-xr-plugin
|
d59dec1e8739bea4eca68d95081e67317caf3edb
|
8a821dc0b7b52d5d3cae352dd6cdbb1f3dad902c
|
refs/heads/master
| 2023-08-28T10:32:38.789807
| 2023-08-25T17:14:44
| 2023-08-25T17:14:44
| 268,947,323
| 296
| 63
|
BSD-3-Clause
| 2023-08-24T18:54:44
| 2020-06-03T01:30:32
|
C#
|
UTF-8
|
C
| false
| false
| 3,025
|
h
|
IUnityGraphics.h
|
// Unity Native Plugin API copyright © 2015 Unity Technologies ApS
//
// Licensed under the Unity Companion License for Unity - dependent projects--see[Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License).
//
// Unless expressly provided otherwise, the Software under this license is made available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED.Please review the license for details on these and other terms and conditions.
#pragma once
#include "IUnityInterface.h"
typedef enum UnityGfxRenderer
{
//kUnityGfxRendererOpenGL = 0, // Legacy OpenGL, removed
//kUnityGfxRendererD3D9 = 1, // Direct3D 9, removed
kUnityGfxRendererD3D11 = 2, // Direct3D 11
kUnityGfxRendererNull = 4, // "null" device (used in batch mode)
kUnityGfxRendererOpenGLES20 = 8, // OpenGL ES 2.0
kUnityGfxRendererOpenGLES30 = 11, // OpenGL ES 3.0
//kUnityGfxRendererGXM = 12, // PlayStation Vita, removed
kUnityGfxRendererPS4 = 13, // PlayStation 4
kUnityGfxRendererXboxOne = 14, // Xbox One
kUnityGfxRendererMetal = 16, // iOS Metal
kUnityGfxRendererOpenGLCore = 17, // OpenGL core
kUnityGfxRendererD3D12 = 18, // Direct3D 12
kUnityGfxRendererVulkan = 21, // Vulkan
kUnityGfxRendererNvn = 22, // Nintendo Switch NVN API
kUnityGfxRendererXboxOneD3D12 = 23 // MS XboxOne Direct3D 12
} UnityGfxRenderer;
typedef enum UnityGfxDeviceEventType
{
kUnityGfxDeviceEventInitialize = 0,
kUnityGfxDeviceEventShutdown = 1,
kUnityGfxDeviceEventBeforeReset = 2,
kUnityGfxDeviceEventAfterReset = 3,
} UnityGfxDeviceEventType;
typedef void ( UNITY_INTERFACE_API *IUnityGraphicsDeviceEventCallback )( UnityGfxDeviceEventType eventType );
// Should only be used on the rendering thread unless noted otherwise.
UNITY_DECLARE_INTERFACE( IUnityGraphics )
{
UnityGfxRenderer( UNITY_INTERFACE_API * GetRenderer )( ); // Thread safe
// This callback will be called when graphics device is created, destroyed, reset, etc.
// It is possible to miss the kUnityGfxDeviceEventInitialize event in case plugin is loaded at a later time,
// when the graphics device is already created.
void( UNITY_INTERFACE_API * RegisterDeviceEventCallback )( IUnityGraphicsDeviceEventCallback callback );
void( UNITY_INTERFACE_API * UnregisterDeviceEventCallback )( IUnityGraphicsDeviceEventCallback callback );
int( UNITY_INTERFACE_API * ReserveEventIDRange )( int count ); // reserves 'count' event IDs. Plugins should use the result as a base index when issuing events back and forth to avoid event id clashes.
};
UNITY_REGISTER_INTERFACE_GUID( 0x7CBA0A9CA4DDB544ULL, 0x8C5AD4926EB17B11ULL, IUnityGraphics )
// Certain Unity APIs (GL.IssuePluginEvent, CommandBuffer.IssuePluginEvent) can callback into native plugins.
// Provide them with an address to a function of this signature.
typedef void ( UNITY_INTERFACE_API *UnityRenderingEvent )( int eventId );
typedef void ( UNITY_INTERFACE_API *UnityRenderingEventAndData )( int eventId, void *data );
|
5b31e821f590e8d203950027c84892cb6ca392b9
|
e910318d01528d82040507a49eeeb8dade45b31f
|
/drivers/cc3000/inc/nvmem.h
|
b99a2e7b9ec5b4926b4fe791416c9f7823a4ed06
|
[
"MIT"
] |
permissive
|
pfalcon/pycopy
|
e844480a5e5cd463530328889daed2ba87552b8a
|
3ac90ae9c3c6bbebfba9cada2d37025e35c62796
|
refs/heads/pfalcon
| 2023-08-30T09:39:52.290147
| 2022-09-08T16:42:38
| 2022-09-08T16:42:38
| 15,507,576
| 753
| 71
|
MIT
| 2021-05-08T04:59:21
| 2013-12-29T11:38:47
|
C
|
UTF-8
|
C
| false
| false
| 9,621
|
h
|
nvmem.h
|
/*****************************************************************************
*
* nvmem.h - CC3000 Host Driver Implementation.
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
#ifndef __CC3000_NVRAM_H__
#define __CC3000_NVRAM_H__
#include "cc3000_common.h"
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C" {
#endif
//*****************************************************************************
//
//! \addtogroup nvmem_api
//! @{
//
//*****************************************************************************
/****************************************************************************
**
** Definitions for File IDs
**
****************************************************************************/
/* NVMEM file ID - system files*/
#define NVMEM_NVS_FILEID (0)
#define NVMEM_NVS_SHADOW_FILEID (1)
#define NVMEM_WLAN_CONFIG_FILEID (2)
#define NVMEM_WLAN_CONFIG_SHADOW_FILEID (3)
#define NVMEM_WLAN_DRIVER_SP_FILEID (4)
#define NVMEM_WLAN_FW_SP_FILEID (5)
#define NVMEM_MAC_FILEID (6)
#define NVMEM_FRONTEND_VARS_FILEID (7)
#define NVMEM_IP_CONFIG_FILEID (8)
#define NVMEM_IP_CONFIG_SHADOW_FILEID (9)
#define NVMEM_BOOTLOADER_SP_FILEID (10)
#define NVMEM_RM_FILEID (11)
/* NVMEM file ID - user files*/
#define NVMEM_AES128_KEY_FILEID (12)
#define NVMEM_SHARED_MEM_FILEID (13)
/* max entry in order to invalid nvmem */
#define NVMEM_MAX_ENTRY (16)
//*****************************************************************************
//
//! nvmem_read
//!
//! @param ulFileId nvmem file id:\n
//! NVMEM_NVS_FILEID, NVMEM_NVS_SHADOW_FILEID,
//! NVMEM_WLAN_CONFIG_FILEID, NVMEM_WLAN_CONFIG_SHADOW_FILEID,
//! NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID,
//! NVMEM_MAC_FILEID, NVMEM_FRONTEND_VARS_FILEID,
//! NVMEM_IP_CONFIG_FILEID, NVMEM_IP_CONFIG_SHADOW_FILEID,
//! NVMEM_BOOTLOADER_SP_FILEID, NVMEM_RM_FILEID,
//! and user files 12-15.
//! @param ulLength number of bytes to read
//! @param ulOffset ulOffset in file from where to read
//! @param buff output buffer pointer
//!
//! @return on success 0, error otherwise.
//!
//! @brief Reads data from the file referred by the ulFileId parameter.
//! Reads data from file ulOffset till length. Err if the file can't
//! be used, is invalid, or if the read is out of bounds.
//!
//*****************************************************************************
extern INT32 nvmem_read(UINT32 file_id, UINT32 length, UINT32 offset, UINT8 *buff);
//*****************************************************************************
//
//! nvmem_write
//!
//! @param ulFileId nvmem file id:\n
//! NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID,
//! NVMEM_MAC_FILEID, NVMEM_BOOTLOADER_SP_FILEID,
//! and user files 12-15.
//! @param ulLength number of bytes to write
//! @param ulEntryOffset offset in file to start write operation from
//! @param buff data to write
//!
//! @return on success 0, error otherwise.
//!
//! @brief Write data to nvmem.
//! writes data to file referred by the ulFileId parameter.
//! Writes data to file ulOffset till ulLength.The file id will be
//! marked invalid till the write is done. The file entry doesn't
//! need to be valid - only allocated.
//!
//*****************************************************************************
extern INT32 nvmem_write(UINT32 ulFileId, UINT32 ulLength, UINT32 ulEntryOffset, UINT8 *buff);
//*****************************************************************************
//
//! nvmem_set_mac_address
//!
//! @param mac mac address to be set
//!
//! @return on success 0, error otherwise.
//!
//! @brief Write MAC address to EEPROM.
//! mac address as appears over the air (OUI first)
//!
//*****************************************************************************
extern UINT8 nvmem_set_mac_address(UINT8 *mac);
//*****************************************************************************
//
//! nvmem_get_mac_address
//!
//! @param[out] mac mac address
//!
//! @return on success 0, error otherwise.
//!
//! @brief Read MAC address from EEPROM.
//! mac address as appears over the air (OUI first)
//!
//*****************************************************************************
extern UINT8 nvmem_get_mac_address(UINT8 *mac);
//*****************************************************************************
//
//! nvmem_write_patch
//!
//! @param ulFileId nvmem file id:\n
//! NVMEM_WLAN_DRIVER_SP_FILEID, NVMEM_WLAN_FW_SP_FILEID,
//! @param spLength number of bytes to write
//! @param spData SP data to write
//!
//! @return on success 0, error otherwise.
//!
//! @brief program a patch to a specific file ID.
//! The SP data is assumed to be organized in 2-dimensional.
//! Each line is SP_PORTION_SIZE bytes long. Actual programming is
//! applied in SP_PORTION_SIZE bytes portions.
//!
//*****************************************************************************
extern UINT8 nvmem_write_patch(UINT32 ulFileId, UINT32 spLength, const UINT8 *spData);
//*****************************************************************************
//
//! nvmem_read_sp_version
//!
//! @param[out] patchVer first number indicates package ID and the second
//! number indicates package build number
//!
//! @return on success 0, error otherwise.
//!
//! @brief Read patch version. read package version (WiFi FW patch,
//! driver-supplicant-NS patch, bootloader patch)
//!
//*****************************************************************************
#ifndef CC3000_TINY_DRIVER
extern UINT8 nvmem_read_sp_version(UINT8* patchVer);
#endif
//*****************************************************************************
//
//! nvmem_create_entry
//!
//! @param ulFileId nvmem file Id:\n
//! * NVMEM_AES128_KEY_FILEID: 12
//! * NVMEM_SHARED_MEM_FILEID: 13
//! * and fileIDs 14 and 15
//! @param ulNewLen entry ulLength
//!
//! @return on success 0, error otherwise.
//!
//! @brief Create new file entry and allocate space on the NVMEM.
//! Applies only to user files.
//! Modify the size of file.
//! If the entry is unallocated - allocate it to size
//! ulNewLen (marked invalid).
//! If it is allocated then deallocate it first.
//! To just mark the file as invalid without resizing -
//! set ulNewLen=0.
//!
//*****************************************************************************
extern INT32 nvmem_create_entry(UINT32 file_id, UINT32 newlen);
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __CC3000_NVRAM_H__
|
ac0bf87214356b696699939591039132a358e65b
|
9de0cec678bc4a3bec2b4adabef9f39ff5b4afac
|
/PWGUD/multVScentPbPb/CorrectSpectra.C
|
6dd8b86a121797e128099e3eab41fba0dbfea4c8
|
[] |
permissive
|
alisw/AliPhysics
|
91bf1bd01ab2af656a25ff10b25e618a63667d3e
|
5df28b2b415e78e81273b0d9bf5c1b99feda3348
|
refs/heads/master
| 2023-08-31T20:41:44.927176
| 2023-08-31T14:51:12
| 2023-08-31T14:51:12
| 61,661,378
| 129
| 1,150
|
BSD-3-Clause
| 2023-09-14T18:48:45
| 2016-06-21T19:31:29
|
C++
|
UTF-8
|
C
| false
| false
| 46,378
|
c
|
CorrectSpectra.C
|
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "TList.h"
#include "TFile.h"
#include "TStyle.h"
#include "TH1F.h"
#include "TH2F.h"
#include "THnSparse.h"
#include "TLegend.h"
#include "TSystem.h"
#include "TMath.h"
#include "TCanvas.h"
#include "TLegend.h"
#include "TLatex.h"
#include "TF1.h"
#include "TLine.h"
#include "TPaletteAxis.h"
//
//
#endif
#include "/home/shahoian/ALICE/mymacros/SaveCanvas.h"
const char kHStatName[]="hStat";
double kEps = 1e-6;
//
double kdPhiBgTailMin = 0.1; // lower limit of dphi tail to use for bg normalization
double kdPhiBgTailMax = 0.3; // upper limit of dphi tail to use for bg normalization
//
double kWDistBgTailMin = 5.; // lower limit of wgh.distance tail to use for bg normalization
double kWDistBgTailMax = 25.; // upper limit of wgh.distance tail to use for bg normalization
double kdPhiSgCut = 0.06; // cut in dphi-bent used to extract the signal, extracted from stat histo
double kWDistSgCut = 1.5; // cut in w.distance used to extract the signal, extracted from stat histo
//
enum { kNormShapeDist, // normalize bg tails usig weighted distance shape
kNormShapeDPhi, // normalize bg tails usig dPhi-bend shape
kNormShapes};
enum { kSclWghMean, // normalize bg tails to data using weighted mean of bin-by-bin ratios
kSclIntegral, // normalize bg tails to data using integral
kSclTypes};
// histograms to be used for bg nomalization for each of NormShapes used
const char* kNormShapeH[kNormShapes] = {
"EtaDist", // Weighted distance vs Eta
"EtaDPhiS" // Dphi-bent vs distance
};
const char* figDir = "fig161110";
TString useBgType = "Inj";
Int_t useShapeType = kNormShapeDist; // which distribution to use for bg normalization
Bool_t useMCLB = 0;//kFALSE; // use Comb MC Labels as a template for Bg.
Int_t useScaleType = kSclIntegral;//kSclWghMean; // which type of tails normalization to use
Double_t useEtaCut = 1.; // cut on eta
Double_t useZvMin = -5.; // cut on Z vertex
Double_t useZvMax = 5.; // cut on Z vertex
Int_t useBinGrEta = -1; // for bg fits group eta bins
Int_t useBinGrZv = -1; // for bg fits group Zv bins
enum {kBitNormPerEvent=BIT(14)};
// bins for saved parameters in the hStat histo
enum {kDummyBin,
kEvTot, // events read
kEvProcData, // events with data mult.object (ESD or reco)
kEvProcInj, // events Injected
kEvProcRot, // events Rotated
kEvProcMix, // events Mixed
//
kDPhi, // dphi window
kDTht, // dtheta window
kNStd, // N.standard deviations to keep
kPhiShift, // bending shift
kThtS2, // is dtheta scaled by 1/sin^2
kPhiOvl, // overlap params
kZEtaOvl, // overlap params
kNoOvl, // flag that overlap are suppressed
//
kPhiRot, // rotation phi
kInjScl, // injection scaling
kEtaCut, // eta cut
kZVMin, // min ZVertex to process
kZVMax, // max ZVertex to process
kTrcMin, // min mult to process
kTrcMax, // max mult to process
//
kOneUnit=49, // just 1 to track mergings
kNWorkers=50, // n workers
kNStatBins
};
enum {kSigCorr,kMCPrim,kRawDtCut,kSignalEst,kSignalEstMC,kBgEst,k1MBeta,k1MBetaMC,kAlpha,kAlphaMC,kBgMC,kBgRescFc,kDataDist,kBgDist,kBgMCDist, kNHistos, kMCShift=20};
void CorrectSpectra(const char* flNameData, const char* flNameMC,const char* unique="");
void PrepareHistos(TList* lst, Bool_t isMC, TObjArray* outArray);
void ProcessHistos(TObjArray* outArray);
TH1* NormalizeBg(TH1* dataH, TH1* bgH, double &scl, double &scle);
TObject* FindObject(const char* nameH, const TList* lst, Bool_t normPerEvent=kTRUE);
TList* LoadList(const char* flName, const char* addPref, const char* nameL="clist");
void GetRatE(double x,double xe, double y,double ye, double &rat, double &rate);
Int_t CheckStat(const TList* lst,const char* dtType);
void Integrate(TH1* hist, double xmn,double xmx, double &val, double& err);
void CropHisto(TH1* histo, int b00, int b01, int b10=-1, int b11=-1);
void CropHisto(TH1* histo, double b00, double b01, double b10=-1, double b11=-1);
void GetRealMinMax(TH1* h, double &vmn, double &vmx);
const char* HName(const char* prefix,const char* htype);
void ProjDZE(THnSparseF* hrawd, THnSparseF* hgenb, THnSparseF* hmcComb, TObjArray* res, int bstep0=-1,int bstep1=-1);
void PlotResults();
void PlotDNDEta();
void PlotDist();
void PlotAlphaBeta();
void PlotSpecies();
TList *listDt=0, *listMC=0;
TObjArray resArr;
char outStr[1000];
char outTitle[1000];
TString uniqueName="";
void CorrectSpectra(const char* flNameData, const char* flNameMC, const char* uniqueNm)
{
//
uniqueName = uniqueNm;
listDt = LoadList(flNameData,"dt_");
listMC = LoadList(flNameMC,"mc_");
//
resArr.Clear();
PrepareHistos(listMC, kTRUE, &resArr);
PrepareHistos(listDt, kFALSE, &resArr);
//
ProcessHistos(&resArr);
//
sprintf(outStr,"CutEta%.1f_Zv%.1f_%.1f_bg%s_Shape_%s_mcLB%d_cutSig%.1f_cutBg%.1f",useEtaCut,useZvMin,useZvMax,useBgType.Data(),
useShapeType==kNormShapeDist ? "wdst":"dphi",
useMCLB,
useShapeType==kNormShapeDist ? kWDistSgCut:kdPhiSgCut,
useShapeType==kNormShapeDist ? kWDistBgTailMin:kdPhiBgTailMin);
sprintf(outTitle,"%s, |#eta|<%.1f, %.1f<Z_{V}<%.1f, Bg.:%s, UseMCLB=%d, CutVar:%s, |sig|<%.2f, %.2f<|bg.nrm|<%.2f",
uniqueName.Data(),
useEtaCut,useZvMin,useZvMax,useBgType.Data(),
useMCLB,
useShapeType==kNormShapeDist ? "#Delta":"#Delta#varphi-#delta_{#varphi}",
useShapeType==kNormShapeDist ? kWDistSgCut:kdPhiSgCut,
useShapeType==kNormShapeDist ? kWDistBgTailMin : kdPhiBgTailMin,
useShapeType==kNormShapeDist ? kWDistBgTailMax : kdPhiBgTailMax
);
PlotResults();
}
//_____________________________________________________________________
void PrepareHistos(TList* lst, Bool_t isMC, TObjArray* outArray)
{
// params:
//
int shift = isMC ? kMCShift : 0;
//
const char* xxZvEta;
if (useShapeType==kNormShapeDist) xxZvEta = "DistZvEta";
else xxZvEta = "DistZvDPhiS";
printf("PrepareBg : (%4s) of type %s from %s with shape %d\n",isMC?" MC ":"Data",useBgType.Data(),lst->GetName(),useShapeType);
if (!CheckStat(lst,useBgType.Data())) {printf("Bg of type %s is absent in list %s\n",useBgType.Data(),lst->GetName()); return;}
//
THnSparseF* hD = (THnSparseF*) FindObject(HName("Data",xxZvEta),lst);
THnSparseF* hB = (THnSparseF*) FindObject(HName(useBgType.Data(),xxZvEta),lst);
//
// special feature: use MC Labels bg as a shape instead of generated bg
if (useMCLB/* && !isMC*/) {
TString nm = hB->GetName(); nm += "_MCLB";
TString tit = hB->GetTitle(); tit += "_MCLB";
THnSparseF* hBMCLB = (THnSparseF*) FindObject(HName("Comb",xxZvEta),listMC)->Clone(nm.Data());
hBMCLB->SetTitle(tit.Data());
hB = hBMCLB;
}
THnSparseF* hBmc = 0;
if (isMC) hBmc = (THnSparseF*) FindObject(HName("Comb",xxZvEta),lst);
//
ProjDZE(hD,hB,hBmc, outArray, useBinGrEta, useBinGrZv);
//
if (!isMC) return;
//
// prepare MC primary signal histo
TH2F* mcPrim = (TH2F*)FindObject( "zvEtaPrimMC", lst );
mcPrim = (TH2F*) mcPrim->Clone("mcTrueSignal");
CropHisto(mcPrim,-useEtaCut,useEtaCut,useZvMin,useZvMax);
outArray->AddAtAndExpand(mcPrim, kMCPrim + shift);
//
}
//_____________________________________________________________________
void ProcessHistos(TObjArray* outArray)
{
//
// build alpha matrix
TH2* halp = (TH2*)outArray->At(kMCShift + kMCPrim);
halp = (TH2*) halp->Clone("Alpha");
halp->SetTitle("#alpha");
halp->Divide( (TH2*)outArray->At(kMCShift + k1MBeta) );
halp->Divide( (TH2*)outArray->At(kMCShift + kRawDtCut) );
halp->SetMinimum(1.5);
halp->SetMaximum(4.);
outArray->AddAtAndExpand(halp, kAlpha);
//
// build alpha matrix with MC labels bg
TH2* halpMC = (TH2*)outArray->At(kMCShift + kMCPrim);
halpMC = (TH2*) halpMC->Clone("AlphaMC");
halpMC->SetTitle("#alpha MC labels");
halpMC->Divide( (TH2*)outArray->At(kMCShift + k1MBetaMC) );
halpMC->Divide( (TH2*)outArray->At(kMCShift + kRawDtCut) );
halpMC->SetMinimum(1.5);
halpMC->SetMaximum(4.);
outArray->AddAtAndExpand(halpMC, kAlphaMC);
//
// build corrected signal
TH2* hsigCorr = (TH2*)outArray->At(kSignalEst);
hsigCorr = (TH2*) hsigCorr->Clone("SignalEstCorr");
hsigCorr->SetTitle("Corrected Signal");
hsigCorr->Multiply( halp );
outArray->AddAtAndExpand(hsigCorr, kSigCorr);
//
}
TCanvas *canvFin=0;
TCanvas *canvAlp=0;
TCanvas *canvBet=0;
TCanvas* canvDst=0;
TCanvas* canvSpec=0;
void PlotResults()
{
PlotDist();
PlotAlphaBeta();
PlotSpecies();
PlotDNDEta();
}
void PlotDNDEta()
{
//
TObjArray *res = &resArr;
char buff[1000];
// eta range
double plEta = useEtaCut*1.1;
gStyle->SetOptFit(0);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
double mn = 1e6,mx = -1e6;
canvFin = new TCanvas("canvFin", "canvFin",0,50,700,550);
canvFin->SetLeftMargin(0.15);
// canvFin->ToggleEventStatus();
//
// corrected data
TH1* hsigCorr = ((TH2F*)res->At(kSigCorr))->ProjectionX("DataCorrSignal");
SetHStyle(hsigCorr,kRed,20,1.0);
hsigCorr->GetXaxis()->SetRangeUser(-plEta+kEps,plEta-kEps);
hsigCorr->Scale(1./hsigCorr->GetBinWidth(1));
hsigCorr->Draw();
mx = TMath::Max(mx, hsigCorr->GetMaximum());
mn = TMath::Min(mn, hsigCorr->GetMinimum());
TF1* pl0 = new TF1("pl0","pol0");
pl0->SetParameter(0,hsigCorr->GetMinimum());
hsigCorr->Fit(pl0,"q0","",-0.5,.5);
double fval = pl0->GetParameter(0);
double ferr = pl0->GetParError(0);
char ftres[1000];
sprintf(ftres,"dN/d#eta_{|#eta|<0.5} = %d #pm %d",int(fval),int(ferr));
printf("dN/d#eta_{|#eta|<0.5} = %.2f %.2f\n",fval,ferr);
TLatex *txfit = new TLatex(-0.2,hsigCorr->GetMinimum()*0.9, ftres);
txfit->SetTextSize(0.04);
txfit->Draw();
//
// raw data
TH1* hraw = ((TH2F*)res->At(kRawDtCut))->ProjectionX("DataRaw");
SetHStyle(hraw,kRed,21,1.0);
hraw->GetXaxis()->SetRangeUser(-plEta,plEta);
hraw->Scale(1./hraw->GetBinWidth(1));
hraw->Draw("same");
mn = TMath::Min(mn, hraw->GetMinimum());
mx = TMath::Max(mx, hraw->GetMaximum());
//
// raw data bg sub
TH1* hraws = ((TH2F*)res->At(kSignalEst))->ProjectionX("DataRawSub");
SetHStyle(hraws,kRed,23,1.0);
hraws->GetXaxis()->SetRangeUser(-plEta,plEta);
hraws->Scale(1./hraw->GetBinWidth(1));
hraws->Draw("same");
mn = TMath::Min(mn, hraw->GetMinimum());
mx = TMath::Max(mx, hraw->GetMaximum());
//
// bg
TH1* hbg = ((TH2F*)res->At(kBgEst))->ProjectionX("BgEst");
SetHStyle(hbg,kMagenta,22,1.0);
hbg->GetXaxis()->SetRangeUser(-plEta,plEta);
hbg->Scale(1./hbg->GetBinWidth(1));
hbg->Draw("same");
mn = TMath::Min(mn, hbg->GetMinimum());
mx = TMath::Max(mx, hbg->GetMaximum());
//
// mc part ----------------------------
// raw data
TH1* hrawMC = ((TH2F*)res->At(kRawDtCut+kMCShift))->ProjectionX("DataRawMC");
SetHStyle(hrawMC,kBlue,24,1.0);
hrawMC->GetXaxis()->SetRangeUser(-plEta,plEta);
hrawMC->Scale(1./hrawMC->GetBinWidth(1));
hrawMC->Draw("same");
mn = TMath::Min(mn, hrawMC->GetMinimum());
mx = TMath::Max(mx, hrawMC->GetMaximum());
//
// raw data bg sub
TH1* hrawsMC = ((TH2F*)res->At(kSignalEst+kMCShift))->ProjectionX("DataRawSubMC");
SetHStyle(hrawsMC,kBlue,26,1.0);
hrawsMC->GetXaxis()->SetRangeUser(-plEta,plEta);
hrawsMC->Scale(1./hrawMC->GetBinWidth(1));
hrawsMC->Draw("same");
mn = TMath::Min(mn, hrawMC->GetMinimum());
mx = TMath::Max(mx, hrawMC->GetMaximum());
//
// raw data bgMClabels sub
TH1* hrawsMCLB = ((TH2F*)res->At(kSignalEstMC+kMCShift))->ProjectionX("DataRawSubMCLB");
SetHStyle(hrawsMCLB,kGreen+2,30,1.0);
hrawsMCLB->GetXaxis()->SetRangeUser(-plEta,plEta);
hrawsMCLB->Scale(1./hrawsMCLB->GetBinWidth(1));
hrawsMCLB->Draw("same");
mn = TMath::Min(mn, hrawsMCLB->GetMinimum());
mx = TMath::Max(mx, hrawsMCLB->GetMaximum());
//
// bg est
TH1* hbgMCEst = ((TH2F*)res->At(kBgEst+kMCShift))->ProjectionX("BgEstMC");
SetHStyle(hbgMCEst,kBlue,26,1.0);
hbgMCEst->GetXaxis()->SetRangeUser(-plEta,plEta);
hbgMCEst->Scale(1./hbgMCEst->GetBinWidth(1));
hbgMCEst->Draw("same");
mn = TMath::Min(mn, hbgMCEst->GetMinimum());
mx = TMath::Max(mx, hbgMCEst->GetMaximum());
//
// bg MC
TH1* hbgMC = ((TH2F*)res->At(kBgMC+kMCShift))->ProjectionX("BgMC");
SetHStyle(hbgMC,kGreen+2,25,1.0);
hbgMC->GetXaxis()->SetRangeUser(-plEta,plEta);
hbgMC->Scale(1./hbgMC->GetBinWidth(1));
hbgMC->Draw("same");
mn = TMath::Min(mn, hbgMC->GetMinimum());
mx = TMath::Max(mx, hbgMC->GetMaximum());
//
mn = 0;
hsigCorr->SetMinimum(mn);
hsigCorr->SetMaximum(mx + 0.4*(mx-mn));
gPad->Modified();
//
TLegend *legDnDeta = new TLegend(0.15,0.75, 0.45,0.95);
legDnDeta->SetFillColor(kWhite);
legDnDeta->SetHeader("Data");
legDnDeta->AddEntry(hsigCorr,"Corrected","pl");
legDnDeta->AddEntry(hraw, "Reconstructed","pl");
sprintf(buff,"Reconstructed - Bckg.%s.",useBgType.Data());
legDnDeta->AddEntry(hraws, buff,"pl");
sprintf(buff,"Background %s.",useBgType.Data());
legDnDeta->AddEntry(hbg, buff,"pl");
legDnDeta->Draw();
//
TLegend *legDnDetaMC = new TLegend(0.60,0.72, 0.95,0.95);
legDnDetaMC->SetFillColor(kWhite);
legDnDetaMC->SetHeader("MC");
legDnDetaMC->AddEntry(hrawMC, "Reconstructed","pl");
sprintf(buff,"Reconstructed - Bckg.%s.",useBgType.Data());
legDnDetaMC->AddEntry(hrawsMC, buff,"pl");
sprintf(buff,"Reconstructed - Bckg.%s.","MC.Labels");
legDnDetaMC->AddEntry(hrawsMCLB, buff,"pl");
sprintf(buff,"Background %s.",useBgType.Data());
legDnDetaMC->AddEntry(hbgMCEst, buff,"pl");
sprintf(buff,"Background %s.","MC Labels");
legDnDetaMC->AddEntry(hbgMC, buff,"pl");
legDnDetaMC->Draw();
//
gPad->SetGrid(1.1);
gPad->Modified();
canvFin->cd();
AddLabel(outTitle,0.1,0.97, kBlack,0.025);
sprintf(buff,"%s/%sdNdEta_%s",figDir,uniqueName.Data(),outStr);
SaveCanvas(canvFin,buff,"cg");
//
}
//
void PlotAlphaBeta()
{
char buff[1000];
gStyle->SetOptFit(0);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
TObjArray* res = &resArr;
//------------------------------------------------------
canvBet = new TCanvas("canvBet","canvBet",10,10,1000,400);
canvBet->Divide(3,1,0.01,0.06);
canvBet->cd(1);
TH1* dtBet = (TH1*)res->At(k1MBeta);
TH1* mcBet = (TH1*)res->At(k1MBeta+kMCShift);
TH1* mcBetLB = (TH1*)res->At(k1MBetaMC+kMCShift);
double mn,mx,mnt,mxt;
GetRealMinMax(dtBet,mn,mx);
GetRealMinMax(mcBet,mnt,mxt);
if (mnt<mn) mn = mnt;
if (mxt>mx) mx = mxt;
GetRealMinMax(mcBetLB,mnt,mxt);
if (mnt<mn) mn = mnt;
if (mxt>mx) mx = mxt;
//
dtBet->SetMinimum(mn - 0.05*(mx-mn));
dtBet->SetMaximum(mx + 0.05*(mx-mn));
mcBet->SetMinimum(mn - 0.05*(mx-mn));
mcBet->SetMaximum(mx + 0.05*(mx-mn));
mcBetLB->SetMinimum(mn - 0.05*(mx-mn));
mcBetLB->SetMaximum(mx + 0.05*(mx-mn));
//
canvBet->cd(1);
gPad->SetRightMargin(0.15);
dtBet->Draw("colz");
AddLabel("#beta Data",0.2,0.95,kBlack,0.05);
gPad->Modified();
dtBet->GetYaxis()->SetTitleOffset(1.4);
TPaletteAxis *p = (TPaletteAxis*)dtBet->FindObject("palette");
if (p) p->SetX1NDC(0.85);
canvBet->cd(2);
gPad->SetRightMargin(0.15);
mcBet->Draw("colz");
AddLabel("#beta MC (bckg.estimated)",0.2,0.95,kBlack,0.05);
gPad->Modified();
mcBet->GetYaxis()->SetTitleOffset(1.4);
p = (TPaletteAxis*)mcBet->FindObject("palette");
if (p) p->SetX1NDC(0.85);
canvBet->cd(3);
gPad->SetRightMargin(0.15);
mcBetLB->Draw("colz");
AddLabel("#beta MC (bckg.from MC labels)",0.2,0.95,kBlack,0.05);
gPad->Modified();
mcBetLB->GetYaxis()->SetTitleOffset(1.4);
p = (TPaletteAxis*)mcBetLB->FindObject("palette");
if (p) p->SetX1NDC(0.85);
//
canvBet->cd();
AddLabel(outTitle,0.1,0.97, kBlack, 0.025);
//
sprintf(buff,"%s/%sBeta_%s",figDir,uniqueName.Data(),outStr);
SaveCanvas(canvBet,buff,"cg");
//------------------------------------------------------
canvAlp = new TCanvas("canvAlp","canvAlp",10,10,900,400);
canvAlp->Divide(2,1,0.01,0.06);
canvAlp->cd(1);
TH1* dtAlp = (TH1*)res->At(kAlpha);
TH1* mcAlp = (TH1*)res->At(kAlphaMC);
GetRealMinMax(dtAlp,mn,mx);
GetRealMinMax(mcAlp,mnt,mxt);
if (mnt<mn) mn = mnt;
if (mxt>mx) mx = mxt;
dtAlp->SetMinimum(mn - 0.05*(mx-mn));
dtAlp->SetMaximum(mx + 0.05*(mx-mn));
mcAlp->SetMinimum(mn - 0.05*(mx-mn));
mcAlp->SetMaximum(mx + 0.05*(mx-mn));
//
canvAlp->cd(1);
gPad->SetRightMargin(0.15);
dtAlp->Draw("colz");
AddLabel("#alpha (bckg.estimated)",0.2,0.95,kBlack,0.05);
gPad->Modified();
dtAlp->GetYaxis()->SetTitleOffset(1.4);
TPaletteAxis *pa = (TPaletteAxis*)dtBet->FindObject("palette");
if (pa) pa->SetX1NDC(0.85);
canvAlp->cd(2);
gPad->SetRightMargin(0.15);
mcAlp->Draw("colz");
AddLabel("#alpha (bckg.from MC labels)",0.2,0.95,kBlack,0.05);
gPad->Modified();
mcAlp->GetYaxis()->SetTitleOffset(1.4);
pa = (TPaletteAxis*)mcBet->FindObject("palette");
if (pa) pa->SetX1NDC(0.85);
gPad->Modified();
canvAlp->cd();
AddLabel(outTitle,0.1,0.97, kBlack, 0.025);
//
sprintf(buff,"%s/%sAlpha_%s",figDir,uniqueName.Data(),outStr);
SaveCanvas(canvAlp,buff,"cg");
}
void PlotSpecies()
{
char buff[1000];
gStyle->SetOptFit(0);
gStyle->SetOptStat(0);
gStyle->SetOptTitle(0);
//------------------------------------------------------
TH2F* hSpecPrim = (TH2F*)FindObject( "pdgPrim", listMC,kFALSE);
TH2F* hSpecSec = (TH2F*)FindObject( "pdgSec", listMC,kFALSE);
TH2F* hSpecPrimP = (TH2F*)FindObject( "pdgPrimPar", listMC,kFALSE);
TH2F* hSpecSecP = (TH2F*)FindObject( "pdgSecPar", listMC,kFALSE);
int nbd = hSpecPrim->GetXaxis()->GetNbins();
//
TH1* hSpecPrimAll = hSpecPrim->ProjectionX("specPrimAll",1,nbd+1,"e");
hSpecPrimAll->Scale(100./hSpecPrimAll->Integral());
hSpecPrimAll->GetYaxis()->SetTitle("Fraction,%");
hSpecPrimAll->GetXaxis()->SetLabelSize(0.06);
hSpecPrimAll->GetXaxis()->LabelsOption("v");
//
TH1* hSpecSecAll = hSpecSec->ProjectionX("specSecAll",1,nbd+1,"e");
hSpecSecAll->Scale(100./hSpecSecAll->Integral());
hSpecSecAll->GetYaxis()->SetTitle("Fraction,%");
hSpecSecAll->GetXaxis()->SetLabelSize(0.05);
//
TH1* hSpecPrimPAll = hSpecPrimP->ProjectionX("specPrimPAll",1,nbd+1,"e");
hSpecPrimPAll->Scale(100./hSpecPrimPAll->Integral());
hSpecPrimPAll->GetYaxis()->SetTitle("Fraction,%");
hSpecPrimPAll->GetXaxis()->SetLabelSize(0.06);
hSpecPrimPAll->GetXaxis()->LabelsOption("v");
//
TH1* hSpecSecPAll = hSpecSecP->ProjectionX("specSecPAll",1,nbd+1,"e");
hSpecSecPAll->Scale(100./hSpecSecPAll->Integral());
hSpecSecPAll->GetYaxis()->SetTitle("Fraction,%");
hSpecSecPAll->GetXaxis()->SetLabelSize(0.05);
//
int binCut = hSpecPrim->GetXaxis()->FindBin(kWDistSgCut-kEps);
TH1* hSpecPrimSel = hSpecPrim->ProjectionX("specPrimSel",1,binCut,"e");
hSpecPrimSel->Scale(100./hSpecPrimSel->Integral());
hSpecPrimSel->GetYaxis()->SetTitle("Fraction,%");
hSpecPrimSel->GetXaxis()->SetLabelSize(0.05);
//
TH1* hSpecSecSel = hSpecSec->ProjectionX("specSecSel",1,binCut,"e");
hSpecSecSel->Scale(100./hSpecSecSel->Integral());
hSpecSecSel->GetYaxis()->SetTitle("Fraction,%");
hSpecSecSel->GetXaxis()->SetLabelSize(0.05);
//
TH1* hSpecPrimPSel = hSpecPrimP->ProjectionX("specPrimPSel",1,binCut,"e");
hSpecPrimPSel->Scale(100./hSpecPrimPSel->Integral());
hSpecPrimPSel->GetYaxis()->SetTitle("Fraction,%");
hSpecPrimPSel->GetXaxis()->SetLabelSize(0.05);
//
TH1* hSpecSecPSel = hSpecSecP->ProjectionX("specSecPSel",1,binCut,"e");
hSpecSecPSel->Scale(100./hSpecSecPSel->Integral());
hSpecSecPSel->GetYaxis()->SetTitle("Fraction,%");
hSpecSecPSel->GetXaxis()->SetLabelSize(0.05);
canvSpec = new TCanvas("canvSpec","canvSpec",10,10,1100,800);
canvSpec->Divide(1,2,0.01,0.01);
canvSpec->cd(1);
hSpecPrimAll->Draw();
SetHStyle(hSpecPrimAll,kBlue,25,1.1);
hSpecPrimSel->Draw("same");
SetHStyle(hSpecPrimSel,kRed,20,1);
//
hSpecSecAll->Draw("same");
SetHStyle(hSpecSecAll,kGreen,32,1.1);
hSpecSecSel->Draw("same");
SetHStyle(hSpecSecSel,kBlack,22,1);
//
TLegend *legPart = new TLegend(0.8,0.72, 0.999,0.999);
legPart->SetFillColor(kWhite);
legPart->SetHeader("Tracklet PDG");
//
legPart->AddEntry(hSpecPrimAll, "Prim., before #Delta cut","pl");
legPart->AddEntry(hSpecPrimSel, "Prim., after #Delta cut","pl");
legPart->AddEntry(hSpecSecAll, "Sec., before #Delta cut","pl");
legPart->AddEntry(hSpecSecSel, "Sec., after #Delta cut","pl");
//
legPart->Draw();
gPad->SetLogy();
gPad->SetGrid(1,1);
gPad->Modified();
//
canvSpec->cd(2);
hSpecPrimPAll->Draw();
SetHStyle(hSpecPrimPAll,kBlue,25,1.1);
hSpecPrimPSel->Draw("same");
SetHStyle(hSpecPrimPSel,kRed,20,1);
//
hSpecSecPAll->Draw("same");
SetHStyle(hSpecSecPAll,kGreen,32,1.1);
hSpecSecPSel->Draw("same");
SetHStyle(hSpecSecPSel,kBlack,22,1);
//
TLegend *legPartP = new TLegend(0.8,0.72, 0.999,0.999);
legPartP->SetFillColor(kWhite);
legPartP->SetHeader("Tracklet Parents PDG");
//
legPartP->AddEntry(hSpecPrimPAll, "Prim., before #Delta cut","pl");
legPartP->AddEntry(hSpecPrimPSel, "Prim., after #Delta cut","pl");
legPartP->AddEntry(hSpecSecPAll, "Sec., before #Delta cut","pl");
legPartP->AddEntry(hSpecSecPSel, "Sec., after #Delta cut","pl");
//
legPartP->Draw();
gPad->SetLogy();
gPad->SetGrid(1,1);
gPad->Modified();
//
canvSpec->cd(1);
AddLabel(outTitle,0.1,0.97, kBlack, 0.025);
canvSpec->cd();
//
sprintf(buff,"%s/%sSpecies_%s",figDir,uniqueName.Data(),outStr);
SaveCanvas(canvSpec,buff,"cg");
}
void PlotDist()
{
TObjArray* res = &resArr;
char buff[1000];
canvDst = new TCanvas("canvDst","canvDst",10,10,700,500);
TH1* mcdst = (TH1*)res->At(kDataDist+kMCShift);
TH1* mcdstbg = (TH1*)res->At(kBgDist+kMCShift);
TH1* mcdstbgLB = (TH1*)res->At(kBgMCDist+kMCShift);
TH1* dtdst = (TH1*)res->At(kDataDist);
TH1* dtdstbg = (TH1*)res->At(kBgDist);
//
TH2* mcDstZN = (TH2*)FindObject(useShapeType==kNormShapeDist ? "TrData_ZvDist":"TrData_ZvDPhiS", listMC );
TH2* mcDstZSec = (TH2*)FindObject(useShapeType==kNormShapeDist ? "TrSec_ZvDist":"TrSec_ZvDPhiS", listMC );
TH2* mcDstZCombU = (TH2*)FindObject(useShapeType==kNormShapeDist ? "TrCombU_ZvDist":"TrCombU_ZvDPhiS", listMC );
TH2* mcDstZCombC = (TH2*)FindObject(useShapeType==kNormShapeDist ? "TrComb_ZvDist":"TrComb_ZvDPhiS", listMC );
//
mcDstZN->GetXaxis()->SetRangeUser(useZvMin+kEps,useZvMax-kEps);
mcDstZSec->GetXaxis()->SetRangeUser(useZvMin+kEps,useZvMax-kEps);
mcDstZCombU->GetXaxis()->SetRangeUser(useZvMin+kEps,useZvMax-kEps);
mcDstZCombC->GetXaxis()->SetRangeUser(useZvMin+kEps,useZvMax-kEps);
//
TH1* mcDstN = mcDstZN->ProjectionY("mcDstN");
TH1* mcDstSec = mcDstZSec->ProjectionY("mcDstSec");
TH1* mcDstCombU = mcDstZCombU->ProjectionY("mcDstCombU");
TH1* mcDstCombC = mcDstZCombC->ProjectionY("mcDstCombC");
//
double scl,sclE;
mcDstN = NormalizeBg(mcdst,mcDstN,scl,sclE);
mcDstSec->Scale(scl);
mcDstCombU->Scale(scl);
mcDstCombC->Scale(scl);
mcDstCombC->Add(mcDstCombU,-1);
//
dtdst->Draw("");
gPad->Modified();
dtdst->GetXaxis()->SetLabelSize(0.03);
dtdst->GetXaxis()->SetTitleSize(0.03);
dtdst->GetXaxis()->SetTitleOffset(2);
dtdstbg->Draw("same");
mcdst->Draw("same");
mcDstSec->Draw("same");
mcdstbgLB->Draw("same");
mcdstbg->Draw("same");
mcDstCombC->Draw("same");
//
SetHStyle(mcdst,kBlue, 25,0.7);
SetHStyle(mcdstbgLB,kGreen, 7/*32*/,0.5);
SetHStyle(mcdstbg,kCyan, 7/*26*/,0.5);
SetHStyle(mcDstCombC,kGreen+2, 21,0.7);
SetHStyle(mcDstSec,kBlue+2, 22,0.7);
//
SetHStyle(dtdst,kRed, 20,0.7);
SetHStyle(dtdstbg,kBlue, 34,0.7);
//
double vmcTot,vmcTotE;
double vmcSec,vmcSecE, ratSec,ratSecE;
double vmcCmbEst,vmcCmbEstE, ratCmbEst,ratCmbEstE;
double vmcCmb,vmcCmbE, ratCmb,ratCmbE;
double vmcCmbC,vmcCmbCE, ratCmbC,ratCmbCE;
double cutSgMin,cutSgMax;
double cutBgMin,cutBgMax;
if (useShapeType==kNormShapeDist) {
cutSgMin = 0;
cutSgMax = kWDistSgCut;
cutBgMin = kWDistBgTailMin;
cutBgMax = kWDistBgTailMax;
}
else {
cutSgMin = 0;
cutSgMax = kdPhiSgCut;
cutBgMin = kdPhiBgTailMin;
cutBgMax = kdPhiBgTailMax;
}
Integrate(mcdst, cutSgMin,cutSgMax, vmcTot,vmcTotE);
Integrate(mcDstSec, cutSgMin,cutSgMax, vmcSec,vmcSecE);
GetRatE(vmcSec,vmcSecE, vmcTot,vmcTotE, ratSec,ratSecE);
//
Integrate(mcdstbgLB, cutSgMin,cutSgMax, vmcCmb,vmcCmbE);
GetRatE(vmcCmb,vmcCmbE, vmcTot,vmcTotE, ratCmb,ratCmbE);
//
Integrate(mcdstbg, cutSgMin,cutSgMax, vmcCmbEst,vmcCmbEstE);
GetRatE(vmcCmbEst,vmcCmbEstE, vmcTot,vmcTotE, ratCmbEst,ratCmbEstE);
//
Integrate(mcDstCombC, cutSgMin,cutSgMax, vmcCmbC,vmcCmbCE);
GetRatE(vmcCmbC,vmcCmbCE, vmcTot,vmcTotE, ratCmbC,ratCmbCE);
//
double vdtTot,vdtTotE;
double vdtBg,vdtBgE, ratdtBg,ratdtBgE;
//
Integrate(dtdst, cutSgMin,cutSgMax, vdtTot,vdtTotE);
Integrate(dtdstbg, cutSgMin,cutSgMax, vdtBg,vdtBgE);
GetRatE( vdtBg,vdtBgE, vdtTot,vdtTotE, ratdtBg,ratdtBgE);
//
//
double dmn = mcdst->GetMinimum();
double dmx = mcdst->GetMaximum();
TLine *ln = new TLine(cutSgMax, dmn, cutSgMax, dmx);
ln->SetLineColor(kBlack);
ln->Draw();
TLine *lnc = new TLine(cutBgMin, dmn, cutBgMin, dmx);
lnc->SetLineColor(kRed);
lnc->Draw();
if (useShapeType==kNormShapeDPhi) {
ln = new TLine(-cutSgMax, dmn, -cutSgMax, dmx);
ln->SetLineColor(kBlack);
ln->Draw();
//
lnc = new TLine(-cutBgMin, dmn, -cutBgMin, dmx);
lnc->SetLineColor(kRed);
lnc->Draw();
}
//
TLegend *legDstMC1 = new TLegend(0.60,0.72, 0.95,0.95);
legDstMC1->SetFillColor(kWhite);
//
legDstMC1->AddEntry(dtdst, "Data raw","pl");
sprintf(buff,"Data Comb. %s. : %.1f%%",useBgType.Data(),ratdtBg*100);
legDstMC1->AddEntry(dtdstbg, buff,"pl");
//
legDstMC1->AddEntry(mcdst, "MC raw","pl");
sprintf(buff,"MC Comb. %s. : %.1f%%",useBgType.Data(),ratCmbEst*100);
legDstMC1->AddEntry(mcdstbg, buff,"pl");
//
sprintf(buff,"MC Comb. %s. : %.1f%%","MC Lbl.",ratCmb*100);
legDstMC1->AddEntry(mcdstbgLB, buff,"pl");
sprintf(buff,"MC Comb.Uncorr %s. : %.1f%%","MC Lbl.",ratCmbC*100);
legDstMC1->AddEntry(mcDstCombC, buff,"pl");
sprintf(buff,"MC Sec. : %.1f%%",ratSec*100);
legDstMC1->AddEntry(mcDstSec, buff,"pl");
legDstMC1->Draw();
if (useShapeType==kNormShapeDist) gPad->SetLogx();
gPad->SetLogy();
gPad->SetGrid(1,1);
gPad->Modified();
//
canvDst->cd();
AddLabel(outTitle,0.1,0.97, kBlack, 0.025);
//
sprintf(buff,"%s/%sDst_%s",figDir,uniqueName.Data(),outStr);
SaveCanvas(canvDst,buff,"cg");
//
}
//______________________________________________________________________
void CropHisto(TH1* histo, int bx0, int bx1, int by0, int by1)
{
// fill 0 to all bins outside defined range
TAxis *xax = histo->GetXaxis();
int nbx = xax->GetNbins();
double vmn=1e16,vmx=-1e16;
if (histo->InheritsFrom(TH2::Class())) {
TAxis *yax = histo->GetYaxis();
int nby = yax->GetNbins();
for (int ix=nbx+2;ix--;) {
for (int iy=nby+2;iy--;) {
if ((ix<bx0||ix>bx1)||(iy<by0||iy>by1)) {
histo->SetBinContent(ix,iy,0);
histo->SetBinError(ix,iy,0);
}
else {
double vl = histo->GetBinContent(ix,iy);
if (vl<vmn) vmn = vl;
if (vl>vmx) vmx = vl;
}
}
}
}
else {
for (int ix=nbx+2;ix--;) {
if ((ix<bx0||ix>bx1)) {
histo->SetBinContent(ix,0);
histo->SetBinError(ix,0);
}
else {
double vl = histo->GetBinContent(ix);
if (vl<vmn) vmn = vl;
if (vl>vmx) vmx = vl;
}
}
}
//
if (vmn==vmx) {
vmn = 0.95*vmn;
vmx = 1.05*vmx;
}
histo->SetMaximum(vmx);
histo->SetMinimum(vmn);
}
//______________________________________________________________________
void CropHisto(TH1* histo, double vx0, double vx1, double vy0, double vy1)
{
// fill 0 to all bins outside defined range
TAxis *xax = histo->GetXaxis();
int bx0,bx1,by0=-1,by1=-1;
bx0 = xax->FindBin(vx0+kEps);
bx1 = xax->FindBin(vx1-kEps);
if (histo->InheritsFrom(TH2::Class())) {
TAxis *yax = histo->GetYaxis();
by0 = yax->FindBin(vy0+kEps);
by1 = yax->FindBin(vy1-kEps);
}
CropHisto(histo,bx0,bx1,by0,by1);
}
//______________________________________________________________________
TH1* NormalizeBg(TH1* dataH, TH1* bgH, double &scl, double &sclE)
{
// match generated bg and data tails, calculate normalization, return normalized bg copy
//
TAxis* xax = dataH->GetXaxis();
int nbtot = xax->GetNbins();
int bgBins[2][2] = {{0}}; // limiting bins for tails integration
Int_t ntails; // 0 for dphi plot, 1 for weighted dist plot
if (useShapeType == kNormShapeDist) { // only positive tail
bgBins[0][0] = xax->FindBin(kWDistBgTailMin+kEps); // positive tail min bin
bgBins[0][1] = xax->FindBin(kWDistBgTailMax-kEps); // positive tail max bin
ntails = 1;
}
else if (useShapeType == kNormShapeDPhi) { // both tails
bgBins[0][0] = xax->FindBin( kdPhiBgTailMin+kEps); // positive tail min bin
bgBins[0][1] = xax->FindBin( kdPhiBgTailMax-kEps); // positive tail max bin
bgBins[1][0] = xax->FindBin(-kdPhiBgTailMax+kEps); // negative tail min bin
bgBins[1][1] = xax->FindBin(-kdPhiBgTailMin-kEps); // positive tail max bin
ntails = 2;
}
else {printf("NormalizeBg: unknown shape type %d\n",useShapeType);exit(1);}
printf("NormalizeBg: bins for tails: right: %d:%d / left: %d:%d\n",bgBins[0][0],bgBins[0][1],bgBins[1][0],bgBins[1][1]);
//
double meanR=0,meanRE=0,meanRE2=0;
double meanD=0,meanDE2=0;
double meanB=0,meanBE2=0;
double meanRI=0,meanRIE=0;
for (int itp=0;itp<=ntails;itp++) {
for (int ib=bgBins[itp][0];ib<=bgBins[itp][1];ib++) {
if (ib<1||ib>nbtot) continue;
double vD = dataH->GetBinContent(ib);
double vB = bgH->GetBinContent(ib);
double eD = dataH->GetBinError(ib);
double eB = bgH->GetBinError(ib);
meanD += vD; meanDE2 += eD*eD;
meanB += vB; meanBE2 += eB*eB;
if (vD<=0 || vB<=0 || eD<=0 || eB<=0) continue;
double rat = vD/vB;
double ratE2 = rat*rat*(eD*eD/vD/vD + eB*eB/vB/vB);
meanR += rat/ratE2; meanRE2 += 1.0/ratE2;
}
}
//
if (meanRE2>0) {
meanR /= meanRE2;
meanRE2 = 1./meanRE2;
meanRE = TMath::Sqrt(meanRE2);
}
if (meanDE2>0 && meanBE2>0) {
meanRI = meanD/meanB;
meanRIE = meanRI*TMath::Sqrt(meanDE2/meanD/meanD + meanBE2/meanB/meanB);
}
printf("NormalizeBg: Tails scaling %s wrt %s: Wgh.Mean:%.4f(%.4f) / Integral:%.4f(%.4f)\n",
bgH->GetName(),dataH->GetName(), meanR,meanRE, meanRI,meanRIE);
printf("NormalizeBg: Select scaling type %s\n",useScaleType==kSclWghMean ? "Wgh.Mean":"Integral");
//
scl = useScaleType==kSclWghMean ? meanR : meanRI;
sclE = useScaleType==kSclWghMean ? meanRE : meanRIE;
//
// rescaled bg
char buff[1000];
sprintf(buff,"%s_bgNorm",bgH->GetName());
bgH = (TH1*)bgH->Clone(buff);
sprintf(buff,"%s bgNorm%d %.4f+-%.4f",bgH->GetName(),useScaleType,scl,sclE);
TH1* dumH = (TH1*)bgH->Clone("dummySCL$"); dumH->Reset();
for (int i=1;i<=nbtot;i++) {
dumH->SetBinContent(i,scl);
dumH->SetBinError(i,sclE);
}
bgH->Multiply(dumH);
delete dumH;
return bgH;
}
//______________________________________________________________________
TObject* FindObject(const char* nameH, const TList* lst, Bool_t normPerEvent)
{
// get histo, optionally normalizing it per processed event
if (!lst) {printf("FindObject %s: No list provided\n",nameH); exit(1);}
int nent = lst->GetEntries();
TString nm;
TObject *hst = 0;
for (int i=nent;i--;) {
nm = lst->At(i)->GetName();
if (nm.EndsWith(nameH)) {hst = lst->At(i); break;}
}
if (!hst) {printf("FindObject: No %s histo in list %s\n",nameH,lst->GetName()); exit(1);}
if (!normPerEvent || hst->TestBit(kBitNormPerEvent)) return hst; // already normalized
TString nameHS = nameH;
if (nameHS==kHStatName) return hst; // never scale stat. histo
//
TH1* hstat = (TH1*)FindObject(kHStatName,lst,kFALSE);
double nrm = hstat->GetBinContent(kEvProcData);
if (nrm<1) {printf("FindObject: Anomaluous %d number of events processed in list %p\n",int(nrm),lst); exit(1);}
//
// account for eventual cut in Z
TH1* hzv = (TH1*)FindObject("zv",lst,kFALSE);
int nbz = hzv->GetNbinsX();
double zvTot = hzv->Integral(1,nbz);
int zb0 = hzv->FindBin( useZvMin+kEps); if (zb0<1) zb0 = 1;
int zb1 = hzv->FindBin( useZvMax-kEps); if (zb1>nbz) zb1 = nbz;
double zvSel = hzv->Integral(zb0,zb1);
if (zvTot<1 || zvSel<1) {printf("No statistics: NzvTot: %.1f NzvSel:%.f\n",zvTot,zvSel); return 0;}
else printf("%f fraction of selected events is used with current Zv cut %.1f:%.1f\n",zvSel/zvTot,useZvMin,useZvMax);
nrm *= zvSel/zvTot;
//
if (hst->InheritsFrom(TH1::Class())) ((TH1*)hst)->Scale(1./nrm);
else if (hst->InheritsFrom(THnSparse::Class())) {
THnSparse* spr = (THnSparse*) hst;
spr->Sumw2();
int coord[3] = {0,0,0};
for (Long64_t i = 0; i < spr->GetNbins(); ++i) {
// Get the content of the bin from the current histogram
Double_t v = spr->GetBinContent(i, coord);
spr->SetBinContent(coord, v/nrm);
spr->SetBinError(coord,TMath::Sqrt(v)/nrm);
}
}
//
hst->SetBit(kBitNormPerEvent);
return hst;
}
//______________________________________________________________________
TList* LoadList(const char* flName, const char* addPref, const char* nameL)
{
// load list with histos
TString nms = flName;
gSystem->ExpandPathName(nms);
TFile* fl = TFile::Open(nms.Data());
if (!fl) {printf("LoadList: No file %s\n",nms.Data()); exit(1);}
TList* lst = (TList*)fl->Get(nameL);
if (!lst) {printf("LoadList: No list %s in file %s\n",nameL,nms.Data()); exit(1);}
lst->SetName(flName);
//
int nEnt = lst->GetSize();
TString nm;
for (int i=0;i<nEnt;i++) {
TNamed* ob = (TNamed*)lst->At(i);
nm = addPref;
nm += ob->GetName();
ob->SetName(nm.Data());
}
//
return lst;
}
//____________________________________________________________________________
void GetRatE(double x,double xe, double y,double ye, double &rat, double &rate)
{
rat = 0; rate = 0;
if (TMath::Abs(y)<1e-16 || TMath::Abs(x)<1e-16) return;
rat = x/y;
rate = rat*TMath::Sqrt( xe*xe/(x*x) + ye*ye/(y*y));
}
//____________________________________________________________________________
void Integrate(TH1* hist, double xmn,double xmx, double &val, double& err)
{
// integrate 1d histo within given limits
TAxis* xax = hist->GetXaxis();
int bmn = xax->FindBin(xmn+kEps); if (bmn<1) bmn = 0; // include
int bmx = xax->FindBin(xmx-kEps);
val = hist->IntegralAndError(bmn,bmx,err);
// is this histo with symmetric axis ? then integrate also negative half axis
if (TMath::Abs( xax->GetXmin() + xax->GetXmax() )<1e-6) {
bmn = xax->FindBin(-xmx+kEps);
bmx = xax->FindBin(-xmn-kEps);
double errn;
val += hist->IntegralAndError(bmn,bmx,errn);
err = TMath::Sqrt(err*err + errn*errn);
}
}
//____________________________________________________________________________
const char* HName(const char* prefix,const char* htype)
{
// compose the name of histo in the clist
static TString strh;
strh = "Tr"; strh += prefix; strh += "_"; strh += htype;
return strh.Data();
}
//____________________________________________________________________________
Int_t CheckStat(const TList* lst, const char* dtType)
{
// check if needed bg was generated
TH1* hstat = (TH1*)FindObject(kHStatName,lst);
TString dts = dtType;
if (dts=="Data") return int( hstat->GetBinContent(kEvProcData) );
if (dts=="Mix") return int( hstat->GetBinContent(kEvProcMix) );
if (dts=="Inj") return int( hstat->GetBinContent(kEvProcInj) );
if (dts=="Rot") return int( hstat->GetBinContent(kEvProcRot) );
printf("Unknown process %s statistics is checked. Alowed: Data,Mix,Inj,Rot",dtType);
return 0;
}
//____________________________________________________________________________
void ProjDZE(THnSparseF* hrawd, THnSparseF* hgenb, THnSparseF* hmcComb, TObjArray* res, int bStepEta,int bStepZv)
{
// project 3d histo of Dist vs Zv vs Eta to Zv vs Eta with all cuts
int shift = hmcComb ? kMCShift : 0; // is this mc?
//
// determine boundaries for zv and eta cuts
//
double cutDstMin,cutDstMax;
double cutBgMin,cutBgMax;
double cutSgMin,cutSgMax;
if (useShapeType==kNormShapeDist) {
cutDstMin = 0;
cutDstMax = kWDistBgTailMax;
//
cutBgMin = kWDistBgTailMin;
cutBgMax = kWDistBgTailMax;
//
cutSgMin = 0;
cutSgMax = kWDistSgCut;
}
else {
cutDstMin = -kdPhiBgTailMax;
cutDstMax = kdPhiBgTailMax;
//
cutBgMin = kdPhiBgTailMin;
cutBgMax = kdPhiBgTailMax;
//
cutSgMin = 0;
cutSgMax = kdPhiSgCut;
}
//
int bn0[3] = {0}; // 1st bin to count
int bn1[3] = {0}; // last bin to count
// eta
TAxis* axEta = hrawd->GetAxis(0);
bn0[0] = axEta->FindBin(-useEtaCut+kEps);
bn1[0] = axEta->FindBin( useEtaCut-kEps);
// Zv
TAxis* axZv = hrawd->GetAxis(1);
bn0[1] = axZv->FindBin( useZvMin+kEps);
bn1[1] = axZv->FindBin( useZvMax-kEps);
// W.dist
TAxis* axDst = hrawd->GetAxis(2);
bn0[2] = axDst->FindBin( cutDstMin + kEps);
bn1[2] = axDst->FindBin( cutDstMax - kEps);
//
//
int nb[3] = { bn1[0]-bn0[0]+1, bn1[1]-bn0[1]+1, bn1[2]-bn0[2]+1}; // number of bins to count
int nbTot[3] = {axEta->GetNbins(), axZv->GetNbins(), axDst->GetNbins() }; // total bins
//
if (bStepEta<1 || bStepEta>nb[0]) bStepEta = nb[0];
if (bStepZv<1 || bStepEta>nb[1]) bStepZv = nb[1];
//
for (int i=3;i--;) { // set default axis range
hrawd->GetAxis(i)->SetRange(1,nbTot[i]);
hgenb->GetAxis(i)->SetRange(1,nbTot[i]);
if (hmcComb) hmcComb->GetAxis(i)->SetRange(1,nbTot[i]);
}
//
char grpTit[100];
sprintf(grpTit,"grp_eta%d_zv%d",bStepEta,bStepZv);
//
TString pref = hmcComb ? "mc" : "dt";
//
// "Data" histo with cut on tails where we look for signal
hrawd->GetAxis(2)->SetRangeUser(cutDstMin+kEps,cutDstMax-kEps);
TH2* hRawDtCut = hrawd->Projection(1,0,"e");
hrawd->GetAxis(2)->SetRange(bn0[2],bn1[2]);
hRawDtCut->SetName(pref+"_RawWithCut");
hRawDtCut->SetTitle(pref+" Raw with cut on tracklets");
res->AddAtAndExpand(hRawDtCut, kRawDtCut+shift);
//
// "Data - Est.Bg" histo with cut on tails where we look for signal
hrawd->GetAxis(2)->SetRangeUser(cutDstMin+kEps,cutDstMax-kEps);
TH2* hSignalEst = hrawd->Projection(1,0,"e");
hrawd->GetAxis(2)->SetRange(bn0[2],bn1[2]);
hSignalEst->SetName(pref+"_SignalCut_"+grpTit);
hSignalEst->SetTitle(pref+" Signal (raw-bg) with cut on tracklets "+grpTit);
res->AddAtAndExpand(hSignalEst, kSignalEst+shift);
//
// "Data - MC.Bg" histo with cut on tails where we look for signal
TH2* hSignalEstMC = 0;
if (hmcComb) {
hrawd->GetAxis(2)->SetRangeUser(cutDstMin+kEps,cutDstMax-kEps);
hSignalEstMC = hrawd->Projection(1,0,"e");
hrawd->GetAxis(2)->SetRange(bn0[2],bn1[2]);
hSignalEstMC->SetName(pref+"_SignalCut_bgMCLabels_"+grpTit);
hSignalEstMC->SetTitle(pref+" Signal (raw-bg_MCLabels) with cut on tracklets "+grpTit);
res->AddAtAndExpand(hSignalEstMC, kSignalEstMC+shift);
}
//
// Estimated background in the cut range
hgenb->GetAxis(2)->SetRangeUser(cutDstMin+kEps,cutDstMax-kEps);
TH2* hBgEst = hgenb->Projection(1,0,"e");
hgenb->GetAxis(2)->SetRange(bn0[2],bn1[2]);
hBgEst->SetName(pref+"_BgEst_"+grpTit);
hBgEst->SetTitle(pref+" Estimated Bg "+grpTit);
res->AddAtAndExpand(hBgEst, kBgEst+shift);
//
// 1-beta for "data" = (Data_cut - Bg_cut) / Data_cut
TH2* h1mBeta = hrawd->Projection(1,0,"e");
h1mBeta->Reset();
h1mBeta->SetName(pref+"_h1mBeta_"+grpTit);
h1mBeta->SetTitle(pref+" 1-#beta with gen.bg. "+grpTit);
res->AddAtAndExpand(h1mBeta, k1MBeta+shift);
//
// If MC labels info is provided
TH2* h1mBetaMC = 0; // 1-beta for MC with bg from labels
TH2* hBgMC = 0; // bg from MC labels
if (hmcComb) {
hmcComb->GetAxis(2)->SetRangeUser(cutDstMin+kEps,cutDstMax-kEps);
h1mBetaMC = hmcComb->Projection(1,0,"e");
h1mBetaMC->SetName(pref+"_h1mBetaMC");
h1mBetaMC->SetTitle(pref+" 1-#beta with bg. from MC labels");
h1mBetaMC->Divide(hRawDtCut);
res->AddAtAndExpand(h1mBetaMC, k1MBetaMC+shift);
for (int ib0=1;ib0<=nbTot[0];ib0++)
for (int ib1=1;ib1<=nbTot[1];ib1++)
h1mBetaMC->SetBinContent(ib0,ib1, 1.- h1mBetaMC->GetBinContent(ib0,ib1));
//
hBgMC = hmcComb->Projection(1,0,"e");
hBgMC->SetName(pref+"_Bg_MClab");
hBgMC->SetTitle(pref+" Bg from MC labels");
res->AddAtAndExpand(hBgMC, kBgMC+shift);
//
// finalize estimated signal with bg from MC labels
hSignalEstMC->Add(hBgMC,-1);
//
hmcComb->GetAxis(2)->SetRange(bn0[2],bn1[2]);
}
//
// rescaling factors for generated bg
TH2* hBgRescFc = hrawd->Projection(1,0,"e"); hBgRescFc->Reset();
hBgRescFc->SetName(pref+"_hBgRescFactors_"+grpTit);
hBgRescFc->SetTitle(pref+" Scale.factor for gen.bg. "+grpTit);
res->AddAtAndExpand(hBgRescFc, kBgRescFc+shift);
//
int nbint = bStepEta*bStepZv;
float nbinstsq = TMath::Sqrt(nbint);
hrawd->GetAxis(0)->SetRange(bn0[0],bn1[0]);
hrawd->GetAxis(1)->SetRange(bn0[1],bn1[1]);
TH1* hDstDt = hrawd->Projection(2,"e");
hrawd->GetAxis(0)->SetRange(1,nbTot[0]);
hrawd->GetAxis(1)->SetRange(1,nbTot[1]);
hDstDt->SetName(pref+"_DistRaw_"+grpTit); // "Data" projection on tracklet quality (w.distance) axis to check the tails
hDstDt->SetTitle(pref+" DistRaw "+grpTit);
double nrmDst,dumErr = 0;
Integrate(hDstDt, cutBgMin,cutBgMax, nrmDst, dumErr);
hDstDt->Scale(1./nrmDst);
res->AddAtAndExpand(hDstDt, kDataDist+shift);
//
hgenb->GetAxis(0)->SetRange(bn0[0],bn1[0]);
hgenb->GetAxis(1)->SetRange(bn0[1],bn1[1]);
TH1* hDstBg = hgenb->Projection(2,"e"); hDstBg->Reset();
hgenb->GetAxis(0)->SetRange(1,nbTot[0]);
hgenb->GetAxis(1)->SetRange(1,nbTot[1]);
hDstBg->SetName(pref+"_DistBgNorm_"+grpTit); // Gen.Bg projection on tracklet quality (w.distance) axis to check the tails
hDstBg->SetTitle(pref+" DistBgNorm "+grpTit); // Gen.Bg projection on tracklet quality (w.distance) axis to check the tails
res->AddAtAndExpand(hDstBg, kBgDist+shift);
TH1* hDstBgMC = 0;
if (hmcComb) {
hmcComb->GetAxis(0)->SetRange(bn0[0],bn1[0]);
hmcComb->GetAxis(1)->SetRange(bn0[1],bn1[1]);
hDstBgMC = hmcComb->Projection(2,"e");
hmcComb->GetAxis(0)->SetRange(1,nbTot[0]);
hmcComb->GetAxis(1)->SetRange(1,nbTot[1]);
hDstBgMC->SetName(pref+"_DistBgMC");
hDstBgMC->SetTitle(pref+" Bg. Distance from MC labels");
hDstBgMC->Scale(1./nrmDst);
res->AddAtAndExpand(hDstBgMC, kBgMCDist+shift);
}
//
// fill 1-beta matrix
for (int ib0=bn0[0];ib0<=bn1[0];ib0+=bStepEta) { // eta
hrawd->GetAxis(0)->SetRange(ib0,ib0+bStepEta-1);
hgenb->GetAxis(0)->SetRange(ib0,ib0+bStepEta-1);
for (int ib1=bn0[1];ib1<=bn1[1];ib1+=bStepZv) { // zv
hrawd->GetAxis(1)->SetRange(ib1,ib1+bStepZv-1);
hgenb->GetAxis(1)->SetRange(ib1,ib1+bStepZv-1);
//
TH1D* dstD = hrawd->Projection(2,"e"); // data "qaulity" for given eta:zv bin
TH1D* dstB = hgenb->Projection(2,"e"); // data "qaulity" for given eta:zv bin
double scl,sclE;
TH1* nrmB = NormalizeBg(dstD,dstB,scl,sclE); // get rescaling factor for bg. from tails comparison
double bgVal,bgErr;
double dtVal,dtErr;
// integral in the range where we look for signal
Integrate(nrmB, cutSgMin, cutSgMax, bgVal, bgErr);
Integrate(dstD, cutSgMin, cutSgMax, dtVal, dtErr);
double beta,betaErr;
GetRatE(bgVal,bgErr, dtVal, dtErr,beta,betaErr);
// betaErr*=nbinstsq; // ??? RS
for (int i=ib0;i<ib0+bStepEta;i++) {
for (int j=ib1;j<ib1+bStepZv;j++) {
hBgRescFc->SetBinContent(i,j, scl);
hBgRescFc->SetBinError(i,j, sclE);
}
}
hDstBg->Add(nrmB);
delete dstD;
delete dstB;
delete nrmB;
//
}
}
hDstBg->Scale(1./nrmDst);
//
// finalize estimated bg and signal matrices
hBgEst->Multiply(hBgRescFc);
hSignalEst->Add(hBgEst,-1);
//
// finalize 1-beta
for (int ib0=bn0[0];ib0<=bn1[0];ib0++) { // eta
for (int ib1=bn0[1];ib1<=bn1[1];ib1++) { // zv
// printf("Bin %d %d\n",ib0,ib1);
double bg = hBgEst->GetBinContent(ib0,ib1);
double bgE = hBgEst->GetBinError(ib0,ib1);
double dt = hRawDtCut->GetBinContent(ib0,ib1);
double dtE = hRawDtCut->GetBinError(ib0,ib1);
double beta,betaE;
GetRatE(bg,bgE,dt,dtE, beta,betaE );
h1mBeta->SetBinContent(ib0,ib1,1.-beta);
h1mBeta->SetBinError(ib0,ib1,betaE);
//
}
}
//
// crop to needed range
for (int i=shift;i<kNHistos+shift;i++) {
TH2* hist = (TH2*)res->At(i);
if (!hist || !hist->InheritsFrom(TH2::Class())) continue;
CropHisto(hist, bn0[0],bn1[0], bn0[1],bn1[1]);
}
//
h1mBeta->SetMinimum(0.6);
h1mBeta->SetMaximum(0.85);
if (hmcComb) {
h1mBetaMC->SetMinimum(0.6);
h1mBetaMC->SetMaximum(0.85);
}
//
// restore
for (int i=3;i--;) { // set default axis range
hrawd->GetAxis(i)->SetRange(1,nbTot[i]);
hgenb->GetAxis(i)->SetRange(1,nbTot[i]);
if (hmcComb) hmcComb->GetAxis(i)->SetRange(1,nbTot[i]);
}
//
}
void GetRealMinMax(TH1* histo, double &vmn, double &vmx)
{
TAxis *xax = histo->GetXaxis();
int nbx = xax->GetNbins();
vmn=1e6, vmx=-1e6;
if (histo->InheritsFrom(TH2::Class())) {
TAxis *yax = histo->GetYaxis();
int nby = yax->GetNbins();
for (int ix=nbx+2;ix--;) {
for (int iy=nby+2;iy--;) {
double vl = histo->GetBinContent(ix,iy);
if (vl<kEps) continue;
if (vl<vmn) vmn = vl;
if (vl>vmx) vmx = vl;
}
}
}
//
else {
for (int ix=nbx+2;ix--;) {
double vl = histo->GetBinContent(ix);
if (vl<vmn) vmn = vl;
if (vl>vmx) vmx = vl;
}
}
//
}
|
87bc5960fc779acd73d9dc3006dafd2d2b547ed2
|
00fbe208cec31dc61ca326ea0c7c8711e4a8db2a
|
/legacy/src/hotkey/kc_map.c
|
f7cb6dfd5708879c4713678bf052cac83ab1f934
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
twitter/pelikan
|
9725f1a5d1e30ebbdbcf3b0177c4dae130806b1d
|
e7a76c92d8a6b401475ce53d3cefe964f1e7fbb6
|
refs/heads/master
| 2023-08-14T05:07:36.020898
| 2022-10-27T17:13:29
| 2022-10-27T17:13:29
| 42,829,191
| 1,880
| 180
|
Apache-2.0
| 2023-05-12T12:23:40
| 2015-09-20T20:51:55
|
C
|
UTF-8
|
C
| false
| false
| 5,646
|
c
|
kc_map.c
|
#include "kc_map.h"
#include "constant.h"
#include <cc_bstring.h>
#include <cc_debug.h>
#include <hash/cc_murmur3.h>
#include <cc_mm.h>
#include <cc_pool.h>
#define KC_MAP_MODULE_NAME "hotkey::kc_map"
struct kc_map_entry {
STAILQ_ENTRY(kc_map_entry) next; /* entry in hash table or pool */
char key[MAX_KEY_LEN];
uint32_t klen;
uint32_t count;
};
STAILQ_HEAD(kcme_slh, kc_map_entry);
static uint32_t murmur3_iv = 0x3ac5d673;
static struct kcme_slh *table = NULL;
static uint32_t table_size = 0; /* number of buckets in table */
static bool kc_map_init = false;
FREEPOOL(kcme_pool, kcmeq, kc_map_entry);
static struct kcme_pool kcmep;
static bool kcmep_init = false;
static void
kc_map_entry_reset(struct kc_map_entry *kcme)
{
kcme->klen = 0;
kcme->count = 0;
}
static struct kc_map_entry *
kc_map_entry_create(void)
{
struct kc_map_entry *kcme = cc_alloc(sizeof(*kcme));
if (kcme == NULL) {
return NULL;
}
kc_map_entry_reset(kcme);
return kcme;
}
static void
kc_map_entry_destroy(struct kc_map_entry **kc_map_entry)
{
struct kc_map_entry *kcme = *kc_map_entry;
ASSERT(kcme != NULL);
cc_free(kcme);
*kc_map_entry = NULL;
}
static void
kc_map_entry_pool_destroy(void)
{
struct kc_map_entry *kcme, *tkcme;
if (!kcmep_init) {
log_warn("kc_map_entry pool was not created, ignore");
return;
}
log_info("destroying kc_map_entry pool: free %"PRIu32, kcmep.nfree);
FREEPOOL_DESTROY(kcme, tkcme, &kcmep, next, kc_map_entry_destroy);
kcmep_init = false;
}
static struct kc_map_entry *
kc_map_entry_borrow(void)
{
struct kc_map_entry *kcme;
FREEPOOL_BORROW(kcme, &kcmep, next, kc_map_entry_create);
if (kcme == NULL) {
log_debug("borrow kc_map_entry failed: OOM");
return NULL;
}
kc_map_entry_reset(kcme);
return kcme;
}
static void
kc_map_entry_return(struct kc_map_entry **kc_map_entry)
{
struct kc_map_entry *kcme = *kc_map_entry;
if (kcme == NULL) {
return;
}
FREEPOOL_RETURN(kcme, &kcmep, next);
*kc_map_entry = NULL;
}
static void
kc_map_entry_pool_create(uint32_t max)
{
struct kc_map_entry *kcme;
if (kcmep_init) {
log_warn("kc_map_entry pool has already been created, re-creating");
kc_map_entry_pool_destroy();
}
log_info("creating kc_map_entry pool: max %"PRIu32, max);
FREEPOOL_CREATE(&kcmep, max);
kcmep_init = true;
FREEPOOL_PREALLOC(kcme, &kcmep, max, next, kc_map_entry_create);
if (kcmep.nfree < max) {
log_crit("cannot preallocate kc_map_entry pool, OOM. abort");
exit(EXIT_FAILURE);
}
}
void
kc_map_setup(uint32_t size, uint32_t poolsize)
{
uint32_t i;
log_info("Set up the %s module", KC_MAP_MODULE_NAME);
if (kc_map_init) {
log_warn("%s has already been setup, ignore", KC_MAP_MODULE_NAME);
return;
}
table = cc_alloc(sizeof(*table) * size);
table_size = size;
if (table == NULL) {
log_crit("Could not allocate counter table for hotkey - OOM");
exit(EXIT_FAILURE);
}
for (i = 0; i < size; ++i) {
STAILQ_INIT(&table[i]);
}
kc_map_entry_pool_create(poolsize);
}
void
kc_map_teardown(void)
{
log_info("Tear down the %s module", KC_MAP_MODULE_NAME);
if (!kc_map_init) {
log_warn("%s was not setup", KC_MAP_MODULE_NAME);
}
if (table != NULL) {
uint32_t i;
/* free all entries in table */
for (i = 0; i < table_size; ++i) {
struct kc_map_entry *kcme, *tkcme;
STAILQ_FOREACH_SAFE(kcme, &(table[i]), next, tkcme) {
kc_map_entry_return(&kcme);
}
}
}
kc_map_entry_pool_destroy();
kc_map_init = false;
}
static inline struct kcme_slh *
_get_bucket(const struct bstring *key)
{
uint32_t hv;
hash_murmur3_32(key->data, key->len, murmur3_iv, &hv);
return &(table[hv % table_size]);
}
uint32_t
kc_map_incr(const struct bstring *key)
{
struct kc_map_entry *kcme;
struct kcme_slh *bucket;
ASSERT(key->len <= MAX_KEY_LEN);
bucket = _get_bucket(key);
/* iterate through bucket looking for item */
for (kcme = STAILQ_FIRST(bucket); kcme != NULL; kcme = STAILQ_NEXT(kcme, next)) {
if ((key->len == kcme->klen) && cc_memcmp(key->data, kcme->key, key->len) == 0) {
/* found item */
return ++kcme->count;
}
}
/* not found, insert entry */
kcme = kc_map_entry_borrow();
cc_memcpy(kcme->key, key->data, key->len);
kcme->klen = key->len;
kcme->count = 1;
STAILQ_INSERT_HEAD(bucket, kcme, next);
return 1;
}
void
kc_map_decr(const struct bstring *key)
{
struct kc_map_entry *kcme, *prev;
struct kcme_slh *bucket;
ASSERT(key->len <= MAX_KEY_LEN);
bucket = _get_bucket(key);
/* iterate through bucket looking for item */
for (prev = NULL, kcme = STAILQ_FIRST(bucket); kcme != NULL;
prev = kcme, kcme = STAILQ_NEXT(kcme, next)) {
if ((key->len == kcme->klen) && cc_memcmp(key->data, kcme->key, key->len) == 0) {
/* found item */
if (--(kcme->count) == 0) {
/* remove entry */
if (prev == NULL) {
STAILQ_REMOVE_HEAD(bucket, next);
} else {
STAILQ_REMOVE_AFTER(bucket, prev, next);
}
}
return;
}
}
/* item not found, should never happen for hotkey detection scheme */
ASSERT(false);
}
|
f2dd05272a51c593a35cf35cf13e35f03837b4c8
|
70ffcb065027032a399f44b9ec91e7b61d73583d
|
/ccan_compat.h
|
8400d76d198747e24eb356ec0c92f1562c3e1fec
|
[
"MIT"
] |
permissive
|
ElementsProject/lightning
|
4e260841b2ebad8c772a5ff91ef1ebbc3fe1ad71
|
990096f904e26386527a4eddd8d3262464bacabd
|
refs/heads/master
| 2023-09-01T07:11:34.794039
| 2023-08-31T09:55:14
| 2023-08-31T22:02:14
| 37,350,472
| 2,812
| 961
|
NOASSERTION
| 2023-09-14T19:33:22
| 2015-06-13T00:04:22
|
C
|
UTF-8
|
C
| false
| false
| 1,981
|
h
|
ccan_compat.h
|
#ifndef LIGHTNING_CCAN_COMPAT_H
#define LIGHTNING_CCAN_COMPAT_H
/* Magical file included from config.h (ie. everywhere) which renames
* sha256 and ripemd160 routines so they don't clash with libwally-core's
* internal ones */
/* So, for obvious reasons, this is an exception to the usual rule that we
#include "config.h"
* in all files. */
#define sha256(sha, p, size) ccan_sha256(sha, p, size)
#define sha256_init(ctx) ccan_sha256_init(ctx)
#define sha256_update(ctx, p, size) ccan_sha256_update(ctx, p, size)
#define sha256_done(sha256, res) ccan_sha256_done(sha256, res)
#define sha256_u8(ctx, v) ccan_sha256_u8(ctx, v)
#define sha256_u16(ctx, v) ccan_sha256_u16(ctx, v)
#define sha256_u32(ctx, v) ccan_sha256_u32(ctx, v)
#define sha256_u64(ctx, v) ccan_sha256_u64(ctx, v)
#define sha256_le16(ctx, v) ccan_sha256_le16(ctx, v)
#define sha256_le32(ctx, v) ccan_sha256_le32(ctx, v)
#define sha256_le64(ctx, v) ccan_sha256_le64(ctx, v)
#define sha256_be16(ctx, v) ccan_sha256_be16(ctx, v)
#define sha256_be32(ctx, v) ccan_sha256_be32(ctx, v)
#define sha256_be64(ctx, v) ccan_sha256_be64(ctx, v)
#define ripemd160(sha, p, size) ccan_ripemd160(sha, p, size)
#define ripemd160_init(ctx) ccan_ripemd160_init(ctx)
#define ripemd160_update(ctx, p, size) ccan_ripemd160_update(ctx, p, size)
#define ripemd160_done(ripemd160, res) ccan_ripemd160_done(ripemd160, res)
#define ripemd160_u8(ctx, v) ccan_ripemd160_u8(ctx, v)
#define ripemd160_u16(ctx, v) ccan_ripemd160_u16(ctx, v)
#define ripemd160_u32(ctx, v) ccan_ripemd160_u32(ctx, v)
#define ripemd160_u64(ctx, v) ccan_ripemd160_u64(ctx, v)
#define ripemd160_le16(ctx, v) ccan_ripemd160_le16(ctx, v)
#define ripemd160_le32(ctx, v) ccan_ripemd160_le32(ctx, v)
#define ripemd160_le64(ctx, v) ccan_ripemd160_le64(ctx, v)
#define ripemd160_be16(ctx, v) ccan_ripemd160_be16(ctx, v)
#define ripemd160_be32(ctx, v) ccan_ripemd160_be32(ctx, v)
#define ripemd160_be64(ctx, v) ccan_ripemd160_be64(ctx, v)
#endif /* LIGHTNING_CCAN_COMPAT_H */
|
031abb60e8b038ad5c2b73bc22013a9a5f7d3697
|
88dea29c69d1b003e188a9a7819931eb1fbd17d8
|
/agent/mibgroup/mibII/snmp_mib.h
|
78a5cadd1752bc12bed99eacfb660996ac0ba6c2
|
[
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-other-permissive",
"BSD-3-Clause",
"MIT",
"MIT-CMU"
] |
permissive
|
net-snmp/net-snmp
|
388733e7094495d25d052834e36691bcfc8b5bad
|
9ff837bfae4d985e40c8eaf3734a377898d8753a
|
refs/heads/master
| 2023-09-01T09:19:14.133409
| 2023-08-31T02:54:49
| 2023-08-31T15:11:53
| 128,822,274
| 241
| 236
|
NOASSERTION
| 2023-09-11T18:00:01
| 2018-04-09T19:19:27
|
C
|
UTF-8
|
C
| false
| false
| 69
|
h
|
snmp_mib.h
|
config_require(mibII/updates);
void init_snmp_mib(void);
|
6104f59096adac85594e6da7d369081864830e8b
|
e65a4dbfbfb0e54e59787ba7741efee12f7687f3
|
/comms/bluegps/files/patch-bluegps.c
|
feba011f1158935dd7262d81f55571f85f2ef837
|
[
"BSD-2-Clause"
] |
permissive
|
freebsd/freebsd-ports
|
86f2e89d43913412c4f6b2be3e255bc0945eac12
|
605a2983f245ac63f5420e023e7dce56898ad801
|
refs/heads/main
| 2023-08-30T21:46:28.720924
| 2023-08-30T19:33:44
| 2023-08-30T19:33:44
| 1,803,961
| 916
| 918
|
NOASSERTION
| 2023-09-08T04:06:26
| 2011-05-26T11:15:35
| null |
UTF-8
|
C
| false
| false
| 1,979
|
c
|
patch-bluegps.c
|
--- bluegps.c 2006-06-26 20:28:31.000000000 +0200
+++ bluegps.c 2007-07-29 18:54:17.000000000 +0200
@@ -27,10 +27,21 @@
#include <stdarg.h>
#include <ctype.h>
+#ifdef __FreeBSD__
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#else
#include <netinet/ip.h>
+#endif
+
+#ifdef __FreeBSD__
+#include <bluetooth.h>
+#else
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>
+#endif
#include "rbt3000.h"
@@ -269,19 +280,44 @@
int
rbt3000_connect (char *device_addr)
{
-
+#ifdef __FreeBSD__
+ struct sockaddr_rfcomm rem_addr;
+ struct hostent * he;
+
+ memset(&rem_addr, 0, sizeof(rem_addr));
+ rem_addr.rfcomm_len = sizeof(rem_addr);
+ rem_addr.rfcomm_family = AF_BLUETOOTH;
+ rem_addr.rfcomm_channel = RFCOMM_CHANNEL;
+
+ if ((he = bt_gethostbyname(device_addr))) {
+ context->device = *(bdaddr_t *) he->h_addr_list[0];
+ if (context->messages == MSG_VERBOSE)
+ printf("Actual BT address for '%s': %s\n",
+ device_addr, bt_ntoa(&(context->device),NULL));
+ } else
+ if (!bt_aton(device_addr, &context->device)) {
+ perror("No such device address");
+ return 0;
+ }
+ rem_addr.rfcomm_bdaddr = context->device;
+#else
struct sockaddr_rc rem_addr;
- baswap (&context->device, strtoba (device_addr));
-
rem_addr.rc_family = AF_BLUETOOTH;
- rem_addr.rc_bdaddr = context->device;
rem_addr.rc_channel = RFCOMM_CHANNEL;
+ baswap (&context->device, strtoba (device_addr));
+ rem_addr.rc_bdaddr = context->device;
+#endif
/* bluez connects to BlueClient */
if ((context->device_fd = socket (PF_BLUETOOTH,
SOCK_STREAM,
- BTPROTO_RFCOMM)) < 0 )
+#ifdef __FreeBSD__
+ BLUETOOTH_PROTO_RFCOMM
+#else
+ BTPROTO_RFCOMM
+#endif
+ )) < 0 )
{
perror ("Can't create socket");
return 0;
|
17fcf07877b3f17c1caee20ad15c6241d7fb4c6a
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/n32/libraries/N32WB452_Firmware_Library/n32wb452_ble_driver/platform/Eif_timer.c
|
daf7041e93c1ab960d22ee3607632527a55246b9
|
[
"Apache-2.0",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 3,141
|
c
|
Eif_timer.c
|
/*****************************************************************************
* Copyright (c) 2019, Nations Technologies Inc.
*
* All rights reserved.
* ****************************************************************************
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Nations' name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY NATIONS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL NATIONS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ****************************************************************************/
/**
* @file Eif_timer.c
* @author Nations
* @version v1.0.0
*
* @copyright Copyright (c) 2019, Nations Technologies Inc. All rights reserved.
*/
#include "Eif_timer.h"
#include "bsp_timer.h"
#include "ke_event.h"
//#include "Eif_iom.h"
/*************************************
*函数名:eif_timer_isr
*功能:设置一个定时器事件
*参数:void
*
*返回值:void
*备注:
**************************************/
void eif_timer_isr(void)
{
ke_event_set(KE_EVENT_KE_TIMER);
}
/*************************************
*函数名:eif_timer_init
*功能:定时器初始化,配置自动重装值和分频系数
*参数:void
*
*返回值:void
*备注:
**************************************/
void eif_timer_init(void)
{
TIM3_config(9999,35);//36分频,1MHz计数,10ms定时中断
}
/*************************************
*函数名:eif_set_timeout
*功能:设置超时时间,10ms计时基数
*参数:to,超时时长
*
*返回值:void
*备注:
**************************************/
void eif_set_timeout(uint32_t to)
{
TIM3_set_timeout(to);
}
/*************************************
*函数名:eif_get_time
*功能:获取超时剩余时间,单位ms
*参数:void
*
*返回值:void
*备注:
**************************************/
uint32_t eif_get_time(void)
{
return (TIM3_get_time());
}
/*************************************
*函数名:eif_enable_timer
*功能:启动或关闭定时器
*参数:enable,1:启动; 0:关闭
*
*返回值:void
*备注:
**************************************/
void eif_enable_timer(bool enable)
{
TIM3_IRQ_enable(enable);
}
|
bff54dd1d79277f99cbcf76614e8e2f411cceeea
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/Vango/v85xx/Libraries/VangoV85xx_standard_peripheral/Include/lib_adc_tiny.h
|
b9b8da41a3fd8e75d13745aca14ec66d34ac3326
|
[
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 2,681
|
h
|
lib_adc_tiny.h
|
/**
******************************************************************************
* @file lib_adc_tiny.h
* @author Application Team
* @version V4.4.0
* @date 2018-09-27
* @brief ADC_TINY library.
******************************************************************************
* @attention
*
******************************************************************************
*/
#ifndef __LIB_ADC_TINY_H
#define __LIB_ADC_TINY_H
#ifdef __cplusplus
extern "C" {
#endif
#include "target.h"
typedef struct
{
uint32_t SignalSel;
uint32_t ADTREF1;
uint32_t ADTREF2;
uint32_t ADTREF3;
} TADCInitType;
//SelADT
#define ADCTINY_SIGNALSEL_IOE6 0
#define ADCTINY_SIGNALSEL_IOE7 ANA_REGF_SELADT
#define IS_ADCTINY_SELADT(__SELADT__) (((__SELADT__) == ADCTINY_SIGNALSEL_IOE6) ||\
((__SELADT__) == ADCTINY_SIGNALSEL_IOE7))
//ADTREF1
#define ADCTINY_REF1_0_9 0
#define ADCTINY_REF1_0_7 ANA_REGF_ADTREF1SEL
#define IS_ADCTINY_ADTREF1(__ADTREF1__) (((__ADTREF1__) == ADCTINY_REF1_0_9) ||\
((__ADTREF1__) == ADCTINY_REF1_0_7))
//ADTREF2
#define ADCTINY_REF2_1_8 0
#define ADCTINY_REF2_1_6 ANA_REGF_ADTREF2SEL
#define IS_ADCTINY_ADTREF2(__ADTREF2__) (((__ADTREF2__) == ADCTINY_REF2_1_8) ||\
((__ADTREF2__) == ADCTINY_REF2_1_6))
//ADTREF3
#define ADCTINY_REF3_2_7 0
#define ADCTINY_REF3_2_5 ANA_REGF_ADTREF3SEL
#define IS_ADCTINY_ADTREF3(__ADTREF3__) (((__ADTREF3__) == ADCTINY_REF3_2_7) ||\
((__ADTREF3__) == ADCTINY_REF3_2_5))
//THSel
#define ADCTINY_THSEL_0 ANA_MISC_TADCTH_0
#define ADCTINY_THSEL_1 ANA_MISC_TADCTH_1
#define ADCTINY_THSEL_2 ANA_MISC_TADCTH_2
#define ADCTINY_THSEL_3 ANA_MISC_TADCTH_3
#define IS_ADCTINY_THSEL(__THSEL__) (((__THSEL__) == ADCTINY_THSEL_0) ||\
((__THSEL__) == ADCTINY_THSEL_1) ||\
((__THSEL__) == ADCTINY_THSEL_2) ||\
((__THSEL__) == ADCTINY_THSEL_3))
/* Exported Functions ------------------------------------------------------- */
void TADC_DeInit(void);
void TADC_StructInit(TADCInitType* TADC_InitStruct);
void TADC_Init(TADCInitType* TADC_InitStruct);
void TADC_Cmd(uint32_t NewState);
uint8_t TADC_GetOutput(void);
void TADC_IntTHConfig(uint32_t THSel);
void TADC_INTConfig(uint32_t NewState);
uint8_t TADC_GetINTStatus(void);
void TADC_ClearINTStatus(void);
#ifdef __cplusplus
}
#endif
#endif /* __LIB_ADC_TINY_H */
/*********************************** END OF FILE ******************************/
|
e001d8ffbd2ce58ef4602d7a6eebce59fd6e6f8b
|
50dd46b8ece33f3cdd174284b15d1d51f89669d4
|
/third_party/edk2/EmbeddedPkg/GdbStub/GdbStub.c
|
a75e7751af8dca3489bd9844925120f2503eaeff
|
[
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"BSD-2-Clause",
"OpenSSL"
] |
permissive
|
google/google-ctf
|
f99da1ee07729bbccb869fff1cbaed6a80e43bcc
|
df02323eaf945d15e124801c74abaadca2749dc7
|
refs/heads/master
| 2023-08-31T14:30:27.548081
| 2023-08-29T13:04:20
| 2023-08-29T13:04:20
| 131,317,137
| 4,136
| 607
|
Apache-2.0
| 2023-08-30T22:17:02
| 2018-04-27T15:56:03
|
Go
|
UTF-8
|
C
| false
| false
| 37,294
|
c
|
GdbStub.c
|
/** @file
UEFI driver that implements a GDB stub
Note: Any code in the path of the Serial IO output can not call DEBUG as will
will blow out the stack. Serial IO calls DEBUG, debug calls Serail IO, ...
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <GdbStubInternal.h>
#include <Protocol/DebugPort.h>
UINTN gMaxProcessorIndex = 0;
//
// Buffers for basic gdb communication
//
CHAR8 gInBuffer[MAX_BUF_SIZE];
CHAR8 gOutBuffer[MAX_BUF_SIZE];
// Assume gdb does a "qXfer:libraries:read::offset,length" when it connects so we can default
// this value to FALSE. Since gdb can reconnect its self a global default is not good enough
BOOLEAN gSymbolTableUpdate = FALSE;
EFI_EVENT gEvent;
VOID *gGdbSymbolEventHandlerRegistration = NULL;
//
// Globals for returning XML from qXfer:libraries:read packet
//
UINTN gPacketqXferLibraryOffset = 0;
UINTN gEfiDebugImageTableEntry = 0;
EFI_DEBUG_IMAGE_INFO_TABLE_HEADER *gDebugImageTableHeader = NULL;
EFI_DEBUG_IMAGE_INFO *gDebugTable = NULL;
CHAR8 gXferLibraryBuffer[2000];
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mHexToStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
VOID
EFIAPI
GdbSymbolEventHandler (
IN EFI_EVENT Event,
IN VOID *Context
)
{
}
/**
The user Entry Point for Application. The user code starts with this function
as the real entry point for the image goes into a library that calls this
function.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The entry point is executed successfully.
@retval other Some error occurs when executing this entry point.
**/
EFI_STATUS
EFIAPI
GdbStubEntry (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupport;
UINTN HandleCount;
EFI_HANDLE *Handles;
UINTN Index;
UINTN Processor;
BOOLEAN IsaSupported;
Status = EfiGetSystemConfigurationTable (&gEfiDebugImageInfoTableGuid, (VOID **)&gDebugImageTableHeader);
if (EFI_ERROR (Status)) {
gDebugImageTableHeader = NULL;
}
Status = gBS->LocateHandleBuffer (
ByProtocol,
&gEfiDebugSupportProtocolGuid,
NULL,
&HandleCount,
&Handles
);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Debug Support Protocol not found\n"));
return Status;
}
DebugSupport = NULL;
IsaSupported = FALSE;
do {
HandleCount--;
Status = gBS->HandleProtocol (
Handles[HandleCount],
&gEfiDebugSupportProtocolGuid,
(VOID **) &DebugSupport
);
if (!EFI_ERROR (Status)) {
if (CheckIsa (DebugSupport->Isa)) {
// We found what we are looking for so break out of the loop
IsaSupported = TRUE;
break;
}
}
} while (HandleCount > 0);
FreePool (Handles);
if (!IsaSupported) {
DEBUG ((EFI_D_ERROR, "Debug Support Protocol does not support our ISA\n"));
return EFI_NOT_FOUND;
}
Status = DebugSupport->GetMaximumProcessorIndex (DebugSupport, &gMaxProcessorIndex);
ASSERT_EFI_ERROR (Status);
DEBUG ((EFI_D_INFO, "Debug Support Protocol ISA %x\n", DebugSupport->Isa));
DEBUG ((EFI_D_INFO, "Debug Support Protocol Processor Index %d\n", gMaxProcessorIndex));
// Call processor-specific init routine
InitializeProcessor ();
for (Processor = 0; Processor <= gMaxProcessorIndex; Processor++) {
for (Index = 0; Index < MaxEfiException (); Index++) {
Status = DebugSupport->RegisterExceptionCallback (DebugSupport, Processor, GdbExceptionHandler, gExceptionType[Index].Exception);
ASSERT_EFI_ERROR (Status);
}
//
// Current edk2 DebugPort is not interrupt context safe so we can not use it
//
Status = DebugSupport->RegisterPeriodicCallback (DebugSupport, Processor, GdbPeriodicCallBack);
ASSERT_EFI_ERROR (Status);
}
//
// This even fires every time an image is added. This allows the stub to know when gdb needs
// to update the symbol table.
//
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
TPL_CALLBACK,
GdbSymbolEventHandler,
NULL,
&gEvent
);
ASSERT_EFI_ERROR (Status);
//
// Register for protocol notifications on this event
//
Status = gBS->RegisterProtocolNotify (
&gEfiLoadedImageProtocolGuid,
gEvent,
&gGdbSymbolEventHandlerRegistration
);
ASSERT_EFI_ERROR (Status);
if (PcdGetBool (PcdGdbSerial)) {
GdbInitializeSerialConsole ();
}
return EFI_SUCCESS;
}
/**
Transfer length bytes of input buffer, starting at Address, to memory.
@param length the number of the bytes to be transferred/written
@param *address the start address of the transferring/writing the memory
@param *new_data the new data to be written to memory
**/
VOID
TransferFromInBufToMem (
IN UINTN Length,
IN unsigned char *Address,
IN CHAR8 *NewData
)
{
CHAR8 c1;
CHAR8 c2;
while (Length-- > 0) {
c1 = (CHAR8)HexCharToInt (*NewData++);
c2 = (CHAR8)HexCharToInt (*NewData++);
if ((c1 < 0) || (c2 < 0)) {
Print ((CHAR16 *)L"Bad message from write to memory..\n");
SendError (GDB_EBADMEMDATA);
return;
}
*Address++ = (UINT8)((c1 << 4) + c2);
}
SendSuccess();
}
/**
Transfer Length bytes of memory starting at Address to an output buffer, OutBuffer. This function will finally send the buffer
as a packet.
@param Length the number of the bytes to be transferred/read
@param *address pointer to the start address of the transferring/reading the memory
**/
VOID
TransferFromMemToOutBufAndSend (
IN UINTN Length,
IN unsigned char *Address
)
{
// there are Length bytes and every byte is represented as 2 hex chars
CHAR8 OutBuffer[MAX_BUF_SIZE];
CHAR8 *OutBufPtr; // pointer to the output buffer
CHAR8 Char;
if (ValidateAddress(Address) == FALSE) {
SendError(14);
return;
}
OutBufPtr = OutBuffer;
while (Length > 0) {
Char = mHexToStr[*Address >> 4];
if ((Char >= 'A') && (Char <= 'F')) {
Char = Char - 'A' + 'a';
}
*OutBufPtr++ = Char;
Char = mHexToStr[*Address & 0x0f];
if ((Char >= 'A') && (Char <= 'F')) {
Char = Char - 'A' + 'a';
}
*OutBufPtr++ = Char;
Address++;
Length--;
}
*OutBufPtr = '\0' ; // the end of the buffer
SendPacket (OutBuffer);
}
/**
Send a GDB Remote Serial Protocol Packet
$PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',
the packet teminating character '#' and the two digit checksum.
If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up
in an infinit loop. This is so if you unplug the debugger code just keeps running
@param PacketData Payload data for the packet
@retval Number of bytes of packet data sent.
**/
UINTN
SendPacket (
IN CHAR8 *PacketData
)
{
UINT8 CheckSum;
UINTN Timeout;
CHAR8 *Ptr;
CHAR8 TestChar;
UINTN Count;
Timeout = PcdGet32 (PcdGdbMaxPacketRetryCount);
Count = 0;
do {
Ptr = PacketData;
if (Timeout-- == 0) {
// Only try a finite number of times so we don't get stuck in the loop
return Count;
}
// Packet prefix
GdbPutChar ('$');
for (CheckSum = 0, Count =0 ; *Ptr != '\0'; Ptr++, Count++) {
GdbPutChar (*Ptr);
CheckSum = CheckSum + *Ptr;
}
// Packet terminating character and checksum
GdbPutChar ('#');
GdbPutChar (mHexToStr[CheckSum >> 4]);
GdbPutChar (mHexToStr[CheckSum & 0x0F]);
TestChar = GdbGetChar ();
} while (TestChar != '+');
return Count;
}
/**
Receive a GDB Remote Serial Protocol Packet
$PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',
the packet teminating character '#' and the two digit checksum.
If host re-starts sending a packet without ending the previous packet, only the last valid packet is processed.
(In other words, if received packet is '$12345$12345$123456#checksum', only '$123456#checksum' will be processed.)
If an ack '+' is not sent resend the packet
@param PacketData Payload data for the packet
@retval Number of bytes of packet data received.
**/
UINTN
ReceivePacket (
OUT CHAR8 *PacketData,
IN UINTN PacketDataSize
)
{
UINT8 CheckSum;
UINTN Index;
CHAR8 Char;
CHAR8 SumString[3];
CHAR8 TestChar;
ZeroMem (PacketData, PacketDataSize);
for (;;) {
// wait for the start of a packet
TestChar = GdbGetChar ();
while (TestChar != '$') {
TestChar = GdbGetChar ();
};
retry:
for (Index = 0, CheckSum = 0; Index < (PacketDataSize - 1); Index++) {
Char = GdbGetChar ();
if (Char == '$') {
goto retry;
}
if (Char == '#') {
break;
}
PacketData[Index] = Char;
CheckSum = CheckSum + Char;
}
PacketData[Index] = '\0';
if (Index == PacketDataSize) {
continue;
}
SumString[0] = GdbGetChar ();
SumString[1] = GdbGetChar ();
SumString[2] = '\0';
if (AsciiStrHexToUintn (SumString) == CheckSum) {
// Ack: Success
GdbPutChar ('+');
// Null terminate the callers string
PacketData[Index] = '\0';
return Index;
} else {
// Ack: Failure
GdbPutChar ('-');
}
}
//return 0;
}
/**
Empties the given buffer
@param Buf pointer to the first element in buffer to be emptied
**/
VOID
EmptyBuffer (
IN CHAR8 *Buf
)
{
*Buf = '\0';
}
/**
Converts an 8-bit Hex Char into a INTN.
@param Char the hex character to be converted into UINTN
@retval a INTN, from 0 to 15, that corressponds to Char
-1 if Char is not a hex character
**/
INTN
HexCharToInt (
IN CHAR8 Char
)
{
if ((Char >= 'A') && (Char <= 'F')) {
return Char - 'A' + 10;
} else if ((Char >= 'a') && (Char <= 'f')) {
return Char - 'a' + 10;
} else if ((Char >= '0') && (Char <= '9')) {
return Char - '0';
} else { // if not a hex value, return a negative value
return -1;
}
}
// 'E' + the biggest error number is 255, so its 2 hex digits + buffer end
CHAR8 *gError = "E__";
/** 'E NN'
Send an error with the given error number after converting to hex.
The error number is put into the buffer in hex. '255' is the biggest errno we can send.
ex: 162 will be sent as A2.
@param errno the error number that will be sent
**/
VOID
EFIAPI
SendError (
IN UINT8 ErrorNum
)
{
//
// Replace _, or old data, with current errno
//
gError[1] = mHexToStr [ErrorNum >> 4];
gError[2] = mHexToStr [ErrorNum & 0x0f];
SendPacket (gError); // send buffer
}
/**
Send 'OK' when the function is done executing successfully.
**/
VOID
EFIAPI
SendSuccess (
VOID
)
{
SendPacket ("OK"); // send buffer
}
/**
Send empty packet to specify that particular command/functionality is not supported.
**/
VOID
EFIAPI
SendNotSupported (
VOID
)
{
SendPacket ("");
}
/**
Send the T signal with the given exception type (in gdb order) and possibly with n:r pairs related to the watchpoints
@param SystemContext Register content at time of the exception
@param GdbExceptionType GDB exception type
**/
VOID
GdbSendTSignal (
IN EFI_SYSTEM_CONTEXT SystemContext,
IN UINT8 GdbExceptionType
)
{
CHAR8 TSignalBuffer[128];
CHAR8 *TSignalPtr;
UINTN BreakpointDetected;
BREAK_TYPE BreakType;
UINTN DataAddress;
CHAR8 *WatchStrPtr = NULL;
UINTN RegSize;
TSignalPtr = &TSignalBuffer[0];
//Construct TSignal packet
*TSignalPtr++ = 'T';
//
// replace _, or previous value, with Exception type
//
*TSignalPtr++ = mHexToStr [GdbExceptionType >> 4];
*TSignalPtr++ = mHexToStr [GdbExceptionType & 0x0f];
if (GdbExceptionType == GDB_SIGTRAP) {
if (gSymbolTableUpdate) {
//
// We can only send back on reason code. So if the flag is set it means the breakpoint is from our event handler
//
WatchStrPtr = "library:;";
while (*WatchStrPtr != '\0') {
*TSignalPtr++ = *WatchStrPtr++;
}
gSymbolTableUpdate = FALSE;
} else {
//
// possible n:r pairs
//
//Retrieve the breakpoint number
BreakpointDetected = GetBreakpointDetected (SystemContext);
//Figure out if the exception is happend due to watch, rwatch or awatch.
BreakType = GetBreakpointType (SystemContext, BreakpointDetected);
//INFO: rwatch is not supported due to the way IA32 debug registers work
if ((BreakType == DataWrite) || (BreakType == DataRead) || (BreakType == DataReadWrite)) {
//Construct n:r pair
DataAddress = GetBreakpointDataAddress (SystemContext, BreakpointDetected);
//Assign appropriate buffer to print particular watchpoint type
if (BreakType == DataWrite) {
WatchStrPtr = "watch";
} else if (BreakType == DataRead) {
WatchStrPtr = "rwatch";
} else if (BreakType == DataReadWrite) {
WatchStrPtr = "awatch";
}
while (*WatchStrPtr != '\0') {
*TSignalPtr++ = *WatchStrPtr++;
}
*TSignalPtr++ = ':';
//Set up series of bytes in big-endian byte order. "awatch" won't work with little-endian byte order.
RegSize = REG_SIZE;
while (RegSize > 0) {
RegSize = RegSize-4;
*TSignalPtr++ = mHexToStr[(UINT8)(DataAddress >> RegSize) & 0xf];
}
//Always end n:r pair with ';'
*TSignalPtr++ = ';';
}
}
}
*TSignalPtr = '\0';
SendPacket (TSignalBuffer);
}
/**
Translates the EFI mapping to GDB mapping
@param EFIExceptionType EFI Exception that is being processed
@retval UINTN that corresponds to EFIExceptionType's GDB exception type number
**/
UINT8
ConvertEFItoGDBtype (
IN EFI_EXCEPTION_TYPE EFIExceptionType
)
{
UINTN Index;
for (Index = 0; Index < MaxEfiException () ; Index++) {
if (gExceptionType[Index].Exception == EFIExceptionType) {
return gExceptionType[Index].SignalNo;
}
}
return GDB_SIGTRAP; // this is a GDB trap
}
/** "m addr,length"
Find the Length of the area to read and the start addres. Finally, pass them to
another function, TransferFromMemToOutBufAndSend, that will read from that memory space and
send it as a packet.
**/
VOID
EFIAPI
ReadFromMemory (
CHAR8 *PacketData
)
{
UINTN Address;
UINTN Length;
CHAR8 AddressBuffer[MAX_ADDR_SIZE]; // the buffer that will hold the address in hex chars
CHAR8 *AddrBufPtr; // pointer to the address buffer
CHAR8 *InBufPtr; /// pointer to the input buffer
AddrBufPtr = AddressBuffer;
InBufPtr = &PacketData[1];
while (*InBufPtr != ',') {
*AddrBufPtr++ = *InBufPtr++;
}
*AddrBufPtr = '\0';
InBufPtr++; // this skips ',' in the buffer
/* Error checking */
if (AsciiStrLen (AddressBuffer) >= MAX_ADDR_SIZE) {
Print((CHAR16 *)L"Address is too long\n");
SendError (GDB_EBADMEMADDRBUFSIZE);
return;
}
// 2 = 'm' + ','
if (AsciiStrLen (PacketData) - AsciiStrLen (AddressBuffer) - 2 >= MAX_LENGTH_SIZE) {
Print((CHAR16 *)L"Length is too long\n");
SendError (GDB_EBADMEMLENGTH);
return;
}
Address = AsciiStrHexToUintn (AddressBuffer);
Length = AsciiStrHexToUintn (InBufPtr);
TransferFromMemToOutBufAndSend (Length, (unsigned char *)Address);
}
/** "M addr,length :XX..."
Find the Length of the area in bytes to write and the start addres. Finally, pass them to
another function, TransferFromInBufToMem, that will write to that memory space the info in
the input buffer.
**/
VOID
EFIAPI
WriteToMemory (
IN CHAR8 *PacketData
)
{
UINTN Address;
UINTN Length;
UINTN MessageLength;
CHAR8 AddressBuffer[MAX_ADDR_SIZE]; // the buffer that will hold the Address in hex chars
CHAR8 LengthBuffer[MAX_LENGTH_SIZE]; // the buffer that will hold the Length in hex chars
CHAR8 *AddrBufPtr; // pointer to the Address buffer
CHAR8 *LengthBufPtr; // pointer to the Length buffer
CHAR8 *InBufPtr; /// pointer to the input buffer
AddrBufPtr = AddressBuffer;
LengthBufPtr = LengthBuffer;
InBufPtr = &PacketData[1];
while (*InBufPtr != ',') {
*AddrBufPtr++ = *InBufPtr++;
}
*AddrBufPtr = '\0';
InBufPtr++; // this skips ',' in the buffer
while (*InBufPtr != ':') {
*LengthBufPtr++ = *InBufPtr++;
}
*LengthBufPtr = '\0';
InBufPtr++; // this skips ':' in the buffer
Address = AsciiStrHexToUintn (AddressBuffer);
Length = AsciiStrHexToUintn (LengthBuffer);
/* Error checking */
//Check if Address is not too long.
if (AsciiStrLen (AddressBuffer) >= MAX_ADDR_SIZE) {
Print ((CHAR16 *)L"Address too long..\n");
SendError (GDB_EBADMEMADDRBUFSIZE);
return;
}
//Check if message length is not too long
if (AsciiStrLen (LengthBuffer) >= MAX_LENGTH_SIZE) {
Print ((CHAR16 *)L"Length too long..\n");
SendError (GDB_EBADMEMLENGBUFSIZE);
return;
}
// Check if Message is not too long/short.
// 3 = 'M' + ',' + ':'
MessageLength = (AsciiStrLen (PacketData) - AsciiStrLen (AddressBuffer) - AsciiStrLen (LengthBuffer) - 3);
if (MessageLength != (2*Length)) {
//Message too long/short. New data is not the right size.
SendError (GDB_EBADMEMDATASIZE);
return;
}
TransferFromInBufToMem (Length, (unsigned char *)Address, InBufPtr);
}
/**
Parses breakpoint packet data and captures Breakpoint type, Address and length.
In case of an error, function returns particular error code. Returning 0 meaning
no error.
@param PacketData Pointer to the payload data for the packet.
@param Type Breakpoint type
@param Address Breakpoint address
@param Length Breakpoint length in Bytes (1 byte, 2 byte, 4 byte)
@retval 1 Success
@retval {other} Particular error code
**/
UINTN
ParseBreakpointPacket (
IN CHAR8 *PacketData,
OUT UINTN *Type,
OUT UINTN *Address,
OUT UINTN *Length
)
{
CHAR8 AddressBuffer[MAX_ADDR_SIZE];
CHAR8 *AddressBufferPtr;
CHAR8 *PacketDataPtr;
PacketDataPtr = &PacketData[1];
AddressBufferPtr = AddressBuffer;
*Type = AsciiStrHexToUintn (PacketDataPtr);
//Breakpoint/watchpoint type should be between 0 to 4
if (*Type > 4) {
Print ((CHAR16 *)L"Type is invalid\n");
return 22; //EINVAL: Invalid argument.
}
//Skip ',' in the buffer.
while (*PacketDataPtr++ != ',');
//Parse Address information
while (*PacketDataPtr != ',') {
*AddressBufferPtr++ = *PacketDataPtr++;
}
*AddressBufferPtr = '\0';
//Check if Address is not too long.
if (AsciiStrLen (AddressBuffer) >= MAX_ADDR_SIZE) {
Print ((CHAR16 *)L"Address too long..\n");
return 40; //EMSGSIZE: Message size too long.
}
*Address = AsciiStrHexToUintn (AddressBuffer);
PacketDataPtr++; //This skips , in the buffer
//Parse Length information
*Length = AsciiStrHexToUintn (PacketDataPtr);
//Length should be 1, 2 or 4 bytes
if (*Length > 4) {
Print ((CHAR16 *)L"Length is invalid\n");
return 22; //EINVAL: Invalid argument
}
return 0; //0 = No error
}
UINTN
gXferObjectReadResponse (
IN CHAR8 Type,
IN CHAR8 *Str
)
{
CHAR8 *OutBufPtr; // pointer to the output buffer
CHAR8 Char;
UINTN Count;
// Response starts with 'm' or 'l' if it is the end
OutBufPtr = gOutBuffer;
*OutBufPtr++ = Type;
Count = 1;
// Binary data encoding
OutBufPtr = gOutBuffer;
while (*Str != '\0') {
Char = *Str++;
if ((Char == 0x7d) || (Char == 0x23) || (Char == 0x24) || (Char == 0x2a)) {
// escape character
*OutBufPtr++ = 0x7d;
Char ^= 0x20;
}
*OutBufPtr++ = Char;
Count++;
}
*OutBufPtr = '\0' ; // the end of the buffer
SendPacket (gOutBuffer);
return Count;
}
/**
Note: This should be a library function. In the Apple case you have to add
the size of the PE/COFF header into the starting address to make things work
right as there is no way to pad the Mach-O for the size of the PE/COFF header.
Returns a pointer to the PDB file name for a PE/COFF image that has been
loaded into system memory with the PE/COFF Loader Library functions.
Returns the PDB file name for the PE/COFF image specified by Pe32Data. If
the PE/COFF image specified by Pe32Data is not a valid, then NULL is
returned. If the PE/COFF image specified by Pe32Data does not contain a
debug directory entry, then NULL is returned. If the debug directory entry
in the PE/COFF image specified by Pe32Data does not contain a PDB file name,
then NULL is returned.
If Pe32Data is NULL, then ASSERT().
@param Pe32Data Pointer to the PE/COFF image that is loaded in system
memory.
@param DebugBase Address that the debugger would use as the base of the image
@return The PDB file name for the PE/COFF image specified by Pe32Data or NULL
if it cannot be retrieved. DebugBase is only valid if PDB file name is
valid.
**/
VOID *
EFIAPI
PeCoffLoaderGetDebuggerInfo (
IN VOID *Pe32Data,
OUT VOID **DebugBase
)
{
EFI_IMAGE_DOS_HEADER *DosHdr;
EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
UINTN DirCount;
VOID *CodeViewEntryPointer;
INTN TEImageAdjust;
UINT32 NumberOfRvaAndSizes;
UINT16 Magic;
UINTN SizeOfHeaders;
ASSERT (Pe32Data != NULL);
TEImageAdjust = 0;
DirectoryEntry = NULL;
DebugEntry = NULL;
NumberOfRvaAndSizes = 0;
SizeOfHeaders = 0;
DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
//
// DOS image header is present, so read the PE header after the DOS image header.
//
Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHdr->e_lfanew) & 0x0ffff));
} else {
//
// DOS image header is not present, so PE header is at the image base.
//
Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
}
if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
if (Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {
DirectoryEntry = &Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];
TEImageAdjust = sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;
DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) Hdr.Te +
Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +
TEImageAdjust);
}
SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN)Hdr.Te->BaseOfCode - (UINTN)Hdr.Te->StrippedSize;
// __APPLE__ check this math...
*DebugBase = ((CHAR8 *)Pe32Data) - TEImageAdjust;
} else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
*DebugBase = Pe32Data;
//
// NOTE: We use Machine field to identify PE32/PE32+, instead of Magic.
// It is due to backward-compatibility, for some system might
// generate PE32+ image with PE32 Magic.
//
switch (Hdr.Pe32->FileHeader.Machine) {
case EFI_IMAGE_MACHINE_IA32:
//
// Assume PE32 image with IA32 Machine field.
//
Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
break;
case EFI_IMAGE_MACHINE_X64:
case EFI_IMAGE_MACHINE_IA64:
//
// Assume PE32+ image with X64 or IPF Machine field
//
Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
break;
default:
//
// For unknow Machine field, use Magic in optional Header
//
Magic = Hdr.Pe32->OptionalHeader.Magic;
}
if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
//
// Use PE32 offset get Debug Directory Entry
//
SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders;
NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);
} else if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
//
// Use PE32+ offset get Debug Directory Entry
//
SizeOfHeaders = Hdr.Pe32Plus->OptionalHeader.SizeOfHeaders;
NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);
}
if (NumberOfRvaAndSizes <= EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
DirectoryEntry = NULL;
DebugEntry = NULL;
}
} else {
return NULL;
}
if (DebugEntry == NULL || DirectoryEntry == NULL) {
return NULL;
}
for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY), DebugEntry++) {
if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
if (DebugEntry->SizeOfData > 0) {
CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + ((UINTN)Pe32Data) + (UINTN)TEImageAdjust);
switch (* (UINT32 *) CodeViewEntryPointer) {
case CODEVIEW_SIGNATURE_NB10:
return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY));
case CODEVIEW_SIGNATURE_RSDS:
return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY));
case CODEVIEW_SIGNATURE_MTOC:
*DebugBase = (VOID *)(UINTN)((UINTN)DebugBase - SizeOfHeaders);
return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY));
default:
break;
}
}
}
}
(void)SizeOfHeaders;
return NULL;
}
/**
Process "qXfer:object:read:annex:offset,length" request.
Returns an XML document that contains loaded libraries. In our case it is
information in the EFI Debug Image Table converted into an XML document.
GDB will call with an arbitrary length (it can't know the real length and
will reply with chunks of XML that are easy for us to deal with. Gdb will
keep calling until we say we are done. XML doc looks like:
<library-list>
<library name="/a/a/c/d.dSYM"><segment address="0x10000000"/></library>
<library name="/a/m/e/e.pdb"><segment address="0x20000000"/></library>
<library name="/a/l/f/f.dll"><segment address="0x30000000"/></library>
</library-list>
Since we can not allocate memory in interrupt context this module has
assumptions about how it will get called:
1) Length will generally be max remote packet size (big enough)
2) First Offset of an XML document read needs to be 0
3) This code will return back small chunks of the XML document on every read.
Each subsequent call will ask for the next available part of the document.
Note: The only variable size element in the XML is:
" <library name=\"%s\"><segment address=\"%p\"/></library>\n" and it is
based on the file path and name of the symbol file. If the symbol file name
is bigger than the max gdb remote packet size we could update this code
to respond back in chunks.
@param Offset offset into special data area
@param Length number of bytes to read starting at Offset
**/
VOID
QxferLibrary (
IN UINTN Offset,
IN UINTN Length
)
{
VOID *LoadAddress;
CHAR8 *Pdb;
UINTN Size;
if (Offset != gPacketqXferLibraryOffset) {
SendError (GDB_EINVALIDARG);
Print (L"\nqXferLibrary (%d, %d) != %d\n", Offset, Length, gPacketqXferLibraryOffset);
// Force a retry from the beginning
gPacketqXferLibraryOffset = 0;
return;
}
if (Offset == 0) {
gPacketqXferLibraryOffset += gXferObjectReadResponse ('m', "<library-list>\n");
// The owner of the table may have had to ralloc it so grab a fresh copy every time
// we assume qXferLibrary will get called over and over again until the entire XML table is
// returned in a tight loop. Since we are in the debugger the table should not get updated
gDebugTable = gDebugImageTableHeader->EfiDebugImageInfoTable;
gEfiDebugImageTableEntry = 0;
return;
}
if (gDebugTable != NULL) {
for (; gEfiDebugImageTableEntry < gDebugImageTableHeader->TableSize; gEfiDebugImageTableEntry++, gDebugTable++) {
if (gDebugTable->NormalImage != NULL) {
if ((gDebugTable->NormalImage->ImageInfoType == EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL) &&
(gDebugTable->NormalImage->LoadedImageProtocolInstance != NULL)) {
Pdb = PeCoffLoaderGetDebuggerInfo (
gDebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase,
&LoadAddress
);
if (Pdb != NULL) {
Size = AsciiSPrint (
gXferLibraryBuffer,
sizeof (gXferLibraryBuffer),
" <library name=\"%a\"><segment address=\"0x%p\"/></library>\n",
Pdb,
LoadAddress
);
if ((Size != 0) && (Size != (sizeof (gXferLibraryBuffer) - 1))) {
gPacketqXferLibraryOffset += gXferObjectReadResponse ('m', gXferLibraryBuffer);
// Update loop variables so we are in the right place when we get back
gEfiDebugImageTableEntry++;
gDebugTable++;
return;
} else {
// We could handle <library> entires larger than sizeof (gXferLibraryBuffer) here if
// needed by breaking up into N packets
// "<library name=\"%s
// the rest of the string (as many packets as required
// \"><segment address=\"%d\"/></library> (fixed size)
//
// But right now we just skip any entry that is too big
}
}
}
}
}
}
gXferObjectReadResponse ('l', "</library-list>\n");
gPacketqXferLibraryOffset = 0;
return;
}
/**
Exception Hanldler for GDB. It will be called for all exceptions
registered via the gExceptionType[] array.
@param ExceptionType Exception that is being processed
@param SystemContext Register content at time of the exception
**/
VOID
EFIAPI
GdbExceptionHandler (
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
{
UINT8 GdbExceptionType;
CHAR8 *Ptr;
if (ValidateException (ExceptionType, SystemContext) == FALSE) {
return;
}
RemoveSingleStep (SystemContext);
GdbExceptionType = ConvertEFItoGDBtype (ExceptionType);
GdbSendTSignal (SystemContext, GdbExceptionType);
for( ; ; ) {
ReceivePacket (gInBuffer, MAX_BUF_SIZE);
switch (gInBuffer[0]) {
case '?':
GdbSendTSignal (SystemContext, GdbExceptionType);
break;
case 'c':
ContinueAtAddress (SystemContext, gInBuffer);
return;
case 'g':
ReadGeneralRegisters (SystemContext);
break;
case 'G':
WriteGeneralRegisters (SystemContext, gInBuffer);
break;
case 'H':
//Return "OK" packet since we don't have more than one thread.
SendSuccess ();
break;
case 'm':
ReadFromMemory (gInBuffer);
break;
case 'M':
WriteToMemory (gInBuffer);
break;
case 'P':
WriteNthRegister (SystemContext, gInBuffer);
break;
//
// Still debugging this code. Not used in Darwin
//
case 'q':
// General Query Packets
if (AsciiStrnCmp (gInBuffer, "qSupported", 10) == 0) {
// return what we currently support, we don't parse what gdb suports
AsciiSPrint (gOutBuffer, MAX_BUF_SIZE, "qXfer:libraries:read+;PacketSize=%d", MAX_BUF_SIZE);
SendPacket (gOutBuffer);
} else if (AsciiStrnCmp (gInBuffer, "qXfer:libraries:read::", 22) == 0) {
// ‘qXfer:libraries:read::offset,length
// gInBuffer[22] is offset string, ++Ptr is length string’
for (Ptr = &gInBuffer[22]; *Ptr != ','; Ptr++);
// Not sure if multi-radix support is required. Currently only support decimal
QxferLibrary (AsciiStrHexToUintn (&gInBuffer[22]), AsciiStrHexToUintn (++Ptr));
} if (AsciiStrnCmp (gInBuffer, "qOffsets", 10) == 0) {
AsciiSPrint (gOutBuffer, MAX_BUF_SIZE, "Text=1000;Data=f000;Bss=f000");
SendPacket (gOutBuffer);
} else {
//Send empty packet
SendNotSupported ();
}
break;
case 's':
SingleStep (SystemContext, gInBuffer);
return;
case 'z':
RemoveBreakPoint (SystemContext, gInBuffer);
break;
case 'Z':
InsertBreakPoint (SystemContext, gInBuffer);
break;
default:
//Send empty packet
SendNotSupported ();
break;
}
}
}
/**
Periodic callback for GDB. This function is used to catch a ctrl-c or other
break in type command from GDB.
@param SystemContext Register content at time of the call
**/
VOID
EFIAPI
GdbPeriodicCallBack (
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
{
//
// gCtrlCBreakFlag may have been set from a previous F response package
// and we set the global as we need to process it at a point where we
// can update the system context. If we are in the middle of processing
// a F Packet it is not safe to read the GDB serial stream so we need
// to skip it on this check
//
if (!gCtrlCBreakFlag && !gProcessingFPacket) {
//
// Ctrl-C was not pending so grab any pending characters and see if they
// are a Ctrl-c (0x03). If so set the Ctrl-C global.
//
while (TRUE) {
if (!GdbIsCharAvailable ()) {
//
// No characters are pending so exit the loop
//
break;
}
if (GdbGetChar () == 0x03) {
gCtrlCBreakFlag = TRUE;
//
// We have a ctrl-c so exit the loop
//
break;
}
}
}
if (gCtrlCBreakFlag) {
//
// Update the context to force a single step trap when we exit the GDB
// stub. This will transfer control to GdbExceptionHandler () and let
// us break into the program. We don't want to break into the GDB stub.
//
AddSingleStep (SystemContext);
gCtrlCBreakFlag = FALSE;
}
}
|
47c9b80c85a0f5d9417f76c624602d4f7031c0ec
|
eecd5e4c50d8b78a769bcc2675250576bed34066
|
/src/vec/is/sf/utils/f90-custom/zsfutilsf90.c
|
4aa26a06ed051b858ff4a51bd5ebaf707947e225
|
[
"BSD-2-Clause"
] |
permissive
|
petsc/petsc
|
3b1a04fea71858e0292f9fd4d04ea11618c50969
|
9c5460f9064ca60dd71a234a1f6faf93e7a6b0c9
|
refs/heads/main
| 2023-08-17T20:51:16.507070
| 2023-08-17T16:08:06
| 2023-08-17T16:08:06
| 8,691,401
| 341
| 169
|
NOASSERTION
| 2023-03-29T11:02:58
| 2013-03-10T20:55:21
|
C
|
UTF-8
|
C
| false
| false
| 1,869
|
c
|
zsfutilsf90.c
|
#include <petsc/private/f90impl.h>
#include <petscsf.h>
#include <petscsection.h>
#if defined(PETSC_HAVE_FORTRAN_CAPS)
#define petscsfdistributesectionf90_ PETSCSFDISTRIBUTESECTIONF90
#define petscsfcreatesectionsff90_ PETSCSFCREATESECTIONSFF90
#define petscsfcreateremoteoffsetsf90_ PETSCSFCREATEREMOTEOFFSETSF90
#elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
#define petscsfdistributesectionf90_ petscsfdistributesectionf90
#define petscsfcreatesectionsff90_ petscsfcreatesectionsff90
#define petscsfcreateremoteoffsetsf90_ petscsfcreateremoteoffsetsf90
#endif
PETSC_EXTERN void petscsfdistributesectionf90_(PetscSF *sf, PetscSection *rootSection, F90Array1d *ptr, PetscSection *leafSection, int *__ierr PETSC_F90_2PTR_PROTO(ptrd))
{
PetscInt *fa;
*__ierr = F90Array1dAccess(ptr, MPIU_INT, (void **)&fa PETSC_F90_2PTR_PARAM(ptrd));
if (*__ierr) return;
*__ierr = PetscSFDistributeSection(*sf, *rootSection, &fa, *leafSection);
}
PETSC_EXTERN void petscsfcreatesectionsff90_(PetscSF *pointSF, PetscSection *rootSection, F90Array1d *ptr, PetscSection *leafSection, PetscSF *sf, int *__ierr PETSC_F90_2PTR_PROTO(ptrd))
{
PetscInt *fa;
*__ierr = F90Array1dAccess(ptr, MPIU_INT, (void **)&fa PETSC_F90_2PTR_PARAM(ptrd));
if (*__ierr) return;
*__ierr = PetscSFCreateSectionSF(*pointSF, *rootSection, fa, *leafSection, sf);
}
PETSC_EXTERN void petscsfcreateremoteoffsetsf90_(PetscSF *pointSF, PetscSection *rootSection, PetscSection *leafSection, F90Array1d *ptr, int *__ierr PETSC_F90_2PTR_PROTO(ptrd))
{
PetscInt *fa;
PetscInt lpStart, lpEnd;
*__ierr = PetscSFCreateRemoteOffsets(*pointSF, *rootSection, *leafSection, &fa);
*__ierr = PetscSectionGetChart(*leafSection, &lpStart, &lpEnd);
if (*__ierr) return;
*__ierr = F90Array1dCreate((void *)fa, MPIU_INT, 1, lpEnd - lpStart, ptr PETSC_F90_2PTR_PARAM(ptrd));
}
|
1c8b8e0d6d8fd020ddb95979347b29bdc752bae6
|
95753e92497eb499f1a20262e9639e4309cc8378
|
/demo_algorithms/mag_calibrate_src/libmymath/mymath.h
|
2391b689cb39292ef9149eb5d1dc39e49574fb65
|
[
"MIT"
] |
permissive
|
Aceinna/gnss-ins-sim
|
cf9cf890048cae832c39980424196f96c64df020
|
020ca3798e931813c6e394ba822d4d3c43218a0f
|
refs/heads/master
| 2023-08-19T19:35:20.285793
| 2023-03-17T03:15:23
| 2023-03-17T03:15:23
| 115,900,361
| 999
| 298
|
MIT
| 2023-03-17T03:15:24
| 2018-01-01T05:02:47
|
Python
|
UTF-8
|
C
| false
| false
| 16,201
|
h
|
mymath.h
|
/*****************************************************************************
* 矩阵运算\矢量运算\缓冲区操作\均值方差运算\四元数运算\均值滤波\中值滤波\一般滤波
* Author: Dong Xiaoguang
* Created on 2015/11/24
*****************************************************************************/
#ifndef MY_MATH_H_INCLUDED
#define MY_MATH_H_INCLUDED
//===========================REAL or float=========================
#define PRECISION_REAL 1
#if PRECISION_REAL
#define REAL double
#else
#define REAL float
#endif
//===========================some constants==========================
#if PRECISION_REAL
#define PI 3.14159265358979323846
#define R2D 180.0/PI
#else
#define PI 3.14159265358979323846f
#define R2D 180.0f/PI
#endif
//======================data struct definitions======================
typedef struct _buffer
{
REAL *d;//数据,每列是一组完整数据
int m;//总行数
int n;//总列数
int i;//当前写入数据索引, -1表示没有数据
int full;//是否存满buffer, 0表示没满,1表示满;
int num;//当前缓冲区内数据量
}Buffer;
//===================================================================
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
//===========================math operations=========================
//-------------------------------------------------------------------
// 打印矢量的全部元素
// input: v--矢量
// n--矢量长度
// output:
// return:
void printVec(REAL *v, int n);
//-------------------------------------------------------------------
// 打印矩阵的全部元素
// input: a--矢量
// m--行数
// n--列数
// output:
// return:
void printMtx(REAL *a, int m, int n);
//-------------------------------------------------------------------
// vector add
// a, b and c are vectors with n elements
// c = a+b
void vecAdd(REAL* a, REAL* b, REAL* c, int n);
//-------------------------------------------------------------------
// vector subtraction
// a, b and c are vectors with n elements
// c = a-b
void vecSub(REAL* a, REAL* b, REAL* c, int n);
//-------------------------------------------------------------------
// dot product
// a and b are vectors with n elements
// return a.b
REAL dot(REAL* a, REAL* b, int len);
//-------------------------------------------------------------------
// vector 2-norm
// return the 2-norm of a
REAL norm2(REAL* a, int n);
//-------------------------------------------------------------------
// 矢量归一化,1e-15还需进一步优化
// input: a--vector to be normalized
// len--vector length
// output: aN--normalized vector
// return:
void vecNormalize(REAL* a, REAL* aN, int len);
//-------------------------------------------------------------------
// 求数组均值
// input: a--vector
// n--length of the vector
// output:
// return: mean value of the first n elements of vector
REAL vecMean(REAL *a, int n);
//-------------------------------------------------------------------
// 数组方差
// input: a--vector
// am--数组的均值
// n--length of the vector
// output:
// return: variance of the first n elements of vector
REAL vecVar(REAL *a, REAL am, int n);
//-------------------------------------------------------------------
// 数组排序,升序
// input: a--vector
// n--length of the vector
// output: a--sorted vector
// return:
void vecSort(REAL *a, int n);
//-------------------------------------------------------------------
// 数组中最大元素的下标
// input: a--vector
// n--length of the vector
// output:
// return: index of the max element
int vecMax(REAL *a, int n);
//-------------------------------------------------------------------
// 数组中最小元素的下标
// input: a--vector
// n--length of the vector
// output:
// return: index of the min element
int vecMin(REAL *a, int n);
//-------------------------------------------------------------------
// 数组中所有元素取绝对值
// input: a--vector
// n--length of the vector
// output: b--abs(a)
// return:
void vecAbs(REAL *a, int n, REAL *b);
//-------------------------------------------------------------------
// 数组中所有元素求和
// input: a--vector
// n--length of the vector
// output:
// return: sum of all the elements
REAL vecSum(REAL *a, int n);
//-------------------------------------------------------------------
// 矢量叉乘
// input: a--vector
// b--vector
// output: c--axb
// return:
void cross(REAL* a, REAL* b, REAL* axb);
//-------------------------------------------------------------------
// vector multiplied by a constant
// intput: a--n vector
// b--constant scalar
// n--vector length
// output: c--b*a,n vector
void vecMultiplyConst(REAL* a,REAL b, REAL* c, int n);
//-------------------------------------------------------------------
// vector duplication
// input: vSrc--源矢量
// n--矢量长度
// output: vDst--目标矢量
// return:
void vecDuplicate(REAL* vSrc, REAL* vDst, int n);
//-------------------------------------------------------------------
// cross product matrix of a vector
// input: a--3-dim vector
// output: b--3x3 matrix
// return:
void crossMtx(REAL* a, REAL *b);
//-------------------------------------------------------------------
// max absolute elements in a matrix and its corresponding index
// input: a--a matrix
// m--rows
// n--columns
// output: mMax--row number of the max absolute element
// nMax--column number of the max absolute element
// return: max absolute value
REAL mtxMaxAbsIdx(REAL *a, int m, int n, int *mMax, int *nMax);
//-------------------------------------------------------------------
// max absolute elements in a matrix
// input: a--a matrix
// m--rows
// n--columns
// output:
// return: max absolute value
REAL mtxMaxAbs(REAL *a, int m, int n);
//-------------------------------------------------------------------
// one row of a matrix
// input: a--matrix
// m--row size
// n--col size
// r--index of the row to be extracted
// output: b--the r row of a
void mtxRow(REAL *a, int m, int n, int r, REAL *b);
//-------------------------------------------------------------------
// one column of a matrix
// input: a--matrix
// m--row size
// n--col size
// r--index of the column to be extracted
// output: b--the r column of a
void mtxCol(REAL *a, int m, int n, int r, REAL *b);
//-------------------------------------------------------------------
// lower triangular part of a matrix
// input: a--matrix
// m--row size
// n--col size
// output: l--tril(a)
// return:
void mtxTril(REAL *a, int m, int n, REAL *l);
//-------------------------------------------------------------------
// upper triangular part of a matrix
// input: a--matrix
// m--row size
// n--col size
// output: u--triu(a)
// return:
void mtxTriu(REAL *a, int m, int n, REAL *u);
//-------------------------------------------------------------------
// matrix duplication
// input: aSrc--源矩阵
// m--矩阵行数
// n--矩阵列数
// output: aDst--目标矢量
// return:
void mtxDuplicate(REAL* aSrc, REAL* aDst, int m, int n);
//-------------------------------------------------------------------
// matrix multiplication
// input: a--matrix(aRow x aCol), b--matrix(aCol x bCol)
// output: c--matrix(aRow x bCol)
void mtxMultiply(REAL* a, REAL* b, REAL* c, int aRow, int aCol,int bCol);
//-------------------------------------------------------------------
// matrix multiplied by a constant
// input: a--matrix(row x col), b--constant
// output: c--b*a;
void mtxMultiplyConst(REAL* a, REAL b, REAL* c, int row, int col);
//-------------------------------------------------------------------
// matrix add
// input: a and b are matrices(row x col)
// output: c = a+b
void mtxAdd(REAL* a,REAL *b,REAL *c, int row, int col);
//-------------------------------------------------------------------
// matrix substraction
// input: a and b are matrices(row x col)
// output: c = a-b
void mtxSub(REAL* a,REAL* b,REAL* c, int row, int col);
//-------------------------------------------------------------------
// merge two matrices along the row
// input: a--mxn, b--mxq
// output: c--mx(n+q)
void mtxMergeRow(REAL* a, REAL* b, REAL* c, int m, int n, int q);
//-------------------------------------------------------------------
// merge two matrices along col
// input: a--mxn, b--pxn
// output: c--(m+p)xn
void mtxMergeCol(REAL* a, REAL* b, REAL* c, int m, int n, int p);
//-------------------------------------------------------------------
// matrix tranpose
// input: a--matrix(row x col)
// output: aT = a'
void mtxTranspose(REAL* a, REAL* aT, int row, int col);
//-------------------------------------------------------------------
// matrix multiplied by a vector
// input: a--mxn matrix, b--nx1 vector
// return: c--a*b,mx1 vector
void mtxMultiplyVec(REAL* a, REAL* b, REAL* c, int m, int n);
//-------------------------------------------------------------------
// 2x2 matrix inverse
// input: a--matrix(2 x 2)
// output: x--inv(x)
void mtxInverse2(REAL* a, REAL* x);
//-------------------------------------------------------------------
// 3x3 matrix inverse
// input: a--matrix(3 x 3)
// output: x--inv(x)
void mtxInverse3(REAL* a, REAL* x);
//-------------------------------------------------------------------
// 4x4 matrix inverse
// input: a--matrix(4 x 4)
// output: x--inv(x)
void mtxInverse4(REAL* a, REAL* x);
//-------------------------------------------------------------------
// matrix inverse
// input: a--matrix(n x n)
// output: x--inv(x)
void mtxInverse(REAL* a, REAL* x, int n);
//-------------------------------------------------------------------
// eigenvalue and eigenvector of a real symmetric matrix
// input: a--nxn real symmetric matrix
// n--size of matrix a
// eps--tolerance
// jt--max iterations
// output: a--eigenvalue will be stored as diagonal elements in matrix a
// u--nxn matrix containing engenvector, stored as column
// return: 1 means OK, less than 0 means tolerance is not met after jt ierations
int realSymmetricMtxEig(double *a,int n,double *v,double eps,int jt);
//-------------------------------------------------------------------
// generate diagonal matrix
// input: a--nx1 vector containing the diagonal elements
// n--length of the vector
// output: b = diag(a), nxn
// return:
void diag(REAL* a, REAL* b, int n);
//-------------------------------------------------------------------
// generate identity matrix
// input: a--matrix
// n--size of the identity matrix
// output: a = eye(n)
// return:
void eye(REAL *a, int n);
//-------------------------------------------------------------------
// generate zeros matrix
// input: a--matrix
// m--rows
// n--columns
// output: a = zeros(n)
// return:
void zeros(REAL *a, int m, int n);
//-------------------------------------------------------------------
// generate ones matrix
// input: a--matrix
// m--rows
// n--columns
// output: a = ones(n)
// return:
void ones(REAL *a, int m, int n);
//-------------------------------------------------------------------
// exchange two row of a matrix
// input: a--mxn
// m--rows
// n--columns
// r1,r2--rows to be exchanged, zero based
// output:
// return: 1 means success, 0 error
int mtxExchangeRow(REAL* a, int m, int n, int r1, int r2);
//-------------------------------------------------------------------
// exchange two columns of a matrix
// input: a--mxn
// m--rows
// n--columns
// c1,c2--columns to be exchanged, zero based
// output:
// return: 1 means success, 0 error
int mtxExchangeCol(REAL* a, int m, int n, int c1, int c2);
//-------------------------------------------------------------------
// 新建缓冲区
// input: bf--缓冲区指针
// d--缓冲区数据地址
// m--行数
// n--列数
// output:
// return:
void bfNew(Buffer *bf, REAL*d, int m, int n);
//-------------------------------------------------------------------
// input: bf--buffer指针
// d--数据指针
// output:
// return:
void bfPut(Buffer *bf, REAL* d);
//===================================================================
//-------------------------------------------------------------------
// 读取缓冲区数据
// input: bf--buffer指针
// idx--数据的序号,idx=0表示当前数据,idx=1表示当前数据的前1一个数据,以此类推
// output:
// return: 1表示成功,0表示idx超出范围
int bfGet(Buffer *bf,REAL *d, int idx);
//-------------------------------------------------------------------
// 清空缓冲区
// input: bf--buffer指针
// output:
// return:
void bfClear(Buffer *bf);
//-------------------------------------------------------------------
// 对缓冲区内数据进行中值滤波
// input: u--输入缓冲区
// y--滤波结果
// n--中值滤波点数
// output:
// return: 1正确,0出错
int medFilter(Buffer *u, REAL *y, int n);
//-------------------------------------------------------------------
// 均值滤波
// input: u--输入缓冲区
// y--滤波结果
// n--均值滤波点数
// output:
// return: 1正确,0出错
int meanFilter(Buffer *u, REAL *y, int n);
//===================================================================
// 注意:所有四元数皆是标量在前
//-------------------------------------------------------------------
// 四元数归一化(模太小的四元数的处理方法需要更新)
// input: q--输入四元数
// output: qN--归一化四元数
// return:
void quatNormalize(REAL* q, REAL* qN);
//-------------------------------------------------------------------
// 四元数转方向余弦矩阵
// input: q--输入四元数
// output: dcm--方向余弦矩阵
// return:
void quat2DCM(REAL *q, REAL *dcm);
//-------------------------------------------------------------------
// 方向余弦矩阵转四元数
// input: a--方向余弦矩阵
// output: q--四元数
// return:
void dcm2Quat(REAL *a, REAL *q);
//-------------------------------------------------------------------
// 四元数共轭
// input: q--输入四元数
// output: qconj--共轭四元数
// return:
void quatConj(REAL *q, REAL *qconj);
//-------------------------------------------------------------------
// 四元数相乘
// input: q1--输入四元数
// q2--输入四元数
// output: q--q1xq2
// return:
void quatMultiply(REAL* q1, REAL* q2, REAL* q);
//-------------------------------------------------------------------
// 四元数积分
// input: q--待积分四元数
// w--角速度
// t--积分步长
// output: q--积分后四元数
// return:
void quatIntegrate(REAL* q, REAL* w, REAL t);
//void quatIntegrate2(REAL* q, REAL* w, REAL t);
//-------------------------------------------------------------------
// 线性拟合
// input: data--存储数据的数组,data[0]最老
// n--数组长度
// output: a--2维数组,y = a[0]x + a[1]
// return;
void PolyFit1(REAL *data, REAL *a, int n);
//-------------------------------------------------------------------
// modulus
// input: x--
// y--
// output:
// return: x - y*floor(x/y)
REAL mod(REAL x, REAL y);
#endif // MY_MATH_H_INCLUDED
|
9eddbd31ef49b95f91c1a30122fa9e2fe6b17846
|
cffb2c8cd029670f8c3dbb6e5451c066b76d6804
|
/tests/assembly/cmov/cmovl-rm/main.c
|
a4fcdbdeeec396cc6a16c352aa1d460aa72b7f3b
|
[
"BSD-2-Clause"
] |
permissive
|
sslab-gatech/qsym
|
7cf0d66a416f8e0f289ebec6484becad964704fa
|
153a0b468258e76e03e5d9763a11349e744844fa
|
refs/heads/master
| 2022-12-11T21:44:20.473329
| 2022-11-23T00:23:07
| 2022-11-23T00:23:07
| 145,025,326
| 634
| 141
|
NOASSERTION
| 2022-05-16T01:14:11
| 2018-08-16T18:30:29
|
C++
|
UTF-8
|
C
| false
| false
| 52
|
c
|
main.c
|
#include "cmov.h"
int main() {
CMOV_RM(cmovl);
}
|
5f60d2facf71b072b782ddb09381996a515c0092
|
f79dec3c4033ca3cbb55d8a51a748cc7b8b6fbab
|
/mail/thunderbird31/patches/patch-mozilla_ipc_chromium_src_base_file__util.h
|
45cdcc0d6ccaa7ee26b494a7a0759982e84a8770
|
[] |
no_license
|
jsonn/pkgsrc
|
fb34c4a6a2d350e8e415f3c4955d4989fcd86881
|
c1514b5f4a3726d90e30aa16b0c209adbc276d17
|
refs/heads/trunk
| 2021-01-24T09:10:01.038867
| 2017-07-07T15:49:43
| 2017-07-07T15:49:43
| 2,095,004
| 106
| 47
| null | 2016-09-19T09:26:01
| 2011-07-23T23:49:04
|
Makefile
|
UTF-8
|
C
| false
| false
| 406
|
h
|
patch-mozilla_ipc_chromium_src_base_file__util.h
|
$NetBSD: patch-mozilla_ipc_chromium_src_base_file__util.h,v 1.1 2015/07/13 17:49:26 ryoon Exp $
--- mozilla/ipc/chromium/src/base/file_util.h.orig 2014-07-18 00:05:24.000000000 +0000
+++ mozilla/ipc/chromium/src/base/file_util.h
@@ -16,7 +16,9 @@
#include <sys/stat.h>
#elif defined(OS_POSIX)
#include <sys/types.h>
+#if !defined(OS_SOLARIS)
#include <fts.h>
+#endif
#include <sys/stat.h>
#endif
|
1f4622fcfc615e6107570a78574950a662ad8e05
|
847ebadf2b0e7c01ad33ce92b42528a1a5c4846c
|
/lib/dpif-netdev-private-dfc.h
|
3dfc91f0fe6ab67964ffdd7125380e77ff4b4e34
|
[
"Apache-2.0",
"BSD-3-Clause",
"ISC",
"SISSL",
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"BSD-2-Clause"
] |
permissive
|
openvswitch/ovs
|
6f782527cf5fde4ccfd25e68d359b91ff41acf8a
|
bc79a7bf033fa4cda8ccfc5481db3cfccd72650c
|
refs/heads/master
| 2023-09-04T06:31:47.899017
| 2023-08-03T16:19:12
| 2023-09-01T20:15:05
| 18,383,364
| 3,366
| 2,259
|
Apache-2.0
| 2023-08-17T13:17:13
| 2014-04-02T22:15:28
|
C
|
UTF-8
|
C
| false
| false
| 6,566
|
h
|
dpif-netdev-private-dfc.h
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc.
* Copyright (c) 2019, 2020, 2021 Intel Corporation.
*
* 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.
*/
#ifndef DPIF_NETDEV_PRIVATE_DFC_H
#define DPIF_NETDEV_PRIVATE_DFC_H 1
#include "dpif.h"
#include "dpif-netdev-private-dpcls.h"
#include "dpif-netdev-private-flow.h"
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/* EMC cache and SMC cache compose the datapath flow cache (DFC)
*
* Exact match cache for frequently used flows
*
* The cache uses a 32-bit hash of the packet (which can be the RSS hash) to
* search its entries for a miniflow that matches exactly the miniflow of the
* packet. It stores the 'dpcls_rule' (rule) that matches the miniflow.
*
* A cache entry holds a reference to its 'dp_netdev_flow'.
*
* A miniflow with a given hash can be in one of EM_FLOW_HASH_SEGS different
* entries. The 32-bit hash is split into EM_FLOW_HASH_SEGS values (each of
* them is EM_FLOW_HASH_SHIFT bits wide and the remainder is thrown away). Each
* value is the index of a cache entry where the miniflow could be.
*
*
* Signature match cache (SMC)
*
* This cache stores a 16-bit signature for each flow without storing keys, and
* stores the corresponding 16-bit flow_table index to the 'dp_netdev_flow'.
* Each flow thus occupies 32bit which is much more memory efficient than EMC.
* SMC uses a set-associative design that each bucket contains
* SMC_ENTRY_PER_BUCKET number of entries.
* Since 16-bit flow_table index is used, if there are more than 2^16
* dp_netdev_flow, SMC will miss them that cannot be indexed by a 16-bit value.
*
*
* Thread-safety
* =============
*
* Each pmd_thread has its own private exact match cache and signature match
* cache.
* If dp_netdev_input is not called from a pmd thread, a mutex is used.
*/
#define EM_FLOW_HASH_SHIFT 13
#define EM_FLOW_HASH_ENTRIES (1u << EM_FLOW_HASH_SHIFT)
#define EM_FLOW_HASH_MASK (EM_FLOW_HASH_ENTRIES - 1)
#define EM_FLOW_HASH_SEGS 2
/* SMC uses a set-associative design. A bucket contains a set of entries that
* a flow item can occupy. For now, it uses one hash function rather than two
* as for the EMC design. */
#define SMC_ENTRY_PER_BUCKET 4
#define SMC_ENTRIES (1u << 20)
#define SMC_BUCKET_CNT (SMC_ENTRIES / SMC_ENTRY_PER_BUCKET)
#define SMC_MASK (SMC_BUCKET_CNT - 1)
/* Default EMC insert probability is 1 / DEFAULT_EM_FLOW_INSERT_INV_PROB */
#define DEFAULT_EM_FLOW_INSERT_INV_PROB 100
#define DEFAULT_EM_FLOW_INSERT_MIN (UINT32_MAX / \
DEFAULT_EM_FLOW_INSERT_INV_PROB)
/* Forward declaration for SMC function prototype that requires access to
* 'struct dp_netdev_pmd_thread'. */
struct dp_netdev_pmd_thread;
/* Forward declaration for EMC and SMC batch insert function prototypes that
* require access to 'struct dpcls_rule'. */
struct dpcls_rule;
struct emc_entry {
struct dp_netdev_flow *flow;
struct netdev_flow_key key; /* key.hash used for emc hash value. */
};
struct emc_cache {
struct emc_entry entries[EM_FLOW_HASH_ENTRIES];
int sweep_idx; /* For emc_cache_slow_sweep(). */
};
struct smc_bucket {
uint16_t sig[SMC_ENTRY_PER_BUCKET];
uint16_t flow_idx[SMC_ENTRY_PER_BUCKET];
};
/* Signature match cache, differentiate from EMC cache */
struct smc_cache {
struct smc_bucket buckets[SMC_BUCKET_CNT];
};
struct dfc_cache {
struct emc_cache emc_cache;
struct smc_cache smc_cache;
};
/* Iterate in the exact match cache through every entry that might contain a
* miniflow with hash 'HASH'. */
#define EMC_FOR_EACH_POS_WITH_HASH(EMC, CURRENT_ENTRY, HASH) \
for (uint32_t i__ = 0, srch_hash__ = (HASH); \
(CURRENT_ENTRY) = &(EMC)->entries[srch_hash__ & EM_FLOW_HASH_MASK], \
i__ < EM_FLOW_HASH_SEGS; \
i__++, srch_hash__ >>= EM_FLOW_HASH_SHIFT)
void dfc_cache_init(struct dfc_cache *flow_cache);
void dfc_cache_uninit(struct dfc_cache *flow_cache);
/* Check and clear dead flow references slowly (one entry at each
* invocation). */
void emc_cache_slow_sweep(struct emc_cache *flow_cache);
static inline bool
emc_entry_alive(struct emc_entry *ce)
{
return ce->flow && !ce->flow->dead;
}
/* Used to compare 'netdev_flow_key' in the exact match cache to a miniflow.
* The maps are compared bitwise, so both 'key->mf' and 'mf' must have been
* generated by miniflow_extract. */
static inline bool
emc_flow_key_equal_mf(const struct netdev_flow_key *key,
const struct miniflow *mf)
{
return !memcmp(&key->mf, mf, key->len);
}
static inline struct dp_netdev_flow *
emc_lookup(struct emc_cache *cache, const struct netdev_flow_key *key)
{
struct emc_entry *current_entry;
EMC_FOR_EACH_POS_WITH_HASH (cache, current_entry, key->hash) {
if (current_entry->key.hash == key->hash
&& emc_entry_alive(current_entry)
&& emc_flow_key_equal_mf(¤t_entry->key, &key->mf)) {
/* We found the entry with the 'key->mf' miniflow */
return current_entry->flow;
}
}
return NULL;
}
/* Insert a batch of keys/flows into the EMC and SMC caches. */
void
emc_probabilistic_insert_batch(struct dp_netdev_pmd_thread *pmd,
const struct netdev_flow_key *keys,
struct dpcls_rule **rules,
uint32_t emc_insert_mask);
void
smc_insert_batch(struct dp_netdev_pmd_thread *pmd,
const struct netdev_flow_key *keys,
struct dpcls_rule **rules,
uint32_t smc_insert_mask);
struct dp_netdev_flow *
smc_lookup_single(struct dp_netdev_pmd_thread *pmd,
struct dp_packet *packet,
struct netdev_flow_key *key);
#ifdef __cplusplus
}
#endif
#endif /* dpif-netdev-private-dfc.h */
|
5e4d140177847d16107f901181cb9653dca40d98
|
7c857119fe1505b1d80d6e62969661c06dc1a2f4
|
/MdeModulePkg/Library/PlatformVarCleanupLib/PlatVarCleanupHii.h
|
74bcdb4b9f73e9eea13ad7acb81c586bc254fd0c
|
[
"BSD-2-Clause"
] |
permissive
|
CloverHackyColor/CloverBootloader
|
7042ca7dd6b513d22be591a295e49071ae1482ee
|
2711170df4f60b2ae5aa20add3e00f35cf57b7e5
|
refs/heads/master
| 2023-08-30T22:14:34.590134
| 2023-08-27T19:14:02
| 2023-08-27T19:14:02
| 205,810,121
| 4,734
| 770
|
BSD-2-Clause
| 2023-09-03T12:41:33
| 2019-09-02T08:22:14
|
C
|
UTF-8
|
C
| false
| false
| 1,454
|
h
|
PlatVarCleanupHii.h
|
/** @file
Include file for platform variable cleanup HII.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef _PLAT_VAR_CLEANUP_HII_
#define _PLAT_VAR_CLEANUP_HII_
//
// {24F14D8A-D7A8-4991-91E0-96C3B7DB8456}
//
#define VARIABLE_CLEANUP_HII_GUID \
{ \
0x24f14d8a, 0xd7a8, 0x4991, { 0x91, 0xe0, 0x96, 0xc3, 0xb7, 0xdb, 0x84, 0x56 } \
}
#define MAX_USER_VARIABLE_COUNT 0x1000
typedef struct {
UINT8 SelectAll;
//
// FALSE is to not delete, TRUE is to delete.
//
UINT8 UserVariable[MAX_USER_VARIABLE_COUNT];
} VARIABLE_CLEANUP_DATA;
#define VARIABLE_CLEANUP_VARSTORE_ID 0x8000
//
// Field offset of structure VARIABLE_CLEANUP_DATA
//
#define VAR_OFFSET(Field) ((UINTN) &(((VARIABLE_CLEANUP_DATA *) 0)->Field))
#define USER_VARIABLE_VAR_OFFSET (VAR_OFFSET (UserVariable))
#define FORM_ID_VARIABLE_CLEANUP 0x8000
#define LABEL_START 0x0000
#define LABEL_END 0xFFFF
#define SELECT_ALL_QUESTION_ID 0x7FFD
#define SAVE_AND_EXIT_QUESTION_ID 0x7FFE
#define NO_SAVE_AND_EXIT_QUESTION_ID 0x7FFF
//
// Tool automatic generated Question Id start from 1.
// In order to avoid to conflict them, the user variable QuestionID offset is defined from 0x8000.
//
#define USER_VARIABLE_QUESTION_ID 0x8000
#endif
|
762470ca31cc7a007452aa42ef913da62e013c96
|
a91796ab826878e54d91c32249f45bb919e0c149
|
/3rdparty/libjpeg-turbo/src/simd/mips64/jdcolext-mmi.c
|
3b5b2f2030782c605647a5d06f35043420f99ff0
|
[
"IJG",
"Zlib",
"BSD-3-Clause",
"Libpng",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] |
permissive
|
opencv/opencv
|
8f1c8b5a16980f78de7c6e73a4340d302d1211cc
|
a308dfca9856574d37abe7628b965e29861fb105
|
refs/heads/4.x
| 2023-09-01T12:37:49.132527
| 2023-08-30T06:53:59
| 2023-08-30T06:53:59
| 5,108,051
| 68,495
| 62,910
|
Apache-2.0
| 2023-09-14T17:37:48
| 2012-07-19T09:40:17
|
C++
|
UTF-8
|
C
| false
| false
| 15,201
|
c
|
jdcolext-mmi.c
|
/*
* Loongson MMI optimizations for libjpeg-turbo
*
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
* Copyright (C) 2015, 2019, D. R. Commander. All Rights Reserved.
* Copyright (C) 2016-2018, Loongson Technology Corporation Limited, BeiJing.
* All Rights Reserved.
* Authors: ZhuChen <zhuchen@loongson.cn>
* SunZhangzhi <sunzhangzhi-cq@loongson.cn>
* CaiWanwei <caiwanwei@loongson.cn>
*
* Based on the x86 SIMD extension for IJG JPEG library
* Copyright (C) 1999-2006, MIYASAKA Masaru.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
/* This file is included by jdcolor-mmi.c */
#if RGB_RED == 0
#define mmA re
#define mmB ro
#elif RGB_GREEN == 0
#define mmA ge
#define mmB go
#elif RGB_BLUE == 0
#define mmA be
#define mmB bo
#else
#define mmA xe
#define mmB xo
#endif
#if RGB_RED == 1
#define mmC re
#define mmD ro
#elif RGB_GREEN == 1
#define mmC ge
#define mmD go
#elif RGB_BLUE == 1
#define mmC be
#define mmD bo
#else
#define mmC xe
#define mmD xo
#endif
#if RGB_RED == 2
#define mmE re
#define mmF ro
#elif RGB_GREEN == 2
#define mmE ge
#define mmF go
#elif RGB_BLUE == 2
#define mmE be
#define mmF bo
#else
#define mmE xe
#define mmF xo
#endif
#if RGB_RED == 3
#define mmG re
#define mmH ro
#elif RGB_GREEN == 3
#define mmG ge
#define mmH go
#elif RGB_BLUE == 3
#define mmG be
#define mmH bo
#else
#define mmG xe
#define mmH xo
#endif
void jsimd_ycc_rgb_convert_mmi(JDIMENSION out_width, JSAMPIMAGE input_buf,
JDIMENSION input_row, JSAMPARRAY output_buf,
int num_rows)
{
JSAMPROW outptr, inptr0, inptr1, inptr2;
int num_cols, col;
__m64 ye, yo, y, cbe, cbe2, cbo, cbo2, cb, cre, cre2, cro, cro2, cr;
__m64 re, ro, gle, ghe, ge, glo, gho, go, be, bo, xe = 0.0, xo = 0.0;
__m64 decenter, mask;
while (--num_rows >= 0) {
inptr0 = input_buf[0][input_row];
inptr1 = input_buf[1][input_row];
inptr2 = input_buf[2][input_row];
input_row++;
outptr = *output_buf++;
for (num_cols = out_width; num_cols > 0; num_cols -= 8,
inptr0 += 8, inptr1 += 8, inptr2 += 8) {
cb = _mm_load_si64((__m64 *)inptr1);
cr = _mm_load_si64((__m64 *)inptr2);
y = _mm_load_si64((__m64 *)inptr0);
mask = decenter = 0.0;
mask = _mm_cmpeq_pi16(mask, mask);
decenter = _mm_cmpeq_pi16(decenter, decenter);
mask = _mm_srli_pi16(mask, BYTE_BIT); /* {0xFF 0x00 0xFF 0x00 ..} */
decenter = _mm_slli_pi16(decenter, 7); /* {0xFF80 0xFF80 0xFF80 0xFF80} */
cbe = _mm_and_si64(mask, cb); /* Cb(0246) */
cbo = _mm_srli_pi16(cb, BYTE_BIT); /* Cb(1357) */
cre = _mm_and_si64(mask, cr); /* Cr(0246) */
cro = _mm_srli_pi16(cr, BYTE_BIT); /* Cr(1357) */
cbe = _mm_add_pi16(cbe, decenter);
cbo = _mm_add_pi16(cbo, decenter);
cre = _mm_add_pi16(cre, decenter);
cro = _mm_add_pi16(cro, decenter);
/* (Original)
* R = Y + 1.40200 * Cr
* G = Y - 0.34414 * Cb - 0.71414 * Cr
* B = Y + 1.77200 * Cb
*
* (This implementation)
* R = Y + 0.40200 * Cr + Cr
* G = Y - 0.34414 * Cb + 0.28586 * Cr - Cr
* B = Y - 0.22800 * Cb + Cb + Cb
*/
cbe2 = _mm_add_pi16(cbe, cbe); /* 2*CbE */
cbo2 = _mm_add_pi16(cbo, cbo); /* 2*CbO */
cre2 = _mm_add_pi16(cre, cre); /* 2*CrE */
cro2 = _mm_add_pi16(cro, cro); /* 2*CrO */
be = _mm_mulhi_pi16(cbe2, PW_MF0228); /* (2*CbE * -FIX(0.22800) */
bo = _mm_mulhi_pi16(cbo2, PW_MF0228); /* (2*CbO * -FIX(0.22800) */
re = _mm_mulhi_pi16(cre2, PW_F0402); /* (2*CrE * FIX(0.40200)) */
ro = _mm_mulhi_pi16(cro2, PW_F0402); /* (2*CrO * FIX(0.40200)) */
be = _mm_add_pi16(be, PW_ONE);
bo = _mm_add_pi16(bo, PW_ONE);
be = _mm_srai_pi16(be, 1); /* (CbE * -FIX(0.22800)) */
bo = _mm_srai_pi16(bo, 1); /* (CbO * -FIX(0.22800)) */
re = _mm_add_pi16(re, PW_ONE);
ro = _mm_add_pi16(ro, PW_ONE);
re = _mm_srai_pi16(re, 1); /* (CrE * FIX(0.40200)) */
ro = _mm_srai_pi16(ro, 1); /* (CrO * FIX(0.40200)) */
be = _mm_add_pi16(be, cbe);
bo = _mm_add_pi16(bo, cbo);
be = _mm_add_pi16(be, cbe); /* (CbE * FIX(1.77200))=(B-Y)E */
bo = _mm_add_pi16(bo, cbo); /* (CbO * FIX(1.77200))=(B-Y)O */
re = _mm_add_pi16(re, cre); /* (CrE * FIX(1.40200))=(R-Y)E */
ro = _mm_add_pi16(ro, cro); /* (CrO * FIX(1.40200))=(R-Y)O */
gle = _mm_unpacklo_pi16(cbe, cre);
ghe = _mm_unpackhi_pi16(cbe, cre);
gle = _mm_madd_pi16(gle, PW_MF0344_F0285);
ghe = _mm_madd_pi16(ghe, PW_MF0344_F0285);
glo = _mm_unpacklo_pi16(cbo, cro);
gho = _mm_unpackhi_pi16(cbo, cro);
glo = _mm_madd_pi16(glo, PW_MF0344_F0285);
gho = _mm_madd_pi16(gho, PW_MF0344_F0285);
gle = _mm_add_pi32(gle, PD_ONEHALF);
ghe = _mm_add_pi32(ghe, PD_ONEHALF);
gle = _mm_srai_pi32(gle, SCALEBITS);
ghe = _mm_srai_pi32(ghe, SCALEBITS);
glo = _mm_add_pi32(glo, PD_ONEHALF);
gho = _mm_add_pi32(gho, PD_ONEHALF);
glo = _mm_srai_pi32(glo, SCALEBITS);
gho = _mm_srai_pi32(gho, SCALEBITS);
ge = _mm_packs_pi32(gle, ghe); /* CbE*-FIX(0.344)+CrE*FIX(0.285) */
go = _mm_packs_pi32(glo, gho); /* CbO*-FIX(0.344)+CrO*FIX(0.285) */
ge = _mm_sub_pi16(ge, cre); /* CbE*-FIX(0.344)+CrE*-FIX(0.714)=(G-Y)E */
go = _mm_sub_pi16(go, cro); /* CbO*-FIX(0.344)+CrO*-FIX(0.714)=(G-Y)O */
ye = _mm_and_si64(mask, y); /* Y(0246) */
yo = _mm_srli_pi16(y, BYTE_BIT); /* Y(1357) */
re = _mm_add_pi16(re, ye); /* ((R-Y)E+YE)=(R0 R2 R4 R6) */
ro = _mm_add_pi16(ro, yo); /* ((R-Y)O+YO)=(R1 R3 R5 R7) */
re = _mm_packs_pu16(re, re); /* (R0 R2 R4 R6 ** ** ** **) */
ro = _mm_packs_pu16(ro, ro); /* (R1 R3 R5 R7 ** ** ** **) */
ge = _mm_add_pi16(ge, ye); /* ((G-Y)E+YE)=(G0 G2 G4 G6) */
go = _mm_add_pi16(go, yo); /* ((G-Y)O+YO)=(G1 G3 G5 G7) */
ge = _mm_packs_pu16(ge, ge); /* (G0 G2 G4 G6 ** ** ** **) */
go = _mm_packs_pu16(go, go); /* (G1 G3 G5 G7 ** ** ** **) */
be = _mm_add_pi16(be, ye); /* (YE+(B-Y)E)=(B0 B2 B4 B6) */
bo = _mm_add_pi16(bo, yo); /* (YO+(B-Y)O)=(B1 B3 B5 B7) */
be = _mm_packs_pu16(be, be); /* (B0 B2 B4 B6 ** ** ** **) */
bo = _mm_packs_pu16(bo, bo); /* (B1 B3 B5 B7 ** ** ** **) */
#if RGB_PIXELSIZE == 3
/* mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **) */
/* mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **) */
mmA = _mm_unpacklo_pi8(mmA, mmC); /* (00 10 02 12 04 14 06 16) */
mmE = _mm_unpacklo_pi8(mmE, mmB); /* (20 01 22 03 24 05 26 07) */
mmD = _mm_unpacklo_pi8(mmD, mmF); /* (11 21 13 23 15 25 17 27) */
mmH = _mm_srli_si64(mmA, 2 * BYTE_BIT);
mmG = _mm_unpackhi_pi16(mmA, mmE); /* (04 14 24 05 06 16 26 07) */
mmA = _mm_unpacklo_pi16(mmA, mmE); /* (00 10 20 01 02 12 22 03) */
mmE = _mm_srli_si64(mmE, 2 * BYTE_BIT);
mmB = _mm_srli_si64(mmD, 2 * BYTE_BIT); /* (13 23 15 25 17 27 -- --) */
mmC = _mm_unpackhi_pi16(mmD, mmH); /* (15 25 06 16 17 27 -- --) */
mmD = _mm_unpacklo_pi16(mmD, mmH); /* (11 21 02 12 13 23 04 14) */
mmF = _mm_unpackhi_pi16(mmE, mmB); /* (26 07 17 27 -- -- -- --) */
mmE = _mm_unpacklo_pi16(mmE, mmB); /* (22 03 13 23 24 05 15 25) */
mmA = _mm_unpacklo_pi32(mmA, mmD); /* (00 10 20 01 11 21 02 12) */
mmE = _mm_unpacklo_pi32(mmE, mmG); /* (22 03 13 23 04 14 24 05) */
mmC = _mm_unpacklo_pi32(mmC, mmF); /* (15 25 06 16 26 07 17 27) */
if (num_cols >= 8) {
if (!(((long)outptr) & 7)) {
_mm_store_si64((__m64 *)outptr, mmA);
_mm_store_si64((__m64 *)(outptr + 8), mmE);
_mm_store_si64((__m64 *)(outptr + 16), mmC);
} else {
_mm_storeu_si64((__m64 *)outptr, mmA);
_mm_storeu_si64((__m64 *)(outptr + 8), mmE);
_mm_storeu_si64((__m64 *)(outptr + 16), mmC);
}
outptr += RGB_PIXELSIZE * 8;
} else {
col = num_cols * 3;
asm(".set noreorder\r\n"
"li $8, 16\r\n"
"move $9, %4\r\n"
"mov.s $f4, %1\r\n"
"mov.s $f6, %3\r\n"
"move $10, %5\r\n"
"bltu $9, $8, 1f\r\n"
"nop \r\n"
"gssdlc1 $f4, 7($10)\r\n"
"gssdrc1 $f4, 0($10)\r\n"
"gssdlc1 $f6, 7+8($10)\r\n"
"gssdrc1 $f6, 8($10)\r\n"
"mov.s $f4, %2\r\n"
"subu $9, $9, 16\r\n"
PTR_ADDU "$10, $10, 16\r\n"
"b 2f\r\n"
"nop \r\n"
"1: \r\n"
"li $8, 8\r\n" /* st8 */
"bltu $9, $8, 2f\r\n"
"nop \r\n"
"gssdlc1 $f4, 7($10)\r\n"
"gssdrc1 $f4, 0($10)\r\n"
"mov.s $f4, %3\r\n"
"subu $9, $9, 8\r\n"
PTR_ADDU "$10, $10, 8\r\n"
"2: \r\n"
"li $8, 4\r\n" /* st4 */
"mfc1 $11, $f4\r\n"
"bltu $9, $8, 3f\r\n"
"nop \r\n"
"swl $11, 3($10)\r\n"
"swr $11, 0($10)\r\n"
"li $8, 32\r\n"
"mtc1 $8, $f6\r\n"
"dsrl $f4, $f4, $f6\r\n"
"mfc1 $11, $f4\r\n"
"subu $9, $9, 4\r\n"
PTR_ADDU "$10, $10, 4\r\n"
"3: \r\n"
"li $8, 2\r\n" /* st2 */
"bltu $9, $8, 4f\r\n"
"nop \r\n"
"ush $11, 0($10)\r\n"
"srl $11, 16\r\n"
"subu $9, $9, 2\r\n"
PTR_ADDU "$10, $10, 2\r\n"
"4: \r\n"
"li $8, 1\r\n" /* st1 */
"bltu $9, $8, 5f\r\n"
"nop \r\n"
"sb $11, 0($10)\r\n"
"5: \r\n"
"nop \r\n" /* end */
: "=m" (*outptr)
: "f" (mmA), "f" (mmC), "f" (mmE), "r" (col), "r" (outptr)
: "$f4", "$f6", "$8", "$9", "$10", "$11", "memory"
);
}
#else /* RGB_PIXELSIZE == 4 */
#ifdef RGBX_FILLER_0XFF
xe = _mm_cmpeq_pi8(xe, xe);
xo = _mm_cmpeq_pi8(xo, xo);
#else
xe = _mm_xor_si64(xe, xe);
xo = _mm_xor_si64(xo, xo);
#endif
/* mmA=(00 02 04 06 ** ** ** **), mmB=(01 03 05 07 ** ** ** **) */
/* mmC=(10 12 14 16 ** ** ** **), mmD=(11 13 15 17 ** ** ** **) */
/* mmE=(20 22 24 26 ** ** ** **), mmF=(21 23 25 27 ** ** ** **) */
/* mmG=(30 32 34 36 ** ** ** **), mmH=(31 33 35 37 ** ** ** **) */
mmA = _mm_unpacklo_pi8(mmA, mmC); /* (00 10 02 12 04 14 06 16) */
mmE = _mm_unpacklo_pi8(mmE, mmG); /* (20 30 22 32 24 34 26 36) */
mmB = _mm_unpacklo_pi8(mmB, mmD); /* (01 11 03 13 05 15 07 17) */
mmF = _mm_unpacklo_pi8(mmF, mmH); /* (21 31 23 33 25 35 27 37) */
mmC = _mm_unpackhi_pi16(mmA, mmE); /* (04 14 24 34 06 16 26 36) */
mmA = _mm_unpacklo_pi16(mmA, mmE); /* (00 10 20 30 02 12 22 32) */
mmG = _mm_unpackhi_pi16(mmB, mmF); /* (05 15 25 35 07 17 27 37) */
mmB = _mm_unpacklo_pi16(mmB, mmF); /* (01 11 21 31 03 13 23 33) */
mmD = _mm_unpackhi_pi32(mmA, mmB); /* (02 12 22 32 03 13 23 33) */
mmA = _mm_unpacklo_pi32(mmA, mmB); /* (00 10 20 30 01 11 21 31) */
mmH = _mm_unpackhi_pi32(mmC, mmG); /* (06 16 26 36 07 17 27 37) */
mmC = _mm_unpacklo_pi32(mmC, mmG); /* (04 14 24 34 05 15 25 35) */
if (num_cols >= 8) {
if (!(((long)outptr) & 7)) {
_mm_store_si64((__m64 *)outptr, mmA);
_mm_store_si64((__m64 *)(outptr + 8), mmD);
_mm_store_si64((__m64 *)(outptr + 16), mmC);
_mm_store_si64((__m64 *)(outptr + 24), mmH);
} else {
_mm_storeu_si64((__m64 *)outptr, mmA);
_mm_storeu_si64((__m64 *)(outptr + 8), mmD);
_mm_storeu_si64((__m64 *)(outptr + 16), mmC);
_mm_storeu_si64((__m64 *)(outptr + 24), mmH);
}
outptr += RGB_PIXELSIZE * 8;
} else {
col = num_cols;
asm(".set noreorder\r\n" /* st16 */
"li $8, 4\r\n"
"move $9, %6\r\n"
"move $10, %7\r\n"
"mov.s $f4, %2\r\n"
"mov.s $f6, %4\r\n"
"bltu $9, $8, 1f\r\n"
"nop \r\n"
"gssdlc1 $f4, 7($10)\r\n"
"gssdrc1 $f4, 0($10)\r\n"
"gssdlc1 $f6, 7+8($10)\r\n"
"gssdrc1 $f6, 8($10)\r\n"
"mov.s $f4, %3\r\n"
"mov.s $f6, %5\r\n"
"subu $9, $9, 4\r\n"
PTR_ADDU "$10, $10, 16\r\n"
"1: \r\n"
"li $8, 2\r\n" /* st8 */
"bltu $9, $8, 2f\r\n"
"nop \r\n"
"gssdlc1 $f4, 7($10)\r\n"
"gssdrc1 $f4, 0($10)\r\n"
"mov.s $f4, $f6\r\n"
"subu $9, $9, 2\r\n"
PTR_ADDU "$10, $10, 8\r\n"
"2: \r\n"
"li $8, 1\r\n" /* st4 */
"bltu $9, $8, 3f\r\n"
"nop \r\n"
"gsswlc1 $f4, 3($10)\r\n"
"gsswrc1 $f4, 0($10)\r\n"
"3: \r\n"
"li %1, 0\r\n" /* end */
: "=m" (*outptr), "=r" (col)
: "f" (mmA), "f" (mmC), "f" (mmD), "f" (mmH), "r" (col),
"r" (outptr)
: "$f4", "$f6", "$8", "$9", "$10", "memory"
);
}
#endif
}
}
}
#undef mmA
#undef mmB
#undef mmC
#undef mmD
#undef mmE
#undef mmF
#undef mmG
#undef mmH
|
78e54c08491238105e0b9bf9263371f4774a84bf
|
b4c2b8dc89417e966a67a433267ebb9c156dbff4
|
/src/vehicles/sounds/UralV8Knock.h
|
37ae408122bba8b8b91cd7265bc3a595e7a49e83
|
[] |
no_license
|
TheDIYGuy999/Rc_Engine_Sound_ESP32
|
92134030dbc047627310d54ccf1fd34fb3cad791
|
eeeb47964861b66f8e1db34bffe35657846d8b20
|
refs/heads/master
| 2023-08-31T00:17:03.698027
| 2023-05-04T19:46:51
| 2023-05-04T19:46:51
| 225,658,413
| 230
| 105
| null | 2023-08-26T14:38:39
| 2019-12-03T15:51:13
|
C
|
UTF-8
|
C
| false
| false
| 28,962
|
h
|
UralV8Knock.h
|
const unsigned int knockSampleRate = 22050;
const unsigned int knockSampleCount = 1630; // 6530 240
const signed char knockSamples[] = {
2, 0, -11, -21, -29, -26, -7, -6, -20, -39, -50, -50, -46, -41, -36, -35,
-29, -12, -7, -15, -29, -32, -28, -12, -8, -14, -17, -16, -14, -27, -39, -46,
-46, -42, -39, -39, -39, -44, -50, -54, -42, -25, -20, -28, -43, -59, -72, -68,
-57, -50, -49, -58, -62, -61, -56, -49, -48, -52, -49, -52, -64, -72, -60, -34,
-40, -60, -67, -51, -32, -44, -49, -32, -9, -4, -33, -47, -44, -31, -15, -2,
0, -6, -12, -19, -26, -29, -19, 2, 17, 7, -15, -25, -20, -8, 5, 7,
4, -5, -16, -19, -20, -29, -42, -41, -40, -40, -38, -38, -45, -53, -51, -33,
-11, 1, -5, -8, -11, -24, -42, -48, -31, -22, -26, -32, -32, -39, -54, -64,
-62, -53, -45, -26, -9, -5, -11, -14, 2, 14, 14, -1, -19, -31, -53, -60,
-54, -48, -47, -51, -44, -31, -31, -44, -47, -12, 14, 21, 10, -9, -20, -20,
-19, -23, -35, -42, -31, -19, -13, -16, -25, -32, -30, -29, -25, -23, -23, -20,
-12, -13, -24, -43, -53, -49, -37, -27, -35, -46, -42, -23, -16, -20, -26, -28,
-25, -12, 0, 3, -4, -7, -5, -6, -9, -15, -23, -23, -14, -12, -5, 2,
4, 0, -11, -19, -24, -26, -28, -20, -9, -4, -2, -2, 0, 8, 8, 0,
-11, -21, -19, 8, 18, 12, -5, -21, -23, -20, -13, -7, -9, -12, -8, 2,
14, 18, 13, 4, -6, -12, -15, -5, 11, 16, 24, 34, 31, 27, 31, 41,
44, 46, 46, 49, 62, 63, 58, 60, 67, 77, 72, 62, 68, 86, 90, 85,
105, 101, 73, 52, 49, 70, 107, 88, 60, 52, 58, 56, 35, 20, 29, 47,
47, 22, 11, 22, 40, 46, 39, 32, 21, 21, 33, 38, 31, 21, 21, 41,
63, 70, 61, 52, 50, 57, 60, 55, 60, 75, 87, 87, 80, 53, 48, 65,
77, 78, 70, 58, 51, 40, 36, 42, 45, 28, 9, 4, 12, 18, 7, 2,
12, 33, 39, 30, 18, 28, 49, 56, 54, 58, 70, 77, 68, 45, 18, 4,
13, 25, 26, 11, -5, 4, 12, 7, 3, -3, -7, -3, -6, -14, -22, -24,
-25, -26, -28, -32, -33, -32, -34, -35, -38, -36, -37, -41, -27, -8, 1, -3,
-6, 11, 16, 5, -9, -14, 0, 28, 23, 6, -5, -6, 4, 9, 8, 1,
-7, -1, 16, 19, 19, 18, 19, 18, 11, 14, 10, 0, -4, -5, -6, -1,
8, 11, 6, -2, 2, 7, 10, 8, 10, 27, 28, 21, 8, 1, 16, 23,
20, 15, 12, 5, -2, 3, 11, 21, 31, 36, 33, 27, 23, 24, 21, 21,
29, 37, 38, 31, 22, 17, 24, 28, 26, 16, 2, -2, -1, 8, 21, 27,
25, 22, 17, 13, 9, -2, -18, -26, -27, -27, -34, -41, -42, -42, -39, -35,
-36, -37, -35, -38, -36, -35, -32, -29, -34, -41, -52, -63, -60, -43, -29, -26,
-34, -48, -56, -52, -43, -38, -41, -54, -71, -62, -46, -32, -30, -36, -35, -31,
-29, -38, -45, -35, -16, -2, -3, -9, -17, -25, -23, -13, -10, -21, -44, -52,
-43, -42, -48, -51, -60, -69, -81, -87, -74, -51, -24, -16, -20, -38, -58, -58,
-41, -31, -31, -37, -40, -45, -52, -58, -64, -71, -82, -90, -86, -82, -85, -91,
-83, -72, -69, -74, -79, -81, -84, -85, -82, -74, -65, -55, -48, -48, -48, -48,
-48, -51, -49, -39, -29, -28, -24, -13, -11, -12, -20, -24, -6, 3, 2, -1,
-4, -7, -4, -3, -3, -5, -13, -25, -33, -25, -13, -6, -9, -21, -15, -1,
9, 7, -2, -13, -10, 1, -2, -15, -25, -36, -39, -37, -27, -13, -5, -6,
-6, -12, -20, -21, -23, -20, -10, -7, -15, -22, -14, 2, 10, 2, -1, 5,
-1, -15, -30, -38, -36, -20, -8, 6, 18, 20, 15, 10, 8, 6, 1, 0,
5, 8, 13, 13, 12, 10, -2, -9, -7, 2, 8, 16, 30, 41, 45, 34,
18, 1, 6, 16, 23, 20, 17, 18, 13, 15, 16, 15, 17, 21, 18, 16,
10, 3, 12, 12, 7, 1, -8, -14, -13, -14, -12, -12, -16, -16, -4, 4,
4, -1, -6, -15, -15, -3, 17, 36, 42, 26, 8, -2, 1, 11, 16, 8,
13, 26, 37, 44, 40, 33, 34, 42, 46, 42, 30, 23, 16, 11, 11, 11,
8, 11, 18, 22, 20, 20, 20, 23, 31, 30, 21, 7, 4, 9, 20, 27,
30, 31, 35, 42, 50, 58, 79, 88, 92, 91, 85, 83, 87, 89, 86, 73,
54, 41, 35, 31, 34, 46, 64, 78, 71, 62, 64, 72, 76, 63, 54, 50,
49, 57, 68, 67, 61, 52, 42, 33, 25, 19, 22, 30, 32, 30, 26, 29,
36, 37, 29, 16, 17, 18, 24, 28, 28, 26, 26, 27, 20, 14, 17, 40,
53, 55, 49, 42, 40, 45, 45, 31, 16, 16, 35, 39, 31, 16, -1, -15,
-23, -24, -26, -24, -14, 0, 2, 4, 4, 7, 11, 10, 7, 12, 21, 23,
23, 29, 34, 34, 31, 29, 38, 51, 61, 65, 62, 57, 54, 47, 40, 37,
36, 32, 18, 12, 10, 12, 17, 12, -1, -8, -10, -11, -11, 2, 9, 15,
17, 13, 13, 8, 7, 17, 20, 18, 26, 35, 38, 37, 31, 24, 28, 30,
36, 50, 66, 67, 59, 46, 36, 43, 49, 45, 31, 12, 1, -2, 2, 7,
6, 8, 17, 19, -4, -15, -10, 9, 22, 18, -7, -17, -14, -6, 7, 11,
-8, -31, -48, -49, -37, -9, -4, -8, -18, -18, -18, -35, -37, -30, -24, -32,
-45, -60, -64, -61, -55, -51, -47, -47, -50, -50, -46, -38, -34, -31, -16, 1,
8, -1, -15, -15, -12, -17, -33, -50, -48, -34, -18, -17, -31, -55, -68, -69,
-61, -48, -38, -46, -59, -78, -95, -97, -70, -53, -51, -55, -63, -66, -58, -60,
-60, -55, -44, -30, -18, -21, -26, -30, -31, -25, -25, -30, -36, -35, -26, -19,
-26, -33, -34, -27, -9, 13, 10, -3, -14, -21, -27, -31, -28, -19, -11, -6,
-23, -49, -67, -71, -58, -32, -22, -14, -7, -6, -12, -16, -16, -15, -14, -15,
-21, -28, -23, -18, -20, -29, -33, -27, -24, -27, -26, -20, -1, 16, 24, 23,
19, 21, 31, 37, 35, 19, -1, -22, -17, -7, -5, -10, -16, -28, -31, -24,
-6, 17, 31, 22, 5, -7, -17, -26, -29, -25, -19, -17, -24, -30, -29, -25,
-29, -39, -50, -53, -43, -35, -25, -17, -13, -16, -16, -11, -8, -7, -2, 3,
-1, -6, -10, -16, -17, -13, -9, -6, -7, -14, -38, -49, -47, -33, -19, -13,
-21, -33, -39, -37, -31, -25, -7, 13, 23, 12, -12, -36, -41, -42, -38, -25,
-11, -9, -19, -28, -22, -11, -6, -9, -15, -20, -22, -24, -27, -26, -27, -35,
-44, -49, -41, -27, -15, -15, -23, -26, -15, -10, -10, -10, -6, -4, -12, -23,
-28, -20, -6, 6, 5, -2, -4, -8, -9, -2, 7, 13, 7, -4, -16, -12,
-4, 4, 16, 24, 25, 19, 14, 18, 30, 52, 48, 28, 8, 0, 2, 9,
16, 28, 36, 38, 34, 30, 35, 40, 44, 46, 42, 43, 48, 50, 44, 45,
67, 61, 40, 33, 52, 74, 72, 65, 77, 101, 110, 90, 88, 101, 108, 107,
106, 109, 101, 84, 69, 60, 55, 55, 63, 71, 71, 50, 20, 34, 56, 70,
74, 74, 71, 62, 47, 37, 39, 43, 54, 45, 15, -9, -9, 24, 44, 55,
59, 59, 56, 42, 37, 52, 76, 79, 57, 28, 31, 37, 34, 24, 6, 2,
-2, -11, -17, -17, -4, 3, 6, -1, -10, -10, -7, -10, -12, -15, -24, -37,
-45, -51, -48, -45, -46, -42, -28, -9, 1, -4, -11, -4, 4, 10, 18, 25,
19, 4, -11, -19, -19, -12, -9, -10, -7, -5, -8, -21, -27, -25, -20, -21,
-23, -24, -25, -23, -19, -18, -26, -36, -28, -16, -8, -3, 0, -2, -7, -9,
-4, 2, 1, -11, -19, -17, -16, -13, 11, 24, 27, 24, 21, 26, 22, 14,
13, 17, 18, 4, -8, -8, 2, 11, 13, 0, -17, -34, -41, -28, -2, 1,
-10, -23, -27, -25, -11, 0, 10, 21, 24, 15, -4, -16, -23, -18, -13, -13,
-15, -16, -14, -11, -3, 16, 25, 29, 27, 28, 34, 41, 36, 29, 23, 20,
13, 3, -3, -4, -2, 2, 10, 20, 29, 38, 44, 41, 35, 32, 26, 18,
15, 13, 7, -1, -10, -17, -23, -30, -26, -22, -21, -17, -12, -10, -9, -3,
0, 0, -12, -28, -38, -43, -43, -40, -25, -22, -31, -46, -60, -63, -63, -51,
-32, -13, 1, 9, 10, 10, 3, -4, -10, -15, -6, 2, 3, 3, -8, -15,
-16, -13, -9, -10, -24, -24, -23, -31, -40, -36, -35, -44, -55, -67, -76, -88,
-89, -85, -80, -77, -75, -75, -79, -81, -80, -68, -44, -19, -20, -32, -46, -54,
-51, -46, -38, -27, -24, -30, -42, -53, -54, -50, -42, -29, -20, -23, -29, -35,
-42, -53, -60, -74, -85, -89, -85, -69, -72, -83, -94, -100, -94, -80, -77, -76,
-73, -68, -63, -71, -73, -58, -36, -23, -34, -46, -46, -40, -34, -24, 0, 4,
1, -6, -15, -23, -19, -7, 8, 20, 22, 19, 11, 7, 10, 11, 9, -6,
-15, -18, -20, -26, -41, -43, -38, -29, -25, -23, -15, -12, -15, -25, -29, -27,
-15, -7, -9, -17, -21, -16, -3, 11, 19, 21, 16, 2, -9, -14, -6, 18,
45, 52, 40, 25, 9, -1, -2, 9, 21, 22, 19, 19, 22, 24, 27, 34,
41, 52, 53, 42, 29, 26, 29, 24, 21, 20, 25, 36, 36, 18, 5, 6,
17, 29, 34, 26, 14, 7, 9, 13, 28, 41, 43, 39, 29, 21, 22, 28,
42, 70, 97, 82, 65, 59, 71, 84, 75, 56, 43, 37, 33, 24, 14, 31,
60, 74, 73, 64, 61, 67, 68, 57, 44, 40, 56, 61, 50, 36, 32, 40,
53, 49, 46, 49, 60, 72, 72, 68, 64, 71, 80, 71, 52, 41, 45, 54,
66, 68, 60, 49, 43, 43, 44, 46, 45, 47, 48, 50, 55, 43, 33, 27,
28, 28, 8, 0, 3, 17, 29, 26, 10, -4, -6, -7, 0, 20, 36, 48,
42, 26, 5, -15, -10, 0, 4, -1, -6, -4, 3, 3, -4, -9, -7, 5,
15, 14, 9, 8, 23, 43, 58, 59, 52, 55, 63, 66, 56, 40, 36, 53,
61, 57, 41, 25, 21, 20, 20, 14, 7, 5, 1, 1, 6, 12, 20, 23,
8, -12, -29, -35, -33, -16, -14, -21, -34, -46, -48, -42, -34, -28, -21, -11,
1, 8, 5, -5, -10, 4, 22, 22, 14, 7, 9, 14, 9, 0, -9, -11,
-4, 4, 17, 13, -5, -24, -35, -39, -35, -29, -29, -38, -45, -58, -66, -62,
-41, -20, -16, -18, -19, -17, -5, 5, 7, 9, 4, 0, 4, 14, 31, 29,
21, 11, 4, 8, 33, 46, 52, 55, 48, 31, 26, 29, 39, 43, 40, 21,
15, 17, 12, 5, 3, 4, 5, 9, 8, 6, 2, 0, 2, 3, -1, -9,
-26, -39, -37, -25, -9, -4, -28, -37, -38, -32, -23, -22, -32, -33, -23, -12,
-7, -9, -12, -7, 5, 13, 13, 12, 14, 14, 11, 4, -3, 4, 16, 15,
8, 2, -11, -9, 0, 7, -3, -43, -64, -62, -39, -21, -21, -56, -80, -79,
-62, -35, -13, -22, -37, -47, -51, -48, -41, -31, -22, -21, -29, -44, -58, -59,
-52, -42, -37, -33, -25, -19, -16, -18, -28, -42, -35, -27, -19, -21, -42, -70,
-95, -110, -106, -90, -63, -35, -38, -53, -69, -84, -98, -101, -90, -69, -54, -57,
-91, -115, -126, -127, -119, -102, -83, -72, -58, -45, -41, -43, -31, -16, -8, -7,
-8, 3, 9, 9, -8, -35, -55, -61, -47, -37, -42, -50, -52, -44, -32, -16,
0, 5, 1, -6, -13, -15, -8, 3, -7, -29, -45, -46, -42, -46, -43, -32,
-21, -15, -12, 1, 12, 21, 17, 3, -6, -4, 8, 15, 18, 6, -36, -51,
-56, -47, -28, -8, 3, 1, 3, 9, 14, 12, 0, 3, 10, 12, 8, -9,
-19, -23, -23, -22, -19, -6, 1, 3, 2, 0, -2, 0, 3, 12, 20, 24,
27, 17, 0, -4, 6, 19, 32, 20, -10, -42, -57, -43, -22, -3, 8, 12,
11, 5, -4, -13, -23, -30, -28, -22, -20, -17, -15, -8, 8, 8, -1, -8,
1, 17, 30, 35, 33, 28, 21, 14, 13, 10, 11, 10, -5, -18, -20, -19,
-18, -15, -4, 19, 30, 31, 26, 16, 7, 2, 9, 27, 37, 35, 35, 29,
20, 24, 36, 47, 62, 66, 64, 56, 50, 57, 73, 78, 72, 58, 45, 40,
45, 51, 51, 44, 37, 34, 42, 51, 53, 49, 48, 43, 38, 32, 31, 39,
41, 34, 20, 8, 10, 19, 38, 46, 37, 26, 27, 35, 47, 53, 51, 48,
46, 30, 21, 17, 21, 24, 17, 7, 3, -6, -10, -1, 13, 24, 20, 6,
-4, -2, 3, -1, -12, -20, -19, -10, 3, 5, 6, 9, 9, 3, 5, 15,
27, 33, 34, 26, 19, 19, 29, 35, 35, 24, 12, 7, 14, 23, 28, 22,
9, -4, -10, -11, -6, 4, 18, 27, 22, 8, -20, -34, -33, -14, 4, 6,
1, 1, 6, 8, 1, -16, -14, 9, 37, 47, 39, 34, 37, 41, 39, 30,
29, 34, 35, 27, 21, 22, 27, 35, 45, 48, 43, 31, 13, 14, 25, 37,
41, 37, 36, 27, 14, -1, -8, 4, 22, 37, 39, 31, 19, 8, 10, 16,
21, 18, 7, 12, 18, 25, 36, 45, 42, 34, 27, 23, 28, 39, 54, 53,
46, 37, 35, 48, 54, 55, 50, 40, 33, 30, 38, 49, 57, 60, 58, 38,
25, 27, 41, 57, 64, 52, 27, 12, 18, 30, 49, 50, 48, 44, 40, 40,
23, 16, 17, 18, 15, -1, -7, 0, 13, 22, 22, 8, 3, 1, 2, -5,
-22, -24, -25, -28, -38, -51, -60, -65, -66, -65, -58, -50, -54, -64, -68, -61,
-49, -41, -38, -35, -34, -37, -47, -52, -47, -30, -21, -26, -28, -23, -11, -12,
-17, -18, -11, -4, -2, 1, -7, -16, -18, -17, -17, -27, -41, -56, -73, -73,
-64, -48, -41, -45, -47, -51, -59, -68, -74, -71, -62, -56, -53, -52, -51, -46,
-59, -79, -93, -90, -65, -48, -36, -40, -55, -68, -68, -58, -50, -43, -38, -29,
-25, -31, -45, -62, -65, -60, -65, -70, -74, -77, -78, -72, -62, -44, -29, -32,
-43, -46, -40, -42, -49, -51, -59, -65, -60, -44, -24, -5, -6, -15, -25, -36,
-39, -37, -11, 7, 10, -3, -18, -18, -12, -2, 2, -7, -12, -11, -17, -20,
-17, -17, -11, 0, -2, -6, -8, -4, 3, 4, 13, 35, 60, 66, 43, 28,
22, 28, 33, 24, 15, 17, 25, 29, 29, 19, 13, 13, 21, 38, 50, 50,
45, 34, 18, 6, 13, 20, 26, 23, 8, -6, -10, -15, -16, -7, 8, 23,
27, 17, 1, -10, -16, -29, -37, -37, -28, -20, -17, -10, -7, -1, 9, 15,
14, -2, -19, -32, -37, -33, -22, -20, -23, -22, -18, -20, -26, -24, -21, -17,
-19, -24, -23, -22, -23, -27, -32, -39, -39, -39, -40, -32, -19, 3, 3, -11,
-22, -28, -29, -14, -5, -1, -1, 5, 7, 1, 1, 0, -7, 0, 17, 16,
11, 5, 13, 22, 17, 22, 34, 36, 35, 16, 6, 7, 3, 0, 5, 7,
8, 11, 13, 23, 30, 13, 5, 10, 15, 21, 25, 25, 26, 17, 6, 8,
16, 24, 31, 30, 22, 15, 26, 46, 56, 49, 41, 37, 32, 26, 28, 41,
57, 75, 67, 47, 32, 22, 12, 13, 14, 28, 53, 68, 63, 53, 50, 53,
60, 66, 71, 70, 57, 48, 44, 45, 47, 51, 56, 61, 63, 52, 47, 51,
60, 68, 66, 53, 46, 39, 35, 33, 24, 20, 20, 22, 27, 32, 40, 45,
43, 28, 4, -14, -7, 21, 43, 49, 46, 32, 20, 12, 8, 15, 28, 38,
33, 24, 22, 21, 18, 23, 35, 42, 39, 32, 12, 5, 7, 7, 4, -4,
-14, -12, 0, 8, 3, -4, -10, -6, -3, -8, -13, -15, -14, -10, -4, -2,
-2, -1, 1, 1, -5, -15, -21, -13, -2, 10, 14, 6, -8, -10, -8, -9,
-12, -14, -13, -12, -13, -13, -13, -11, -11, -17, -17, -12, -3, 15, 17, 22,
28, 24, 16, 10, 11, 13, 13, 14, 19, 18, 9, -2, -8, -7, -6, -11,
-14, -9, 6, 16, 10, 0, -9, -17, -22, -17, -15, -16, -21, -32, -42, -47,
-42, -32, -24, -24, -30, -45, -50, -46, -40, -42, -53, -54, -48, -43, -43, -40,
-28, -25, -22, -22, -29, -36, -37, -32, -27, -23, -19, -16, -18, -30, -46, -56,
-51, -26, -14, -13, -18, -18, -14, -17, -23, -19, -11, -7, -12, -17, -16, -14,
-11, -15, -34, -38, -28, -12, -6, -15, -34, -38, -33, -27, -20, -26, -35, -38,
-41, -47, -45, -25, -20, -28, -37, -32, -25, -27, -34, -38, -29, -18, -12, 1,
21, 32, 25, 13, -6, -15, -21, -21, -15, -15, -34, -51, -55, -51, -45, -39,
-33, -26, -25, -24, -28, -40, -48, -56, -52, -42, -41, -45, -37, -29, -29, -35,
-33, -22, -14, -10, -7, -2, -2, -2, -2, -5, -8, -10, -20, -36, -54, -71,
-79, -60, -31, -9, -7, -15, -21, -17, -11, 1, 17, 36, 48, 34, 18, 10,
11, 12, 6, 5, 4, 13, 26, 30, 37, 41, 51, 58, 57, 49, 35, 16,
-1, -11, -15, -11, -5, -3, 1, 9, 10, 1, -7, -16, -16, -11, -1, 5,
5, 2, -5, -17, -41, -53, -58, -45, -27, -22, -28, -32, -34, -38, -42, -44,
-49, -55, -56, -45, -30, -25, -40, -51, -53, -55, -56, -55, -50, -41, -45, -59,
-74, -67, -50, -31, -19, -18, -25, -32, -36, -46, -61, -65, -45, -31, -31, -49,
-65, -67, -50, -37, -33, -29, -23, -5, 1, -2, -9, -14, -13, -5, -1, 6,
15, 24, 34, 38, 36, 31, 28, 30, 49, 63, 69, 70, 69, 67, 68, 66,
54, 28, 6, 0, 2, 8, 11, 11, 7, 2, -3, -10, -11, -1, 15, 22,
21, 22, 26, 36, 56, 66, 72, 79, 82, 77, 74, 79, 91, 100, 102, 99,
92, 88, 83, 80, 84, 90, 89, 79, 69, 69, 72, 58, 43, 42, 49, 53,
54, 56, 54, 51, 54, 56, 44, 43, 51, 64, 72, 74, 74, 83, 88, 79,
66, 52, 60, 77, 89, 88, 82, 84, 86, 82, 74, 70, 75, 79, 64, 45,
30, 23, 19, 15, 15, 20, 31, 41, 48, 48, 44, 37, 29, 21, 19, 16,
13, 14, 19, 23, 18, 2, -10, -8, 3, 14, 10, 3, -1, -1, -3, -3,
5, 11, 10, -2, -29, -43, -51, -48, -49, -58, -61, -55, -45, -33, -31, -37,
-32, -32, -41, -44, -34, -20, -20, -24, -29, -34, -37, -32, -22, -14, -7, -6,
-14, -24, -24, -24, -26, -20, -8, -2, 0, -9, -23, -35, -44, -34, -21, -19,
-18, -20, -27, -29, -28, -22, -16, -8, -4, 2, 5, 1, -7, -15, -4, 7,
13, 16, 5, -4, -7, -1, 5, 6, 11, 25, 46, 55, 40, 13, -12, -6,
11, 18, 14, 13, 25, 34, 29, 16, 11, 35, 45, 37, 26, 16, 15, 26,
21, 10, 4, 6, 10, 13, 18, 23, 28, 30, 10, -7, -12, -5, 10, 22,
32, 33, 24, 5, -15, -25, -25, -26, -26, -18, -1, 0, -19, -32, -26, -3,
25, 48, 46, 40, 40, 45, 49, 43, 29, 21, 21, 22, 4, -7, -6, 2,
0, -11, -21, -31, -36, -26, -10, 8, 6, -10, -33, -47, -45, -34, -38, -52,
-58, -59, -54, -49, -61, -74, -74, -63, -57, -68, -78, -77, -70, -71, -82, -74,
-58, -50, -51, -58, -57, -45, -35, -31, -31, -24, -24, -34, -52, -68, -76, -73,
-74, -82, -87, -80, -62, -44, -52, -60, -63, -58, -49, -49, -44, -43, -50, -62,
-79, -74, -61, -55, -58, -58, -54, -58, -67, -67, -58, -48, -48, -52, -54, -52,
-48, -45, -37, -30, -28, -28, -19, -10, -5, -4, -9, -21, -27, -26, -24, -24,
-26, -32, -43, -53, -60, -58, -45, -21, -21, -29, -37, -31, -11, -4, -13, -20,
-22, -23, -32, -45, -44, -38, -36, -34, -25, -21, -20, -19, -15, -9, -11, -19,
-25, -22, -16, -10, -14, -28, -34, -26, -16, -18, -22, -22, -17, -15, -16, -19,
-17, -14, -13, -16, -19, -6, 3, 1, -8, -11, 5, 19, 30, 32, 29, 27,
21, 18, 18, 23, 27, 30, 31, 28, 22, 13, 5, 5, 8, 7, 1, -9,
-11, 2, 12, 17, 16, 13, 18, 33, 33, 32, 33, 31, 25, 23, 30, 44,
53, 48, 32, 29, 29, 30, 35, 44, 57, 60, 58, 48, 33, 24, 25, 24,
18, 10, 4, -2, -3, 3, 16, 28, 32, 30, 37, 47, 53, 56, 45, 34,
29, 28, 31, 31, 38, 45, 49, 57, 71, 90, 91, 83, 72, 64, 60, 51,
46, 42, 40, 42, 50, 57, 53, 45, 34, 30, 34, 32, 31, 29, 23, 17,
14, 20, 24, 26, 24, 21, 18, 21, 28, 36, 47, 47, 35, 22, 17, 26,
35, 48, 56, 54, 43, 35, 33, 37, 38, 34, 30, 32, 33, 25, 17, 8,
0, -5, -11, -9, -1, 7, 9, 6, 2, 4, 9, 6, -2, -4, 0, 3,
-4, -17, -31, -35, -23, -9, 1, 6, 9, 20, 22, 22, 18, 5, -7, -5,
1, 1, -3, -1, 8, 11, 13, 15, 21, 27, 16, 7, -1, -2, 0, -7,
-15, -16, -13, -11, -13, -21, -14, 0, 7, 3, -8, -8, 2, 14, 21, 21,
25, 20, 16, 18, 16, 11, 4, 10, 21, 28, 31, 19, 11, 16, 30, 43,
51, 53, 46, 37, 29, 27, 36, 51, 50, 41, 35, 37, 52, 63, 67, 62,
52, 43, 41, 42, 47, 53, 61, 70, 67, 54, 43, 40, 40, 48, 55, 52,
42, 31, 26, 25, 23, 23, 29, 41, 47, 28, 9, -6, -12, -2, 13, 8,
2, 3, 3, 6, 13, 10, 2, 1, 10, 21, 20, 17, 27, 39, 42, 36,
28, 18, 12, 12, 18, 26, 23, 17, 15, 13, 13, 15, 24, 37, 38, 25,
0, -9, -7, -7, -12, -22, -43, -56, -69, -75, -71, -62, -51, -47, -46, -49,
-50, -48, -42, -36, -31, -29, -41, -69, -84, -82, -67, -61, -63, -64, -68, -72,
-74, -66, -40, -23, -10, -3, -4, -17, -33, -27, -18, -22, -35, -29, -3, 4,
-5, -24, -34, -42, -42, -37, -39, -39, -30, -28, -36, -44, -48, -50, -54, -60,
-68, -73, -71, -65, -58, -58, -61, -55, -38, -27, -31, -36, -39, -35, -29, -30,
-38, -41, -44, -38, -26, -10, -6, -18, -32, -34, -27, -15, -6, 5, 17, 18,
-16, -39, -41, -26, -16, -14, -23, -35, -41, -35, -25, -19, -16, -17, -17, -16,
-20, -35, -35, -33, -38, -48, -57, -70, -71, -73, -72, -65, -61, -64, -62, -55,
-44, -40, -33, -17, -5, 0, -6, -22, -33, -30, -29, -31, -29, -20, -1, 6,
6, -3, -14, -18, -6, 2, -6, -22, -32, -25, -19, -18, -20, -19, -12, -8,
-7, -12, -21, -29, -38, -30, -25, -27, -30, -33, -32, -31, -31, -32, -36, -41,
-38, -25, -19, -21, -24, -15, -7, -9, -19, -27, -27, -10, 1, 9, 14, 17,
26, 38, 41, 36, 19, 7, 17, 28, 33, 35, 34, 34, 31, 24, 18, 15,
20, 25, 22, 15, 8, 5, -1, -17, -24, -23, -16, -10, -12, -12, -5, -10,
-1, 19, 30, 30, 29, 37, 44, 48, 50, 45, 52, 62, 67, 65, 56, 60,
64, 60, 59, 77, 57, 31, 38, 55, 53, 22, 15, 34, 68, 67, 30, 31,
62, 78, 53, 7, -14, -1, 0, -12, -6, 20, 60, 65, 49, 28, 18, 22,
42, 46, 36, 20, 5, -1, 8, 12, 15, 19, 23, 34, 35, 28, 10, 2,
12, 38, 36, 22, 9, 5, 19, 8, -4, -5, -3, 5, 4, 3, 13, 24,
25, 13, -1, -7, -8, -3, 8, 24, 22, 5, -16, -26, -21, -1, 12, 20,
24, 29, 31, 25, 20, 23, 34, 45, 45, 35, 26, 15, -2, -7, 14, 24,
28, 27, 19, 16, 15, 14, 15, 21, 32, 32, 15, 1, -5, -3, 8, 18,
15, 8, 2, 3, -6, -9, -11, -19, -20, -6, 5, 0, -1, 5, 5, -5,
-26, -29, -21, -16, -17, -17, -14, -6, 4, 7, 12, 36, 42, 36, 35, 36,
35, 31, 25, 27, 31, 30, 22, 13, 12, 19, 29, 32, 13, 6, 10, 15,
20, 17, 7, 9, 18, 24, 21, 16, 14, 8, -1, -7, -7, 18, 32, 34,
31, 27, 30, 43, 45, 37, 24, 19, 25, 26, 22, 18, 15, 9, 6, -1,
-5, -4, 0, 5, 5, 2, -2, -2, 4, -5, -21, -30, -29, -25, -28, -50,
-62, -60, -53, -47, -43, -39, -35, -37, -39, -32, -11, -4, -8, -14, -13, -11,
-17, -29, -39, -44, -47, -50, -45, -37, -29, -25, -29, -31, -30, -29, -32, -43,
-52, -51, -41, -34, -29, -28, -31, -36, -41, -44, -44, -37, -26, -22, -22, -24,
-26, -31, -43, -56, -67, -75, -78, -81, -79, -62, -48, -50, -56, -75, -81, -81,
-77, -63, -46, -24, -22, -23, -22, -30, -40, -35, -24, -13, -5, -2, -6, -11,
-14, -17, -28, -45, -52, -46, -41, -42, -50, -50, -45, -41, -47, -61, -70, -87,
-93, -89, -78, -62, -45, -23, -14, -10, -8, -9, -13, -17, -21, -16, -6, 3,
7, 11, 15, 12, 7, -4, -11, -1, 12, 22, 23, 12, 4, -2, -11, -19,
-16, -1, 7, 9, 4, 6, 16, 18, 13, 5, -6, -14, -29, -36, -37, -36,
-30, -19, -11, -9, -13, -19, -24, -25, -25, -25, -26, -25, -17, -11, -13, -17,
-25, -36, -38, -17, -1, 11, 15, 10, 1, -9, -7, -7, -5, -1, 13, 24,
21, 16, 17, 16, 10, -7, -22, -25, -23, -17, -17, -13, 2, 15, 19, -3,
-15, -18, -14, -7, -5, -2, -1, -6, -21, -31, -29, -19, -8, -3, 4, 11,
9, 6, 9, 18, 26, 32, 26, 15, 3, -4, -6, -8, -5, -5, -6, -6,
-5, 4, 9, 11, 11, 7, 5, 6, 7, 9, 9, 6, 4, -3, -6, 1,
11, 21, 21, 18, 15, 12, 11, 12, 7, -1, -1, 4, 11, 16, 17, 14,
5, -5, -8, 6, 17, 22, 25, 26, 25, 15, 8, 2, 0, 1, 7, 14,
13, 5, 2, 0, -10, -13, -8, 7, 21, 26, 14, 2, 2, 13, 29, 52,
62, 69, 70, 68, 65, 54, 58, 74, 89, 89, 76, 54, 50, 59, 77, 90,
97, 95, 84, 67, 53, 45, 45, 51, 51, 46, 42, 37, 34, 32, 27, 24,
25, 24, 17, 10, 7, 11, 15, 17, 12, 9, 13, 17, 12, 2, 14, 37,
58, 67, 62, 53, 45, 43, 43, 46, 69, 79, 69, 56, 47, 44, 48, 53,
58, 62, 64, 58, 54, 50, 46, 47, 43, 37, 33, 29, 26, 26, 35, 37,
36, 32, 33, 45, 48, 35, 24, 22, 29, 39, 58, 59, 54, 51, 48, 46,
48, 51, 55, 57, 50, 34, 23, 21, 23, 24, 27, 16, 6, -3, 0, 13,
27, 27, 19, 8, 5, 6, -2, 7, 19, 24, 25, 27, 23, 21, 18, 20,
28, 28, 34, 44, 42, 38, 35, 33, 29, 27, 30, 40, 47, 35, 25, 15,
10, 12, 10, 4, -5, -11, -14, -14, 1, 7, 3, -6, -6, 2, 10, 9,
8, 13, 11, -6, -13, -14, -8, 4, 17, 11, 9, 10, 5, -3, -12, -7,
-6, -14, -20, -29, -40, -40, -36, -33, -35, -37, -52, -55, -53, -50, -45, -46,
-55, -53, -54, -59, -53, -38, -33, -38, -45, -46, -46, -41, -37, -41, -48, -44,
-26, -21, -25, -30, -37, -44, -48, -52, -61, -68, -65, -63, -74, -71, -57, -42,
-39, -46, -45, -39, -26, -16, -22, -37, -40, -35, -29, -30, -31, -27, -23, -12,
-3, -2, 6, 18, 24, 19, 5, -13, -35, -37, -26, -11, -3, -9, -23, -24,
-25, -26, -25, -33, -41, -43, -37, -28, -22, -31, -44, -52, -55, -54, -50, -46,
-44, -43, -45, -47, -36, -28, -27, -29, -30, -27, -12, -2, 3, 4, 5, 8,
15, 12, 5, 2, 0, 2, -2, -7, 4, 32, 60, 65, 45, 26, 17, 21,
33, 32, 27, 22, 9, -12, -42, -42, -32, -27, -25, -26, -16, -5, -4, -3,
-2, 1, 4, -6, -16, -22, -18, -16, -23, -34, -48, -53, -43, -32, -36, -48,
-54, -44, -26, -9, -4, -2, -3, -5, -6, -5, -5, -7, -6, -7, -19, -30,
-38, -32, -18, -11, -21, -29, -28, -21, -14, -18, -19, -18, -21, -28, -38, -50,
-50, -48, -46, -45, -53, -63, -64, -60, -56, -49, -54, -58, -60, -62, -63, -66,
-68, -64, -64, -67, -73, -75, -72, -72, -68, -61, -51, -44, -44, -41, -29, -17,
-17, -28, -30, -25, -15, -12, -18, -18, -13, -9, -11, -16, -16, -6, 17, 32,
25, 8, 0, 3, 1, -1, -8, -26, -35, -40, -41, -34, -19, -11, -18, -21,
-17, -12, -8, 10, 30, 45, 46, 41, 36, 31, 30, 36, 44, 48, 57, 70,
90, 104, 102, 90, 81, 78, 77, 78, 75, 76, 70, 69, 76, 83, 79, 63,
73, 90, 93, 76, 63, 87, 99, 93, 73, 58, 61, 62, 53, 41, 39, 47,
50, 43, 41, 39, 42, 52, 58, 55, 52, 51, 54, 55, 52, 51, 53, 59,
64, 52, 42, 44, 50, 60, 68, 71, 71, 66, 64, 59, 63, 82, 95, 84,
58, 36, 27, 31, 33, 38, 42, 46, 47, 35, 18, 8, 6, 11, 10, 0,
-13, -16, -6, 1, -7, -21, -35, -36, -24, -19, -16, -19, -29, -35, -27, -19,
-14, -9, -4, -1, -4, -2, 1, 1, 7, 24, 22, 13, 8, 7, 3, -6,
-11, -11, -5, 0, -1, -4, -5, -11, -25, -43, -56, -51, -40, -29, -26, -30,
-29, -33, -41, -46, -45, -33, -5, -3, -13, -21, -20, -17, -13, -8, -6, 0,
12, 22, 22, 24, 31, 38, 40, 41, 38, 26, 11, 9, 18, 23, 27, 25,
23, 23, 13, 3, -6, -9, -7, 2, 13, 8, 1, 1, 9, 15, 1, -9,
-9, -2, 2, 1, 4, 12, 17, 9, -4, -5, 9, 21, 25, 21, 12, 14,
18, 19, 19, 20, 19, 13, 5, 1, 2, 5, 17, 22, 16, 5, -4, -1,
9, 16, 12, 10, 11, 11, 17, 21, 25, 26, 27, 27, 25, 21, 13, 10,
14, 13, 5, -6, -13, -12, -9, -15, -26, -33, -32, -29, -24, -14, -11, -17,
-27, -45, -58, -64, -58, -49, -45, -45, -48, -52, -52, -46, -46, -51, -50, -45,
-46, -42, -20, -15, -14, -14, -22, -33, -38, -32, -24, -27, -37, -36, -28, -24,
-29, -38, -39, -35, -55, -81, -83, -66, -49, -40, -44, -46, -52, -56, -54, -57,
-52, -43, -39, -42, -61, -70, -72, -67, -58, -50, -50, -57, -65, -66, -56, -38,
-34, -41, -51, -62, -72, -78, -76, -69, -63, -61, -67, -82, -86, -90, -88, -76,
-60, -57, -61, -65, -60, -54, -51, -58, -66, -69, -60, -47, -36, -37, -41, -43,
-40, -37, -35, -27, -24, -21, -9, 19, 30, 29, 22, 17, 17, 22, 24, 19,
14, 12, 2, -6, -8, -2, 6, 14, 13, 11, 13, 16, 20, 9, -6, -17,
-31, -41, -43, -43, -39, -32, -24, -25, -28, -44, -49, -41, -28, -12, 5, 10,
10, 3, -5, -11, -6, 10, 27, 33, 27, 21, 8, 4, 6, 10, 12, 16,
20, 19, 14, 9, 5, 0, -1, -4, -6, -3, 1, -4, -10, -10, -5, 1,
9, 15, 18, 18, 18, 15, 9, 5, 1, 1, -2, -2, 10, 9, -1, -14,
-17, -12, -9, -12, -19, -22, -21, 6, 29, 44, 54, 58, 51, 30, 21, 30,
38, 44, 46, 53, 55, 43, 41, 34, 49, 63, 67, 66, 62, 53, 43, 36,
24, 28, 32, 43, 34, 21, 19, 20, 27, 37, 48, 67, 74, 72, 63, 42,
43, 40, 40, 44, 60, 59, 48, 40, 29, 28, 37, 43, 45, 41, 42, 47,
53, 65, 71, 65, 51, 38, 40, 39, 39, 46, 55, 66, 66, 54, 39, 31,
31, 35, 35, 34, 33, 32, 38, 37, 40, 41, 30, 21, 21, 20, 11, 6,
3, 14, 33, 39, 29, 14, 5, 8, 18, 29, 37, 44, 48, 40, 25, 13,
8, 14, 22, 28, 36, 43, 51, 57, 56, 50, 41, 38, 43, 43, 34, 28,
27, 19, 9, -2, -12, -14, -10, -8, -10, -9, -13, -15, -13, -10, -6, -11,
-21, -36, -46, -49, -49, -43, -41, -39, -40, -42, -46, -46, -40, -29, -17, -7,
1, -1, -4, -11, -22, -30, -31, -26, -19, -18, -20, -14, -10, -12, -15, -14,
-12, -16, -16, -8, 3, 8, 15, 15, 6, -11, -30, -33, -7, 13, 19, 11,
2, -7, -15, -21, -21, -4, 21, 41, 37, 34, 29, 20, 19, 21, 9, -1,
3, 14, 17, 11, 4, 2, 5, 7, 3, 1, 7, 19, 23, 17, 10, 11,
12, 8, 6, -1, -17, -22, -10, 1, -1, -18, -26, -18, -10, -16, -29, -32,
-22, -17, -16, -15, -25, -41, -45, -34, -27, -23, -23, -20, -21, -27, -35, -39,
-20, -5, 2, 6, 9, -3, -14, -11, 3, 19, 22, 11, 6, 0, -5, -9,
-11, -5, 0, 4, 5, 4, -17, -36, -44, -36, -24, -25, -41, -53, -63, -71,
-77, -75, -62, -51, -39, -32, -31, -34, -35, -35, -32, -27, -20, -15, -18, -24,
-30, -30, -24, -29, -30, -27, -24, -23, -41, -51, -53, -42, -26, -19, -34, -57,
-79, -95, -97, -92, -76, -65, -58, -52, -50, -51, -51, -46, -40, -35, -32, -36,
-37, -35, -35, -48, -61, -61, -55, -48, -43, -39, -39, -45, -49, -45, -35, -22,
-7, -1, 6, 3, -10, -28, -48, -66, -70, -68, -70, -70, -57, -37, -22, -21,
-24, -8, 10, 32, 49, 51, 29, 10, -8, -21, -18, -11, -14, -19, -22, -21,
-14, 2, 21, 26, 29, 37, 38, 10, 0, 6, 22, 26, 10, -12, -21, -23,
-30, -43, -44, -31, -18, -9, -9, -5, 14, 21, 18, 6, -2, 6, 26, 29,
23, 12, 1, -8, -14, -19, -26, -29, -24, -8, -3, 0, 2, 7, 11, 4,
0, -2, 0, 9, 15, 2, -12, -26, -37, -43, -34, -26, -29, -32, -29, -20,
-3, 6, 14, 18, 21, 17, 5, 4, 11, 18, 11, -4, -4, 4, 17, 25,
27, 14, 4, 2, 2, 1, 2, 12, 18, 20, 17, 7, -4, -4, 0, 0,
-4, -3, 1, 2, -2, -8, -6, -2, -1, 0, 3, 7, 17, 40, 45, 33,
15, 9, 13, 18, 20, 22, 30, 37, 36, 26, 17, 24, 40, 56, 63, 55,
48, 40, 32, 29, 28, 28, 29, 24, 22, 28, 31, 34, 34, 43, 51, 41,
27, 22, 32, 47, 50, 37, 33, 29, 19, 8, 12, 21, 19, 9, 3, 7,
23, 25, 22, 19, 20, 23, 23, 19, 20, 22, 21, 18, 19, 25, 27, 25,
16, -1, -1, 5, 13, 19, 20, 20, 24, 29, 26, 21, 15, 12, 15, 21,
24, 20, 12, 11, 14, 14, 7, 2, 5, 15, 28, 35, 31, 14, 1, -4,
-4, -7, -12, -12, -9, -13, -24, -36, -37, -9, 12, 25, 26, 14, -10, -14,
-7, 9, 32, 50, 43, 27, 9, -7, -13, -11, 1, 15, 30, 45, 61, 72,
68, 61, 53, 51, 56, 56, 46, 35, 28, 32, 39, 38, 30, 23, 22, 25,
16, 2, -2, 2, 14, 23, 20, 14, 5, 0, -3, -10, -7, 3, 7, 5,
7, 11, 17, 19, 18, 12, 13, 29, 43, 53, 55, 52, 40, 36, 29, 19,
14, 13, 24, 33, 40, 43, 45, 48, 45, 47, 53, 66, 76, 78, 70, 59,
46, 29, 24, 41, 58, 53, 28, 4, -9, -1, 8, 17, 24, 23, 16, 12,
10, 3, -2, 1, 26, 32, 25, 6, -9, -18, -23, -15, -12, -4, 2, 14,
20, 22, 20, 16, 19, 14, 2, -12, -20, -21, -19, -19, -10, -6, -10, -16,
-29, -32, -34, -30, -22, -14, -7, -4, -8, -15, -17, -15, -15, -19, -21, -24,
-26, -16, -8, -4, -5, -5, -4, 2, 11, 17, 19, 13, 0, -14, -20, -16,
-10, -7, -11, -29, -55, -74, -74, -58, -28, -26, -42, -61, -72, -74, -77, -81,
-82, -72, -56, -49, -52, -55, -60, -65, -69, -71, -66, -53, -41, -34, -35, -46,
-53, -54, -54, -54, -51, -55, -69, -84, -85, -73, -55, -51, -52, -53, -52, -54,
-57, -49, -37, -24, -16, -21, -26, -29, -26, -27, -30, -24, -20, -18, -21, -21,
-9, 1, 2, -15, -36, -49, -36, -24, -17, -18, -18, -7, -4, -13, -19, -26,
-29, -28, -32, -37, -30, -16, -3, 0, -9, -16, -21, -11, 2, 4, 1, -2,
6, 14, 14, 8, 0, -1, -1, -2, -3, -2, 4, 9, 8, 3, -1, 0,
6, 15, 17, 20, 17, 18, 22, 27, 28, 20, 10, 1, 1, 6, 14, 29,
23, 16, 17, 22, 19, 12, 8, 5, 2, -5, -19, -27, -31, -30, -26, -20,
-8, -7, -10, -10, -4, 4, 2, -2, -8, -10, -6, -10, -8, -2, 2, 6,
12, 14, 4, -11, -20, -22, -21, -16, -14, -9, 4, 17, 11, -9, -27, -34,
-35, -34, -31, -27, -21, -12, -3, -1, -4, -6, -6, -3, -1, 7, 20, 27,
22, 16, -3, -21, -24, -18, -10, -2, 7, 26, 39, 24, 5, 2, 6, 4,
1, 1, 9, 18, 11, 9, 1, -13, -14, -5, 4, 14, 19, 23, 31, 40,
44, 39, 32, 33, 46, 37, 16, 10, 22, 42, 45, 29, 11, 2, 3, 0,
-7, -4, 6, 19, 26, 29, 30, 23, 14, 15, 18, 16, 17, 13, 11, 17,
19, 17, 18, 16, 15, 19, 28, 38, 43, 39, 35, 34, 29, 25, 19, 20,
28, 31, 22, 10, 7, 11, 15, 18, 18, 20, 33, 47, 52, 43, 34, 34,
39, 40, 35, 26, 23, 21, 26, 37, 50, 46, 35, 27, 24, 26, 33, 42,
48, 48, 46, 39, 20, 15, 23, 34, 37, 20, 7, 5, 8, 4, 0, 7,
15, 15, 6, 1, 19, 36, 40, 29, 16, 15, 22, 11, 2, 4, 9, 11,
14, 20, 27, 26, 19, 15, 22, 30, 31, 29, 32, 42, 38, 30, 28, 30,
30, 28, 19, 8, 1, -2, 9, 17, 24, 28, 27, 19, 8, 14, 31, 48,
50, 43, 32, 16, 1, -11, -17, -8, 0, 1, -3, -5, -6, -10, -12, -12,
-7, -2, };
|
dbfce047debb0e9662f5e52c1908bd5b15da665b
|
2c73a693c2b3c162eae2ab94f649d8c4494878ba
|
/components/rtos/win32/luat_rtos_win32_task.c
|
8467899ef76a6dc79c9cf3742d70e281b56a5031
|
[
"MIT"
] |
permissive
|
openLuat/LuatOS
|
185e1e140aed908434168133571ddcafe98f4e12
|
4b29d5121ab4f7133630331e8502c526c7856897
|
refs/heads/master
| 2023-08-23T04:57:23.263539
| 2023-08-23T04:46:46
| 2023-08-23T04:46:46
| 230,403,844
| 378
| 93
|
MIT
| 2021-12-17T02:19:30
| 2019-12-27T08:29:19
|
C
|
UTF-8
|
C
| false
| false
| 891
|
c
|
luat_rtos_win32_task.c
|
#include "luat_base.h"
#include "luat_rtos.h"
#include "windows.h"
#define thread_type HANDLE
#define thread_id_type DWORD
#define thread_return_type DWORD
#define thread_fn LPTHREAD_START_ROUTINE
#define cond_type HANDLE
#define sem_type HANDLE
#undef ETIMEDOUT
#define ETIMEDOUT WSAETIMEDOUT
#define LUAT_LOG_TAG "thread"
#include "luat_log.h"
static void task_proxy(void* params) {
luat_thread_t* thread = (luat_thread_t*)params;
thread->entry(thread->userdata);
}
LUAT_RET luat_thread_start(luat_thread_t* thread) {
thread_type thread = NULL;
thread = CreateThread(NULL, 0, task_proxy, thread, 0, NULL);
CloseHandle(thread);
LLOGD("thread start fail %d", ret);
return LUAT_ERR_FAIL;
}
LUAT_RET luat_thread_stop(luat_thread_t* thread) {
return LUAT_ERR_FAIL;
}
LUAT_RET luat_thread_delete(luat_thread_t* thread) {
return LUAT_ERR_FAIL;
}
|
552edda82e5a2e6640d1a5a66b215baed6f600a3
|
f3eed0234b4d0ad2bbb2abd700cf1e2c7a0e8a1d
|
/AKWF-c/AKWF_0016/AKWF_1561.h
|
9eb6d57cefc3acdcb3678eb55edd417a351c4fcb
|
[
"CC0-1.0"
] |
permissive
|
KristofferKarlAxelEkstrand/AKWF-FREE
|
b2defa1a2d389d309be6dd2e9f968923daf80d1b
|
cf8171df36e9fec25416b5f568b72a6e2cb69194
|
refs/heads/master
| 2023-07-23T18:22:36.939705
| 2023-07-10T17:14:40
| 2023-07-10T17:14:40
| 145,817,187
| 359
| 59
|
CC0-1.0
| 2023-07-10T17:14:41
| 2018-08-23T07:26:56
| null |
UTF-8
|
C
| false
| false
| 4,672
|
h
|
AKWF_1561.h
|
/* Adventure Kid Waveforms (AKWF) converted for use with Teensy Audio Library
*
* Adventure Kid Waveforms(AKWF) Open waveforms library
* https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/
*
* This code is in the public domain, CC0 1.0 Universal (CC0 1.0)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* Converted by Brad Roy, https://github.com/prosper00
*/
/* AKWF_1561 256 samples
+-----------------------------------------------------------------------------------------------------------------+
| ****************************************************************** ******* |
| ********* ** * * |
| **** * * * |
|** * * * |
| * * * *|
| * * * **|
| * * * * |
| * * * * |
| * * * ** |
| * * * * |
| * * *** |
| * * ** |
| * * ** |
| * * * |
| * * * |
+-----------------------------------------------------------------------------------------------------------------+
*/
const uint16_t AKWF_1561 [] = {
32911, 33755, 34639, 35410, 36124, 36774, 37355, 37889, 38377, 38808, 39221, 39574, 39912, 40208, 40485, 40736,
40959, 41161, 41351, 41517, 41673, 41809, 41938, 42052, 42153, 42248, 42334, 42412, 42480, 42544, 42602, 42653,
42698, 42741, 42777, 42812, 42841, 42868, 42893, 42914, 42934, 42951, 42966, 42979, 42990, 43003, 43011, 43019,
43024, 43030, 43034, 43037, 43042, 43045, 43045, 43046, 43047, 43047, 43047, 43046, 43045, 43044, 43042, 43038,
43037, 43034, 43032, 43029, 43026, 43023, 43020, 43016, 43011, 43008, 43004, 43001, 42996, 42992, 42988, 42983,
42979, 42975, 42971, 42966, 42962, 42957, 42953, 42949, 42945, 42939, 42933, 42929, 42926, 42922, 42915, 42911,
42907, 42902, 42897, 42891, 42888, 42883, 42877, 42875, 42868, 42866, 42858, 42856, 42849, 42846, 42838, 42835,
42833, 42824, 42825, 42812, 42816, 42801, 42807, 42788, 42801, 42776, 42794, 42764, 42785, 42754, 42777, 42743,
42765, 42737, 42752, 42734, 42736, 42730, 42718, 42731, 42699, 42734, 42674, 42740, 42649, 42744, 42624, 42749,
42602, 42752, 42582, 42749, 42569, 42739, 42565, 42721, 42570, 42691, 42588, 42646, 42621, 42587, 42666, 42512,
42729, 42423, 42809, 42318, 42903, 42198, 43014, 42055, 43153, 41873, 43349, 41600, 43719, 40918, 45197, 36031,
828, 220, 81, 0, 250, 0, 328, 0, 356, 0, 353, 0, 331, 0, 294, 0,
247, 0, 194, 29, 146, 115, 106, 192, 77, 257, 65, 303, 71, 333, 100, 338,
152, 323, 228, 282, 331, 216, 459, 125, 613, 3, 803, 0, 1042, 0, 1393, 0,
2185, 0, 12344, 45125, 42440, 43088, 43110, 42759, 43361, 42596, 43505, 42497, 43604, 42410, 43723, 42176,
44463, 35619, 8423, 6503, 11946, 13305, 17097, 18539, 21547, 22807, 25247, 26322, 28321, 29235, 30814, 31701,
};
|
1ac86cfdba635a586774c41f3cfb692bd9210c46
|
ea401c3e792a50364fe11f7cea0f35f99e8f4bde
|
/hackathon/PengXie/NeuronStructNavigator/cmake-3.6.2/Bootstrap.cmk/cmsys/Encoding.h
|
1236871e80f1d5149160ea7298d55f52bf90f41a
|
[
"BSD-3-Clause",
"MIT"
] |
permissive
|
Vaa3D/vaa3d_tools
|
edb696aa3b9b59acaf83d6d27c6ae0a14bf75fe9
|
e6974d5223ae70474efaa85e1253f5df1814fae8
|
refs/heads/master
| 2023-08-03T06:12:01.013752
| 2023-08-02T07:26:01
| 2023-08-02T07:26:01
| 50,527,925
| 107
| 86
|
MIT
| 2023-05-22T23:43:48
| 2016-01-27T18:19:17
|
C++
|
UTF-8
|
C
| false
| false
| 2,668
|
h
|
Encoding.h
|
/*============================================================================
KWSys - Kitware System Library
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#ifndef cmsys_Encoding_h
#define cmsys_Encoding_h
#include <cmsys/Configure.h>
#include <wchar.h>
/* Redefine all public interface symbol names to be in the proper
namespace. These macros are used internally to kwsys only, and are
not visible to user code. Use kwsysHeaderDump.pl to reproduce
these macros after making changes to the interface. */
#if !defined(KWSYS_NAMESPACE)
# define kwsys_ns(x) cmsys##x
# define kwsysEXPORT cmsys_EXPORT
#endif
#if !cmsys_NAME_IS_KWSYS
# define kwsysEncoding kwsys_ns(Encoding)
# define kwsysEncoding_mbstowcs kwsys_ns(Encoding_mbstowcs)
# define kwsysEncoding_DupToWide kwsys_ns(Encoding_DupToWide)
# define kwsysEncoding_wcstombs kwsys_ns(Encoding_wcstombs)
# define kwsysEncoding_DupToNarrow kwsys_ns(Encoding_DupToNarrow)
#endif
#if defined(__cplusplus)
extern "C"
{
#endif
/* Convert a narrow string to a wide string.
On Windows, UTF-8 is assumed, and on other platforms,
the current locale is assumed.
*/
kwsysEXPORT size_t kwsysEncoding_mbstowcs(wchar_t* dest, const char* src, size_t n);
/* Convert a narrow string to a wide string.
This can return NULL if the conversion fails. */
kwsysEXPORT wchar_t* kwsysEncoding_DupToWide(const char* src);
/* Convert a wide string to a narrow string.
On Windows, UTF-8 is assumed, and on other platforms,
the current locale is assumed. */
kwsysEXPORT size_t kwsysEncoding_wcstombs(char* dest, const wchar_t* src, size_t n);
/* Convert a wide string to a narrow string.
This can return NULL if the conversion fails. */
kwsysEXPORT char* kwsysEncoding_DupToNarrow(const wchar_t* str);
#if defined(__cplusplus)
} /* extern "C" */
#endif
/* If we are building a kwsys .c or .cxx file, let it use these macros.
Otherwise, undefine them to keep the namespace clean. */
#if !defined(KWSYS_NAMESPACE)
# undef kwsys_ns
# undef kwsysEXPORT
# if !defined(KWSYS_NAMESPACE) && !cmsys_NAME_IS_KWSYS
# undef kwsysEncoding
# undef kwsysEncoding_mbstowcs
# undef kwsysEncoding_DupToWide
# undef kwsysEncoding_wcstombs
# undef kwsysEncoding_DupToNarrow
# endif
#endif
#endif
|
895bb491bf854f9388c2147156aef721f465e785
|
99bdb3251fecee538e0630f15f6574054dfc1468
|
/bsp/microchip/same54/bsp/hri/hri_freqm_e54.h
|
8cbc484f66f9994c52955fd600f8cb69fb0555db
|
[
"Apache-2.0",
"Zlib",
"LicenseRef-scancode-proprietary-license",
"MIT",
"BSD-3-Clause",
"X11",
"BSD-4-Clause-UC",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
RT-Thread/rt-thread
|
03a7c52c2aeb1b06a544143b0e803d72f47d1ece
|
3602f891211904a27dcbd51e5ba72fefce7326b2
|
refs/heads/master
| 2023-09-01T04:10:20.295801
| 2023-08-31T16:20:55
| 2023-08-31T16:20:55
| 7,408,108
| 9,599
| 5,805
|
Apache-2.0
| 2023-09-14T13:37:26
| 2013-01-02T14:49:21
|
C
|
UTF-8
|
C
| false
| false
| 13,672
|
h
|
hri_freqm_e54.h
|
/**
* \file
*
* \brief SAM FREQM
*
* Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
*
* \asf_license_start
*
* \page License
*
* Subject to your compliance with these terms, you may use Microchip
* software and any derivatives exclusively with Microchip products.
* It is your responsibility to comply with third party license terms applicable
* to your use of third party software (including open source software) that
* may accompany Microchip software.
*
* THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
* WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
* INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
* AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
* LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
* LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
* SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
* POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
* ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
* RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
* THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
*
* \asf_license_stop
*
*/
#ifdef _SAME54_FREQM_COMPONENT_
#ifndef _HRI_FREQM_E54_H_INCLUDED_
#define _HRI_FREQM_E54_H_INCLUDED_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <hal_atomic.h>
#if defined(ENABLE_FREQM_CRITICAL_SECTIONS)
#define FREQM_CRITICAL_SECTION_ENTER() CRITICAL_SECTION_ENTER()
#define FREQM_CRITICAL_SECTION_LEAVE() CRITICAL_SECTION_LEAVE()
#else
#define FREQM_CRITICAL_SECTION_ENTER()
#define FREQM_CRITICAL_SECTION_LEAVE()
#endif
typedef uint16_t hri_freqm_cfga_reg_t;
typedef uint32_t hri_freqm_syncbusy_reg_t;
typedef uint32_t hri_freqm_value_reg_t;
typedef uint8_t hri_freqm_ctrla_reg_t;
typedef uint8_t hri_freqm_ctrlb_reg_t;
typedef uint8_t hri_freqm_intenset_reg_t;
typedef uint8_t hri_freqm_intflag_reg_t;
typedef uint8_t hri_freqm_status_reg_t;
static inline void hri_freqm_wait_for_sync(const void *const hw, hri_freqm_syncbusy_reg_t reg)
{
while (((Freqm *)hw)->SYNCBUSY.reg & reg) {
};
}
static inline bool hri_freqm_is_syncing(const void *const hw, hri_freqm_syncbusy_reg_t reg)
{
return ((Freqm *)hw)->SYNCBUSY.reg & reg;
}
static inline bool hri_freqm_get_INTFLAG_DONE_bit(const void *const hw)
{
return (((Freqm *)hw)->INTFLAG.reg & FREQM_INTFLAG_DONE) >> FREQM_INTFLAG_DONE_Pos;
}
static inline void hri_freqm_clear_INTFLAG_DONE_bit(const void *const hw)
{
((Freqm *)hw)->INTFLAG.reg = FREQM_INTFLAG_DONE;
}
static inline bool hri_freqm_get_interrupt_DONE_bit(const void *const hw)
{
return (((Freqm *)hw)->INTFLAG.reg & FREQM_INTFLAG_DONE) >> FREQM_INTFLAG_DONE_Pos;
}
static inline void hri_freqm_clear_interrupt_DONE_bit(const void *const hw)
{
((Freqm *)hw)->INTFLAG.reg = FREQM_INTFLAG_DONE;
}
static inline hri_freqm_intflag_reg_t hri_freqm_get_INTFLAG_reg(const void *const hw, hri_freqm_intflag_reg_t mask)
{
uint8_t tmp;
tmp = ((Freqm *)hw)->INTFLAG.reg;
tmp &= mask;
return tmp;
}
static inline hri_freqm_intflag_reg_t hri_freqm_read_INTFLAG_reg(const void *const hw)
{
return ((Freqm *)hw)->INTFLAG.reg;
}
static inline void hri_freqm_clear_INTFLAG_reg(const void *const hw, hri_freqm_intflag_reg_t mask)
{
((Freqm *)hw)->INTFLAG.reg = mask;
}
static inline void hri_freqm_set_INTEN_DONE_bit(const void *const hw)
{
((Freqm *)hw)->INTENSET.reg = FREQM_INTENSET_DONE;
}
static inline bool hri_freqm_get_INTEN_DONE_bit(const void *const hw)
{
return (((Freqm *)hw)->INTENSET.reg & FREQM_INTENSET_DONE) >> FREQM_INTENSET_DONE_Pos;
}
static inline void hri_freqm_write_INTEN_DONE_bit(const void *const hw, bool value)
{
if (value == 0x0) {
((Freqm *)hw)->INTENCLR.reg = FREQM_INTENSET_DONE;
} else {
((Freqm *)hw)->INTENSET.reg = FREQM_INTENSET_DONE;
}
}
static inline void hri_freqm_clear_INTEN_DONE_bit(const void *const hw)
{
((Freqm *)hw)->INTENCLR.reg = FREQM_INTENSET_DONE;
}
static inline void hri_freqm_set_INTEN_reg(const void *const hw, hri_freqm_intenset_reg_t mask)
{
((Freqm *)hw)->INTENSET.reg = mask;
}
static inline hri_freqm_intenset_reg_t hri_freqm_get_INTEN_reg(const void *const hw, hri_freqm_intenset_reg_t mask)
{
uint8_t tmp;
tmp = ((Freqm *)hw)->INTENSET.reg;
tmp &= mask;
return tmp;
}
static inline hri_freqm_intenset_reg_t hri_freqm_read_INTEN_reg(const void *const hw)
{
return ((Freqm *)hw)->INTENSET.reg;
}
static inline void hri_freqm_write_INTEN_reg(const void *const hw, hri_freqm_intenset_reg_t data)
{
((Freqm *)hw)->INTENSET.reg = data;
((Freqm *)hw)->INTENCLR.reg = ~data;
}
static inline void hri_freqm_clear_INTEN_reg(const void *const hw, hri_freqm_intenset_reg_t mask)
{
((Freqm *)hw)->INTENCLR.reg = mask;
}
static inline bool hri_freqm_get_SYNCBUSY_SWRST_bit(const void *const hw)
{
return (((Freqm *)hw)->SYNCBUSY.reg & FREQM_SYNCBUSY_SWRST) >> FREQM_SYNCBUSY_SWRST_Pos;
}
static inline bool hri_freqm_get_SYNCBUSY_ENABLE_bit(const void *const hw)
{
return (((Freqm *)hw)->SYNCBUSY.reg & FREQM_SYNCBUSY_ENABLE) >> FREQM_SYNCBUSY_ENABLE_Pos;
}
static inline hri_freqm_syncbusy_reg_t hri_freqm_get_SYNCBUSY_reg(const void *const hw, hri_freqm_syncbusy_reg_t mask)
{
uint32_t tmp;
tmp = ((Freqm *)hw)->SYNCBUSY.reg;
tmp &= mask;
return tmp;
}
static inline hri_freqm_syncbusy_reg_t hri_freqm_read_SYNCBUSY_reg(const void *const hw)
{
return ((Freqm *)hw)->SYNCBUSY.reg;
}
static inline hri_freqm_value_reg_t hri_freqm_get_VALUE_VALUE_bf(const void *const hw, hri_freqm_value_reg_t mask)
{
return (((Freqm *)hw)->VALUE.reg & FREQM_VALUE_VALUE(mask)) >> FREQM_VALUE_VALUE_Pos;
}
static inline hri_freqm_value_reg_t hri_freqm_read_VALUE_VALUE_bf(const void *const hw)
{
return (((Freqm *)hw)->VALUE.reg & FREQM_VALUE_VALUE_Msk) >> FREQM_VALUE_VALUE_Pos;
}
static inline hri_freqm_value_reg_t hri_freqm_get_VALUE_reg(const void *const hw, hri_freqm_value_reg_t mask)
{
uint32_t tmp;
tmp = ((Freqm *)hw)->VALUE.reg;
tmp &= mask;
return tmp;
}
static inline hri_freqm_value_reg_t hri_freqm_read_VALUE_reg(const void *const hw)
{
return ((Freqm *)hw)->VALUE.reg;
}
static inline void hri_freqm_set_CTRLA_SWRST_bit(const void *const hw)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CTRLA.reg |= FREQM_CTRLA_SWRST;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_freqm_get_CTRLA_SWRST_bit(const void *const hw)
{
uint8_t tmp;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST);
tmp = ((Freqm *)hw)->CTRLA.reg;
tmp = (tmp & FREQM_CTRLA_SWRST) >> FREQM_CTRLA_SWRST_Pos;
return (bool)tmp;
}
static inline void hri_freqm_set_CTRLA_ENABLE_bit(const void *const hw)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CTRLA.reg |= FREQM_CTRLA_ENABLE;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_freqm_get_CTRLA_ENABLE_bit(const void *const hw)
{
uint8_t tmp;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
tmp = ((Freqm *)hw)->CTRLA.reg;
tmp = (tmp & FREQM_CTRLA_ENABLE) >> FREQM_CTRLA_ENABLE_Pos;
return (bool)tmp;
}
static inline void hri_freqm_write_CTRLA_ENABLE_bit(const void *const hw, bool value)
{
uint8_t tmp;
FREQM_CRITICAL_SECTION_ENTER();
tmp = ((Freqm *)hw)->CTRLA.reg;
tmp &= ~FREQM_CTRLA_ENABLE;
tmp |= value << FREQM_CTRLA_ENABLE_Pos;
((Freqm *)hw)->CTRLA.reg = tmp;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline void hri_freqm_clear_CTRLA_ENABLE_bit(const void *const hw)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CTRLA.reg &= ~FREQM_CTRLA_ENABLE;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline void hri_freqm_toggle_CTRLA_ENABLE_bit(const void *const hw)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CTRLA.reg ^= FREQM_CTRLA_ENABLE;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_SWRST | FREQM_SYNCBUSY_ENABLE);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline void hri_freqm_set_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CTRLA.reg |= mask;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline hri_freqm_ctrla_reg_t hri_freqm_get_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t mask)
{
uint8_t tmp;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
tmp = ((Freqm *)hw)->CTRLA.reg;
tmp &= mask;
return tmp;
}
static inline void hri_freqm_write_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t data)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CTRLA.reg = data;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline void hri_freqm_clear_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CTRLA.reg &= ~mask;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline void hri_freqm_toggle_CTRLA_reg(const void *const hw, hri_freqm_ctrla_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CTRLA.reg ^= mask;
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline hri_freqm_ctrla_reg_t hri_freqm_read_CTRLA_reg(const void *const hw)
{
hri_freqm_wait_for_sync(hw, FREQM_SYNCBUSY_MASK);
return ((Freqm *)hw)->CTRLA.reg;
}
static inline void hri_freqm_set_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CFGA.reg |= FREQM_CFGA_REFNUM(mask);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline hri_freqm_cfga_reg_t hri_freqm_get_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t mask)
{
uint16_t tmp;
tmp = ((Freqm *)hw)->CFGA.reg;
tmp = (tmp & FREQM_CFGA_REFNUM(mask)) >> FREQM_CFGA_REFNUM_Pos;
return tmp;
}
static inline void hri_freqm_write_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t data)
{
uint16_t tmp;
FREQM_CRITICAL_SECTION_ENTER();
tmp = ((Freqm *)hw)->CFGA.reg;
tmp &= ~FREQM_CFGA_REFNUM_Msk;
tmp |= FREQM_CFGA_REFNUM(data);
((Freqm *)hw)->CFGA.reg = tmp;
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline void hri_freqm_clear_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CFGA.reg &= ~FREQM_CFGA_REFNUM(mask);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline void hri_freqm_toggle_CFGA_REFNUM_bf(const void *const hw, hri_freqm_cfga_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CFGA.reg ^= FREQM_CFGA_REFNUM(mask);
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline hri_freqm_cfga_reg_t hri_freqm_read_CFGA_REFNUM_bf(const void *const hw)
{
uint16_t tmp;
tmp = ((Freqm *)hw)->CFGA.reg;
tmp = (tmp & FREQM_CFGA_REFNUM_Msk) >> FREQM_CFGA_REFNUM_Pos;
return tmp;
}
static inline void hri_freqm_set_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CFGA.reg |= mask;
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline hri_freqm_cfga_reg_t hri_freqm_get_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t mask)
{
uint16_t tmp;
tmp = ((Freqm *)hw)->CFGA.reg;
tmp &= mask;
return tmp;
}
static inline void hri_freqm_write_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t data)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CFGA.reg = data;
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline void hri_freqm_clear_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CFGA.reg &= ~mask;
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline void hri_freqm_toggle_CFGA_reg(const void *const hw, hri_freqm_cfga_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CFGA.reg ^= mask;
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline hri_freqm_cfga_reg_t hri_freqm_read_CFGA_reg(const void *const hw)
{
return ((Freqm *)hw)->CFGA.reg;
}
static inline bool hri_freqm_get_STATUS_BUSY_bit(const void *const hw)
{
return (((Freqm *)hw)->STATUS.reg & FREQM_STATUS_BUSY) >> FREQM_STATUS_BUSY_Pos;
}
static inline void hri_freqm_clear_STATUS_BUSY_bit(const void *const hw)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->STATUS.reg = FREQM_STATUS_BUSY;
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline bool hri_freqm_get_STATUS_OVF_bit(const void *const hw)
{
return (((Freqm *)hw)->STATUS.reg & FREQM_STATUS_OVF) >> FREQM_STATUS_OVF_Pos;
}
static inline void hri_freqm_clear_STATUS_OVF_bit(const void *const hw)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->STATUS.reg = FREQM_STATUS_OVF;
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline hri_freqm_status_reg_t hri_freqm_get_STATUS_reg(const void *const hw, hri_freqm_status_reg_t mask)
{
uint8_t tmp;
tmp = ((Freqm *)hw)->STATUS.reg;
tmp &= mask;
return tmp;
}
static inline void hri_freqm_clear_STATUS_reg(const void *const hw, hri_freqm_status_reg_t mask)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->STATUS.reg = mask;
FREQM_CRITICAL_SECTION_LEAVE();
}
static inline hri_freqm_status_reg_t hri_freqm_read_STATUS_reg(const void *const hw)
{
return ((Freqm *)hw)->STATUS.reg;
}
static inline void hri_freqm_write_CTRLB_reg(const void *const hw, hri_freqm_ctrlb_reg_t data)
{
FREQM_CRITICAL_SECTION_ENTER();
((Freqm *)hw)->CTRLB.reg = data;
FREQM_CRITICAL_SECTION_LEAVE();
}
#ifdef __cplusplus
}
#endif
#endif /* _HRI_FREQM_E54_H_INCLUDED */
#endif /* _SAME54_FREQM_COMPONENT_ */
|
3ef662353d1790d3a436cad6aada253b9e43db70
|
afd2087e80478010d9df66e78280f75e1ff17d45
|
/torch/csrc/stub.c
|
fb132203fb80a8db1765346e5e9318d6429dbb86
|
[
"BSD-3-Clause",
"BSD-2-Clause",
"LicenseRef-scancode-secret-labs-2011",
"LicenseRef-scancode-generic-cla",
"BSL-1.0",
"Apache-2.0"
] |
permissive
|
pytorch/pytorch
|
7521ac50c47d18b916ae47a6592c4646c2cb69b5
|
a6f7dd4707ac116c0f5fb5f44f42429f38d23ab4
|
refs/heads/main
| 2023-08-03T05:05:02.822937
| 2023-08-03T00:40:33
| 2023-08-03T04:14:52
| 65,600,975
| 77,092
| 24,610
|
NOASSERTION
| 2023-09-14T21:58:39
| 2016-08-13T05:26:41
|
Python
|
UTF-8
|
C
| false
| false
| 241
|
c
|
stub.c
|
#include <Python.h>
extern PyObject* initModule(void);
#ifndef _WIN32
#ifdef __cplusplus
extern "C"
#endif
__attribute__((visibility("default"))) PyObject* PyInit__C(void);
#endif
PyMODINIT_FUNC PyInit__C(void)
{
return initModule();
}
|
1e79710d2187c7bb98280db5252021a0ce7be9c6
|
8a87f5b889a9ce7d81421515f06d9c9cbf6ce64a
|
/3rdParty/boost/1.78.0/boost/predef/compiler/visualc.h
|
5b0f2b8366bf8a04b53ccefea89c968cc95d8770
|
[
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode-public-domain",
"JSON",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense",
"BSD-4-Clause",
"Python-2.0",
"LGPL-2.1-or-later"
] |
permissive
|
arangodb/arangodb
|
0980625e76c56a2449d90dcb8d8f2c485e28a83b
|
43c40535cee37fc7349a21793dc33b1833735af5
|
refs/heads/devel
| 2023-08-31T09:34:47.451950
| 2023-08-31T07:25:02
| 2023-08-31T07:25:02
| 2,649,214
| 13,385
| 982
|
Apache-2.0
| 2023-09-14T17:02:16
| 2011-10-26T06:42:00
|
C++
|
UTF-8
|
C
| false
| false
| 3,327
|
h
|
visualc.h
|
/*
Copyright Rene Rivera 2008-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_COMPILER_VISUALC_H
#define BOOST_PREDEF_COMPILER_VISUALC_H
/* Other compilers that emulate this one need to be detected first. */
#include <boost/predef/compiler/clang.h>
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/* tag::reference[]
= `BOOST_COMP_MSVC`
http://en.wikipedia.org/wiki/Visual_studio[Microsoft Visual C/{CPP}] compiler.
Version number available as major, minor, and patch.
[options="header"]
|===
| {predef_symbol} | {predef_version}
| `+_MSC_VER+` | {predef_detection}
| `+_MSC_FULL_VER+` | V.R.P
| `+_MSC_VER+` | V.R.0
|===
NOTE: Release of Visual Studio after 2015 will no longer be identified
by Boost Predef as the marketing version number. Instead we use the
compiler version number directly, i.e. the _MSC_VER number.
*/ // end::reference[]
#define BOOST_COMP_MSVC BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if defined(_MSC_VER)
# if !defined (_MSC_FULL_VER)
# define BOOST_COMP_MSVC_BUILD 0
# else
/* how many digits does the build number have? */
# if _MSC_FULL_VER / 10000 == _MSC_VER
/* four digits */
# define BOOST_COMP_MSVC_BUILD (_MSC_FULL_VER % 10000)
# elif _MSC_FULL_VER / 100000 == _MSC_VER
/* five digits */
# define BOOST_COMP_MSVC_BUILD (_MSC_FULL_VER % 100000)
# else
# error "Cannot determine build number from _MSC_FULL_VER"
# endif
# endif
/*
VS2014 was skipped in the release sequence for MS. Which
means that the compiler and VS product versions are no longer
in sync. Hence we need to use different formulas for
mapping from MSC version to VS product version.
VS2017 is a total nightmare when it comes to version numbers.
Hence to avoid arguments relating to that both present and
future.. Any version after VS2015 will use solely the compiler
version, i.e. cl.exe, as the version number here.
*/
# if (_MSC_VER > 1900)
# define BOOST_COMP_MSVC_DETECTION BOOST_VERSION_NUMBER(\
_MSC_VER/100,\
_MSC_VER%100,\
BOOST_COMP_MSVC_BUILD)
# elif (_MSC_VER >= 1900)
# define BOOST_COMP_MSVC_DETECTION BOOST_VERSION_NUMBER(\
_MSC_VER/100-5,\
_MSC_VER%100,\
BOOST_COMP_MSVC_BUILD)
# else
# define BOOST_COMP_MSVC_DETECTION BOOST_VERSION_NUMBER(\
_MSC_VER/100-6,\
_MSC_VER%100,\
BOOST_COMP_MSVC_BUILD)
# endif
#endif
#ifdef BOOST_COMP_MSVC_DETECTION
# if defined(BOOST_PREDEF_DETAIL_COMP_DETECTED)
# define BOOST_COMP_MSVC_EMULATED BOOST_COMP_MSVC_DETECTION
# else
# undef BOOST_COMP_MSVC
# define BOOST_COMP_MSVC BOOST_COMP_MSVC_DETECTION
# endif
# define BOOST_COMP_MSVC_AVAILABLE
# include <boost/predef/detail/comp_detected.h>
#endif
#define BOOST_COMP_MSVC_NAME "Microsoft Visual C/C++"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MSVC,BOOST_COMP_MSVC_NAME)
#ifdef BOOST_COMP_MSVC_EMULATED
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_COMP_MSVC_EMULATED,BOOST_COMP_MSVC_NAME)
#endif
|
7ce87c388d4dbc219ce7fe2f6ebc20fdf0bd0bd0
|
b7d4fc29e02e1379b0d44a756b4697dc19f8a792
|
/deps/icu4c/source/test/cintltst/uenumtst.c
|
cfe4a72b61c468997cec8c45fafbcb0d4b1be1f2
|
[
"GPL-1.0-or-later",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"ICU",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"NAIST-2003",
"BSD-3-Clause",
"LicenseRef-scancode-unicode",
"GPL-3.0-or-later",
"NTP",
"LicenseRef-scancode-unicode-icu-58",
"LicenseRef-scancode-autoconf-simple-exception"
] |
permissive
|
vslavik/poedit
|
45140ca86a853db58ddcbe65ab588da3873c4431
|
1b0940b026b429a10f310d98eeeaadfab271d556
|
refs/heads/master
| 2023-08-29T06:24:16.088676
| 2023-08-14T15:48:18
| 2023-08-14T15:48:18
| 477,156
| 1,424
| 275
|
MIT
| 2023-09-01T16:57:47
| 2010-01-18T08:23:13
|
C++
|
UTF-8
|
C
| false
| false
| 13,895
|
c
|
uenumtst.c
|
/*
*******************************************************************************
*
* Copyright (C) 2002-2016, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: uenumtst.c
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:2
*
* created on: 2002jul08
* created by: Vladimir Weinstein
*/
#include "cintltst.h"
#include "uenumimp.h"
#include "cmemory.h"
#include "cstring.h"
#include "unicode/ustring.h"
static char quikBuf[256];
static char* quikU2C(const UChar* str, int32_t len) {
u_UCharsToChars(str, quikBuf, len);
quikBuf[len] = 0;
return quikBuf;
}
static const char* test1[] = {
"first",
"second",
"third",
"fourth"
};
struct chArrayContext {
int32_t currIndex;
int32_t maxIndex;
char *currChar;
UChar *currUChar;
char **array;
};
typedef struct chArrayContext chArrayContext;
#define cont ((chArrayContext *)en->context)
static void U_CALLCONV
chArrayClose(UEnumeration *en) {
if(cont->currUChar != NULL) {
free(cont->currUChar);
cont->currUChar = NULL;
}
free(en);
}
static int32_t U_CALLCONV
chArrayCount(UEnumeration *en, UErrorCode *status) {
return cont->maxIndex;
}
static const UChar* U_CALLCONV
chArrayUNext(UEnumeration *en, int32_t *resultLength, UErrorCode *status) {
if(cont->currIndex >= cont->maxIndex) {
return NULL;
}
if(cont->currUChar == NULL) {
cont->currUChar = (UChar *)malloc(1024*sizeof(UChar));
}
cont->currChar = (cont->array)[cont->currIndex];
*resultLength = (int32_t)strlen(cont->currChar);
u_charsToUChars(cont->currChar, cont->currUChar, *resultLength);
cont->currIndex++;
return cont->currUChar;
}
static const char* U_CALLCONV
chArrayNext(UEnumeration *en, int32_t *resultLength, UErrorCode *status) {
if(cont->currIndex >= cont->maxIndex) {
return NULL;
}
cont->currChar = (cont->array)[cont->currIndex];
*resultLength = (int32_t)strlen(cont->currChar);
cont->currIndex++;
return cont->currChar;
}
static void U_CALLCONV
chArrayReset(UEnumeration *en, UErrorCode *status) {
cont->currIndex = 0;
}
chArrayContext myCont = {
0, 0,
NULL, NULL,
NULL
};
UEnumeration chEnum = {
NULL,
&myCont,
chArrayClose,
chArrayCount,
chArrayUNext,
chArrayNext,
chArrayReset
};
static const UEnumeration emptyEnumerator = {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
static const UEnumeration emptyPartialEnumerator = {
NULL,
NULL,
NULL,
NULL,
uenum_unextDefault,
NULL,
NULL,
};
/********************************************************************/
static const UChar _first[] = {102,105,114,115,116,0}; /* "first" */
static const UChar _second[]= {115,101,99,111,110,100,0}; /* "second" */
static const UChar _third[] = {116,104,105,114,100,0}; /* "third" */
static const UChar _fourth[]= {102,111,117,114,116,104,0};/* "fourth" */
static const UChar* test2[] = {
_first, _second, _third, _fourth
};
struct uchArrayContext {
int32_t currIndex;
int32_t maxIndex;
UChar *currUChar;
UChar **array;
};
typedef struct uchArrayContext uchArrayContext;
#define ucont ((uchArrayContext *)en->context)
static void U_CALLCONV
uchArrayClose(UEnumeration *en) {
free(en);
}
static int32_t U_CALLCONV
uchArrayCount(UEnumeration *en, UErrorCode *status) {
return ucont->maxIndex;
}
static const UChar* U_CALLCONV
uchArrayUNext(UEnumeration *en, int32_t *resultLength, UErrorCode *status) {
if(ucont->currIndex >= ucont->maxIndex) {
return NULL;
}
ucont->currUChar = (ucont->array)[ucont->currIndex];
*resultLength = u_strlen(ucont->currUChar);
ucont->currIndex++;
return ucont->currUChar;
}
static void U_CALLCONV
uchArrayReset(UEnumeration *en, UErrorCode *status) {
ucont->currIndex = 0;
}
uchArrayContext myUCont = {
0, 0,
NULL, NULL
};
UEnumeration uchEnum = {
NULL,
&myUCont,
uchArrayClose,
uchArrayCount,
uchArrayUNext,
uenum_nextDefault,
uchArrayReset
};
/********************************************************************/
static UEnumeration *getchArrayEnum(const char** source, int32_t size) {
UEnumeration *en = (UEnumeration *)malloc(sizeof(UEnumeration));
memcpy(en, &chEnum, sizeof(UEnumeration));
cont->array = (char **)source;
cont->maxIndex = size;
return en;
}
static void EnumerationTest(void) {
UErrorCode status = U_ZERO_ERROR;
int32_t len = 0;
UEnumeration *en = getchArrayEnum(test1, UPRV_LENGTHOF(test1));
const char *string = NULL;
const UChar *uString = NULL;
while ((string = uenum_next(en, &len, &status))) {
log_verbose("read \"%s\", length %i\n", string, len);
}
uenum_reset(en, &status);
while ((uString = uenum_unext(en, &len, &status))) {
log_verbose("read \"%s\" (UChar), length %i\n", quikU2C(uString, len), len);
}
uenum_close(en);
}
static void EmptyEnumerationTest(void) {
UErrorCode status = U_ZERO_ERROR;
UEnumeration *emptyEnum = uprv_malloc(sizeof(UEnumeration));
uprv_memcpy(emptyEnum, &emptyEnumerator, sizeof(UEnumeration));
if (uenum_count(emptyEnum, &status) != -1 || status != U_UNSUPPORTED_ERROR) {
log_err("uenum_count failed\n");
}
status = U_ZERO_ERROR;
if (uenum_next(emptyEnum, NULL, &status) != NULL || status != U_UNSUPPORTED_ERROR) {
log_err("uenum_next failed\n");
}
status = U_ZERO_ERROR;
if (uenum_unext(emptyEnum, NULL, &status) != NULL || status != U_UNSUPPORTED_ERROR) {
log_err("uenum_unext failed\n");
}
status = U_ZERO_ERROR;
uenum_reset(emptyEnum, &status);
if (status != U_UNSUPPORTED_ERROR) {
log_err("uenum_reset failed\n");
}
uenum_close(emptyEnum);
status = U_ZERO_ERROR;
if (uenum_next(NULL, NULL, &status) != NULL || status != U_ZERO_ERROR) {
log_err("uenum_next(NULL) failed\n");
}
status = U_ZERO_ERROR;
if (uenum_unext(NULL, NULL, &status) != NULL || status != U_ZERO_ERROR) {
log_err("uenum_unext(NULL) failed\n");
}
status = U_ZERO_ERROR;
uenum_reset(NULL, &status);
if (status != U_ZERO_ERROR) {
log_err("uenum_reset(NULL) failed\n");
}
emptyEnum = uprv_malloc(sizeof(UEnumeration));
uprv_memcpy(emptyEnum, &emptyPartialEnumerator, sizeof(UEnumeration));
status = U_ZERO_ERROR;
if (uenum_unext(emptyEnum, NULL, &status) != NULL || status != U_UNSUPPORTED_ERROR) {
log_err("partial uenum_unext failed\n");
}
uenum_close(emptyEnum);
}
static UEnumeration *getuchArrayEnum(const UChar** source, int32_t size) {
UEnumeration *en = (UEnumeration *)malloc(sizeof(UEnumeration));
memcpy(en, &uchEnum, sizeof(UEnumeration));
ucont->array = (UChar **)source;
ucont->maxIndex = size;
return en;
}
static void DefaultNextTest(void) {
UErrorCode status = U_ZERO_ERROR;
int32_t len = 0;
UEnumeration *en = getuchArrayEnum(test2, UPRV_LENGTHOF(test2));
const char *string = NULL;
const UChar *uString = NULL;
while ((uString = uenum_unext(en, &len, &status))) {
log_verbose("read \"%s\" (UChar), length %i\n", quikU2C(uString, len), len);
}
if (U_FAILURE(status)) {
log_err("FAIL: uenum_unext => %s\n", u_errorName(status));
}
uenum_reset(en, &status);
while ((string = uenum_next(en, &len, &status))) {
log_verbose("read \"%s\", length %i\n", string, len);
}
if (U_FAILURE(status)) {
log_err("FAIL: uenum_next => %s\n", u_errorName(status));
}
uenum_close(en);
}
static void verifyEnumeration(int line, UEnumeration *u, const char * const * compareToChar, const UChar * const * compareToUChar, int32_t expect_count) {
UErrorCode status = U_ZERO_ERROR;
int32_t got_count,i,len;
const char *c;
UChar buf[1024];
log_verbose("%s:%d: verifying enumeration..\n", __FILE__, line);
uenum_reset(u, &status);
if(U_FAILURE(status)) {
log_err("%s:%d: FAIL: could not reset char strings enumeration: %s\n", __FILE__, line, u_errorName(status));
return;
}
got_count = uenum_count(u, &status);
if(U_FAILURE(status)) {
log_err("%s:%d: FAIL: could not count char strings enumeration: %s\n", __FILE__, line, u_errorName(status));
return;
}
if(got_count!=expect_count) {
log_err("%s:%d: FAIL: expect count %d got %d\n", __FILE__, line, expect_count, got_count);
} else {
log_verbose("%s:%d: OK: got count %d\n", __FILE__, line, got_count);
}
if(compareToChar!=NULL) { /* else, not invariant */
for(i=0;i<got_count;i++) {
c = uenum_next(u,&len, &status);
if(U_FAILURE(status)) {
log_err("%s:%d: FAIL: could not iterate to next after %d: %s\n", __FILE__, line, i, u_errorName(status));
return;
}
if(c==NULL) {
log_err("%s:%d: FAIL: got NULL for next after %d: %s\n", __FILE__, line, i, u_errorName(status));
return;
}
if(strcmp(c,compareToChar[i])) {
log_err("%s:%d: FAIL: string #%d expected '%s' got '%s'\n", __FILE__, line, i, compareToChar[i], c);
} else {
log_verbose("%s:%d: OK: string #%d got '%s'\n", __FILE__, line, i, c);
}
if(len!=strlen(compareToChar[i])) {
log_err("%s:%d: FAIL: string #%d expected len %d got %d\n", __FILE__, line, i, strlen(compareToChar[i]), len);
} else {
log_verbose("%s:%d: OK: string #%d got len %d\n", __FILE__, line, i, len);
}
}
}
/* now try U */
uenum_reset(u, &status);
if(U_FAILURE(status)) {
log_err("%s:%d: FAIL: could not reset again char strings enumeration: %s\n", __FILE__, line, u_errorName(status));
return;
}
for(i=0;i<got_count;i++) {
const UChar *ustr = uenum_unext(u,&len, &status);
if(U_FAILURE(status)) {
log_err("%s:%d: FAIL: could not iterate to unext after %d: %s\n", __FILE__, line, i, u_errorName(status));
return;
}
if(ustr==NULL) {
log_err("%s:%d: FAIL: got NULL for unext after %d: %s\n", __FILE__, line, i, u_errorName(status));
return;
}
if(compareToChar!=NULL) {
u_charsToUChars(compareToChar[i], buf, strlen(compareToChar[i])+1);
if(u_strncmp(ustr,buf,len)) {
int j;
log_err("%s:%d: FAIL: ustring #%d expected '%s' got '%s'\n", __FILE__, line, i, compareToChar[i], austrdup(ustr));
for(j=0;ustr[j]&&buf[j];j++) {
log_verbose(" @ %d\t<U+%04X> vs <U+%04X>\n", j, ustr[j],buf[j]);
}
} else {
log_verbose("%s:%d: OK: ustring #%d got '%s'\n", __FILE__, line, i, compareToChar[i]);
}
if(len!=strlen(compareToChar[i])) {
log_err("%s:%d: FAIL: ustring #%d expected len %d got %d\n", __FILE__, line, i, strlen(compareToChar[i]), len);
} else {
log_verbose("%s:%d: OK: ustring #%d got len %d\n", __FILE__, line, i, len);
}
}
if(compareToUChar!=NULL) {
if(u_strcmp(ustr,compareToUChar[i])) {
int j;
log_err("%s:%d: FAIL: ustring #%d expected '%s' got '%s'\n", __FILE__, line, i, austrdup(compareToUChar[i]), austrdup(ustr));
for(j=0;ustr[j]&&compareToUChar[j];j++) {
log_verbose(" @ %d\t<U+%04X> vs <U+%04X>\n", j, ustr[j],compareToUChar[j]);
}
} else {
log_verbose("%s:%d: OK: ustring #%d got '%s'\n", __FILE__, line, i, austrdup(compareToUChar[i]));
}
if(len!=u_strlen(compareToUChar[i])) {
log_err("%s:%d: FAIL: ustring #%d expected len %d got %d\n", __FILE__, line, i, u_strlen(compareToUChar[i]), len);
} else {
log_verbose("%s:%d: OK: ustring #%d got len %d\n", __FILE__, line, i, len);
}
}
}
}
static void TestCharStringsEnumeration(void) {
UErrorCode status = U_ZERO_ERROR;
/* //! [uenum_openCharStringsEnumeration] */
const char* strings[] = { "Firstly", "Secondly", "Thirdly", "Fourthly" };
UEnumeration *u = uenum_openCharStringsEnumeration(strings, 4, &status);
/* //! [uenum_openCharStringsEnumeration] */
if(U_FAILURE(status)) {
log_err("FAIL: could not open char strings enumeration: %s\n", u_errorName(status));
return;
}
verifyEnumeration(__LINE__, u, strings, NULL, 4);
uenum_close(u);
}
static void TestUCharStringsEnumeration(void) {
UErrorCode status = U_ZERO_ERROR;
/* //! [uenum_openUCharStringsEnumeration] */
static const UChar nko_1[] = {0x07c1,0}, nko_2[] = {0x07c2,0}, nko_3[] = {0x07c3,0}, nko_4[] = {0x07c4,0};
static const UChar* ustrings[] = { nko_1, nko_2, nko_3, nko_4 };
UEnumeration *u = uenum_openUCharStringsEnumeration(ustrings, 4, &status);
/* //! [uenum_openUCharStringsEnumeration] */
if(U_FAILURE(status)) {
log_err("FAIL: could not open uchar strings enumeration: %s\n", u_errorName(status));
return;
}
verifyEnumeration(__LINE__, u, NULL, ustrings, 4);
uenum_close(u);
u = uenum_openUCharStringsEnumeration(test2, 4, &status);
if(U_FAILURE(status)) {
log_err("FAIL: could not reopen uchar strings enumeration: %s\n", u_errorName(status));
return;
}
verifyEnumeration(__LINE__, u, test1, NULL, 4); /* same string */
uenum_close(u);
}
void addEnumerationTest(TestNode** root);
void addEnumerationTest(TestNode** root)
{
addTest(root, &EnumerationTest, "tsutil/uenumtst/EnumerationTest");
addTest(root, &EmptyEnumerationTest, "tsutil/uenumtst/EmptyEnumerationTest");
addTest(root, &DefaultNextTest, "tsutil/uenumtst/DefaultNextTest");
addTest(root, &TestCharStringsEnumeration, "tsutil/uenumtst/TestCharStringsEnumeration");
addTest(root, &TestUCharStringsEnumeration, "tsutil/uenumtst/TestUCharStringsEnumeration");
}
|
5c7bbe6ef938a05c6dc13727b0f4cf8f2c4e94fa
|
6223530200223fd0add9a081a25cb6daf3a8d3c3
|
/src/utils/btorhashptr.h
|
23bce211a7fe9d49a2b8183c0b34b7efbf522c58
|
[
"MIT",
"LicenseRef-scancode-dco-1.1"
] |
permissive
|
Boolector/boolector
|
959aec7715c3122763f803733f0af4f6124801d9
|
13a8a06d561041cafcaf5458e404c1ec354b2841
|
refs/heads/master
| 2023-06-08T03:52:44.634825
| 2023-01-10T22:48:06
| 2023-01-10T22:48:06
| 134,006,909
| 280
| 58
|
NOASSERTION
| 2023-09-11T23:31:41
| 2018-05-18T21:44:21
|
SMT
|
UTF-8
|
C
| false
| false
| 4,609
|
h
|
btorhashptr.h
|
/* Boolector: Satisfiability Modulo Theories (SMT) solver.
*
* Copyright (C) 2007-2021 by the authors listed in the AUTHORS file.
*
* This file is part of Boolector.
* See COPYING for more information on using this software.
*/
#ifndef BTOR_PTR_HASH_H_INCLUDED
#define BTOR_PTR_HASH_H_INCLUDED
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include "utils/btorhash.h"
#include "utils/btorhashptr.h"
#include "utils/btormem.h"
/*------------------------------------------------------------------------*/
typedef struct BtorPtrHashTable BtorPtrHashTable;
typedef struct BtorPtrHashBucket BtorPtrHashBucket;
typedef void *(*BtorCloneKeyPtr) (BtorMemMgr *mm,
const void *map,
const void *key);
typedef void (*BtorCloneDataPtr) (BtorMemMgr *mm,
const void *map,
BtorHashTableData *data,
BtorHashTableData *cloned_data);
struct BtorPtrHashBucket
{
/* public:
*/
void *key;
BtorHashTableData data;
BtorPtrHashBucket *next; /* chronologically */
BtorPtrHashBucket *prev; /* chronologically */
/* private:
*/
BtorPtrHashBucket *chain; /* collision chain */
};
struct BtorPtrHashTable
{
BtorMemMgr *mm;
uint32_t size;
uint32_t count;
BtorPtrHashBucket **table;
BtorHashPtr hash;
BtorCmpPtr cmp;
BtorPtrHashBucket *first; /* chronologically */
BtorPtrHashBucket *last; /* chronologically */
};
/*------------------------------------------------------------------------*/
BtorPtrHashTable *btor_hashptr_table_new (BtorMemMgr *,
BtorHashPtr,
BtorCmpPtr);
/* Clone hash table. 'ckey' is a function mapping key to cloned key,
* 'cdata' is a function mapping data to cloned data (note: as_ptr vs.
* as_int!). 'key_map' represents a map mapping key to cloned key values.
* 'data_map' represents a map mapping data to cloned data values. */
BtorPtrHashTable *btor_hashptr_table_clone (BtorMemMgr *mm,
BtorPtrHashTable *table,
BtorCloneKeyPtr ckey,
BtorCloneDataPtr cdata,
const void *key_map,
const void *data_map);
void btor_hashptr_table_delete (BtorPtrHashTable *p2iht);
BtorPtrHashBucket *btor_hashptr_table_get (BtorPtrHashTable *p2iht,
const void *key);
BtorPtrHashBucket *btor_hashptr_table_add (BtorPtrHashTable *p2iht, void *key);
/* Remove from hash table the bucket with the key. The key has to be an
* element of the hash table. If 'stored_data_ptr' is non zero, then data
* to which the given key was mapped is copied to this location. The same
* applies to 'stored_key_ptr'. If you traverse/iterate a hash table
* through the chronological chains, then you can remove elements while
* traversing the hash table.
*/
void btor_hashptr_table_remove (BtorPtrHashTable *,
void *key,
void **stored_key_ptr,
BtorHashTableData *stored_data_ptr);
uint32_t btor_hash_str (const void *str);
#define btor_compare_str ((BtorCmpPtr) strcmp)
/*------------------------------------------------------------------------*/
/* iterators */
/*------------------------------------------------------------------------*/
#define BTOR_PTR_HASH_TABLE_ITERATOR_STACK_SIZE 8
typedef struct BtorPtrHashTableIterator
{
BtorPtrHashBucket *bucket;
void *cur;
bool reversed;
uint8_t num_queued;
uint8_t pos;
const BtorPtrHashTable *stack[BTOR_PTR_HASH_TABLE_ITERATOR_STACK_SIZE];
} BtorPtrHashTableIterator;
void btor_iter_hashptr_init (BtorPtrHashTableIterator *it,
const BtorPtrHashTable *t);
void btor_iter_hashptr_init_reversed (BtorPtrHashTableIterator *it,
const BtorPtrHashTable *t);
void btor_iter_hashptr_queue (BtorPtrHashTableIterator *it,
const BtorPtrHashTable *t);
bool btor_iter_hashptr_has_next (const BtorPtrHashTableIterator *it);
void *btor_iter_hashptr_next (BtorPtrHashTableIterator *it);
BtorHashTableData *btor_iter_hashptr_next_data (BtorPtrHashTableIterator *it);
/*------------------------------------------------------------------------*/
#endif
|
1396dbd487d1d6531b462b823f2b46fd3056ce3f
|
1661c43eaf9e44dfe7cce269cfaae62e336036f1
|
/tool/config/siocgifconf.c
|
f888951277cca55c0bce4636405fd565e127eb26
|
[] |
permissive
|
jart/blink
|
3354eaf084e3e85a50372f1a93fc75ff2b9488b1
|
312a027d0908c1b1f9d1e9ebba837da569606b82
|
refs/heads/master
| 2023-08-31T21:30:40.551686
| 2023-08-22T15:42:44
| 2023-08-22T15:42:44
| 561,183,031
| 6,089
| 192
|
ISC
| 2023-08-22T15:42:46
| 2022-11-03T06:07:09
|
C
|
UTF-8
|
C
| false
| false
| 643
|
c
|
siocgifconf.c
|
// checks if we can enumerate network interfaces
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
char buf[16384];
int main(int argc, char *argv[]) {
int rc;
struct ifreq *ifreq;
struct ifconf ifconf;
unsigned long magnums_we_care_about[] = {
IFNAMSIZ, //
SIOCGIFADDR, //
SIOCGIFNETMASK, //
SIOCGIFBRDADDR, //
SIOCGIFDSTADDR, //
};
ifconf.ifc_buf = buf;
ifconf.ifc_len = sizeof(buf);
socket(AF_INET, SOCK_DGRAM, 0);
rc = ioctl(3, SIOCGIFCONF, &ifconf);
if (rc) return 1;
if (!ifconf.ifc_len) return 2;
ifreq = ifconf.ifc_req;
(void)ifreq;
return 0;
}
|
d24b10f3964bc14e6691c3969addc038ad09b45a
|
9de0cec678bc4a3bec2b4adabef9f39ff5b4afac
|
/PWGCF/EBYE/macros/AddTaskPIDMCEffCont.C
|
c1bc7ca575b676c1550b79cd3965f9c69815acea
|
[] |
permissive
|
alisw/AliPhysics
|
91bf1bd01ab2af656a25ff10b25e618a63667d3e
|
5df28b2b415e78e81273b0d9bf5c1b99feda3348
|
refs/heads/master
| 2023-08-31T20:41:44.927176
| 2023-08-31T14:51:12
| 2023-08-31T14:51:12
| 61,661,378
| 129
| 1,150
|
BSD-3-Clause
| 2023-09-14T18:48:45
| 2016-06-21T19:31:29
|
C++
|
UTF-8
|
C
| false
| false
| 6,130
|
c
|
AddTaskPIDMCEffCont.C
|
AliAnalysisTaskPIDMCEffCont *AddTaskPIDMCEffCont( TString centralityEstimator="V0M",
UInt_t triggerSelectionString = AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral,
Double_t partData = 1,
Double_t vertexZ=10., Int_t nsigma = 3,
Double_t ptMin=0, Double_t ptMax=10,
Double_t etaMin=-0.8, Double_t etaMax=0.8,
Bool_t PIDNsigma = kFALSE,
Bool_t PIDPDG = kFALSE,
Bool_t DCAext = kFALSE,
AliAnalysisTaskPIDMCEffCont::kParticleOfInterest particleType = AliAnalysisTaskPIDMCEffCont::kPion,
Int_t AODfilterBit = 768,
TString fileNameBase="AnalysisResults"
) {
// Creates a balance function analysis task and adds it to the analysis manager.
// Get the pointer to the existing analysis manager via the static access method.
TString centralityName("");
static const Int_t nCentralitiespart1 = 2;
static const Int_t nCentralitiespart2 = 5;
static const Int_t nCentralitiespart3 = 4;
Double_t gCentrality[nCentralitiespart2];
if(partData == 1) {
gCentrality[0]=0;
gCentrality[1]=10;
}
else if(partData == 2) {
gCentrality[0] = 10;
gCentrality[1] = 20;
gCentrality[2] = 30;
gCentrality[3] = 40;
gCentrality[4] = 50;
}
else if(partData == 3) {
gCentrality[0] = 50;
gCentrality[1] = 60;
gCentrality[2] = 70;
gCentrality[3] = 80;
}
Int_t nCentralities = 0;
if(partData == 1) nCentralities = nCentralitiespart1;
else if(partData == 2) nCentralities = nCentralitiespart2;
else if(partData == 3) nCentralities = nCentralitiespart3;
TString suffixName[nCentralitiespart2];
TString outputFileName(fileNameBase);
outputFileName.Append(".root");
AliAnalysisTaskPIDMCEffCont *task[nCentralitiespart2];
AliAnalysisDataContainer *coutQA[nCentralitiespart2];
AliAnalysisDataContainer *coutEff[nCentralitiespart2];
//===========================================================================
for(Int_t iCentralityBin = 0; iCentralityBin < nCentralities-1 ; iCentralityBin++) {
suffixName[iCentralityBin] = "Centrality_";
suffixName[iCentralityBin] += gCentrality[iCentralityBin];
suffixName[iCentralityBin] += "To";
suffixName[iCentralityBin] += gCentrality[iCentralityBin+1];
suffixName[iCentralityBin] += "_fb";
suffixName[iCentralityBin] += AODfilterBit;
if(PIDNsigma)
suffixName[iCentralityBin] += "_nsigmaPID";
if(PIDPDG)
suffixName[iCentralityBin] += "_nsigmaPDG";
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
::Error("AddTaskTriggeredBF", "No analysis manager to connect to.");
return NULL;
}
// Check the analysis type using the event handlers connected to the analysis manager.
//===========================================================================
if (!mgr->GetInputEventHandler()) {
::Error("AddTaskTriggeredBF", "This task requires an input event handler");
return NULL;
}
TString analysisType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
//if(dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())) analysisType = "MC";
// Create the task, add it to manager and configure it.
//===========================================================================
task[iCentralityBin] = new AliAnalysisTaskPIDMCEffCont(Form("Task_%s",suffixName[iCentralityBin].Data()));
// centrality
task[iCentralityBin]->UseCentrality();
task[iCentralityBin]->SetCentralityEstimator(centralityEstimator);
task[iCentralityBin]->SetRejectInjectedSignals();
task[iCentralityBin]->SetCentralityPercentileRange(gCentrality[iCentralityBin],gCentrality[iCentralityBin+1]);
task[iCentralityBin]->SelectCollisionCandidates(triggerSelectionString);
// vertex
task[iCentralityBin]->SetVertexDiamond(3.,3.,vertexZ);
task[iCentralityBin]->SetKinematicsCutsAOD(ptMin,ptMax,etaMin,etaMax);
task[iCentralityBin]->SetAODtrackCutBit(AODfilterBit);
if(DCAext)
task[iCentralityBin]->USEextendedDCA();
if(PIDNsigma) {
task[iCentralityBin]->UsePIDNsigma();
task[iCentralityBin]->SetNSigmaPID(nsigma);
task[iCentralityBin]->setParticleType(particleType);
mgr->AddTask(task[iCentralityBin]);
}
if(PIDPDG) {
task[iCentralityBin]->UsePIDPDG();
task[iCentralityBin]->setParticleType(particleType);
mgr->AddTask(task[iCentralityBin]);
}
if(!PIDNsigma && !PIDPDG){
mgr->AddTask(task[iCentralityBin]);
}
// Create ONLY the output containers for the data produced by the task.
// Get and connect other common input/output containers via the manager as below
//==============================================================================
TString outputFileName = AliAnalysisManager::GetCommonFileName();
outputFileName += ":BalanceFunctionEffContAnalysis";
coutQA[iCentralityBin] = mgr->CreateContainer(Form("listQA_%s",suffixName[iCentralityBin].Data()), TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data());
coutEff[iCentralityBin] = mgr->CreateContainer(Form("listEff_%s",suffixName[iCentralityBin].Data()), TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data());
mgr->ConnectInput(task[iCentralityBin], 0, mgr->GetCommonInputContainer());
mgr->ConnectOutput(task[iCentralityBin], 1, coutQA[iCentralityBin]);
mgr->ConnectOutput(task[iCentralityBin], 2, coutEff[iCentralityBin]);
}
}
|
527fe0cd127f0ff0559d8e67efa9f96fa3bd5103
|
88ae8695987ada722184307301e221e1ba3cc2fa
|
/third_party/wayland-protocols/gtk/gsk/gskprivate.h
|
5d9f88c942dce693c20e414a7f74176fae6f5a12
|
[
"BSD-3-Clause",
"MIT",
"LGPL-2.0-or-later",
"LGPL-2.0-only",
"LGPL-2.1-only",
"Apache-2.0",
"GPL-1.0-or-later"
] |
permissive
|
iridium-browser/iridium-browser
|
71d9c5ff76e014e6900b825f67389ab0ccd01329
|
5ee297f53dc7f8e70183031cff62f37b0f19d25f
|
refs/heads/master
| 2023-08-03T16:44:16.844552
| 2023-07-20T15:17:00
| 2023-07-23T16:09:30
| 220,016,632
| 341
| 40
|
BSD-3-Clause
| 2021-08-13T13:54:45
| 2019-11-06T14:32:31
| null |
UTF-8
|
C
| false
| false
| 361
|
h
|
gskprivate.h
|
#ifndef __GSK_PRIVATE_H__
#define __GSK_PRIVATE_H__
#include <glib.h>
#include <pango/pango.h>
G_BEGIN_DECLS
void gsk_ensure_resources (void);
int pango_glyph_string_num_glyphs (PangoGlyphString *glyphs);
typedef struct _GskVulkanRender GskVulkanRender;
typedef struct _GskVulkanRenderPass GskVulkanRenderPass;
G_END_DECLS
#endif /* __GSK_PRIVATE_H__ */
|
8e3269212be0fc23a7569067ffa8b2d5354caca9
|
9ca19ee62e2c985be413bd12e5eb63b44833750d
|
/src/platform/arm-ariel/consoleio.c
|
aa1ccd708535221d78d6293a74447856d1b0999e
|
[
"MIT"
] |
permissive
|
MitchBradley/cforth
|
4cb523847c552b2e32e5e50a328b8e263a074d85
|
bae39263f2615e1d260426e3eca0ab32816f54ef
|
refs/heads/master
| 2023-08-31T17:23:00.037535
| 2023-08-17T09:01:57
| 2023-08-17T09:01:57
| 12,050,604
| 142
| 43
|
NOASSERTION
| 2023-08-21T16:36:56
| 2013-08-12T07:50:31
|
C
|
UTF-8
|
C
| false
| false
| 1,998
|
c
|
consoleio.c
|
/*
* Ariel (Dell Wyse 3020) Console I/O
*
* Copyright (C) 2020 Lubomir Rintel <lkundrak@v3.sk>
*
* Based on src/platform/arm-xo-1.75/consoleio.c
*/
#include "forth.h"
#include "compiler.h"
#define UART3REG ((unsigned int volatile *)0xd4018000)
int dbg_uart_only = 0;
void txdbg(char c)
{
while ((UART3REG[5] & 0x20) == 0)
;
UART3REG[0] = (unsigned int)c;
}
void raw_putchar(char c)
{
txdbg(c);
}
int kbhit3() {
return (UART3REG[5] & 0x1) != 0;
}
int kbhit() {
return kbhit3();
}
int getkey()
{
do {
if (kbhit3())
return UART3REG[0];
} while (1);
}
void init_io(int argc, char **argv, cell *up)
{
dbg_uart_only = 0;
// If the PJ4 processor has already been started, this is an unexpected
// reset so we skip the SoC init to preserve state for debugging.
if (((*(int *)0xd4050020) & 0x02) == 0)
return;
*(int *)0xd4051024 = 0xffffffff; // PMUM_CGR_PJ - everything on
*(int *)0xd4015064 = 0x00000007; // APBC_AIB_CLK_RST - reset, functional and APB clock on
*(int *)0xd4015064 = 0x00000003; // APBC_AIB_CLK_RST - release reset, functional and APB clock on
*(int *)0xd4051020 = 0x00000000; // PMUM_PRR_PJ - Turn off SLAVE_R and WDTR2 (empirically, the WDTR2 bit stays set afterwards)
*(int *)0xd401e120 = 0x00001001; // GPIO51 = AF1 for UART3 RXD
*(int *)0xd401e124 = 0x00001001; // GPIO52 = AF for UART3 TXD
*(int *)0xd4015034 = 0x00000013; // APBC_UART3_CLK_RST - VCTCXO, functional and APB clock on (26 mhz)
UART3REG[1] = 0x40; // Marvell-specific UART Enable bit
UART3REG[3] = 0x83; // Divisor Latch Access bit
UART3REG[0] = 14; // 115200 baud
UART3REG[1] = 00; // 115200 baud
UART3REG[3] = 0x03; // 8n1
UART3REG[2] = 0x07; // FIFOs and stuff
}
void irq_handler()
{
}
void swi_handler()
{
}
void raise()
{
}
int strlen(const char *s)
{
const char *p;
for (p=s; *p != '\0'; *p++)
;
return p-s;
}
|
6998c71a2c5c06fc774d2eba4e3df847d4738c5a
|
b01b4365ab6c9afeb6664563dd314df4f269014f
|
/env/env.c
|
c69bd7e49a0e7d53bbaa821ed70b37e20897af64
|
[
"MIT"
] |
permissive
|
malxau/yori
|
6208011ca60485cfbf141c7639e9f941a160e002
|
027f9b42c08cc5fcc682ecb7fb67e6de5363b8de
|
refs/heads/master
| 2023-09-01T13:11:19.083028
| 2023-08-28T00:00:02
| 2023-08-28T00:00:02
| 127,679,677
| 1,234
| 31
|
MIT
| 2023-04-23T04:54:56
| 2018-04-01T23:29:17
|
C
|
UTF-8
|
C
| false
| false
| 15,003
|
c
|
env.c
|
/**
* @file env/env.c
*
* Yori shell set environment state and execute command
*
* Copyright (c) 2019-2023 Malcolm J. Smith
*
* 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.
*/
#include <yoripch.h>
#include <yorilib.h>
#if YORI_BUILTIN
#include <yoricall.h>
#endif
/**
Help text to display to the user.
*/
const
CHAR strEnvHelpText[] =
"\n"
"Set environment state and execute a command.\n"
"\n"
"ENV [-license] [-iv Var] [Var=Value] Command\n"
"\n"
" -iv Set a variable whose value is provided as standard input\n"
" -- Treat all further arguments as variables or commands\n";
/**
Display usage text to the user.
*/
BOOL
EnvHelp(VOID)
{
YoriLibOutput(YORI_LIB_OUTPUT_STDOUT, _T("Env %i.%02i\n"), YORI_VER_MAJOR, YORI_VER_MINOR);
#if YORI_BUILD_ID
YoriLibOutput(YORI_LIB_OUTPUT_STDOUT, _T(" Build %i\n"), YORI_BUILD_ID);
#endif
YoriLibOutput(YORI_LIB_OUTPUT_STDOUT, _T("%hs"), strEnvHelpText);
return TRUE;
}
/**
A buffer for a single data stream.
*/
typedef struct _ENV_BUFFER {
/**
The number of bytes currently allocated to this buffer.
*/
DWORD BytesAllocated;
/**
The number of bytes populated with data in this buffer.
*/
DWORD BytesPopulated;
/**
A handle to a pipe which is the source of data for this buffer.
*/
HANDLE hSource;
/**
The data buffer.
*/
PUCHAR Buffer;
} ENV_BUFFER, *PENV_BUFFER;
/**
Allocate and initialize a buffer for an input stream.
@param Buffer Pointer to the buffer to allocate structures for.
@return TRUE if the buffer is successfully initialized, FALSE if it is not.
*/
BOOL
EnvAllocateBuffer(
__out PENV_BUFFER Buffer
)
{
Buffer->BytesAllocated = 1024;
Buffer->Buffer = YoriLibMalloc(Buffer->BytesAllocated);
if (Buffer->Buffer == NULL) {
return FALSE;
}
return TRUE;
}
/**
Free structures associated with a single input stream.
@param ThisBuffer Pointer to the single stream's buffers to deallocate.
*/
VOID
EnvFreeBuffer(
__in PENV_BUFFER ThisBuffer
)
{
if (ThisBuffer->Buffer != NULL) {
YoriLibFree(ThisBuffer->Buffer);
}
}
/**
Populate data from stdin into an in memory buffer.
@param ThisBuffer A pointer to the process buffer set.
@return TRUE to indicate success, FALSE to indicate failure.
*/
BOOL
EnvBufferPump(
__in PENV_BUFFER ThisBuffer
)
{
DWORD BytesRead;
BOOL Result = FALSE;
while (TRUE) {
if (ReadFile(ThisBuffer->hSource,
YoriLibAddToPointer(ThisBuffer->Buffer, ThisBuffer->BytesPopulated),
ThisBuffer->BytesAllocated - ThisBuffer->BytesPopulated,
&BytesRead,
NULL)) {
if (BytesRead == 0) {
Result = TRUE;
break;
}
ThisBuffer->BytesPopulated += BytesRead;
ASSERT(ThisBuffer->BytesPopulated <= ThisBuffer->BytesAllocated);
if (ThisBuffer->BytesPopulated >= ThisBuffer->BytesAllocated) {
DWORD NewBytesAllocated;
PCHAR NewBuffer;
if (ThisBuffer->BytesAllocated >= ((DWORD)-1) / 4) {
break;
}
NewBytesAllocated = ThisBuffer->BytesAllocated * 4;
NewBuffer = YoriLibMalloc(NewBytesAllocated);
if (NewBuffer == NULL) {
break;
}
memcpy(NewBuffer, ThisBuffer->Buffer, ThisBuffer->BytesAllocated);
YoriLibFree(ThisBuffer->Buffer);
ThisBuffer->Buffer = NewBuffer;
ThisBuffer->BytesAllocated = NewBytesAllocated;
}
} else {
Result = TRUE;
break;
}
}
return Result;
}
/**
Process any arguments to the command that set or delete environment
variables, and indicate on completion the first argument that indicates
a command to execute.
@param StartEnvArg The array index of the first argument to parse to see if
it will change an environment variable.
@param ArgC The total number of array elements.
@param ArgV Pointer to the array of arguments.
@param StdinVariableName Optionally points to a variable name corresponding
to the value in Stdin.
@param Stdin Pointer to a context describing a buffer of data from stdin.
May be zero length if stdin does not supply data.
@param StartCmdArg On successful completion, updated to point to the first
argument to scan for a command to execute.
@return TRUE to indicate success, FALSE to indicate failure.
*/
BOOL
EnvModifyEnvironment(
__in DWORD StartEnvArg,
__in DWORD ArgC,
__in YORI_STRING ArgV[],
__in_opt PYORI_STRING StdinVariableName,
__in PENV_BUFFER Stdin,
__out PDWORD StartCmdArg
)
{
YORI_STRING Variable;
YORI_STRING Value;
LPTSTR Equals;
DWORD i;
DWORD StdinLength;
YORI_STRING StdinString;
*StartCmdArg = 0;
YoriLibInitEmptyString(&Variable);
for (i = StartEnvArg; i < ArgC; i++) {
Equals = YoriLibFindLeftMostCharacter(&ArgV[i], '=');
if (Equals == NULL) {
*StartCmdArg = i;
break;
}
Variable.StartOfString = ArgV[i].StartOfString;
Variable.LengthInChars = (DWORD)(Equals - ArgV[i].StartOfString);
Variable.LengthAllocated = Variable.LengthInChars + 1;
Variable.StartOfString[Variable.LengthInChars] = '\0';
Value.StartOfString = &Equals[1];
Value.LengthInChars = (DWORD)(ArgV[i].LengthInChars - Variable.LengthAllocated);
Value.LengthAllocated = Value.LengthInChars + 1;
#ifdef YORI_BUILTIN
if (Value.LengthInChars == 0) {
YoriCallSetEnvironmentVariable(&Variable, NULL);
} else {
YoriCallSetEnvironmentVariable(&Variable, &Value);
}
#else
if (Value.LengthInChars == 0) {
SetEnvironmentVariable(Variable.StartOfString, NULL);
} else {
SetEnvironmentVariable(Variable.StartOfString, Value.StartOfString);
}
#endif
}
if (StdinVariableName != NULL) {
YoriLibInitEmptyString(&StdinString);
if (Stdin->BytesPopulated > 0) {
StdinLength = YoriLibGetMultibyteInputSizeNeeded(Stdin->Buffer, Stdin->BytesPopulated);
if (!YoriLibAllocateString(&StdinString, StdinLength + 1)) {
return FALSE;
}
YoriLibMultibyteInput(Stdin->Buffer, Stdin->BytesPopulated, StdinString.StartOfString, StdinLength);
StdinString.LengthInChars = StdinLength;
//
// Truncate any newlines from the output, which tools
// frequently emit but are of no value here
//
YoriLibTrimTrailingNewlines(&StdinString);
StdinString.StartOfString[StdinString.LengthInChars] = '\0';
}
#ifdef YORI_BUILTIN
if (StdinString.LengthInChars == 0) {
YoriCallSetEnvironmentVariable(StdinVariableName, NULL);
} else {
YoriCallSetEnvironmentVariable(StdinVariableName, &StdinString);
}
#else
if (StdinString.LengthInChars == 0) {
SetEnvironmentVariable(StdinVariableName->StartOfString, NULL);
} else {
SetEnvironmentVariable(StdinVariableName->StartOfString, StdinString.StartOfString);
}
#endif
YoriLibFreeStringContents(&StdinString);
}
return TRUE;
}
#ifdef YORI_BUILTIN
/**
The main entrypoint for the env builtin command.
*/
#define ENTRYPOINT YoriCmd_YENV
#else
/**
The main entrypoint for the env standalone application.
*/
#define ENTRYPOINT ymain
#endif
/**
The main entrypoint for the env cmdlet.
@param ArgC The number of arguments.
@param ArgV An array of arguments.
@return Exit code of the child process on success, or failure if the child
could not be launched.
*/
DWORD
ENTRYPOINT(
__in DWORD ArgC,
__in YORI_STRING ArgV[]
)
{
YORI_STRING CmdLine;
PYORI_STRING StdinVariableName;
DWORD ExitCode;
BOOL ArgumentUnderstood;
DWORD i;
DWORD StartEnvArg = 0;
DWORD StartCmdArg = 0;
YORI_STRING Arg;
BOOLEAN LoadStdin;
ENV_BUFFER Stdin;
LoadStdin = FALSE;
StdinVariableName = NULL;
ZeroMemory(&Stdin, sizeof(Stdin));
for (i = 1; i < ArgC; i++) {
ArgumentUnderstood = FALSE;
ASSERT(YoriLibIsStringNullTerminated(&ArgV[i]));
if (YoriLibIsCommandLineOption(&ArgV[i], &Arg)) {
if (YoriLibCompareStringWithLiteralInsensitive(&Arg, _T("?")) == 0) {
EnvHelp();
return EXIT_SUCCESS;
} else if (YoriLibCompareStringWithLiteralInsensitive(&Arg, _T("license")) == 0) {
YoriLibDisplayMitLicense(_T("2019-2023"));
return EXIT_SUCCESS;
} else if (YoriLibCompareStringWithLiteralInsensitive(&Arg, _T("iv")) == 0) {
if (i + 1 < ArgC) {
LoadStdin = TRUE;
StdinVariableName = &ArgV[i + 1];
ArgumentUnderstood = TRUE;
i++;
}
} else if (YoriLibCompareStringWithLiteralInsensitive(&Arg, _T("-")) == 0) {
ArgumentUnderstood = TRUE;
StartEnvArg = i + 1;
break;
}
} else {
ArgumentUnderstood = TRUE;
StartEnvArg = i;
break;
}
if (!ArgumentUnderstood) {
YoriLibOutput(YORI_LIB_OUTPUT_STDERR, _T("Argument not understood, ignored: %y\n"), &ArgV[i]);
}
}
if (StartEnvArg == 0) {
YoriLibOutput(YORI_LIB_OUTPUT_STDERR, _T("env: argument not specified\n"));
return EXIT_FAILURE;
}
if (LoadStdin) {
if (GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &i)) {
YoriLibOutput(YORI_LIB_OUTPUT_STDERR, _T("env: no file or pipe for input\n"));
return EXIT_FAILURE;
}
if (!EnvAllocateBuffer(&Stdin)) {
return EXIT_FAILURE;
}
Stdin.hSource = GetStdHandle(STD_INPUT_HANDLE);
if (!EnvBufferPump(&Stdin)) {
EnvFreeBuffer(&Stdin);
return EXIT_FAILURE;
}
}
#ifdef YORI_BUILTIN
{
YORI_STRING SavedEnvironment;
if (!YoriLibGetEnvironmentStrings(&SavedEnvironment)) {
EnvFreeBuffer(&Stdin);
return EXIT_FAILURE;
}
EnvModifyEnvironment(StartEnvArg, ArgC, ArgV, StdinVariableName, &Stdin, &StartCmdArg);
EnvFreeBuffer(&Stdin);
if (StartCmdArg == 0) {
YoriLibOutput(YORI_LIB_OUTPUT_STDERR, _T("env: argument not specified\n"));
YoriLibBuiltinSetEnvironmentStrings(&SavedEnvironment);
return EXIT_FAILURE;
}
if (!YoriLibBuildCmdlineFromArgcArgv(ArgC - StartCmdArg, &ArgV[StartCmdArg], TRUE, TRUE, &CmdLine)) {
YoriLibBuiltinSetEnvironmentStrings(&SavedEnvironment);
return EXIT_FAILURE;
}
YoriCallExecuteExpression(&CmdLine);
YoriLibFreeStringContents(&CmdLine);
YoriLibBuiltinSetEnvironmentStrings(&SavedEnvironment);
ExitCode = YoriCallGetErrorLevel();
}
#else
{
YORI_STRING Executable;
PYORI_STRING ChildArgs;
PROCESS_INFORMATION ProcessInfo;
STARTUPINFO StartupInfo;
EnvModifyEnvironment(StartEnvArg, ArgC, ArgV, StdinVariableName, &Stdin, &StartCmdArg);
EnvFreeBuffer(&Stdin);
if (StartCmdArg == 0) {
YoriLibOutput(YORI_LIB_OUTPUT_STDERR, _T("env: argument not specified\n"));
return EXIT_FAILURE;
}
ChildArgs = YoriLibMalloc((ArgC - StartCmdArg) * sizeof(YORI_STRING));
if (ChildArgs == NULL) {
return EXIT_FAILURE;
}
YoriLibInitEmptyString(&Executable);
if (!YoriLibLocateExecutableInPath(&ArgV[StartCmdArg], NULL, NULL, &Executable) ||
Executable.LengthInChars == 0) {
YoriLibOutput(YORI_LIB_OUTPUT_STDERR, _T("env: unable to find executable\n"));
YoriLibFree(ChildArgs);
YoriLibFreeStringContents(&Executable);
return EXIT_FAILURE;
}
memcpy(&ChildArgs[0], &Executable, sizeof(YORI_STRING));
if (StartCmdArg + 1 < ArgC) {
memcpy(&ChildArgs[1], &ArgV[StartCmdArg + 1], (ArgC - StartCmdArg - 1) * sizeof(YORI_STRING));
}
if (!YoriLibBuildCmdlineFromArgcArgv(ArgC - StartCmdArg, ChildArgs, TRUE, TRUE, &CmdLine)) {
YoriLibFree(ChildArgs);
YoriLibFreeStringContents(&Executable);
return EXIT_FAILURE;
}
ASSERT(YoriLibIsStringNullTerminated(&CmdLine));
memset(&StartupInfo, 0, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
if (!CreateProcess(NULL, CmdLine.StartOfString, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &StartupInfo, &ProcessInfo)) {
DWORD LastError = GetLastError();
LPTSTR ErrText = YoriLibGetWinErrorText(LastError);
YoriLibOutput(YORI_LIB_OUTPUT_STDERR, _T("env: execution failed: %s"), ErrText);
YoriLibFreeWinErrorText(ErrText);
YoriLibFree(ChildArgs);
YoriLibFreeStringContents(&CmdLine);
YoriLibFreeStringContents(&Executable);
return EXIT_FAILURE;
}
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
GetExitCodeProcess(ProcessInfo.hProcess, &ExitCode);
CloseHandle(ProcessInfo.hProcess);
CloseHandle(ProcessInfo.hThread);
YoriLibFreeStringContents(&Executable);
YoriLibFreeStringContents(&CmdLine);
YoriLibFree(ChildArgs);
}
#endif
return ExitCode;
}
// vim:sw=4:ts=4:et:
|
2739331c640eb2a452bf4e8676e6c83c080635c5
|
8838eb997879add5759b6dfb23f9a646464e53ca
|
/src/arch/aarch64/include/asm/hal/reg.h
|
edec1254d70298850f50d21088e4f98756b54ee4
|
[
"BSD-2-Clause"
] |
permissive
|
embox/embox
|
d6aacec876978522f01cdc4b8de37a668c6f4c80
|
98e3c06e33f3fdac10a29c069c20775568e0a6d1
|
refs/heads/master
| 2023-09-04T03:02:20.165042
| 2023-09-02T14:55:31
| 2023-09-02T14:55:31
| 33,078,138
| 1,087
| 325
|
BSD-2-Clause
| 2023-09-14T16:58:34
| 2015-03-29T15:27:48
|
C
|
UTF-8
|
C
| false
| false
| 6,101
|
h
|
reg.h
|
/**
* @file reg.h
* @brief Stub header
* @author Denis Deryugin <deryugin.denis@gmail.com>
* @version
* @date 19.07.2019
*/
#ifndef AARCH_HAL_REG_
#define AARCH_HAL_REG_
#include <stdint.h>
static inline uint64_t get_daif(void) {
volatile uint64_t reg;
__asm__ __volatile__ ("mrs %0, daif;\n\t"
: "=r"(reg)
);
return reg;
}
static inline void set_daif(uint64_t reg) {
__asm__ __volatile__ ("msr daif, %0; \n\t"
:
: "r"(reg)
);
}
#define read_system_reg(name) ({ \
volatile uint64_t reg; \
asm volatile("mrs %0, "#name";" \
"isb;" \
: "=r"(reg) \
); \
reg; \
})
#define write_system_reg(name, reg) do { \
asm volatile("msr "#name", %0;" \
"isb;" \
: : "r"(reg) \
); \
} while (0)
static inline uint64_t icc_ctlr_el1_read(void) {
return read_system_reg(S3_0_C12_C12_4);
}
static inline void icc_ctlr_el1_write(uint64_t reg) {
write_system_reg(S3_0_C12_C12_4, reg);
}
static inline uint64_t icc_pmr_el1_read(void) {
return read_system_reg(S3_0_C4_C6_0);
}
static inline void icc_pmr_el1_write(uint64_t reg) {
write_system_reg(S3_0_C4_C6_0, reg);
}
static inline uint64_t icc_iar0_el1_read(void) {
return read_system_reg(S3_0_C12_C8_0);
}
static inline void icc_iar0_el1_write(uint64_t reg) {
write_system_reg(S3_0_C12_C8_0, reg);
}
static inline uint64_t icc_iar1_el1_read(void) {
return read_system_reg(S3_0_C12_C12_0);
}
static inline void icc_iar1_el1_write(uint64_t reg) {
write_system_reg(S3_0_C12_C12_0, reg);
}
static inline uint64_t icc_igrpen0_el1_read(void) {
return read_system_reg(S3_0_C12_C12_6);
}
static inline void icc_igrpen0_el1_write(uint64_t reg) {
write_system_reg(S3_0_C12_C12_6, reg);
}
static inline uint64_t icc_igrpen1_el1_read(void) {
return read_system_reg(S3_0_C12_C12_7);
}
static inline void icc_igrpen1_el1_write(uint64_t reg) {
write_system_reg(S3_0_C12_C12_7, reg);
}
static inline uint64_t icc_igrpen1_el3_read(void) {
return read_system_reg(S3_6_C12_C12_7);
}
static inline void icc_igrpen1_el3_write(uint64_t reg) {
write_system_reg(S3_6_C12_C12_7, reg);
}
static inline uint64_t icc_eoir0_el1_read(void) {
return read_system_reg(S3_0_C12_C8_1);
}
static inline void icc_eoir0_el1_write(uint64_t reg) {
write_system_reg(S3_0_C12_C8_1, reg);
}
static inline uint64_t icc_eoir1_el1_read(void) {
return read_system_reg(S3_0_C12_C12_1);
}
static inline void icc_eoir1_el1_write(uint64_t reg) {
write_system_reg(S3_0_C12_C12_1, reg);
}
static inline uint64_t icc_sre_el1_read(void) {
return read_system_reg(S3_0_C12_C12_5);
}
static inline void icc_sre_el1_write(uint64_t reg) {
write_system_reg(S3_4_C12_C9_5, reg);
}
static inline uint64_t icc_sre_el2_read(void) {
return read_system_reg(S3_4_C12_C9_5);
}
static inline void icc_sre_el2_write(uint64_t reg) {
write_system_reg(S3_0_C12_C12_5, reg);
}
static inline uint64_t icc_sre_el3_read(void) {
return read_system_reg(S3_6_C12_C12_5);
}
static inline void icc_sre_el3_write(uint64_t reg) {
write_system_reg(S3_6_C12_C12_5, reg);
}
static inline uint64_t icc_hppir0_el1_read(void) {
return read_system_reg(S3_0_C12_C8_2);
}
static inline void icc_hppir0_el1_write(uint64_t reg) {
write_system_reg(S3_0_C12_C8_2, reg);
}
static inline uint64_t icc_hppir1_el1_read(void) {
return read_system_reg(S3_0_C12_C12_2);
}
static inline void icc_hppir1_el1_write(uint64_t reg) {
write_system_reg(S3_0_C12_C12_2, reg);
}
static inline uint64_t aarch64_isr_el1(void) {
return read_system_reg(ISR_EL1);
}
/* Raw CurrentEL register */
static inline uint64_t aarch64_current_el_read(void) {
return read_system_reg(CurrentEL);
}
/* Convert CurrentEL to number from 0 to 3 */
static inline int aarch64_current_el(void) {
#define CURRENT_EL_OFFSET 2
#define CURRENT_EL_MASK 0xC
return (int) ((aarch64_current_el_read() & CURRENT_EL_MASK)
>> CURRENT_EL_OFFSET);
}
static inline uint64_t aarch64_hcr_el2_read(void) {
return read_system_reg(HCR_EL2);
}
static inline uint64_t aarch64_ttbr0_el2_read(void) {
return read_system_reg(TTBR0_EL2);
}
static inline void aarch64_ttbr0_el2_write(uint64_t reg) {
write_system_reg(TTBR0_EL2, reg);
}
static inline uint64_t aarch64_ttbr0_el1_read(void) {
return read_system_reg(TTBR0_EL1);
}
static inline void aarch64_ttbr0_el1_write(uint64_t reg) {
write_system_reg(TTBR0_EL1, reg);
}
static inline uint64_t aarch64_ttbr1_el2_read(void) {
return read_system_reg(TTBR1_EL2);
}
static inline void aarch64_hcr_el2_write(uint64_t reg) {
write_system_reg(HCR_EL2, reg);
}
static inline uint64_t aarch64_sctlr_el2_read(void) {
return read_system_reg(SCTLR_EL2);
}
static inline void aarch64_sctlr_el2_write(uint64_t reg) {
write_system_reg(SCTLR_EL2, reg);
}
static inline uint64_t aarch64_sctlr_el1_read(void) {
return read_system_reg(SCTLR_EL1);
}
static inline void aarch64_sctlr_el1_write(uint64_t reg) {
write_system_reg(SCTLR_EL1, reg);
}
static inline uint64_t aarch64_esr_el2_read(void) {
return read_system_reg(ESR_EL2);
}
static inline uint64_t aarch64_esr_el1_read(void) {
return read_system_reg(ESR_EL1);
}
static inline uint64_t aarch64_spsr_el2_read(void) {
return read_system_reg(SPSR_EL2);
}
static inline uint64_t aarch64_spsr_el1_read(void) {
return read_system_reg(SPSR_EL1);
}
static inline uint64_t aarch64_far_el2_read(void) {
return read_system_reg(FAR_EL2);
}
static inline void aarch64_far_el2_write(uint64_t reg) {
write_system_reg(FAR_EL2, reg);
}
static inline uint64_t aarch64_far_el1_read(void) {
return read_system_reg(FAR_EL1);
}
static inline void aarch64_far_el1_write(uint64_t reg) {
write_system_reg(FAR_EL1, reg);
}
static inline uint64_t aarch64_tcr_el1_read(void) {
return read_system_reg(TCR_EL1);
}
static inline void aarch64_tcr_el1_write(uint64_t reg) {
write_system_reg(TCR_EL1, reg);
}
static inline uint64_t aarch64_tcr_el2_read(void) {
return read_system_reg(TCR_EL2);
}
static inline void aarch64_tcr_el2_write(uint64_t reg) {
write_system_reg(TCR_EL2, reg);
}
static inline uint64_t aarch64_id_aa64mmfr0_read(void) {
return read_system_reg(ID_AA64MMFR0_EL1);
}
#endif /* AARCH_HAL_REG_ */
|
be2eef525418c391e05a44c18135816cd3c7c4cf
|
cfb789b208ae682817fcfcb8417d8d38e2a0bdd8
|
/XCSnippetr/Class/XCSKit/Source/Clients/GitHubClient/XCSGithubConstants.h
|
6707ad995b6d012e98dd705364f8f19aecc108ff
|
[
"MIT"
] |
permissive
|
dzenbot/XCSnippetr
|
86961d52cfae3ca1befe2779e24cbf1fb2c2674b
|
0de8071b82f1f6a2daf55ad05c195a076035d4f7
|
refs/heads/master
| 2023-04-09T20:32:13.676042
| 2017-04-25T07:03:41
| 2017-04-25T07:03:41
| 39,323,578
| 112
| 6
| null | 2017-04-25T07:03:42
| 2015-07-19T05:31:34
|
Objective-C
|
UTF-8
|
C
| false
| false
| 1,225
|
h
|
XCSGithubConstants.h
|
//
// XCSKit
// https://github.com/dzenbot/XCSnippetr
//
// Created by Ignacio Romero Zurbuchen on 13/6/15
// Copyright (c) 2015 DZN Labs. All rights reserved.
// Licence: MIT-Licence
//
// Urls
static NSString * const kGithubAPIBaseUrl = @"https://api.github.com/";
static NSString * const kGistWebAPIUrl = @"https://github.com/settings/tokens/new";
// API Methods
static NSString * const kGithubAPIMethodUser = @"user";
static NSString * const kGithubAPIMethodGists = @"gists";
// API Param keys
static NSString * const kGithubAPIParamAccessToken = @"access_token";
static NSString * const kGithubAPIParamDescription = @"description";
static NSString * const kGithubAPIParamScopes = @"scopes";
static NSString * const kGithubAPIParamGist = @"gist";
static NSString * const kGithubAPIParamPublic = @"public";
static NSString * const kGithubAPIParamContent = @"content";
static NSString * const kGithubAPIParamFiles = @"files";
static NSString * const kGithubAPIParamId = @"id";
static NSString * const kGithubAPIParamLogin = @"login";
static NSString * const kGithubAPIParamErrorMessage = @"message";
|
e39a3429a14cb48f198b5c0aecfe1283c68db1da
|
ee4ecc3c526322dc42c2d2bcf6a9982694da5d69
|
/other/clrs/12/02/03.c
|
b65dcacb4b003a3af107ee863076301426aefaa0
|
[] |
no_license
|
skanev/playground
|
77d0f35a7e932021c9da8ce4f9095be9ac8a5c1e
|
07b88d789391e34d71a74722b0b42b328b1f3c62
|
refs/heads/master
| 2023-04-15T14:07:42.719874
| 2022-12-20T09:12:00
| 2022-12-20T09:12:16
| 191,557
| 212
| 108
| null | 2023-04-12T05:33:25
| 2009-05-03T16:41:17
|
Scheme
|
UTF-8
|
C
| false
| false
| 507
|
c
|
03.c
|
struct tree_t {
struct tree_t *left;
struct tree_t *right;
struct tree_t *parent;
int key;
};
typedef struct tree_t tree_t;
tree_t *maximum(tree_t *tree) {
while (tree->right) tree = tree->right;
return tree;
}
tree_t *predecessor(tree_t *tree) {
if (tree->left) {
return maximum(tree->left);
}
tree_t *parent = tree->parent;
while (parent && parent->left == tree) {
tree = tree->parent;
parent = tree->parent;
}
return parent;
}
|
56657833dfaa2a4b1f3dbd24ae752b101bc0b94a
|
fb0f9abad373cd635c2635bbdf491ea0f32da5ff
|
/src/mono/mono/eventpipe/ep-rt-mono-runtime-provider.c
|
fe3b3c09db18a9ee4e16c3348528512fb663c525
|
[
"MIT"
] |
permissive
|
dotnet/runtime
|
f6fd23936752e202f8e4d6d94f3a4f3b0e77f58f
|
47bb554d298e1e34c4e3895d7731e18ad1c47d02
|
refs/heads/main
| 2023-09-03T15:35:46.493337
| 2023-09-03T08:13:23
| 2023-09-03T08:13:23
| 210,716,005
| 13,765
| 5,179
|
MIT
| 2023-09-14T21:58:52
| 2019-09-24T23:36:39
|
C#
|
UTF-8
|
C
| false
| false
| 138,217
|
c
|
ep-rt-mono-runtime-provider.c
|
#include <config.h>
#ifdef ENABLE_PERFTRACING
#include <eventpipe/ep-rt-config.h>
#include <eventpipe/ep-types.h>
#include <eventpipe/ep-rt.h>
#include <eventpipe/ep.h>
#include <eglib/gmodule.h>
#include <mono/metadata/profiler.h>
#include <mono/metadata/debug-internals.h>
#include <mono/metadata/gc-internals.h>
#include <mono/metadata/mono-endian.h>
#include <mono/mini/mini-runtime.h>
#include <mono/sgen/sgen-conf.h>
#include <mono/sgen/sgen-tagged-pointer.h>
#include <clretwallmain.h>
extern EVENTPIPE_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context;
extern EVENTPIPE_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context;
#define RUNTIME_PROVIDER_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context
#define RUNTIME_RUNDOWN_PROVIDER_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context
#define NUM_NANOSECONDS_IN_1_MS 1000000
// Sample profiler.
static GArray * _sampled_thread_callstacks = NULL;
static uint32_t _max_sampled_thread_count = 32;
// Mono profilers.
extern MonoProfilerHandle _ep_rt_mono_default_profiler_provider;
// Phantom JIT compile method.
static MonoMethod *_runtime_helper_compile_method = NULL;
static MonoJitInfo *_runtime_helper_compile_method_jitinfo = NULL;
// Monitor.Enter methods.
static MonoMethod *_monitor_enter_method = NULL;
static MonoJitInfo *_monitor_enter_method_jitinfo = NULL;
static MonoMethod *_monitor_enter_v4_method = NULL;
static MonoJitInfo *_monitor_enter_v4_method_jitinfo = NULL;
// GC roots table.
static dn_umap_t _gc_roots_table = {0};
// Lock used for GC related activities.
static ep_rt_spin_lock_handle_t _gc_lock = {0};
// Rundown types.
typedef
bool
(*fire_method_rundown_events_func)(
const uint64_t method_id,
const uint64_t module_id,
const uint64_t method_start_address,
const uint32_t method_size,
const uint32_t method_token,
const uint32_t method_flags,
const ep_char8_t *method_namespace,
const ep_char8_t *method_name,
const ep_char8_t *method_signature,
const uint16_t count_of_map_entries,
const uint32_t *il_offsets,
const uint32_t *native_offsets,
bool aot_method,
bool verbose,
void *user_data);
typedef
bool
(*fire_assembly_rundown_events_func)(
const uint64_t domain_id,
const uint64_t assembly_id,
const uint32_t assembly_flags,
const uint32_t binding_id,
const ep_char8_t *assembly_name,
const uint64_t module_id,
const uint32_t module_flags,
const uint32_t reserved_flags,
const ep_char8_t *module_il_path,
const ep_char8_t *module_native_path,
const uint8_t *managed_pdb_signature,
const uint32_t managed_pdb_age,
const ep_char8_t *managed_pdb_build_path,
const uint8_t *native_pdb_signature,
const uint32_t native_pdb_age,
const ep_char8_t *native_pdb_build_path,
void *user_data);
typedef
bool
(*fire_domain_rundown_events_func)(
const uint64_t domain_id,
const uint32_t domain_flags,
const ep_char8_t *domain_name,
const uint32_t domain_index,
void *user_data);
typedef struct _FireMethodEventsData {
MonoDomain *domain;
uint8_t *buffer;
size_t buffer_size;
fire_method_rundown_events_func method_events_func;
} FireMethodEventsData;
typedef struct _StackWalkData {
EventPipeStackContents *stack_contents;
bool top_frame;
bool async_frame;
bool safe_point_frame;
bool runtime_invoke_frame;
} StackWalkData;
typedef struct _SampleProfileStackWalkData {
StackWalkData stack_walk_data;
EventPipeStackContents stack_contents;
uint64_t thread_id;
uintptr_t thread_ip;
uint32_t payload_data;
} SampleProfileStackWalkData;
// Rundown flags.
#define RUNTIME_SKU_MONO 0x4
#define METHOD_FLAGS_DYNAMIC_METHOD 0x1
#define METHOD_FLAGS_GENERIC_METHOD 0x2
#define METHOD_FLAGS_SHARED_GENERIC_METHOD 0x4
#define METHOD_FLAGS_JITTED_METHOD 0x8
#define METHOD_FLAGS_JITTED_HELPER_METHOD 0x10
#define METHOD_FLAGS_EXTENT_HOT_SECTION 0x00000000
#define METHOD_FLAGS_EXTENT_COLD_SECTION 0x10000000
#define MODULE_FLAGS_NATIVE_MODULE 0x2
#define MODULE_FLAGS_DYNAMIC_MODULE 0x4
#define MODULE_FLAGS_MANIFEST_MODULE 0x8
#define ASSEMBLY_FLAGS_DYNAMIC_ASSEMBLY 0x2
#define ASSEMBLY_FLAGS_NATIVE_ASSEMBLY 0x4
#define ASSEMBLY_FLAGS_COLLECTIBLE_ASSEMBLY 0x8
#define DOMAIN_FLAGS_DEFAULT_DOMAIN 0x1
#define DOMAIN_FLAGS_EXECUTABLE_DOMAIN 0x2
// Event data types.
struct _ModuleEventData {
uint8_t module_il_pdb_signature [EP_GUID_SIZE];
uint8_t module_native_pdb_signature [EP_GUID_SIZE];
uint64_t domain_id;
uint64_t module_id;
uint64_t assembly_id;
const char *module_il_path;
const char *module_il_pdb_path;
const char *module_native_path;
const char *module_native_pdb_path;
uint32_t module_il_pdb_age;
uint32_t module_native_pdb_age;
uint32_t reserved_flags;
uint32_t module_flags;
};
typedef struct _ModuleEventData ModuleEventData;
struct _AssemblyEventData {
uint64_t domain_id;
uint64_t assembly_id;
uint64_t binding_id;
char *assembly_name;
uint32_t assembly_flags;
};
typedef struct _AssemblyEventData AssemblyEventData;
// Event flags.
#define THREAD_FLAGS_GC_SPECIAL 0x00000001
#define THREAD_FLAGS_FINALIZER 0x00000002
#define THREAD_FLAGS_THREADPOOL_WORKER 0x00000004
#define EXCEPTION_THROWN_FLAGS_HAS_INNER 0x1
#define EXCEPTION_THROWN_FLAGS_IS_NESTED 0x2
#define EXCEPTION_THROWN_FLAGS_IS_RETHROWN 0x4
#define EXCEPTION_THROWN_FLAGS_IS_CSE 0x8
#define EXCEPTION_THROWN_FLAGS_IS_CLS_COMPLIANT 0x10
// BulkType types.
typedef enum {
TYPE_FLAGS_DELEGATE = 0x1,
TYPE_FLAGS_FINALIZABLE = 0x2,
TYPE_FLAGS_EXTERNALLY_IMPLEMENTED_COM_OBJECT = 0x4,
TYPE_FLAGS_ARRAY = 0x8,
TYPE_FLAGS_ARRAY_RANK_MASK = 0x3F00,
TYPE_FLAGS_ARRAY_RANK_SHIFT = 8,
TYPE_FLAGS_ARRAY_RANK_MAX = TYPE_FLAGS_ARRAY_RANK_MASK >> TYPE_FLAGS_ARRAY_RANK_SHIFT
} TypeFlags;
// This only contains the fixed-size data at the top of each struct in
// the bulk type event. These fields must still match exactly the initial
// fields of the struct described in the manifest.
typedef struct _EventStructBulkTypeFixedSizedData {
uint64_t type_id;
uint64_t module_id;
uint32_t type_name_id;
uint32_t flags;
uint8_t cor_element_type;
} EventStructBulkTypeFixedSizedData;
// Represents one instance of the Value struct inside a single BulkType event
typedef struct _BulkTypeValue {
EventStructBulkTypeFixedSizedData fixed_sized_data;
uint32_t type_parameters_count;
MonoType **mono_type_parameters;
const ep_char8_t *name;
} BulkTypeValue;
// ETW has a limitation of 64K for TOTAL event Size, however there is overhead associated with
// the event headers. It is unclear exactly how much that is, but 1K should be sufficiently
// far away to avoid problems without sacrificing the perf of bulk processing.
#define MAX_EVENT_BYTE_COUNT (63 * 1024)
// The maximum event size, and the size of the buffer that we allocate to hold the event contents.
#define MAX_SIZE_OF_EVENT_BUFFER 65536
// Estimate of how many bytes we can squeeze in the event data for the value struct
// array. (Intentionally overestimate the size of the non-array parts to keep it safe.)
// This follows CoreCLR's kMaxBytesTypeValues.
#define MAX_TYPE_VALUES_BYTES (MAX_EVENT_BYTE_COUNT - 0x30)
// Estimate of how many type value elements we can put into the struct array, while
// staying under the ETW event size limit. Note that this is impossible to calculate
// perfectly, since each element of the struct array has variable size.
//
// In addition to the byte-size limit per event, Windows always forces on us a
// max-number-of-descriptors per event, which in the case of BulkType, will kick in
// far sooner. There's a max number of 128 descriptors allowed per event. 2 are used
// for Count + ClrInstanceID. Then 4 per batched value. (Might actually be 3 if there
// are no type parameters to log, but let's overestimate at 4 per value).
#define K_MAX_COUNT_TYPE_VALUES ((uint32_t)(128 - 2) / 4)
typedef enum {
TYPE_LOG_BEHAVIOR_IF_FIRST_TIME,
TYPE_LOG_BEHAVIOR_ALWAYS_LOG,
TYPE_LOG_BEHAVIOR_ALWAYS_LOG_TOP_LEVEL
} TypeLogBehavior;
typedef struct _BulkTypeEventLogger {
BulkTypeValue bulk_type_values [K_MAX_COUNT_TYPE_VALUES];
uint8_t *bulk_type_event_buffer;
uint32_t bulk_type_value_count;
uint32_t bulk_type_value_byte_count;
MonoMemPool *mem_pool;
dn_umap_t *type_cache;
} BulkTypeEventLogger;
// ETW has a limit for maximum event size. Do not log overly large method type argument sets
static const uint32_t MAX_METHOD_TYPE_ARGUMENT_COUNT = 1024;
// GC roots type.
typedef struct _GCRootData {
uintptr_t start;
uintptr_t end;
const void *key;
char *name;
MonoGCRootSource source;
} GCRootData;
// GC heap dump types.
typedef enum {
BUFFERED_GC_EVENT_OBJECT_REF = 1,
BUFFERED_GC_EVENT_ROOTS = 2,
} BufferedGCEventType;
typedef struct _BufferedGCEvent BufferedGCEvent;
struct _BufferedGCEvent {
BufferedGCEventType type;
uint32_t payload_size;
};
typedef struct _GCHeapDumpMemFileBuffer GCHeapDumpMemFileBuffer;
struct _GCHeapDumpMemFileBuffer {
ep_char8_t *name;
int fd;
uint8_t *start;
uint8_t *current;
uint8_t *end;
};
typedef struct _GCHeapDumpBuffer GCHeapDumpBuffer;
struct _GCHeapDumpBuffer{
void *context;
bool (*reset_func)(void *context);
uint8_t * (*alloc_func)(void *context ,size_t size);
const uint8_t * (*get_next_buffer_func)(void *context, size_t *size);
};
typedef struct _GCHeapDumpBulkData GCHeapDumpBulkData;
struct _GCHeapDumpBulkData {
uint8_t *data_start;
uint8_t *data_current;
uint8_t *data_end;
uint32_t index;
uint32_t count;
uint32_t max_count;
};
typedef enum {
GC_HEAP_DUMP_CONTEXT_STATE_INIT = 0,
GC_HEAP_DUMP_CONTEXT_STATE_START = 1,
GC_HEAP_DUMP_CONTEXT_STATE_DUMP = 2,
GC_HEAP_DUMP_CONTEXT_STATE_END = 3
} GCHeapDumpContextState;
typedef struct _GCHeapDumpContext GCHeapDumpContext;
struct _GCHeapDumpContext {
EVENTPIPE_TRACE_CONTEXT trace_context;
GCHeapDumpBulkData bulk_nodes;
GCHeapDumpBulkData bulk_edges;
GCHeapDumpBulkData bulk_root_edges;
GCHeapDumpBulkData bulk_root_cwt_elem_edges;
GCHeapDumpBulkData bulk_root_static_vars;
BulkTypeEventLogger *bulk_type_logger;
GCHeapDumpBuffer *buffer;
dn_vector_ptr_t *gc_roots;
uint32_t gc_reason;
uint32_t gc_type;
uint32_t gc_count;
uint32_t gc_depth;
uint32_t retry_count;
GCHeapDumpContextState state;
};
// Must match GCBulkNode layout in ClrEtwAll.man.
static const uint32_t BULK_NODE_EVENT_TYPE_SIZE =
// Address
sizeof (uintptr_t) +
// Size
sizeof (uint64_t) +
// TypeID
sizeof (uint64_t) +
// EdgeCount
sizeof (uint64_t);
// Must match GCBulkEdge layout in ClrEtwAll.man.
static const uint32_t BULK_EDGE_EVENT_TYPE_SIZE =
// Value
sizeof (uintptr_t) +
// ReferencingFiledID
sizeof (uint32_t);
// Must match GCBulkRootEdge layout in ClrEtwAll.man.
static const uint32_t BULK_ROOT_EDGE_EVENT_TYPE_SIZE =
// RootedNodeAddresses
sizeof (uintptr_t) +
// GCRootKind
sizeof (uint8_t) +
// GCRootFlag
sizeof (uint32_t) +
// GCRootID
sizeof (uintptr_t);
// Must match GCBulkRootConditionalWeakTableElementEdge layout in ClrEtwAll.man.
static const uint32_t BULK_ROOT_CWT_ELEM_EDGE_EVENT_TYPE_SIZE =
// GCKeyNodeID
sizeof (uintptr_t) +
// GCValueNodeID
sizeof (uintptr_t) +
// GCRootID
sizeof (uintptr_t);
// Must match GCBulkRootStaticVar layout in ClrEtwAll.man.
static const uint32_t BULK_ROOT_STATIC_VAR_EVENT_TYPE_SIZE =
// GCRootID
sizeof (uint64_t) +
// ObjectID
sizeof (uint64_t) +
// TypeID
sizeof (uint64_t) +
// Flags
sizeof (uint32_t) +
//FieldName
sizeof (ep_char16_t);
// GC heap dump flags.
#define GC_REASON_INDUCED 1
#define GC_TYPE_NGC 0
#define GC_ROOT_FLAGS_NONE 0
#define GC_ROOT_FLAGS_PINNING 1
#define GC_ROOT_FLAGS_WEAKREF 2
#define GC_ROOT_FLAGS_INTERIOR 4
#define GC_ROOT_FLAGS_REFCOUNTED 8
#define GC_ROOT_KIND_STACK 0
#define GC_ROOT_KIND_FINALIZER 1
#define GC_ROOT_KIND_HANDLE 2
#define GC_ROOT_KIND_OTHER 3
static volatile uint32_t _gc_heap_dump_requests = 0;
static volatile uint32_t _gc_heap_dump_count = 0;
static volatile uint64_t _gc_heap_dump_trigger_count = 0;
static dn_vector_t _gc_heap_dump_requests_data = {0};
static
uint64_t
get_typeid_for_type (MonoType *t);
static
void
bulk_type_log_type_and_parameters_if_necessary (
BulkTypeEventLogger *type_logger,
MonoType *mono_type,
TypeLogBehavior log_behavior);
static
uint16_t
clr_instance_get_id (void)
{
// Mono runtime id.
return 9;
}
static
bool
is_keyword_and_level_enabled (
const EVENTPIPE_TRACE_CONTEXT *context,
uint8_t level,
uint64_t keyword)
{
if (context->IsEnabled && level <= context->Level)
return (keyword == 0) || (keyword & context->EnabledKeywordsBitmask) != 0;
return false;
}
static
bool
is_keword_enabled (uint64_t enabled_keywords, uint64_t keyword)
{
return (enabled_keywords & keyword) == keyword;
}
static
bool
is_gc_heap_dump_enabled (GCHeapDumpContext *context)
{
if (!context)
return false;
bool enabled = is_keyword_and_level_enabled (&context->trace_context, EP_EVENT_LEVEL_INFORMATIONAL, GC_HEAP_DUMP_KEYWORD);
enabled &= context->gc_reason == GC_REASON_INDUCED;
enabled &= context->gc_type == GC_TYPE_NGC;
return enabled;
}
static
uint32_t
write_buffer_string_utf8_to_utf16_t (
uint8_t **buf,
const ep_char8_t *str,
uint32_t len)
{
uint32_t num_bytes_utf16_str = 0;
if (str && len != 0) {
glong len_utf16 = 0;
ep_char16_t *str_utf16 = (ep_char16_t *)(g_utf8_to_utf16le ((const gchar *)str, (glong)len, NULL, &len_utf16, NULL));
if (str_utf16 && len_utf16 != 0) {
num_bytes_utf16_str = MIN (GLONG_TO_UINT32 (len_utf16), len) * sizeof (ep_char16_t);
memcpy (*buf, str_utf16, num_bytes_utf16_str);
}
g_free (str_utf16);
}
(*buf) [num_bytes_utf16_str] = 0;
num_bytes_utf16_str++;
(*buf) [num_bytes_utf16_str] = 0;
num_bytes_utf16_str++;
*buf += num_bytes_utf16_str;
return num_bytes_utf16_str;
}
static
bool
fire_method_rundown_events (
const uint64_t method_id,
const uint64_t module_id,
const uint64_t method_start_address,
const uint32_t method_size,
const uint32_t method_token,
const uint32_t method_flags,
const ep_char8_t *method_namespace,
const ep_char8_t *method_name,
const ep_char8_t *method_signature,
const uint16_t count_of_map_entries,
const uint32_t *il_offsets,
const uint32_t *native_offsets,
bool aot_method,
bool verbose,
void *user_data)
{
FireEtwMethodDCEndILToNativeMap (
method_id,
0,
0,
count_of_map_entries,
il_offsets,
native_offsets,
clr_instance_get_id (),
NULL,
NULL);
if (verbose) {
FireEtwMethodDCEndVerbose_V1 (
method_id,
module_id,
method_start_address,
method_size,
method_token,
method_flags | METHOD_FLAGS_EXTENT_HOT_SECTION,
method_namespace,
method_name,
method_signature,
clr_instance_get_id (),
NULL,
NULL);
if (aot_method)
FireEtwMethodDCEndVerbose_V1 (
method_id,
module_id,
method_start_address,
method_size,
method_token,
method_flags | METHOD_FLAGS_EXTENT_COLD_SECTION,
method_namespace,
method_name,
method_signature,
clr_instance_get_id (),
NULL,
NULL);
} else {
FireEtwMethodDCEnd_V1 (
method_id,
module_id,
method_start_address,
method_size,
method_token,
method_flags | METHOD_FLAGS_EXTENT_HOT_SECTION,
clr_instance_get_id (),
NULL,
NULL);
if (aot_method)
FireEtwMethodDCEnd_V1 (
method_id,
module_id,
method_start_address,
method_size,
method_token,
method_flags | METHOD_FLAGS_EXTENT_COLD_SECTION,
clr_instance_get_id (),
NULL,
NULL);
}
return true;
}
static
bool
fire_assembly_rundown_events (
const uint64_t domain_id,
const uint64_t assembly_id,
const uint32_t assembly_flags,
const uint32_t binding_id,
const ep_char8_t *assembly_name,
const uint64_t module_id,
const uint32_t module_flags,
const uint32_t reserved_flags,
const ep_char8_t *module_il_path,
const ep_char8_t *module_native_path,
const uint8_t *managed_pdb_signature,
const uint32_t managed_pdb_age,
const ep_char8_t *managed_pdb_build_path,
const uint8_t *native_pdb_signature,
const uint32_t native_pdb_age,
const ep_char8_t *native_pdb_build_path,
void *user_data)
{
FireEtwModuleDCEnd_V2 (
module_id,
assembly_id,
module_flags,
reserved_flags,
module_il_path,
module_native_path,
clr_instance_get_id (),
managed_pdb_signature,
managed_pdb_age,
managed_pdb_build_path,
native_pdb_signature,
native_pdb_age,
native_pdb_build_path,
NULL,
NULL);
FireEtwDomainModuleDCEnd_V1 (
module_id,
assembly_id,
domain_id,
module_flags,
reserved_flags,
module_il_path,
module_native_path,
clr_instance_get_id (),
NULL,
NULL);
FireEtwAssemblyDCEnd_V1 (
assembly_id,
domain_id,
binding_id,
assembly_flags,
assembly_name,
clr_instance_get_id (),
NULL,
NULL);
return true;
}
static
bool
fire_domain_rundown_events (
const uint64_t domain_id,
const uint32_t domain_flags,
const ep_char8_t *domain_name,
const uint32_t domain_index,
void *user_data)
{
return FireEtwAppDomainDCEnd_V1 (
domain_id,
domain_flags,
domain_name,
domain_index,
clr_instance_get_id (),
NULL,
NULL);
}
static
void
fire_method_events (
MonoJitInfo *ji,
MonoMethod *method,
FireMethodEventsData *events_data)
{
EP_ASSERT (ji != NULL);
EP_ASSERT (events_data->domain != NULL);
EP_ASSERT (events_data->method_events_func != NULL);
uint64_t method_id = 0;
uint64_t module_id = 0;
uint64_t method_code_start = (uint64_t)ji->code_start;
uint32_t method_code_size = (uint32_t)ji->code_size;
uint32_t method_token = 0;
uint32_t method_flags = 0;
uint8_t kind = MONO_CLASS_DEF;
char *method_namespace = NULL;
const char *method_name = NULL;
char *method_signature = NULL;
bool verbose = (RUNTIME_RUNDOWN_PROVIDER_CONTEXT.Level >= (uint8_t)EP_EVENT_LEVEL_VERBOSE);
//TODO: Optimize string formatting into functions accepting GString to reduce heap alloc.
if (method) {
method_id = (uint64_t)method;
method_token = method->token;
if (mono_jit_info_get_generic_sharing_context (ji))
method_flags |= METHOD_FLAGS_SHARED_GENERIC_METHOD;
if (method->dynamic)
method_flags |= METHOD_FLAGS_DYNAMIC_METHOD;
if (!ji->from_aot && !ji->from_llvm) {
method_flags |= METHOD_FLAGS_JITTED_METHOD;
if (method->wrapper_type != MONO_WRAPPER_NONE)
method_flags |= METHOD_FLAGS_JITTED_HELPER_METHOD;
}
if (method->is_generic || method->is_inflated)
method_flags |= METHOD_FLAGS_GENERIC_METHOD;
if (method->klass) {
module_id = (uint64_t)m_class_get_image (method->klass);
kind = m_class_get_class_kind (method->klass);
if (kind == MONO_CLASS_GTD || kind == MONO_CLASS_GINST)
method_flags |= METHOD_FLAGS_GENERIC_METHOD;
}
if (verbose) {
method_name = method->name;
method_signature = mono_signature_full_name (mono_method_signature_internal (method));
if (method->klass)
method_namespace = mono_type_get_name_full (m_class_get_byval_arg (method->klass), MONO_TYPE_NAME_FORMAT_IL);
}
}
uint32_t offset_entries = 0;
uint32_t *il_offsets = NULL;
uint32_t *native_offsets = NULL;
MonoDebugMethodJitInfo *debug_info = method ? mono_debug_find_method (method, events_data->domain) : NULL;
if (debug_info) {
offset_entries = debug_info->num_line_numbers;
if (offset_entries != 0) {
size_t needed_size = (offset_entries * sizeof (uint32_t) * 2);
if (!events_data->buffer || needed_size > events_data->buffer_size) {
g_free (events_data->buffer);
events_data->buffer_size = (size_t)(needed_size * 1.5);
events_data->buffer = g_new (uint8_t, events_data->buffer_size);
}
if (events_data->buffer) {
il_offsets = (uint32_t*)events_data->buffer;
native_offsets = il_offsets + offset_entries;
uint8_t *il_offsets_ptr = (uint8_t *)il_offsets;
uint8_t *native_offsets_ptr = (uint8_t *)native_offsets;
for (uint32_t offset_count = 0; offset_count < offset_entries; ++offset_count) {
ep_write_buffer_uint32_t (&il_offsets_ptr, debug_info->line_numbers [offset_count].il_offset);
ep_write_buffer_uint32_t (&native_offsets_ptr, debug_info->line_numbers [offset_count].native_offset);
}
}
}
mono_debug_free_method_jit_info (debug_info);
}
if (events_data->buffer && !il_offsets && !native_offsets) {
// No IL offset -> Native offset mapping available. Put all code on IL offset 0.
EP_ASSERT (events_data->buffer_size >= sizeof (uint32_t) * 2);
offset_entries = 1;
il_offsets = (uint32_t*)events_data->buffer;
native_offsets = il_offsets + offset_entries;
il_offsets [0] = 0;
native_offsets [0] = ep_rt_val_uint32_t ((uint32_t)ji->code_size);
}
events_data->method_events_func (
method_id,
module_id,
method_code_start,
method_code_size,
method_token,
method_flags,
(ep_char8_t *)method_namespace,
(ep_char8_t *)method_name,
(ep_char8_t *)method_signature,
GUINT32_TO_UINT16 (offset_entries),
il_offsets,
native_offsets,
(ji->from_aot || ji->from_llvm),
verbose,
NULL);
g_free (method_namespace);
g_free (method_signature);
}
static
bool
include_method (MonoMethod *method)
{
if (!method) {
return false;
} else if (!m_method_is_wrapper (method)) {
return true;
} else {
WrapperInfo *wrapper = mono_marshal_get_wrapper_info (method);
return (wrapper && wrapper->subtype == WRAPPER_SUBTYPE_PINVOKE) ? true : false;
}
}
static
bool
get_module_event_data (
MonoImage *image,
ModuleEventData *module_data)
{
if (module_data) {
memset (module_data->module_il_pdb_signature, 0, EP_GUID_SIZE);
memset (module_data->module_native_pdb_signature, 0, EP_GUID_SIZE);
// Under netcore we only have root domain.
MonoDomain *root_domain = mono_get_root_domain ();
module_data->domain_id = (uint64_t)root_domain;
module_data->module_id = (uint64_t)image;
module_data->assembly_id = image ? (uint64_t)image->assembly : 0;
// TODO: Extract all module native paths and pdb metadata when available.
module_data->module_native_path = "";
module_data->module_native_pdb_path = "";
module_data->module_native_pdb_age = 0;
module_data->reserved_flags = 0;
// Netcore has a 1:1 between assemblies and modules, so its always a manifest module.
module_data->module_flags = MODULE_FLAGS_MANIFEST_MODULE;
if (image && image->dynamic)
module_data->module_flags |= MODULE_FLAGS_DYNAMIC_MODULE;
if (image && image->aot_module)
module_data->module_flags |= MODULE_FLAGS_NATIVE_MODULE;
module_data->module_il_path = NULL;
if (image && image->filename) {
/* if there's a filename, use it */
module_data->module_il_path = image->filename;
} else if (image && image->module_name) {
/* otherwise, use the module name */
module_data->module_il_path = image->module_name;
}
if (!module_data->module_il_path)
module_data->module_il_path = "";
module_data->module_il_pdb_path = "";
module_data->module_il_pdb_age = 0;
if (image && image->image_info) {
MonoPEDirEntry *debug_dir_entry = (MonoPEDirEntry *)&image->image_info->cli_header.datadir.pe_debug;
if (debug_dir_entry->size) {
ImageDebugDirectory debug_dir;
memset (&debug_dir, 0, sizeof (debug_dir));
uint32_t offset = mono_cli_rva_image_map (image, debug_dir_entry->rva);
for (uint32_t idx = 0; idx < debug_dir_entry->size / sizeof (ImageDebugDirectory); ++idx) {
uint8_t *data = (uint8_t *) ((ImageDebugDirectory *) (image->raw_data + offset) + idx);
debug_dir.major_version = read16 (data + 8);
debug_dir.minor_version = read16 (data + 10);
debug_dir.type = read32 (data + 12);
debug_dir.pointer = read32 (data + 24);
if (debug_dir.type == DEBUG_DIR_ENTRY_CODEVIEW && debug_dir.major_version == 0x100 && debug_dir.minor_version == 0x504d) {
data = (uint8_t *)(image->raw_data + debug_dir.pointer);
int32_t signature = read32 (data);
if (signature == 0x53445352) {
memcpy (module_data->module_il_pdb_signature, data + 4, EP_GUID_SIZE);
module_data->module_il_pdb_age = read32 (data + 20);
module_data->module_il_pdb_path = (const char *)(data + 24);
break;
}
}
}
}
}
}
return true;
}
static
void
fire_method_events_callback (
MonoJitInfo *ji,
void *user_data)
{
FireMethodEventsData *events_data = (FireMethodEventsData *)user_data;
EP_ASSERT (events_data != NULL);
if (ji && !ji->is_trampoline && !ji->async) {
MonoMethod *method = jinfo_get_method (ji);
if (include_method (method))
fire_method_events (ji, method, events_data);
}
}
static
void
fire_assembly_events (
MonoDomain *domain,
MonoAssembly *assembly,
fire_assembly_rundown_events_func assembly_events_func)
{
EP_ASSERT (domain != NULL);
EP_ASSERT (assembly != NULL);
EP_ASSERT (assembly_events_func != NULL);
// Native methods are part of JIT table and already emitted.
// TODO: FireEtwMethodDCEndVerbose_V1_or_V2 for all native methods in module as well?
uint32_t binding_id = 0;
ModuleEventData module_data;
memset (&module_data, 0, sizeof (module_data));
get_module_event_data (assembly->image, &module_data);
uint32_t assembly_flags = 0;
if (assembly->dynamic)
assembly_flags |= ASSEMBLY_FLAGS_DYNAMIC_ASSEMBLY;
if (assembly->image && assembly->image->aot_module) {
assembly_flags |= ASSEMBLY_FLAGS_NATIVE_ASSEMBLY;
}
char *assembly_name = mono_stringify_assembly_name (&assembly->aname);
assembly_events_func (
module_data.domain_id,
module_data.assembly_id,
assembly_flags,
binding_id,
(const ep_char8_t*)assembly_name,
module_data.module_id,
module_data.module_flags,
module_data.reserved_flags,
(const ep_char8_t *)module_data.module_il_path,
(const ep_char8_t *)module_data.module_native_path,
module_data.module_il_pdb_signature,
module_data.module_il_pdb_age,
(const ep_char8_t *)module_data.module_il_pdb_path,
module_data.module_native_pdb_signature,
module_data.module_native_pdb_age,
(const ep_char8_t *)module_data.module_native_pdb_path,
NULL);
g_free (assembly_name);
}
static
gboolean
execute_rundown (
fire_domain_rundown_events_func domain_events_func,
fire_assembly_rundown_events_func assembly_events_func,
fire_method_rundown_events_func method_events_func)
{
EP_ASSERT (domain_events_func != NULL);
EP_ASSERT (assembly_events_func != NULL);
EP_ASSERT (method_events_func != NULL);
// Under netcore we only have root domain.
MonoDomain *root_domain = mono_get_root_domain ();
if (root_domain) {
uint64_t domain_id = (uint64_t)root_domain;
// Emit all functions in use (JIT, AOT and Interpreter).
FireMethodEventsData events_data;
events_data.domain = root_domain;
events_data.buffer_size = 1024 * sizeof(uint32_t);
events_data.buffer = g_new (uint8_t, events_data.buffer_size);
events_data.method_events_func = method_events_func;
// All called JIT/AOT methods should be included in jit info table.
mono_jit_info_table_foreach_internal (fire_method_events_callback, &events_data);
// All called interpreted methods should be included in interpreter jit info table.
if (mono_get_runtime_callbacks ()->is_interpreter_enabled())
mono_get_runtime_callbacks ()->interp_jit_info_foreach (fire_method_events_callback, &events_data);
// Phantom methods injected in callstacks representing runtime functions.
if (_runtime_helper_compile_method_jitinfo && _runtime_helper_compile_method)
fire_method_events (_runtime_helper_compile_method_jitinfo, _runtime_helper_compile_method, &events_data);
if (_monitor_enter_method_jitinfo && _monitor_enter_method)
fire_method_events (_monitor_enter_method_jitinfo, _monitor_enter_method, &events_data);
if (_monitor_enter_v4_method_jitinfo && _monitor_enter_v4_method)
fire_method_events (_monitor_enter_v4_method_jitinfo, _monitor_enter_v4_method, &events_data);
g_free (events_data.buffer);
// Iterate all assemblies in domain.
GPtrArray *assemblies = mono_alc_get_all_loaded_assemblies ();
if (assemblies) {
for (uint32_t i = 0; i < assemblies->len; ++i) {
MonoAssembly *assembly = (MonoAssembly *)g_ptr_array_index (assemblies, i);
if (assembly)
fire_assembly_events (root_domain, assembly, assembly_events_func);
}
g_ptr_array_free (assemblies, TRUE);
}
uint32_t domain_flags = DOMAIN_FLAGS_DEFAULT_DOMAIN | DOMAIN_FLAGS_EXECUTABLE_DOMAIN;
const char *domain_name = root_domain->friendly_name ? root_domain->friendly_name : "";
uint32_t domain_index = 1;
domain_events_func (
domain_id,
domain_flags,
(const ep_char8_t *)domain_name,
domain_index,
NULL);
}
return TRUE;
}
static
bool
in_safe_point_frame (EventPipeStackContents *stack_content, WrapperInfo *wrapper)
{
EP_ASSERT (stack_content != NULL);
// If top of stack is a managed->native icall wrapper for one of the below subtypes, we are at a safe point frame.
if (wrapper && ep_stack_contents_get_length (stack_content) == 0 && wrapper->subtype == WRAPPER_SUBTYPE_ICALL_WRAPPER &&
(wrapper->d.icall.jit_icall_id == MONO_JIT_ICALL_mono_threads_state_poll ||
wrapper->d.icall.jit_icall_id == MONO_JIT_ICALL_mono_threads_enter_gc_safe_region_unbalanced ||
wrapper->d.icall.jit_icall_id == MONO_JIT_ICALL_mono_threads_exit_gc_safe_region_unbalanced ||
wrapper->d.icall.jit_icall_id == MONO_JIT_ICALL_mono_threads_enter_gc_unsafe_region_unbalanced ||
wrapper->d.icall.jit_icall_id == MONO_JIT_ICALL_mono_threads_exit_gc_unsafe_region_unbalanced))
return true;
return false;
}
static
bool
in_runtime_invoke_frame (EventPipeStackContents *stack_content, WrapperInfo *wrapper)
{
EP_ASSERT (stack_content != NULL);
// If top of stack is a managed->native runtime invoke wrapper, we are at a managed frame.
if (wrapper && ep_stack_contents_get_length (stack_content) == 0 &&
(wrapper->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL ||
wrapper->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT ||
wrapper->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_DYNAMIC ||
wrapper->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL))
return true;
return false;
}
static
bool
in_monitor_enter_frame (WrapperInfo *wrapper)
{
if (wrapper && wrapper->subtype == WRAPPER_SUBTYPE_ICALL_WRAPPER &&
(wrapper->d.icall.jit_icall_id == MONO_JIT_ICALL_mono_monitor_enter_fast ||
wrapper->d.icall.jit_icall_id == MONO_JIT_ICALL_mono_monitor_enter_internal))
return true;
return false;
}
static
bool
in_monitor_enter_v4_frame (WrapperInfo *wrapper)
{
if (wrapper && wrapper->subtype == WRAPPER_SUBTYPE_ICALL_WRAPPER &&
(wrapper->d.icall.jit_icall_id == MONO_JIT_ICALL_mono_monitor_enter_v4_fast ||
wrapper->d.icall.jit_icall_id == MONO_JIT_ICALL_mono_monitor_enter_v4_internal))
return true;
return false;
}
static
gboolean
walk_managed_stack_for_thread (
MonoStackFrameInfo *frame,
MonoContext *ctx,
StackWalkData *stack_walk_data)
{
EP_ASSERT (frame != NULL);
EP_ASSERT (stack_walk_data != NULL);
switch (frame->type) {
case FRAME_TYPE_DEBUGGER_INVOKE:
case FRAME_TYPE_MANAGED_TO_NATIVE:
case FRAME_TYPE_TRAMPOLINE:
case FRAME_TYPE_INTERP_TO_MANAGED:
case FRAME_TYPE_INTERP_TO_MANAGED_WITH_CTX:
case FRAME_TYPE_INTERP_ENTRY:
stack_walk_data->top_frame = false;
return FALSE;
case FRAME_TYPE_JIT_ENTRY:
// Frame in JIT compiler at top of callstack, add phantom frame representing call into JIT compiler.
// Makes it possible to detect stacks waiting on JIT compiler.
if (_runtime_helper_compile_method && stack_walk_data->top_frame)
ep_stack_contents_append (stack_walk_data->stack_contents, (uintptr_t)((uint8_t*)_runtime_helper_compile_method), _runtime_helper_compile_method);
stack_walk_data->top_frame = false;
return FALSE;
case FRAME_TYPE_MANAGED:
case FRAME_TYPE_INTERP:
if (frame->ji) {
stack_walk_data->async_frame |= frame->ji->async;
MonoMethod *method = frame->ji->async ? NULL : frame->actual_method;
if (method && m_method_is_wrapper (method)) {
WrapperInfo *wrapper = mono_marshal_get_wrapper_info (method);
if (in_safe_point_frame (stack_walk_data->stack_contents, wrapper)) {
stack_walk_data->safe_point_frame = true;
}else if (in_runtime_invoke_frame (stack_walk_data->stack_contents, wrapper)) {
stack_walk_data->runtime_invoke_frame = true;
} else if (_monitor_enter_method && in_monitor_enter_frame (wrapper)) {
ep_stack_contents_append (stack_walk_data->stack_contents, (uintptr_t)((uint8_t*)_monitor_enter_method), _monitor_enter_method);
} else if (_monitor_enter_v4_method && in_monitor_enter_v4_frame (wrapper)) {
ep_stack_contents_append (stack_walk_data->stack_contents, (uintptr_t)((uint8_t*)_monitor_enter_v4_method), _monitor_enter_v4_method);
} else if (wrapper && wrapper->subtype == WRAPPER_SUBTYPE_PINVOKE) {
ep_stack_contents_append (stack_walk_data->stack_contents, (uintptr_t)((uint8_t*)frame->ji->code_start + frame->native_offset), method);
}
} else if (method && !m_method_is_wrapper (method)) {
ep_stack_contents_append (stack_walk_data->stack_contents, (uintptr_t)((uint8_t*)frame->ji->code_start + frame->native_offset), method);
} else if (!method && frame->ji->async && !frame->ji->is_trampoline) {
ep_stack_contents_append (stack_walk_data->stack_contents, (uintptr_t)((uint8_t*)frame->ji->code_start), method);
}
}
stack_walk_data->top_frame = false;
return ep_stack_contents_get_length (stack_walk_data->stack_contents) >= EP_MAX_STACK_DEPTH;
default:
EP_UNREACHABLE ("walk_managed_stack_for_thread");
return FALSE;
}
}
static
gboolean
walk_managed_stack_for_thread_callback (
MonoStackFrameInfo *frame,
MonoContext *ctx,
void *data)
{
return walk_managed_stack_for_thread (frame, ctx, (StackWalkData *)data);
}
static
gboolean
sample_profiler_walk_managed_stack_for_thread_callback (
MonoStackFrameInfo *frame,
MonoContext *ctx,
void *data)
{
EP_ASSERT (frame != NULL);
EP_ASSERT (data != NULL);
SampleProfileStackWalkData *sample_data = (SampleProfileStackWalkData *)data;
if (sample_data->payload_data == EP_SAMPLE_PROFILER_SAMPLE_TYPE_ERROR) {
switch (frame->type) {
case FRAME_TYPE_MANAGED:
sample_data->payload_data = EP_SAMPLE_PROFILER_SAMPLE_TYPE_MANAGED;
break;
case FRAME_TYPE_MANAGED_TO_NATIVE:
case FRAME_TYPE_TRAMPOLINE:
sample_data->payload_data = EP_SAMPLE_PROFILER_SAMPLE_TYPE_EXTERNAL;
break;
case FRAME_TYPE_JIT_ENTRY:
sample_data->payload_data = EP_SAMPLE_PROFILER_SAMPLE_TYPE_EXTERNAL;
break;
case FRAME_TYPE_INTERP:
sample_data->payload_data = frame->managed ? EP_SAMPLE_PROFILER_SAMPLE_TYPE_MANAGED : EP_SAMPLE_PROFILER_SAMPLE_TYPE_EXTERNAL;
break;
case FRAME_TYPE_INTERP_TO_MANAGED:
case FRAME_TYPE_INTERP_TO_MANAGED_WITH_CTX:
break;
default:
sample_data->payload_data = EP_SAMPLE_PROFILER_SAMPLE_TYPE_MANAGED;
}
}
return walk_managed_stack_for_thread (frame, ctx, &sample_data->stack_walk_data);
}
bool
ep_rt_mono_walk_managed_stack_for_thread (
ep_rt_thread_handle_t thread,
EventPipeStackContents *stack_contents)
{
EP_ASSERT (thread != NULL && stack_contents != NULL);
StackWalkData stack_walk_data;
stack_walk_data.stack_contents = stack_contents;
stack_walk_data.top_frame = true;
stack_walk_data.async_frame = false;
stack_walk_data.safe_point_frame = false;
stack_walk_data.runtime_invoke_frame = false;
bool restore_async_context = FALSE;
bool prevent_profiler_event_recursion = FALSE;
EventPipeMonoThreadData *thread_data = ep_rt_mono_thread_data_get_or_create ();
if (thread_data) {
prevent_profiler_event_recursion = thread_data->prevent_profiler_event_recursion;
if (prevent_profiler_event_recursion && !mono_thread_info_is_async_context ()) {
// Running stackwalk in async context mode is currently the only way to prevent
// unwinder to NOT load additional classes during stackwalk, making it signal unsafe and
// potential triggering uncontrolled recursion in profiler class loading event.
mono_thread_info_set_is_async_context (TRUE);
restore_async_context = TRUE;
}
thread_data->prevent_profiler_event_recursion = TRUE;
}
if (thread == ep_rt_thread_get_handle () && mono_get_eh_callbacks ()->mono_walk_stack_with_ctx)
mono_get_eh_callbacks ()->mono_walk_stack_with_ctx (walk_managed_stack_for_thread_callback, NULL, MONO_UNWIND_SIGNAL_SAFE, &stack_walk_data);
else if (mono_get_eh_callbacks ()->mono_walk_stack_with_state)
mono_get_eh_callbacks ()->mono_walk_stack_with_state (walk_managed_stack_for_thread_callback, mono_thread_info_get_suspend_state (thread), MONO_UNWIND_SIGNAL_SAFE, &stack_walk_data);
if (thread_data) {
if (restore_async_context)
mono_thread_info_set_is_async_context (FALSE);
thread_data->prevent_profiler_event_recursion = prevent_profiler_event_recursion;
}
return true;
}
bool
ep_rt_mono_sample_profiler_write_sampling_event_for_threads (
ep_rt_thread_handle_t sampling_thread,
EventPipeEvent *sampling_event)
{
// Follows CoreClr implementation of sample profiler. Generic invasive/expensive way to do CPU sample profiling relying on STW and stackwalks.
// TODO: Investigate alternatives on platforms supporting Signals/SuspendThread (see Mono profiler) or CPU PMU's (see ETW/perf_event_open).
// Sample profiler only runs on one thread, no need to synchorinize.
if (!_sampled_thread_callstacks)
_sampled_thread_callstacks = g_array_sized_new (FALSE, FALSE, sizeof (SampleProfileStackWalkData), _max_sampled_thread_count);
// Make sure there is room based on previous max number of sampled threads.
// NOTE, there is a chance there are more threads than max, if that's the case we will
// miss those threads in this sample, but will be included in next when max has been adjusted.
g_array_set_size (_sampled_thread_callstacks, _max_sampled_thread_count);
uint32_t filtered_thread_count = 0;
uint32_t sampled_thread_count = 0;
mono_stop_world (MONO_THREAD_INFO_FLAGS_NO_GC);
bool restore_async_context = FALSE;
if (!mono_thread_info_is_async_context ()) {
mono_thread_info_set_is_async_context (TRUE);
restore_async_context = TRUE;
}
// Record all info needed in sample events while runtime is suspended, must be async safe.
FOREACH_THREAD_SAFE_EXCLUDE (thread_info, MONO_THREAD_INFO_FLAGS_NO_GC | MONO_THREAD_INFO_FLAGS_NO_SAMPLE) {
if (!mono_thread_info_is_running (thread_info) && thread_info->jit_data) {
MonoThreadUnwindState *thread_state = mono_thread_info_get_suspend_state (thread_info);
if (thread_state->valid) {
if (sampled_thread_count < _max_sampled_thread_count) {
SampleProfileStackWalkData *data = &g_array_index (_sampled_thread_callstacks, SampleProfileStackWalkData, sampled_thread_count);
data->thread_id = ep_rt_thread_id_t_to_uint64_t (mono_thread_info_get_tid (thread_info));
data->thread_ip = (uintptr_t)MONO_CONTEXT_GET_IP (&thread_state->ctx);
data->payload_data = EP_SAMPLE_PROFILER_SAMPLE_TYPE_ERROR;
data->stack_walk_data.stack_contents = &data->stack_contents;
data->stack_walk_data.top_frame = true;
data->stack_walk_data.async_frame = false;
data->stack_walk_data.safe_point_frame = false;
data->stack_walk_data.runtime_invoke_frame = false;
ep_stack_contents_reset (&data->stack_contents);
mono_get_eh_callbacks ()->mono_walk_stack_with_state (sample_profiler_walk_managed_stack_for_thread_callback, thread_state, MONO_UNWIND_SIGNAL_SAFE, data);
if (data->payload_data == EP_SAMPLE_PROFILER_SAMPLE_TYPE_EXTERNAL && (data->stack_walk_data.safe_point_frame || data->stack_walk_data.runtime_invoke_frame)) {
// If classified as external code (managed->native frame on top of stack), but have a safe point or runtime invoke frame
// as second, re-classify current callstack to be executing managed code.
data->payload_data = EP_SAMPLE_PROFILER_SAMPLE_TYPE_MANAGED;
}
if (data->stack_walk_data.top_frame && ep_stack_contents_get_length (&data->stack_contents) == 0) {
// If no managed frames (including helper frames) are located on stack, mark sample as beginning in external code.
// This can happen on attached embedding threads returning to native code between runtime invokes.
// Make sure sample is still written into EventPipe for all attached threads even if they are currently not having
// any managed frames on stack. Prevents some tools applying thread time heuristics to prolong duration of last sample
// when embedding thread returns to native code. It also opens ability to visualize number of samples in unmanaged code
// on attached threads when executing outside of runtime. If tooling is not interested in these sample events, they are easy
// to identify and filter out.
data->payload_data = EP_SAMPLE_PROFILER_SAMPLE_TYPE_EXTERNAL;
}
sampled_thread_count++;
}
}
}
filtered_thread_count++;
} FOREACH_THREAD_SAFE_END
if (restore_async_context)
mono_thread_info_set_is_async_context (FALSE);
mono_restart_world (MONO_THREAD_INFO_FLAGS_NO_GC);
// Fire sample event for threads. Must be done after runtime is resumed since it's not async safe.
// Since we can't keep thread info around after runtime as been suspended, use an empty
// adapter instance and only set recorded tid as parameter inside adapter.
THREAD_INFO_TYPE adapter = { { 0 } };
for (uint32_t thread_count = 0; thread_count < sampled_thread_count; ++thread_count) {
SampleProfileStackWalkData *data = &g_array_index (_sampled_thread_callstacks, SampleProfileStackWalkData, thread_count);
if ((data->stack_walk_data.top_frame && data->payload_data == EP_SAMPLE_PROFILER_SAMPLE_TYPE_EXTERNAL) || (data->payload_data != EP_SAMPLE_PROFILER_SAMPLE_TYPE_ERROR && ep_stack_contents_get_length (&data->stack_contents) > 0)) {
// Check if we have an async frame, if so we will need to make sure all frames are registered in regular jit info table.
// TODO: An async frame can contain wrapper methods (no way to check during stackwalk), we could skip writing profile event
// for this specific stackwalk or we could cleanup stack_frames before writing profile event.
if (data->stack_walk_data.async_frame) {
for (uint32_t frame_count = 0; frame_count < data->stack_contents.next_available_frame; ++frame_count)
mono_jit_info_table_find_internal ((gpointer)data->stack_contents.stack_frames [frame_count], TRUE, FALSE);
}
mono_thread_info_set_tid (&adapter, ep_rt_uint64_t_to_thread_id_t (data->thread_id));
uint32_t payload_data = ep_rt_val_uint32_t (data->payload_data);
ep_write_sample_profile_event (sampling_thread, sampling_event, &adapter, &data->stack_contents, (uint8_t *)&payload_data, sizeof (payload_data));
}
}
// Current thread count will be our next maximum sampled threads.
_max_sampled_thread_count = filtered_thread_count;
return true;
}
void
ep_rt_mono_execute_rundown (dn_vector_ptr_t *execution_checkpoints)
{
ep_char8_t runtime_module_path [256];
const uint8_t object_guid [EP_GUID_SIZE] = { 0 };
const uint16_t runtime_product_qfe_version = 0;
const uint8_t startup_flags = 0;
const uint8_t startup_mode = 0;
const ep_char8_t *command_line = "";
if (!g_module_address ((void *)mono_init, runtime_module_path, sizeof (runtime_module_path), NULL, NULL, 0, NULL))
runtime_module_path [0] = '\0';
FireEtwRuntimeInformationDCStart (
clr_instance_get_id (),
RUNTIME_SKU_MONO,
RuntimeProductMajorVersion,
RuntimeProductMinorVersion,
RuntimeProductPatchVersion,
runtime_product_qfe_version,
RuntimeFileMajorVersion,
RuntimeFileMajorVersion,
RuntimeFileBuildVersion,
RuntimeFileRevisionVersion,
startup_mode,
startup_flags,
command_line,
object_guid,
runtime_module_path,
NULL,
NULL);
if (execution_checkpoints) {
DN_VECTOR_PTR_FOREACH_BEGIN (EventPipeExecutionCheckpoint *, checkpoint, execution_checkpoints) {
FireEtwExecutionCheckpointDCEnd (
clr_instance_get_id (),
checkpoint->name,
checkpoint->timestamp,
NULL,
NULL);
} DN_VECTOR_PTR_FOREACH_END;
}
FireEtwDCEndInit_V1 (
clr_instance_get_id (),
NULL,
NULL);
execute_rundown (
fire_domain_rundown_events,
fire_assembly_rundown_events,
fire_method_rundown_events);
FireEtwDCEndComplete_V1 (
clr_instance_get_id (),
NULL,
NULL);
}
// Clear out BulkTypeValue before filling it out (array elements can get reused if there
// are enough types that we need to flush to multiple events).
static
void
bulk_type_value_clear (BulkTypeValue *bulk_type_value)
{
memset (bulk_type_value, 0, sizeof(BulkTypeValue));
}
static
int
bulk_type_get_byte_count_in_event (BulkTypeValue *bulk_type_value)
{
int name_len = bulk_type_value->name && bulk_type_value->name [0] != '\0'
? GSIZE_TO_INT (strlen (bulk_type_value->name))
: 0;
// NOTE, must match manifest BulkType value type.
return sizeof (bulk_type_value->fixed_sized_data.type_id) +
sizeof (bulk_type_value->fixed_sized_data.module_id) +
sizeof (bulk_type_value->fixed_sized_data.type_name_id) +
sizeof (bulk_type_value->fixed_sized_data.flags) +
sizeof (bulk_type_value->fixed_sized_data.cor_element_type) +
(name_len + 1) * sizeof (ep_char16_t) +
sizeof (bulk_type_value->type_parameters_count) +
bulk_type_value->type_parameters_count * sizeof (uint64_t);
}
static
BulkTypeEventLogger*
bulk_type_event_logger_alloc (void)
{
BulkTypeEventLogger *type_logger = g_malloc0 (sizeof (BulkTypeEventLogger));
type_logger->bulk_type_event_buffer = g_malloc0 (sizeof (uint8_t) * MAX_SIZE_OF_EVENT_BUFFER);
type_logger->mem_pool = mono_mempool_new ();
dn_umap_custom_alloc_params_t params = {0, };
params.value_dispose_func = g_free;
type_logger->type_cache = dn_umap_custom_alloc (¶ms);
return type_logger;
}
static
void
bulk_type_event_logger_free (BulkTypeEventLogger *type_logger)
{
mono_mempool_destroy (type_logger->mem_pool);
dn_umap_free (type_logger->type_cache);
g_free (type_logger->bulk_type_event_buffer);
g_free (type_logger);
}
//---------------------------------------------------------------------------------------
//
// fire_bulk_type_event fires an ETW event for all the types batched so far,
// it then resets the state to start batching new types at the beginning of the
// bulk_type_values array.
//
// This follows CoreCLR's BulkTypeEventLogger::FireBulkTypeEvent
static
void
bulk_type_fire_bulk_type_event (BulkTypeEventLogger *type_logger)
{
if (type_logger->bulk_type_value_count == 0)
return;
uint16_t clr_instance_id = clr_instance_get_id ();
uint32_t values_element_size = 0;
uint8_t *ptr = type_logger->bulk_type_event_buffer;
// NOTE, must match manifest BulkType value type.
for (uint32_t type_value_index = 0; type_value_index < type_logger->bulk_type_value_count; type_value_index++) {
BulkTypeValue *target = &type_logger->bulk_type_values [type_value_index];
values_element_size += ep_write_buffer_uint64_t (&ptr, target->fixed_sized_data.type_id);
values_element_size += ep_write_buffer_uint64_t (&ptr, target->fixed_sized_data.module_id);
values_element_size += ep_write_buffer_uint32_t (&ptr, target->fixed_sized_data.type_name_id);
values_element_size += ep_write_buffer_uint32_t (&ptr, target->fixed_sized_data.flags);
values_element_size += ep_write_buffer_uint8_t (&ptr, target->fixed_sized_data.cor_element_type);
uint32_t target_name_len = target->name && target->name [0] != '\0' ? GSIZE_TO_UINT32 (strlen (target->name)) : 0;
values_element_size += write_buffer_string_utf8_to_utf16_t (&ptr, target->name, target_name_len);
values_element_size += ep_write_buffer_uint32_t (&ptr, target->type_parameters_count);
for (uint32_t i = 0; i < target->type_parameters_count; i++) {
uint64_t type_parameter = get_typeid_for_type (target->mono_type_parameters [i]);
values_element_size += ep_write_buffer_uint64_t (&ptr, type_parameter);
}
}
FireEtwBulkType (
type_logger->bulk_type_value_count,
clr_instance_id,
values_element_size,
type_logger->bulk_type_event_buffer,
NULL,
NULL);
memset (type_logger->bulk_type_event_buffer, 0, sizeof (uint8_t) * MAX_SIZE_OF_EVENT_BUFFER);
type_logger->bulk_type_value_count = 0;
type_logger->bulk_type_value_byte_count = 0;
}
//---------------------------------------------------------------------------------------
//
// get_typeid_for_type is responsible for obtaining the unique type identifier for a
// particular MonoType. MonoTypes are structs that are not unique pointers. There
// can be two different MonoTypes that both System.Thread or int32 or bool []. There
// is exactly one MonoClass * for any type, so we leverage the MonoClass a MonoType
// points to in order to obtain a unique type identifier in mono. With that unique
// MonoClass, its fields this_arg and _byval_arg are unique as well.
//
// Arguments:
// * mono_type - MonoType to be logged
//
// Return Value:
// type_id - Unique type identifier of mono_type
static
uint64_t
get_typeid_for_type (MonoType *t)
{
if (m_type_is_byref (t))
return (uint64_t)m_class_get_this_arg (mono_class_from_mono_type_internal (t));
else
return (uint64_t)m_class_get_byval_arg (mono_class_from_mono_type_internal (t));
}
static
uint64_t
get_typeid_for_class (MonoClass *c)
{
return get_typeid_for_type (m_class_get_byval_arg (c));
}
//---------------------------------------------------------------------------------------
//
// bulk_type_log_single_type batches a single type into the bulk type array and flushes
// the array to ETW if it fills up. Most interaction with the type system (type analysis)
// is done here. This does not recursively batch up any parameter types (arrays or generics),
// but does add their unique identifiers to the mono_type_parameters array.
// ep_rt_mono_log_type_and_parameters is responsible for initiating any recursive calls to
// deal with type parameters.
//
// Arguments:
// * type_logger - BulkTypeEventLogger instance
// * mono_type - MonoType to be logged
//
// Return Value:
// Index into array of where this type got batched. -1 if there was a failure.
//
// This follows CoreCLR's BulkTypeEventLogger::LogSingleType
static
int
bulk_type_log_single_type (
BulkTypeEventLogger *type_logger,
MonoType *mono_type)
{
// If there's no room for another type, flush what we've got
if (type_logger->bulk_type_value_count == K_MAX_COUNT_TYPE_VALUES)
bulk_type_fire_bulk_type_event (type_logger);
EP_ASSERT (type_logger->bulk_type_value_count < K_MAX_COUNT_TYPE_VALUES);
BulkTypeValue *val = &type_logger->bulk_type_values [type_logger->bulk_type_value_count];
bulk_type_value_clear (val);
MonoClass *klass = mono_class_from_mono_type_internal (mono_type);
MonoType *mono_underlying_type = mono_type_get_underlying_type (mono_type);
// Initialize val fixed_sized_data
val->fixed_sized_data.type_id = get_typeid_for_type (mono_type);
val->fixed_sized_data.module_id = (uint64_t)m_class_get_image (klass);
val->fixed_sized_data.type_name_id = m_class_get_type_token (klass) ? mono_metadata_make_token (MONO_TABLE_TYPEDEF, mono_metadata_token_index (m_class_get_type_token (klass))) : 0;
if (mono_class_has_finalizer (klass))
val->fixed_sized_data.flags |= TYPE_FLAGS_FINALIZABLE;
if (m_class_is_delegate (klass))
val->fixed_sized_data.flags |= TYPE_FLAGS_DELEGATE;
if (mono_class_is_com_object (klass))
val->fixed_sized_data.flags |= TYPE_FLAGS_EXTERNALLY_IMPLEMENTED_COM_OBJECT;
val->fixed_sized_data.cor_element_type = (uint8_t)mono_underlying_type->type;
// Sets val variable sized parameter type data, type_parameters_count, and mono_type_parameters associated
// with arrays or generics to be recursively batched in the same ep_rt_mono_log_type_and_parameters call
switch (mono_underlying_type->type) {
case MONO_TYPE_ARRAY:
case MONO_TYPE_SZARRAY:
{
MonoArrayType *mono_array_type = mono_type_get_array_type (mono_type);
val->fixed_sized_data.flags |= TYPE_FLAGS_ARRAY;
if (mono_underlying_type->type == MONO_TYPE_ARRAY) {
// Only ranks less than TypeFlagsArrayRankMax are supported.
// Fortunately TypeFlagsArrayRankMax should be greater than the
// number of ranks the type loader will support
uint32_t rank = mono_array_type->rank;
if (rank < TYPE_FLAGS_ARRAY_RANK_MAX) {
rank <<= 8;
val->fixed_sized_data.flags |= rank;
}
}
// mono arrays are always arrays of by value types
val->mono_type_parameters = mono_mempool_alloc0 (type_logger->mem_pool, 1 * sizeof (MonoType*));
*val->mono_type_parameters = m_class_get_byval_arg (mono_array_type->eklass);
val->type_parameters_count++;
break;
}
case MONO_TYPE_GENERICINST:
{
MonoGenericInst *class_inst = mono_type->data.generic_class->context.class_inst;
val->type_parameters_count = class_inst->type_argc;
val->mono_type_parameters = mono_mempool_alloc0 (type_logger->mem_pool, val->type_parameters_count * sizeof (MonoType*));
memcpy (val->mono_type_parameters, class_inst->type_argv, val->type_parameters_count * sizeof (MonoType*));
break;
}
case MONO_TYPE_CLASS:
case MONO_TYPE_VALUETYPE:
case MONO_TYPE_PTR:
case MONO_TYPE_BYREF:
{
if (mono_underlying_type == mono_type)
break;
val->mono_type_parameters = mono_mempool_alloc0 (type_logger->mem_pool, 1 * sizeof (MonoType*));
*val->mono_type_parameters = mono_underlying_type;
val->type_parameters_count++;
break;
}
default:
break;
}
val->name = "";
bool log_type_name = is_keyword_and_level_enabled (&RUNTIME_PROVIDER_CONTEXT, EP_EVENT_LEVEL_INFORMATIONAL, GC_HEAP_AND_TYPE_NAMES_KEYWORD);
if (type_logger->type_cache && log_type_name) {
dn_umap_it_t result = dn_umap_find (type_logger->type_cache, GUINT64_TO_POINTER (val->fixed_sized_data.type_id));
if (dn_umap_it_end (result) || !dn_umap_it_value (result)) {
dn_umap_result_t insert = dn_umap_insert_or_assign (type_logger->type_cache, GUINT64_TO_POINTER (val->fixed_sized_data.type_id), mono_type_get_name_full (mono_type, MONO_TYPE_NAME_FORMAT_IL));
if (insert.result)
result = insert.it;
}
val->name = !dn_umap_it_end (result) ? (const ep_char8_t *)dn_umap_it_value (result) : "";
}
// Now that we know the full size of this type's data, see if it fits in our
// batch or whether we need to flush
int val_byte_count = bulk_type_get_byte_count_in_event (val);
if (val_byte_count > MAX_TYPE_VALUES_BYTES) {
// NOTE: If name is actively used, set it to NULL and relevant memory management to reduce byte count
// This type is apparently so huge, it's too big to squeeze into an event, even
// if it were the only type batched in the whole event. Bail
mono_trace (G_LOG_LEVEL_ERROR, MONO_TRACE_DIAGNOSTICS, "Failed to log single mono type %p with typeID %llu. Type is too large for the BulkType Event.\n", (gpointer)mono_type, (unsigned long long)val->fixed_sized_data.type_id);
return -1;
}
if (type_logger->bulk_type_value_byte_count + val_byte_count > MAX_TYPE_VALUES_BYTES) {
// Although this type fits into the array, its size is so big that the entire
// array can't be logged via ETW. So flush the array, and start over by
// calling ourselves--this refetches the type info and puts it at the
// beginning of the array. Since we know this type is small enough to be
// batched into an event on its own, this recursive call will not try to
// call itself again.
g_assert (type_logger->bulk_type_value_byte_count + val_byte_count > MAX_TYPE_VALUES_BYTES);
bulk_type_fire_bulk_type_event (type_logger);
return bulk_type_log_single_type (type_logger, mono_type);
}
// The type fits into the batch, so update our state
type_logger->bulk_type_value_count++;
type_logger->bulk_type_value_byte_count += val_byte_count;
return type_logger->bulk_type_value_count - 1;
}
//---------------------------------------------------------------------------------------
//
// High-level method to batch a type and (recursively) its type parameters, flushing to
// ETW as needed. This is called by bulk_type_log_type_and_parameters_if_necessary.
//
// Arguments:
// * type_logger - BulkTypeEventLogger instance
// * mono_type - MonoType to be logged
// log_behavior - Describe how type should be logged.
//
// This follows CoreCLR's BulkTypeEventLogger::LogTypeAndParameter
static
void
bulk_type_log_type_and_parameters (
BulkTypeEventLogger *type_logger,
MonoType *mono_type,
TypeLogBehavior log_behavior)
{
// Batch up this type. This grabs useful info about the type, including any
// type parameters it may have, and sticks it in bulk_type_values
int bulk_type_value_index = bulk_type_log_single_type (type_logger, mono_type);
if (bulk_type_value_index == -1) {
// There was a failure trying to log the type, so don't bother with its type
// parameters
return;
}
// Look at the type info we just batched, so we can get the type parameters
BulkTypeValue *val = &type_logger->bulk_type_values [bulk_type_value_index];
// We're about to recursively call ourselves for the type parameters, so make a
// local copy of their type handles first (else, as we log them we could flush
// and clear out bulk_type_values, thus trashing val)
uint32_t param_count = val->type_parameters_count;
if (param_count == 0)
return;
MonoType **mono_type_parameters = mono_mempool_alloc0 (type_logger->mem_pool, param_count * sizeof (MonoType*));
memcpy (mono_type_parameters, val->mono_type_parameters, sizeof (MonoType*) * param_count);
if (log_behavior == TYPE_LOG_BEHAVIOR_ALWAYS_LOG_TOP_LEVEL)
log_behavior = TYPE_LOG_BEHAVIOR_IF_FIRST_TIME;
for (uint32_t i = 0; i < param_count; i++)
bulk_type_log_type_and_parameters_if_necessary (type_logger, mono_type_parameters [i], log_behavior);
}
//---------------------------------------------------------------------------------------
//
// Outermost level of ETW-type-logging. This method is used to log a unique type identifier
// (in this case a MonoType) and (recursively) its type parameters when present.
//
// Arguments:
// * type_logger - BulkTypeEventLogger instance
// * mono_type - MonoType to be logged
// log_behavior - Describe how type should be logged.
//
// This follows CoreCLR's BulkTypeEventLogger::LogTypeAndParameters
static
void
bulk_type_log_type_and_parameters_if_necessary (
BulkTypeEventLogger *type_logger,
MonoType *mono_type,
TypeLogBehavior log_behavior)
{
if (!is_keyword_and_level_enabled (&RUNTIME_PROVIDER_CONTEXT, EP_EVENT_LEVEL_INFORMATIONAL, TYPE_KEYWORD))
return;
bool log_type = (log_behavior == TYPE_LOG_BEHAVIOR_ALWAYS_LOG || log_behavior == TYPE_LOG_BEHAVIOR_ALWAYS_LOG_TOP_LEVEL);
if (!log_type && type_logger) {
uint64_t type_id = get_typeid_for_type (mono_type);
dn_umap_result_t result = dn_umap_insert (type_logger->type_cache, GUINT64_TO_POINTER (type_id), NULL);
log_type = result.result;
}
if (!log_type)
return;
if (type_logger)
bulk_type_log_type_and_parameters (type_logger, mono_type, log_behavior);
}
//---------------------------------------------------------------------------------------
//
// write_method_details_event is the method responsible for sending details of
// methods involved in events such as JitStart, Load/Unload, Rundown, R2R, and other
// eventpipe events. It calls ep_rt_mono_log_type_and_parameters_if_necessary to log
// unique types from the method type and available method instantiation parameter types
// that are ultimately emitted as a BulkType event in ep_rt_mono_fire_bulk_type_event.
// After appropriately logging type information, it sends method details outlined by
// the generated dotnetruntime.c and ClrEtwAll manifest.
//
// Arguments:
// * method - a MonoMethod hit during an eventpipe event
//
// This follows CoreCLR's ETW::MethodLog::SendMethodDetailsEvent
static
void
write_event_method_details (MonoMethod *method)
{
if (method->wrapper_type != MONO_WRAPPER_NONE || method->dynamic)
return;
MonoGenericContext *method_ctx = mono_method_get_context (method);
MonoGenericInst *method_inst = NULL;
if (method_ctx)
method_inst = method_ctx->method_inst;
if (method_inst && method_inst->type_argc > MAX_METHOD_TYPE_ARGUMENT_COUNT)
return;
BulkTypeEventLogger *type_logger = bulk_type_event_logger_alloc ();
uint64_t method_type_id = 0;
g_assert (mono_metadata_token_index (method->token) != 0);
uint32_t method_token = mono_metadata_make_token (MONO_TABLE_METHOD, mono_metadata_token_index (method->token));
uint64_t loader_module_id = 0;
MonoClass *klass = method->klass;
if (klass) {
MonoType *method_mono_type = m_class_get_byval_arg (klass);
method_type_id = get_typeid_for_class (klass);
bulk_type_log_type_and_parameters_if_necessary (type_logger, method_mono_type, TYPE_LOG_BEHAVIOR_ALWAYS_LOG);
loader_module_id = (uint64_t)mono_class_get_image (klass);
}
uint32_t method_inst_parameter_types_count = 0;
if (method_inst)
method_inst_parameter_types_count = method_inst->type_argc;
uint64_t *method_inst_parameters_type_ids = mono_mempool_alloc0 (type_logger->mem_pool, method_inst_parameter_types_count * sizeof (uint64_t));
uint8_t *buffer = (uint8_t *)method_inst_parameters_type_ids;
for (uint32_t i = 0; i < method_inst_parameter_types_count; i++) {
ep_write_buffer_uint64_t (&buffer, get_typeid_for_type (method_inst->type_argv [i]));
bulk_type_log_type_and_parameters_if_necessary (type_logger, method_inst->type_argv [i], TYPE_LOG_BEHAVIOR_ALWAYS_LOG);
}
bulk_type_fire_bulk_type_event (type_logger);
FireEtwMethodDetails (
(uint64_t)method,
method_type_id,
method_token,
method_inst_parameter_types_count,
loader_module_id,
(uint64_t*)method_inst_parameters_type_ids,
NULL,
NULL);
bulk_type_event_logger_free (type_logger);
}
static
bool
write_event_jit_start (MonoMethod *method)
{
if (!EventEnabledMethodJittingStarted_V1 ())
return true;
//TODO: Optimize string formatting into functions accepting GString to reduce heap alloc.
if (method) {
uint64_t method_id = 0;
uint64_t module_id = 0;
uint32_t code_size = 0;
uint32_t method_token = 0;
char *method_namespace = NULL;
const char *method_name = NULL;
char *method_signature = NULL;
write_event_method_details (method);
method_id = (uint64_t)method;
if (!method->dynamic)
method_token = method->token;
if (!mono_method_has_no_body (method)) {
ERROR_DECL (error);
MonoMethodHeader *header = mono_method_get_header_internal (method, error);
if (header)
code_size = header->code_size;
}
method_name = method->name;
method_signature = mono_signature_full_name (mono_method_signature_internal (method));
if (method->klass) {
module_id = (uint64_t)m_class_get_image (method->klass);
method_namespace = mono_type_get_name_full (m_class_get_byval_arg (method->klass), MONO_TYPE_NAME_FORMAT_IL);
}
FireEtwMethodJittingStarted_V1 (
method_id,
module_id,
method_token,
code_size,
method_namespace,
method_name,
method_signature,
clr_instance_get_id (),
NULL,
NULL);
g_free (method_namespace);
g_free (method_signature);
}
return true;
}
static
bool
write_event_method_il_to_native_map (
MonoMethod *method,
MonoJitInfo *ji)
{
if (!EventEnabledMethodILToNativeMap ())
return true;
if (method) {
// Under netcore we only have root domain.
MonoDomain *root_domain = mono_get_root_domain ();
uint64_t method_id = (uint64_t)method;
uint32_t fixed_buffer [64];
uint8_t *buffer = NULL;
uint32_t offset_entries = 0;
uint32_t *il_offsets = NULL;
uint32_t *native_offsets = NULL;
MonoDebugMethodJitInfo *debug_info = method ? mono_debug_find_method (method, root_domain) : NULL;
if (debug_info) {
offset_entries = debug_info->num_line_numbers;
if (offset_entries != 0) {
size_t needed_size = (offset_entries * sizeof (uint32_t) * 2);
if (needed_size > sizeof (fixed_buffer)) {
buffer = g_new (uint8_t, needed_size);
il_offsets = (uint32_t*)buffer;
} else {
il_offsets = fixed_buffer;
}
if (il_offsets) {
native_offsets = il_offsets + offset_entries;
uint8_t *il_offsets_ptr = (uint8_t *)il_offsets;
uint8_t *native_offsets_ptr = (uint8_t *)native_offsets;
for (uint32_t offset_count = 0; offset_count < offset_entries; ++offset_count) {
ep_write_buffer_uint32_t (&il_offsets_ptr, debug_info->line_numbers [offset_count].il_offset);
ep_write_buffer_uint32_t (&native_offsets_ptr, debug_info->line_numbers [offset_count].native_offset);
}
}
}
mono_debug_free_method_jit_info (debug_info);
}
if (!il_offsets && !native_offsets) {
// No IL offset -> Native offset mapping available. Put all code on IL offset 0.
EP_ASSERT (sizeof (fixed_buffer) >= sizeof (uint32_t) * 2);
offset_entries = 1;
il_offsets = fixed_buffer;
native_offsets = il_offsets + offset_entries;
il_offsets [0] = 0;
native_offsets [0] = ji ? ep_rt_val_uint32_t ((uint32_t)ji->code_size) : 0;
}
FireEtwMethodILToNativeMap (
method_id,
0,
0,
GUINT32_TO_UINT16 (offset_entries),
il_offsets,
native_offsets,
clr_instance_get_id (),
NULL,
NULL);
g_free (buffer);
}
return true;
}
static
bool
write_event_method_load (
MonoMethod *method,
MonoJitInfo *ji)
{
if (!EventEnabledMethodLoad_V1 () && !EventEnabledMethodLoadVerbose_V1 ())
return true;
//TODO: Optimize string formatting into functions accepting GString to reduce heap alloc.
if (method) {
uint64_t method_id = 0;
uint64_t module_id = 0;
uint64_t method_code_start = ji ? (uint64_t)ji->code_start : 0;
uint32_t method_code_size = ji ? (uint32_t)ji->code_size : 0;
uint32_t method_token = 0;
uint32_t method_flags = 0;
uint8_t kind = MONO_CLASS_DEF;
char *method_namespace = NULL;
const char *method_name = NULL;
char *method_signature = NULL;
bool verbose = (RUNTIME_PROVIDER_CONTEXT.Level >= (uint8_t)EP_EVENT_LEVEL_VERBOSE);
method_id = (uint64_t)method;
if (!method->dynamic)
method_token = method->token;
if (ji && mono_jit_info_get_generic_sharing_context (ji)) {
method_flags |= METHOD_FLAGS_SHARED_GENERIC_METHOD;
verbose = true;
}
if (method->dynamic) {
method_flags |= METHOD_FLAGS_DYNAMIC_METHOD;
verbose = true;
}
if (ji && !ji->from_aot && !ji->from_llvm) {
method_flags |= METHOD_FLAGS_JITTED_METHOD;
if (method->wrapper_type != MONO_WRAPPER_NONE)
method_flags |= METHOD_FLAGS_JITTED_HELPER_METHOD;
}
if (method->is_generic || method->is_inflated) {
method_flags |= METHOD_FLAGS_GENERIC_METHOD;
verbose = true;
}
if (method->klass) {
module_id = (uint64_t)m_class_get_image (method->klass);
kind = m_class_get_class_kind (method->klass);
if (kind == MONO_CLASS_GTD || kind == MONO_CLASS_GINST)
method_flags |= METHOD_FLAGS_GENERIC_METHOD;
}
write_event_method_details (method);
if (verbose) {
method_name = method->name;
method_signature = mono_signature_full_name (mono_method_signature_internal (method));
if (method->klass)
method_namespace = mono_type_get_name_full (m_class_get_byval_arg (method->klass), MONO_TYPE_NAME_FORMAT_IL);
FireEtwMethodLoadVerbose_V1 (
method_id,
module_id,
method_code_start,
method_code_size,
method_token,
method_flags | METHOD_FLAGS_EXTENT_HOT_SECTION,
method_namespace,
method_name,
method_signature,
clr_instance_get_id (),
NULL,
NULL);
if (ji && (ji->from_aot || ji->from_llvm))
FireEtwMethodLoadVerbose_V1 (
method_id,
module_id,
method_code_start,
method_code_size,
method_token,
method_flags | METHOD_FLAGS_EXTENT_COLD_SECTION,
method_namespace,
method_name,
method_signature,
clr_instance_get_id (),
NULL,
NULL);
} else {
FireEtwMethodLoad_V1 (
method_id,
module_id,
method_code_start,
method_code_size,
method_token,
method_flags | METHOD_FLAGS_EXTENT_HOT_SECTION,
clr_instance_get_id (),
NULL,
NULL);
if (ji && (ji->from_aot || ji->from_llvm))
FireEtwMethodLoad_V1 (
method_id,
module_id,
method_code_start,
method_code_size,
method_token,
method_flags | METHOD_FLAGS_EXTENT_COLD_SECTION,
clr_instance_get_id (),
NULL,
NULL);
}
g_free (method_namespace);
g_free (method_signature);
}
return true;
}
static
bool
write_event_module_load (MonoImage *image)
{
if (!EventEnabledModuleLoad_V2 () && !EventEnabledDomainModuleLoad_V1 ())
return true;
if (image) {
ModuleEventData module_data;
memset (&module_data, 0, sizeof (module_data));
if (get_module_event_data (image, &module_data)) {
FireEtwModuleLoad_V2 (
module_data.module_id,
module_data.assembly_id,
module_data.module_flags,
module_data.reserved_flags,
module_data.module_il_path,
module_data.module_native_path,
clr_instance_get_id (),
module_data.module_il_pdb_signature,
module_data.module_il_pdb_age,
module_data.module_il_pdb_path,
module_data.module_native_pdb_signature,
module_data.module_native_pdb_age,
module_data.module_native_pdb_path,
NULL,
NULL);
FireEtwDomainModuleLoad_V1 (
module_data.module_id,
module_data.assembly_id,
module_data.domain_id,
module_data.module_flags,
module_data.reserved_flags,
module_data.module_il_path,
module_data.module_native_path,
clr_instance_get_id (),
NULL,
NULL);
}
}
return true;
}
static
bool
write_event_module_unload (MonoImage *image)
{
if (!EventEnabledModuleUnload_V2())
return true;
if (image) {
ModuleEventData module_data;
memset (&module_data, 0, sizeof (module_data));
if (get_module_event_data (image, &module_data)) {
FireEtwModuleUnload_V2 (
module_data.module_id,
module_data.assembly_id,
module_data.module_flags,
module_data.reserved_flags,
module_data.module_il_path,
module_data.module_native_path,
clr_instance_get_id (),
module_data.module_il_pdb_signature,
module_data.module_il_pdb_age,
module_data.module_il_pdb_path,
module_data.module_native_pdb_signature,
module_data.module_native_pdb_age,
module_data.module_native_pdb_path,
NULL,
NULL);
}
}
return true;
}
static
bool
get_assembly_event_data (
MonoAssembly *assembly,
AssemblyEventData *assembly_data)
{
if (assembly && assembly_data) {
// Under netcore we only have root domain.
MonoDomain *root_domain = mono_get_root_domain ();
assembly_data->domain_id = (uint64_t)root_domain;
assembly_data->assembly_id = (uint64_t)assembly;
assembly_data->binding_id = 0;
assembly_data->assembly_flags = 0;
if (assembly->dynamic)
assembly_data->assembly_flags |= ASSEMBLY_FLAGS_DYNAMIC_ASSEMBLY;
if (assembly->image && assembly->image->aot_module)
assembly_data->assembly_flags |= ASSEMBLY_FLAGS_NATIVE_ASSEMBLY;
assembly_data->assembly_name = mono_stringify_assembly_name (&assembly->aname);
}
return true;
}
static
bool
write_event_assembly_load (MonoAssembly *assembly)
{
if (!EventEnabledAssemblyLoad_V1 ())
return true;
if (assembly) {
AssemblyEventData assembly_data;
memset (&assembly_data, 0, sizeof (assembly_data));
if (get_assembly_event_data (assembly, &assembly_data)) {
FireEtwAssemblyLoad_V1 (
assembly_data.assembly_id,
assembly_data.domain_id,
assembly_data.binding_id,
assembly_data.assembly_flags,
assembly_data.assembly_name,
clr_instance_get_id (),
NULL,
NULL);
g_free (assembly_data.assembly_name);
}
}
return true;
}
static
bool
write_event_assembly_unload (MonoAssembly *assembly)
{
if (!EventEnabledAssemblyUnload_V1 ())
return true;
if (assembly) {
AssemblyEventData assembly_data;
memset (&assembly_data, 0, sizeof (assembly_data));
if (get_assembly_event_data (assembly, &assembly_data)) {
FireEtwAssemblyUnload_V1 (
assembly_data.assembly_id,
assembly_data.domain_id,
assembly_data.binding_id,
assembly_data.assembly_flags,
assembly_data.assembly_name,
clr_instance_get_id (),
NULL,
NULL);
g_free (assembly_data.assembly_name);
}
}
return true;
}
static
bool
write_event_thread_created (ep_rt_thread_id_t tid)
{
if (!EventEnabledThreadCreated ())
return true;
uint64_t managed_thread = 0;
uint32_t native_thread_id = MONO_NATIVE_THREAD_ID_TO_UINT (tid);
uint32_t managed_thread_id = 0;
uint32_t flags = 0;
MonoThread *thread = mono_thread_current ();
if (thread && mono_thread_info_get_tid (thread->thread_info) == tid) {
managed_thread_id = mono_thread_get_managed_id (thread);
managed_thread = (uint64_t)thread;
switch (mono_thread_info_get_flags (thread->thread_info)) {
case MONO_THREAD_INFO_FLAGS_NO_GC:
case MONO_THREAD_INFO_FLAGS_NO_SAMPLE:
flags |= THREAD_FLAGS_GC_SPECIAL;
}
if (mono_gc_is_finalizer_thread (thread))
flags |= THREAD_FLAGS_FINALIZER;
if (thread->threadpool_thread)
flags |= THREAD_FLAGS_THREADPOOL_WORKER;
}
FireEtwThreadCreated (
managed_thread,
(uint64_t)mono_get_root_domain (),
flags,
managed_thread_id,
native_thread_id,
clr_instance_get_id (),
NULL,
NULL);
return true;
}
static
bool
write_event_thread_terminated (ep_rt_thread_id_t tid)
{
if (!EventEnabledThreadTerminated ())
return true;
uint64_t managed_thread = 0;
MonoThread *thread = mono_thread_current ();
if (thread && mono_thread_info_get_tid (thread->thread_info) == tid)
managed_thread = (uint64_t)thread;
FireEtwThreadTerminated (
managed_thread,
(uint64_t)mono_get_root_domain (),
clr_instance_get_id (),
NULL,
NULL);
return true;
}
static
uint32_t
get_type_start_id (MonoType *type)
{
uint32_t start_id = (uint32_t)(uintptr_t)type;
start_id = (((start_id * 215497) >> 16) ^ ((start_id * 1823231) + start_id));
MONO_DISABLE_WARNING(4127) /* conditional expression is constant */
// Mix in highest bits on 64-bit systems only
if (sizeof (type) > 4)
start_id = start_id ^ GUINT64_TO_UINT32 ((((uint64_t)type >> 31) >> 1));
MONO_RESTORE_WARNING
return start_id;
}
static
bool
write_event_type_load_start (MonoType *type)
{
if (!EventEnabledTypeLoadStart ())
return true;
FireEtwTypeLoadStart (
get_type_start_id (type),
clr_instance_get_id (),
NULL,
NULL);
return true;
}
static
bool
write_event_type_load_stop (MonoType *type)
{
if (!EventEnabledTypeLoadStop ())
return true;
char *type_name = NULL;
if (type)
type_name = mono_type_get_name_full (type, MONO_TYPE_NAME_FORMAT_IL);
FireEtwTypeLoadStop (
get_type_start_id (type),
clr_instance_get_id (),
6 /* CLASS_LOADED */,
(uint64_t)type,
type_name,
NULL,
NULL);
g_free (type_name);
return true;
}
static
gboolean
get_exception_ip_func (
MonoStackFrameInfo *frame,
MonoContext *ctx,
void *data)
{
*(uintptr_t *)data = (uintptr_t)MONO_CONTEXT_GET_IP (ctx);
return TRUE;
}
static
bool
write_event_exception_thrown (MonoObject *obj)
{
if (!EventEnabledExceptionThrown_V1 ())
return true;
if (obj) {
ERROR_DECL (error);
char *type_name = NULL;
char *exception_message = NULL;
uint16_t flags = 0;
uint32_t hresult = 0;
uintptr_t ip = 0;
if (mono_object_isinst_checked ((MonoObject *) obj, mono_get_exception_class (), error)) {
MonoException *exception = (MonoException *)obj;
flags |= EXCEPTION_THROWN_FLAGS_IS_CLS_COMPLIANT;
if (exception->inner_ex)
flags |= EXCEPTION_THROWN_FLAGS_HAS_INNER;
if (exception->message)
exception_message = ep_rt_utf16_to_utf8_string_n (mono_string_chars_internal (exception->message), mono_string_length_internal (exception->message));
hresult = exception->hresult;
}
if (exception_message == NULL)
exception_message = g_strdup ("");
if (mono_get_eh_callbacks ()->mono_walk_stack_with_ctx)
mono_get_eh_callbacks ()->mono_walk_stack_with_ctx (get_exception_ip_func, NULL, MONO_UNWIND_SIGNAL_SAFE, (void *)&ip);
type_name = mono_type_get_name_full (m_class_get_byval_arg (mono_object_class (obj)), MONO_TYPE_NAME_FORMAT_IL);
FireEtwExceptionThrown_V1 (
type_name,
exception_message,
(void *)&ip,
hresult,
flags,
clr_instance_get_id (),
NULL,
NULL);
if (!mono_component_profiler_clauses_enabled ()) {
FireEtwExceptionThrownStop (
NULL,
NULL);
}
g_free (exception_message);
g_free (type_name);
mono_error_cleanup (error);
}
return true;
}
static
bool
write_event_exception_clause (
MonoMethod *method,
uint32_t clause_num,
MonoExceptionEnum clause_type,
MonoObject *obj)
{
if (!mono_component_profiler_clauses_enabled ())
return true;
if ((clause_type == MONO_EXCEPTION_CLAUSE_FAULT || clause_type == MONO_EXCEPTION_CLAUSE_NONE) && (!EventEnabledExceptionCatchStart() || !EventEnabledExceptionCatchStop()))
return true;
if (clause_type == MONO_EXCEPTION_CLAUSE_FILTER && (!EventEnabledExceptionFilterStart() || !EventEnabledExceptionFilterStop()))
return true;
if (clause_type == MONO_EXCEPTION_CLAUSE_FINALLY && (!EventEnabledExceptionFinallyStart() || !EventEnabledExceptionFinallyStop()))
return true;
uintptr_t ip = 0; //TODO: Have profiler pass along IP of handler block.
uint64_t method_id = (uint64_t)method;
char *method_name = NULL;
method_name = mono_method_get_name_full (method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL);
if ((clause_type == MONO_EXCEPTION_CLAUSE_FAULT || clause_type == MONO_EXCEPTION_CLAUSE_NONE)) {
FireEtwExceptionCatchStart (
(uint64_t)ip,
method_id,
(const ep_char8_t *)method_name,
clr_instance_get_id (),
NULL,
NULL);
FireEtwExceptionCatchStop (
NULL,
NULL);
FireEtwExceptionThrownStop (
NULL,
NULL);
}
if (clause_type == MONO_EXCEPTION_CLAUSE_FILTER) {
FireEtwExceptionFilterStart (
(uint64_t)ip,
method_id,
(const ep_char8_t *)method_name,
clr_instance_get_id (),
NULL,
NULL);
FireEtwExceptionFilterStop (
NULL,
NULL);
}
if (clause_type == MONO_EXCEPTION_CLAUSE_FINALLY) {
FireEtwExceptionFinallyStart (
(uint64_t)ip,
method_id,
(const ep_char8_t *)method_name,
clr_instance_get_id (),
NULL,
NULL);
FireEtwExceptionFinallyStop (
NULL,
NULL);
}
g_free (method_name);
return true;
}
static
bool
write_event_monitor_contention_start (MonoObject *obj)
{
if (!EventEnabledContentionStart_V1 ())
return true;
FireEtwContentionStart_V1 (
0 /* ManagedContention */,
clr_instance_get_id (),
NULL,
NULL);
return true;
}
static
bool
write_event_monitor_contention_stop (MonoObject *obj)
{
if (!EventEnabledContentionStop ())
return true;
FireEtwContentionStop (
0 /* ManagedContention */,
clr_instance_get_id (),
NULL,
NULL);
return true;
}
static
bool
write_event_method_jit_memory_allocated_for_code (
const uint8_t *buffer,
uint64_t size,
MonoProfilerCodeBufferType type,
const void *data)
{
if (!EventEnabledMethodJitMemoryAllocatedForCode ())
return true;
if (type != MONO_PROFILER_CODE_BUFFER_METHOD)
return true;
uint64_t method_id = 0;
uint64_t module_id = 0;
if (data) {
MonoMethod *method;
method = (MonoMethod *)data;
method_id = (uint64_t)method;
if (method->klass)
module_id = (uint64_t)(uint64_t)m_class_get_image (method->klass);
}
FireEtwMethodJitMemoryAllocatedForCode (
method_id,
module_id,
size,
0,
size,
0 /* CORJIT_ALLOCMEM_DEFAULT_CODE_ALIGN */,
clr_instance_get_id (),
NULL,
NULL);
return true;
}
bool
ep_rt_write_event_ee_startup_start (void)
{
return FireEtwEEStartupStart_V1 (
clr_instance_get_id (),
NULL,
NULL);
}
bool
ep_rt_write_event_threadpool_worker_thread_start (
uint32_t active_thread_count,
uint32_t retired_worker_thread_count,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolWorkerThreadStart (
active_thread_count,
retired_worker_thread_count,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_worker_thread_stop (
uint32_t active_thread_count,
uint32_t retired_worker_thread_count,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolWorkerThreadStop (
active_thread_count,
retired_worker_thread_count,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_worker_thread_wait (
uint32_t active_thread_count,
uint32_t retired_worker_thread_count,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolWorkerThreadWait (
active_thread_count,
retired_worker_thread_count,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_min_max_threads (
uint16_t min_worker_threads,
uint16_t max_worker_threads,
uint16_t min_io_completion_threads,
uint16_t max_io_completion_threads,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolMinMaxThreads (
min_worker_threads,
max_worker_threads,
min_io_completion_threads,
max_io_completion_threads,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_worker_thread_adjustment_sample (
double throughput,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolWorkerThreadAdjustmentSample (
throughput,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_worker_thread_adjustment_adjustment (
double average_throughput,
uint32_t networker_thread_count,
/*NativeRuntimeEventSource.ThreadAdjustmentReasonMap*/ int32_t reason,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolWorkerThreadAdjustmentAdjustment (
average_throughput,
networker_thread_count,
reason,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_worker_thread_adjustment_stats (
double duration,
double throughput,
double threadpool_worker_thread_wait,
double throughput_wave,
double throughput_error_estimate,
double average_throughput_error_estimate,
double throughput_ratio,
double confidence,
double new_control_setting,
uint16_t new_thread_wave_magnitude,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolWorkerThreadAdjustmentStats (
duration,
throughput,
threadpool_worker_thread_wait,
throughput_wave,
throughput_error_estimate,
average_throughput_error_estimate,
throughput_ratio,
confidence,
new_control_setting,
new_thread_wave_magnitude,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_io_enqueue (
intptr_t native_overlapped,
intptr_t overlapped,
bool multi_dequeues,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolIOEnqueue (
(const void *)native_overlapped,
(const void *)overlapped,
multi_dequeues,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_io_dequeue (
intptr_t native_overlapped,
intptr_t overlapped,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolIODequeue (
(const void *)native_overlapped,
(const void *)overlapped,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_working_thread_count (
uint16_t count,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolWorkingThreadCount (
count,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_threadpool_io_pack (
intptr_t native_overlapped,
intptr_t overlapped,
uint16_t clr_instance_id)
{
return FireEtwThreadPoolIOPack (
(const void *)native_overlapped,
(const void *)overlapped,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_contention_lock_created (
intptr_t lock_id,
intptr_t associated_object_id,
uint16_t clr_instance_id)
{
return FireEtwContentionLockCreated (
(const void *)lock_id,
(const void *)associated_object_id,
clr_instance_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_contention_start (
uint8_t contention_flags,
uint16_t clr_instance_id,
intptr_t lock_id,
intptr_t associated_object_id,
uint64_t lock_owner_thread_id)
{
return FireEtwContentionStart_V2 (
contention_flags,
clr_instance_id,
(const void *)lock_id,
(const void *)associated_object_id,
lock_owner_thread_id,
NULL,
NULL) == 0 ? true : false;
}
bool
ep_rt_write_event_contention_stop (
uint8_t contention_flags,
uint16_t clr_instance_id,
double duration_ns)
{
return FireEtwContentionStop_V1 (
contention_flags,
clr_instance_id,
duration_ns,
NULL,
NULL) == 0 ? true : false;
}
static
void
jit_begin_callback (
MonoProfiler *prof,
MonoMethod *method)
{
write_event_jit_start (method);
}
static
void
jit_failed_callback (
MonoProfiler *prof,
MonoMethod *method)
{
//TODO: CoreCLR doesn't have this case, so no failure event currently exists.
}
static
void
jit_done_callback (
MonoProfiler *prof,
MonoMethod *method,
MonoJitInfo *ji)
{
write_event_method_load (method, ji);
write_event_method_il_to_native_map (method, ji);
}
static
void
image_loaded_callback (
MonoProfiler *prof,
MonoImage *image)
{
if (image && image->heap_pdb.size == 0)
write_event_module_load (image);
}
static
void
image_unloaded_callback (
MonoProfiler *prof,
MonoImage *image)
{
if (image && image->heap_pdb.size == 0)
write_event_module_unload (image);
}
static
void
assembly_loaded_callback (
MonoProfiler *prof,
MonoAssembly *assembly)
{
write_event_assembly_load (assembly);
}
static
void
assembly_unloaded_callback (
MonoProfiler *prof,
MonoAssembly *assembly)
{
write_event_assembly_unload (assembly);
}
static
void
thread_started_callback (
MonoProfiler *prof,
uintptr_t tid)
{
write_event_thread_created (ep_rt_uint64_t_to_thread_id_t (tid));
}
static
void
thread_stopped_callback (
MonoProfiler *prof,
uintptr_t tid)
{
write_event_thread_terminated (ep_rt_uint64_t_to_thread_id_t (tid));
}
static
void
class_loading_callback (
MonoProfiler *prof,
MonoClass *klass)
{
bool prevent_profiler_event_recursion = FALSE;
EventPipeMonoThreadData *thread_data = ep_rt_mono_thread_data_get_or_create ();
if (thread_data) {
// Prevent additional class loading to happen recursively as part of fire TypeLoadStart event.
// Additional class loading can happen as part of capturing callstack for TypeLoadStart event.
prevent_profiler_event_recursion = thread_data->prevent_profiler_event_recursion;
thread_data->prevent_profiler_event_recursion = TRUE;
}
write_event_type_load_start (m_class_get_byval_arg (klass));
if (thread_data)
thread_data->prevent_profiler_event_recursion = prevent_profiler_event_recursion;
}
static
void
class_failed_callback (
MonoProfiler *prof,
MonoClass *klass)
{
write_event_type_load_stop (m_class_get_byval_arg (klass));
}
static
void
class_loaded_callback (
MonoProfiler *prof,
MonoClass *klass)
{
write_event_type_load_stop (m_class_get_byval_arg (klass));
}
static
void
exception_throw_callback (
MonoProfiler *prof,
MonoObject *exc)
{
write_event_exception_thrown (exc);
}
static
void
exception_clause_callback (
MonoProfiler *prof,
MonoMethod *method,
uint32_t clause_num,
MonoExceptionEnum clause_type,
MonoObject *exc)
{
write_event_exception_clause (method, clause_num, clause_type, exc);
}
static
void
monitor_contention_callback (
MonoProfiler *prof,
MonoObject *obj)
{
write_event_monitor_contention_start (obj);
}
static
void
monitor_acquired_callback (
MonoProfiler *prof,
MonoObject *obj)
{
write_event_monitor_contention_stop (obj);
}
static
void
monitor_failed_callback (
MonoProfiler *prof,
MonoObject *obj)
{
write_event_monitor_contention_stop (obj);
}
static
void
jit_code_buffer_callback (
MonoProfiler *prof,
const mono_byte *buffer,
uint64_t size,
MonoProfilerCodeBufferType type,
const void *data)
{
write_event_method_jit_memory_allocated_for_code ((const uint8_t *)buffer, size, type, data);
}
static
uint32_t
gc_heap_dump_requests_inc (void)
{
EP_ASSERT (ep_rt_mono_is_runtime_initialized ());
return ep_rt_atomic_inc_uint32_t (&_gc_heap_dump_requests);
}
static
uint32_t
gc_heap_dump_requests_dec (void)
{
EP_ASSERT (ep_rt_mono_is_runtime_initialized ());
return ep_rt_atomic_dec_uint32_t (&_gc_heap_dump_requests);
}
static
bool
gc_heap_dump_requested (void)
{
if (!ep_rt_mono_is_runtime_initialized ())
return false;
return ep_rt_volatile_load_uint32_t(&_gc_heap_dump_requests) != 0 ? true : false;
}
static
uint32_t
gc_heap_dump_count_inc (void)
{
EP_ASSERT (ep_rt_mono_is_runtime_initialized ());
return ep_rt_atomic_inc_uint32_t (&_gc_heap_dump_count);
}
static
bool
gc_heap_dump_mem_file_buffer_init (GCHeapDumpMemFileBuffer *file_buffer)
{
// Called on GC thread so no need to call MONO_ENTER_GC_SAFE/MONO_EXIT_GC_SAFE
// around IO functions.
EP_ASSERT (file_buffer);
file_buffer->fd = g_file_open_tmp ("mono_gc_heap_dump_XXXXXX", &file_buffer->name, NULL);
file_buffer->start = g_malloc (MAX_EVENT_BYTE_COUNT);
file_buffer->current = file_buffer->start;
file_buffer->end = file_buffer->start + MAX_EVENT_BYTE_COUNT;
return file_buffer->fd != -1 && file_buffer->start;
}
#ifndef g_close
#ifdef G_OS_WIN32
#define g_close _close
#else
#define g_close close
#endif
#endif
static
void
gc_heap_dump_mem_file_buffer_fini (GCHeapDumpMemFileBuffer *file_buffer)
{
// Called on GC thread so no need to call MONO_ENTER_GC_SAFE/MONO_EXIT_GC_SAFE
// around IO functions.
if (!file_buffer)
return;
if (file_buffer->fd != -1) {
g_close (file_buffer->fd);
if (file_buffer->name) {
g_unlink (file_buffer->name);
g_free (file_buffer->name);
}
g_free (file_buffer->start);
}
}
static
bool
gc_heap_dump_mem_file_buffer_write_all (
int fd,
const uint8_t *buffer,
size_t len)
{
// Called on GC thread (during GC) while holding GC locks,
// before/during/after STW so no need to MONO_ENTER_GC_SAFE/MONO_EXIT_GC_SAFE
// around async safe IO functions.
size_t offset = 0;
int nwritten;
do {
nwritten = g_write (fd, buffer + offset, GSIZE_TO_UINT32 (len - offset));
if (nwritten > 0)
offset += nwritten;
} while ((nwritten > 0 && offset < len) || (nwritten == -1 && errno == EINTR));
return nwritten == len;
}
static
bool
gc_heap_dump_mem_file_buffer_flush (GCHeapDumpMemFileBuffer *file_buffer)
{
EP_ASSERT (file_buffer);
EP_ASSERT (file_buffer->fd != -1);
EP_ASSERT (file_buffer->start);
bool result = true;
uint64_t size = (uint64_t)(file_buffer->current - file_buffer->start);
result &= gc_heap_dump_mem_file_buffer_write_all (file_buffer->fd, (const uint8_t *)&size, sizeof (size));
result &= gc_heap_dump_mem_file_buffer_write_all (file_buffer->fd, file_buffer->start, GUINT64_TO_SIZE (size));
file_buffer->current = file_buffer->start;
return result;
}
#ifndef g_lseek
#ifdef G_OS_WIN32
#define g_lseek _lseek
#else
#define g_lseek lseek
#endif
#endif
static
bool
gc_heap_dump_mem_file_buffer_reset_func (void *context)
{
// Called on GC thread (during GC) while holding GC locks,
// but after STW so no need to MONO_ENTER_GC_SAFE/MONO_EXIT_GC_SAFE
// around async safe IO functions.
EP_ASSERT (context);
bool result = true;
GCHeapDumpMemFileBuffer *file_buffer = (GCHeapDumpMemFileBuffer *)context;
EP_ASSERT (file_buffer->fd != -1);
result &= gc_heap_dump_mem_file_buffer_flush (file_buffer);
result &= g_lseek (file_buffer->fd, 0, SEEK_SET) != -1;
return result;
}
static
uint8_t *
gc_heap_dump_mem_file_buffer_alloc_func (
void *context,
size_t size)
{
EP_ASSERT (context);
GCHeapDumpMemFileBuffer *file_buffer = (GCHeapDumpMemFileBuffer *)context;
if (size > MAX_EVENT_BYTE_COUNT)
return NULL;
if (file_buffer->current + size >= file_buffer->end)
if (!gc_heap_dump_mem_file_buffer_flush (file_buffer))
return NULL;
uint8_t *result = file_buffer->current;
file_buffer->current = file_buffer->current + size;
return result;
}
static
bool
gc_heap_dump_mem_file_buffer_read (
int fd,
uint8_t *buffer,
size_t len)
{
// Called on GC thread (during GC) while holding GC locks,
// but after STW so no need to MONO_ENTER_GC_SAFE/MONO_EXIT_GC_SAFE
// around async safe IO functions.
size_t offset = 0;
int nread;
do {
nread = g_read (fd, buffer + offset, GSIZE_TO_UINT32 (len - offset));
if (nread > 0)
offset += nread;
} while ((nread > 0 && offset < len) || (nread == -1 && errno == EINTR));
return nread == len;
}
static
const uint8_t *
gc_heap_dump_mem_file_buffer_get_next_buffer_func (
void *context,
size_t *next_buffer_size)
{
EP_ASSERT (context);
GCHeapDumpMemFileBuffer *file_buffer = (GCHeapDumpMemFileBuffer *)context;
bool result = false;
uint64_t max_size = (uint64_t)(file_buffer->end - file_buffer->start);
uint64_t size = 0;
EP_ASSERT (file_buffer->fd != -1);
if (gc_heap_dump_mem_file_buffer_read (file_buffer->fd, (uint8_t *)&size, sizeof (size)))
if (size <= max_size)
result = gc_heap_dump_mem_file_buffer_read (file_buffer->fd, file_buffer->start, GUINT64_TO_SIZE (size));
file_buffer->current = file_buffer->start;
*next_buffer_size = GUINT64_TO_SIZE (size);
return result ? file_buffer->start : NULL;
}
static
GCHeapDumpBuffer *
gc_heap_dump_context_buffer_alloc (void)
{
GCHeapDumpMemFileBuffer *file_buffer = g_new0 (GCHeapDumpMemFileBuffer, 1);
GCHeapDumpBuffer *buffer = g_new0 (GCHeapDumpBuffer, 1);
buffer->context = file_buffer;
buffer->reset_func = gc_heap_dump_mem_file_buffer_reset_func;
buffer->alloc_func = gc_heap_dump_mem_file_buffer_alloc_func;
buffer->get_next_buffer_func = gc_heap_dump_mem_file_buffer_get_next_buffer_func;
if (!gc_heap_dump_mem_file_buffer_init (file_buffer)) {
gc_heap_dump_mem_file_buffer_fini (file_buffer);
buffer = NULL;
}
return buffer;
}
static
void
gc_heap_dump_context_buffer_free (GCHeapDumpBuffer *buffer)
{
if (!buffer)
return;
gc_heap_dump_mem_file_buffer_fini ((GCHeapDumpMemFileBuffer *)buffer->context);
g_free (buffer->context);
g_free (buffer);
}
static
bool
gc_heap_dump_context_alloc_bulk_data (
GCHeapDumpBulkData *data,
size_t len,
size_t count)
{
data->data_start = g_malloc (len);
data->data_current = data->data_start;
data->data_end = data->data_start + len;
data->max_count = GSIZE_TO_UINT32 (count);
data->index = 0;
data->count = 0;
return data->data_start;
}
static
void
gc_heap_dump_context_free_bulk_data (GCHeapDumpBulkData *data)
{
g_free (data->data_start);
}
static
void
gc_heap_dump_context_clear_bulk_data (GCHeapDumpBulkData *data)
{
if (data->data_start)
memset (data->data_start, 0, data->data_end - data->data_start);
data->data_current = data->data_start;
data->count = 0;
}
static
bool
gc_heap_dump_context_init (
GCHeapDumpContext *context,
EVENTPIPE_TRACE_CONTEXT trace_context,
uint32_t gc_reason,
uint32_t gc_type,
uint32_t gc_count,
uint32_t gc_depth)
{
EP_ASSERT (context);
bool result = true;
context->trace_context = trace_context;
context->gc_reason = gc_reason;
context->gc_type = gc_type;
context->gc_count = gc_count;
context->gc_depth = gc_depth;
context->retry_count = 0;
context->state = GC_HEAP_DUMP_CONTEXT_STATE_INIT;
if (is_gc_heap_dump_enabled (context)) {
context->bulk_type_logger = bulk_type_event_logger_alloc ();
context->buffer = gc_heap_dump_context_buffer_alloc ();
const size_t bulk_nodes_max_data_len = (MAX_EVENT_BYTE_COUNT - 0x100);
const size_t bulk_nodes_max_count = bulk_nodes_max_data_len / BULK_NODE_EVENT_TYPE_SIZE;
const size_t bulk_edges_max_data_len = (MAX_EVENT_BYTE_COUNT - 0x100);
const size_t bulk_edges_max_count = bulk_edges_max_data_len / BULK_EDGE_EVENT_TYPE_SIZE;
const size_t bulk_root_edges_max_data_len = (MAX_EVENT_BYTE_COUNT - 0x100);
const size_t bulk_root_edges_max_count = bulk_root_edges_max_data_len / BULK_ROOT_EDGE_EVENT_TYPE_SIZE;
const size_t bulk_root_cwt_elem_edges_max_data_len = (MAX_EVENT_BYTE_COUNT - 0x100);
const size_t bulk_root_cwt_elem_edges_max_count = bulk_root_cwt_elem_edges_max_data_len / BULK_ROOT_CWT_ELEM_EDGE_EVENT_TYPE_SIZE;
const size_t bulk_root_static_vars_max_data_len = (MAX_EVENT_BYTE_COUNT - 0x30);
const size_t bulk_root_static_vars_max_count = bulk_root_static_vars_max_data_len / BULK_ROOT_STATIC_VAR_EVENT_TYPE_SIZE;
gc_heap_dump_context_alloc_bulk_data (&context->bulk_nodes, bulk_nodes_max_data_len, bulk_nodes_max_count);
gc_heap_dump_context_alloc_bulk_data (&context->bulk_edges, bulk_edges_max_data_len, bulk_edges_max_count);
gc_heap_dump_context_alloc_bulk_data (&context->bulk_root_edges, bulk_root_edges_max_data_len, bulk_root_edges_max_count);
gc_heap_dump_context_alloc_bulk_data (&context->bulk_root_cwt_elem_edges, bulk_root_cwt_elem_edges_max_data_len, bulk_root_cwt_elem_edges_max_count);
gc_heap_dump_context_alloc_bulk_data (&context->bulk_root_static_vars, bulk_root_static_vars_max_data_len, bulk_root_static_vars_max_count);
result = context->bulk_type_logger &&
context->buffer &&
context->bulk_nodes.data_start &&
context->bulk_edges.data_start &&
context->bulk_root_edges.data_start &&
context->bulk_root_cwt_elem_edges.data_start &&
context->bulk_root_static_vars.data_start;
}
return result;
}
static
void
gc_heap_dump_context_fini (GCHeapDumpContext *context)
{
if (context) {
if (is_gc_heap_dump_enabled (context)) {
if (context->gc_roots)
dn_vector_ptr_free (context->gc_roots);
gc_heap_dump_context_free_bulk_data (&context->bulk_root_static_vars);
gc_heap_dump_context_free_bulk_data (&context->bulk_root_cwt_elem_edges);
gc_heap_dump_context_free_bulk_data (&context->bulk_root_edges);
gc_heap_dump_context_free_bulk_data (&context->bulk_edges);
gc_heap_dump_context_free_bulk_data (&context->bulk_nodes);
gc_heap_dump_context_buffer_free (context->buffer);
if (context->bulk_type_logger)
bulk_type_event_logger_free (context->bulk_type_logger);
}
memset (context, 0, sizeof (GCHeapDumpContext));
}
}
static
GCHeapDumpContext *
gc_heap_dump_context_alloc (
EVENTPIPE_TRACE_CONTEXT trace_context,
uint32_t gc_reason,
uint32_t gc_type,
uint32_t gc_count,
uint32_t gc_depth)
{
GCHeapDumpContext *context = g_new0 (GCHeapDumpContext, 1);
gc_heap_dump_context_init (
context,
trace_context,
gc_reason,
gc_type,
gc_count,
gc_depth);
return context;
}
static
void
gc_heap_dump_context_free (GCHeapDumpContext *context)
{
gc_heap_dump_context_fini (context);
g_free (context);
}
static
GCHeapDumpContext *
gc_heap_dump_context_get (void)
{
EventPipeMonoThreadData *thread_data = ep_rt_mono_thread_data_get_or_create ();
return thread_data ? thread_data->gc_heap_dump_context : NULL;
}
static
void
gc_heap_dump_context_set (GCHeapDumpContext *context)
{
EventPipeMonoThreadData *thread_data = ep_rt_mono_thread_data_get_or_create ();
if (thread_data) {
if (thread_data->gc_heap_dump_context)
gc_heap_dump_context_free (thread_data->gc_heap_dump_context);
thread_data->gc_heap_dump_context = context;
}
}
static
void
gc_heap_dump_context_reset (void)
{
gc_heap_dump_context_set (NULL);
}
static
int32_t
gc_roots_sort_compare_func (
const void *a,
const void *b)
{
EP_ASSERT (a && b);
GCRootData *root_a = *(GCRootData **)a;
GCRootData *root_b = *(GCRootData **)b;
EP_ASSERT (root_a && root_b);
if (root_a->start == root_b->start)
return 0;
return (root_a->start > root_b->start) ? 1 : -1;
}
static
void
gc_heap_dump_context_build_roots (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
ep_rt_spin_lock_requires_lock_not_held (&_gc_lock);
EP_SPIN_LOCK_ENTER (&_gc_lock, section1)
if (!context->gc_roots) {
dn_vector_ptr_custom_alloc_params_t params = { 0, };
params.capacity = dn_umap_size (&_gc_roots_table);
context->gc_roots = dn_vector_ptr_custom_alloc (¶ms);
} else {
dn_vector_ptr_clear (context->gc_roots);
}
DN_UMAP_FOREACH_BEGIN (const mono_byte *, key, GCRootData *, value, &_gc_roots_table) {
DN_UNREFERENCED_PARAMETER (key);
dn_vector_ptr_push_back (context->gc_roots, value);
} DN_UMAP_FOREACH_END;
EP_SPIN_LOCK_EXIT (&_gc_lock, section1)
dn_vector_ptr_sort (context->gc_roots, gc_roots_sort_compare_func);
ep_on_exit:
ep_rt_spin_lock_requires_lock_not_held (&_gc_lock);
return;
ep_on_error:
ep_exit_error_handler ();
}
static
GCRootData *
gc_heap_dump_context_find_root (
GCHeapDumpContext *context,
uintptr_t root)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
const uint8_t *base = (const uint8_t *)dn_vector_ptr_data (context->gc_roots);
const uint8_t *p;
size_t lim;
int32_t cmp;
for (lim = dn_vector_ptr_size (context->gc_roots); lim; lim >>= 1) {
p = base + ((lim >> 1) * dn_vector_ptr_element_size);
GCRootData *gc_root_data = *(GCRootData **)p;
EP_ASSERT (gc_root_data);
if (gc_root_data->start <= root && gc_root_data->end > root)
cmp = 0;
else
cmp = (root > gc_root_data->start) ? 1 : -1;
if (!cmp)
return *(GCRootData **)p;
else if (cmp > 0) {
base = p + dn_vector_ptr_element_size;
lim--;
}
}
return NULL;
}
static
void
gc_heap_dump_context_clear_nodes (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
gc_heap_dump_context_clear_bulk_data (&context->bulk_nodes);
}
static
void
gc_heap_dump_context_clear_edges (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
gc_heap_dump_context_clear_bulk_data (&context->bulk_edges);
}
static
void
gc_heap_dump_context_clear_root_edges (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
gc_heap_dump_context_clear_bulk_data (&context->bulk_root_edges);
}
static
void
gc_heap_dump_context_clear_root_cwt_elem_edges (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
gc_heap_dump_context_clear_bulk_data (&context->bulk_root_cwt_elem_edges);
}
static
void
gc_heap_dump_context_clear_root_static_vars (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
gc_heap_dump_context_clear_bulk_data (&context->bulk_root_static_vars);
}
static
void
flush_gc_event_bulk_nodes (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
if (!context->bulk_nodes.count)
return;
FireEtwGCBulkNode (
context->bulk_nodes.index,
context->bulk_nodes.count,
clr_instance_get_id (),
BULK_NODE_EVENT_TYPE_SIZE,
context->bulk_nodes.data_start,
NULL,
NULL);
context->bulk_nodes.index++;
gc_heap_dump_context_clear_nodes (context);
}
static
void
fire_gc_event_bulk_node (
GCHeapDumpContext *context,
uintptr_t address,
uint64_t size,
uintptr_t type,
uint64_t edge_count)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
bool update_previous_bulk_node = (size == 0 && context->bulk_nodes.count != 0);
if (update_previous_bulk_node)
context->bulk_nodes.count--;
if (context->bulk_nodes.count == context->bulk_nodes.max_count)
flush_gc_event_bulk_nodes (context);
// Mono profiler object reference callback might split bulk node
// into several calls if it contains more edges than internal buffer size.
// Mono profiler pass an object size of 0 to identify this case.
if (update_previous_bulk_node) {
context->bulk_nodes.data_current -= sizeof (edge_count);
uint64_t previous_edge_count;
memcpy (&previous_edge_count, context->bulk_nodes.data_current, sizeof (edge_count));
edge_count = GUINT64_FROM_LE (previous_edge_count) + edge_count;
ep_write_buffer_uint64_t (&context->bulk_nodes.data_current, edge_count);
} else {
uint64_t type_id = type;
MonoVTable *vtable = (MonoVTable *)type;
if (vtable && vtable->klass) {
MonoType *klass_type = m_class_get_byval_arg (vtable->klass);
bulk_type_log_type_and_parameters_if_necessary (context->bulk_type_logger, klass_type, TYPE_LOG_BEHAVIOR_IF_FIRST_TIME);
type_id = get_typeid_for_type (klass_type);
}
// NOTE, must match manifest GCBulkNode values type.
ep_write_buffer_uintptr_t (&context->bulk_nodes.data_current, address);
ep_write_buffer_uint64_t (&context->bulk_nodes.data_current, size);
ep_write_buffer_uint64_t (&context->bulk_nodes.data_current, type_id);
ep_write_buffer_uint64_t (&context->bulk_nodes.data_current, edge_count);
}
context->bulk_nodes.count++;
}
static
void
flush_gc_event_bulk_edges (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
if (!context->bulk_edges.count)
return;
FireEtwGCBulkEdge (
context->bulk_edges.index,
context->bulk_edges.count,
clr_instance_get_id (),
BULK_EDGE_EVENT_TYPE_SIZE,
context->bulk_edges.data_start,
NULL,
NULL);
context->bulk_edges.index++;
gc_heap_dump_context_clear_edges (context);
}
static
void
fire_gc_event_bulk_edge (
GCHeapDumpContext *context,
uintptr_t address,
uint32_t ref_field_id)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
if (context->bulk_edges.count == context->bulk_edges.max_count)
flush_gc_event_bulk_edges (context);
// NOTE, must match manifest GCBulkEdge values type.
ep_write_buffer_uintptr_t (&context->bulk_edges.data_current, address);
ep_write_buffer_uint32_t (&context->bulk_edges.data_current, ref_field_id);
context->bulk_edges.count++;
}
static
void
fire_gc_event_object_reference (
GCHeapDumpContext *context,
const uint8_t *data,
uint32_t payload_size)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
uintptr_t object_address;
uintptr_t object_type;
uint64_t object_size;
uint64_t edge_count;
EP_ASSERT (data + sizeof (object_address) <= data + payload_size);
memcpy (&object_address, data, sizeof (object_address));
data += sizeof (object_address);
EP_ASSERT (data + sizeof (object_size) <= data + payload_size);
memcpy (&object_size, data, sizeof (object_size));
data += sizeof (object_size);
EP_ASSERT (data + sizeof (object_type) <= data + payload_size);
memcpy (&object_type, data, sizeof (object_type));
data += sizeof (object_type);
EP_ASSERT (data + sizeof (edge_count) <= data + payload_size);
memcpy (&edge_count, data, sizeof (edge_count));
data += sizeof (edge_count);
fire_gc_event_bulk_node (
context,
object_address,
object_size,
object_type,
edge_count);
EP_ASSERT (data + (edge_count * sizeof (object_address)) <= data + payload_size);
for (uint32_t i = 0; i < edge_count; i++) {
memcpy (&object_address, data, sizeof (object_address));
data += sizeof (object_address);
fire_gc_event_bulk_edge (
context,
object_address,
0);
}
}
static
int
buffer_gc_event_object_reference_callback (
MonoObject *obj,
MonoClass *klass,
uintptr_t size,
uintptr_t num,
MonoObject **refs,
uintptr_t *offsets,
void *data)
{
if (!data)
return 1;
GCHeapDumpContext *context = (GCHeapDumpContext *)data;
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
uintptr_t object_address = (uintptr_t)SGEN_POINTER_UNTAG_ALL (obj);
uintptr_t object_type = (uintptr_t)SGEN_POINTER_UNTAG_ALL (mono_object_get_vtable_internal (obj));
uint64_t object_size = (uint64_t)size;
uint64_t edge_count = (uint64_t)num;
/* account for object alignment */
object_size += 7;
object_size &= ~7;
BufferedGCEvent gc_event_data;
gc_event_data.type = BUFFERED_GC_EVENT_OBJECT_REF;
gc_event_data.payload_size =
sizeof (object_address) +
sizeof (object_size) +
sizeof (object_type) +
sizeof (edge_count) +
(edge_count * sizeof (uintptr_t));
EP_ASSERT (context->buffer);
EP_ASSERT (context->buffer->context);
uint8_t *buffer = context->buffer->alloc_func (context->buffer->context, sizeof (gc_event_data) + gc_event_data.payload_size);
if (buffer) {
memcpy (buffer, &gc_event_data, sizeof (gc_event_data));
buffer += sizeof (gc_event_data);
memcpy (buffer, &object_address, sizeof (object_address));
buffer += sizeof (object_address);
memcpy (buffer, &object_size, sizeof (object_size));
buffer += sizeof (object_size);
memcpy (buffer, &object_type, sizeof (object_type));
buffer += sizeof (object_type);
memcpy (buffer, &edge_count, sizeof (edge_count));
buffer += sizeof (edge_count);
for (uint64_t i = 0; i < edge_count; i++) {
object_address = (uintptr_t)SGEN_POINTER_UNTAG_ALL (refs [i]);
memcpy (buffer, &object_address, sizeof (object_address));
buffer += sizeof (object_address);
}
}
return 0;
}
static
void
flush_gc_event_bulk_root_static_vars (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
if (!context->bulk_root_static_vars.count)
return;
FireEtwGCBulkRootStaticVar (
context->bulk_root_static_vars.count,
(uint64_t)mono_get_root_domain (),
clr_instance_get_id (),
context->bulk_root_static_vars.data_current - context->bulk_root_static_vars.data_start,
context->bulk_root_static_vars.data_start,
NULL,
NULL);
context->bulk_root_static_vars.index++;
gc_heap_dump_context_clear_root_static_vars (context);
}
static
void
fire_gc_event_bulk_root_static_var (
GCHeapDumpContext *context,
GCRootData *root_data,
uintptr_t address,
uintptr_t object)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
EP_ASSERT (root_data);
EP_ASSERT (root_data->source == MONO_ROOT_SOURCE_STATIC);
MonoVTable *vtable = (MonoVTable *)(root_data->key);
uint32_t static_var_flags = 0;
uint64_t type_id = (uint64_t)vtable;
const ep_char8_t *static_var_name = "?";
if (vtable && vtable->klass) {
ERROR_DECL (error);
gpointer iter = NULL;
MonoClassField *field;
uint32_t offset = GPTRDIFF_TO_UINT32 (address - root_data->start);
while ((field = mono_class_get_fields_internal (vtable->klass, &iter))) {
if (mono_field_get_flags (field) & FIELD_ATTRIBUTE_LITERAL)
continue;
if (!(mono_field_get_flags (field) & FIELD_ATTRIBUTE_STATIC))
continue;
if (mono_field_is_deleted (field) || m_field_is_from_update (field))
continue;
if (mono_field_get_offset (field) == offset) {
static_var_name = mono_field_get_name (field);
break;
}
}
if (!is_ok (error))
mono_error_cleanup (error);
error_init_reuse (error);
}
size_t name_len = static_var_name && static_var_name [0] != '\0'
? strlen (static_var_name)
: 0;
size_t event_size = BULK_ROOT_STATIC_VAR_EVENT_TYPE_SIZE + ((name_len +1) * sizeof (ep_char16_t));
if (context->bulk_root_static_vars.data_end <= context->bulk_root_static_vars.data_current + event_size)
flush_gc_event_bulk_root_static_vars (context);
if (context->bulk_root_static_vars.data_end <= context->bulk_root_static_vars.data_current + event_size)
return;
if (vtable && vtable->klass) {
MonoType *klass_type = m_class_get_byval_arg (vtable->klass);
bulk_type_log_type_and_parameters_if_necessary (context->bulk_type_logger, klass_type, TYPE_LOG_BEHAVIOR_IF_FIRST_TIME);
type_id = get_typeid_for_type (klass_type);
}
// NOTE, needs to match manifest GCBulkRootStaticVar values type.
ep_write_buffer_uint64_t (&context->bulk_root_static_vars.data_current, (uint64_t)address);
ep_write_buffer_uint64_t (&context->bulk_root_static_vars.data_current, (uint64_t)object);
ep_write_buffer_uint64_t (&context->bulk_root_static_vars.data_current, type_id);
ep_write_buffer_uint32_t (&context->bulk_root_static_vars.data_current, static_var_flags);
write_buffer_string_utf8_to_utf16_t (&context->bulk_root_static_vars.data_current, static_var_name, GSIZE_TO_UINT32 (name_len));
context->bulk_root_static_vars.count++;
}
static
void
flush_gc_event_bulk_root_edges (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
if (!context->bulk_root_edges.count)
return;
FireEtwGCBulkRootEdge (
context->bulk_root_edges.index,
context->bulk_root_edges.count,
clr_instance_get_id (),
BULK_ROOT_EDGE_EVENT_TYPE_SIZE,
context->bulk_root_edges.data_start,
NULL,
NULL);
context->bulk_root_edges.index++;
gc_heap_dump_context_clear_root_edges (context);
}
static
void
flush_gc_event_bulk_root_cwt_elem_edges (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
if (!context->bulk_root_cwt_elem_edges.count)
return;
FireEtwGCBulkRootConditionalWeakTableElementEdge (
context->bulk_root_cwt_elem_edges.index,
context->bulk_root_cwt_elem_edges.count,
clr_instance_get_id (),
BULK_ROOT_CWT_ELEM_EDGE_EVENT_TYPE_SIZE,
context->bulk_root_cwt_elem_edges.data_start,
NULL,
NULL);
context->bulk_root_cwt_elem_edges.index++;
gc_heap_dump_context_clear_root_cwt_elem_edges (context);
}
static
void
fire_gc_event_bulk_root_cwt_elem_edge (
GCHeapDumpContext *context,
uintptr_t address,
uintptr_t key,
uintptr_t value)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
if (context->bulk_root_cwt_elem_edges.count == context->bulk_root_cwt_elem_edges.max_count)
flush_gc_event_bulk_root_cwt_elem_edges (context);
// NOTE, must match manifest GCBulkRootConditionalWeakTableElementEdge values type.
ep_write_buffer_uintptr_t (&context->bulk_root_cwt_elem_edges.data_current, key);
ep_write_buffer_uintptr_t (&context->bulk_root_cwt_elem_edges.data_current, value);
ep_write_buffer_uintptr_t (&context->bulk_root_cwt_elem_edges.data_current, address);
context->bulk_root_cwt_elem_edges.count++;
}
static
void
fire_gc_event_bulk_root_edge (
GCHeapDumpContext *context,
uintptr_t address,
uintptr_t object)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
if (context->bulk_root_edges.count == context->bulk_root_edges.max_count)
flush_gc_event_bulk_root_edges (context);
uint8_t root_kind = GC_ROOT_KIND_OTHER;
uint32_t root_flags = GC_ROOT_FLAGS_NONE;
uintptr_t root_id = 0;
GCRootData *gc_root = gc_heap_dump_context_find_root (context, address);
if (gc_root) {
if (gc_root->source == MONO_ROOT_SOURCE_STATIC) {
fire_gc_event_bulk_root_static_var (
context,
gc_root,
address,
object);
return;
}
if (gc_root->source == MONO_ROOT_SOURCE_EPHEMERON) {
// Should be ephemeron key, but current profiler
// API won't report it and key is only validated
// to be none 0 and a aligned pointer by gcdump.
// Use object as key until we get key reported
// in gc_roots profiler callback.
uintptr_t key = object;
uintptr_t value = object;
fire_gc_event_bulk_root_cwt_elem_edge (
context,
root_id,
key,
value);
return;
}
switch (gc_root->source) {
case MONO_ROOT_SOURCE_STACK :
root_kind = GC_ROOT_KIND_STACK;
root_id = address;
break;
case MONO_ROOT_SOURCE_FINALIZER_QUEUE :
root_kind = GC_ROOT_KIND_FINALIZER;
break;
case MONO_ROOT_SOURCE_THREAD_STATIC :
root_kind = GC_ROOT_KIND_HANDLE;
root_id = address;
break;
case MONO_ROOT_SOURCE_GC_HANDLE :
root_kind = GC_ROOT_KIND_HANDLE;
root_flags = GPOINTER_TO_INT (gc_root->key) != 0 ? GC_ROOT_FLAGS_PINNING : GC_ROOT_FLAGS_NONE;
root_id = address;
break;
case MONO_ROOT_SOURCE_HANDLE :
root_kind = GC_ROOT_KIND_HANDLE;
root_id = address;
break;
case MONO_ROOT_SOURCE_TOGGLEREF :
root_kind = GC_ROOT_KIND_HANDLE;
root_flags = GC_ROOT_FLAGS_REFCOUNTED;
root_id = address;
break;
default :
break;
}
}
// NOTE, needs to match manifest GCBulkRootEdge values type.
ep_write_buffer_uintptr_t (&context->bulk_root_edges.data_current, object);
ep_write_buffer_uint8_t (&context->bulk_root_edges.data_current, root_kind);
ep_write_buffer_uint32_t (&context->bulk_root_edges.data_current, root_flags);
ep_write_buffer_uintptr_t (&context->bulk_root_edges.data_current, root_id);
context->bulk_root_edges.count++;
}
static
void
fire_gc_event_roots (
GCHeapDumpContext *context,
const uint8_t *data,
uint32_t payload_size)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
uint64_t count;
uintptr_t address;
uintptr_t object;
EP_ASSERT (data + sizeof (count) <= data + payload_size);
memcpy (&count, data, sizeof (count));
data += sizeof (count);
EP_ASSERT (data + (count * (sizeof (address) + sizeof (object))) <= data + payload_size);
for (uint32_t i = 0; i < count; i++) {
memcpy (&address, data, sizeof (address));
data += sizeof (address);
memcpy (&object, data, sizeof (object));
data += sizeof (object);
fire_gc_event_bulk_root_edge (
context,
address,
object);
}
}
static
void
buffer_gc_event_roots_callback (
MonoProfiler *prof,
uint64_t count,
const mono_byte *const * addresses,
MonoObject *const * objects)
{
GCHeapDumpContext *context = gc_heap_dump_context_get ();
if (!context)
return;
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
BufferedGCEvent gc_event_data;
gc_event_data.type = BUFFERED_GC_EVENT_ROOTS;
gc_event_data.payload_size =
(uint32_t)(sizeof (count) +
(count * (sizeof (uintptr_t) + sizeof (uintptr_t) + sizeof (uintptr_t))));
EP_ASSERT (context->buffer);
EP_ASSERT (context->buffer->context);
uint8_t *buffer = context->buffer->alloc_func (context->buffer->context, sizeof (gc_event_data) + gc_event_data.payload_size);
if (buffer) {
memcpy (buffer, &gc_event_data, sizeof (gc_event_data));
buffer += sizeof (gc_event_data);
memcpy (buffer, &count, sizeof (count));
buffer += sizeof (count);
for (uint64_t i = 0; i < count; i++) {
uintptr_t address = (uintptr_t)addresses [i];
uintptr_t object = (uintptr_t)SGEN_POINTER_UNTAG_ALL (objects [i]);
memcpy (buffer, &address, sizeof (address));
buffer += sizeof (address);
memcpy (buffer, &object, sizeof (object));
buffer += sizeof (object);
}
}
}
static
void
flush_gc_events (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
flush_gc_event_bulk_nodes (context);
flush_gc_event_bulk_edges (context);
flush_gc_event_bulk_root_edges (context);
flush_gc_event_bulk_root_cwt_elem_edges (context);
flush_gc_event_bulk_root_static_vars (context);
if (context->bulk_type_logger && is_keyword_and_level_enabled (&context->trace_context, EP_EVENT_LEVEL_INFORMATIONAL, TYPE_KEYWORD))
bulk_type_fire_bulk_type_event (context->bulk_type_logger);
}
static
void
fire_buffered_gc_events (GCHeapDumpContext *context)
{
EP_ASSERT (is_gc_heap_dump_enabled (context));
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
if (context->buffer) {
const uint8_t *buffer = NULL;
const uint8_t *buffer_end = NULL;
size_t size = 0;
context->buffer->reset_func (context->buffer->context);
while ((buffer = context->buffer->get_next_buffer_func (context->buffer->context, &size))) {
buffer_end = buffer + size;
while (buffer < buffer_end) {
if (buffer + sizeof (BufferedGCEvent) > buffer_end)
break;
BufferedGCEvent *gc_event = (BufferedGCEvent *)buffer;
buffer += sizeof (BufferedGCEvent);
if (buffer + gc_event->payload_size > buffer_end)
break;
switch (gc_event->type) {
case BUFFERED_GC_EVENT_OBJECT_REF :
fire_gc_event_object_reference (context, buffer, gc_event->payload_size);
break;
case BUFFERED_GC_EVENT_ROOTS :
fire_gc_event_roots (context, buffer, gc_event->payload_size);
break;
default:
EP_ASSERT (!"Unknown buffered GC event type.");
}
buffer += gc_event->payload_size;
}
}
flush_gc_events (context);
}
}
static
void
calculate_live_keywords (
uint64_t *live_keywords,
bool *trigger_heap_dump)
{
uint64_t keywords[] = { GC_HEAP_COLLECT_KEYWORD };
uint64_t count[] = { 0 };
ep_requires_lock_held ();
EP_ASSERT (G_N_ELEMENTS (keywords) == G_N_ELEMENTS (count));
*live_keywords = ep_rt_mono_session_calculate_and_count_all_keywords (
ep_config_get_public_provider_name_utf8 (),
keywords,
count,
G_N_ELEMENTS (count));
*trigger_heap_dump = ep_rt_mono_is_runtime_initialized ();
*trigger_heap_dump &= is_keword_enabled (*live_keywords, GC_KEYWORD);
*trigger_heap_dump &= is_keword_enabled (*live_keywords, GC_HEAP_COLLECT_KEYWORD);
*trigger_heap_dump &= count [0] > _gc_heap_dump_trigger_count;
_gc_heap_dump_trigger_count = count [0];
ep_requires_lock_held ();
}
// TODO: If/when we can unload vtables, we would need to temporary
// root the vtable pointers currently stored in buffered gc events.
// Once all events are fired, we can remove root from GC.
static
void
gc_event_callback (
MonoProfiler *prof,
MonoProfilerGCEvent gc_event,
uint32_t generation,
mono_bool serial)
{
switch (gc_event) {
case MONO_GC_EVENT_POST_STOP_WORLD:
{
GCHeapDumpContext *context = gc_heap_dump_context_get ();
if (is_gc_heap_dump_enabled (context)) {
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
mono_profiler_set_gc_roots_callback (_ep_rt_mono_default_profiler_provider, buffer_gc_event_roots_callback);
}
break;
}
case MONO_GC_EVENT_PRE_START_WORLD:
{
GCHeapDumpContext *context = gc_heap_dump_context_get ();
if (is_gc_heap_dump_enabled (context)) {
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
mono_gc_walk_heap (0, buffer_gc_event_object_reference_callback, context);
mono_profiler_set_gc_roots_callback (_ep_rt_mono_default_profiler_provider, NULL);
}
break;
}
case MONO_GC_EVENT_POST_START_WORLD:
{
GCHeapDumpContext *context = gc_heap_dump_context_get ();
if (is_gc_heap_dump_enabled (context)) {
EP_ASSERT (context->state == GC_HEAP_DUMP_CONTEXT_STATE_DUMP);
gc_heap_dump_context_build_roots (context);
}
break;
}
default:
break;
}
}
static
void
gc_heap_dump_trigger_callback (MonoProfiler *prof)
{
bool notify_finalizer = false;
GCHeapDumpContext *heap_dump_context = gc_heap_dump_context_get ();
if (!heap_dump_context && gc_heap_dump_requested ()) {
EP_LOCK_ENTER (section1)
if (gc_heap_dump_requested ()) {
EVENTPIPE_TRACE_CONTEXT context = RUNTIME_PROVIDER_CONTEXT;
if (!dn_vector_empty (&_gc_heap_dump_requests_data)) {
context = *dn_vector_back_t (&_gc_heap_dump_requests_data, EVENTPIPE_TRACE_CONTEXT);
dn_vector_pop_back (&_gc_heap_dump_requests_data);
}
gc_heap_dump_requests_dec ();
uint32_t gc_count = gc_heap_dump_count_inc ();
uint32_t gc_depth = mono_gc_max_generation () + 1;
uint32_t gc_reason = GC_REASON_INDUCED;
uint32_t gc_type = GC_TYPE_NGC;
heap_dump_context =
gc_heap_dump_context_alloc (
context,
gc_reason,
gc_type,
gc_count,
gc_depth);
gc_heap_dump_context_set (heap_dump_context);
}
EP_LOCK_EXIT (section1)
}
if (heap_dump_context) {
switch (heap_dump_context->state) {
case GC_HEAP_DUMP_CONTEXT_STATE_INIT :
{
bool all_started = false;
EP_LOCK_ENTER (section2)
all_started = ep_rt_mono_sesion_has_all_started ();
EP_LOCK_EXIT (section2)
if (!all_started && heap_dump_context->retry_count < 5) {
heap_dump_context->retry_count++;
notify_finalizer = true;
break;
}
heap_dump_context->state = GC_HEAP_DUMP_CONTEXT_STATE_START;
// Fallthrough
}
case GC_HEAP_DUMP_CONTEXT_STATE_START :
{
FireEtwGCStart_V2 (
heap_dump_context->gc_count,
heap_dump_context->gc_depth,
heap_dump_context->gc_reason,
heap_dump_context->gc_type,
clr_instance_get_id (),
0,
NULL,
NULL);
heap_dump_context->state = GC_HEAP_DUMP_CONTEXT_STATE_DUMP;
notify_finalizer = true;
break;
}
case GC_HEAP_DUMP_CONTEXT_STATE_DUMP :
{
bool gc_dump = true;
gc_dump &= EventPipeEventEnabledGCBulkNode ();
gc_dump &= EventPipeEventEnabledGCBulkEdge ();
gc_dump &= EventPipeEventEnabledGCBulkRootEdge ();
gc_dump &= EventPipeEventEnabledGCBulkRootStaticVar ();
if (gc_dump) {
mono_profiler_set_gc_event_callback (_ep_rt_mono_default_profiler_provider, gc_event_callback);
mono_gc_collect (mono_gc_max_generation ());
mono_profiler_set_gc_event_callback (_ep_rt_mono_default_profiler_provider, NULL);
fire_buffered_gc_events (heap_dump_context);
}
heap_dump_context->state = GC_HEAP_DUMP_CONTEXT_STATE_END;
notify_finalizer = true;
break;
}
case GC_HEAP_DUMP_CONTEXT_STATE_END :
{
FireEtwGCEnd_V1 (
heap_dump_context->gc_count,
heap_dump_context->gc_depth,
clr_instance_get_id (),
NULL,
NULL);
gc_heap_dump_context_reset ();
heap_dump_context = NULL;
break;
}
default :
g_assert_not_reached ();
}
}
if (!heap_dump_context) {
EP_LOCK_ENTER (section3)
bool gc_enabled = is_keword_enabled(RUNTIME_PROVIDER_CONTEXT.EnabledKeywordsBitmask, GC_KEYWORD);
bool gc_dump_enabled = is_keword_enabled(RUNTIME_PROVIDER_CONTEXT.EnabledKeywordsBitmask, GC_HEAP_COLLECT_KEYWORD);
if (!(gc_enabled && gc_dump_enabled))
mono_profiler_set_gc_finalized_callback (_ep_rt_mono_default_profiler_provider, NULL);
EP_LOCK_EXIT (section3)
}
if (notify_finalizer) {
ep_rt_thread_sleep (200 * NUM_NANOSECONDS_IN_1_MS);
mono_gc_finalize_notify ();
}
ep_on_exit:
ep_rt_config_requires_lock_not_held ();
return;
ep_on_error:
ep_exit_error_handler ();
}
void
EP_CALLBACK_CALLTYPE
EventPipeEtwCallbackDotNETRuntime (
const uint8_t *source_id,
unsigned long is_enabled,
uint8_t level,
uint64_t match_any_keywords,
uint64_t match_all_keywords,
EventFilterDescriptor *filter_data,
void *callback_data)
{
ep_rt_config_requires_lock_not_held ();
EP_ASSERT (_ep_rt_mono_default_profiler_provider != NULL);
EP_LOCK_ENTER (section1)
uint64_t live_keywords = 0;
bool trigger_heap_dump = false;
calculate_live_keywords (&live_keywords, &trigger_heap_dump);
if (is_keword_enabled(live_keywords, JIT_KEYWORD)) {
mono_profiler_set_jit_begin_callback (_ep_rt_mono_default_profiler_provider, jit_begin_callback);
mono_profiler_set_jit_failed_callback (_ep_rt_mono_default_profiler_provider, jit_failed_callback);
mono_profiler_set_jit_done_callback (_ep_rt_mono_default_profiler_provider, jit_done_callback);
} else {
mono_profiler_set_jit_begin_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_jit_failed_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_jit_done_callback (_ep_rt_mono_default_profiler_provider, NULL);
}
if (is_keword_enabled(live_keywords, LOADER_KEYWORD)) {
mono_profiler_set_image_loaded_callback (_ep_rt_mono_default_profiler_provider, image_loaded_callback);
mono_profiler_set_image_unloaded_callback (_ep_rt_mono_default_profiler_provider, image_unloaded_callback);
mono_profiler_set_assembly_loaded_callback (_ep_rt_mono_default_profiler_provider, assembly_loaded_callback);
mono_profiler_set_assembly_unloaded_callback (_ep_rt_mono_default_profiler_provider, assembly_unloaded_callback);
} else {
mono_profiler_set_image_loaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_image_unloaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_assembly_loaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_assembly_unloaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
}
if (is_keword_enabled(live_keywords, TYPE_DIAGNOSTIC_KEYWORD)) {
mono_profiler_set_class_loading_callback (_ep_rt_mono_default_profiler_provider, class_loading_callback);
mono_profiler_set_class_failed_callback (_ep_rt_mono_default_profiler_provider, class_failed_callback);
mono_profiler_set_class_loaded_callback (_ep_rt_mono_default_profiler_provider, class_loaded_callback);
} else {
mono_profiler_set_class_loading_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_class_failed_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_class_loaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
}
if (is_keword_enabled(live_keywords, EXCEPTION_KEYWORD)) {
mono_profiler_set_exception_throw_callback (_ep_rt_mono_default_profiler_provider, exception_throw_callback);
mono_profiler_set_exception_clause_callback (_ep_rt_mono_default_profiler_provider, exception_clause_callback);
} else {
mono_profiler_set_exception_throw_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_exception_clause_callback (_ep_rt_mono_default_profiler_provider, NULL);
}
if (is_keword_enabled(live_keywords, CONTENTION_KEYWORD)) {
mono_profiler_set_monitor_contention_callback (_ep_rt_mono_default_profiler_provider, monitor_contention_callback);
mono_profiler_set_monitor_acquired_callback (_ep_rt_mono_default_profiler_provider, monitor_acquired_callback);
mono_profiler_set_monitor_failed_callback (_ep_rt_mono_default_profiler_provider, monitor_failed_callback);
} else {
mono_profiler_set_monitor_contention_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_monitor_acquired_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_monitor_failed_callback (_ep_rt_mono_default_profiler_provider, NULL);
}
// Disabled in gc_heap_dump_trigger_callback when no longer needed.
if (is_keword_enabled(live_keywords, GC_KEYWORD) && is_keword_enabled(live_keywords, GC_HEAP_COLLECT_KEYWORD))
mono_profiler_set_gc_finalized_callback (_ep_rt_mono_default_profiler_provider, gc_heap_dump_trigger_callback);
RUNTIME_PROVIDER_CONTEXT.Level = level;
RUNTIME_PROVIDER_CONTEXT.EnabledKeywordsBitmask = live_keywords;
RUNTIME_PROVIDER_CONTEXT.IsEnabled = (live_keywords != 0 ? true : false);
if (trigger_heap_dump) {
EP_ASSERT (ep_rt_mono_is_runtime_initialized ());
dn_vector_push_back (&_gc_heap_dump_requests_data, RUNTIME_PROVIDER_CONTEXT);
gc_heap_dump_requests_inc ();
mono_gc_finalize_notify ();
}
EP_LOCK_EXIT (section1)
ep_on_exit:
ep_rt_config_requires_lock_not_held ();
return;
ep_on_error:
ep_exit_error_handler ();
}
static
GCRootData *
gc_root_data_alloc (
uintptr_t start,
uintptr_t size,
MonoGCRootSource source,
const void *key,
const char *name)
{
GCRootData *root_data = g_new0 (GCRootData, 1);
root_data->start = start;
root_data->end = start + size;
root_data->key = key;
//root_data->name = g_strdup (name);
root_data->source = source;
return root_data;
}
static
void
gc_root_data_free (void *data)
{
GCRootData *root_data = (GCRootData *)data;
if (root_data) {
g_free (root_data->name);
g_free (root_data);
}
}
static
void
gc_root_register_callback (
MonoProfiler *prof,
const mono_byte *start,
uintptr_t size,
MonoGCRootSource source,
const void *key,
const char *name)
{
ep_rt_spin_lock_requires_lock_not_held (&_gc_lock);
GCRootData *root_data = gc_root_data_alloc ((uintptr_t)start, size, source, key, name);
EP_SPIN_LOCK_ENTER (&_gc_lock, section1)
dn_umap_insert_or_assign (&_gc_roots_table, (void *)start, root_data);
EP_SPIN_LOCK_EXIT (&_gc_lock, section1)
ep_on_exit:
ep_rt_spin_lock_requires_lock_not_held (&_gc_lock);
return;
ep_on_error:
ep_exit_error_handler ();
}
static
void
gc_root_unregister_callback (
MonoProfiler *prof,
const mono_byte *start)
{
ep_rt_spin_lock_requires_lock_not_held (&_gc_lock);
GCRootData *root_data = NULL;
EP_SPIN_LOCK_ENTER (&_gc_lock, section1)
dn_umap_extract_key (&_gc_roots_table, start, NULL, (void **)&root_data);
EP_SPIN_LOCK_EXIT (&_gc_lock, section1)
g_free (root_data);
ep_on_exit:
ep_rt_spin_lock_requires_lock_not_held (&_gc_lock);
return;
ep_on_error:
ep_exit_error_handler ();
}
void
ep_rt_mono_runtime_provider_component_init (void)
{
ep_rt_spin_lock_alloc (&_gc_lock);
dn_umap_custom_init_params_t params = {0,};
params.value_dispose_func = gc_root_data_free;
dn_umap_custom_init (&_gc_roots_table, ¶ms);
dn_vector_init_t (&_gc_heap_dump_requests_data, EVENTPIPE_TRACE_CONTEXT);
EP_ASSERT (_ep_rt_mono_default_profiler_provider != NULL);
mono_profiler_set_gc_root_register_callback (_ep_rt_mono_default_profiler_provider, gc_root_register_callback);
mono_profiler_set_gc_root_unregister_callback (_ep_rt_mono_default_profiler_provider, gc_root_unregister_callback);
}
void
ep_rt_mono_runtime_provider_init (void)
{
MonoMethodSignature *method_signature = mono_metadata_signature_alloc (mono_get_corlib (), 1);
if (method_signature) {
method_signature->params[0] = m_class_get_byval_arg (mono_get_object_class());
method_signature->ret = m_class_get_byval_arg (mono_get_void_class());
ERROR_DECL (error);
MonoClass *runtime_helpers = mono_class_from_name_checked (mono_get_corlib (), "System.Runtime.CompilerServices", "RuntimeHelpers", error);
if (is_ok (error) && runtime_helpers) {
MonoMethodBuilder *method_builder = mono_mb_new (runtime_helpers, "CompileMethod", MONO_WRAPPER_RUNTIME_INVOKE);
if (method_builder) {
_runtime_helper_compile_method = mono_mb_create_method (method_builder, method_signature, 1);
mono_mb_free (method_builder);
}
}
mono_error_cleanup (error);
mono_metadata_free_method_signature (method_signature);
if (_runtime_helper_compile_method) {
_runtime_helper_compile_method_jitinfo = (MonoJitInfo *)g_new0 (MonoJitInfo, 1);
if (_runtime_helper_compile_method) {
_runtime_helper_compile_method_jitinfo->code_start = MINI_FTNPTR_TO_ADDR (_runtime_helper_compile_method);
_runtime_helper_compile_method_jitinfo->code_size = 20;
_runtime_helper_compile_method_jitinfo->d.method = _runtime_helper_compile_method;
}
}
}
{
ERROR_DECL (error);
MonoMethodDesc *desc = NULL;
MonoClass *monitor = mono_class_from_name_checked (mono_get_corlib (), "System.Threading", "Monitor", error);
if (is_ok (error) && monitor) {
desc = mono_method_desc_new ("Monitor:Enter(object,bool&)", FALSE);
if (desc) {
_monitor_enter_v4_method = mono_method_desc_search_in_class (desc, monitor);
mono_method_desc_free (desc);
if (_monitor_enter_v4_method) {
_monitor_enter_v4_method_jitinfo = (MonoJitInfo *)g_new0 (MonoJitInfo, 1);
if (_monitor_enter_v4_method_jitinfo) {
_monitor_enter_v4_method_jitinfo->code_start = MINI_FTNPTR_TO_ADDR (_monitor_enter_v4_method);
_monitor_enter_v4_method_jitinfo->code_size = 20;
_monitor_enter_v4_method_jitinfo->d.method = _monitor_enter_v4_method;
}
}
}
desc = mono_method_desc_new ("Monitor:Enter(object)", FALSE);
if (desc) {
_monitor_enter_method = mono_method_desc_search_in_class (desc, monitor);
mono_method_desc_free (desc);
if (_monitor_enter_method ) {
_monitor_enter_method_jitinfo = (MonoJitInfo *)g_new0 (MonoJitInfo, 1);
if (_monitor_enter_method_jitinfo) {
_monitor_enter_method_jitinfo->code_start = MINI_FTNPTR_TO_ADDR (_monitor_enter_method);
_monitor_enter_method_jitinfo->code_size = 20;
_monitor_enter_method_jitinfo->d.method = _monitor_enter_method;
}
}
}
}
mono_error_cleanup (error);
}
}
void
ep_rt_mono_runtime_provider_fini (void)
{
if (_sampled_thread_callstacks)
g_array_free (_sampled_thread_callstacks, TRUE);
_sampled_thread_callstacks = NULL;
_max_sampled_thread_count = 32;
g_free (_runtime_helper_compile_method_jitinfo);
_runtime_helper_compile_method_jitinfo = NULL;
if (_runtime_helper_compile_method)
mono_free_method (_runtime_helper_compile_method);
_runtime_helper_compile_method = NULL;
g_free (_monitor_enter_method_jitinfo);
_monitor_enter_method_jitinfo = NULL;
_monitor_enter_method = NULL;
g_free (_monitor_enter_v4_method_jitinfo);
_monitor_enter_v4_method_jitinfo = NULL;
_monitor_enter_v4_method = NULL;
if (_ep_rt_mono_default_profiler_provider) {
mono_profiler_set_jit_begin_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_jit_failed_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_jit_done_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_image_loaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_image_unloaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_assembly_loaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_assembly_unloaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_class_loading_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_class_failed_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_class_loaded_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_exception_throw_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_exception_clause_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_monitor_contention_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_monitor_acquired_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_monitor_failed_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_gc_root_register_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_gc_root_unregister_callback (_ep_rt_mono_default_profiler_provider, NULL);
mono_profiler_set_gc_finalized_callback (_ep_rt_mono_default_profiler_provider, NULL);
}
_gc_heap_dump_requests = 0;
_gc_heap_dump_count = 0;
_gc_heap_dump_trigger_count = 0;
dn_vector_dispose (&_gc_heap_dump_requests_data);
memset (&_gc_heap_dump_requests_data, 0, sizeof (_gc_heap_dump_requests_data));
dn_umap_dispose (&_gc_roots_table);
memset (&_gc_roots_table, 0, sizeof (_gc_roots_table));
ep_rt_spin_lock_free (&_gc_lock);
}
void
ep_rt_mono_runtime_provider_thread_started_callback (
MonoProfiler *prof,
uintptr_t tid)
{
thread_started_callback (prof, tid);
}
void
ep_rt_mono_runtime_provider_thread_stopped_callback (
MonoProfiler *prof,
uintptr_t tid)
{
thread_stopped_callback (prof, tid);
}
#endif /* ENABLE_PERFTRACING */
MONO_EMPTY_SOURCE_FILE(eventpipe_rt_mono_runtime_provider);
|
402a6cf6d9bb3ecb688a5ffb112dab594e9ab859
|
3afd7229cfff2da1b504cf33869f0397e7d72535
|
/src/dynarec/arm64/dynarec_arm64_67.c
|
7c4ea04545671bc8f096e2081dc1fdad7803db3d
|
[
"MIT"
] |
permissive
|
ptitSeb/box64
|
ed62db37d8dd328316fef259be24ff95b9d785e7
|
7cba83231a0ca05a18bb6a07735ba8d5f0a216b6
|
refs/heads/main
| 2023-08-31T06:25:22.053788
| 2023-08-30T19:53:29
| 2023-08-30T19:53:29
| 317,493,442
| 2,317
| 197
|
MIT
| 2023-09-13T13:51:23
| 2020-12-01T09:42:50
|
C
|
UTF-8
|
C
| false
| false
| 42,102
|
c
|
dynarec_arm64_67.c
|
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <errno.h>
#include "debug.h"
#include "box64context.h"
#include "dynarec.h"
#include "emu/x64emu_private.h"
#include "emu/x64run_private.h"
#include "x64run.h"
#include "x64emu.h"
#include "box64stack.h"
#include "callback.h"
#include "emu/x64run_private.h"
#include "x64trace.h"
#include "dynarec_native.h"
#include "arm64_printer.h"
#include "dynarec_arm64_private.h"
#include "dynarec_arm64_helper.h"
#include "dynarec_arm64_functions.h"
#define GETGm gd = ((nextop&0x38)>>3)
uintptr_t dynarec64_67(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int ninst, rex_t rex, int rep, int* ok, int* need_epilog)
{
(void)ip; (void)need_epilog;
uint8_t opcode = F8;
uint8_t nextop;
uint8_t gd, ed, wback, wb, wb1, wb2, gb1, gb2, eb1, eb2;
int64_t fixedaddress;
int unscaled;
int8_t i8;
uint8_t u8;
int32_t i32;
int64_t j64, i64;
int cacheupd = 0;
int lock;
int v0, v1, s0;
MAYUSE(i32);
MAYUSE(j64);
MAYUSE(v0);
MAYUSE(v1);
MAYUSE(s0);
MAYUSE(lock);
MAYUSE(cacheupd);
if(rex.is32bits) {
// should do a different file
DEFAULT;
return addr;
}
GETREX();
rep = 0;
while((opcode==0xF2) || (opcode==0xF3)) {
rep = opcode-0xF1;
opcode = F8;
}
switch(opcode) {
case 0x00:
INST_NAME("ADD Eb, Gb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x1, 0);
GETGB(x2);
emit_add8(dyn, ninst, x1, x2, x4, x5);
EBBACK;
break;
case 0x01:
INST_NAME("ADD Ed, Gd");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_add32(dyn, ninst, rex, ed, gd, x3, x4);
WBACK;
break;
case 0x02:
INST_NAME("ADD Gb, Eb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x2, 0);
GETGB(x1);
emit_add8(dyn, ninst, x1, x2, x3, x4);
GBBACK;
break;
case 0x03:
INST_NAME("ADD Gd, Ed");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_add32(dyn, ninst, rex, gd, ed, x3, x4);
break;
case 0x04:
INST_NAME("ADD AL, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING);
u8 = F8;
UXTBw(x1, xRAX);
emit_add8c(dyn, ninst, x1, u8, x3, x4);
BFIx(xRAX, x1, 0, 8);
break;
case 0x05:
INST_NAME("ADD EAX, Id");
SETFLAGS(X_ALL, SF_SET_PENDING);
i64 = F32S;
emit_add32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5);
break;
case 0x08:
INST_NAME("OR Eb, Gb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x1, 0);
GETGB(x2);
emit_or8(dyn, ninst, x1, x2, x4, x2);
EBBACK;
break;
case 0x09:
INST_NAME("OR Ed, Gd");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_or32(dyn, ninst, rex, ed, gd, x3, x4);
WBACK;
break;
case 0x0A:
INST_NAME("OR Gb, Eb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x2, 0);
GETGB(x1);
emit_or8(dyn, ninst, x1, x2, x3, x4);
GBBACK;
break;
case 0x0B:
INST_NAME("OR Gd, Ed");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_or32(dyn, ninst, rex, gd, ed, x3, x4);
break;
case 0x0C:
INST_NAME("OR AL, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING);
u8 = F8;
UXTBw(x1, xRAX);
emit_or8c(dyn, ninst, x1, u8, x3, x4);
BFIx(xRAX, x1, 0, 8);
break;
case 0x0D:
INST_NAME("OR EAX, Id");
SETFLAGS(X_ALL, SF_SET_PENDING);
i64 = F32S;
emit_or32c(dyn, ninst, rex, xRAX, i64, x3, x4);
break;
case 0x0F:
opcode=F8;
switch(opcode) {
case 0x11:
switch(rep) {
case 0:
INST_NAME("MOVUPS Ex,Gx");
nextop = F8;
GETG;
v0 = sse_get_reg(dyn, ninst, x1, gd, 0);
if(MODREG) {
ed = (nextop&7)+(rex.b<<3);
v1 = sse_get_reg_empty(dyn, ninst, x1, ed);
VMOVQ(v1, v0);
} else {
addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
VST128(v0, ed, fixedaddress);
SMWRITE2();
}
break;
default:
DEFAULT;
}
break;
case 0x2E:
// no special check...
case 0x2F:
switch(rep) {
case 0:
if(opcode==0x2F) {INST_NAME("COMISS Gx, Ex");} else {INST_NAME("UCOMISS Gx, Ex");}
SETFLAGS(X_ALL, SF_SET);
nextop = F8;
GETGX(v0, 0);
if(MODREG) {
s0 = sse_get_reg(dyn, ninst, x1, (nextop&7) + (rex.b<<3), 0);
} else {
s0 = fpu_get_scratch(dyn);
SMREAD();
addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
VLD32(s0, ed, fixedaddress);
}
FCMPS(v0, s0);
FCOMI(x1, x2);
break;
default:
DEFAULT;
}
break;
case 0x6F:
switch(rep) {
case 0:
INST_NAME("MOVQ Gm, Em");
nextop = F8;
GETGm;
if(MODREG) {
v1 = mmx_get_reg(dyn, ninst, x1, x2, x3, nextop&7); // no rex.b on MMX
v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd);
VMOV(v0, v1);
} else {
v0 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, gd);
SMREAD();
addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
VLD64(v0, ed, fixedaddress);
}
break;
case 2:
INST_NAME("MOVDQU Gx,Ex");
nextop = F8;
if(MODREG) {
v1 = sse_get_reg(dyn, ninst, x1, (nextop&7)+(rex.b<<3), 0);
GETGX_empty(v0);
VMOVQ(v0, v1);
} else {
GETGX_empty(v0);
SMREAD();
addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<4, 15, rex, NULL, 0, 0);
VLD128(v0, ed, fixedaddress);
}
break;
default:
DEFAULT;
}
break;
case 0x7F:
switch(rep) {
case 0:
INST_NAME("MOVQ Em, Gm");
nextop = F8;
GETGM(v0);
if(MODREG) {
v1 = mmx_get_reg_empty(dyn, ninst, x1, x2, x3, nextop&7);
VMOV(v1, v0);
} else {
addr = geted32(dyn, addr, ninst, nextop, &ed, x1, &fixedaddress, &unscaled, 0xfff<<3, 7, rex, NULL, 0, 0);
VST64(v0, ed, fixedaddress);
SMWRITE();
}
break;
default:
DEFAULT;
}
break;
case 0xB6:
INST_NAME("MOVZX Gd, Eb");
nextop = F8;
GETGD;
if(MODREG) {
if(rex.rex) {
eb1 = xRAX+(nextop&7)+(rex.b<<3);
eb2 = 0; \
} else {
ed = (nextop&7);
eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
eb2 = (ed&4)>>2; // L or H
}
UBFXxw(gd, eb1, eb2*8, 8);
} else {
SMREAD();
addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, NULL, 0, 0);
LDB(gd, ed, fixedaddress);
}
break;
case 0xB7:
INST_NAME("MOVZX Gd, Ew");
nextop = F8;
GETGD;
if(MODREG) {
ed = xRAX+(nextop&7)+(rex.b<<3);
UBFXxw(gd, ed, 0, 16);
} else {
SMREAD();
addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, NULL, 0, 0);
LDH(gd, ed, fixedaddress);
}
break;
default:
DEFAULT;
}
break;
case 0x10:
INST_NAME("ADC Eb, Gb");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x1, 0);
GETGB(x2);
emit_adc8(dyn, ninst, x1, x2, x4, x5);
EBBACK;
break;
case 0x11:
INST_NAME("ADC Ed, Gd");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_adc32(dyn, ninst, rex, ed, gd, x3, x4);
WBACK;
break;
case 0x12:
INST_NAME("ADC Gb, Eb");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x2, 0);
GETGB(x1);
emit_adc8(dyn, ninst, x1, x2, x4, x3);
GBBACK;
break;
case 0x13:
INST_NAME("ADC Gd, Ed");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_adc32(dyn, ninst, rex, gd, ed, x3, x4);
break;
case 0x14:
INST_NAME("ADC AL, Ib");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
u8 = F8;
UXTBw(x1, xRAX);
emit_adc8c(dyn, ninst, x1, u8, x3, x4, x5);
BFIx(xRAX, x1, 0, 8);
break;
case 0x15:
INST_NAME("ADC EAX, Id");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
i64 = F32S;
MOV64xw(x1, i64);
emit_adc32(dyn, ninst, rex, xRAX, x1, x3, x4);
break;
case 0x18:
INST_NAME("SBB Eb, Gb");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x1, 0);
GETGB(x2);
emit_sbb8(dyn, ninst, x1, x2, x4, x5);
EBBACK;
break;
case 0x19:
INST_NAME("SBB Ed, Gd");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_sbb32(dyn, ninst, rex, ed, gd, x3, x4);
WBACK;
break;
case 0x1A:
INST_NAME("SBB Gb, Eb");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x2, 0);
GETGB(x1);
emit_sbb8(dyn, ninst, x1, x2, x3, x4);
GBBACK;
break;
case 0x1B:
INST_NAME("SBB Gd, Ed");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_sbb32(dyn, ninst, rex, gd, ed, x3, x4);
break;
case 0x1C:
INST_NAME("SBB AL, Ib");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
u8 = F8;
UXTBw(x1, xRAX);
emit_sbb8c(dyn, ninst, x1, u8, x3, x4, x5);
BFIx(xRAX, x1, 0, 8);
break;
case 0x1D:
INST_NAME("SBB EAX, Id");
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
i64 = F32S;
MOV64xw(x2, i64);
emit_sbb32(dyn, ninst, rex, xRAX, x2, x3, x4);
break;
case 0x20:
INST_NAME("AND Eb, Gb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x1, 0);
GETGB(x2);
emit_and8(dyn, ninst, x1, x2, x4, x5);
EBBACK;
break;
case 0x21:
INST_NAME("AND Ed, Gd");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_and32(dyn, ninst, rex, ed, gd, x3, x4);
WBACK;
break;
case 0x22:
INST_NAME("AND Gb, Eb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x2, 0);
GETGB(x1);
emit_and8(dyn, ninst, x1, x2, x3, x4);
GBBACK;
break;
case 0x23:
INST_NAME("AND Gd, Ed");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_and32(dyn, ninst, rex, gd, ed, x3, x4);
break;
case 0x24:
INST_NAME("AND AL, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING);
u8 = F8;
UXTBw(x1, xRAX);
emit_and8c(dyn, ninst, x1, u8, x3, x4);
BFIx(xRAX, x1, 0, 8);
break;
case 0x25:
INST_NAME("AND EAX, Id");
SETFLAGS(X_ALL, SF_SET_PENDING);
i64 = F32S;
emit_and32c(dyn, ninst, rex, xRAX, i64, x3, x4);
break;
case 0x28:
INST_NAME("SUB Eb, Gb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x1, 0);
GETGB(x2);
emit_sub8(dyn, ninst, x1, x2, x4, x5);
EBBACK;
break;
case 0x29:
INST_NAME("SUB Ed, Gd");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_sub32(dyn, ninst, rex, ed, gd, x3, x4);
WBACK;
break;
case 0x2A:
INST_NAME("SUB Gb, Eb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x2, 0);
GETGB(x1);
emit_sub8(dyn, ninst, x1, x2, x3, x4);
GBBACK;
break;
case 0x2B:
INST_NAME("SUB Gd, Ed");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_sub32(dyn, ninst, rex, gd, ed, x3, x4);
break;
case 0x2C:
INST_NAME("SUB AL, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING);
u8 = F8;
UXTBw(x1, xRAX);
emit_sub8c(dyn, ninst, x1, u8, x3, x4, x5);
BFIx(xRAX, x1, 0, 8);
break;
case 0x2D:
INST_NAME("SUB EAX, Id");
SETFLAGS(X_ALL, SF_SET_PENDING);
i64 = F32S;
emit_sub32c(dyn, ninst, rex, xRAX, i64, x3, x4, x5);
break;
case 0x30:
INST_NAME("XOR Eb, Gb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x1, 0);
GETGB(x2);
emit_xor8(dyn, ninst, x1, x2, x4, x5);
EBBACK;
break;
case 0x31:
INST_NAME("XOR Ed, Gd");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_xor32(dyn, ninst, rex, ed, gd, x3, x4);
WBACK;
break;
case 0x32:
INST_NAME("XOR Gb, Eb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x2, 0);
GETGB(x1);
emit_xor8(dyn, ninst, x1, x2, x3, x4);
GBBACK;
break;
case 0x33:
INST_NAME("XOR Gd, Ed");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_xor32(dyn, ninst, rex, gd, ed, x3, x4);
break;
case 0x34:
INST_NAME("XOR AL, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING);
u8 = F8;
UXTBw(x1, xRAX);
emit_xor8c(dyn, ninst, x1, u8, x3, x4);
BFIx(xRAX, x1, 0, 8);
break;
case 0x35:
INST_NAME("XOR EAX, Id");
SETFLAGS(X_ALL, SF_SET_PENDING);
i64 = F32S;
emit_xor32c(dyn, ninst, rex, xRAX, i64, x3, x4);
break;
case 0x38:
INST_NAME("CMP Eb, Gb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x1, 0);
GETGB(x2);
emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5);
break;
case 0x39:
INST_NAME("CMP Ed, Gd");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_cmp32(dyn, ninst, rex, ed, gd, x3, x4, x5);
break;
case 0x3A:
INST_NAME("CMP Gb, Eb");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETEB32(x2, 0);
GETGB(x1);
emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5);
break;
case 0x3B:
INST_NAME("CMP Gd, Ed");
SETFLAGS(X_ALL, SF_SET_PENDING);
nextop = F8;
GETGD;
GETED32(0);
emit_cmp32(dyn, ninst, rex, gd, ed, x3, x4, x5);
break;
case 0x3C:
INST_NAME("CMP AL, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING);
u8 = F8;
UXTBw(x1, xRAX);
if(u8) {
MOV32w(x2, u8);
emit_cmp8(dyn, ninst, x1, x2, x3, x4, x5);
} else {
emit_cmp8_0(dyn, ninst, x1, x3, x4);
}
break;
case 0x3D:
INST_NAME("CMP EAX, Id");
SETFLAGS(X_ALL, SF_SET_PENDING);
i64 = F32S;
if(i64) {
MOV64xw(x2, i64);
emit_cmp32(dyn, ninst, rex, xRAX, x2, x3, x4, x5);
} else
emit_cmp32_0(dyn, ninst, rex, xRAX, x3, x4);
break;
case 0x63:
INST_NAME("MOVSXD Gd, Ed");
nextop = F8;
GETGD;
if(rex.w) {
if(MODREG) { // reg <= reg
SXTWx(gd, xRAX+(nextop&7)+(rex.b<<3));
} else { // mem <= reg
SMREAD();
addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
LDSW(gd, ed, fixedaddress);
}
} else {
if(MODREG) { // reg <= reg
MOVw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
} else { // mem <= reg
SMREAD();
addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<2, 3, rex, NULL, 0, 0);
LDW(gd, ed, fixedaddress);
}
}
break;
case 0x66:
opcode=F8;
switch(opcode) {
case 0x89:
INST_NAME("MOV Ew, Gw");
nextop = F8;
GETGD; // don't need GETGW here
if(MODREG) {
ed = xRAX+(nextop&7)+(rex.b<<3);
if(ed!=gd) {
BFIx(ed, gd, 0, 16);
}
} else {
addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<1, 1, rex, &lock, 0, 0);
STH(gd, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
default:
DEFAULT;
}
break;
case 0x81:
case 0x83:
nextop = F8;
switch((nextop>>3)&7) {
case 0: //ADD
if(opcode==0x81) {INST_NAME("ADD Ed, Id");} else {INST_NAME("ADD Ed, Ib");}
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32((opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
emit_add32c(dyn, ninst, rex, ed, i64, x3, x4, x5);
WBACK;
break;
case 1: //OR
if(opcode==0x81) {INST_NAME("OR Ed, Id");} else {INST_NAME("OR Ed, Ib");}
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32((opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
emit_or32c(dyn, ninst, rex, ed, i64, x3, x4);
WBACK;
break;
case 2: //ADC
if(opcode==0x81) {INST_NAME("ADC Ed, Id");} else {INST_NAME("ADC Ed, Ib");}
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32((opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
MOV64xw(x5, i64);
emit_adc32(dyn, ninst, rex, ed, x5, x3, x4);
WBACK;
break;
case 3: //SBB
if(opcode==0x81) {INST_NAME("SBB Ed, Id");} else {INST_NAME("SBB Ed, Ib");}
READFLAGS(X_CF);
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32((opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
MOV64xw(x5, i64);
emit_sbb32(dyn, ninst, rex, ed, x5, x3, x4);
WBACK;
break;
case 4: //AND
if(opcode==0x81) {INST_NAME("AND Ed, Id");} else {INST_NAME("AND Ed, Ib");}
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32((opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
emit_and32c(dyn, ninst, rex, ed, i64, x3, x4);
WBACK;
break;
case 5: //SUB
if(opcode==0x81) {INST_NAME("SUB Ed, Id");} else {INST_NAME("SUB Ed, Ib");}
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32((opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
emit_sub32c(dyn, ninst, rex, ed, i64, x3, x4, x5);
WBACK;
break;
case 6: //XOR
if(opcode==0x81) {INST_NAME("XOR Ed, Id");} else {INST_NAME("XOR Ed, Ib");}
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32((opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
emit_xor32c(dyn, ninst, rex, ed, i64, x3, x4);
WBACK;
break;
case 7: //CMP
if(opcode==0x81) {INST_NAME("CMP Ed, Id");} else {INST_NAME("CMP Ed, Ib");}
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32((opcode==0x81)?4:1);
if(opcode==0x81) i64 = F32S; else i64 = F8S;
if(i64) {
MOV64xw(x2, i64);
emit_cmp32(dyn, ninst, rex, ed, x2, x3, x4, x5);
} else
emit_cmp32_0(dyn, ninst, rex, ed, x3, x4);
break;
}
break;
case 0x88:
INST_NAME("MOV Eb, Gb");
nextop = F8;
gd = ((nextop&0x38)>>3)+(rex.r<<3);
if(rex.rex) {
gb2 = 0;
gb1 = xRAX + gd;
} else {
gb2 = ((gd&4)<<1);
gb1 = xRAX+(gd&3);
}
if(gb2) {
gd = x4;
UBFXw(gd, gb1, gb2, 8);
} else {
gd = gb1; // no need to extract
}
if(MODREG) {
ed = (nextop&7) + (rex.b<<3);
if(rex.rex) {
eb1 = xRAX+ed;
eb2 = 0;
} else {
eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx
eb2 = ((ed&4)>>2); // L or H
}
BFIx(eb1, gd, eb2*8, 8);
} else {
addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff, 0, rex, &lock, 0, 0);
STB(gd, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
case 0x89:
INST_NAME("MOV Ed, Gd");
nextop=F8;
GETGD;
if(MODREG) { // reg <= reg
MOVxw_REG(xRAX+(nextop&7)+(rex.b<<3), gd);
} else { // mem <= reg
addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
STxw(gd, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
case 0x8B:
INST_NAME("MOV Gd, Ed");
nextop=F8;
GETGD;
if(MODREG) {
MOVxw_REG(gd, xRAX+(nextop&7)+(rex.b<<3));
} else {
addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 0);
SMREADLOCK(lock);
LDxw(gd, ed, fixedaddress);
}
break;
case 0x8D:
INST_NAME("LEA Gd, Ed");
nextop=F8;
GETGD;
if(MODREG) { // reg <= reg? that's an invalid operation
DEFAULT;
} else { // mem <= reg
addr = geted32(dyn, addr, ninst, nextop, &ed, gd, &fixedaddress, NULL, 0, 0, rex, NULL, 0, 0);
if(ed!=gd) {
MOVw_REG(gd, ed);
}
}
break;
case 0xC1:
nextop = F8;
switch((nextop>>3)&7) {
case 0:
INST_NAME("ROL Ed, Ib");
SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING);
GETED32(1);
u8 = (F8)&(rex.w?0x3f:0x1f);
emit_rol32c(dyn, ninst, rex, ed, u8, x3, x4);
if(u8) { WBACK; }
break;
case 1:
INST_NAME("ROR Ed, Ib");
SETFLAGS(X_OF|X_CF, SF_SUBSET_PENDING);
GETED32(1);
u8 = (F8)&(rex.w?0x3f:0x1f);
emit_ror32c(dyn, ninst, rex, ed, u8, x3, x4);
if(u8) { WBACK; }
break;
case 2:
INST_NAME("RCL Ed, Ib");
MESSAGE(LOG_DUMP, "Need Optimization\n");
READFLAGS(X_CF);
SETFLAGS(X_OF|X_CF, SF_SET);
GETED32W(x4, x1, 1);
u8 = F8;
MOV32w(x2, u8);
CALL_(rex.w?((void*)rcl64):((void*)rcl32), ed, x4);
WBACK;
break;
case 3:
INST_NAME("RCR Ed, Ib");
MESSAGE(LOG_DUMP, "Need Optimization\n");
READFLAGS(X_CF);
SETFLAGS(X_OF|X_CF, SF_SET);
GETED32W(x4, x1, 1);
u8 = F8;
MOV32w(x2, u8);
CALL_(rex.w?((void*)rcr64):((void*)rcr32), ed, x4);
WBACK;
break;
case 4:
case 6:
INST_NAME("SHL Ed, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
GETED32(1);
u8 = (F8)&(rex.w?0x3f:0x1f);
emit_shl32c(dyn, ninst, rex, ed, u8, x3, x4);
WBACK;
break;
case 5:
INST_NAME("SHR Ed, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
GETED32(1);
u8 = (F8)&(rex.w?0x3f:0x1f);
emit_shr32c(dyn, ninst, rex, ed, u8, x3, x4);
if(u8) {
WBACK;
}
break;
case 7:
INST_NAME("SAR Ed, Ib");
SETFLAGS(X_ALL, SF_SET_PENDING); // some flags are left undefined
GETED32(1);
u8 = (F8)&(rex.w?0x3f:0x1f);
emit_sar32c(dyn, ninst, rex, ed, u8, x3, x4);
if(u8) {
WBACK;
}
break;
}
break;
case 0xC7:
INST_NAME("MOV Ed, Id");
nextop=F8;
if(MODREG) { // reg <= i32
i64 = F32S;
ed = xRAX+(nextop&7)+(rex.b<<3);
MOV64xw(ed, i64);
} else { // mem <= i32
addr = geted32(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, &unscaled, 0xfff<<(2+rex.w), (1<<(2+rex.w))-1, rex, &lock, 0, 4);
i64 = F32S;
MOV64xw(x3, i64);
STxw(x3, ed, fixedaddress);
SMWRITELOCK(lock);
}
break;
#define GO(NO, YES) \
BARRIER(BARRIER_MAYBE); \
JUMP(addr+i8, 1); \
if(dyn->insts[ninst].x64.jmp_insts==-1 || \
CHECK_CACHE()) { \
/* out of the block */ \
i32 = dyn->insts[ninst].epilog-(dyn->native_size); \
Bcond(NO, i32); \
if(dyn->insts[ninst].x64.jmp_insts==-1) { \
if(!(dyn->insts[ninst].x64.barrier&BARRIER_FLOAT)) \
fpu_purgecache(dyn, ninst, 1, x1, x2, x3); \
jump_to_next(dyn, addr+i8, 0, ninst); \
} else { \
CacheTransform(dyn, ninst, cacheupd, x1, x2, x3); \
i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size);\
B(i32); \
} \
} else { \
/* inside the block */ \
i32 = dyn->insts[dyn->insts[ninst].x64.jmp_insts].address-(dyn->native_size); \
Bcond(YES, i32); \
}
case 0xE0:
INST_NAME("LOOPNZ (32bits)");
READFLAGS(X_ZF);
i8 = F8S;
MOVw_REG(x1, xRCX);
SUBSw_U12(x1, x1, 1);
BFIx(xRCX, x1, 0, 32);
B_NEXT(cEQ); // ECX is 0, no LOOP
TSTw_mask(xFlags, 0b011010, 0); //mask=0x40
GO(cNE, cEQ);
break;
case 0xE1:
INST_NAME("LOOPZ (32bits)");
READFLAGS(X_ZF);
i8 = F8S;
MOVw_REG(x1, xRCX);
SUBSw_U12(x1, x1, 1);
BFIx(xRCX, x1, 0, 32);
B_NEXT(cEQ); // ECX is 0, no LOOP
TSTw_mask(xFlags, 0b011010, 0); //mask=0x40
GO(cEQ, cNE);
break;
case 0xE2:
INST_NAME("LOOP (32bits)");
i8 = F8S;
MOVw_REG(x1, xRCX);
SUBSw_U12(x1, x1, 1);
BFIx(xRCX, x1, 0, 32);
GO(cEQ, cNE);
break;
case 0xE3:
INST_NAME("JECXZ");
i8 = F8S;
MOVw_REG(x1, xRCX);
TSTw_REG(x1, x1);
GO(cNE, cEQ);
break;
#undef GO
case 0xE8:
return dynarec64_00(dyn, addr-1, ip, ninst, rex, rep, ok, need_epilog); // addr-1, to "put back" opcode)
case 0xF7:
nextop = F8;
switch((nextop>>3)&7) {
case 0:
case 1:
INST_NAME("TEST Ed, Id");
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32H(x1, 4);
i64 = F32S;
MOV64xw(x2, i64);
emit_test32(dyn, ninst, rex, ed, x2, x3, x4, x5);
break;
case 2:
INST_NAME("NOT Ed");
GETED32(0);
MVNxw_REG(ed, ed);
WBACK;
break;
case 3:
INST_NAME("NEG Ed");
SETFLAGS(X_ALL, SF_SET_PENDING);
GETED32(0);
emit_neg32(dyn, ninst, rex, ed, x3, x4);
WBACK;
break;
case 4:
INST_NAME("MUL EAX, Ed");
SETFLAGS(X_ALL, SF_PENDING);
UFLAG_DF(x2, rex.w?d_mul64:d_mul32);
GETED32(0);
if(rex.w) {
if(ed==xRDX) gd=x3; else gd=xRDX;
UMULH(gd, xRAX, ed);
MULx(xRAX, xRAX, ed);
if(gd!=xRDX) {MOVx_REG(xRDX, gd);}
} else {
UMULL(xRDX, xRAX, ed); //64 <- 32x32
MOVw_REG(xRAX, xRDX);
LSRx(xRDX, xRDX, 32);
}
UFLAG_RES(xRAX);
UFLAG_OP1(xRDX);
break;
case 5:
INST_NAME("IMUL EAX, Ed");
SETFLAGS(X_ALL, SF_PENDING);
UFLAG_DF(x2, rex.w?d_imul64:d_imul32);
GETED32(0);
if(rex.w) {
if(ed==xRDX) gd=x3; else gd=xRDX;
SMULH(gd, xRAX, ed);
MULx(xRAX, xRAX, ed);
if(gd!=xRDX) {MOVx_REG(xRDX, gd);}
} else {
SMULL(xRDX, xRAX, ed); //64 <- 32x32
MOVw_REG(xRAX, xRDX);
LSRx(xRDX, xRDX, 32);
}
UFLAG_RES(xRAX);
UFLAG_OP1(xRDX);
break;
case 6:
INST_NAME("DIV Ed");
SETFLAGS(X_ALL, SF_SET);
if(!rex.w) {
SET_DFNONE(x2);
GETED32(0);
MOVw_REG(x3, xRAX);
ORRx_REG_LSL(x3, x3, xRDX, 32);
if(MODREG) {
MOVw_REG(x4, ed);
ed = x4;
}
UDIVx(x2, x3, ed);
MSUBx(x4, x2, ed, xRAX);
MOVw_REG(xRAX, x2);
MOVw_REG(xRDX, x4);
} else {
if(ninst && dyn->insts
&& dyn->insts[ninst-1].x64.addr
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x31
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0xD2) {
SET_DFNONE(x2);
GETED32(0);
UDIVx(x2, xRAX, ed);
MSUBx(xRDX, x2, ed, xRAX);
MOVx_REG(xRAX, x2);
} else {
GETED32H(x1, 0); // get edd changed addr, so cannot be called 2 times for same op...
CBZxw_MARK(xRDX);
if(ed!=x1) {MOVx_REG(x1, ed);}
CALL(div64, -1);
B_NEXT_nocond;
MARK;
UDIVx(x2, xRAX, ed);
MSUBx(xRDX, x2, ed, xRAX);
MOVx_REG(xRAX, x2);
SET_DFNONE(x2);
}
}
break;
case 7:
INST_NAME("IDIV Ed");
NOTEST(x1);
SETFLAGS(X_ALL, SF_SET);
if(!rex.w) {
SET_DFNONE(x2)
GETSED32w(0);
MOVw_REG(x3, xRAX);
ORRx_REG_LSL(x3, x3, xRDX, 32);
SDIVx(x2, x3, wb);
MSUBx(x4, x2, wb, x3);
MOVw_REG(xRAX, x2);
MOVw_REG(xRDX, x4);
} else {
if(ninst && dyn->insts
&& dyn->insts[ninst-1].x64.addr
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr)==0x48
&& *(uint8_t*)(dyn->insts[ninst-1].x64.addr+1)==0x99) {
SET_DFNONE(x2)
GETED32(0);
SDIVx(x2, xRAX, ed);
MSUBx(xRDX, x2, ed, xRAX);
MOVx_REG(xRAX, x2);
} else {
GETED32H(x1, 0); // get edd changed addr, so cannot be called 2 times for same op...
CBZxw_MARK(xRDX);
MVNx_REG(x2, xRDX);
CBZxw_MARK(x2);
if(ed!=x1) {MOVx_REG(x1, ed);}
CALL((void*)idiv64, -1);
B_NEXT_nocond;
MARK;
SDIVx(x2, xRAX, ed);
MSUBx(xRDX, x2, ed, xRAX);
MOVx_REG(xRAX, x2);
SET_DFNONE(x2)
}
}
break;
}
break;
default:
DEFAULT;
}
return addr;
}
|
1d3cd8ca9a1d2f678833da4cb33da130cea5e1c3
|
f3eed0234b4d0ad2bbb2abd700cf1e2c7a0e8a1d
|
/AKWF-c/AKWF_0004/AKWF_0382.h
|
f8d7f8c66bc145a67f9be8a09abc462fe5c83403
|
[
"CC0-1.0"
] |
permissive
|
KristofferKarlAxelEkstrand/AKWF-FREE
|
b2defa1a2d389d309be6dd2e9f968923daf80d1b
|
cf8171df36e9fec25416b5f568b72a6e2cb69194
|
refs/heads/master
| 2023-07-23T18:22:36.939705
| 2023-07-10T17:14:40
| 2023-07-10T17:14:40
| 145,817,187
| 359
| 59
|
CC0-1.0
| 2023-07-10T17:14:41
| 2018-08-23T07:26:56
| null |
UTF-8
|
C
| false
| false
| 4,672
|
h
|
AKWF_0382.h
|
/* Adventure Kid Waveforms (AKWF) converted for use with Teensy Audio Library
*
* Adventure Kid Waveforms(AKWF) Open waveforms library
* https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/
*
* This code is in the public domain, CC0 1.0 Universal (CC0 1.0)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* Converted by Brad Roy, https://github.com/prosper00
*/
/* AKWF_0382 256 samples
+-----------------------------------------------------------------------------------------------------------------+
| * |
| * |
| * |
| * ** *** ** *** ******************* |
| * ** * * ** * * * |
| * ** * * ** * * * |
| * ** * ** * * ** |
| *** ** ***** ** *** ** |
| * * ** * |
|** *** * |
|** *** * |
|** ***** |
|** |
|** |
|** |
+-----------------------------------------------------------------------------------------------------------------+
*/
const uint16_t AKWF_0382 [] = {
27298, 15131, 7108, 540, 7045, 12316, 17444, 23515, 19134, 20111, 14279, 9605, 8527, 14467, 19437, 19284,
17799, 10056, 8961, 10884, 18220, 19848, 27182, 29391, 27548, 20469, 18239, 19798, 18427, 19672, 26092, 30017,
27203, 30359, 22187, 19227, 18173, 24971, 29128, 28756, 26983, 18686, 19295, 19194, 18590, 23378, 29943, 27685,
29652, 26194, 18818, 19377, 18800, 26633, 29280, 28269, 28940, 28434, 28845, 28511, 28791, 28564, 28752, 28603,
28723, 28634, 28703, 28657, 28689, 28672, 28684, 28681, 28684, 28683, 28689, 28679, 28700, 28672, 28718, 28660,
28737, 28643, 28757, 28627, 28778, 28611, 28800, 28595, 28820, 28578, 28841, 28557, 28876, 28482, 29322, 37517,
38471, 38024, 38380, 38062, 38356, 38080, 38339, 38099, 38320, 38114, 38301, 38133, 38280, 38150, 38260, 38165,
38242, 38178, 38223, 38190, 38209, 38199, 38197, 38204, 38187, 38209, 38180, 38208, 38175, 38207, 38174, 38204,
38172, 38201, 38170, 38194, 38171, 38189, 38172, 38183, 38171, 38177, 38170, 38173, 38170, 38169, 38168, 38165,
38166, 38160, 38164, 38158, 38161, 38155, 38158, 38152, 38155, 38150, 38152, 38147, 38149, 38146, 38145, 38142,
38142, 38140, 38140, 38137, 38135, 38135, 38132, 38131, 38129, 38129, 38127, 38125, 38124, 38122, 38121, 38119,
38118, 38116, 38115, 38115, 38113, 38111, 38110, 38109, 38107, 38106, 38104, 38103, 38102, 38101, 38099, 38097,
38097, 38094, 38094, 38090, 38090, 38089, 38089, 38085, 38085, 38083, 38081, 38079, 38078, 38078, 38075, 38076,
38073, 38075, 38068, 38071, 38064, 38069, 38059, 38066, 38056, 38066, 38053, 38063, 38050, 38059, 38049, 38055,
38048, 38051, 38047, 38044, 38047, 38037, 38049, 38030, 38052, 38023, 38053, 38014, 38055, 38007, 38058, 38000,
38058, 37995, 38058, 37991, 38052, 37993, 38044, 37997, 38030, 38010, 38007, 38035, 37964, 38095, 37851, 38342,
};
|
402b4730ea06698bb714b2932a755012782d0414
|
76c0e91112e29cd13392111711918c2016a138e8
|
/oss_c_sdk/oss_define.c
|
291adf4a3b0cdfd9d97f1edbb8eec09b7b3c6601
|
[
"MIT"
] |
permissive
|
aliyun/aliyun-oss-c-sdk
|
c86bd3d0812a3f694d696711187fe167c3385ef3
|
2d1ed0d657bec3c0a230bfadcc05519014e7d40a
|
refs/heads/master
| 2023-09-05T10:11:18.897194
| 2023-08-15T12:35:14
| 2023-08-18T07:22:16
| 48,464,620
| 160
| 124
|
MIT
| 2023-08-18T07:22:17
| 2015-12-23T02:30:40
|
C
|
UTF-8
|
C
| false
| false
| 3,959
|
c
|
oss_define.c
|
#include "oss_define.h"
const char OSS_CANNONICALIZED_HEADER_PREFIX[] = "x-oss-";
const char OSS_CANNONICALIZED_HEADER_DATE[] = "x-oss-date";
const char OSS_CANNONICALIZED_HEADER_ACL[] = "x-oss-acl";
const char OSS_CANNONICALIZED_HEADER_STORAGE_CLASS[] = "StorageClass";
const char OSS_CANNONICALIZED_HEADER_COPY_SOURCE[] = "x-oss-copy-source";
const char OSS_CANNONICALIZED_HEADER_SYMLINK[] = "x-oss-symlink-target";
const char OSS_CANNONICALIZED_HEADER_REGION[] = "x-oss-bucket-region";
const char OSS_CANNONICALIZED_HEADER_OBJECT_ACL[] = "x-oss-object-acl";
const char OSS_CONTENT_MD5[] = "Content-MD5";
const char OSS_CONTENT_TYPE[] = "Content-Type";
const char OSS_CONTENT_LENGTH[] = "Content-Length";
const char OSS_DATE[] = "Date";
const char OSS_AUTHORIZATION[] = "Authorization";
const char OSS_ACCESSKEYID[] = "OSSAccessKeyId";
const char OSS_EXPECT[] = "Expect";
const char OSS_EXPIRES[] = "Expires";
const char OSS_SIGNATURE[] = "Signature";
const char OSS_ACL[] = "acl";
const char OSS_LOCATION[] = "location";
const char OSS_BUCKETINFO[] = "bucketInfo";
const char OSS_BUCKETSTAT[] = "stat";
const char OSS_RESTORE[] = "restore";
const char OSS_SYMLINK[] = "symlink";
const char OSS_QOS[] = "qos";
const char OSS_PREFIX[] = "prefix";
const char OSS_DELIMITER[] = "delimiter";
const char OSS_MARKER[] = "marker";
const char OSS_MAX_KEYS[] = "max-keys";
const char OSS_UPLOADS[] = "uploads";
const char OSS_UPLOAD_ID[] = "uploadId";
const char OSS_MAX_PARTS[] = "max-parts";
const char OSS_PART_NUMBER_MARKER[] = "part-number-marker";
const char OSS_KEY_MARKER[] = "key-marker";
const char OSS_UPLOAD_ID_MARKER[] = "upload-id-marker";
const char OSS_MAX_UPLOADS[] = "max-uploads";
const char OSS_PARTNUMBER[] = "partNumber";
const char OSS_APPEND[] = "append";
const char OSS_POSITION[] = "position";
const char OSS_MULTIPART_CONTENT_TYPE[] = "application/x-www-form-urlencoded";
const char OSS_COPY_SOURCE[] = "x-oss-copy-source";
const char OSS_COPY_SOURCE_RANGE[] = "x-oss-copy-source-range";
const char OSS_SECURITY_TOKEN[] = "security-token";
const char OSS_STS_SECURITY_TOKEN[] = "x-oss-security-token";
const char OSS_OBJECT_TYPE[] = "x-oss-object-type";
const char OSS_NEXT_APPEND_POSITION[] = "x-oss-next-append-position";
const char OSS_HASH_CRC64_ECMA[] = "x-oss-hash-crc64ecma";
const char OSS_CALLBACK[] = "x-oss-callback";
const char OSS_CALLBACK_VAR[] = "x-oss-callback-var";
const char OSS_PROCESS[] = "x-oss-process";
const char OSS_LIFECYCLE[] = "lifecycle";
const char OSS_REFERER[] = "referer";
const char OSS_CORS[] = "cors";
const char OSS_WEBSITE[] = "website";
const char OSS_LOGGING[] = "logging";
const char OSS_DELETE[] = "delete";
const char OSS_YES[] = "yes";
const char OSS_OBJECT_TYPE_NORMAL[] = "Normal";
const char OSS_OBJECT_TYPE_APPENDABLE[] = "Appendable";
const char OSS_LIVE_CHANNEL[] = "live";
const char OSS_LIVE_CHANNEL_STATUS[] = "status";
const char OSS_COMP[] = "comp";
const char OSS_LIVE_CHANNEL_STAT[] = "stat";
const char OSS_LIVE_CHANNEL_HISTORY[] = "history";
const char OSS_LIVE_CHANNEL_VOD[] = "vod";
const char OSS_LIVE_CHANNEL_START_TIME[] = "startTime";
const char OSS_LIVE_CHANNEL_END_TIME[] = "endTime";
const char OSS_PLAY_LIST_NAME[] = "playlistName";
const char LIVE_CHANNEL_STATUS_DISABLED[] = "disabled";
const char LIVE_CHANNEL_STATUS_ENABLED[] = "enabled";
const char LIVE_CHANNEL_STATUS_IDLE[] = "idle";
const char LIVE_CHANNEL_STATUS_LIVE[] = "live";
const char LIVE_CHANNEL_DEFAULT_TYPE[] = "HLS";
const char LIVE_CHANNEL_DEFAULT_PLAYLIST[] = "playlist.m3u8";
const int LIVE_CHANNEL_DEFAULT_FRAG_DURATION = 5;
const int LIVE_CHANNEL_DEFAULT_FRAG_COUNT = 3;
const int OSS_MAX_PART_NUM = 10000;
const int OSS_PER_RET_NUM = 1000;
const int MAX_SUFFIX_LEN = 1024;
const char OSS_OBJECT_META[] = "objectMeta";
const char OSS_SELECT_OBJECT_OUTPUT_RAW[] = "x-oss-select-output-raw";
const char OSS_TAGGING[] = "tagging";
const char OSS_SIGN_ORIGIN_ONLY[] = "x-oss-sign-origin-only";
|
c4d156a5585c9fa0701ae76e6d0bea3b617575e5
|
04e5b6df2ee3bcfb7005d8ec91aab8e380333ac4
|
/Extensions/clib/iPhoneOS.sdk/usr/include/dns_util.h
|
5f9da7d60e8d174a5b13f8ea323873ca13b6ea5b
|
[
"MIT"
] |
permissive
|
ColdGrub1384/Pyto
|
64e2a593957fd640907f0e4698d430ea7754a73e
|
7557485a733dd7e17ba0366b92794931bdb39975
|
refs/heads/main
| 2023-08-01T03:48:35.694832
| 2022-07-20T14:38:45
| 2022-07-20T14:38:45
| 148,944,721
| 884
| 157
|
MIT
| 2023-02-26T21:34:04
| 2018-09-15T22:29:07
|
C
|
UTF-8
|
C
| false
| false
| 7,972
|
h
|
dns_util.h
|
/*
* Copyright (c) 2003-2006 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef __DNS_UTIL_H__
#define __DNS_UTIL_H__
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <dns.h>
#include <stdio.h>
/*
* Status returned in a dns_reply_t
*/
#define DNS_STATUS_OK 0
#define DNS_STATUS_BAD_HANDLE 1
#define DNS_STATUS_MALFORMED_QUERY 2
#define DNS_STATUS_TIMEOUT 3
#define DNS_STATUS_SEND_FAILED 4
#define DNS_STATUS_RECEIVE_FAILED 5
#define DNS_STATUS_CONNECTION_FAILED 6
#define DNS_STATUS_WRONG_SERVER 7
#define DNS_STATUS_WRONG_XID 8
#define DNS_STATUS_WRONG_QUESTION 9
/*
* dns_print_reply mask
*/
#define DNS_PRINT_XID 0x0001
#define DNS_PRINT_QR 0x0002
#define DNS_PRINT_OPCODE 0x0004
#define DNS_PRINT_AA 0x0008
#define DNS_PRINT_TC 0x0010
#define DNS_PRINT_RD 0x0020
#define DNS_PRINT_RA 0x0040
#define DNS_PRINT_PR 0x0080
#define DNS_PRINT_RCODE 0x0100
#define DNS_PRINT_QUESTION 0x0200
#define DNS_PRINT_ANSWER 0x0400
#define DNS_PRINT_AUTHORITY 0x0800
#define DNS_PRINT_ADDITIONAL 0x1000
#define DNS_PRINT_SERVER 0x2000
/*
* DNS query / reply header
*/
typedef struct {
uint16_t xid;
uint16_t flags;
uint16_t qdcount;
uint16_t ancount;
uint16_t nscount;
uint16_t arcount;
} dns_header_t;
/*
* DNS query
*/
typedef struct
{
char *name;
uint16_t dnstype;
uint16_t dnsclass;
} dns_question_t;
/*
* Resource Record types
* dns_parse_packet() creates resourse records of these types.
*/
typedef struct
{
uint16_t length;
char *data;
} dns_raw_resource_record_t;
typedef struct
{
struct in_addr addr;
} dns_address_record_t;
typedef struct
{
struct in6_addr addr;
} dns_in6_address_record_t;
typedef struct
{
char *name;
} dns_domain_name_record_t;
typedef struct
{
char *mname;
char *rname;
uint32_t serial;
uint32_t refresh;
uint32_t retry;
uint32_t expire;
uint32_t minimum;
} dns_SOA_record_t;
typedef struct
{
char *cpu;
char *os;
} dns_HINFO_record_t;
typedef struct
{
char *rmailbx;
char *emailbx;
} dns_MINFO_record_t;
typedef struct
{
uint16_t preference;
char *name;
} dns_MX_record_t;
typedef struct
{
uint32_t string_count;
char **strings;
} dns_TXT_record_t;
typedef struct
{
struct in_addr addr;
uint8_t protocol;
uint32_t maplength;
uint8_t *map;
} dns_WKS_record_t;
typedef struct
{
char *mailbox;
char *txtdname;
} dns_RP_record_t;
typedef struct
{
uint32_t subtype;
char *hostname;
} dns_AFSDB_record_t;
typedef struct
{
char *psdn_address;
} dns_X25_record_t;
typedef struct
{
char *isdn_address;
char *subaddress;
} dns_ISDN_record_t;
typedef struct
{
uint16_t preference;
char * intermediate;
} dns_RT_record_t;
typedef struct
{
uint8_t version;
uint8_t size;
uint8_t horizontal_precision;
uint8_t vertical_precision;
uint32_t latitude;
uint32_t longitude;
uint32_t altitude;
} dns_LOC_record_t;
typedef struct
{
uint16_t priority;
uint16_t weight;
uint16_t port;
char *target;
} dns_SRV_record_t;
/*
* DNS Resource Record
*
* Data contained in unsupported or obsolete Resource Record types
* may be accessed via DNSNULL as a dns_raw_resource_record_t.
*/
typedef struct
{
char *name;
uint16_t dnstype;
uint16_t dnsclass;
uint32_t ttl;
union
{
dns_address_record_t *A;
dns_domain_name_record_t *NS;
dns_domain_name_record_t *MD; /* Obsolete */
dns_domain_name_record_t *MF; /* Obsolete */
dns_domain_name_record_t *CNAME;
dns_SOA_record_t *SOA;
dns_domain_name_record_t *MB;
dns_domain_name_record_t *MG;
dns_domain_name_record_t *MR;
dns_raw_resource_record_t *DNSNULL;
dns_WKS_record_t *WKS;
dns_domain_name_record_t *PTR;
dns_HINFO_record_t *HINFO;
dns_MINFO_record_t *MINFO;
dns_MX_record_t *MX;
dns_TXT_record_t *TXT;
dns_RP_record_t *RP;
dns_AFSDB_record_t *AFSDB;
dns_X25_record_t *X25;
dns_ISDN_record_t *ISDN;
dns_RT_record_t *RT;
dns_in6_address_record_t *AAAA;
dns_LOC_record_t *LOC;
dns_SRV_record_t *SRV;
} data;
} dns_resource_record_t;
/*
* A parsed DNS record. Returned by dns_parse_packet() and dns_lookup().
* The contents may be printed using dns_print_reply().
*/
typedef struct
{
uint32_t status;
struct sockaddr *server;
dns_header_t *header;
dns_question_t **question;
dns_resource_record_t **answer;
dns_resource_record_t **authority;
dns_resource_record_t **additional;
} dns_reply_t;
__BEGIN_DECLS
/*
* High-level lookup performs a search (using dns_search), parses the
* reply and returns a dns_reply_t structure.
*
* The DNS handle contains an internal buffer used for fetching replies.
* The buffer is reused for each query, and is released with the DNS client
* handle when dns_free() is called. The default buffer size is 1024 bytes.
* The size may be changed with dns_set_buffer_size.
*
* Note that in a multithreaded application, each thread using this API must
* open a separate handle.
*/
extern dns_reply_t *dns_lookup(dns_handle_t dns, const char *name, uint32_t dnsclass, uint32_t dnstype);
/*
* Get / Set the size of the internal receive buffer used by dns_lookup()
*/
extern uint32_t dns_get_buffer_size(dns_handle_t d);
extern void dns_set_buffer_size(dns_handle_t d, uint32_t len);
/*
* Parse a reply packet into a reply structure.
*/
extern dns_reply_t *dns_parse_packet(const char *buf, uint32_t len);
/*
* Free a reply structure.
*/
extern void dns_free_reply(dns_reply_t *r);
/*
* Parse a query packet into a question structure.
*/
extern dns_question_t *dns_parse_question(const char *buf, uint32_t len);
/*
* Free a question structure.
*/
extern void dns_free_question(dns_question_t *q);
/*
* Parse a resource record into a structure.
*/
extern dns_resource_record_t *dns_parse_resource_record(const char *buf, uint32_t len);
/*
* Free a resource record structure.
*/
extern void dns_free_resource_record(dns_resource_record_t *rr);
/*
* String / number representation of a DNS class
* dns_class_number returns 0 if the string is recognized,
* non-zero if the class string is unknown.
*/
extern const char *dns_class_string(uint16_t dnsclass);
extern int32_t dns_class_number(const char *c, uint16_t *n);
/*
* String / number representation of a DNS type
* dns_type_number returns 0 if the string is recognized,
* non-zero if the class string is unknown.
*/
extern const char *dns_type_string(uint16_t dnstype);
extern int32_t dns_type_number(const char *t, uint16_t *n);
/*
* Print a dns handle.
*/
extern void dns_print_handle(dns_handle_t d, FILE *f);
/*
* Print the contents of a question structure.
*/
extern void dns_print_question(const dns_question_t *q, FILE *f);
/*
* Print the contents of a resource record structure.
*/
extern void dns_print_resource_record(const dns_resource_record_t *r, FILE *f);
/*
* Print the contents of a reply structure.
*/
extern void dns_print_reply(const dns_reply_t *r, FILE *f, uint16_t mask);
__END_DECLS
#endif /* __DNS_UTIL_H__ */
|
21962b87603d50333b2a92c4bf3dec33c03d9ab8
|
0853493263443e3493d5d359576f71fc7b1d509c
|
/src/host/curl_utils.h
|
d8215bdd56fc55fd7e5a8b23eade380b4f4b2d1a
|
[
"BSD-3-Clause"
] |
permissive
|
premake/premake-core
|
2480471ed07868913533b045b7d7db7d9630e8ba
|
7b309649ce08cb40f4947d6952fb554c94f8cff6
|
refs/heads/master
| 2023-09-01T07:23:53.970594
| 2023-08-30T19:06:18
| 2023-08-30T19:06:18
| 32,634,405
| 3,160
| 944
|
BSD-3-Clause
| 2023-09-09T23:25:44
| 2015-03-21T14:08:15
|
C
|
ISO-8859-13
|
C
| false
| false
| 951
|
h
|
curl_utils.h
|
/**
* \file curl_utils.h
* \brief curl utilities for the http library.
* \author Copyright (c) 2017 Tom van Dijck, Joćo Matos and the Premake project
*/
#ifndef curl_utils_h
#define curl_utils_h
#ifdef PREMAKE_CURL
#include "buffered_io.h"
#include "lua.h"
#define _MPRINTF_REPLACE /* use curl functions only */
#include <curl/curl.h>
#include <curl/mprintf.h>
typedef struct
{
lua_State* L;
int RefIndex;
Buffer S;
char errorBuffer[256];
struct curl_slist* headers;
} curl_state;
int curlProgressCallback(curl_state* state, double dltotal, double dlnow, double ultotal, double ulnow);
size_t curlWriteCallback(char *ptr, size_t size, size_t nmemb, curl_state* state);
CURL* curlRequest(lua_State* L, curl_state* state, int optionsIndex, int progressFnIndex, int headersIndex);
void curlCleanup(CURL* curl, curl_state* state);
#endif // PREMAKE_CURL
#endif // curl_utils_h
|
35d883c05d56388cf25305e19577db087b14cd9f
|
de21f9075f55640514c29ef0f1fe3f0690845764
|
/regression/cbmc-incr-oneloop/ignore-before-unwind/main.c
|
d5e190a61baffdd9f076e11a1ffc6a41b856827b
|
[
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"BSD-4-Clause"
] |
permissive
|
diffblue/cbmc
|
975a074ac445febb3b5715f8792beb545522dc18
|
decd2839c2f51a54b2ad0f3e89fdc1b4bf78cd16
|
refs/heads/develop
| 2023-08-31T05:52:05.342195
| 2023-08-30T13:31:51
| 2023-08-30T13:31:51
| 51,877,056
| 589
| 309
|
NOASSERTION
| 2023-09-14T18:49:17
| 2016-02-16T23:03:52
|
C++
|
UTF-8
|
C
| false
| false
| 198
|
c
|
main.c
|
int main()
{
__CPROVER_bool property = (__CPROVER_bool)1;
while(1)
{
__CPROVER_assume(property == 1);
property = 0;
__CPROVER_assert(property == 1, "property");
}
return 0;
}
|
639f0f1e1ad82b7fa76976414f18d77fe7e067c8
|
7eaf54a78c9e2117247cb2ab6d3a0c20719ba700
|
/SOFTWARE/A64-TERES/linux-a64/drivers/i2c/i2c-mux.c
|
7409ebb33c47df7166087f937d0d5eb91d9d70c9
|
[
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"Linux-syscall-note",
"GPL-2.0-only",
"GPL-1.0-or-later"
] |
permissive
|
OLIMEX/DIY-LAPTOP
|
ae82f4ee79c641d9aee444db9a75f3f6709afa92
|
a3fafd1309135650bab27f5eafc0c32bc3ca74ee
|
refs/heads/rel3
| 2023-08-04T01:54:19.483792
| 2023-04-03T07:18:12
| 2023-04-03T07:18:12
| 80,094,055
| 507
| 92
|
Apache-2.0
| 2023-04-03T07:05:59
| 2017-01-26T07:25:50
|
C
|
UTF-8
|
C
| false
| false
| 5,555
|
c
|
i2c-mux.c
|
/*
* Multiplexed I2C bus driver.
*
* Copyright (c) 2008-2009 Rodolfo Giometti <giometti@linux.it>
* Copyright (c) 2008-2009 Eurotech S.p.A. <info@eurotech.it>
* Copyright (c) 2009-2010 NSN GmbH & Co KG <michael.lawnick.ext@nsn.com>
*
* Simplifies access to complex multiplexed I2C bus topologies, by presenting
* each multiplexed bus segment as an additional I2C adapter.
* Supports multi-level mux'ing (mux behind a mux).
*
* Based on:
* i2c-virt.c from Kumar Gala <galak@kernel.crashing.org>
* i2c-virtual.c from Ken Harrenstien, Copyright (c) 2004 Google, Inc.
* i2c-virtual.c from Brian Kuschak <bkuschak@yahoo.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/i2c-mux.h>
#include <linux/of.h>
#include <linux/of_i2c.h>
/* multiplexer per channel data */
struct i2c_mux_priv {
struct i2c_adapter adap;
struct i2c_algorithm algo;
struct i2c_adapter *parent;
void *mux_priv; /* the mux chip/device */
u32 chan_id; /* the channel id */
int (*select)(struct i2c_adapter *, void *mux_priv, u32 chan_id);
int (*deselect)(struct i2c_adapter *, void *mux_priv, u32 chan_id);
};
static int i2c_mux_master_xfer(struct i2c_adapter *adap,
struct i2c_msg msgs[], int num)
{
struct i2c_mux_priv *priv = adap->algo_data;
struct i2c_adapter *parent = priv->parent;
int ret;
/* Switch to the right mux port and perform the transfer. */
ret = priv->select(parent, priv->mux_priv, priv->chan_id);
if (ret >= 0)
ret = parent->algo->master_xfer(parent, msgs, num);
if (priv->deselect)
priv->deselect(parent, priv->mux_priv, priv->chan_id);
return ret;
}
static int i2c_mux_smbus_xfer(struct i2c_adapter *adap,
u16 addr, unsigned short flags,
char read_write, u8 command,
int size, union i2c_smbus_data *data)
{
struct i2c_mux_priv *priv = adap->algo_data;
struct i2c_adapter *parent = priv->parent;
int ret;
/* Select the right mux port and perform the transfer. */
ret = priv->select(parent, priv->mux_priv, priv->chan_id);
if (ret >= 0)
ret = parent->algo->smbus_xfer(parent, addr, flags,
read_write, command, size, data);
if (priv->deselect)
priv->deselect(parent, priv->mux_priv, priv->chan_id);
return ret;
}
/* Return the parent's functionality */
static u32 i2c_mux_functionality(struct i2c_adapter *adap)
{
struct i2c_mux_priv *priv = adap->algo_data;
struct i2c_adapter *parent = priv->parent;
return parent->algo->functionality(parent);
}
/* Return all parent classes, merged */
static unsigned int i2c_mux_parent_classes(struct i2c_adapter *parent)
{
unsigned int class = 0;
do {
class |= parent->class;
parent = i2c_parent_is_i2c_adapter(parent);
} while (parent);
return class;
}
struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
struct device *mux_dev,
void *mux_priv, u32 force_nr, u32 chan_id,
unsigned int class,
int (*select) (struct i2c_adapter *,
void *, u32),
int (*deselect) (struct i2c_adapter *,
void *, u32))
{
struct i2c_mux_priv *priv;
int ret;
priv = kzalloc(sizeof(struct i2c_mux_priv), GFP_KERNEL);
if (!priv)
return NULL;
/* Set up private adapter data */
priv->parent = parent;
priv->mux_priv = mux_priv;
priv->chan_id = chan_id;
priv->select = select;
priv->deselect = deselect;
/* Need to do algo dynamically because we don't know ahead
* of time what sort of physical adapter we'll be dealing with.
*/
if (parent->algo->master_xfer)
priv->algo.master_xfer = i2c_mux_master_xfer;
if (parent->algo->smbus_xfer)
priv->algo.smbus_xfer = i2c_mux_smbus_xfer;
priv->algo.functionality = i2c_mux_functionality;
/* Now fill out new adapter structure */
snprintf(priv->adap.name, sizeof(priv->adap.name),
"i2c-%d-mux (chan_id %d)", i2c_adapter_id(parent), chan_id);
priv->adap.owner = THIS_MODULE;
priv->adap.algo = &priv->algo;
priv->adap.algo_data = priv;
priv->adap.dev.parent = &parent->dev;
/* Sanity check on class */
if (i2c_mux_parent_classes(parent) & class)
dev_err(&parent->dev,
"Segment %d behind mux can't share classes with ancestors\n",
chan_id);
else
priv->adap.class = class;
/*
* Try to populate the mux adapter's of_node, expands to
* nothing if !CONFIG_OF.
*/
if (mux_dev->of_node) {
struct device_node *child;
u32 reg;
for_each_child_of_node(mux_dev->of_node, child) {
ret = of_property_read_u32(child, "reg", ®);
if (ret)
continue;
if (chan_id == reg) {
priv->adap.dev.of_node = child;
break;
}
}
}
if (force_nr) {
priv->adap.nr = force_nr;
ret = i2c_add_numbered_adapter(&priv->adap);
} else {
ret = i2c_add_adapter(&priv->adap);
}
if (ret < 0) {
dev_err(&parent->dev,
"failed to add mux-adapter (error=%d)\n",
ret);
kfree(priv);
return NULL;
}
dev_info(&parent->dev, "Added multiplexed i2c bus %d\n",
i2c_adapter_id(&priv->adap));
of_i2c_register_devices(&priv->adap);
return &priv->adap;
}
EXPORT_SYMBOL_GPL(i2c_add_mux_adapter);
void i2c_del_mux_adapter(struct i2c_adapter *adap)
{
struct i2c_mux_priv *priv = adap->algo_data;
i2c_del_adapter(adap);
kfree(priv);
}
EXPORT_SYMBOL_GPL(i2c_del_mux_adapter);
MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>");
MODULE_DESCRIPTION("I2C driver for multiplexed I2C busses");
MODULE_LICENSE("GPL v2");
|
0d1851f8abb65a770706189f77a2a4e8e7672319
|
f3eed0234b4d0ad2bbb2abd700cf1e2c7a0e8a1d
|
/AKWF-c/AKWF_hvoice/AKWF_hvoice_0055.h
|
3a874ffa5f54eda6cc531a453a6749344494260c
|
[
"CC0-1.0"
] |
permissive
|
KristofferKarlAxelEkstrand/AKWF-FREE
|
b2defa1a2d389d309be6dd2e9f968923daf80d1b
|
cf8171df36e9fec25416b5f568b72a6e2cb69194
|
refs/heads/master
| 2023-07-23T18:22:36.939705
| 2023-07-10T17:14:40
| 2023-07-10T17:14:40
| 145,817,187
| 359
| 59
|
CC0-1.0
| 2023-07-10T17:14:41
| 2018-08-23T07:26:56
| null |
UTF-8
|
C
| false
| false
| 4,686
|
h
|
AKWF_hvoice_0055.h
|
/* Adventure Kid Waveforms (AKWF) converted for use with Teensy Audio Library
*
* Adventure Kid Waveforms(AKWF) Open waveforms library
* https://www.adventurekid.se/akrt/waveforms/adventure-kid-waveforms/
*
* This code is in the public domain, CC0 1.0 Universal (CC0 1.0)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* Converted by Brad Roy, https://github.com/prosper00
*/
/* AKWF_hvoice_0055 256 samples
+-----------------------------------------------------------------------------------------------------------------+
| ** |
| ** |
| * * ** * |
| * ********* ** |
| ********** **** ** |
| ******* * * ** |
| * ******* * * ** |
| ******** * *** |
|********* ********* * *|
| * ********** ***************************************|
| ** ******** * ********** * * |
| ** ************ * ***************** |
| ** * *** * ************* * |
| * |
| * |
+-----------------------------------------------------------------------------------------------------------------+
*/
const uint16_t AKWF_hvoice_0055 [] = {
33334, 33273, 33697, 34759, 33041, 33874, 34270, 34099, 34288, 34290, 35584, 35274, 33674, 34629, 36600, 37678,
36121, 35222, 37549, 37503, 36987, 36370, 37950, 39971, 37714, 37891, 39816, 39294, 41282, 40214, 40298, 42564,
40408, 43067, 42512, 42675, 44899, 42589, 45144, 43970, 44046, 48746, 46619, 47754, 48576, 46298, 49134, 47036,
47761, 50608, 47665, 49656, 48418, 50156, 52578, 49213, 53007, 52164, 50996, 51292, 48351, 51698, 52306, 53759,
51871, 43836, 46053, 51204, 52415, 50036, 56984, 65204, 42495, 13790, 16356, 33460, 38204, 32144, 36791, 53145,
50681, 34067, 27108, 31030, 36404, 27842, 21474, 27627, 32997, 35130, 27785, 26965, 32812, 29658, 26034, 20722,
24025, 28595, 22575, 23169, 23724, 24917, 26195, 20621, 22630, 24098, 23725, 23241, 20733, 23851, 23252, 21796,
21037, 20952, 24076, 22020, 21001, 21924, 22312, 23732, 21100, 22802, 23780, 21327, 23169, 20563, 21889, 22604,
20900, 23441, 21470, 23669, 24747, 22263, 23159, 22865, 24231, 24981, 22921, 23283, 24269, 24392, 24598, 24669,
25266, 25487, 26088, 25180, 25521, 26251, 26225, 27138, 26202, 26175, 26155, 26952, 28136, 28569, 27943, 27590,
27842, 27912, 29065, 28321, 28509, 29517, 29135, 29381, 29699, 29367, 30759, 30319, 29401, 30316, 29816, 30983,
31481, 30187, 30338, 31078, 32454, 31537, 30153, 30479, 31118, 32375, 30800, 31221, 32248, 32417, 32361, 30468,
31584, 32028, 31589, 32087, 31521, 31840, 31995, 31598, 31443, 31919, 30913, 30727, 31970, 31089, 31759, 31477,
30919, 30645, 31643, 32857, 30961, 30489, 31685, 31482, 30594, 30984, 31375, 31228, 29730, 30382, 31763, 31860,
31204, 30705, 31292, 30375, 30283, 30550, 30394, 31139, 31196, 30363, 31501, 30321, 30831, 31905, 30695, 31837,
30677, 31668, 31106, 30318, 32161, 31600, 32250, 30732, 31631, 33915, 32519, 33072, 31432, 32231, 34078, 32460,
};
|
73edbf7ff38314609658f6c15723ce3af9a39f3a
|
b0f08154e3eebc7d8465efc57597e52d08d69c18
|
/src/executables/esql_translate.h
|
a4ee64c2bc18309b2825719b236d4771f79f1976
|
[
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
CUBRID/cubrid
|
8f71a0010243b72e43ba887d229210650f4e901e
|
3b952af33230839a1b561a78ecd4b773374b66f8
|
refs/heads/develop
| 2023-08-18T19:16:30.987583
| 2023-08-18T08:18:05
| 2023-08-18T08:18:05
| 52,080,367
| 287
| 294
|
NOASSERTION
| 2023-09-14T21:29:09
| 2016-02-19T10:25:32
|
C
|
UTF-8
|
C
| false
| false
| 2,834
|
h
|
esql_translate.h
|
/*
* Copyright 2008 Search Solution Corporation
* Copyright 2016 CUBRID Corporation
*
* 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.
*
*/
/*
* esql_translate.h - ESQL C Translator Inclusion header file
*/
#ifndef _ESQL_TRANSLATE_H_
#define _ESQL_TRANSLATE_H_
#ident "$Id$"
#include <stdio.h>
#include "esql_host_variable.h"
typedef struct esql_translate_table_s ESQL_TRANSLATE_TABLE;
struct esql_translate_table_s
{
void (*tr_connect) (HOST_REF * db_name, HOST_REF * user_name, HOST_REF * passwd);
void (*tr_disconnect) (void);
void (*tr_commit) (void);
void (*tr_rollback) (void);
void (*tr_static) (const char *stmt, int length, bool repeat, int num_in_vars, HOST_REF * in_vars,
const char *in_desc_name, int num_out_vars, HOST_REF * out_vars, const char *out_desc_name);
void (*tr_open_cs) (int cs_no, const char *stmt, int length, int stmt_no, bool readonly, int num_in_vars,
HOST_REF * in_vars, const char *desc_name);
void (*tr_fetch_cs) (int cs_no, int num_out_vars, HOST_REF * out_vars, const char *desc_name);
void (*tr_update_cs) (int cs_no, const char *text, int length, bool repetitive, int num_in_vars, HOST_REF * in_vars);
void (*tr_delete_cs) (int cs_no);
void (*tr_close_cs) (int cs_no);
void (*tr_prepare_esql) (int stmt_no, HOST_REF * stmt);
void (*tr_describe) (int stmt_no, const char *desc_name);
void (*tr_execute) (int stmt_no, int num_in_vars, HOST_REF * in_vars, const char *in_desc_name, int num_out_vars,
HOST_REF * out_vars, const char *out_desc_name);
void (*tr_execute_immediate) (HOST_REF * stmt);
void (*tr_object_describe) (HOST_REF * obj, int num_attrs, const char **attr_names, const char *desc_name);
void (*tr_object_fetch) (HOST_REF * obj, int num_attrs, const char **attr_names, int num_out_vars,
HOST_REF * out_vars, const char *desc_name);
void (*tr_object_update) (const char *set_expr, int length, bool repetitive, int num_in_vars, HOST_REF * in_vars);
void (*tr_whenever) (WHEN_CONDITION condition, WHEN_ACTION action, const char *name);
void (*tr_set_out_stream) (FILE * out_stream);
void (*tr_set_line_terminator) (const char *);
};
#ifdef __cplusplus
extern "C"
{
#endif
extern ESQL_TRANSLATE_TABLE esql_Translate_table;
#ifdef __cplusplus
}
#endif
#endif /* _ESQL_TRANSLATE_H_ */
|
c02f35f6768ea03a116390abc6d9d5334646319a
|
7744859512f027ef0da8b1bde0f8518e631b98eb
|
/soh/assets/objects/object_gi_bosskey/object_gi_bosskey.h
|
85f56524142537e50831a162f52bd4b0631e6fd9
|
[] |
no_license
|
HarbourMasters/Shipwright
|
7f70b9470e4f9a117f3fe2d6e4deb776b8742182
|
0e7c6585239c0d7ea2c039b8b8cb7eaedf8928a9
|
refs/heads/develop
| 2023-08-31T20:50:56.253521
| 2023-08-30T17:34:06
| 2023-08-30T17:34:06
| 472,575,717
| 2,104
| 459
| null | 2023-09-14T20:29:01
| 2022-03-22T01:42:52
|
C
|
UTF-8
|
C
| false
| false
| 328
|
h
|
object_gi_bosskey.h
|
#pragma once
#include "align_asset_macro.h"
#define dgGiBossKeyDL "__OTR__objects/object_gi_bosskey/gGiBossKeyDL"
static const ALIGN_ASSET(2) char gGiBossKeyDL[] = dgGiBossKeyDL;
#define dgGiBossKeyGemDL "__OTR__objects/object_gi_bosskey/gGiBossKeyGemDL"
static const ALIGN_ASSET(2) char gGiBossKeyGemDL[] = dgGiBossKeyGemDL;
|
1b9f328568a18f6c09ae9299c531e728ed17054a
|
dd6bdce2131e1f608ae711be1426765c9db44122
|
/src/daemon/modules/image/oci/storage/layer_store/graphdriver/overlay2/driver_overlay2_types.h
|
4e01dd227f477e98f9300b60cc38bf7b2412777d
|
[] |
no_license
|
openeuler-mirror/iSulad
|
df3b7bdd285e3ed0e2b572ec02c3cef8a80fa8a9
|
1faaae7ee243bc8b9484ede632302a3cd4bc8670
|
refs/heads/master
| 2023-09-01T04:07:42.243619
| 2023-08-26T01:28:08
| 2023-08-26T01:28:08
| 246,005,159
| 350
| 25
| null | null | null | null |
UTF-8
|
C
| false
| false
| 1,333
|
h
|
driver_overlay2_types.h
|
/******************************************************************************
* Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
* iSulad licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
* Author: lifeng
* Create: 2020-02-27
* Description: provide overlay2 types definition
******************************************************************************/
#ifndef DAEMON_MODULES_IMAGE_OCI_STORAGE_LAYER_STORE_GRAPHDRIVER_OVERLAY2_DRIVER_OVERLAY2_TYPES_H
#define DAEMON_MODULES_IMAGE_OCI_STORAGE_LAYER_STORE_GRAPHDRIVER_OVERLAY2_DRIVER_OVERLAY2_TYPES_H
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
struct overlay_options {
bool override_kernelcheck;
uint64_t default_quota;
const char *mount_program;
bool skip_mount_home;
const char *mount_options;
};
#ifdef __cplusplus
}
#endif
#endif
|
9cb78d28ba4b45c874924e61692e2b403a725709
|
5e4913b3d7b6dfd9f35d9e5f24486bb6b6145125
|
/src/plugins/uname/testmod_uname.c
|
3677b7b094523853bf94496ba1e060d1bf5ff16f
|
[
"BSD-3-Clause"
] |
permissive
|
ElektraInitiative/libelektra
|
ff5d5cfc4bf91d704f58405b14ea694aad3a2edd
|
dbbe4ae4f669c322a8f95f59112d3f5fc370bbd9
|
refs/heads/master
| 2023-08-05T14:54:48.081359
| 2023-08-04T12:40:00
| 2023-08-04T12:40:00
| 21,063,580
| 215
| 170
|
BSD-3-Clause
| 2023-09-07T13:34:30
| 2014-06-21T08:01:04
|
C
|
UTF-8
|
C
| false
| false
| 1,478
|
c
|
testmod_uname.c
|
/**
* @file
*
* @brief
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/
#ifdef HAVE_KDBCONFIG_H
#include "kdbconfig.h"
#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <tests_plugin.h>
void test_structure (void)
{
printf ("Test structure of keys returned from uname plugin");
Key * parentKey = keyNew ("user:/test/key", KEY_END);
KeySet * keys = ksNew (0, KS_END);
KeySet * conf = 0;
PLUGIN_OPEN ("uname");
succeed_if (plugin->kdbGet (plugin, keys, parentKey) == 1, "could not call kdbGet");
succeed_if (ksGetSize (keys) == 6, "size not correct");
succeed_if (ksLookupByName (keys, "user:/test/key", 0), "parentkey not found");
succeed_if (ksLookupByName (keys, "user:/test/key/sysname", 0), "sysname key not found");
succeed_if (ksLookupByName (keys, "user:/test/key/nodename", 0), "nodename key not found");
succeed_if (ksLookupByName (keys, "user:/test/key/release", 0), "release key not found");
succeed_if (ksLookupByName (keys, "user:/test/key/version", 0), "version key not found");
succeed_if (ksLookupByName (keys, "user:/test/key/machine", 0), "machine key not found");
ksDel (keys);
keyDel (parentKey);
PLUGIN_CLOSE ();
}
int main (int argc, char ** argv)
{
printf ("UNAME TESTS\n");
printf ("==================\n\n");
init (argc, argv);
test_structure ();
print_result ("testmod_uname");
return nbError;
}
|
936a91670d2b1f4c97b7323fe9991bdb4eff4fed
|
382a4dacbf7d6e6da096ddac660ba7a40af350cf
|
/src/libraries/TFT_eSPI/TFT_Drivers/ILI9481_Init.h
|
ea6a9056398b2ea38861543e025ef73fb30653c0
|
[
"BSD-3-Clause",
"MIT",
"GPL-1.0-or-later",
"BSD-2-Clause-Views",
"BSD-2-Clause"
] |
permissive
|
Xinyuan-LilyGO/TTGO_TWatch_Library
|
84b1a580ad931caac7407bf110fde5b9248be3c4
|
6a07f3762a4d11c8e5c0c2d6f9340ee4fdaa5fcb
|
refs/heads/master
| 2023-08-18T15:36:22.029944
| 2023-07-03T01:27:29
| 2023-07-03T01:27:29
| 202,286,916
| 776
| 293
|
MIT
| 2023-08-31T05:18:44
| 2019-08-14T06:17:29
|
C
|
UTF-8
|
C
| false
| false
| 1,321
|
h
|
ILI9481_Init.h
|
// This is the command sequence that initialises the ILI9481 driver
//
// This setup information uses simple 8 bit SPI writecommand() and writedata() functions
//
// See ST7735_Setup.h file for an alternative format
// Configure ILI9481 display
writecommand(TFT_SLPOUT);
delay(20);
writecommand(0xD0);
writedata(0x07);
writedata(0x42);
writedata(0x18);
writecommand(0xD1);
writedata(0x00);
writedata(0x07);
writedata(0x10);
writecommand(0xD2);
writedata(0x01);
writedata(0x02);
writecommand(0xC0);
writedata(0x10);
writedata(0x3B);
writedata(0x00);
writedata(0x02);
writedata(0x11);
writecommand(0xC5);
writedata(0x03);
writecommand(0xC8);
writedata(0x00);
writedata(0x32);
writedata(0x36);
writedata(0x45);
writedata(0x06);
writedata(0x16);
writedata(0x37);
writedata(0x75);
writedata(0x77);
writedata(0x54);
writedata(0x0C);
writedata(0x00);
writecommand(TFT_MADCTL);
writedata(0x0A);
writecommand(0x3A);
writedata(0x55);
writecommand(TFT_CASET);
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0x3F);
writecommand(TFT_PASET);
writedata(0x00);
writedata(0x00);
writedata(0x01);
writedata(0xDF);
writecommand(TFT_INVON);
delay(120);
writecommand(TFT_DISPON);
delay(25);
// End of ILI9481 display configuration
|
5eda2adfd60de110f96fa1c4375b586b1f04037b
|
d61b532db0d3e08818338cfaac530a1ced1ffe3b
|
/lang/a68s/liba68s/aclose.c
|
ea0f191a249055e138626f589f85ad4c07529f22
|
[
"LicenseRef-scancode-other-permissive"
] |
permissive
|
davidgiven/ack
|
61049c7a8e95ff61a77b1edd3c22bb290720e276
|
db5a32c68c4a60ca26a3927a799ea662b5b2b0e5
|
refs/heads/default
| 2023-08-29T07:33:12.771205
| 2023-07-08T20:17:27
| 2023-07-08T20:17:27
| 37,686,316
| 376
| 74
|
NOASSERTION
| 2023-07-08T20:17:28
| 2015-06-18T21:33:42
|
C
|
UTF-8
|
C
| false
| false
| 526
|
c
|
aclose.c
|
#include <pc_file.h>
extern _cls(); /* pc runtime routine to close a file */
/* as the following routine is called from a pascal subroutine */
/* and the pascal compiler has been fixed to alwayd supply static links */
/* to non-global externals the parameter 'statlink' is a dummy to fill */
/* the space occupied by the static link. The parameter is first instead */
/* of last because of the C method of passing its parameters backwards */
ACLS(statlink,f) int *statlink; struct file *f; {
_cls(f);
}
|
ad35e981cf672a6a9aea72010d7dc461e2ebb988
|
4e366db41b2bb755c5a1d8fa8149bf619ac7c970
|
/components/x11/libX11/srcs/src/xlibi18n/lcUniConv/ksc5601_1992.h
|
90fb2205c0287ea076192fdec7a5d15f44ecb102
|
[] |
no_license
|
OpenIndiana/oi-userland
|
0af05f09a04dc95d814fce1d56ff1d74f07fd042
|
a40cd6c757239bcf4e1f0d5943a65d9b57fbc3f7
|
refs/heads/oi/hipster
| 2023-09-04T04:41:58.585774
| 2023-09-03T18:00:28
| 2023-09-03T18:00:28
| 10,007,731
| 220
| 334
| null | 2023-09-14T21:48:26
| 2013-05-12T01:29:19
|
C
|
UTF-8
|
C
| false
| false
| 268,331
|
h
|
ksc5601_1992.h
|
/*
* File: ksc5601_1992.h
* Author: William Xue
*
* Created on 02/01/2008
*/
#ifndef _KSC5601_1992_H
#define _KSC5601_1992_H
/*
* johabtoUCS : ksc5601_1992_mbtowc
*/
/*
*#define NOHANG_NUM 6062
*#define USERDEDINE_NUM 1174
*#define HANJ_NUM 4888
*/
#define HANG_NUM 11172
#define FIRST1 (0x8861U)
#define FIRST2 (0xD831U)
#define FIRST3 (0xE031U)
#define UNICODE_REPLACEMENT_CHAR (0xfffd)
#define GETID(c1, c2, first) \
((((unsigned short)(c1)) << 8 | (unsigned short)(c2)) - \
(unsigned short)(first))
/*
*U+FFFD "REPLACEMENT CHARACTER" used to replace an unknown or unprintable character
*see http://en.wikipedia.org/wiki/Unicode_Specials
*/
/*
* (0xFD-0x41+1)*(0xd3-0x88+1) = 189 * 76 = 14364
*/
static const unsigned short ksc5601_1992_hangul[1783*8+4] = {
0xac00, 0xac01, 0xac02, 0xac03, 0xac04, 0xac05, 0xac06, 0xac07,
0xac08, 0xac09, 0xac0a, 0xac0b, 0xac0c, 0xac0d, 0xac0e, 0xac0f,
0xac10, 0xfffd, 0xac11, 0xac12, 0xac13, 0xac14, 0xac15, 0xac16,
0xac17, 0xac18, 0xac19, 0xac1a, 0xac1b, 0xfffd, 0xfffd, 0xfffd,
0xac1c, 0xac1d, 0xac1e, 0xac1f, 0xac20, 0xac21, 0xac22, 0xac23,
0xac24, 0xac25, 0xac26, 0xac27, 0xac28, 0xac29, 0xac2a, 0xac2b,
0xac2c, 0xfffd, 0xac2d, 0xac2e, 0xac2f, 0xac30, 0xac31, 0xac32,
0xac33, 0xac34, 0xac35, 0xac36, 0xac37, 0xfffd, 0xfffd, 0xfffd,
0xac38, 0xac39, 0xac3a, 0xac3b, 0xac3c, 0xac3d, 0xac3e, 0xac3f,
0xac40, 0xac41, 0xac42, 0xac43, 0xac44, 0xac45, 0xac46, 0xac47,
0xac48, 0xfffd, 0xac49, 0xac4a, 0xac4b, 0xac4c, 0xac4d, 0xac4e,
0xac4f, 0xac50, 0xac51, 0xac52, 0xac53, 0xfffd, 0xfffd, 0xfffd,
0xac54, 0xac55, 0xac56, 0xac57, 0xac58, 0xac59, 0xac5a, 0xac5b,
0xac5c, 0xac5d, 0xac5e, 0xac5f, 0xac60, 0xac61, 0xac62, 0xac63,
0xac64, 0xfffd, 0xac65, 0xac66, 0xac67, 0xac68, 0xac69, 0xac6a,
0xac6b, 0xac6c, 0xac6d, 0xac6e, 0xac6f, 0xfffd, 0xfffd, 0xfffd,
0xac70, 0xac71, 0xac72, 0xac73, 0xac74, 0xac75, 0xac76, 0xac77,
0xac78, 0xac79, 0xac7a, 0xac7b, 0xac7c, 0xac7d, 0xac7e, 0xac7f,
0xac80, 0xfffd, 0xac81, 0xac82, 0xac83, 0xac84, 0xac85, 0xac86,
0xac87, 0xac88, 0xac89, 0xac8a, 0xac8b, 0xac8c, 0xac8d, 0xac8e,
0xac8f, 0xac90, 0xac91, 0xac92, 0xac93, 0xac94, 0xac95, 0xac96,
0xac97, 0xac98, 0xac99, 0xac9a, 0xac9b, 0xac9c, 0xfffd, 0xac9d,
0xac9e, 0xac9f, 0xaca0, 0xaca1, 0xaca2, 0xaca3, 0xaca4, 0xaca5,
0xaca6, 0xaca7, 0xfffd, 0xfffd, 0xfffd, 0xaca8, 0xaca9, 0xacaa,
0xacab, 0xacac, 0xacad, 0xacae, 0xacaf, 0xacb0, 0xacb1, 0xacb2,
0xacb3, 0xacb4, 0xacb5, 0xacb6, 0xacb7, 0xacb8, 0xfffd, 0xacb9,
0xacba, 0xacbb, 0xacbc, 0xacbd, 0xacbe, 0xacbf, 0xacc0, 0xacc1,
0xacc2, 0xacc3, 0xfffd, 0xfffd, 0xfffd, 0xacc4, 0xacc5, 0xacc6,
0xacc7, 0xacc8, 0xacc9, 0xacca, 0xaccb, 0xaccc, 0xaccd, 0xacce,
0xaccf, 0xacd0, 0xacd1, 0xacd2, 0xacd3, 0xacd4, 0xfffd, 0xacd5,
0xacd6, 0xacd7, 0xacd8, 0xacd9, 0xacda, 0xacdb, 0xacdc, 0xacdd,
0xacde, 0xacdf, 0xfffd, 0xfffd, 0xfffd, 0xace0, 0xace1, 0xace2,
0xace3, 0xace4, 0xace5, 0xace6, 0xace7, 0xace8, 0xace9, 0xacea,
0xaceb, 0xacec, 0xaced, 0xacee, 0xacef, 0xacf0, 0xfffd, 0xacf1,
0xacf2, 0xacf3, 0xacf4, 0xacf5, 0xacf6, 0xacf7, 0xacf8, 0xacf9,
0xacfa, 0xacfb, 0xfffd, 0xfffd, 0xfffd, 0xacfc, 0xacfd, 0xacfe,
0xacff, 0xad00, 0xad01, 0xad02, 0xad03, 0xad04, 0xad05, 0xad06,
0xad07, 0xad08, 0xad09, 0xad0a, 0xad0b, 0xad0c, 0xfffd, 0xad0d,
0xad0e, 0xad0f, 0xad10, 0xad11, 0xad12, 0xad13, 0xad14, 0xad15,
0xad16, 0xad17, 0xfffd, 0xfffd, 0xfffd, 0xad18, 0xad19, 0xad1a,
0xad1b, 0xad1c, 0xad1d, 0xad1e, 0xad1f, 0xad20, 0xad21, 0xad22,
0xad23, 0xad24, 0xad25, 0xad26, 0xad27, 0xad28, 0xfffd, 0xad29,
0xad2a, 0xad2b, 0xad2c, 0xad2d, 0xad2e, 0xad2f, 0xad30, 0xad31,
0xad32, 0xad33, 0xad34, 0xad35, 0xad36, 0xad37, 0xad38, 0xad39,
0xad3a, 0xad3b, 0xad3c, 0xad3d, 0xad3e, 0xad3f, 0xad40, 0xad41,
0xad42, 0xad43, 0xad44, 0xfffd, 0xad45, 0xad46, 0xad47, 0xad48,
0xad49, 0xad4a, 0xad4b, 0xad4c, 0xad4d, 0xad4e, 0xad4f, 0xfffd,
0xfffd, 0xfffd, 0xad50, 0xad51, 0xad52, 0xad53, 0xad54, 0xad55,
0xad56, 0xad57, 0xad58, 0xad59, 0xad5a, 0xad5b, 0xad5c, 0xad5d,
0xad5e, 0xad5f, 0xad60, 0xfffd, 0xad61, 0xad62, 0xad63, 0xad64,
0xad65, 0xad66, 0xad67, 0xad68, 0xad69, 0xad6a, 0xad6b, 0xfffd,
0xfffd, 0xfffd, 0xad6c, 0xad6d, 0xad6e, 0xad6f, 0xad70, 0xad71,
0xad72, 0xad73, 0xad74, 0xad75, 0xad76, 0xad77, 0xad78, 0xad79,
0xad7a, 0xad7b, 0xad7c, 0xfffd, 0xad7d, 0xad7e, 0xad7f, 0xad80,
0xad81, 0xad82, 0xad83, 0xad84, 0xad85, 0xad86, 0xad87, 0xfffd,
0xfffd, 0xfffd, 0xad88, 0xad89, 0xad8a, 0xad8b, 0xad8c, 0xad8d,
0xad8e, 0xad8f, 0xad90, 0xad91, 0xad92, 0xad93, 0xad94, 0xad95,
0xad96, 0xad97, 0xad98, 0xfffd, 0xad99, 0xad9a, 0xad9b, 0xad9c,
0xad9d, 0xad9e, 0xad9f, 0xada0, 0xada1, 0xada2, 0xada3, 0xfffd,
0xfffd, 0xfffd, 0xada4, 0xada5, 0xada6, 0xada7, 0xada8, 0xada9,
0xadaa, 0xadab, 0xadac, 0xadad, 0xadae, 0xadaf, 0xadb0, 0xadb1,
0xadb2, 0xadb3, 0xadb4, 0xfffd, 0xadb5, 0xadb6, 0xadb7, 0xadb8,
0xadb9, 0xadba, 0xadbb, 0xadbc, 0xadbd, 0xadbe, 0xadbf, 0xfffd,
0xfffd, 0xfffd, 0xadc0, 0xadc1, 0xadc2, 0xadc3, 0xadc4, 0xadc5,
0xadc6, 0xadc7, 0xadc8, 0xadc9, 0xadca, 0xadcb, 0xadcc, 0xadcd,
0xadce, 0xadcf, 0xadd0, 0xfffd, 0xadd1, 0xadd2, 0xadd3, 0xadd4,
0xadd5, 0xadd6, 0xadd7, 0xadd8, 0xadd9, 0xadda, 0xaddb, 0xaddc,
0xaddd, 0xadde, 0xaddf, 0xade0, 0xade1, 0xade2, 0xade3, 0xade4,
0xade5, 0xade6, 0xade7, 0xade8, 0xade9, 0xadea, 0xadeb, 0xadec,
0xfffd, 0xaded, 0xadee, 0xadef, 0xadf0, 0xadf1, 0xadf2, 0xadf3,
0xadf4, 0xadf5, 0xadf6, 0xadf7, 0xfffd, 0xfffd, 0xfffd, 0xadf8,
0xadf9, 0xadfa, 0xadfb, 0xadfc, 0xadfd, 0xadfe, 0xadff, 0xae00,
0xae01, 0xae02, 0xae03, 0xae04, 0xae05, 0xae06, 0xae07, 0xae08,
0xfffd, 0xae09, 0xae0a, 0xae0b, 0xae0c, 0xae0d, 0xae0e, 0xae0f,
0xae10, 0xae11, 0xae12, 0xae13, 0xfffd, 0xfffd, 0xfffd, 0xae14,
0xae15, 0xae16, 0xae17, 0xae18, 0xae19, 0xae1a, 0xae1b, 0xae1c,
0xae1d, 0xae1e, 0xae1f, 0xae20, 0xae21, 0xae22, 0xae23, 0xae24,
0xfffd, 0xae25, 0xae26, 0xae27, 0xae28, 0xae29, 0xae2a, 0xae2b,
0xae2c, 0xae2d, 0xae2e, 0xae2f, 0xfffd, 0xfffd, 0xfffd, 0xae30,
0xae31, 0xae32, 0xae33, 0xae34, 0xae35, 0xae36, 0xae37, 0xae38,
0xae39, 0xae3a, 0xae3b, 0xae3c, 0xae3d, 0xae3e, 0xae3f, 0xae40,
0xfffd, 0xae41, 0xae42, 0xae43, 0xae44, 0xae45, 0xae46, 0xae47,
0xae48, 0xae49, 0xae4a, 0xae4b, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xae4c, 0xae4d, 0xae4e, 0xae4f,
0xae50, 0xae51, 0xae52, 0xae53, 0xae54, 0xae55, 0xae56, 0xae57,
0xae58, 0xae59, 0xae5a, 0xae5b, 0xae5c, 0xfffd, 0xae5d, 0xae5e,
0xae5f, 0xae60, 0xae61, 0xae62, 0xae63, 0xae64, 0xae65, 0xae66,
0xae67, 0xfffd, 0xfffd, 0xfffd, 0xae68, 0xae69, 0xae6a, 0xae6b,
0xae6c, 0xae6d, 0xae6e, 0xae6f, 0xae70, 0xae71, 0xae72, 0xae73,
0xae74, 0xae75, 0xae76, 0xae77, 0xae78, 0xfffd, 0xae79, 0xae7a,
0xae7b, 0xae7c, 0xae7d, 0xae7e, 0xae7f, 0xae80, 0xae81, 0xae82,
0xae83, 0xfffd, 0xfffd, 0xfffd, 0xae84, 0xae85, 0xae86, 0xae87,
0xae88, 0xae89, 0xae8a, 0xae8b, 0xae8c, 0xae8d, 0xae8e, 0xae8f,
0xae90, 0xae91, 0xae92, 0xae93, 0xae94, 0xfffd, 0xae95, 0xae96,
0xae97, 0xae98, 0xae99, 0xae9a, 0xae9b, 0xae9c, 0xae9d, 0xae9e,
0xae9f, 0xfffd, 0xfffd, 0xfffd, 0xaea0, 0xaea1, 0xaea2, 0xaea3,
0xaea4, 0xaea5, 0xaea6, 0xaea7, 0xaea8, 0xaea9, 0xaeaa, 0xaeab,
0xaeac, 0xaead, 0xaeae, 0xaeaf, 0xaeb0, 0xfffd, 0xaeb1, 0xaeb2,
0xaeb3, 0xaeb4, 0xaeb5, 0xaeb6, 0xaeb7, 0xaeb8, 0xaeb9, 0xaeba,
0xaebb, 0xfffd, 0xfffd, 0xfffd, 0xaebc, 0xaebd, 0xaebe, 0xaebf,
0xaec0, 0xaec1, 0xaec2, 0xaec3, 0xaec4, 0xaec5, 0xaec6, 0xaec7,
0xaec8, 0xaec9, 0xaeca, 0xaecb, 0xaecc, 0xfffd, 0xaecd, 0xaece,
0xaecf, 0xaed0, 0xaed1, 0xaed2, 0xaed3, 0xaed4, 0xaed5, 0xaed6,
0xaed7, 0xaed8, 0xaed9, 0xaeda, 0xaedb, 0xaedc, 0xaedd, 0xaede,
0xaedf, 0xaee0, 0xaee1, 0xaee2, 0xaee3, 0xaee4, 0xaee5, 0xaee6,
0xaee7, 0xaee8, 0xfffd, 0xaee9, 0xaeea, 0xaeeb, 0xaeec, 0xaeed,
0xaeee, 0xaeef, 0xaef0, 0xaef1, 0xaef2, 0xaef3, 0xfffd, 0xfffd,
0xfffd, 0xaef4, 0xaef5, 0xaef6, 0xaef7, 0xaef8, 0xaef9, 0xaefa,
0xaefb, 0xaefc, 0xaefd, 0xaefe, 0xaeff, 0xaf00, 0xaf01, 0xaf02,
0xaf03, 0xaf04, 0xfffd, 0xaf05, 0xaf06, 0xaf07, 0xaf08, 0xaf09,
0xaf0a, 0xaf0b, 0xaf0c, 0xaf0d, 0xaf0e, 0xaf0f, 0xfffd, 0xfffd,
0xfffd, 0xaf10, 0xaf11, 0xaf12, 0xaf13, 0xaf14, 0xaf15, 0xaf16,
0xaf17, 0xaf18, 0xaf19, 0xaf1a, 0xaf1b, 0xaf1c, 0xaf1d, 0xaf1e,
0xaf1f, 0xaf20, 0xfffd, 0xaf21, 0xaf22, 0xaf23, 0xaf24, 0xaf25,
0xaf26, 0xaf27, 0xaf28, 0xaf29, 0xaf2a, 0xaf2b, 0xfffd, 0xfffd,
0xfffd, 0xaf2c, 0xaf2d, 0xaf2e, 0xaf2f, 0xaf30, 0xaf31, 0xaf32,
0xaf33, 0xaf34, 0xaf35, 0xaf36, 0xaf37, 0xaf38, 0xaf39, 0xaf3a,
0xaf3b, 0xaf3c, 0xfffd, 0xaf3d, 0xaf3e, 0xaf3f, 0xaf40, 0xaf41,
0xaf42, 0xaf43, 0xaf44, 0xaf45, 0xaf46, 0xaf47, 0xfffd, 0xfffd,
0xfffd, 0xaf48, 0xaf49, 0xaf4a, 0xaf4b, 0xaf4c, 0xaf4d, 0xaf4e,
0xaf4f, 0xaf50, 0xaf51, 0xaf52, 0xaf53, 0xaf54, 0xaf55, 0xaf56,
0xaf57, 0xaf58, 0xfffd, 0xaf59, 0xaf5a, 0xaf5b, 0xaf5c, 0xaf5d,
0xaf5e, 0xaf5f, 0xaf60, 0xaf61, 0xaf62, 0xaf63, 0xfffd, 0xfffd,
0xfffd, 0xaf64, 0xaf65, 0xaf66, 0xaf67, 0xaf68, 0xaf69, 0xaf6a,
0xaf6b, 0xaf6c, 0xaf6d, 0xaf6e, 0xaf6f, 0xaf70, 0xaf71, 0xaf72,
0xaf73, 0xaf74, 0xfffd, 0xaf75, 0xaf76, 0xaf77, 0xaf78, 0xaf79,
0xaf7a, 0xaf7b, 0xaf7c, 0xaf7d, 0xaf7e, 0xaf7f, 0xaf80, 0xaf81,
0xaf82, 0xaf83, 0xaf84, 0xaf85, 0xaf86, 0xaf87, 0xaf88, 0xaf89,
0xaf8a, 0xaf8b, 0xaf8c, 0xaf8d, 0xaf8e, 0xaf8f, 0xaf90, 0xfffd,
0xaf91, 0xaf92, 0xaf93, 0xaf94, 0xaf95, 0xaf96, 0xaf97, 0xaf98,
0xaf99, 0xaf9a, 0xaf9b, 0xfffd, 0xfffd, 0xfffd, 0xaf9c, 0xaf9d,
0xaf9e, 0xaf9f, 0xafa0, 0xafa1, 0xafa2, 0xafa3, 0xafa4, 0xafa5,
0xafa6, 0xafa7, 0xafa8, 0xafa9, 0xafaa, 0xafab, 0xafac, 0xfffd,
0xafad, 0xafae, 0xafaf, 0xafb0, 0xafb1, 0xafb2, 0xafb3, 0xafb4,
0xafb5, 0xafb6, 0xafb7, 0xfffd, 0xfffd, 0xfffd, 0xafb8, 0xafb9,
0xafba, 0xafbb, 0xafbc, 0xafbd, 0xafbe, 0xafbf, 0xafc0, 0xafc1,
0xafc2, 0xafc3, 0xafc4, 0xafc5, 0xafc6, 0xafc7, 0xafc8, 0xfffd,
0xafc9, 0xafca, 0xafcb, 0xafcc, 0xafcd, 0xafce, 0xafcf, 0xafd0,
0xafd1, 0xafd2, 0xafd3, 0xfffd, 0xfffd, 0xfffd, 0xafd4, 0xafd5,
0xafd6, 0xafd7, 0xafd8, 0xafd9, 0xafda, 0xafdb, 0xafdc, 0xafdd,
0xafde, 0xafdf, 0xafe0, 0xafe1, 0xafe2, 0xafe3, 0xafe4, 0xfffd,
0xafe5, 0xafe6, 0xafe7, 0xafe8, 0xafe9, 0xafea, 0xafeb, 0xafec,
0xafed, 0xafee, 0xafef, 0xfffd, 0xfffd, 0xfffd, 0xaff0, 0xaff1,
0xaff2, 0xaff3, 0xaff4, 0xaff5, 0xaff6, 0xaff7, 0xaff8, 0xaff9,
0xaffa, 0xaffb, 0xaffc, 0xaffd, 0xaffe, 0xafff, 0xb000, 0xfffd,
0xb001, 0xb002, 0xb003, 0xb004, 0xb005, 0xb006, 0xb007, 0xb008,
0xb009, 0xb00a, 0xb00b, 0xfffd, 0xfffd, 0xfffd, 0xb00c, 0xb00d,
0xb00e, 0xb00f, 0xb010, 0xb011, 0xb012, 0xb013, 0xb014, 0xb015,
0xb016, 0xb017, 0xb018, 0xb019, 0xb01a, 0xb01b, 0xb01c, 0xfffd,
0xb01d, 0xb01e, 0xb01f, 0xb020, 0xb021, 0xb022, 0xb023, 0xb024,
0xb025, 0xb026, 0xb027, 0xb028, 0xb029, 0xb02a, 0xb02b, 0xb02c,
0xb02d, 0xb02e, 0xb02f, 0xb030, 0xb031, 0xb032, 0xb033, 0xb034,
0xb035, 0xb036, 0xb037, 0xb038, 0xfffd, 0xb039, 0xb03a, 0xb03b,
0xb03c, 0xb03d, 0xb03e, 0xb03f, 0xb040, 0xb041, 0xb042, 0xb043,
0xfffd, 0xfffd, 0xfffd, 0xb044, 0xb045, 0xb046, 0xb047, 0xb048,
0xb049, 0xb04a, 0xb04b, 0xb04c, 0xb04d, 0xb04e, 0xb04f, 0xb050,
0xb051, 0xb052, 0xb053, 0xb054, 0xfffd, 0xb055, 0xb056, 0xb057,
0xb058, 0xb059, 0xb05a, 0xb05b, 0xb05c, 0xb05d, 0xb05e, 0xb05f,
0xfffd, 0xfffd, 0xfffd, 0xb060, 0xb061, 0xb062, 0xb063, 0xb064,
0xb065, 0xb066, 0xb067, 0xb068, 0xb069, 0xb06a, 0xb06b, 0xb06c,
0xb06d, 0xb06e, 0xb06f, 0xb070, 0xfffd, 0xb071, 0xb072, 0xb073,
0xb074, 0xb075, 0xb076, 0xb077, 0xb078, 0xb079, 0xb07a, 0xb07b,
0xfffd, 0xfffd, 0xfffd, 0xb07c, 0xb07d, 0xb07e, 0xb07f, 0xb080,
0xb081, 0xb082, 0xb083, 0xb084, 0xb085, 0xb086, 0xb087, 0xb088,
0xb089, 0xb08a, 0xb08b, 0xb08c, 0xfffd, 0xb08d, 0xb08e, 0xb08f,
0xb090, 0xb091, 0xb092, 0xb093, 0xb094, 0xb095, 0xb096, 0xb097,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xb098, 0xb099, 0xb09a, 0xb09b, 0xb09c, 0xb09d, 0xb09e, 0xb09f,
0xb0a0, 0xb0a1, 0xb0a2, 0xb0a3, 0xb0a4, 0xb0a5, 0xb0a6, 0xb0a7,
0xb0a8, 0xfffd, 0xb0a9, 0xb0aa, 0xb0ab, 0xb0ac, 0xb0ad, 0xb0ae,
0xb0af, 0xb0b0, 0xb0b1, 0xb0b2, 0xb0b3, 0xfffd, 0xfffd, 0xfffd,
0xb0b4, 0xb0b5, 0xb0b6, 0xb0b7, 0xb0b8, 0xb0b9, 0xb0ba, 0xb0bb,
0xb0bc, 0xb0bd, 0xb0be, 0xb0bf, 0xb0c0, 0xb0c1, 0xb0c2, 0xb0c3,
0xb0c4, 0xfffd, 0xb0c5, 0xb0c6, 0xb0c7, 0xb0c8, 0xb0c9, 0xb0ca,
0xb0cb, 0xb0cc, 0xb0cd, 0xb0ce, 0xb0cf, 0xfffd, 0xfffd, 0xfffd,
0xb0d0, 0xb0d1, 0xb0d2, 0xb0d3, 0xb0d4, 0xb0d5, 0xb0d6, 0xb0d7,
0xb0d8, 0xb0d9, 0xb0da, 0xb0db, 0xb0dc, 0xb0dd, 0xb0de, 0xb0df,
0xb0e0, 0xfffd, 0xb0e1, 0xb0e2, 0xb0e3, 0xb0e4, 0xb0e5, 0xb0e6,
0xb0e7, 0xb0e8, 0xb0e9, 0xb0ea, 0xb0eb, 0xfffd, 0xfffd, 0xfffd,
0xb0ec, 0xb0ed, 0xb0ee, 0xb0ef, 0xb0f0, 0xb0f1, 0xb0f2, 0xb0f3,
0xb0f4, 0xb0f5, 0xb0f6, 0xb0f7, 0xb0f8, 0xb0f9, 0xb0fa, 0xb0fb,
0xb0fc, 0xfffd, 0xb0fd, 0xb0fe, 0xb0ff, 0xb100, 0xb101, 0xb102,
0xb103, 0xb104, 0xb105, 0xb106, 0xb107, 0xfffd, 0xfffd, 0xfffd,
0xb108, 0xb109, 0xb10a, 0xb10b, 0xb10c, 0xb10d, 0xb10e, 0xb10f,
0xb110, 0xb111, 0xb112, 0xb113, 0xb114, 0xb115, 0xb116, 0xb117,
0xb118, 0xfffd, 0xb119, 0xb11a, 0xb11b, 0xb11c, 0xb11d, 0xb11e,
0xb11f, 0xb120, 0xb121, 0xb122, 0xb123, 0xb124, 0xb125, 0xb126,
0xb127, 0xb128, 0xb129, 0xb12a, 0xb12b, 0xb12c, 0xb12d, 0xb12e,
0xb12f, 0xb130, 0xb131, 0xb132, 0xb133, 0xb134, 0xfffd, 0xb135,
0xb136, 0xb137, 0xb138, 0xb139, 0xb13a, 0xb13b, 0xb13c, 0xb13d,
0xb13e, 0xb13f, 0xfffd, 0xfffd, 0xfffd, 0xb140, 0xb141, 0xb142,
0xb143, 0xb144, 0xb145, 0xb146, 0xb147, 0xb148, 0xb149, 0xb14a,
0xb14b, 0xb14c, 0xb14d, 0xb14e, 0xb14f, 0xb150, 0xfffd, 0xb151,
0xb152, 0xb153, 0xb154, 0xb155, 0xb156, 0xb157, 0xb158, 0xb159,
0xb15a, 0xb15b, 0xfffd, 0xfffd, 0xfffd, 0xb15c, 0xb15d, 0xb15e,
0xb15f, 0xb160, 0xb161, 0xb162, 0xb163, 0xb164, 0xb165, 0xb166,
0xb167, 0xb168, 0xb169, 0xb16a, 0xb16b, 0xb16c, 0xfffd, 0xb16d,
0xb16e, 0xb16f, 0xb170, 0xb171, 0xb172, 0xb173, 0xb174, 0xb175,
0xb176, 0xb177, 0xfffd, 0xfffd, 0xfffd, 0xb178, 0xb179, 0xb17a,
0xb17b, 0xb17c, 0xb17d, 0xb17e, 0xb17f, 0xb180, 0xb181, 0xb182,
0xb183, 0xb184, 0xb185, 0xb186, 0xb187, 0xb188, 0xfffd, 0xb189,
0xb18a, 0xb18b, 0xb18c, 0xb18d, 0xb18e, 0xb18f, 0xb190, 0xb191,
0xb192, 0xb193, 0xfffd, 0xfffd, 0xfffd, 0xb194, 0xb195, 0xb196,
0xb197, 0xb198, 0xb199, 0xb19a, 0xb19b, 0xb19c, 0xb19d, 0xb19e,
0xb19f, 0xb1a0, 0xb1a1, 0xb1a2, 0xb1a3, 0xb1a4, 0xfffd, 0xb1a5,
0xb1a6, 0xb1a7, 0xb1a8, 0xb1a9, 0xb1aa, 0xb1ab, 0xb1ac, 0xb1ad,
0xb1ae, 0xb1af, 0xfffd, 0xfffd, 0xfffd, 0xb1b0, 0xb1b1, 0xb1b2,
0xb1b3, 0xb1b4, 0xb1b5, 0xb1b6, 0xb1b7, 0xb1b8, 0xb1b9, 0xb1ba,
0xb1bb, 0xb1bc, 0xb1bd, 0xb1be, 0xb1bf, 0xb1c0, 0xfffd, 0xb1c1,
0xb1c2, 0xb1c3, 0xb1c4, 0xb1c5, 0xb1c6, 0xb1c7, 0xb1c8, 0xb1c9,
0xb1ca, 0xb1cb, 0xb1cc, 0xb1cd, 0xb1ce, 0xb1cf, 0xb1d0, 0xb1d1,
0xb1d2, 0xb1d3, 0xb1d4, 0xb1d5, 0xb1d6, 0xb1d7, 0xb1d8, 0xb1d9,
0xb1da, 0xb1db, 0xb1dc, 0xfffd, 0xb1dd, 0xb1de, 0xb1df, 0xb1e0,
0xb1e1, 0xb1e2, 0xb1e3, 0xb1e4, 0xb1e5, 0xb1e6, 0xb1e7, 0xfffd,
0xfffd, 0xfffd, 0xb1e8, 0xb1e9, 0xb1ea, 0xb1eb, 0xb1ec, 0xb1ed,
0xb1ee, 0xb1ef, 0xb1f0, 0xb1f1, 0xb1f2, 0xb1f3, 0xb1f4, 0xb1f5,
0xb1f6, 0xb1f7, 0xb1f8, 0xfffd, 0xb1f9, 0xb1fa, 0xb1fb, 0xb1fc,
0xb1fd, 0xb1fe, 0xb1ff, 0xb200, 0xb201, 0xb202, 0xb203, 0xfffd,
0xfffd, 0xfffd, 0xb204, 0xb205, 0xb206, 0xb207, 0xb208, 0xb209,
0xb20a, 0xb20b, 0xb20c, 0xb20d, 0xb20e, 0xb20f, 0xb210, 0xb211,
0xb212, 0xb213, 0xb214, 0xfffd, 0xb215, 0xb216, 0xb217, 0xb218,
0xb219, 0xb21a, 0xb21b, 0xb21c, 0xb21d, 0xb21e, 0xb21f, 0xfffd,
0xfffd, 0xfffd, 0xb220, 0xb221, 0xb222, 0xb223, 0xb224, 0xb225,
0xb226, 0xb227, 0xb228, 0xb229, 0xb22a, 0xb22b, 0xb22c, 0xb22d,
0xb22e, 0xb22f, 0xb230, 0xfffd, 0xb231, 0xb232, 0xb233, 0xb234,
0xb235, 0xb236, 0xb237, 0xb238, 0xb239, 0xb23a, 0xb23b, 0xfffd,
0xfffd, 0xfffd, 0xb23c, 0xb23d, 0xb23e, 0xb23f, 0xb240, 0xb241,
0xb242, 0xb243, 0xb244, 0xb245, 0xb246, 0xb247, 0xb248, 0xb249,
0xb24a, 0xb24b, 0xb24c, 0xfffd, 0xb24d, 0xb24e, 0xb24f, 0xb250,
0xb251, 0xb252, 0xb253, 0xb254, 0xb255, 0xb256, 0xb257, 0xfffd,
0xfffd, 0xfffd, 0xb258, 0xb259, 0xb25a, 0xb25b, 0xb25c, 0xb25d,
0xb25e, 0xb25f, 0xb260, 0xb261, 0xb262, 0xb263, 0xb264, 0xb265,
0xb266, 0xb267, 0xb268, 0xfffd, 0xb269, 0xb26a, 0xb26b, 0xb26c,
0xb26d, 0xb26e, 0xb26f, 0xb270, 0xb271, 0xb272, 0xb273, 0xb274,
0xb275, 0xb276, 0xb277, 0xb278, 0xb279, 0xb27a, 0xb27b, 0xb27c,
0xb27d, 0xb27e, 0xb27f, 0xb280, 0xb281, 0xb282, 0xb283, 0xb284,
0xfffd, 0xb285, 0xb286, 0xb287, 0xb288, 0xb289, 0xb28a, 0xb28b,
0xb28c, 0xb28d, 0xb28e, 0xb28f, 0xfffd, 0xfffd, 0xfffd, 0xb290,
0xb291, 0xb292, 0xb293, 0xb294, 0xb295, 0xb296, 0xb297, 0xb298,
0xb299, 0xb29a, 0xb29b, 0xb29c, 0xb29d, 0xb29e, 0xb29f, 0xb2a0,
0xfffd, 0xb2a1, 0xb2a2, 0xb2a3, 0xb2a4, 0xb2a5, 0xb2a6, 0xb2a7,
0xb2a8, 0xb2a9, 0xb2aa, 0xb2ab, 0xfffd, 0xfffd, 0xfffd, 0xb2ac,
0xb2ad, 0xb2ae, 0xb2af, 0xb2b0, 0xb2b1, 0xb2b2, 0xb2b3, 0xb2b4,
0xb2b5, 0xb2b6, 0xb2b7, 0xb2b8, 0xb2b9, 0xb2ba, 0xb2bb, 0xb2bc,
0xfffd, 0xb2bd, 0xb2be, 0xb2bf, 0xb2c0, 0xb2c1, 0xb2c2, 0xb2c3,
0xb2c4, 0xb2c5, 0xb2c6, 0xb2c7, 0xfffd, 0xfffd, 0xfffd, 0xb2c8,
0xb2c9, 0xb2ca, 0xb2cb, 0xb2cc, 0xb2cd, 0xb2ce, 0xb2cf, 0xb2d0,
0xb2d1, 0xb2d2, 0xb2d3, 0xb2d4, 0xb2d5, 0xb2d6, 0xb2d7, 0xb2d8,
0xfffd, 0xb2d9, 0xb2da, 0xb2db, 0xb2dc, 0xb2dd, 0xb2de, 0xb2df,
0xb2e0, 0xb2e1, 0xb2e2, 0xb2e3, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb2e4, 0xb2e5, 0xb2e6, 0xb2e7,
0xb2e8, 0xb2e9, 0xb2ea, 0xb2eb, 0xb2ec, 0xb2ed, 0xb2ee, 0xb2ef,
0xb2f0, 0xb2f1, 0xb2f2, 0xb2f3, 0xb2f4, 0xfffd, 0xb2f5, 0xb2f6,
0xb2f7, 0xb2f8, 0xb2f9, 0xb2fa, 0xb2fb, 0xb2fc, 0xb2fd, 0xb2fe,
0xb2ff, 0xfffd, 0xfffd, 0xfffd, 0xb300, 0xb301, 0xb302, 0xb303,
0xb304, 0xb305, 0xb306, 0xb307, 0xb308, 0xb309, 0xb30a, 0xb30b,
0xb30c, 0xb30d, 0xb30e, 0xb30f, 0xb310, 0xfffd, 0xb311, 0xb312,
0xb313, 0xb314, 0xb315, 0xb316, 0xb317, 0xb318, 0xb319, 0xb31a,
0xb31b, 0xfffd, 0xfffd, 0xfffd, 0xb31c, 0xb31d, 0xb31e, 0xb31f,
0xb320, 0xb321, 0xb322, 0xb323, 0xb324, 0xb325, 0xb326, 0xb327,
0xb328, 0xb329, 0xb32a, 0xb32b, 0xb32c, 0xfffd, 0xb32d, 0xb32e,
0xb32f, 0xb330, 0xb331, 0xb332, 0xb333, 0xb334, 0xb335, 0xb336,
0xb337, 0xfffd, 0xfffd, 0xfffd, 0xb338, 0xb339, 0xb33a, 0xb33b,
0xb33c, 0xb33d, 0xb33e, 0xb33f, 0xb340, 0xb341, 0xb342, 0xb343,
0xb344, 0xb345, 0xb346, 0xb347, 0xb348, 0xfffd, 0xb349, 0xb34a,
0xb34b, 0xb34c, 0xb34d, 0xb34e, 0xb34f, 0xb350, 0xb351, 0xb352,
0xb353, 0xfffd, 0xfffd, 0xfffd, 0xb354, 0xb355, 0xb356, 0xb357,
0xb358, 0xb359, 0xb35a, 0xb35b, 0xb35c, 0xb35d, 0xb35e, 0xb35f,
0xb360, 0xb361, 0xb362, 0xb363, 0xb364, 0xfffd, 0xb365, 0xb366,
0xb367, 0xb368, 0xb369, 0xb36a, 0xb36b, 0xb36c, 0xb36d, 0xb36e,
0xb36f, 0xb370, 0xb371, 0xb372, 0xb373, 0xb374, 0xb375, 0xb376,
0xb377, 0xb378, 0xb379, 0xb37a, 0xb37b, 0xb37c, 0xb37d, 0xb37e,
0xb37f, 0xb380, 0xfffd, 0xb381, 0xb382, 0xb383, 0xb384, 0xb385,
0xb386, 0xb387, 0xb388, 0xb389, 0xb38a, 0xb38b, 0xfffd, 0xfffd,
0xfffd, 0xb38c, 0xb38d, 0xb38e, 0xb38f, 0xb390, 0xb391, 0xb392,
0xb393, 0xb394, 0xb395, 0xb396, 0xb397, 0xb398, 0xb399, 0xb39a,
0xb39b, 0xb39c, 0xfffd, 0xb39d, 0xb39e, 0xb39f, 0xb3a0, 0xb3a1,
0xb3a2, 0xb3a3, 0xb3a4, 0xb3a5, 0xb3a6, 0xb3a7, 0xfffd, 0xfffd,
0xfffd, 0xb3a8, 0xb3a9, 0xb3aa, 0xb3ab, 0xb3ac, 0xb3ad, 0xb3ae,
0xb3af, 0xb3b0, 0xb3b1, 0xb3b2, 0xb3b3, 0xb3b4, 0xb3b5, 0xb3b6,
0xb3b7, 0xb3b8, 0xfffd, 0xb3b9, 0xb3ba, 0xb3bb, 0xb3bc, 0xb3bd,
0xb3be, 0xb3bf, 0xb3c0, 0xb3c1, 0xb3c2, 0xb3c3, 0xfffd, 0xfffd,
0xfffd, 0xb3c4, 0xb3c5, 0xb3c6, 0xb3c7, 0xb3c8, 0xb3c9, 0xb3ca,
0xb3cb, 0xb3cc, 0xb3cd, 0xb3ce, 0xb3cf, 0xb3d0, 0xb3d1, 0xb3d2,
0xb3d3, 0xb3d4, 0xfffd, 0xb3d5, 0xb3d6, 0xb3d7, 0xb3d8, 0xb3d9,
0xb3da, 0xb3db, 0xb3dc, 0xb3dd, 0xb3de, 0xb3df, 0xfffd, 0xfffd,
0xfffd, 0xb3e0, 0xb3e1, 0xb3e2, 0xb3e3, 0xb3e4, 0xb3e5, 0xb3e6,
0xb3e7, 0xb3e8, 0xb3e9, 0xb3ea, 0xb3eb, 0xb3ec, 0xb3ed, 0xb3ee,
0xb3ef, 0xb3f0, 0xfffd, 0xb3f1, 0xb3f2, 0xb3f3, 0xb3f4, 0xb3f5,
0xb3f6, 0xb3f7, 0xb3f8, 0xb3f9, 0xb3fa, 0xb3fb, 0xfffd, 0xfffd,
0xfffd, 0xb3fc, 0xb3fd, 0xb3fe, 0xb3ff, 0xb400, 0xb401, 0xb402,
0xb403, 0xb404, 0xb405, 0xb406, 0xb407, 0xb408, 0xb409, 0xb40a,
0xb40b, 0xb40c, 0xfffd, 0xb40d, 0xb40e, 0xb40f, 0xb410, 0xb411,
0xb412, 0xb413, 0xb414, 0xb415, 0xb416, 0xb417, 0xb418, 0xb419,
0xb41a, 0xb41b, 0xb41c, 0xb41d, 0xb41e, 0xb41f, 0xb420, 0xb421,
0xb422, 0xb423, 0xb424, 0xb425, 0xb426, 0xb427, 0xb428, 0xfffd,
0xb429, 0xb42a, 0xb42b, 0xb42c, 0xb42d, 0xb42e, 0xb42f, 0xb430,
0xb431, 0xb432, 0xb433, 0xfffd, 0xfffd, 0xfffd, 0xb434, 0xb435,
0xb436, 0xb437, 0xb438, 0xb439, 0xb43a, 0xb43b, 0xb43c, 0xb43d,
0xb43e, 0xb43f, 0xb440, 0xb441, 0xb442, 0xb443, 0xb444, 0xfffd,
0xb445, 0xb446, 0xb447, 0xb448, 0xb449, 0xb44a, 0xb44b, 0xb44c,
0xb44d, 0xb44e, 0xb44f, 0xfffd, 0xfffd, 0xfffd, 0xb450, 0xb451,
0xb452, 0xb453, 0xb454, 0xb455, 0xb456, 0xb457, 0xb458, 0xb459,
0xb45a, 0xb45b, 0xb45c, 0xb45d, 0xb45e, 0xb45f, 0xb460, 0xfffd,
0xb461, 0xb462, 0xb463, 0xb464, 0xb465, 0xb466, 0xb467, 0xb468,
0xb469, 0xb46a, 0xb46b, 0xfffd, 0xfffd, 0xfffd, 0xb46c, 0xb46d,
0xb46e, 0xb46f, 0xb470, 0xb471, 0xb472, 0xb473, 0xb474, 0xb475,
0xb476, 0xb477, 0xb478, 0xb479, 0xb47a, 0xb47b, 0xb47c, 0xfffd,
0xb47d, 0xb47e, 0xb47f, 0xb480, 0xb481, 0xb482, 0xb483, 0xb484,
0xb485, 0xb486, 0xb487, 0xfffd, 0xfffd, 0xfffd, 0xb488, 0xb489,
0xb48a, 0xb48b, 0xb48c, 0xb48d, 0xb48e, 0xb48f, 0xb490, 0xb491,
0xb492, 0xb493, 0xb494, 0xb495, 0xb496, 0xb497, 0xb498, 0xfffd,
0xb499, 0xb49a, 0xb49b, 0xb49c, 0xb49d, 0xb49e, 0xb49f, 0xb4a0,
0xb4a1, 0xb4a2, 0xb4a3, 0xfffd, 0xfffd, 0xfffd, 0xb4a4, 0xb4a5,
0xb4a6, 0xb4a7, 0xb4a8, 0xb4a9, 0xb4aa, 0xb4ab, 0xb4ac, 0xb4ad,
0xb4ae, 0xb4af, 0xb4b0, 0xb4b1, 0xb4b2, 0xb4b3, 0xb4b4, 0xfffd,
0xb4b5, 0xb4b6, 0xb4b7, 0xb4b8, 0xb4b9, 0xb4ba, 0xb4bb, 0xb4bc,
0xb4bd, 0xb4be, 0xb4bf, 0xb4c0, 0xb4c1, 0xb4c2, 0xb4c3, 0xb4c4,
0xb4c5, 0xb4c6, 0xb4c7, 0xb4c8, 0xb4c9, 0xb4ca, 0xb4cb, 0xb4cc,
0xb4cd, 0xb4ce, 0xb4cf, 0xb4d0, 0xfffd, 0xb4d1, 0xb4d2, 0xb4d3,
0xb4d4, 0xb4d5, 0xb4d6, 0xb4d7, 0xb4d8, 0xb4d9, 0xb4da, 0xb4db,
0xfffd, 0xfffd, 0xfffd, 0xb4dc, 0xb4dd, 0xb4de, 0xb4df, 0xb4e0,
0xb4e1, 0xb4e2, 0xb4e3, 0xb4e4, 0xb4e5, 0xb4e6, 0xb4e7, 0xb4e8,
0xb4e9, 0xb4ea, 0xb4eb, 0xb4ec, 0xfffd, 0xb4ed, 0xb4ee, 0xb4ef,
0xb4f0, 0xb4f1, 0xb4f2, 0xb4f3, 0xb4f4, 0xb4f5, 0xb4f6, 0xb4f7,
0xfffd, 0xfffd, 0xfffd, 0xb4f8, 0xb4f9, 0xb4fa, 0xb4fb, 0xb4fc,
0xb4fd, 0xb4fe, 0xb4ff, 0xb500, 0xb501, 0xb502, 0xb503, 0xb504,
0xb505, 0xb506, 0xb507, 0xb508, 0xfffd, 0xb509, 0xb50a, 0xb50b,
0xb50c, 0xb50d, 0xb50e, 0xb50f, 0xb510, 0xb511, 0xb512, 0xb513,
0xfffd, 0xfffd, 0xfffd, 0xb514, 0xb515, 0xb516, 0xb517, 0xb518,
0xb519, 0xb51a, 0xb51b, 0xb51c, 0xb51d, 0xb51e, 0xb51f, 0xb520,
0xb521, 0xb522, 0xb523, 0xb524, 0xfffd, 0xb525, 0xb526, 0xb527,
0xb528, 0xb529, 0xb52a, 0xb52b, 0xb52c, 0xb52d, 0xb52e, 0xb52f,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xb530, 0xb531, 0xb532, 0xb533, 0xb534, 0xb535, 0xb536, 0xb537,
0xb538, 0xb539, 0xb53a, 0xb53b, 0xb53c, 0xb53d, 0xb53e, 0xb53f,
0xb540, 0xfffd, 0xb541, 0xb542, 0xb543, 0xb544, 0xb545, 0xb546,
0xb547, 0xb548, 0xb549, 0xb54a, 0xb54b, 0xfffd, 0xfffd, 0xfffd,
0xb54c, 0xb54d, 0xb54e, 0xb54f, 0xb550, 0xb551, 0xb552, 0xb553,
0xb554, 0xb555, 0xb556, 0xb557, 0xb558, 0xb559, 0xb55a, 0xb55b,
0xb55c, 0xfffd, 0xb55d, 0xb55e, 0xb55f, 0xb560, 0xb561, 0xb562,
0xb563, 0xb564, 0xb565, 0xb566, 0xb567, 0xfffd, 0xfffd, 0xfffd,
0xb568, 0xb569, 0xb56a, 0xb56b, 0xb56c, 0xb56d, 0xb56e, 0xb56f,
0xb570, 0xb571, 0xb572, 0xb573, 0xb574, 0xb575, 0xb576, 0xb577,
0xb578, 0xfffd, 0xb579, 0xb57a, 0xb57b, 0xb57c, 0xb57d, 0xb57e,
0xb57f, 0xb580, 0xb581, 0xb582, 0xb583, 0xfffd, 0xfffd, 0xfffd,
0xb584, 0xb585, 0xb586, 0xb587, 0xb588, 0xb589, 0xb58a, 0xb58b,
0xb58c, 0xb58d, 0xb58e, 0xb58f, 0xb590, 0xb591, 0xb592, 0xb593,
0xb594, 0xfffd, 0xb595, 0xb596, 0xb597, 0xb598, 0xb599, 0xb59a,
0xb59b, 0xb59c, 0xb59d, 0xb59e, 0xb59f, 0xfffd, 0xfffd, 0xfffd,
0xb5a0, 0xb5a1, 0xb5a2, 0xb5a3, 0xb5a4, 0xb5a5, 0xb5a6, 0xb5a7,
0xb5a8, 0xb5a9, 0xb5aa, 0xb5ab, 0xb5ac, 0xb5ad, 0xb5ae, 0xb5af,
0xb5b0, 0xfffd, 0xb5b1, 0xb5b2, 0xb5b3, 0xb5b4, 0xb5b5, 0xb5b6,
0xb5b7, 0xb5b8, 0xb5b9, 0xb5ba, 0xb5bb, 0xb5bc, 0xb5bd, 0xb5be,
0xb5bf, 0xb5c0, 0xb5c1, 0xb5c2, 0xb5c3, 0xb5c4, 0xb5c5, 0xb5c6,
0xb5c7, 0xb5c8, 0xb5c9, 0xb5ca, 0xb5cb, 0xb5cc, 0xfffd, 0xb5cd,
0xb5ce, 0xb5cf, 0xb5d0, 0xb5d1, 0xb5d2, 0xb5d3, 0xb5d4, 0xb5d5,
0xb5d6, 0xb5d7, 0xfffd, 0xfffd, 0xfffd, 0xb5d8, 0xb5d9, 0xb5da,
0xb5db, 0xb5dc, 0xb5dd, 0xb5de, 0xb5df, 0xb5e0, 0xb5e1, 0xb5e2,
0xb5e3, 0xb5e4, 0xb5e5, 0xb5e6, 0xb5e7, 0xb5e8, 0xfffd, 0xb5e9,
0xb5ea, 0xb5eb, 0xb5ec, 0xb5ed, 0xb5ee, 0xb5ef, 0xb5f0, 0xb5f1,
0xb5f2, 0xb5f3, 0xfffd, 0xfffd, 0xfffd, 0xb5f4, 0xb5f5, 0xb5f6,
0xb5f7, 0xb5f8, 0xb5f9, 0xb5fa, 0xb5fb, 0xb5fc, 0xb5fd, 0xb5fe,
0xb5ff, 0xb600, 0xb601, 0xb602, 0xb603, 0xb604, 0xfffd, 0xb605,
0xb606, 0xb607, 0xb608, 0xb609, 0xb60a, 0xb60b, 0xb60c, 0xb60d,
0xb60e, 0xb60f, 0xfffd, 0xfffd, 0xfffd, 0xb610, 0xb611, 0xb612,
0xb613, 0xb614, 0xb615, 0xb616, 0xb617, 0xb618, 0xb619, 0xb61a,
0xb61b, 0xb61c, 0xb61d, 0xb61e, 0xb61f, 0xb620, 0xfffd, 0xb621,
0xb622, 0xb623, 0xb624, 0xb625, 0xb626, 0xb627, 0xb628, 0xb629,
0xb62a, 0xb62b, 0xfffd, 0xfffd, 0xfffd, 0xb62c, 0xb62d, 0xb62e,
0xb62f, 0xb630, 0xb631, 0xb632, 0xb633, 0xb634, 0xb635, 0xb636,
0xb637, 0xb638, 0xb639, 0xb63a, 0xb63b, 0xb63c, 0xfffd, 0xb63d,
0xb63e, 0xb63f, 0xb640, 0xb641, 0xb642, 0xb643, 0xb644, 0xb645,
0xb646, 0xb647, 0xfffd, 0xfffd, 0xfffd, 0xb648, 0xb649, 0xb64a,
0xb64b, 0xb64c, 0xb64d, 0xb64e, 0xb64f, 0xb650, 0xb651, 0xb652,
0xb653, 0xb654, 0xb655, 0xb656, 0xb657, 0xb658, 0xfffd, 0xb659,
0xb65a, 0xb65b, 0xb65c, 0xb65d, 0xb65e, 0xb65f, 0xb660, 0xb661,
0xb662, 0xb663, 0xb664, 0xb665, 0xb666, 0xb667, 0xb668, 0xb669,
0xb66a, 0xb66b, 0xb66c, 0xb66d, 0xb66e, 0xb66f, 0xb670, 0xb671,
0xb672, 0xb673, 0xb674, 0xfffd, 0xb675, 0xb676, 0xb677, 0xb678,
0xb679, 0xb67a, 0xb67b, 0xb67c, 0xb67d, 0xb67e, 0xb67f, 0xfffd,
0xfffd, 0xfffd, 0xb680, 0xb681, 0xb682, 0xb683, 0xb684, 0xb685,
0xb686, 0xb687, 0xb688, 0xb689, 0xb68a, 0xb68b, 0xb68c, 0xb68d,
0xb68e, 0xb68f, 0xb690, 0xfffd, 0xb691, 0xb692, 0xb693, 0xb694,
0xb695, 0xb696, 0xb697, 0xb698, 0xb699, 0xb69a, 0xb69b, 0xfffd,
0xfffd, 0xfffd, 0xb69c, 0xb69d, 0xb69e, 0xb69f, 0xb6a0, 0xb6a1,
0xb6a2, 0xb6a3, 0xb6a4, 0xb6a5, 0xb6a6, 0xb6a7, 0xb6a8, 0xb6a9,
0xb6aa, 0xb6ab, 0xb6ac, 0xfffd, 0xb6ad, 0xb6ae, 0xb6af, 0xb6b0,
0xb6b1, 0xb6b2, 0xb6b3, 0xb6b4, 0xb6b5, 0xb6b6, 0xb6b7, 0xfffd,
0xfffd, 0xfffd, 0xb6b8, 0xb6b9, 0xb6ba, 0xb6bb, 0xb6bc, 0xb6bd,
0xb6be, 0xb6bf, 0xb6c0, 0xb6c1, 0xb6c2, 0xb6c3, 0xb6c4, 0xb6c5,
0xb6c6, 0xb6c7, 0xb6c8, 0xfffd, 0xb6c9, 0xb6ca, 0xb6cb, 0xb6cc,
0xb6cd, 0xb6ce, 0xb6cf, 0xb6d0, 0xb6d1, 0xb6d2, 0xb6d3, 0xfffd,
0xfffd, 0xfffd, 0xb6d4, 0xb6d5, 0xb6d6, 0xb6d7, 0xb6d8, 0xb6d9,
0xb6da, 0xb6db, 0xb6dc, 0xb6dd, 0xb6de, 0xb6df, 0xb6e0, 0xb6e1,
0xb6e2, 0xb6e3, 0xb6e4, 0xfffd, 0xb6e5, 0xb6e6, 0xb6e7, 0xb6e8,
0xb6e9, 0xb6ea, 0xb6eb, 0xb6ec, 0xb6ed, 0xb6ee, 0xb6ef, 0xfffd,
0xfffd, 0xfffd, 0xb6f0, 0xb6f1, 0xb6f2, 0xb6f3, 0xb6f4, 0xb6f5,
0xb6f6, 0xb6f7, 0xb6f8, 0xb6f9, 0xb6fa, 0xb6fb, 0xb6fc, 0xb6fd,
0xb6fe, 0xb6ff, 0xb700, 0xfffd, 0xb701, 0xb702, 0xb703, 0xb704,
0xb705, 0xb706, 0xb707, 0xb708, 0xb709, 0xb70a, 0xb70b, 0xb70c,
0xb70d, 0xb70e, 0xb70f, 0xb710, 0xb711, 0xb712, 0xb713, 0xb714,
0xb715, 0xb716, 0xb717, 0xb718, 0xb719, 0xb71a, 0xb71b, 0xb71c,
0xfffd, 0xb71d, 0xb71e, 0xb71f, 0xb720, 0xb721, 0xb722, 0xb723,
0xb724, 0xb725, 0xb726, 0xb727, 0xfffd, 0xfffd, 0xfffd, 0xb728,
0xb729, 0xb72a, 0xb72b, 0xb72c, 0xb72d, 0xb72e, 0xb72f, 0xb730,
0xb731, 0xb732, 0xb733, 0xb734, 0xb735, 0xb736, 0xb737, 0xb738,
0xfffd, 0xb739, 0xb73a, 0xb73b, 0xb73c, 0xb73d, 0xb73e, 0xb73f,
0xb740, 0xb741, 0xb742, 0xb743, 0xfffd, 0xfffd, 0xfffd, 0xb744,
0xb745, 0xb746, 0xb747, 0xb748, 0xb749, 0xb74a, 0xb74b, 0xb74c,
0xb74d, 0xb74e, 0xb74f, 0xb750, 0xb751, 0xb752, 0xb753, 0xb754,
0xfffd, 0xb755, 0xb756, 0xb757, 0xb758, 0xb759, 0xb75a, 0xb75b,
0xb75c, 0xb75d, 0xb75e, 0xb75f, 0xfffd, 0xfffd, 0xfffd, 0xb760,
0xb761, 0xb762, 0xb763, 0xb764, 0xb765, 0xb766, 0xb767, 0xb768,
0xb769, 0xb76a, 0xb76b, 0xb76c, 0xb76d, 0xb76e, 0xb76f, 0xb770,
0xfffd, 0xb771, 0xb772, 0xb773, 0xb774, 0xb775, 0xb776, 0xb777,
0xb778, 0xb779, 0xb77a, 0xb77b, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xb77c, 0xb77d, 0xb77e, 0xb77f,
0xb780, 0xb781, 0xb782, 0xb783, 0xb784, 0xb785, 0xb786, 0xb787,
0xb788, 0xb789, 0xb78a, 0xb78b, 0xb78c, 0xfffd, 0xb78d, 0xb78e,
0xb78f, 0xb790, 0xb791, 0xb792, 0xb793, 0xb794, 0xb795, 0xb796,
0xb797, 0xfffd, 0xfffd, 0xfffd, 0xb798, 0xb799, 0xb79a, 0xb79b,
0xb79c, 0xb79d, 0xb79e, 0xb79f, 0xb7a0, 0xb7a1, 0xb7a2, 0xb7a3,
0xb7a4, 0xb7a5, 0xb7a6, 0xb7a7, 0xb7a8, 0xfffd, 0xb7a9, 0xb7aa,
0xb7ab, 0xb7ac, 0xb7ad, 0xb7ae, 0xb7af, 0xb7b0, 0xb7b1, 0xb7b2,
0xb7b3, 0xfffd, 0xfffd, 0xfffd, 0xb7b4, 0xb7b5, 0xb7b6, 0xb7b7,
0xb7b8, 0xb7b9, 0xb7ba, 0xb7bb, 0xb7bc, 0xb7bd, 0xb7be, 0xb7bf,
0xb7c0, 0xb7c1, 0xb7c2, 0xb7c3, 0xb7c4, 0xfffd, 0xb7c5, 0xb7c6,
0xb7c7, 0xb7c8, 0xb7c9, 0xb7ca, 0xb7cb, 0xb7cc, 0xb7cd, 0xb7ce,
0xb7cf, 0xfffd, 0xfffd, 0xfffd, 0xb7d0, 0xb7d1, 0xb7d2, 0xb7d3,
0xb7d4, 0xb7d5, 0xb7d6, 0xb7d7, 0xb7d8, 0xb7d9, 0xb7da, 0xb7db,
0xb7dc, 0xb7dd, 0xb7de, 0xb7df, 0xb7e0, 0xfffd, 0xb7e1, 0xb7e2,
0xb7e3, 0xb7e4, 0xb7e5, 0xb7e6, 0xb7e7, 0xb7e8, 0xb7e9, 0xb7ea,
0xb7eb, 0xfffd, 0xfffd, 0xfffd, 0xb7ec, 0xb7ed, 0xb7ee, 0xb7ef,
0xb7f0, 0xb7f1, 0xb7f2, 0xb7f3, 0xb7f4, 0xb7f5, 0xb7f6, 0xb7f7,
0xb7f8, 0xb7f9, 0xb7fa, 0xb7fb, 0xb7fc, 0xfffd, 0xb7fd, 0xb7fe,
0xb7ff, 0xb800, 0xb801, 0xb802, 0xb803, 0xb804, 0xb805, 0xb806,
0xb807, 0xb808, 0xb809, 0xb80a, 0xb80b, 0xb80c, 0xb80d, 0xb80e,
0xb80f, 0xb810, 0xb811, 0xb812, 0xb813, 0xb814, 0xb815, 0xb816,
0xb817, 0xb818, 0xfffd, 0xb819, 0xb81a, 0xb81b, 0xb81c, 0xb81d,
0xb81e, 0xb81f, 0xb820, 0xb821, 0xb822, 0xb823, 0xfffd, 0xfffd,
0xfffd, 0xb824, 0xb825, 0xb826, 0xb827, 0xb828, 0xb829, 0xb82a,
0xb82b, 0xb82c, 0xb82d, 0xb82e, 0xb82f, 0xb830, 0xb831, 0xb832,
0xb833, 0xb834, 0xfffd, 0xb835, 0xb836, 0xb837, 0xb838, 0xb839,
0xb83a, 0xb83b, 0xb83c, 0xb83d, 0xb83e, 0xb83f, 0xfffd, 0xfffd,
0xfffd, 0xb840, 0xb841, 0xb842, 0xb843, 0xb844, 0xb845, 0xb846,
0xb847, 0xb848, 0xb849, 0xb84a, 0xb84b, 0xb84c, 0xb84d, 0xb84e,
0xb84f, 0xb850, 0xfffd, 0xb851, 0xb852, 0xb853, 0xb854, 0xb855,
0xb856, 0xb857, 0xb858, 0xb859, 0xb85a, 0xb85b, 0xfffd, 0xfffd,
0xfffd, 0xb85c, 0xb85d, 0xb85e, 0xb85f, 0xb860, 0xb861, 0xb862,
0xb863, 0xb864, 0xb865, 0xb866, 0xb867, 0xb868, 0xb869, 0xb86a,
0xb86b, 0xb86c, 0xfffd, 0xb86d, 0xb86e, 0xb86f, 0xb870, 0xb871,
0xb872, 0xb873, 0xb874, 0xb875, 0xb876, 0xb877, 0xfffd, 0xfffd,
0xfffd, 0xb878, 0xb879, 0xb87a, 0xb87b, 0xb87c, 0xb87d, 0xb87e,
0xb87f, 0xb880, 0xb881, 0xb882, 0xb883, 0xb884, 0xb885, 0xb886,
0xb887, 0xb888, 0xfffd, 0xb889, 0xb88a, 0xb88b, 0xb88c, 0xb88d,
0xb88e, 0xb88f, 0xb890, 0xb891, 0xb892, 0xb893, 0xfffd, 0xfffd,
0xfffd, 0xb894, 0xb895, 0xb896, 0xb897, 0xb898, 0xb899, 0xb89a,
0xb89b, 0xb89c, 0xb89d, 0xb89e, 0xb89f, 0xb8a0, 0xb8a1, 0xb8a2,
0xb8a3, 0xb8a4, 0xfffd, 0xb8a5, 0xb8a6, 0xb8a7, 0xb8a8, 0xb8a9,
0xb8aa, 0xb8ab, 0xb8ac, 0xb8ad, 0xb8ae, 0xb8af, 0xb8b0, 0xb8b1,
0xb8b2, 0xb8b3, 0xb8b4, 0xb8b5, 0xb8b6, 0xb8b7, 0xb8b8, 0xb8b9,
0xb8ba, 0xb8bb, 0xb8bc, 0xb8bd, 0xb8be, 0xb8bf, 0xb8c0, 0xfffd,
0xb8c1, 0xb8c2, 0xb8c3, 0xb8c4, 0xb8c5, 0xb8c6, 0xb8c7, 0xb8c8,
0xb8c9, 0xb8ca, 0xb8cb, 0xfffd, 0xfffd, 0xfffd, 0xb8cc, 0xb8cd,
0xb8ce, 0xb8cf, 0xb8d0, 0xb8d1, 0xb8d2, 0xb8d3, 0xb8d4, 0xb8d5,
0xb8d6, 0xb8d7, 0xb8d8, 0xb8d9, 0xb8da, 0xb8db, 0xb8dc, 0xfffd,
0xb8dd, 0xb8de, 0xb8df, 0xb8e0, 0xb8e1, 0xb8e2, 0xb8e3, 0xb8e4,
0xb8e5, 0xb8e6, 0xb8e7, 0xfffd, 0xfffd, 0xfffd, 0xb8e8, 0xb8e9,
0xb8ea, 0xb8eb, 0xb8ec, 0xb8ed, 0xb8ee, 0xb8ef, 0xb8f0, 0xb8f1,
0xb8f2, 0xb8f3, 0xb8f4, 0xb8f5, 0xb8f6, 0xb8f7, 0xb8f8, 0xfffd,
0xb8f9, 0xb8fa, 0xb8fb, 0xb8fc, 0xb8fd, 0xb8fe, 0xb8ff, 0xb900,
0xb901, 0xb902, 0xb903, 0xfffd, 0xfffd, 0xfffd, 0xb904, 0xb905,
0xb906, 0xb907, 0xb908, 0xb909, 0xb90a, 0xb90b, 0xb90c, 0xb90d,
0xb90e, 0xb90f, 0xb910, 0xb911, 0xb912, 0xb913, 0xb914, 0xfffd,
0xb915, 0xb916, 0xb917, 0xb918, 0xb919, 0xb91a, 0xb91b, 0xb91c,
0xb91d, 0xb91e, 0xb91f, 0xfffd, 0xfffd, 0xfffd, 0xb920, 0xb921,
0xb922, 0xb923, 0xb924, 0xb925, 0xb926, 0xb927, 0xb928, 0xb929,
0xb92a, 0xb92b, 0xb92c, 0xb92d, 0xb92e, 0xb92f, 0xb930, 0xfffd,
0xb931, 0xb932, 0xb933, 0xb934, 0xb935, 0xb936, 0xb937, 0xb938,
0xb939, 0xb93a, 0xb93b, 0xfffd, 0xfffd, 0xfffd, 0xb93c, 0xb93d,
0xb93e, 0xb93f, 0xb940, 0xb941, 0xb942, 0xb943, 0xb944, 0xb945,
0xb946, 0xb947, 0xb948, 0xb949, 0xb94a, 0xb94b, 0xb94c, 0xfffd,
0xb94d, 0xb94e, 0xb94f, 0xb950, 0xb951, 0xb952, 0xb953, 0xb954,
0xb955, 0xb956, 0xb957, 0xb958, 0xb959, 0xb95a, 0xb95b, 0xb95c,
0xb95d, 0xb95e, 0xb95f, 0xb960, 0xb961, 0xb962, 0xb963, 0xb964,
0xb965, 0xb966, 0xb967, 0xb968, 0xfffd, 0xb969, 0xb96a, 0xb96b,
0xb96c, 0xb96d, 0xb96e, 0xb96f, 0xb970, 0xb971, 0xb972, 0xb973,
0xfffd, 0xfffd, 0xfffd, 0xb974, 0xb975, 0xb976, 0xb977, 0xb978,
0xb979, 0xb97a, 0xb97b, 0xb97c, 0xb97d, 0xb97e, 0xb97f, 0xb980,
0xb981, 0xb982, 0xb983, 0xb984, 0xfffd, 0xb985, 0xb986, 0xb987,
0xb988, 0xb989, 0xb98a, 0xb98b, 0xb98c, 0xb98d, 0xb98e, 0xb98f,
0xfffd, 0xfffd, 0xfffd, 0xb990, 0xb991, 0xb992, 0xb993, 0xb994,
0xb995, 0xb996, 0xb997, 0xb998, 0xb999, 0xb99a, 0xb99b, 0xb99c,
0xb99d, 0xb99e, 0xb99f, 0xb9a0, 0xfffd, 0xb9a1, 0xb9a2, 0xb9a3,
0xb9a4, 0xb9a5, 0xb9a6, 0xb9a7, 0xb9a8, 0xb9a9, 0xb9aa, 0xb9ab,
0xfffd, 0xfffd, 0xfffd, 0xb9ac, 0xb9ad, 0xb9ae, 0xb9af, 0xb9b0,
0xb9b1, 0xb9b2, 0xb9b3, 0xb9b4, 0xb9b5, 0xb9b6, 0xb9b7, 0xb9b8,
0xb9b9, 0xb9ba, 0xb9bb, 0xb9bc, 0xfffd, 0xb9bd, 0xb9be, 0xb9bf,
0xb9c0, 0xb9c1, 0xb9c2, 0xb9c3, 0xb9c4, 0xb9c5, 0xb9c6, 0xb9c7,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xb9c8, 0xb9c9, 0xb9ca, 0xb9cb, 0xb9cc, 0xb9cd, 0xb9ce, 0xb9cf,
0xb9d0, 0xb9d1, 0xb9d2, 0xb9d3, 0xb9d4, 0xb9d5, 0xb9d6, 0xb9d7,
0xb9d8, 0xfffd, 0xb9d9, 0xb9da, 0xb9db, 0xb9dc, 0xb9dd, 0xb9de,
0xb9df, 0xb9e0, 0xb9e1, 0xb9e2, 0xb9e3, 0xfffd, 0xfffd, 0xfffd,
0xb9e4, 0xb9e5, 0xb9e6, 0xb9e7, 0xb9e8, 0xb9e9, 0xb9ea, 0xb9eb,
0xb9ec, 0xb9ed, 0xb9ee, 0xb9ef, 0xb9f0, 0xb9f1, 0xb9f2, 0xb9f3,
0xb9f4, 0xfffd, 0xb9f5, 0xb9f6, 0xb9f7, 0xb9f8, 0xb9f9, 0xb9fa,
0xb9fb, 0xb9fc, 0xb9fd, 0xb9fe, 0xb9ff, 0xfffd, 0xfffd, 0xfffd,
0xba00, 0xba01, 0xba02, 0xba03, 0xba04, 0xba05, 0xba06, 0xba07,
0xba08, 0xba09, 0xba0a, 0xba0b, 0xba0c, 0xba0d, 0xba0e, 0xba0f,
0xba10, 0xfffd, 0xba11, 0xba12, 0xba13, 0xba14, 0xba15, 0xba16,
0xba17, 0xba18, 0xba19, 0xba1a, 0xba1b, 0xfffd, 0xfffd, 0xfffd,
0xba1c, 0xba1d, 0xba1e, 0xba1f, 0xba20, 0xba21, 0xba22, 0xba23,
0xba24, 0xba25, 0xba26, 0xba27, 0xba28, 0xba29, 0xba2a, 0xba2b,
0xba2c, 0xfffd, 0xba2d, 0xba2e, 0xba2f, 0xba30, 0xba31, 0xba32,
0xba33, 0xba34, 0xba35, 0xba36, 0xba37, 0xfffd, 0xfffd, 0xfffd,
0xba38, 0xba39, 0xba3a, 0xba3b, 0xba3c, 0xba3d, 0xba3e, 0xba3f,
0xba40, 0xba41, 0xba42, 0xba43, 0xba44, 0xba45, 0xba46, 0xba47,
0xba48, 0xfffd, 0xba49, 0xba4a, 0xba4b, 0xba4c, 0xba4d, 0xba4e,
0xba4f, 0xba50, 0xba51, 0xba52, 0xba53, 0xba54, 0xba55, 0xba56,
0xba57, 0xba58, 0xba59, 0xba5a, 0xba5b, 0xba5c, 0xba5d, 0xba5e,
0xba5f, 0xba60, 0xba61, 0xba62, 0xba63, 0xba64, 0xfffd, 0xba65,
0xba66, 0xba67, 0xba68, 0xba69, 0xba6a, 0xba6b, 0xba6c, 0xba6d,
0xba6e, 0xba6f, 0xfffd, 0xfffd, 0xfffd, 0xba70, 0xba71, 0xba72,
0xba73, 0xba74, 0xba75, 0xba76, 0xba77, 0xba78, 0xba79, 0xba7a,
0xba7b, 0xba7c, 0xba7d, 0xba7e, 0xba7f, 0xba80, 0xfffd, 0xba81,
0xba82, 0xba83, 0xba84, 0xba85, 0xba86, 0xba87, 0xba88, 0xba89,
0xba8a, 0xba8b, 0xfffd, 0xfffd, 0xfffd, 0xba8c, 0xba8d, 0xba8e,
0xba8f, 0xba90, 0xba91, 0xba92, 0xba93, 0xba94, 0xba95, 0xba96,
0xba97, 0xba98, 0xba99, 0xba9a, 0xba9b, 0xba9c, 0xfffd, 0xba9d,
0xba9e, 0xba9f, 0xbaa0, 0xbaa1, 0xbaa2, 0xbaa3, 0xbaa4, 0xbaa5,
0xbaa6, 0xbaa7, 0xfffd, 0xfffd, 0xfffd, 0xbaa8, 0xbaa9, 0xbaaa,
0xbaab, 0xbaac, 0xbaad, 0xbaae, 0xbaaf, 0xbab0, 0xbab1, 0xbab2,
0xbab3, 0xbab4, 0xbab5, 0xbab6, 0xbab7, 0xbab8, 0xfffd, 0xbab9,
0xbaba, 0xbabb, 0xbabc, 0xbabd, 0xbabe, 0xbabf, 0xbac0, 0xbac1,
0xbac2, 0xbac3, 0xfffd, 0xfffd, 0xfffd, 0xbac4, 0xbac5, 0xbac6,
0xbac7, 0xbac8, 0xbac9, 0xbaca, 0xbacb, 0xbacc, 0xbacd, 0xbace,
0xbacf, 0xbad0, 0xbad1, 0xbad2, 0xbad3, 0xbad4, 0xfffd, 0xbad5,
0xbad6, 0xbad7, 0xbad8, 0xbad9, 0xbada, 0xbadb, 0xbadc, 0xbadd,
0xbade, 0xbadf, 0xfffd, 0xfffd, 0xfffd, 0xbae0, 0xbae1, 0xbae2,
0xbae3, 0xbae4, 0xbae5, 0xbae6, 0xbae7, 0xbae8, 0xbae9, 0xbaea,
0xbaeb, 0xbaec, 0xbaed, 0xbaee, 0xbaef, 0xbaf0, 0xfffd, 0xbaf1,
0xbaf2, 0xbaf3, 0xbaf4, 0xbaf5, 0xbaf6, 0xbaf7, 0xbaf8, 0xbaf9,
0xbafa, 0xbafb, 0xbafc, 0xbafd, 0xbafe, 0xbaff, 0xbb00, 0xbb01,
0xbb02, 0xbb03, 0xbb04, 0xbb05, 0xbb06, 0xbb07, 0xbb08, 0xbb09,
0xbb0a, 0xbb0b, 0xbb0c, 0xfffd, 0xbb0d, 0xbb0e, 0xbb0f, 0xbb10,
0xbb11, 0xbb12, 0xbb13, 0xbb14, 0xbb15, 0xbb16, 0xbb17, 0xfffd,
0xfffd, 0xfffd, 0xbb18, 0xbb19, 0xbb1a, 0xbb1b, 0xbb1c, 0xbb1d,
0xbb1e, 0xbb1f, 0xbb20, 0xbb21, 0xbb22, 0xbb23, 0xbb24, 0xbb25,
0xbb26, 0xbb27, 0xbb28, 0xfffd, 0xbb29, 0xbb2a, 0xbb2b, 0xbb2c,
0xbb2d, 0xbb2e, 0xbb2f, 0xbb30, 0xbb31, 0xbb32, 0xbb33, 0xfffd,
0xfffd, 0xfffd, 0xbb34, 0xbb35, 0xbb36, 0xbb37, 0xbb38, 0xbb39,
0xbb3a, 0xbb3b, 0xbb3c, 0xbb3d, 0xbb3e, 0xbb3f, 0xbb40, 0xbb41,
0xbb42, 0xbb43, 0xbb44, 0xfffd, 0xbb45, 0xbb46, 0xbb47, 0xbb48,
0xbb49, 0xbb4a, 0xbb4b, 0xbb4c, 0xbb4d, 0xbb4e, 0xbb4f, 0xfffd,
0xfffd, 0xfffd, 0xbb50, 0xbb51, 0xbb52, 0xbb53, 0xbb54, 0xbb55,
0xbb56, 0xbb57, 0xbb58, 0xbb59, 0xbb5a, 0xbb5b, 0xbb5c, 0xbb5d,
0xbb5e, 0xbb5f, 0xbb60, 0xfffd, 0xbb61, 0xbb62, 0xbb63, 0xbb64,
0xbb65, 0xbb66, 0xbb67, 0xbb68, 0xbb69, 0xbb6a, 0xbb6b, 0xfffd,
0xfffd, 0xfffd, 0xbb6c, 0xbb6d, 0xbb6e, 0xbb6f, 0xbb70, 0xbb71,
0xbb72, 0xbb73, 0xbb74, 0xbb75, 0xbb76, 0xbb77, 0xbb78, 0xbb79,
0xbb7a, 0xbb7b, 0xbb7c, 0xfffd, 0xbb7d, 0xbb7e, 0xbb7f, 0xbb80,
0xbb81, 0xbb82, 0xbb83, 0xbb84, 0xbb85, 0xbb86, 0xbb87, 0xfffd,
0xfffd, 0xfffd, 0xbb88, 0xbb89, 0xbb8a, 0xbb8b, 0xbb8c, 0xbb8d,
0xbb8e, 0xbb8f, 0xbb90, 0xbb91, 0xbb92, 0xbb93, 0xbb94, 0xbb95,
0xbb96, 0xbb97, 0xbb98, 0xfffd, 0xbb99, 0xbb9a, 0xbb9b, 0xbb9c,
0xbb9d, 0xbb9e, 0xbb9f, 0xbba0, 0xbba1, 0xbba2, 0xbba3, 0xbba4,
0xbba5, 0xbba6, 0xbba7, 0xbba8, 0xbba9, 0xbbaa, 0xbbab, 0xbbac,
0xbbad, 0xbbae, 0xbbaf, 0xbbb0, 0xbbb1, 0xbbb2, 0xbbb3, 0xbbb4,
0xfffd, 0xbbb5, 0xbbb6, 0xbbb7, 0xbbb8, 0xbbb9, 0xbbba, 0xbbbb,
0xbbbc, 0xbbbd, 0xbbbe, 0xbbbf, 0xfffd, 0xfffd, 0xfffd, 0xbbc0,
0xbbc1, 0xbbc2, 0xbbc3, 0xbbc4, 0xbbc5, 0xbbc6, 0xbbc7, 0xbbc8,
0xbbc9, 0xbbca, 0xbbcb, 0xbbcc, 0xbbcd, 0xbbce, 0xbbcf, 0xbbd0,
0xfffd, 0xbbd1, 0xbbd2, 0xbbd3, 0xbbd4, 0xbbd5, 0xbbd6, 0xbbd7,
0xbbd8, 0xbbd9, 0xbbda, 0xbbdb, 0xfffd, 0xfffd, 0xfffd, 0xbbdc,
0xbbdd, 0xbbde, 0xbbdf, 0xbbe0, 0xbbe1, 0xbbe2, 0xbbe3, 0xbbe4,
0xbbe5, 0xbbe6, 0xbbe7, 0xbbe8, 0xbbe9, 0xbbea, 0xbbeb, 0xbbec,
0xfffd, 0xbbed, 0xbbee, 0xbbef, 0xbbf0, 0xbbf1, 0xbbf2, 0xbbf3,
0xbbf4, 0xbbf5, 0xbbf6, 0xbbf7, 0xfffd, 0xfffd, 0xfffd, 0xbbf8,
0xbbf9, 0xbbfa, 0xbbfb, 0xbbfc, 0xbbfd, 0xbbfe, 0xbbff, 0xbc00,
0xbc01, 0xbc02, 0xbc03, 0xbc04, 0xbc05, 0xbc06, 0xbc07, 0xbc08,
0xfffd, 0xbc09, 0xbc0a, 0xbc0b, 0xbc0c, 0xbc0d, 0xbc0e, 0xbc0f,
0xbc10, 0xbc11, 0xbc12, 0xbc13, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xbc14, 0xbc15, 0xbc16, 0xbc17,
0xbc18, 0xbc19, 0xbc1a, 0xbc1b, 0xbc1c, 0xbc1d, 0xbc1e, 0xbc1f,
0xbc20, 0xbc21, 0xbc22, 0xbc23, 0xbc24, 0xfffd, 0xbc25, 0xbc26,
0xbc27, 0xbc28, 0xbc29, 0xbc2a, 0xbc2b, 0xbc2c, 0xbc2d, 0xbc2e,
0xbc2f, 0xfffd, 0xfffd, 0xfffd, 0xbc30, 0xbc31, 0xbc32, 0xbc33,
0xbc34, 0xbc35, 0xbc36, 0xbc37, 0xbc38, 0xbc39, 0xbc3a, 0xbc3b,
0xbc3c, 0xbc3d, 0xbc3e, 0xbc3f, 0xbc40, 0xfffd, 0xbc41, 0xbc42,
0xbc43, 0xbc44, 0xbc45, 0xbc46, 0xbc47, 0xbc48, 0xbc49, 0xbc4a,
0xbc4b, 0xfffd, 0xfffd, 0xfffd, 0xbc4c, 0xbc4d, 0xbc4e, 0xbc4f,
0xbc50, 0xbc51, 0xbc52, 0xbc53, 0xbc54, 0xbc55, 0xbc56, 0xbc57,
0xbc58, 0xbc59, 0xbc5a, 0xbc5b, 0xbc5c, 0xfffd, 0xbc5d, 0xbc5e,
0xbc5f, 0xbc60, 0xbc61, 0xbc62, 0xbc63, 0xbc64, 0xbc65, 0xbc66,
0xbc67, 0xfffd, 0xfffd, 0xfffd, 0xbc68, 0xbc69, 0xbc6a, 0xbc6b,
0xbc6c, 0xbc6d, 0xbc6e, 0xbc6f, 0xbc70, 0xbc71, 0xbc72, 0xbc73,
0xbc74, 0xbc75, 0xbc76, 0xbc77, 0xbc78, 0xfffd, 0xbc79, 0xbc7a,
0xbc7b, 0xbc7c, 0xbc7d, 0xbc7e, 0xbc7f, 0xbc80, 0xbc81, 0xbc82,
0xbc83, 0xfffd, 0xfffd, 0xfffd, 0xbc84, 0xbc85, 0xbc86, 0xbc87,
0xbc88, 0xbc89, 0xbc8a, 0xbc8b, 0xbc8c, 0xbc8d, 0xbc8e, 0xbc8f,
0xbc90, 0xbc91, 0xbc92, 0xbc93, 0xbc94, 0xfffd, 0xbc95, 0xbc96,
0xbc97, 0xbc98, 0xbc99, 0xbc9a, 0xbc9b, 0xbc9c, 0xbc9d, 0xbc9e,
0xbc9f, 0xbca0, 0xbca1, 0xbca2, 0xbca3, 0xbca4, 0xbca5, 0xbca6,
0xbca7, 0xbca8, 0xbca9, 0xbcaa, 0xbcab, 0xbcac, 0xbcad, 0xbcae,
0xbcaf, 0xbcb0, 0xfffd, 0xbcb1, 0xbcb2, 0xbcb3, 0xbcb4, 0xbcb5,
0xbcb6, 0xbcb7, 0xbcb8, 0xbcb9, 0xbcba, 0xbcbb, 0xfffd, 0xfffd,
0xfffd, 0xbcbc, 0xbcbd, 0xbcbe, 0xbcbf, 0xbcc0, 0xbcc1, 0xbcc2,
0xbcc3, 0xbcc4, 0xbcc5, 0xbcc6, 0xbcc7, 0xbcc8, 0xbcc9, 0xbcca,
0xbccb, 0xbccc, 0xfffd, 0xbccd, 0xbcce, 0xbccf, 0xbcd0, 0xbcd1,
0xbcd2, 0xbcd3, 0xbcd4, 0xbcd5, 0xbcd6, 0xbcd7, 0xfffd, 0xfffd,
0xfffd, 0xbcd8, 0xbcd9, 0xbcda, 0xbcdb, 0xbcdc, 0xbcdd, 0xbcde,
0xbcdf, 0xbce0, 0xbce1, 0xbce2, 0xbce3, 0xbce4, 0xbce5, 0xbce6,
0xbce7, 0xbce8, 0xfffd, 0xbce9, 0xbcea, 0xbceb, 0xbcec, 0xbced,
0xbcee, 0xbcef, 0xbcf0, 0xbcf1, 0xbcf2, 0xbcf3, 0xfffd, 0xfffd,
0xfffd, 0xbcf4, 0xbcf5, 0xbcf6, 0xbcf7, 0xbcf8, 0xbcf9, 0xbcfa,
0xbcfb, 0xbcfc, 0xbcfd, 0xbcfe, 0xbcff, 0xbd00, 0xbd01, 0xbd02,
0xbd03, 0xbd04, 0xfffd, 0xbd05, 0xbd06, 0xbd07, 0xbd08, 0xbd09,
0xbd0a, 0xbd0b, 0xbd0c, 0xbd0d, 0xbd0e, 0xbd0f, 0xfffd, 0xfffd,
0xfffd, 0xbd10, 0xbd11, 0xbd12, 0xbd13, 0xbd14, 0xbd15, 0xbd16,
0xbd17, 0xbd18, 0xbd19, 0xbd1a, 0xbd1b, 0xbd1c, 0xbd1d, 0xbd1e,
0xbd1f, 0xbd20, 0xfffd, 0xbd21, 0xbd22, 0xbd23, 0xbd24, 0xbd25,
0xbd26, 0xbd27, 0xbd28, 0xbd29, 0xbd2a, 0xbd2b, 0xfffd, 0xfffd,
0xfffd, 0xbd2c, 0xbd2d, 0xbd2e, 0xbd2f, 0xbd30, 0xbd31, 0xbd32,
0xbd33, 0xbd34, 0xbd35, 0xbd36, 0xbd37, 0xbd38, 0xbd39, 0xbd3a,
0xbd3b, 0xbd3c, 0xfffd, 0xbd3d, 0xbd3e, 0xbd3f, 0xbd40, 0xbd41,
0xbd42, 0xbd43, 0xbd44, 0xbd45, 0xbd46, 0xbd47, 0xbd48, 0xbd49,
0xbd4a, 0xbd4b, 0xbd4c, 0xbd4d, 0xbd4e, 0xbd4f, 0xbd50, 0xbd51,
0xbd52, 0xbd53, 0xbd54, 0xbd55, 0xbd56, 0xbd57, 0xbd58, 0xfffd,
0xbd59, 0xbd5a, 0xbd5b, 0xbd5c, 0xbd5d, 0xbd5e, 0xbd5f, 0xbd60,
0xbd61, 0xbd62, 0xbd63, 0xfffd, 0xfffd, 0xfffd, 0xbd64, 0xbd65,
0xbd66, 0xbd67, 0xbd68, 0xbd69, 0xbd6a, 0xbd6b, 0xbd6c, 0xbd6d,
0xbd6e, 0xbd6f, 0xbd70, 0xbd71, 0xbd72, 0xbd73, 0xbd74, 0xfffd,
0xbd75, 0xbd76, 0xbd77, 0xbd78, 0xbd79, 0xbd7a, 0xbd7b, 0xbd7c,
0xbd7d, 0xbd7e, 0xbd7f, 0xfffd, 0xfffd, 0xfffd, 0xbd80, 0xbd81,
0xbd82, 0xbd83, 0xbd84, 0xbd85, 0xbd86, 0xbd87, 0xbd88, 0xbd89,
0xbd8a, 0xbd8b, 0xbd8c, 0xbd8d, 0xbd8e, 0xbd8f, 0xbd90, 0xfffd,
0xbd91, 0xbd92, 0xbd93, 0xbd94, 0xbd95, 0xbd96, 0xbd97, 0xbd98,
0xbd99, 0xbd9a, 0xbd9b, 0xfffd, 0xfffd, 0xfffd, 0xbd9c, 0xbd9d,
0xbd9e, 0xbd9f, 0xbda0, 0xbda1, 0xbda2, 0xbda3, 0xbda4, 0xbda5,
0xbda6, 0xbda7, 0xbda8, 0xbda9, 0xbdaa, 0xbdab, 0xbdac, 0xfffd,
0xbdad, 0xbdae, 0xbdaf, 0xbdb0, 0xbdb1, 0xbdb2, 0xbdb3, 0xbdb4,
0xbdb5, 0xbdb6, 0xbdb7, 0xfffd, 0xfffd, 0xfffd, 0xbdb8, 0xbdb9,
0xbdba, 0xbdbb, 0xbdbc, 0xbdbd, 0xbdbe, 0xbdbf, 0xbdc0, 0xbdc1,
0xbdc2, 0xbdc3, 0xbdc4, 0xbdc5, 0xbdc6, 0xbdc7, 0xbdc8, 0xfffd,
0xbdc9, 0xbdca, 0xbdcb, 0xbdcc, 0xbdcd, 0xbdce, 0xbdcf, 0xbdd0,
0xbdd1, 0xbdd2, 0xbdd3, 0xfffd, 0xfffd, 0xfffd, 0xbdd4, 0xbdd5,
0xbdd6, 0xbdd7, 0xbdd8, 0xbdd9, 0xbdda, 0xbddb, 0xbddc, 0xbddd,
0xbdde, 0xbddf, 0xbde0, 0xbde1, 0xbde2, 0xbde3, 0xbde4, 0xfffd,
0xbde5, 0xbde6, 0xbde7, 0xbde8, 0xbde9, 0xbdea, 0xbdeb, 0xbdec,
0xbded, 0xbdee, 0xbdef, 0xbdf0, 0xbdf1, 0xbdf2, 0xbdf3, 0xbdf4,
0xbdf5, 0xbdf6, 0xbdf7, 0xbdf8, 0xbdf9, 0xbdfa, 0xbdfb, 0xbdfc,
0xbdfd, 0xbdfe, 0xbdff, 0xbe00, 0xfffd, 0xbe01, 0xbe02, 0xbe03,
0xbe04, 0xbe05, 0xbe06, 0xbe07, 0xbe08, 0xbe09, 0xbe0a, 0xbe0b,
0xfffd, 0xfffd, 0xfffd, 0xbe0c, 0xbe0d, 0xbe0e, 0xbe0f, 0xbe10,
0xbe11, 0xbe12, 0xbe13, 0xbe14, 0xbe15, 0xbe16, 0xbe17, 0xbe18,
0xbe19, 0xbe1a, 0xbe1b, 0xbe1c, 0xfffd, 0xbe1d, 0xbe1e, 0xbe1f,
0xbe20, 0xbe21, 0xbe22, 0xbe23, 0xbe24, 0xbe25, 0xbe26, 0xbe27,
0xfffd, 0xfffd, 0xfffd, 0xbe28, 0xbe29, 0xbe2a, 0xbe2b, 0xbe2c,
0xbe2d, 0xbe2e, 0xbe2f, 0xbe30, 0xbe31, 0xbe32, 0xbe33, 0xbe34,
0xbe35, 0xbe36, 0xbe37, 0xbe38, 0xfffd, 0xbe39, 0xbe3a, 0xbe3b,
0xbe3c, 0xbe3d, 0xbe3e, 0xbe3f, 0xbe40, 0xbe41, 0xbe42, 0xbe43,
0xfffd, 0xfffd, 0xfffd, 0xbe44, 0xbe45, 0xbe46, 0xbe47, 0xbe48,
0xbe49, 0xbe4a, 0xbe4b, 0xbe4c, 0xbe4d, 0xbe4e, 0xbe4f, 0xbe50,
0xbe51, 0xbe52, 0xbe53, 0xbe54, 0xfffd, 0xbe55, 0xbe56, 0xbe57,
0xbe58, 0xbe59, 0xbe5a, 0xbe5b, 0xbe5c, 0xbe5d, 0xbe5e, 0xbe5f,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xbe60, 0xbe61, 0xbe62, 0xbe63, 0xbe64, 0xbe65, 0xbe66, 0xbe67,
0xbe68, 0xbe69, 0xbe6a, 0xbe6b, 0xbe6c, 0xbe6d, 0xbe6e, 0xbe6f,
0xbe70, 0xfffd, 0xbe71, 0xbe72, 0xbe73, 0xbe74, 0xbe75, 0xbe76,
0xbe77, 0xbe78, 0xbe79, 0xbe7a, 0xbe7b, 0xfffd, 0xfffd, 0xfffd,
0xbe7c, 0xbe7d, 0xbe7e, 0xbe7f, 0xbe80, 0xbe81, 0xbe82, 0xbe83,
0xbe84, 0xbe85, 0xbe86, 0xbe87, 0xbe88, 0xbe89, 0xbe8a, 0xbe8b,
0xbe8c, 0xfffd, 0xbe8d, 0xbe8e, 0xbe8f, 0xbe90, 0xbe91, 0xbe92,
0xbe93, 0xbe94, 0xbe95, 0xbe96, 0xbe97, 0xfffd, 0xfffd, 0xfffd,
0xbe98, 0xbe99, 0xbe9a, 0xbe9b, 0xbe9c, 0xbe9d, 0xbe9e, 0xbe9f,
0xbea0, 0xbea1, 0xbea2, 0xbea3, 0xbea4, 0xbea5, 0xbea6, 0xbea7,
0xbea8, 0xfffd, 0xbea9, 0xbeaa, 0xbeab, 0xbeac, 0xbead, 0xbeae,
0xbeaf, 0xbeb0, 0xbeb1, 0xbeb2, 0xbeb3, 0xfffd, 0xfffd, 0xfffd,
0xbeb4, 0xbeb5, 0xbeb6, 0xbeb7, 0xbeb8, 0xbeb9, 0xbeba, 0xbebb,
0xbebc, 0xbebd, 0xbebe, 0xbebf, 0xbec0, 0xbec1, 0xbec2, 0xbec3,
0xbec4, 0xfffd, 0xbec5, 0xbec6, 0xbec7, 0xbec8, 0xbec9, 0xbeca,
0xbecb, 0xbecc, 0xbecd, 0xbece, 0xbecf, 0xfffd, 0xfffd, 0xfffd,
0xbed0, 0xbed1, 0xbed2, 0xbed3, 0xbed4, 0xbed5, 0xbed6, 0xbed7,
0xbed8, 0xbed9, 0xbeda, 0xbedb, 0xbedc, 0xbedd, 0xbede, 0xbedf,
0xbee0, 0xfffd, 0xbee1, 0xbee2, 0xbee3, 0xbee4, 0xbee5, 0xbee6,
0xbee7, 0xbee8, 0xbee9, 0xbeea, 0xbeeb, 0xbeec, 0xbeed, 0xbeee,
0xbeef, 0xbef0, 0xbef1, 0xbef2, 0xbef3, 0xbef4, 0xbef5, 0xbef6,
0xbef7, 0xbef8, 0xbef9, 0xbefa, 0xbefb, 0xbefc, 0xfffd, 0xbefd,
0xbefe, 0xbeff, 0xbf00, 0xbf01, 0xbf02, 0xbf03, 0xbf04, 0xbf05,
0xbf06, 0xbf07, 0xfffd, 0xfffd, 0xfffd, 0xbf08, 0xbf09, 0xbf0a,
0xbf0b, 0xbf0c, 0xbf0d, 0xbf0e, 0xbf0f, 0xbf10, 0xbf11, 0xbf12,
0xbf13, 0xbf14, 0xbf15, 0xbf16, 0xbf17, 0xbf18, 0xfffd, 0xbf19,
0xbf1a, 0xbf1b, 0xbf1c, 0xbf1d, 0xbf1e, 0xbf1f, 0xbf20, 0xbf21,
0xbf22, 0xbf23, 0xfffd, 0xfffd, 0xfffd, 0xbf24, 0xbf25, 0xbf26,
0xbf27, 0xbf28, 0xbf29, 0xbf2a, 0xbf2b, 0xbf2c, 0xbf2d, 0xbf2e,
0xbf2f, 0xbf30, 0xbf31, 0xbf32, 0xbf33, 0xbf34, 0xfffd, 0xbf35,
0xbf36, 0xbf37, 0xbf38, 0xbf39, 0xbf3a, 0xbf3b, 0xbf3c, 0xbf3d,
0xbf3e, 0xbf3f, 0xfffd, 0xfffd, 0xfffd, 0xbf40, 0xbf41, 0xbf42,
0xbf43, 0xbf44, 0xbf45, 0xbf46, 0xbf47, 0xbf48, 0xbf49, 0xbf4a,
0xbf4b, 0xbf4c, 0xbf4d, 0xbf4e, 0xbf4f, 0xbf50, 0xfffd, 0xbf51,
0xbf52, 0xbf53, 0xbf54, 0xbf55, 0xbf56, 0xbf57, 0xbf58, 0xbf59,
0xbf5a, 0xbf5b, 0xfffd, 0xfffd, 0xfffd, 0xbf5c, 0xbf5d, 0xbf5e,
0xbf5f, 0xbf60, 0xbf61, 0xbf62, 0xbf63, 0xbf64, 0xbf65, 0xbf66,
0xbf67, 0xbf68, 0xbf69, 0xbf6a, 0xbf6b, 0xbf6c, 0xfffd, 0xbf6d,
0xbf6e, 0xbf6f, 0xbf70, 0xbf71, 0xbf72, 0xbf73, 0xbf74, 0xbf75,
0xbf76, 0xbf77, 0xfffd, 0xfffd, 0xfffd, 0xbf78, 0xbf79, 0xbf7a,
0xbf7b, 0xbf7c, 0xbf7d, 0xbf7e, 0xbf7f, 0xbf80, 0xbf81, 0xbf82,
0xbf83, 0xbf84, 0xbf85, 0xbf86, 0xbf87, 0xbf88, 0xfffd, 0xbf89,
0xbf8a, 0xbf8b, 0xbf8c, 0xbf8d, 0xbf8e, 0xbf8f, 0xbf90, 0xbf91,
0xbf92, 0xbf93, 0xbf94, 0xbf95, 0xbf96, 0xbf97, 0xbf98, 0xbf99,
0xbf9a, 0xbf9b, 0xbf9c, 0xbf9d, 0xbf9e, 0xbf9f, 0xbfa0, 0xbfa1,
0xbfa2, 0xbfa3, 0xbfa4, 0xfffd, 0xbfa5, 0xbfa6, 0xbfa7, 0xbfa8,
0xbfa9, 0xbfaa, 0xbfab, 0xbfac, 0xbfad, 0xbfae, 0xbfaf, 0xfffd,
0xfffd, 0xfffd, 0xbfb0, 0xbfb1, 0xbfb2, 0xbfb3, 0xbfb4, 0xbfb5,
0xbfb6, 0xbfb7, 0xbfb8, 0xbfb9, 0xbfba, 0xbfbb, 0xbfbc, 0xbfbd,
0xbfbe, 0xbfbf, 0xbfc0, 0xfffd, 0xbfc1, 0xbfc2, 0xbfc3, 0xbfc4,
0xbfc5, 0xbfc6, 0xbfc7, 0xbfc8, 0xbfc9, 0xbfca, 0xbfcb, 0xfffd,
0xfffd, 0xfffd, 0xbfcc, 0xbfcd, 0xbfce, 0xbfcf, 0xbfd0, 0xbfd1,
0xbfd2, 0xbfd3, 0xbfd4, 0xbfd5, 0xbfd6, 0xbfd7, 0xbfd8, 0xbfd9,
0xbfda, 0xbfdb, 0xbfdc, 0xfffd, 0xbfdd, 0xbfde, 0xbfdf, 0xbfe0,
0xbfe1, 0xbfe2, 0xbfe3, 0xbfe4, 0xbfe5, 0xbfe6, 0xbfe7, 0xfffd,
0xfffd, 0xfffd, 0xbfe8, 0xbfe9, 0xbfea, 0xbfeb, 0xbfec, 0xbfed,
0xbfee, 0xbfef, 0xbff0, 0xbff1, 0xbff2, 0xbff3, 0xbff4, 0xbff5,
0xbff6, 0xbff7, 0xbff8, 0xfffd, 0xbff9, 0xbffa, 0xbffb, 0xbffc,
0xbffd, 0xbffe, 0xbfff, 0xc000, 0xc001, 0xc002, 0xc003, 0xfffd,
0xfffd, 0xfffd, 0xc004, 0xc005, 0xc006, 0xc007, 0xc008, 0xc009,
0xc00a, 0xc00b, 0xc00c, 0xc00d, 0xc00e, 0xc00f, 0xc010, 0xc011,
0xc012, 0xc013, 0xc014, 0xfffd, 0xc015, 0xc016, 0xc017, 0xc018,
0xc019, 0xc01a, 0xc01b, 0xc01c, 0xc01d, 0xc01e, 0xc01f, 0xfffd,
0xfffd, 0xfffd, 0xc020, 0xc021, 0xc022, 0xc023, 0xc024, 0xc025,
0xc026, 0xc027, 0xc028, 0xc029, 0xc02a, 0xc02b, 0xc02c, 0xc02d,
0xc02e, 0xc02f, 0xc030, 0xfffd, 0xc031, 0xc032, 0xc033, 0xc034,
0xc035, 0xc036, 0xc037, 0xc038, 0xc039, 0xc03a, 0xc03b, 0xc03c,
0xc03d, 0xc03e, 0xc03f, 0xc040, 0xc041, 0xc042, 0xc043, 0xc044,
0xc045, 0xc046, 0xc047, 0xc048, 0xc049, 0xc04a, 0xc04b, 0xc04c,
0xfffd, 0xc04d, 0xc04e, 0xc04f, 0xc050, 0xc051, 0xc052, 0xc053,
0xc054, 0xc055, 0xc056, 0xc057, 0xfffd, 0xfffd, 0xfffd, 0xc058,
0xc059, 0xc05a, 0xc05b, 0xc05c, 0xc05d, 0xc05e, 0xc05f, 0xc060,
0xc061, 0xc062, 0xc063, 0xc064, 0xc065, 0xc066, 0xc067, 0xc068,
0xfffd, 0xc069, 0xc06a, 0xc06b, 0xc06c, 0xc06d, 0xc06e, 0xc06f,
0xc070, 0xc071, 0xc072, 0xc073, 0xfffd, 0xfffd, 0xfffd, 0xc074,
0xc075, 0xc076, 0xc077, 0xc078, 0xc079, 0xc07a, 0xc07b, 0xc07c,
0xc07d, 0xc07e, 0xc07f, 0xc080, 0xc081, 0xc082, 0xc083, 0xc084,
0xfffd, 0xc085, 0xc086, 0xc087, 0xc088, 0xc089, 0xc08a, 0xc08b,
0xc08c, 0xc08d, 0xc08e, 0xc08f, 0xfffd, 0xfffd, 0xfffd, 0xc090,
0xc091, 0xc092, 0xc093, 0xc094, 0xc095, 0xc096, 0xc097, 0xc098,
0xc099, 0xc09a, 0xc09b, 0xc09c, 0xc09d, 0xc09e, 0xc09f, 0xc0a0,
0xfffd, 0xc0a1, 0xc0a2, 0xc0a3, 0xc0a4, 0xc0a5, 0xc0a6, 0xc0a7,
0xc0a8, 0xc0a9, 0xc0aa, 0xc0ab, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc0ac, 0xc0ad, 0xc0ae, 0xc0af,
0xc0b0, 0xc0b1, 0xc0b2, 0xc0b3, 0xc0b4, 0xc0b5, 0xc0b6, 0xc0b7,
0xc0b8, 0xc0b9, 0xc0ba, 0xc0bb, 0xc0bc, 0xfffd, 0xc0bd, 0xc0be,
0xc0bf, 0xc0c0, 0xc0c1, 0xc0c2, 0xc0c3, 0xc0c4, 0xc0c5, 0xc0c6,
0xc0c7, 0xfffd, 0xfffd, 0xfffd, 0xc0c8, 0xc0c9, 0xc0ca, 0xc0cb,
0xc0cc, 0xc0cd, 0xc0ce, 0xc0cf, 0xc0d0, 0xc0d1, 0xc0d2, 0xc0d3,
0xc0d4, 0xc0d5, 0xc0d6, 0xc0d7, 0xc0d8, 0xfffd, 0xc0d9, 0xc0da,
0xc0db, 0xc0dc, 0xc0dd, 0xc0de, 0xc0df, 0xc0e0, 0xc0e1, 0xc0e2,
0xc0e3, 0xfffd, 0xfffd, 0xfffd, 0xc0e4, 0xc0e5, 0xc0e6, 0xc0e7,
0xc0e8, 0xc0e9, 0xc0ea, 0xc0eb, 0xc0ec, 0xc0ed, 0xc0ee, 0xc0ef,
0xc0f0, 0xc0f1, 0xc0f2, 0xc0f3, 0xc0f4, 0xfffd, 0xc0f5, 0xc0f6,
0xc0f7, 0xc0f8, 0xc0f9, 0xc0fa, 0xc0fb, 0xc0fc, 0xc0fd, 0xc0fe,
0xc0ff, 0xfffd, 0xfffd, 0xfffd, 0xc100, 0xc101, 0xc102, 0xc103,
0xc104, 0xc105, 0xc106, 0xc107, 0xc108, 0xc109, 0xc10a, 0xc10b,
0xc10c, 0xc10d, 0xc10e, 0xc10f, 0xc110, 0xfffd, 0xc111, 0xc112,
0xc113, 0xc114, 0xc115, 0xc116, 0xc117, 0xc118, 0xc119, 0xc11a,
0xc11b, 0xfffd, 0xfffd, 0xfffd, 0xc11c, 0xc11d, 0xc11e, 0xc11f,
0xc120, 0xc121, 0xc122, 0xc123, 0xc124, 0xc125, 0xc126, 0xc127,
0xc128, 0xc129, 0xc12a, 0xc12b, 0xc12c, 0xfffd, 0xc12d, 0xc12e,
0xc12f, 0xc130, 0xc131, 0xc132, 0xc133, 0xc134, 0xc135, 0xc136,
0xc137, 0xc138, 0xc139, 0xc13a, 0xc13b, 0xc13c, 0xc13d, 0xc13e,
0xc13f, 0xc140, 0xc141, 0xc142, 0xc143, 0xc144, 0xc145, 0xc146,
0xc147, 0xc148, 0xfffd, 0xc149, 0xc14a, 0xc14b, 0xc14c, 0xc14d,
0xc14e, 0xc14f, 0xc150, 0xc151, 0xc152, 0xc153, 0xfffd, 0xfffd,
0xfffd, 0xc154, 0xc155, 0xc156, 0xc157, 0xc158, 0xc159, 0xc15a,
0xc15b, 0xc15c, 0xc15d, 0xc15e, 0xc15f, 0xc160, 0xc161, 0xc162,
0xc163, 0xc164, 0xfffd, 0xc165, 0xc166, 0xc167, 0xc168, 0xc169,
0xc16a, 0xc16b, 0xc16c, 0xc16d, 0xc16e, 0xc16f, 0xfffd, 0xfffd,
0xfffd, 0xc170, 0xc171, 0xc172, 0xc173, 0xc174, 0xc175, 0xc176,
0xc177, 0xc178, 0xc179, 0xc17a, 0xc17b, 0xc17c, 0xc17d, 0xc17e,
0xc17f, 0xc180, 0xfffd, 0xc181, 0xc182, 0xc183, 0xc184, 0xc185,
0xc186, 0xc187, 0xc188, 0xc189, 0xc18a, 0xc18b, 0xfffd, 0xfffd,
0xfffd, 0xc18c, 0xc18d, 0xc18e, 0xc18f, 0xc190, 0xc191, 0xc192,
0xc193, 0xc194, 0xc195, 0xc196, 0xc197, 0xc198, 0xc199, 0xc19a,
0xc19b, 0xc19c, 0xfffd, 0xc19d, 0xc19e, 0xc19f, 0xc1a0, 0xc1a1,
0xc1a2, 0xc1a3, 0xc1a4, 0xc1a5, 0xc1a6, 0xc1a7, 0xfffd, 0xfffd,
0xfffd, 0xc1a8, 0xc1a9, 0xc1aa, 0xc1ab, 0xc1ac, 0xc1ad, 0xc1ae,
0xc1af, 0xc1b0, 0xc1b1, 0xc1b2, 0xc1b3, 0xc1b4, 0xc1b5, 0xc1b6,
0xc1b7, 0xc1b8, 0xfffd, 0xc1b9, 0xc1ba, 0xc1bb, 0xc1bc, 0xc1bd,
0xc1be, 0xc1bf, 0xc1c0, 0xc1c1, 0xc1c2, 0xc1c3, 0xfffd, 0xfffd,
0xfffd, 0xc1c4, 0xc1c5, 0xc1c6, 0xc1c7, 0xc1c8, 0xc1c9, 0xc1ca,
0xc1cb, 0xc1cc, 0xc1cd, 0xc1ce, 0xc1cf, 0xc1d0, 0xc1d1, 0xc1d2,
0xc1d3, 0xc1d4, 0xfffd, 0xc1d5, 0xc1d6, 0xc1d7, 0xc1d8, 0xc1d9,
0xc1da, 0xc1db, 0xc1dc, 0xc1dd, 0xc1de, 0xc1df, 0xc1e0, 0xc1e1,
0xc1e2, 0xc1e3, 0xc1e4, 0xc1e5, 0xc1e6, 0xc1e7, 0xc1e8, 0xc1e9,
0xc1ea, 0xc1eb, 0xc1ec, 0xc1ed, 0xc1ee, 0xc1ef, 0xc1f0, 0xfffd,
0xc1f1, 0xc1f2, 0xc1f3, 0xc1f4, 0xc1f5, 0xc1f6, 0xc1f7, 0xc1f8,
0xc1f9, 0xc1fa, 0xc1fb, 0xfffd, 0xfffd, 0xfffd, 0xc1fc, 0xc1fd,
0xc1fe, 0xc1ff, 0xc200, 0xc201, 0xc202, 0xc203, 0xc204, 0xc205,
0xc206, 0xc207, 0xc208, 0xc209, 0xc20a, 0xc20b, 0xc20c, 0xfffd,
0xc20d, 0xc20e, 0xc20f, 0xc210, 0xc211, 0xc212, 0xc213, 0xc214,
0xc215, 0xc216, 0xc217, 0xfffd, 0xfffd, 0xfffd, 0xc218, 0xc219,
0xc21a, 0xc21b, 0xc21c, 0xc21d, 0xc21e, 0xc21f, 0xc220, 0xc221,
0xc222, 0xc223, 0xc224, 0xc225, 0xc226, 0xc227, 0xc228, 0xfffd,
0xc229, 0xc22a, 0xc22b, 0xc22c, 0xc22d, 0xc22e, 0xc22f, 0xc230,
0xc231, 0xc232, 0xc233, 0xfffd, 0xfffd, 0xfffd, 0xc234, 0xc235,
0xc236, 0xc237, 0xc238, 0xc239, 0xc23a, 0xc23b, 0xc23c, 0xc23d,
0xc23e, 0xc23f, 0xc240, 0xc241, 0xc242, 0xc243, 0xc244, 0xfffd,
0xc245, 0xc246, 0xc247, 0xc248, 0xc249, 0xc24a, 0xc24b, 0xc24c,
0xc24d, 0xc24e, 0xc24f, 0xfffd, 0xfffd, 0xfffd, 0xc250, 0xc251,
0xc252, 0xc253, 0xc254, 0xc255, 0xc256, 0xc257, 0xc258, 0xc259,
0xc25a, 0xc25b, 0xc25c, 0xc25d, 0xc25e, 0xc25f, 0xc260, 0xfffd,
0xc261, 0xc262, 0xc263, 0xc264, 0xc265, 0xc266, 0xc267, 0xc268,
0xc269, 0xc26a, 0xc26b, 0xfffd, 0xfffd, 0xfffd, 0xc26c, 0xc26d,
0xc26e, 0xc26f, 0xc270, 0xc271, 0xc272, 0xc273, 0xc274, 0xc275,
0xc276, 0xc277, 0xc278, 0xc279, 0xc27a, 0xc27b, 0xc27c, 0xfffd,
0xc27d, 0xc27e, 0xc27f, 0xc280, 0xc281, 0xc282, 0xc283, 0xc284,
0xc285, 0xc286, 0xc287, 0xc288, 0xc289, 0xc28a, 0xc28b, 0xc28c,
0xc28d, 0xc28e, 0xc28f, 0xc290, 0xc291, 0xc292, 0xc293, 0xc294,
0xc295, 0xc296, 0xc297, 0xc298, 0xfffd, 0xc299, 0xc29a, 0xc29b,
0xc29c, 0xc29d, 0xc29e, 0xc29f, 0xc2a0, 0xc2a1, 0xc2a2, 0xc2a3,
0xfffd, 0xfffd, 0xfffd, 0xc2a4, 0xc2a5, 0xc2a6, 0xc2a7, 0xc2a8,
0xc2a9, 0xc2aa, 0xc2ab, 0xc2ac, 0xc2ad, 0xc2ae, 0xc2af, 0xc2b0,
0xc2b1, 0xc2b2, 0xc2b3, 0xc2b4, 0xfffd, 0xc2b5, 0xc2b6, 0xc2b7,
0xc2b8, 0xc2b9, 0xc2ba, 0xc2bb, 0xc2bc, 0xc2bd, 0xc2be, 0xc2bf,
0xfffd, 0xfffd, 0xfffd, 0xc2c0, 0xc2c1, 0xc2c2, 0xc2c3, 0xc2c4,
0xc2c5, 0xc2c6, 0xc2c7, 0xc2c8, 0xc2c9, 0xc2ca, 0xc2cb, 0xc2cc,
0xc2cd, 0xc2ce, 0xc2cf, 0xc2d0, 0xfffd, 0xc2d1, 0xc2d2, 0xc2d3,
0xc2d4, 0xc2d5, 0xc2d6, 0xc2d7, 0xc2d8, 0xc2d9, 0xc2da, 0xc2db,
0xfffd, 0xfffd, 0xfffd, 0xc2dc, 0xc2dd, 0xc2de, 0xc2df, 0xc2e0,
0xc2e1, 0xc2e2, 0xc2e3, 0xc2e4, 0xc2e5, 0xc2e6, 0xc2e7, 0xc2e8,
0xc2e9, 0xc2ea, 0xc2eb, 0xc2ec, 0xfffd, 0xc2ed, 0xc2ee, 0xc2ef,
0xc2f0, 0xc2f1, 0xc2f2, 0xc2f3, 0xc2f4, 0xc2f5, 0xc2f6, 0xc2f7,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xc2f8, 0xc2f9, 0xc2fa, 0xc2fb, 0xc2fc, 0xc2fd, 0xc2fe, 0xc2ff,
0xc300, 0xc301, 0xc302, 0xc303, 0xc304, 0xc305, 0xc306, 0xc307,
0xc308, 0xfffd, 0xc309, 0xc30a, 0xc30b, 0xc30c, 0xc30d, 0xc30e,
0xc30f, 0xc310, 0xc311, 0xc312, 0xc313, 0xfffd, 0xfffd, 0xfffd,
0xc314, 0xc315, 0xc316, 0xc317, 0xc318, 0xc319, 0xc31a, 0xc31b,
0xc31c, 0xc31d, 0xc31e, 0xc31f, 0xc320, 0xc321, 0xc322, 0xc323,
0xc324, 0xfffd, 0xc325, 0xc326, 0xc327, 0xc328, 0xc329, 0xc32a,
0xc32b, 0xc32c, 0xc32d, 0xc32e, 0xc32f, 0xfffd, 0xfffd, 0xfffd,
0xc330, 0xc331, 0xc332, 0xc333, 0xc334, 0xc335, 0xc336, 0xc337,
0xc338, 0xc339, 0xc33a, 0xc33b, 0xc33c, 0xc33d, 0xc33e, 0xc33f,
0xc340, 0xfffd, 0xc341, 0xc342, 0xc343, 0xc344, 0xc345, 0xc346,
0xc347, 0xc348, 0xc349, 0xc34a, 0xc34b, 0xfffd, 0xfffd, 0xfffd,
0xc34c, 0xc34d, 0xc34e, 0xc34f, 0xc350, 0xc351, 0xc352, 0xc353,
0xc354, 0xc355, 0xc356, 0xc357, 0xc358, 0xc359, 0xc35a, 0xc35b,
0xc35c, 0xfffd, 0xc35d, 0xc35e, 0xc35f, 0xc360, 0xc361, 0xc362,
0xc363, 0xc364, 0xc365, 0xc366, 0xc367, 0xfffd, 0xfffd, 0xfffd,
0xc368, 0xc369, 0xc36a, 0xc36b, 0xc36c, 0xc36d, 0xc36e, 0xc36f,
0xc370, 0xc371, 0xc372, 0xc373, 0xc374, 0xc375, 0xc376, 0xc377,
0xc378, 0xfffd, 0xc379, 0xc37a, 0xc37b, 0xc37c, 0xc37d, 0xc37e,
0xc37f, 0xc380, 0xc381, 0xc382, 0xc383, 0xc384, 0xc385, 0xc386,
0xc387, 0xc388, 0xc389, 0xc38a, 0xc38b, 0xc38c, 0xc38d, 0xc38e,
0xc38f, 0xc390, 0xc391, 0xc392, 0xc393, 0xc394, 0xfffd, 0xc395,
0xc396, 0xc397, 0xc398, 0xc399, 0xc39a, 0xc39b, 0xc39c, 0xc39d,
0xc39e, 0xc39f, 0xfffd, 0xfffd, 0xfffd, 0xc3a0, 0xc3a1, 0xc3a2,
0xc3a3, 0xc3a4, 0xc3a5, 0xc3a6, 0xc3a7, 0xc3a8, 0xc3a9, 0xc3aa,
0xc3ab, 0xc3ac, 0xc3ad, 0xc3ae, 0xc3af, 0xc3b0, 0xfffd, 0xc3b1,
0xc3b2, 0xc3b3, 0xc3b4, 0xc3b5, 0xc3b6, 0xc3b7, 0xc3b8, 0xc3b9,
0xc3ba, 0xc3bb, 0xfffd, 0xfffd, 0xfffd, 0xc3bc, 0xc3bd, 0xc3be,
0xc3bf, 0xc3c0, 0xc3c1, 0xc3c2, 0xc3c3, 0xc3c4, 0xc3c5, 0xc3c6,
0xc3c7, 0xc3c8, 0xc3c9, 0xc3ca, 0xc3cb, 0xc3cc, 0xfffd, 0xc3cd,
0xc3ce, 0xc3cf, 0xc3d0, 0xc3d1, 0xc3d2, 0xc3d3, 0xc3d4, 0xc3d5,
0xc3d6, 0xc3d7, 0xfffd, 0xfffd, 0xfffd, 0xc3d8, 0xc3d9, 0xc3da,
0xc3db, 0xc3dc, 0xc3dd, 0xc3de, 0xc3df, 0xc3e0, 0xc3e1, 0xc3e2,
0xc3e3, 0xc3e4, 0xc3e5, 0xc3e6, 0xc3e7, 0xc3e8, 0xfffd, 0xc3e9,
0xc3ea, 0xc3eb, 0xc3ec, 0xc3ed, 0xc3ee, 0xc3ef, 0xc3f0, 0xc3f1,
0xc3f2, 0xc3f3, 0xfffd, 0xfffd, 0xfffd, 0xc3f4, 0xc3f5, 0xc3f6,
0xc3f7, 0xc3f8, 0xc3f9, 0xc3fa, 0xc3fb, 0xc3fc, 0xc3fd, 0xc3fe,
0xc3ff, 0xc400, 0xc401, 0xc402, 0xc403, 0xc404, 0xfffd, 0xc405,
0xc406, 0xc407, 0xc408, 0xc409, 0xc40a, 0xc40b, 0xc40c, 0xc40d,
0xc40e, 0xc40f, 0xfffd, 0xfffd, 0xfffd, 0xc410, 0xc411, 0xc412,
0xc413, 0xc414, 0xc415, 0xc416, 0xc417, 0xc418, 0xc419, 0xc41a,
0xc41b, 0xc41c, 0xc41d, 0xc41e, 0xc41f, 0xc420, 0xfffd, 0xc421,
0xc422, 0xc423, 0xc424, 0xc425, 0xc426, 0xc427, 0xc428, 0xc429,
0xc42a, 0xc42b, 0xc42c, 0xc42d, 0xc42e, 0xc42f, 0xc430, 0xc431,
0xc432, 0xc433, 0xc434, 0xc435, 0xc436, 0xc437, 0xc438, 0xc439,
0xc43a, 0xc43b, 0xc43c, 0xfffd, 0xc43d, 0xc43e, 0xc43f, 0xc440,
0xc441, 0xc442, 0xc443, 0xc444, 0xc445, 0xc446, 0xc447, 0xfffd,
0xfffd, 0xfffd, 0xc448, 0xc449, 0xc44a, 0xc44b, 0xc44c, 0xc44d,
0xc44e, 0xc44f, 0xc450, 0xc451, 0xc452, 0xc453, 0xc454, 0xc455,
0xc456, 0xc457, 0xc458, 0xfffd, 0xc459, 0xc45a, 0xc45b, 0xc45c,
0xc45d, 0xc45e, 0xc45f, 0xc460, 0xc461, 0xc462, 0xc463, 0xfffd,
0xfffd, 0xfffd, 0xc464, 0xc465, 0xc466, 0xc467, 0xc468, 0xc469,
0xc46a, 0xc46b, 0xc46c, 0xc46d, 0xc46e, 0xc46f, 0xc470, 0xc471,
0xc472, 0xc473, 0xc474, 0xfffd, 0xc475, 0xc476, 0xc477, 0xc478,
0xc479, 0xc47a, 0xc47b, 0xc47c, 0xc47d, 0xc47e, 0xc47f, 0xfffd,
0xfffd, 0xfffd, 0xc480, 0xc481, 0xc482, 0xc483, 0xc484, 0xc485,
0xc486, 0xc487, 0xc488, 0xc489, 0xc48a, 0xc48b, 0xc48c, 0xc48d,
0xc48e, 0xc48f, 0xc490, 0xfffd, 0xc491, 0xc492, 0xc493, 0xc494,
0xc495, 0xc496, 0xc497, 0xc498, 0xc499, 0xc49a, 0xc49b, 0xfffd,
0xfffd, 0xfffd, 0xc49c, 0xc49d, 0xc49e, 0xc49f, 0xc4a0, 0xc4a1,
0xc4a2, 0xc4a3, 0xc4a4, 0xc4a5, 0xc4a6, 0xc4a7, 0xc4a8, 0xc4a9,
0xc4aa, 0xc4ab, 0xc4ac, 0xfffd, 0xc4ad, 0xc4ae, 0xc4af, 0xc4b0,
0xc4b1, 0xc4b2, 0xc4b3, 0xc4b4, 0xc4b5, 0xc4b6, 0xc4b7, 0xfffd,
0xfffd, 0xfffd, 0xc4b8, 0xc4b9, 0xc4ba, 0xc4bb, 0xc4bc, 0xc4bd,
0xc4be, 0xc4bf, 0xc4c0, 0xc4c1, 0xc4c2, 0xc4c3, 0xc4c4, 0xc4c5,
0xc4c6, 0xc4c7, 0xc4c8, 0xfffd, 0xc4c9, 0xc4ca, 0xc4cb, 0xc4cc,
0xc4cd, 0xc4ce, 0xc4cf, 0xc4d0, 0xc4d1, 0xc4d2, 0xc4d3, 0xc4d4,
0xc4d5, 0xc4d6, 0xc4d7, 0xc4d8, 0xc4d9, 0xc4da, 0xc4db, 0xc4dc,
0xc4dd, 0xc4de, 0xc4df, 0xc4e0, 0xc4e1, 0xc4e2, 0xc4e3, 0xc4e4,
0xfffd, 0xc4e5, 0xc4e6, 0xc4e7, 0xc4e8, 0xc4e9, 0xc4ea, 0xc4eb,
0xc4ec, 0xc4ed, 0xc4ee, 0xc4ef, 0xfffd, 0xfffd, 0xfffd, 0xc4f0,
0xc4f1, 0xc4f2, 0xc4f3, 0xc4f4, 0xc4f5, 0xc4f6, 0xc4f7, 0xc4f8,
0xc4f9, 0xc4fa, 0xc4fb, 0xc4fc, 0xc4fd, 0xc4fe, 0xc4ff, 0xc500,
0xfffd, 0xc501, 0xc502, 0xc503, 0xc504, 0xc505, 0xc506, 0xc507,
0xc508, 0xc509, 0xc50a, 0xc50b, 0xfffd, 0xfffd, 0xfffd, 0xc50c,
0xc50d, 0xc50e, 0xc50f, 0xc510, 0xc511, 0xc512, 0xc513, 0xc514,
0xc515, 0xc516, 0xc517, 0xc518, 0xc519, 0xc51a, 0xc51b, 0xc51c,
0xfffd, 0xc51d, 0xc51e, 0xc51f, 0xc520, 0xc521, 0xc522, 0xc523,
0xc524, 0xc525, 0xc526, 0xc527, 0xfffd, 0xfffd, 0xfffd, 0xc528,
0xc529, 0xc52a, 0xc52b, 0xc52c, 0xc52d, 0xc52e, 0xc52f, 0xc530,
0xc531, 0xc532, 0xc533, 0xc534, 0xc535, 0xc536, 0xc537, 0xc538,
0xfffd, 0xc539, 0xc53a, 0xc53b, 0xc53c, 0xc53d, 0xc53e, 0xc53f,
0xc540, 0xc541, 0xc542, 0xc543, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc544, 0xc545, 0xc546, 0xc547,
0xc548, 0xc549, 0xc54a, 0xc54b, 0xc54c, 0xc54d, 0xc54e, 0xc54f,
0xc550, 0xc551, 0xc552, 0xc553, 0xc554, 0xfffd, 0xc555, 0xc556,
0xc557, 0xc558, 0xc559, 0xc55a, 0xc55b, 0xc55c, 0xc55d, 0xc55e,
0xc55f, 0xfffd, 0xfffd, 0xfffd, 0xc560, 0xc561, 0xc562, 0xc563,
0xc564, 0xc565, 0xc566, 0xc567, 0xc568, 0xc569, 0xc56a, 0xc56b,
0xc56c, 0xc56d, 0xc56e, 0xc56f, 0xc570, 0xfffd, 0xc571, 0xc572,
0xc573, 0xc574, 0xc575, 0xc576, 0xc577, 0xc578, 0xc579, 0xc57a,
0xc57b, 0xfffd, 0xfffd, 0xfffd, 0xc57c, 0xc57d, 0xc57e, 0xc57f,
0xc580, 0xc581, 0xc582, 0xc583, 0xc584, 0xc585, 0xc586, 0xc587,
0xc588, 0xc589, 0xc58a, 0xc58b, 0xc58c, 0xfffd, 0xc58d, 0xc58e,
0xc58f, 0xc590, 0xc591, 0xc592, 0xc593, 0xc594, 0xc595, 0xc596,
0xc597, 0xfffd, 0xfffd, 0xfffd, 0xc598, 0xc599, 0xc59a, 0xc59b,
0xc59c, 0xc59d, 0xc59e, 0xc59f, 0xc5a0, 0xc5a1, 0xc5a2, 0xc5a3,
0xc5a4, 0xc5a5, 0xc5a6, 0xc5a7, 0xc5a8, 0xfffd, 0xc5a9, 0xc5aa,
0xc5ab, 0xc5ac, 0xc5ad, 0xc5ae, 0xc5af, 0xc5b0, 0xc5b1, 0xc5b2,
0xc5b3, 0xfffd, 0xfffd, 0xfffd, 0xc5b4, 0xc5b5, 0xc5b6, 0xc5b7,
0xc5b8, 0xc5b9, 0xc5ba, 0xc5bb, 0xc5bc, 0xc5bd, 0xc5be, 0xc5bf,
0xc5c0, 0xc5c1, 0xc5c2, 0xc5c3, 0xc5c4, 0xfffd, 0xc5c5, 0xc5c6,
0xc5c7, 0xc5c8, 0xc5c9, 0xc5ca, 0xc5cb, 0xc5cc, 0xc5cd, 0xc5ce,
0xc5cf, 0xc5d0, 0xc5d1, 0xc5d2, 0xc5d3, 0xc5d4, 0xc5d5, 0xc5d6,
0xc5d7, 0xc5d8, 0xc5d9, 0xc5da, 0xc5db, 0xc5dc, 0xc5dd, 0xc5de,
0xc5df, 0xc5e0, 0xfffd, 0xc5e1, 0xc5e2, 0xc5e3, 0xc5e4, 0xc5e5,
0xc5e6, 0xc5e7, 0xc5e8, 0xc5e9, 0xc5ea, 0xc5eb, 0xfffd, 0xfffd,
0xfffd, 0xc5ec, 0xc5ed, 0xc5ee, 0xc5ef, 0xc5f0, 0xc5f1, 0xc5f2,
0xc5f3, 0xc5f4, 0xc5f5, 0xc5f6, 0xc5f7, 0xc5f8, 0xc5f9, 0xc5fa,
0xc5fb, 0xc5fc, 0xfffd, 0xc5fd, 0xc5fe, 0xc5ff, 0xc600, 0xc601,
0xc602, 0xc603, 0xc604, 0xc605, 0xc606, 0xc607, 0xfffd, 0xfffd,
0xfffd, 0xc608, 0xc609, 0xc60a, 0xc60b, 0xc60c, 0xc60d, 0xc60e,
0xc60f, 0xc610, 0xc611, 0xc612, 0xc613, 0xc614, 0xc615, 0xc616,
0xc617, 0xc618, 0xfffd, 0xc619, 0xc61a, 0xc61b, 0xc61c, 0xc61d,
0xc61e, 0xc61f, 0xc620, 0xc621, 0xc622, 0xc623, 0xfffd, 0xfffd,
0xfffd, 0xc624, 0xc625, 0xc626, 0xc627, 0xc628, 0xc629, 0xc62a,
0xc62b, 0xc62c, 0xc62d, 0xc62e, 0xc62f, 0xc630, 0xc631, 0xc632,
0xc633, 0xc634, 0xfffd, 0xc635, 0xc636, 0xc637, 0xc638, 0xc639,
0xc63a, 0xc63b, 0xc63c, 0xc63d, 0xc63e, 0xc63f, 0xfffd, 0xfffd,
0xfffd, 0xc640, 0xc641, 0xc642, 0xc643, 0xc644, 0xc645, 0xc646,
0xc647, 0xc648, 0xc649, 0xc64a, 0xc64b, 0xc64c, 0xc64d, 0xc64e,
0xc64f, 0xc650, 0xfffd, 0xc651, 0xc652, 0xc653, 0xc654, 0xc655,
0xc656, 0xc657, 0xc658, 0xc659, 0xc65a, 0xc65b, 0xfffd, 0xfffd,
0xfffd, 0xc65c, 0xc65d, 0xc65e, 0xc65f, 0xc660, 0xc661, 0xc662,
0xc663, 0xc664, 0xc665, 0xc666, 0xc667, 0xc668, 0xc669, 0xc66a,
0xc66b, 0xc66c, 0xfffd, 0xc66d, 0xc66e, 0xc66f, 0xc670, 0xc671,
0xc672, 0xc673, 0xc674, 0xc675, 0xc676, 0xc677, 0xc678, 0xc679,
0xc67a, 0xc67b, 0xc67c, 0xc67d, 0xc67e, 0xc67f, 0xc680, 0xc681,
0xc682, 0xc683, 0xc684, 0xc685, 0xc686, 0xc687, 0xc688, 0xfffd,
0xc689, 0xc68a, 0xc68b, 0xc68c, 0xc68d, 0xc68e, 0xc68f, 0xc690,
0xc691, 0xc692, 0xc693, 0xfffd, 0xfffd, 0xfffd, 0xc694, 0xc695,
0xc696, 0xc697, 0xc698, 0xc699, 0xc69a, 0xc69b, 0xc69c, 0xc69d,
0xc69e, 0xc69f, 0xc6a0, 0xc6a1, 0xc6a2, 0xc6a3, 0xc6a4, 0xfffd,
0xc6a5, 0xc6a6, 0xc6a7, 0xc6a8, 0xc6a9, 0xc6aa, 0xc6ab, 0xc6ac,
0xc6ad, 0xc6ae, 0xc6af, 0xfffd, 0xfffd, 0xfffd, 0xc6b0, 0xc6b1,
0xc6b2, 0xc6b3, 0xc6b4, 0xc6b5, 0xc6b6, 0xc6b7, 0xc6b8, 0xc6b9,
0xc6ba, 0xc6bb, 0xc6bc, 0xc6bd, 0xc6be, 0xc6bf, 0xc6c0, 0xfffd,
0xc6c1, 0xc6c2, 0xc6c3, 0xc6c4, 0xc6c5, 0xc6c6, 0xc6c7, 0xc6c8,
0xc6c9, 0xc6ca, 0xc6cb, 0xfffd, 0xfffd, 0xfffd, 0xc6cc, 0xc6cd,
0xc6ce, 0xc6cf, 0xc6d0, 0xc6d1, 0xc6d2, 0xc6d3, 0xc6d4, 0xc6d5,
0xc6d6, 0xc6d7, 0xc6d8, 0xc6d9, 0xc6da, 0xc6db, 0xc6dc, 0xfffd,
0xc6dd, 0xc6de, 0xc6df, 0xc6e0, 0xc6e1, 0xc6e2, 0xc6e3, 0xc6e4,
0xc6e5, 0xc6e6, 0xc6e7, 0xfffd, 0xfffd, 0xfffd, 0xc6e8, 0xc6e9,
0xc6ea, 0xc6eb, 0xc6ec, 0xc6ed, 0xc6ee, 0xc6ef, 0xc6f0, 0xc6f1,
0xc6f2, 0xc6f3, 0xc6f4, 0xc6f5, 0xc6f6, 0xc6f7, 0xc6f8, 0xfffd,
0xc6f9, 0xc6fa, 0xc6fb, 0xc6fc, 0xc6fd, 0xc6fe, 0xc6ff, 0xc700,
0xc701, 0xc702, 0xc703, 0xfffd, 0xfffd, 0xfffd, 0xc704, 0xc705,
0xc706, 0xc707, 0xc708, 0xc709, 0xc70a, 0xc70b, 0xc70c, 0xc70d,
0xc70e, 0xc70f, 0xc710, 0xc711, 0xc712, 0xc713, 0xc714, 0xfffd,
0xc715, 0xc716, 0xc717, 0xc718, 0xc719, 0xc71a, 0xc71b, 0xc71c,
0xc71d, 0xc71e, 0xc71f, 0xc720, 0xc721, 0xc722, 0xc723, 0xc724,
0xc725, 0xc726, 0xc727, 0xc728, 0xc729, 0xc72a, 0xc72b, 0xc72c,
0xc72d, 0xc72e, 0xc72f, 0xc730, 0xfffd, 0xc731, 0xc732, 0xc733,
0xc734, 0xc735, 0xc736, 0xc737, 0xc738, 0xc739, 0xc73a, 0xc73b,
0xfffd, 0xfffd, 0xfffd, 0xc73c, 0xc73d, 0xc73e, 0xc73f, 0xc740,
0xc741, 0xc742, 0xc743, 0xc744, 0xc745, 0xc746, 0xc747, 0xc748,
0xc749, 0xc74a, 0xc74b, 0xc74c, 0xfffd, 0xc74d, 0xc74e, 0xc74f,
0xc750, 0xc751, 0xc752, 0xc753, 0xc754, 0xc755, 0xc756, 0xc757,
0xfffd, 0xfffd, 0xfffd, 0xc758, 0xc759, 0xc75a, 0xc75b, 0xc75c,
0xc75d, 0xc75e, 0xc75f, 0xc760, 0xc761, 0xc762, 0xc763, 0xc764,
0xc765, 0xc766, 0xc767, 0xc768, 0xfffd, 0xc769, 0xc76a, 0xc76b,
0xc76c, 0xc76d, 0xc76e, 0xc76f, 0xc770, 0xc771, 0xc772, 0xc773,
0xfffd, 0xfffd, 0xfffd, 0xc774, 0xc775, 0xc776, 0xc777, 0xc778,
0xc779, 0xc77a, 0xc77b, 0xc77c, 0xc77d, 0xc77e, 0xc77f, 0xc780,
0xc781, 0xc782, 0xc783, 0xc784, 0xfffd, 0xc785, 0xc786, 0xc787,
0xc788, 0xc789, 0xc78a, 0xc78b, 0xc78c, 0xc78d, 0xc78e, 0xc78f,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xc790, 0xc791, 0xc792, 0xc793, 0xc794, 0xc795, 0xc796, 0xc797,
0xc798, 0xc799, 0xc79a, 0xc79b, 0xc79c, 0xc79d, 0xc79e, 0xc79f,
0xc7a0, 0xfffd, 0xc7a1, 0xc7a2, 0xc7a3, 0xc7a4, 0xc7a5, 0xc7a6,
0xc7a7, 0xc7a8, 0xc7a9, 0xc7aa, 0xc7ab, 0xfffd, 0xfffd, 0xfffd,
0xc7ac, 0xc7ad, 0xc7ae, 0xc7af, 0xc7b0, 0xc7b1, 0xc7b2, 0xc7b3,
0xc7b4, 0xc7b5, 0xc7b6, 0xc7b7, 0xc7b8, 0xc7b9, 0xc7ba, 0xc7bb,
0xc7bc, 0xfffd, 0xc7bd, 0xc7be, 0xc7bf, 0xc7c0, 0xc7c1, 0xc7c2,
0xc7c3, 0xc7c4, 0xc7c5, 0xc7c6, 0xc7c7, 0xfffd, 0xfffd, 0xfffd,
0xc7c8, 0xc7c9, 0xc7ca, 0xc7cb, 0xc7cc, 0xc7cd, 0xc7ce, 0xc7cf,
0xc7d0, 0xc7d1, 0xc7d2, 0xc7d3, 0xc7d4, 0xc7d5, 0xc7d6, 0xc7d7,
0xc7d8, 0xfffd, 0xc7d9, 0xc7da, 0xc7db, 0xc7dc, 0xc7dd, 0xc7de,
0xc7df, 0xc7e0, 0xc7e1, 0xc7e2, 0xc7e3, 0xfffd, 0xfffd, 0xfffd,
0xc7e4, 0xc7e5, 0xc7e6, 0xc7e7, 0xc7e8, 0xc7e9, 0xc7ea, 0xc7eb,
0xc7ec, 0xc7ed, 0xc7ee, 0xc7ef, 0xc7f0, 0xc7f1, 0xc7f2, 0xc7f3,
0xc7f4, 0xfffd, 0xc7f5, 0xc7f6, 0xc7f7, 0xc7f8, 0xc7f9, 0xc7fa,
0xc7fb, 0xc7fc, 0xc7fd, 0xc7fe, 0xc7ff, 0xfffd, 0xfffd, 0xfffd,
0xc800, 0xc801, 0xc802, 0xc803, 0xc804, 0xc805, 0xc806, 0xc807,
0xc808, 0xc809, 0xc80a, 0xc80b, 0xc80c, 0xc80d, 0xc80e, 0xc80f,
0xc810, 0xfffd, 0xc811, 0xc812, 0xc813, 0xc814, 0xc815, 0xc816,
0xc817, 0xc818, 0xc819, 0xc81a, 0xc81b, 0xc81c, 0xc81d, 0xc81e,
0xc81f, 0xc820, 0xc821, 0xc822, 0xc823, 0xc824, 0xc825, 0xc826,
0xc827, 0xc828, 0xc829, 0xc82a, 0xc82b, 0xc82c, 0xfffd, 0xc82d,
0xc82e, 0xc82f, 0xc830, 0xc831, 0xc832, 0xc833, 0xc834, 0xc835,
0xc836, 0xc837, 0xfffd, 0xfffd, 0xfffd, 0xc838, 0xc839, 0xc83a,
0xc83b, 0xc83c, 0xc83d, 0xc83e, 0xc83f, 0xc840, 0xc841, 0xc842,
0xc843, 0xc844, 0xc845, 0xc846, 0xc847, 0xc848, 0xfffd, 0xc849,
0xc84a, 0xc84b, 0xc84c, 0xc84d, 0xc84e, 0xc84f, 0xc850, 0xc851,
0xc852, 0xc853, 0xfffd, 0xfffd, 0xfffd, 0xc854, 0xc855, 0xc856,
0xc857, 0xc858, 0xc859, 0xc85a, 0xc85b, 0xc85c, 0xc85d, 0xc85e,
0xc85f, 0xc860, 0xc861, 0xc862, 0xc863, 0xc864, 0xfffd, 0xc865,
0xc866, 0xc867, 0xc868, 0xc869, 0xc86a, 0xc86b, 0xc86c, 0xc86d,
0xc86e, 0xc86f, 0xfffd, 0xfffd, 0xfffd, 0xc870, 0xc871, 0xc872,
0xc873, 0xc874, 0xc875, 0xc876, 0xc877, 0xc878, 0xc879, 0xc87a,
0xc87b, 0xc87c, 0xc87d, 0xc87e, 0xc87f, 0xc880, 0xfffd, 0xc881,
0xc882, 0xc883, 0xc884, 0xc885, 0xc886, 0xc887, 0xc888, 0xc889,
0xc88a, 0xc88b, 0xfffd, 0xfffd, 0xfffd, 0xc88c, 0xc88d, 0xc88e,
0xc88f, 0xc890, 0xc891, 0xc892, 0xc893, 0xc894, 0xc895, 0xc896,
0xc897, 0xc898, 0xc899, 0xc89a, 0xc89b, 0xc89c, 0xfffd, 0xc89d,
0xc89e, 0xc89f, 0xc8a0, 0xc8a1, 0xc8a2, 0xc8a3, 0xc8a4, 0xc8a5,
0xc8a6, 0xc8a7, 0xfffd, 0xfffd, 0xfffd, 0xc8a8, 0xc8a9, 0xc8aa,
0xc8ab, 0xc8ac, 0xc8ad, 0xc8ae, 0xc8af, 0xc8b0, 0xc8b1, 0xc8b2,
0xc8b3, 0xc8b4, 0xc8b5, 0xc8b6, 0xc8b7, 0xc8b8, 0xfffd, 0xc8b9,
0xc8ba, 0xc8bb, 0xc8bc, 0xc8bd, 0xc8be, 0xc8bf, 0xc8c0, 0xc8c1,
0xc8c2, 0xc8c3, 0xc8c4, 0xc8c5, 0xc8c6, 0xc8c7, 0xc8c8, 0xc8c9,
0xc8ca, 0xc8cb, 0xc8cc, 0xc8cd, 0xc8ce, 0xc8cf, 0xc8d0, 0xc8d1,
0xc8d2, 0xc8d3, 0xc8d4, 0xfffd, 0xc8d5, 0xc8d6, 0xc8d7, 0xc8d8,
0xc8d9, 0xc8da, 0xc8db, 0xc8dc, 0xc8dd, 0xc8de, 0xc8df, 0xfffd,
0xfffd, 0xfffd, 0xc8e0, 0xc8e1, 0xc8e2, 0xc8e3, 0xc8e4, 0xc8e5,
0xc8e6, 0xc8e7, 0xc8e8, 0xc8e9, 0xc8ea, 0xc8eb, 0xc8ec, 0xc8ed,
0xc8ee, 0xc8ef, 0xc8f0, 0xfffd, 0xc8f1, 0xc8f2, 0xc8f3, 0xc8f4,
0xc8f5, 0xc8f6, 0xc8f7, 0xc8f8, 0xc8f9, 0xc8fa, 0xc8fb, 0xfffd,
0xfffd, 0xfffd, 0xc8fc, 0xc8fd, 0xc8fe, 0xc8ff, 0xc900, 0xc901,
0xc902, 0xc903, 0xc904, 0xc905, 0xc906, 0xc907, 0xc908, 0xc909,
0xc90a, 0xc90b, 0xc90c, 0xfffd, 0xc90d, 0xc90e, 0xc90f, 0xc910,
0xc911, 0xc912, 0xc913, 0xc914, 0xc915, 0xc916, 0xc917, 0xfffd,
0xfffd, 0xfffd, 0xc918, 0xc919, 0xc91a, 0xc91b, 0xc91c, 0xc91d,
0xc91e, 0xc91f, 0xc920, 0xc921, 0xc922, 0xc923, 0xc924, 0xc925,
0xc926, 0xc927, 0xc928, 0xfffd, 0xc929, 0xc92a, 0xc92b, 0xc92c,
0xc92d, 0xc92e, 0xc92f, 0xc930, 0xc931, 0xc932, 0xc933, 0xfffd,
0xfffd, 0xfffd, 0xc934, 0xc935, 0xc936, 0xc937, 0xc938, 0xc939,
0xc93a, 0xc93b, 0xc93c, 0xc93d, 0xc93e, 0xc93f, 0xc940, 0xc941,
0xc942, 0xc943, 0xc944, 0xfffd, 0xc945, 0xc946, 0xc947, 0xc948,
0xc949, 0xc94a, 0xc94b, 0xc94c, 0xc94d, 0xc94e, 0xc94f, 0xfffd,
0xfffd, 0xfffd, 0xc950, 0xc951, 0xc952, 0xc953, 0xc954, 0xc955,
0xc956, 0xc957, 0xc958, 0xc959, 0xc95a, 0xc95b, 0xc95c, 0xc95d,
0xc95e, 0xc95f, 0xc960, 0xfffd, 0xc961, 0xc962, 0xc963, 0xc964,
0xc965, 0xc966, 0xc967, 0xc968, 0xc969, 0xc96a, 0xc96b, 0xc96c,
0xc96d, 0xc96e, 0xc96f, 0xc970, 0xc971, 0xc972, 0xc973, 0xc974,
0xc975, 0xc976, 0xc977, 0xc978, 0xc979, 0xc97a, 0xc97b, 0xc97c,
0xfffd, 0xc97d, 0xc97e, 0xc97f, 0xc980, 0xc981, 0xc982, 0xc983,
0xc984, 0xc985, 0xc986, 0xc987, 0xfffd, 0xfffd, 0xfffd, 0xc988,
0xc989, 0xc98a, 0xc98b, 0xc98c, 0xc98d, 0xc98e, 0xc98f, 0xc990,
0xc991, 0xc992, 0xc993, 0xc994, 0xc995, 0xc996, 0xc997, 0xc998,
0xfffd, 0xc999, 0xc99a, 0xc99b, 0xc99c, 0xc99d, 0xc99e, 0xc99f,
0xc9a0, 0xc9a1, 0xc9a2, 0xc9a3, 0xfffd, 0xfffd, 0xfffd, 0xc9a4,
0xc9a5, 0xc9a6, 0xc9a7, 0xc9a8, 0xc9a9, 0xc9aa, 0xc9ab, 0xc9ac,
0xc9ad, 0xc9ae, 0xc9af, 0xc9b0, 0xc9b1, 0xc9b2, 0xc9b3, 0xc9b4,
0xfffd, 0xc9b5, 0xc9b6, 0xc9b7, 0xc9b8, 0xc9b9, 0xc9ba, 0xc9bb,
0xc9bc, 0xc9bd, 0xc9be, 0xc9bf, 0xfffd, 0xfffd, 0xfffd, 0xc9c0,
0xc9c1, 0xc9c2, 0xc9c3, 0xc9c4, 0xc9c5, 0xc9c6, 0xc9c7, 0xc9c8,
0xc9c9, 0xc9ca, 0xc9cb, 0xc9cc, 0xc9cd, 0xc9ce, 0xc9cf, 0xc9d0,
0xfffd, 0xc9d1, 0xc9d2, 0xc9d3, 0xc9d4, 0xc9d5, 0xc9d6, 0xc9d7,
0xc9d8, 0xc9d9, 0xc9da, 0xc9db, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xc9dc, 0xc9dd, 0xc9de, 0xc9df,
0xc9e0, 0xc9e1, 0xc9e2, 0xc9e3, 0xc9e4, 0xc9e5, 0xc9e6, 0xc9e7,
0xc9e8, 0xc9e9, 0xc9ea, 0xc9eb, 0xc9ec, 0xfffd, 0xc9ed, 0xc9ee,
0xc9ef, 0xc9f0, 0xc9f1, 0xc9f2, 0xc9f3, 0xc9f4, 0xc9f5, 0xc9f6,
0xc9f7, 0xfffd, 0xfffd, 0xfffd, 0xc9f8, 0xc9f9, 0xc9fa, 0xc9fb,
0xc9fc, 0xc9fd, 0xc9fe, 0xc9ff, 0xca00, 0xca01, 0xca02, 0xca03,
0xca04, 0xca05, 0xca06, 0xca07, 0xca08, 0xfffd, 0xca09, 0xca0a,
0xca0b, 0xca0c, 0xca0d, 0xca0e, 0xca0f, 0xca10, 0xca11, 0xca12,
0xca13, 0xfffd, 0xfffd, 0xfffd, 0xca14, 0xca15, 0xca16, 0xca17,
0xca18, 0xca19, 0xca1a, 0xca1b, 0xca1c, 0xca1d, 0xca1e, 0xca1f,
0xca20, 0xca21, 0xca22, 0xca23, 0xca24, 0xfffd, 0xca25, 0xca26,
0xca27, 0xca28, 0xca29, 0xca2a, 0xca2b, 0xca2c, 0xca2d, 0xca2e,
0xca2f, 0xfffd, 0xfffd, 0xfffd, 0xca30, 0xca31, 0xca32, 0xca33,
0xca34, 0xca35, 0xca36, 0xca37, 0xca38, 0xca39, 0xca3a, 0xca3b,
0xca3c, 0xca3d, 0xca3e, 0xca3f, 0xca40, 0xfffd, 0xca41, 0xca42,
0xca43, 0xca44, 0xca45, 0xca46, 0xca47, 0xca48, 0xca49, 0xca4a,
0xca4b, 0xfffd, 0xfffd, 0xfffd, 0xca4c, 0xca4d, 0xca4e, 0xca4f,
0xca50, 0xca51, 0xca52, 0xca53, 0xca54, 0xca55, 0xca56, 0xca57,
0xca58, 0xca59, 0xca5a, 0xca5b, 0xca5c, 0xfffd, 0xca5d, 0xca5e,
0xca5f, 0xca60, 0xca61, 0xca62, 0xca63, 0xca64, 0xca65, 0xca66,
0xca67, 0xca68, 0xca69, 0xca6a, 0xca6b, 0xca6c, 0xca6d, 0xca6e,
0xca6f, 0xca70, 0xca71, 0xca72, 0xca73, 0xca74, 0xca75, 0xca76,
0xca77, 0xca78, 0xfffd, 0xca79, 0xca7a, 0xca7b, 0xca7c, 0xca7d,
0xca7e, 0xca7f, 0xca80, 0xca81, 0xca82, 0xca83, 0xfffd, 0xfffd,
0xfffd, 0xca84, 0xca85, 0xca86, 0xca87, 0xca88, 0xca89, 0xca8a,
0xca8b, 0xca8c, 0xca8d, 0xca8e, 0xca8f, 0xca90, 0xca91, 0xca92,
0xca93, 0xca94, 0xfffd, 0xca95, 0xca96, 0xca97, 0xca98, 0xca99,
0xca9a, 0xca9b, 0xca9c, 0xca9d, 0xca9e, 0xca9f, 0xfffd, 0xfffd,
0xfffd, 0xcaa0, 0xcaa1, 0xcaa2, 0xcaa3, 0xcaa4, 0xcaa5, 0xcaa6,
0xcaa7, 0xcaa8, 0xcaa9, 0xcaaa, 0xcaab, 0xcaac, 0xcaad, 0xcaae,
0xcaaf, 0xcab0, 0xfffd, 0xcab1, 0xcab2, 0xcab3, 0xcab4, 0xcab5,
0xcab6, 0xcab7, 0xcab8, 0xcab9, 0xcaba, 0xcabb, 0xfffd, 0xfffd,
0xfffd, 0xcabc, 0xcabd, 0xcabe, 0xcabf, 0xcac0, 0xcac1, 0xcac2,
0xcac3, 0xcac4, 0xcac5, 0xcac6, 0xcac7, 0xcac8, 0xcac9, 0xcaca,
0xcacb, 0xcacc, 0xfffd, 0xcacd, 0xcace, 0xcacf, 0xcad0, 0xcad1,
0xcad2, 0xcad3, 0xcad4, 0xcad5, 0xcad6, 0xcad7, 0xfffd, 0xfffd,
0xfffd, 0xcad8, 0xcad9, 0xcada, 0xcadb, 0xcadc, 0xcadd, 0xcade,
0xcadf, 0xcae0, 0xcae1, 0xcae2, 0xcae3, 0xcae4, 0xcae5, 0xcae6,
0xcae7, 0xcae8, 0xfffd, 0xcae9, 0xcaea, 0xcaeb, 0xcaec, 0xcaed,
0xcaee, 0xcaef, 0xcaf0, 0xcaf1, 0xcaf2, 0xcaf3, 0xfffd, 0xfffd,
0xfffd, 0xcaf4, 0xcaf5, 0xcaf6, 0xcaf7, 0xcaf8, 0xcaf9, 0xcafa,
0xcafb, 0xcafc, 0xcafd, 0xcafe, 0xcaff, 0xcb00, 0xcb01, 0xcb02,
0xcb03, 0xcb04, 0xfffd, 0xcb05, 0xcb06, 0xcb07, 0xcb08, 0xcb09,
0xcb0a, 0xcb0b, 0xcb0c, 0xcb0d, 0xcb0e, 0xcb0f, 0xcb10, 0xcb11,
0xcb12, 0xcb13, 0xcb14, 0xcb15, 0xcb16, 0xcb17, 0xcb18, 0xcb19,
0xcb1a, 0xcb1b, 0xcb1c, 0xcb1d, 0xcb1e, 0xcb1f, 0xcb20, 0xfffd,
0xcb21, 0xcb22, 0xcb23, 0xcb24, 0xcb25, 0xcb26, 0xcb27, 0xcb28,
0xcb29, 0xcb2a, 0xcb2b, 0xfffd, 0xfffd, 0xfffd, 0xcb2c, 0xcb2d,
0xcb2e, 0xcb2f, 0xcb30, 0xcb31, 0xcb32, 0xcb33, 0xcb34, 0xcb35,
0xcb36, 0xcb37, 0xcb38, 0xcb39, 0xcb3a, 0xcb3b, 0xcb3c, 0xfffd,
0xcb3d, 0xcb3e, 0xcb3f, 0xcb40, 0xcb41, 0xcb42, 0xcb43, 0xcb44,
0xcb45, 0xcb46, 0xcb47, 0xfffd, 0xfffd, 0xfffd, 0xcb48, 0xcb49,
0xcb4a, 0xcb4b, 0xcb4c, 0xcb4d, 0xcb4e, 0xcb4f, 0xcb50, 0xcb51,
0xcb52, 0xcb53, 0xcb54, 0xcb55, 0xcb56, 0xcb57, 0xcb58, 0xfffd,
0xcb59, 0xcb5a, 0xcb5b, 0xcb5c, 0xcb5d, 0xcb5e, 0xcb5f, 0xcb60,
0xcb61, 0xcb62, 0xcb63, 0xfffd, 0xfffd, 0xfffd, 0xcb64, 0xcb65,
0xcb66, 0xcb67, 0xcb68, 0xcb69, 0xcb6a, 0xcb6b, 0xcb6c, 0xcb6d,
0xcb6e, 0xcb6f, 0xcb70, 0xcb71, 0xcb72, 0xcb73, 0xcb74, 0xfffd,
0xcb75, 0xcb76, 0xcb77, 0xcb78, 0xcb79, 0xcb7a, 0xcb7b, 0xcb7c,
0xcb7d, 0xcb7e, 0xcb7f, 0xfffd, 0xfffd, 0xfffd, 0xcb80, 0xcb81,
0xcb82, 0xcb83, 0xcb84, 0xcb85, 0xcb86, 0xcb87, 0xcb88, 0xcb89,
0xcb8a, 0xcb8b, 0xcb8c, 0xcb8d, 0xcb8e, 0xcb8f, 0xcb90, 0xfffd,
0xcb91, 0xcb92, 0xcb93, 0xcb94, 0xcb95, 0xcb96, 0xcb97, 0xcb98,
0xcb99, 0xcb9a, 0xcb9b, 0xfffd, 0xfffd, 0xfffd, 0xcb9c, 0xcb9d,
0xcb9e, 0xcb9f, 0xcba0, 0xcba1, 0xcba2, 0xcba3, 0xcba4, 0xcba5,
0xcba6, 0xcba7, 0xcba8, 0xcba9, 0xcbaa, 0xcbab, 0xcbac, 0xfffd,
0xcbad, 0xcbae, 0xcbaf, 0xcbb0, 0xcbb1, 0xcbb2, 0xcbb3, 0xcbb4,
0xcbb5, 0xcbb6, 0xcbb7, 0xcbb8, 0xcbb9, 0xcbba, 0xcbbb, 0xcbbc,
0xcbbd, 0xcbbe, 0xcbbf, 0xcbc0, 0xcbc1, 0xcbc2, 0xcbc3, 0xcbc4,
0xcbc5, 0xcbc6, 0xcbc7, 0xcbc8, 0xfffd, 0xcbc9, 0xcbca, 0xcbcb,
0xcbcc, 0xcbcd, 0xcbce, 0xcbcf, 0xcbd0, 0xcbd1, 0xcbd2, 0xcbd3,
0xfffd, 0xfffd, 0xfffd, 0xcbd4, 0xcbd5, 0xcbd6, 0xcbd7, 0xcbd8,
0xcbd9, 0xcbda, 0xcbdb, 0xcbdc, 0xcbdd, 0xcbde, 0xcbdf, 0xcbe0,
0xcbe1, 0xcbe2, 0xcbe3, 0xcbe4, 0xfffd, 0xcbe5, 0xcbe6, 0xcbe7,
0xcbe8, 0xcbe9, 0xcbea, 0xcbeb, 0xcbec, 0xcbed, 0xcbee, 0xcbef,
0xfffd, 0xfffd, 0xfffd, 0xcbf0, 0xcbf1, 0xcbf2, 0xcbf3, 0xcbf4,
0xcbf5, 0xcbf6, 0xcbf7, 0xcbf8, 0xcbf9, 0xcbfa, 0xcbfb, 0xcbfc,
0xcbfd, 0xcbfe, 0xcbff, 0xcc00, 0xfffd, 0xcc01, 0xcc02, 0xcc03,
0xcc04, 0xcc05, 0xcc06, 0xcc07, 0xcc08, 0xcc09, 0xcc0a, 0xcc0b,
0xfffd, 0xfffd, 0xfffd, 0xcc0c, 0xcc0d, 0xcc0e, 0xcc0f, 0xcc10,
0xcc11, 0xcc12, 0xcc13, 0xcc14, 0xcc15, 0xcc16, 0xcc17, 0xcc18,
0xcc19, 0xcc1a, 0xcc1b, 0xcc1c, 0xfffd, 0xcc1d, 0xcc1e, 0xcc1f,
0xcc20, 0xcc21, 0xcc22, 0xcc23, 0xcc24, 0xcc25, 0xcc26, 0xcc27,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xcc28, 0xcc29, 0xcc2a, 0xcc2b, 0xcc2c, 0xcc2d, 0xcc2e, 0xcc2f,
0xcc30, 0xcc31, 0xcc32, 0xcc33, 0xcc34, 0xcc35, 0xcc36, 0xcc37,
0xcc38, 0xfffd, 0xcc39, 0xcc3a, 0xcc3b, 0xcc3c, 0xcc3d, 0xcc3e,
0xcc3f, 0xcc40, 0xcc41, 0xcc42, 0xcc43, 0xfffd, 0xfffd, 0xfffd,
0xcc44, 0xcc45, 0xcc46, 0xcc47, 0xcc48, 0xcc49, 0xcc4a, 0xcc4b,
0xcc4c, 0xcc4d, 0xcc4e, 0xcc4f, 0xcc50, 0xcc51, 0xcc52, 0xcc53,
0xcc54, 0xfffd, 0xcc55, 0xcc56, 0xcc57, 0xcc58, 0xcc59, 0xcc5a,
0xcc5b, 0xcc5c, 0xcc5d, 0xcc5e, 0xcc5f, 0xfffd, 0xfffd, 0xfffd,
0xcc60, 0xcc61, 0xcc62, 0xcc63, 0xcc64, 0xcc65, 0xcc66, 0xcc67,
0xcc68, 0xcc69, 0xcc6a, 0xcc6b, 0xcc6c, 0xcc6d, 0xcc6e, 0xcc6f,
0xcc70, 0xfffd, 0xcc71, 0xcc72, 0xcc73, 0xcc74, 0xcc75, 0xcc76,
0xcc77, 0xcc78, 0xcc79, 0xcc7a, 0xcc7b, 0xfffd, 0xfffd, 0xfffd,
0xcc7c, 0xcc7d, 0xcc7e, 0xcc7f, 0xcc80, 0xcc81, 0xcc82, 0xcc83,
0xcc84, 0xcc85, 0xcc86, 0xcc87, 0xcc88, 0xcc89, 0xcc8a, 0xcc8b,
0xcc8c, 0xfffd, 0xcc8d, 0xcc8e, 0xcc8f, 0xcc90, 0xcc91, 0xcc92,
0xcc93, 0xcc94, 0xcc95, 0xcc96, 0xcc97, 0xfffd, 0xfffd, 0xfffd,
0xcc98, 0xcc99, 0xcc9a, 0xcc9b, 0xcc9c, 0xcc9d, 0xcc9e, 0xcc9f,
0xcca0, 0xcca1, 0xcca2, 0xcca3, 0xcca4, 0xcca5, 0xcca6, 0xcca7,
0xcca8, 0xfffd, 0xcca9, 0xccaa, 0xccab, 0xccac, 0xccad, 0xccae,
0xccaf, 0xccb0, 0xccb1, 0xccb2, 0xccb3, 0xccb4, 0xccb5, 0xccb6,
0xccb7, 0xccb8, 0xccb9, 0xccba, 0xccbb, 0xccbc, 0xccbd, 0xccbe,
0xccbf, 0xccc0, 0xccc1, 0xccc2, 0xccc3, 0xccc4, 0xfffd, 0xccc5,
0xccc6, 0xccc7, 0xccc8, 0xccc9, 0xccca, 0xcccb, 0xcccc, 0xcccd,
0xccce, 0xcccf, 0xfffd, 0xfffd, 0xfffd, 0xccd0, 0xccd1, 0xccd2,
0xccd3, 0xccd4, 0xccd5, 0xccd6, 0xccd7, 0xccd8, 0xccd9, 0xccda,
0xccdb, 0xccdc, 0xccdd, 0xccde, 0xccdf, 0xcce0, 0xfffd, 0xcce1,
0xcce2, 0xcce3, 0xcce4, 0xcce5, 0xcce6, 0xcce7, 0xcce8, 0xcce9,
0xccea, 0xcceb, 0xfffd, 0xfffd, 0xfffd, 0xccec, 0xcced, 0xccee,
0xccef, 0xccf0, 0xccf1, 0xccf2, 0xccf3, 0xccf4, 0xccf5, 0xccf6,
0xccf7, 0xccf8, 0xccf9, 0xccfa, 0xccfb, 0xccfc, 0xfffd, 0xccfd,
0xccfe, 0xccff, 0xcd00, 0xcd01, 0xcd02, 0xcd03, 0xcd04, 0xcd05,
0xcd06, 0xcd07, 0xfffd, 0xfffd, 0xfffd, 0xcd08, 0xcd09, 0xcd0a,
0xcd0b, 0xcd0c, 0xcd0d, 0xcd0e, 0xcd0f, 0xcd10, 0xcd11, 0xcd12,
0xcd13, 0xcd14, 0xcd15, 0xcd16, 0xcd17, 0xcd18, 0xfffd, 0xcd19,
0xcd1a, 0xcd1b, 0xcd1c, 0xcd1d, 0xcd1e, 0xcd1f, 0xcd20, 0xcd21,
0xcd22, 0xcd23, 0xfffd, 0xfffd, 0xfffd, 0xcd24, 0xcd25, 0xcd26,
0xcd27, 0xcd28, 0xcd29, 0xcd2a, 0xcd2b, 0xcd2c, 0xcd2d, 0xcd2e,
0xcd2f, 0xcd30, 0xcd31, 0xcd32, 0xcd33, 0xcd34, 0xfffd, 0xcd35,
0xcd36, 0xcd37, 0xcd38, 0xcd39, 0xcd3a, 0xcd3b, 0xcd3c, 0xcd3d,
0xcd3e, 0xcd3f, 0xfffd, 0xfffd, 0xfffd, 0xcd40, 0xcd41, 0xcd42,
0xcd43, 0xcd44, 0xcd45, 0xcd46, 0xcd47, 0xcd48, 0xcd49, 0xcd4a,
0xcd4b, 0xcd4c, 0xcd4d, 0xcd4e, 0xcd4f, 0xcd50, 0xfffd, 0xcd51,
0xcd52, 0xcd53, 0xcd54, 0xcd55, 0xcd56, 0xcd57, 0xcd58, 0xcd59,
0xcd5a, 0xcd5b, 0xcd5c, 0xcd5d, 0xcd5e, 0xcd5f, 0xcd60, 0xcd61,
0xcd62, 0xcd63, 0xcd64, 0xcd65, 0xcd66, 0xcd67, 0xcd68, 0xcd69,
0xcd6a, 0xcd6b, 0xcd6c, 0xfffd, 0xcd6d, 0xcd6e, 0xcd6f, 0xcd70,
0xcd71, 0xcd72, 0xcd73, 0xcd74, 0xcd75, 0xcd76, 0xcd77, 0xfffd,
0xfffd, 0xfffd, 0xcd78, 0xcd79, 0xcd7a, 0xcd7b, 0xcd7c, 0xcd7d,
0xcd7e, 0xcd7f, 0xcd80, 0xcd81, 0xcd82, 0xcd83, 0xcd84, 0xcd85,
0xcd86, 0xcd87, 0xcd88, 0xfffd, 0xcd89, 0xcd8a, 0xcd8b, 0xcd8c,
0xcd8d, 0xcd8e, 0xcd8f, 0xcd90, 0xcd91, 0xcd92, 0xcd93, 0xfffd,
0xfffd, 0xfffd, 0xcd94, 0xcd95, 0xcd96, 0xcd97, 0xcd98, 0xcd99,
0xcd9a, 0xcd9b, 0xcd9c, 0xcd9d, 0xcd9e, 0xcd9f, 0xcda0, 0xcda1,
0xcda2, 0xcda3, 0xcda4, 0xfffd, 0xcda5, 0xcda6, 0xcda7, 0xcda8,
0xcda9, 0xcdaa, 0xcdab, 0xcdac, 0xcdad, 0xcdae, 0xcdaf, 0xfffd,
0xfffd, 0xfffd, 0xcdb0, 0xcdb1, 0xcdb2, 0xcdb3, 0xcdb4, 0xcdb5,
0xcdb6, 0xcdb7, 0xcdb8, 0xcdb9, 0xcdba, 0xcdbb, 0xcdbc, 0xcdbd,
0xcdbe, 0xcdbf, 0xcdc0, 0xfffd, 0xcdc1, 0xcdc2, 0xcdc3, 0xcdc4,
0xcdc5, 0xcdc6, 0xcdc7, 0xcdc8, 0xcdc9, 0xcdca, 0xcdcb, 0xfffd,
0xfffd, 0xfffd, 0xcdcc, 0xcdcd, 0xcdce, 0xcdcf, 0xcdd0, 0xcdd1,
0xcdd2, 0xcdd3, 0xcdd4, 0xcdd5, 0xcdd6, 0xcdd7, 0xcdd8, 0xcdd9,
0xcdda, 0xcddb, 0xcddc, 0xfffd, 0xcddd, 0xcdde, 0xcddf, 0xcde0,
0xcde1, 0xcde2, 0xcde3, 0xcde4, 0xcde5, 0xcde6, 0xcde7, 0xfffd,
0xfffd, 0xfffd, 0xcde8, 0xcde9, 0xcdea, 0xcdeb, 0xcdec, 0xcded,
0xcdee, 0xcdef, 0xcdf0, 0xcdf1, 0xcdf2, 0xcdf3, 0xcdf4, 0xcdf5,
0xcdf6, 0xcdf7, 0xcdf8, 0xfffd, 0xcdf9, 0xcdfa, 0xcdfb, 0xcdfc,
0xcdfd, 0xcdfe, 0xcdff, 0xce00, 0xce01, 0xce02, 0xce03, 0xce04,
0xce05, 0xce06, 0xce07, 0xce08, 0xce09, 0xce0a, 0xce0b, 0xce0c,
0xce0d, 0xce0e, 0xce0f, 0xce10, 0xce11, 0xce12, 0xce13, 0xce14,
0xfffd, 0xce15, 0xce16, 0xce17, 0xce18, 0xce19, 0xce1a, 0xce1b,
0xce1c, 0xce1d, 0xce1e, 0xce1f, 0xfffd, 0xfffd, 0xfffd, 0xce20,
0xce21, 0xce22, 0xce23, 0xce24, 0xce25, 0xce26, 0xce27, 0xce28,
0xce29, 0xce2a, 0xce2b, 0xce2c, 0xce2d, 0xce2e, 0xce2f, 0xce30,
0xfffd, 0xce31, 0xce32, 0xce33, 0xce34, 0xce35, 0xce36, 0xce37,
0xce38, 0xce39, 0xce3a, 0xce3b, 0xfffd, 0xfffd, 0xfffd, 0xce3c,
0xce3d, 0xce3e, 0xce3f, 0xce40, 0xce41, 0xce42, 0xce43, 0xce44,
0xce45, 0xce46, 0xce47, 0xce48, 0xce49, 0xce4a, 0xce4b, 0xce4c,
0xfffd, 0xce4d, 0xce4e, 0xce4f, 0xce50, 0xce51, 0xce52, 0xce53,
0xce54, 0xce55, 0xce56, 0xce57, 0xfffd, 0xfffd, 0xfffd, 0xce58,
0xce59, 0xce5a, 0xce5b, 0xce5c, 0xce5d, 0xce5e, 0xce5f, 0xce60,
0xce61, 0xce62, 0xce63, 0xce64, 0xce65, 0xce66, 0xce67, 0xce68,
0xfffd, 0xce69, 0xce6a, 0xce6b, 0xce6c, 0xce6d, 0xce6e, 0xce6f,
0xce70, 0xce71, 0xce72, 0xce73, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xce74, 0xce75, 0xce76, 0xce77,
0xce78, 0xce79, 0xce7a, 0xce7b, 0xce7c, 0xce7d, 0xce7e, 0xce7f,
0xce80, 0xce81, 0xce82, 0xce83, 0xce84, 0xfffd, 0xce85, 0xce86,
0xce87, 0xce88, 0xce89, 0xce8a, 0xce8b, 0xce8c, 0xce8d, 0xce8e,
0xce8f, 0xfffd, 0xfffd, 0xfffd, 0xce90, 0xce91, 0xce92, 0xce93,
0xce94, 0xce95, 0xce96, 0xce97, 0xce98, 0xce99, 0xce9a, 0xce9b,
0xce9c, 0xce9d, 0xce9e, 0xce9f, 0xcea0, 0xfffd, 0xcea1, 0xcea2,
0xcea3, 0xcea4, 0xcea5, 0xcea6, 0xcea7, 0xcea8, 0xcea9, 0xceaa,
0xceab, 0xfffd, 0xfffd, 0xfffd, 0xceac, 0xcead, 0xceae, 0xceaf,
0xceb0, 0xceb1, 0xceb2, 0xceb3, 0xceb4, 0xceb5, 0xceb6, 0xceb7,
0xceb8, 0xceb9, 0xceba, 0xcebb, 0xcebc, 0xfffd, 0xcebd, 0xcebe,
0xcebf, 0xcec0, 0xcec1, 0xcec2, 0xcec3, 0xcec4, 0xcec5, 0xcec6,
0xcec7, 0xfffd, 0xfffd, 0xfffd, 0xcec8, 0xcec9, 0xceca, 0xcecb,
0xcecc, 0xcecd, 0xcece, 0xcecf, 0xced0, 0xced1, 0xced2, 0xced3,
0xced4, 0xced5, 0xced6, 0xced7, 0xced8, 0xfffd, 0xced9, 0xceda,
0xcedb, 0xcedc, 0xcedd, 0xcede, 0xcedf, 0xcee0, 0xcee1, 0xcee2,
0xcee3, 0xfffd, 0xfffd, 0xfffd, 0xcee4, 0xcee5, 0xcee6, 0xcee7,
0xcee8, 0xcee9, 0xceea, 0xceeb, 0xceec, 0xceed, 0xceee, 0xceef,
0xcef0, 0xcef1, 0xcef2, 0xcef3, 0xcef4, 0xfffd, 0xcef5, 0xcef6,
0xcef7, 0xcef8, 0xcef9, 0xcefa, 0xcefb, 0xcefc, 0xcefd, 0xcefe,
0xceff, 0xcf00, 0xcf01, 0xcf02, 0xcf03, 0xcf04, 0xcf05, 0xcf06,
0xcf07, 0xcf08, 0xcf09, 0xcf0a, 0xcf0b, 0xcf0c, 0xcf0d, 0xcf0e,
0xcf0f, 0xcf10, 0xfffd, 0xcf11, 0xcf12, 0xcf13, 0xcf14, 0xcf15,
0xcf16, 0xcf17, 0xcf18, 0xcf19, 0xcf1a, 0xcf1b, 0xfffd, 0xfffd,
0xfffd, 0xcf1c, 0xcf1d, 0xcf1e, 0xcf1f, 0xcf20, 0xcf21, 0xcf22,
0xcf23, 0xcf24, 0xcf25, 0xcf26, 0xcf27, 0xcf28, 0xcf29, 0xcf2a,
0xcf2b, 0xcf2c, 0xfffd, 0xcf2d, 0xcf2e, 0xcf2f, 0xcf30, 0xcf31,
0xcf32, 0xcf33, 0xcf34, 0xcf35, 0xcf36, 0xcf37, 0xfffd, 0xfffd,
0xfffd, 0xcf38, 0xcf39, 0xcf3a, 0xcf3b, 0xcf3c, 0xcf3d, 0xcf3e,
0xcf3f, 0xcf40, 0xcf41, 0xcf42, 0xcf43, 0xcf44, 0xcf45, 0xcf46,
0xcf47, 0xcf48, 0xfffd, 0xcf49, 0xcf4a, 0xcf4b, 0xcf4c, 0xcf4d,
0xcf4e, 0xcf4f, 0xcf50, 0xcf51, 0xcf52, 0xcf53, 0xfffd, 0xfffd,
0xfffd, 0xcf54, 0xcf55, 0xcf56, 0xcf57, 0xcf58, 0xcf59, 0xcf5a,
0xcf5b, 0xcf5c, 0xcf5d, 0xcf5e, 0xcf5f, 0xcf60, 0xcf61, 0xcf62,
0xcf63, 0xcf64, 0xfffd, 0xcf65, 0xcf66, 0xcf67, 0xcf68, 0xcf69,
0xcf6a, 0xcf6b, 0xcf6c, 0xcf6d, 0xcf6e, 0xcf6f, 0xfffd, 0xfffd,
0xfffd, 0xcf70, 0xcf71, 0xcf72, 0xcf73, 0xcf74, 0xcf75, 0xcf76,
0xcf77, 0xcf78, 0xcf79, 0xcf7a, 0xcf7b, 0xcf7c, 0xcf7d, 0xcf7e,
0xcf7f, 0xcf80, 0xfffd, 0xcf81, 0xcf82, 0xcf83, 0xcf84, 0xcf85,
0xcf86, 0xcf87, 0xcf88, 0xcf89, 0xcf8a, 0xcf8b, 0xfffd, 0xfffd,
0xfffd, 0xcf8c, 0xcf8d, 0xcf8e, 0xcf8f, 0xcf90, 0xcf91, 0xcf92,
0xcf93, 0xcf94, 0xcf95, 0xcf96, 0xcf97, 0xcf98, 0xcf99, 0xcf9a,
0xcf9b, 0xcf9c, 0xfffd, 0xcf9d, 0xcf9e, 0xcf9f, 0xcfa0, 0xcfa1,
0xcfa2, 0xcfa3, 0xcfa4, 0xcfa5, 0xcfa6, 0xcfa7, 0xcfa8, 0xcfa9,
0xcfaa, 0xcfab, 0xcfac, 0xcfad, 0xcfae, 0xcfaf, 0xcfb0, 0xcfb1,
0xcfb2, 0xcfb3, 0xcfb4, 0xcfb5, 0xcfb6, 0xcfb7, 0xcfb8, 0xfffd,
0xcfb9, 0xcfba, 0xcfbb, 0xcfbc, 0xcfbd, 0xcfbe, 0xcfbf, 0xcfc0,
0xcfc1, 0xcfc2, 0xcfc3, 0xfffd, 0xfffd, 0xfffd, 0xcfc4, 0xcfc5,
0xcfc6, 0xcfc7, 0xcfc8, 0xcfc9, 0xcfca, 0xcfcb, 0xcfcc, 0xcfcd,
0xcfce, 0xcfcf, 0xcfd0, 0xcfd1, 0xcfd2, 0xcfd3, 0xcfd4, 0xfffd,
0xcfd5, 0xcfd6, 0xcfd7, 0xcfd8, 0xcfd9, 0xcfda, 0xcfdb, 0xcfdc,
0xcfdd, 0xcfde, 0xcfdf, 0xfffd, 0xfffd, 0xfffd, 0xcfe0, 0xcfe1,
0xcfe2, 0xcfe3, 0xcfe4, 0xcfe5, 0xcfe6, 0xcfe7, 0xcfe8, 0xcfe9,
0xcfea, 0xcfeb, 0xcfec, 0xcfed, 0xcfee, 0xcfef, 0xcff0, 0xfffd,
0xcff1, 0xcff2, 0xcff3, 0xcff4, 0xcff5, 0xcff6, 0xcff7, 0xcff8,
0xcff9, 0xcffa, 0xcffb, 0xfffd, 0xfffd, 0xfffd, 0xcffc, 0xcffd,
0xcffe, 0xcfff, 0xd000, 0xd001, 0xd002, 0xd003, 0xd004, 0xd005,
0xd006, 0xd007, 0xd008, 0xd009, 0xd00a, 0xd00b, 0xd00c, 0xfffd,
0xd00d, 0xd00e, 0xd00f, 0xd010, 0xd011, 0xd012, 0xd013, 0xd014,
0xd015, 0xd016, 0xd017, 0xfffd, 0xfffd, 0xfffd, 0xd018, 0xd019,
0xd01a, 0xd01b, 0xd01c, 0xd01d, 0xd01e, 0xd01f, 0xd020, 0xd021,
0xd022, 0xd023, 0xd024, 0xd025, 0xd026, 0xd027, 0xd028, 0xfffd,
0xd029, 0xd02a, 0xd02b, 0xd02c, 0xd02d, 0xd02e, 0xd02f, 0xd030,
0xd031, 0xd032, 0xd033, 0xfffd, 0xfffd, 0xfffd, 0xd034, 0xd035,
0xd036, 0xd037, 0xd038, 0xd039, 0xd03a, 0xd03b, 0xd03c, 0xd03d,
0xd03e, 0xd03f, 0xd040, 0xd041, 0xd042, 0xd043, 0xd044, 0xfffd,
0xd045, 0xd046, 0xd047, 0xd048, 0xd049, 0xd04a, 0xd04b, 0xd04c,
0xd04d, 0xd04e, 0xd04f, 0xd050, 0xd051, 0xd052, 0xd053, 0xd054,
0xd055, 0xd056, 0xd057, 0xd058, 0xd059, 0xd05a, 0xd05b, 0xd05c,
0xd05d, 0xd05e, 0xd05f, 0xd060, 0xfffd, 0xd061, 0xd062, 0xd063,
0xd064, 0xd065, 0xd066, 0xd067, 0xd068, 0xd069, 0xd06a, 0xd06b,
0xfffd, 0xfffd, 0xfffd, 0xd06c, 0xd06d, 0xd06e, 0xd06f, 0xd070,
0xd071, 0xd072, 0xd073, 0xd074, 0xd075, 0xd076, 0xd077, 0xd078,
0xd079, 0xd07a, 0xd07b, 0xd07c, 0xfffd, 0xd07d, 0xd07e, 0xd07f,
0xd080, 0xd081, 0xd082, 0xd083, 0xd084, 0xd085, 0xd086, 0xd087,
0xfffd, 0xfffd, 0xfffd, 0xd088, 0xd089, 0xd08a, 0xd08b, 0xd08c,
0xd08d, 0xd08e, 0xd08f, 0xd090, 0xd091, 0xd092, 0xd093, 0xd094,
0xd095, 0xd096, 0xd097, 0xd098, 0xfffd, 0xd099, 0xd09a, 0xd09b,
0xd09c, 0xd09d, 0xd09e, 0xd09f, 0xd0a0, 0xd0a1, 0xd0a2, 0xd0a3,
0xfffd, 0xfffd, 0xfffd, 0xd0a4, 0xd0a5, 0xd0a6, 0xd0a7, 0xd0a8,
0xd0a9, 0xd0aa, 0xd0ab, 0xd0ac, 0xd0ad, 0xd0ae, 0xd0af, 0xd0b0,
0xd0b1, 0xd0b2, 0xd0b3, 0xd0b4, 0xfffd, 0xd0b5, 0xd0b6, 0xd0b7,
0xd0b8, 0xd0b9, 0xd0ba, 0xd0bb, 0xd0bc, 0xd0bd, 0xd0be, 0xd0bf,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xd0c0, 0xd0c1, 0xd0c2, 0xd0c3, 0xd0c4, 0xd0c5, 0xd0c6, 0xd0c7,
0xd0c8, 0xd0c9, 0xd0ca, 0xd0cb, 0xd0cc, 0xd0cd, 0xd0ce, 0xd0cf,
0xd0d0, 0xfffd, 0xd0d1, 0xd0d2, 0xd0d3, 0xd0d4, 0xd0d5, 0xd0d6,
0xd0d7, 0xd0d8, 0xd0d9, 0xd0da, 0xd0db, 0xfffd, 0xfffd, 0xfffd,
0xd0dc, 0xd0dd, 0xd0de, 0xd0df, 0xd0e0, 0xd0e1, 0xd0e2, 0xd0e3,
0xd0e4, 0xd0e5, 0xd0e6, 0xd0e7, 0xd0e8, 0xd0e9, 0xd0ea, 0xd0eb,
0xd0ec, 0xfffd, 0xd0ed, 0xd0ee, 0xd0ef, 0xd0f0, 0xd0f1, 0xd0f2,
0xd0f3, 0xd0f4, 0xd0f5, 0xd0f6, 0xd0f7, 0xfffd, 0xfffd, 0xfffd,
0xd0f8, 0xd0f9, 0xd0fa, 0xd0fb, 0xd0fc, 0xd0fd, 0xd0fe, 0xd0ff,
0xd100, 0xd101, 0xd102, 0xd103, 0xd104, 0xd105, 0xd106, 0xd107,
0xd108, 0xfffd, 0xd109, 0xd10a, 0xd10b, 0xd10c, 0xd10d, 0xd10e,
0xd10f, 0xd110, 0xd111, 0xd112, 0xd113, 0xfffd, 0xfffd, 0xfffd,
0xd114, 0xd115, 0xd116, 0xd117, 0xd118, 0xd119, 0xd11a, 0xd11b,
0xd11c, 0xd11d, 0xd11e, 0xd11f, 0xd120, 0xd121, 0xd122, 0xd123,
0xd124, 0xfffd, 0xd125, 0xd126, 0xd127, 0xd128, 0xd129, 0xd12a,
0xd12b, 0xd12c, 0xd12d, 0xd12e, 0xd12f, 0xfffd, 0xfffd, 0xfffd,
0xd130, 0xd131, 0xd132, 0xd133, 0xd134, 0xd135, 0xd136, 0xd137,
0xd138, 0xd139, 0xd13a, 0xd13b, 0xd13c, 0xd13d, 0xd13e, 0xd13f,
0xd140, 0xfffd, 0xd141, 0xd142, 0xd143, 0xd144, 0xd145, 0xd146,
0xd147, 0xd148, 0xd149, 0xd14a, 0xd14b, 0xd14c, 0xd14d, 0xd14e,
0xd14f, 0xd150, 0xd151, 0xd152, 0xd153, 0xd154, 0xd155, 0xd156,
0xd157, 0xd158, 0xd159, 0xd15a, 0xd15b, 0xd15c, 0xfffd, 0xd15d,
0xd15e, 0xd15f, 0xd160, 0xd161, 0xd162, 0xd163, 0xd164, 0xd165,
0xd166, 0xd167, 0xfffd, 0xfffd, 0xfffd, 0xd168, 0xd169, 0xd16a,
0xd16b, 0xd16c, 0xd16d, 0xd16e, 0xd16f, 0xd170, 0xd171, 0xd172,
0xd173, 0xd174, 0xd175, 0xd176, 0xd177, 0xd178, 0xfffd, 0xd179,
0xd17a, 0xd17b, 0xd17c, 0xd17d, 0xd17e, 0xd17f, 0xd180, 0xd181,
0xd182, 0xd183, 0xfffd, 0xfffd, 0xfffd, 0xd184, 0xd185, 0xd186,
0xd187, 0xd188, 0xd189, 0xd18a, 0xd18b, 0xd18c, 0xd18d, 0xd18e,
0xd18f, 0xd190, 0xd191, 0xd192, 0xd193, 0xd194, 0xfffd, 0xd195,
0xd196, 0xd197, 0xd198, 0xd199, 0xd19a, 0xd19b, 0xd19c, 0xd19d,
0xd19e, 0xd19f, 0xfffd, 0xfffd, 0xfffd, 0xd1a0, 0xd1a1, 0xd1a2,
0xd1a3, 0xd1a4, 0xd1a5, 0xd1a6, 0xd1a7, 0xd1a8, 0xd1a9, 0xd1aa,
0xd1ab, 0xd1ac, 0xd1ad, 0xd1ae, 0xd1af, 0xd1b0, 0xfffd, 0xd1b1,
0xd1b2, 0xd1b3, 0xd1b4, 0xd1b5, 0xd1b6, 0xd1b7, 0xd1b8, 0xd1b9,
0xd1ba, 0xd1bb, 0xfffd, 0xfffd, 0xfffd, 0xd1bc, 0xd1bd, 0xd1be,
0xd1bf, 0xd1c0, 0xd1c1, 0xd1c2, 0xd1c3, 0xd1c4, 0xd1c5, 0xd1c6,
0xd1c7, 0xd1c8, 0xd1c9, 0xd1ca, 0xd1cb, 0xd1cc, 0xfffd, 0xd1cd,
0xd1ce, 0xd1cf, 0xd1d0, 0xd1d1, 0xd1d2, 0xd1d3, 0xd1d4, 0xd1d5,
0xd1d6, 0xd1d7, 0xfffd, 0xfffd, 0xfffd, 0xd1d8, 0xd1d9, 0xd1da,
0xd1db, 0xd1dc, 0xd1dd, 0xd1de, 0xd1df, 0xd1e0, 0xd1e1, 0xd1e2,
0xd1e3, 0xd1e4, 0xd1e5, 0xd1e6, 0xd1e7, 0xd1e8, 0xfffd, 0xd1e9,
0xd1ea, 0xd1eb, 0xd1ec, 0xd1ed, 0xd1ee, 0xd1ef, 0xd1f0, 0xd1f1,
0xd1f2, 0xd1f3, 0xd1f4, 0xd1f5, 0xd1f6, 0xd1f7, 0xd1f8, 0xd1f9,
0xd1fa, 0xd1fb, 0xd1fc, 0xd1fd, 0xd1fe, 0xd1ff, 0xd200, 0xd201,
0xd202, 0xd203, 0xd204, 0xfffd, 0xd205, 0xd206, 0xd207, 0xd208,
0xd209, 0xd20a, 0xd20b, 0xd20c, 0xd20d, 0xd20e, 0xd20f, 0xfffd,
0xfffd, 0xfffd, 0xd210, 0xd211, 0xd212, 0xd213, 0xd214, 0xd215,
0xd216, 0xd217, 0xd218, 0xd219, 0xd21a, 0xd21b, 0xd21c, 0xd21d,
0xd21e, 0xd21f, 0xd220, 0xfffd, 0xd221, 0xd222, 0xd223, 0xd224,
0xd225, 0xd226, 0xd227, 0xd228, 0xd229, 0xd22a, 0xd22b, 0xfffd,
0xfffd, 0xfffd, 0xd22c, 0xd22d, 0xd22e, 0xd22f, 0xd230, 0xd231,
0xd232, 0xd233, 0xd234, 0xd235, 0xd236, 0xd237, 0xd238, 0xd239,
0xd23a, 0xd23b, 0xd23c, 0xfffd, 0xd23d, 0xd23e, 0xd23f, 0xd240,
0xd241, 0xd242, 0xd243, 0xd244, 0xd245, 0xd246, 0xd247, 0xfffd,
0xfffd, 0xfffd, 0xd248, 0xd249, 0xd24a, 0xd24b, 0xd24c, 0xd24d,
0xd24e, 0xd24f, 0xd250, 0xd251, 0xd252, 0xd253, 0xd254, 0xd255,
0xd256, 0xd257, 0xd258, 0xfffd, 0xd259, 0xd25a, 0xd25b, 0xd25c,
0xd25d, 0xd25e, 0xd25f, 0xd260, 0xd261, 0xd262, 0xd263, 0xfffd,
0xfffd, 0xfffd, 0xd264, 0xd265, 0xd266, 0xd267, 0xd268, 0xd269,
0xd26a, 0xd26b, 0xd26c, 0xd26d, 0xd26e, 0xd26f, 0xd270, 0xd271,
0xd272, 0xd273, 0xd274, 0xfffd, 0xd275, 0xd276, 0xd277, 0xd278,
0xd279, 0xd27a, 0xd27b, 0xd27c, 0xd27d, 0xd27e, 0xd27f, 0xfffd,
0xfffd, 0xfffd, 0xd280, 0xd281, 0xd282, 0xd283, 0xd284, 0xd285,
0xd286, 0xd287, 0xd288, 0xd289, 0xd28a, 0xd28b, 0xd28c, 0xd28d,
0xd28e, 0xd28f, 0xd290, 0xfffd, 0xd291, 0xd292, 0xd293, 0xd294,
0xd295, 0xd296, 0xd297, 0xd298, 0xd299, 0xd29a, 0xd29b, 0xd29c,
0xd29d, 0xd29e, 0xd29f, 0xd2a0, 0xd2a1, 0xd2a2, 0xd2a3, 0xd2a4,
0xd2a5, 0xd2a6, 0xd2a7, 0xd2a8, 0xd2a9, 0xd2aa, 0xd2ab, 0xd2ac,
0xfffd, 0xd2ad, 0xd2ae, 0xd2af, 0xd2b0, 0xd2b1, 0xd2b2, 0xd2b3,
0xd2b4, 0xd2b5, 0xd2b6, 0xd2b7, 0xfffd, 0xfffd, 0xfffd, 0xd2b8,
0xd2b9, 0xd2ba, 0xd2bb, 0xd2bc, 0xd2bd, 0xd2be, 0xd2bf, 0xd2c0,
0xd2c1, 0xd2c2, 0xd2c3, 0xd2c4, 0xd2c5, 0xd2c6, 0xd2c7, 0xd2c8,
0xfffd, 0xd2c9, 0xd2ca, 0xd2cb, 0xd2cc, 0xd2cd, 0xd2ce, 0xd2cf,
0xd2d0, 0xd2d1, 0xd2d2, 0xd2d3, 0xfffd, 0xfffd, 0xfffd, 0xd2d4,
0xd2d5, 0xd2d6, 0xd2d7, 0xd2d8, 0xd2d9, 0xd2da, 0xd2db, 0xd2dc,
0xd2dd, 0xd2de, 0xd2df, 0xd2e0, 0xd2e1, 0xd2e2, 0xd2e3, 0xd2e4,
0xfffd, 0xd2e5, 0xd2e6, 0xd2e7, 0xd2e8, 0xd2e9, 0xd2ea, 0xd2eb,
0xd2ec, 0xd2ed, 0xd2ee, 0xd2ef, 0xfffd, 0xfffd, 0xfffd, 0xd2f0,
0xd2f1, 0xd2f2, 0xd2f3, 0xd2f4, 0xd2f5, 0xd2f6, 0xd2f7, 0xd2f8,
0xd2f9, 0xd2fa, 0xd2fb, 0xd2fc, 0xd2fd, 0xd2fe, 0xd2ff, 0xd300,
0xfffd, 0xd301, 0xd302, 0xd303, 0xd304, 0xd305, 0xd306, 0xd307,
0xd308, 0xd309, 0xd30a, 0xd30b, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xd30c, 0xd30d, 0xd30e, 0xd30f,
0xd310, 0xd311, 0xd312, 0xd313, 0xd314, 0xd315, 0xd316, 0xd317,
0xd318, 0xd319, 0xd31a, 0xd31b, 0xd31c, 0xfffd, 0xd31d, 0xd31e,
0xd31f, 0xd320, 0xd321, 0xd322, 0xd323, 0xd324, 0xd325, 0xd326,
0xd327, 0xfffd, 0xfffd, 0xfffd, 0xd328, 0xd329, 0xd32a, 0xd32b,
0xd32c, 0xd32d, 0xd32e, 0xd32f, 0xd330, 0xd331, 0xd332, 0xd333,
0xd334, 0xd335, 0xd336, 0xd337, 0xd338, 0xfffd, 0xd339, 0xd33a,
0xd33b, 0xd33c, 0xd33d, 0xd33e, 0xd33f, 0xd340, 0xd341, 0xd342,
0xd343, 0xfffd, 0xfffd, 0xfffd, 0xd344, 0xd345, 0xd346, 0xd347,
0xd348, 0xd349, 0xd34a, 0xd34b, 0xd34c, 0xd34d, 0xd34e, 0xd34f,
0xd350, 0xd351, 0xd352, 0xd353, 0xd354, 0xfffd, 0xd355, 0xd356,
0xd357, 0xd358, 0xd359, 0xd35a, 0xd35b, 0xd35c, 0xd35d, 0xd35e,
0xd35f, 0xfffd, 0xfffd, 0xfffd, 0xd360, 0xd361, 0xd362, 0xd363,
0xd364, 0xd365, 0xd366, 0xd367, 0xd368, 0xd369, 0xd36a, 0xd36b,
0xd36c, 0xd36d, 0xd36e, 0xd36f, 0xd370, 0xfffd, 0xd371, 0xd372,
0xd373, 0xd374, 0xd375, 0xd376, 0xd377, 0xd378, 0xd379, 0xd37a,
0xd37b, 0xfffd, 0xfffd, 0xfffd, 0xd37c, 0xd37d, 0xd37e, 0xd37f,
0xd380, 0xd381, 0xd382, 0xd383, 0xd384, 0xd385, 0xd386, 0xd387,
0xd388, 0xd389, 0xd38a, 0xd38b, 0xd38c, 0xfffd, 0xd38d, 0xd38e,
0xd38f, 0xd390, 0xd391, 0xd392, 0xd393, 0xd394, 0xd395, 0xd396,
0xd397, 0xd398, 0xd399, 0xd39a, 0xd39b, 0xd39c, 0xd39d, 0xd39e,
0xd39f, 0xd3a0, 0xd3a1, 0xd3a2, 0xd3a3, 0xd3a4, 0xd3a5, 0xd3a6,
0xd3a7, 0xd3a8, 0xfffd, 0xd3a9, 0xd3aa, 0xd3ab, 0xd3ac, 0xd3ad,
0xd3ae, 0xd3af, 0xd3b0, 0xd3b1, 0xd3b2, 0xd3b3, 0xfffd, 0xfffd,
0xfffd, 0xd3b4, 0xd3b5, 0xd3b6, 0xd3b7, 0xd3b8, 0xd3b9, 0xd3ba,
0xd3bb, 0xd3bc, 0xd3bd, 0xd3be, 0xd3bf, 0xd3c0, 0xd3c1, 0xd3c2,
0xd3c3, 0xd3c4, 0xfffd, 0xd3c5, 0xd3c6, 0xd3c7, 0xd3c8, 0xd3c9,
0xd3ca, 0xd3cb, 0xd3cc, 0xd3cd, 0xd3ce, 0xd3cf, 0xfffd, 0xfffd,
0xfffd, 0xd3d0, 0xd3d1, 0xd3d2, 0xd3d3, 0xd3d4, 0xd3d5, 0xd3d6,
0xd3d7, 0xd3d8, 0xd3d9, 0xd3da, 0xd3db, 0xd3dc, 0xd3dd, 0xd3de,
0xd3df, 0xd3e0, 0xfffd, 0xd3e1, 0xd3e2, 0xd3e3, 0xd3e4, 0xd3e5,
0xd3e6, 0xd3e7, 0xd3e8, 0xd3e9, 0xd3ea, 0xd3eb, 0xfffd, 0xfffd,
0xfffd, 0xd3ec, 0xd3ed, 0xd3ee, 0xd3ef, 0xd3f0, 0xd3f1, 0xd3f2,
0xd3f3, 0xd3f4, 0xd3f5, 0xd3f6, 0xd3f7, 0xd3f8, 0xd3f9, 0xd3fa,
0xd3fb, 0xd3fc, 0xfffd, 0xd3fd, 0xd3fe, 0xd3ff, 0xd400, 0xd401,
0xd402, 0xd403, 0xd404, 0xd405, 0xd406, 0xd407, 0xfffd, 0xfffd,
0xfffd, 0xd408, 0xd409, 0xd40a, 0xd40b, 0xd40c, 0xd40d, 0xd40e,
0xd40f, 0xd410, 0xd411, 0xd412, 0xd413, 0xd414, 0xd415, 0xd416,
0xd417, 0xd418, 0xfffd, 0xd419, 0xd41a, 0xd41b, 0xd41c, 0xd41d,
0xd41e, 0xd41f, 0xd420, 0xd421, 0xd422, 0xd423, 0xfffd, 0xfffd,
0xfffd, 0xd424, 0xd425, 0xd426, 0xd427, 0xd428, 0xd429, 0xd42a,
0xd42b, 0xd42c, 0xd42d, 0xd42e, 0xd42f, 0xd430, 0xd431, 0xd432,
0xd433, 0xd434, 0xfffd, 0xd435, 0xd436, 0xd437, 0xd438, 0xd439,
0xd43a, 0xd43b, 0xd43c, 0xd43d, 0xd43e, 0xd43f, 0xd440, 0xd441,
0xd442, 0xd443, 0xd444, 0xd445, 0xd446, 0xd447, 0xd448, 0xd449,
0xd44a, 0xd44b, 0xd44c, 0xd44d, 0xd44e, 0xd44f, 0xd450, 0xfffd,
0xd451, 0xd452, 0xd453, 0xd454, 0xd455, 0xd456, 0xd457, 0xd458,
0xd459, 0xd45a, 0xd45b, 0xfffd, 0xfffd, 0xfffd, 0xd45c, 0xd45d,
0xd45e, 0xd45f, 0xd460, 0xd461, 0xd462, 0xd463, 0xd464, 0xd465,
0xd466, 0xd467, 0xd468, 0xd469, 0xd46a, 0xd46b, 0xd46c, 0xfffd,
0xd46d, 0xd46e, 0xd46f, 0xd470, 0xd471, 0xd472, 0xd473, 0xd474,
0xd475, 0xd476, 0xd477, 0xfffd, 0xfffd, 0xfffd, 0xd478, 0xd479,
0xd47a, 0xd47b, 0xd47c, 0xd47d, 0xd47e, 0xd47f, 0xd480, 0xd481,
0xd482, 0xd483, 0xd484, 0xd485, 0xd486, 0xd487, 0xd488, 0xfffd,
0xd489, 0xd48a, 0xd48b, 0xd48c, 0xd48d, 0xd48e, 0xd48f, 0xd490,
0xd491, 0xd492, 0xd493, 0xfffd, 0xfffd, 0xfffd, 0xd494, 0xd495,
0xd496, 0xd497, 0xd498, 0xd499, 0xd49a, 0xd49b, 0xd49c, 0xd49d,
0xd49e, 0xd49f, 0xd4a0, 0xd4a1, 0xd4a2, 0xd4a3, 0xd4a4, 0xfffd,
0xd4a5, 0xd4a6, 0xd4a7, 0xd4a8, 0xd4a9, 0xd4aa, 0xd4ab, 0xd4ac,
0xd4ad, 0xd4ae, 0xd4af, 0xfffd, 0xfffd, 0xfffd, 0xd4b0, 0xd4b1,
0xd4b2, 0xd4b3, 0xd4b4, 0xd4b5, 0xd4b6, 0xd4b7, 0xd4b8, 0xd4b9,
0xd4ba, 0xd4bb, 0xd4bc, 0xd4bd, 0xd4be, 0xd4bf, 0xd4c0, 0xfffd,
0xd4c1, 0xd4c2, 0xd4c3, 0xd4c4, 0xd4c5, 0xd4c6, 0xd4c7, 0xd4c8,
0xd4c9, 0xd4ca, 0xd4cb, 0xfffd, 0xfffd, 0xfffd, 0xd4cc, 0xd4cd,
0xd4ce, 0xd4cf, 0xd4d0, 0xd4d1, 0xd4d2, 0xd4d3, 0xd4d4, 0xd4d5,
0xd4d6, 0xd4d7, 0xd4d8, 0xd4d9, 0xd4da, 0xd4db, 0xd4dc, 0xfffd,
0xd4dd, 0xd4de, 0xd4df, 0xd4e0, 0xd4e1, 0xd4e2, 0xd4e3, 0xd4e4,
0xd4e5, 0xd4e6, 0xd4e7, 0xd4e8, 0xd4e9, 0xd4ea, 0xd4eb, 0xd4ec,
0xd4ed, 0xd4ee, 0xd4ef, 0xd4f0, 0xd4f1, 0xd4f2, 0xd4f3, 0xd4f4,
0xd4f5, 0xd4f6, 0xd4f7, 0xd4f8, 0xfffd, 0xd4f9, 0xd4fa, 0xd4fb,
0xd4fc, 0xd4fd, 0xd4fe, 0xd4ff, 0xd500, 0xd501, 0xd502, 0xd503,
0xfffd, 0xfffd, 0xfffd, 0xd504, 0xd505, 0xd506, 0xd507, 0xd508,
0xd509, 0xd50a, 0xd50b, 0xd50c, 0xd50d, 0xd50e, 0xd50f, 0xd510,
0xd511, 0xd512, 0xd513, 0xd514, 0xfffd, 0xd515, 0xd516, 0xd517,
0xd518, 0xd519, 0xd51a, 0xd51b, 0xd51c, 0xd51d, 0xd51e, 0xd51f,
0xfffd, 0xfffd, 0xfffd, 0xd520, 0xd521, 0xd522, 0xd523, 0xd524,
0xd525, 0xd526, 0xd527, 0xd528, 0xd529, 0xd52a, 0xd52b, 0xd52c,
0xd52d, 0xd52e, 0xd52f, 0xd530, 0xfffd, 0xd531, 0xd532, 0xd533,
0xd534, 0xd535, 0xd536, 0xd537, 0xd538, 0xd539, 0xd53a, 0xd53b,
0xfffd, 0xfffd, 0xfffd, 0xd53c, 0xd53d, 0xd53e, 0xd53f, 0xd540,
0xd541, 0xd542, 0xd543, 0xd544, 0xd545, 0xd546, 0xd547, 0xd548,
0xd549, 0xd54a, 0xd54b, 0xd54c, 0xfffd, 0xd54d, 0xd54e, 0xd54f,
0xd550, 0xd551, 0xd552, 0xd553, 0xd554, 0xd555, 0xd556, 0xd557,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xd558, 0xd559, 0xd55a, 0xd55b, 0xd55c, 0xd55d, 0xd55e, 0xd55f,
0xd560, 0xd561, 0xd562, 0xd563, 0xd564, 0xd565, 0xd566, 0xd567,
0xd568, 0xfffd, 0xd569, 0xd56a, 0xd56b, 0xd56c, 0xd56d, 0xd56e,
0xd56f, 0xd570, 0xd571, 0xd572, 0xd573, 0xfffd, 0xfffd, 0xfffd,
0xd574, 0xd575, 0xd576, 0xd577, 0xd578, 0xd579, 0xd57a, 0xd57b,
0xd57c, 0xd57d, 0xd57e, 0xd57f, 0xd580, 0xd581, 0xd582, 0xd583,
0xd584, 0xfffd, 0xd585, 0xd586, 0xd587, 0xd588, 0xd589, 0xd58a,
0xd58b, 0xd58c, 0xd58d, 0xd58e, 0xd58f, 0xfffd, 0xfffd, 0xfffd,
0xd590, 0xd591, 0xd592, 0xd593, 0xd594, 0xd595, 0xd596, 0xd597,
0xd598, 0xd599, 0xd59a, 0xd59b, 0xd59c, 0xd59d, 0xd59e, 0xd59f,
0xd5a0, 0xfffd, 0xd5a1, 0xd5a2, 0xd5a3, 0xd5a4, 0xd5a5, 0xd5a6,
0xd5a7, 0xd5a8, 0xd5a9, 0xd5aa, 0xd5ab, 0xfffd, 0xfffd, 0xfffd,
0xd5ac, 0xd5ad, 0xd5ae, 0xd5af, 0xd5b0, 0xd5b1, 0xd5b2, 0xd5b3,
0xd5b4, 0xd5b5, 0xd5b6, 0xd5b7, 0xd5b8, 0xd5b9, 0xd5ba, 0xd5bb,
0xd5bc, 0xfffd, 0xd5bd, 0xd5be, 0xd5bf, 0xd5c0, 0xd5c1, 0xd5c2,
0xd5c3, 0xd5c4, 0xd5c5, 0xd5c6, 0xd5c7, 0xfffd, 0xfffd, 0xfffd,
0xd5c8, 0xd5c9, 0xd5ca, 0xd5cb, 0xd5cc, 0xd5cd, 0xd5ce, 0xd5cf,
0xd5d0, 0xd5d1, 0xd5d2, 0xd5d3, 0xd5d4, 0xd5d5, 0xd5d6, 0xd5d7,
0xd5d8, 0xfffd, 0xd5d9, 0xd5da, 0xd5db, 0xd5dc, 0xd5dd, 0xd5de,
0xd5df, 0xd5e0, 0xd5e1, 0xd5e2, 0xd5e3, 0xd5e4, 0xd5e5, 0xd5e6,
0xd5e7, 0xd5e8, 0xd5e9, 0xd5ea, 0xd5eb, 0xd5ec, 0xd5ed, 0xd5ee,
0xd5ef, 0xd5f0, 0xd5f1, 0xd5f2, 0xd5f3, 0xd5f4, 0xfffd, 0xd5f5,
0xd5f6, 0xd5f7, 0xd5f8, 0xd5f9, 0xd5fa, 0xd5fb, 0xd5fc, 0xd5fd,
0xd5fe, 0xd5ff, 0xfffd, 0xfffd, 0xfffd, 0xd600, 0xd601, 0xd602,
0xd603, 0xd604, 0xd605, 0xd606, 0xd607, 0xd608, 0xd609, 0xd60a,
0xd60b, 0xd60c, 0xd60d, 0xd60e, 0xd60f, 0xd610, 0xfffd, 0xd611,
0xd612, 0xd613, 0xd614, 0xd615, 0xd616, 0xd617, 0xd618, 0xd619,
0xd61a, 0xd61b, 0xfffd, 0xfffd, 0xfffd, 0xd61c, 0xd61d, 0xd61e,
0xd61f, 0xd620, 0xd621, 0xd622, 0xd623, 0xd624, 0xd625, 0xd626,
0xd627, 0xd628, 0xd629, 0xd62a, 0xd62b, 0xd62c, 0xfffd, 0xd62d,
0xd62e, 0xd62f, 0xd630, 0xd631, 0xd632, 0xd633, 0xd634, 0xd635,
0xd636, 0xd637, 0xfffd, 0xfffd, 0xfffd, 0xd638, 0xd639, 0xd63a,
0xd63b, 0xd63c, 0xd63d, 0xd63e, 0xd63f, 0xd640, 0xd641, 0xd642,
0xd643, 0xd644, 0xd645, 0xd646, 0xd647, 0xd648, 0xfffd, 0xd649,
0xd64a, 0xd64b, 0xd64c, 0xd64d, 0xd64e, 0xd64f, 0xd650, 0xd651,
0xd652, 0xd653, 0xfffd, 0xfffd, 0xfffd, 0xd654, 0xd655, 0xd656,
0xd657, 0xd658, 0xd659, 0xd65a, 0xd65b, 0xd65c, 0xd65d, 0xd65e,
0xd65f, 0xd660, 0xd661, 0xd662, 0xd663, 0xd664, 0xfffd, 0xd665,
0xd666, 0xd667, 0xd668, 0xd669, 0xd66a, 0xd66b, 0xd66c, 0xd66d,
0xd66e, 0xd66f, 0xfffd, 0xfffd, 0xfffd, 0xd670, 0xd671, 0xd672,
0xd673, 0xd674, 0xd675, 0xd676, 0xd677, 0xd678, 0xd679, 0xd67a,
0xd67b, 0xd67c, 0xd67d, 0xd67e, 0xd67f, 0xd680, 0xfffd, 0xd681,
0xd682, 0xd683, 0xd684, 0xd685, 0xd686, 0xd687, 0xd688, 0xd689,
0xd68a, 0xd68b, 0xd68c, 0xd68d, 0xd68e, 0xd68f, 0xd690, 0xd691,
0xd692, 0xd693, 0xd694, 0xd695, 0xd696, 0xd697, 0xd698, 0xd699,
0xd69a, 0xd69b, 0xd69c, 0xfffd, 0xd69d, 0xd69e, 0xd69f, 0xd6a0,
0xd6a1, 0xd6a2, 0xd6a3, 0xd6a4, 0xd6a5, 0xd6a6, 0xd6a7, 0xfffd,
0xfffd, 0xfffd, 0xd6a8, 0xd6a9, 0xd6aa, 0xd6ab, 0xd6ac, 0xd6ad,
0xd6ae, 0xd6af, 0xd6b0, 0xd6b1, 0xd6b2, 0xd6b3, 0xd6b4, 0xd6b5,
0xd6b6, 0xd6b7, 0xd6b8, 0xfffd, 0xd6b9, 0xd6ba, 0xd6bb, 0xd6bc,
0xd6bd, 0xd6be, 0xd6bf, 0xd6c0, 0xd6c1, 0xd6c2, 0xd6c3, 0xfffd,
0xfffd, 0xfffd, 0xd6c4, 0xd6c5, 0xd6c6, 0xd6c7, 0xd6c8, 0xd6c9,
0xd6ca, 0xd6cb, 0xd6cc, 0xd6cd, 0xd6ce, 0xd6cf, 0xd6d0, 0xd6d1,
0xd6d2, 0xd6d3, 0xd6d4, 0xfffd, 0xd6d5, 0xd6d6, 0xd6d7, 0xd6d8,
0xd6d9, 0xd6da, 0xd6db, 0xd6dc, 0xd6dd, 0xd6de, 0xd6df, 0xfffd,
0xfffd, 0xfffd, 0xd6e0, 0xd6e1, 0xd6e2, 0xd6e3, 0xd6e4, 0xd6e5,
0xd6e6, 0xd6e7, 0xd6e8, 0xd6e9, 0xd6ea, 0xd6eb, 0xd6ec, 0xd6ed,
0xd6ee, 0xd6ef, 0xd6f0, 0xfffd, 0xd6f1, 0xd6f2, 0xd6f3, 0xd6f4,
0xd6f5, 0xd6f6, 0xd6f7, 0xd6f8, 0xd6f9, 0xd6fa, 0xd6fb, 0xfffd,
0xfffd, 0xfffd, 0xd6fc, 0xd6fd, 0xd6fe, 0xd6ff, 0xd700, 0xd701,
0xd702, 0xd703, 0xd704, 0xd705, 0xd706, 0xd707, 0xd708, 0xd709,
0xd70a, 0xd70b, 0xd70c, 0xfffd, 0xd70d, 0xd70e, 0xd70f, 0xd710,
0xd711, 0xd712, 0xd713, 0xd714, 0xd715, 0xd716, 0xd717, 0xfffd,
0xfffd, 0xfffd, 0xd718, 0xd719, 0xd71a, 0xd71b, 0xd71c, 0xd71d,
0xd71e, 0xd71f, 0xd720, 0xd721, 0xd722, 0xd723, 0xd724, 0xd725,
0xd726, 0xd727, 0xd728, 0xfffd, 0xd729, 0xd72a, 0xd72b, 0xd72c,
0xd72d, 0xd72e, 0xd72f, 0xd730, 0xd731, 0xd732, 0xd733, 0xd734,
0xd735, 0xd736, 0xd737, 0xd738, 0xd739, 0xd73a, 0xd73b, 0xd73c,
0xd73d, 0xd73e, 0xd73f, 0xd740, 0xd741, 0xd742, 0xd743, 0xd744,
0xfffd, 0xd745, 0xd746, 0xd747, 0xd748, 0xd749, 0xd74a, 0xd74b,
0xd74c, 0xd74d, 0xd74e, 0xd74f, 0xfffd, 0xfffd, 0xfffd, 0xd750,
0xd751, 0xd752, 0xd753, 0xd754, 0xd755, 0xd756, 0xd757, 0xd758,
0xd759, 0xd75a, 0xd75b, 0xd75c, 0xd75d, 0xd75e, 0xd75f, 0xd760,
0xfffd, 0xd761, 0xd762, 0xd763, 0xd764, 0xd765, 0xd766, 0xd767,
0xd768, 0xd769, 0xd76a, 0xd76b, 0xfffd, 0xfffd, 0xfffd, 0xd76c,
0xd76d, 0xd76e, 0xd76f, 0xd770, 0xd771, 0xd772, 0xd773, 0xd774,
0xd775, 0xd776, 0xd777, 0xd778, 0xd779, 0xd77a, 0xd77b, 0xd77c,
0xfffd, 0xd77d, 0xd77e, 0xd77f, 0xd780, 0xd781, 0xd782, 0xd783,
0xd784, 0xd785, 0xd786, 0xd787, 0xfffd, 0xfffd, 0xfffd, 0xd788,
0xd789, 0xd78a, 0xd78b, 0xd78c, 0xd78d, 0xd78e, 0xd78f, 0xd790,
0xd791, 0xd792, 0xd793, 0xd794, 0xd795, 0xd796, 0xd797, 0xd798,
0xfffd, 0xd799, 0xd79a, 0xd79b, 0xd79c, 0xd79d, 0xd79e, 0xd79f,
0xd7a0, 0xd7a1, 0xd7a2, 0xd7a3, };
static const unsigned short ksc5601_1992_user[178*8+5] = {
0xf700, 0xf701, 0xf702, 0xf703, 0xf704, 0xf705, 0xf706, 0xf707,
0xf708, 0xf709, 0xf70a, 0xf70b, 0xf70c, 0xf70d, 0xf70e, 0xf70f,
0xf710, 0xf711, 0xf712, 0xf713, 0xf714, 0xf715, 0xf716, 0xf717,
0xf718, 0xf719, 0xf71a, 0xf71b, 0xf71c, 0xf71d, 0xf71e, 0xf71f,
0xf720, 0xf721, 0xf722, 0xf723, 0xf724, 0xf725, 0xf726, 0xf727,
0xf728, 0xf729, 0xf72a, 0xf72b, 0xf72c, 0xf72d, 0xf72e, 0xf72f,
0xf730, 0xf731, 0xf732, 0xf733, 0xf734, 0xf735, 0xf736, 0xf737,
0xf738, 0xf739, 0xf73a, 0xf73b, 0xf73c, 0xf73d, 0xf73e, 0xf73f,
0xf740, 0xf741, 0xf742, 0xf743, 0xf744, 0xf745, 0xf746, 0xf747,
0xf748, 0xf749, 0xf74a, 0xf74b, 0xf74c, 0xf74d, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xf74e, 0xf74f, 0xf750, 0xf751, 0xf752, 0xf753, 0xf754, 0xf755,
0xf756, 0xf757, 0xf758, 0xf759, 0xf75a, 0xf75b, 0xf75c, 0xf75d,
0xf75e, 0xf75f, 0xf760, 0xf761, 0xf762, 0xf763, 0xf764, 0xf765,
0xf766, 0xf767, 0xf768, 0xf769, 0xf76a, 0xf76b, 0xf76c, 0xf76d,
0xf76e, 0xf76f, 0xf770, 0xf771, 0xf772, 0xf773, 0xf774, 0xf775,
0xf776, 0xf777, 0xf778, 0xf779, 0xf77a, 0xf77b, 0xf77c, 0xf77d,
0xf77e, 0xf77f, 0xf780, 0xf781, 0xf782, 0xf783, 0xf784, 0xf785,
0xf786, 0xf787, 0xf788, 0xf789, 0xf78a, 0xf78b, 0xf78c, 0xf78d,
0xf78e, 0xf78f, 0xf790, 0xf791, 0xf792, 0xf793, 0xf794, 0xf795,
0xf796, 0xf797, 0xf798, 0xf799, 0xf79a, 0xf79b, 0xf79c, 0xf79d,
0xf79e, 0xf79f, 0xf7a0, 0xf7a1, 0xf7a2, 0xf7a3, 0xf7a4, 0xf7a5,
0xf7a6, 0xf7a7, 0xf7a8, 0xf7a9, 0xf7aa, 0xf7ab, 0xf7ac, 0xf7ad,
0xf7ae, 0xf7af, 0xf7b0, 0xf7b1, 0xf7b2, 0xf7b3, 0xf7b4, 0xf7b5,
0xf7b6, 0xf7b7, 0xf7b8, 0xf7b9, 0xf7ba, 0xf7bb, 0x3000, 0x3001,
0x3002, 0x30fb, 0x2025, 0x2026, 0x00a8, 0x3003, 0x2013, 0x2014,
0x2016, 0xff3c, 0xff5e, 0x2018, 0x2019, 0x201c, 0x201d, 0x3014,
0x3015, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e,
0x300f, 0x3010, 0x3011, 0x00b1, 0x00d7, 0x00f7, 0x2260, 0x2264,
0x2265, 0x221e, 0x2234, 0x00b0, 0x2032, 0x2033, 0x2103, 0x212b,
0xffe0, 0xffe1, 0xffe5, 0x2642, 0x2640, 0x2220, 0x22a5, 0x2312,
0x2202, 0x2207, 0x2261, 0x2252, 0x00a7, 0x203b, 0x2606, 0x2605,
0x25cb, 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3,
0x25b2, 0x25bd, 0x25bc, 0x2192, 0x2190, 0x2191, 0x2193, 0x2194,
0x3013, 0x00ab, 0x00bb, 0x221a, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x223d, 0x221d,
0x2235, 0x222b, 0x222c, 0x2208, 0x220b, 0x2286, 0x2287, 0x2282,
0x2283, 0x222a, 0x2229, 0x2227, 0x2228, 0xffe2, 0x21d2, 0x21d4,
0x2200, 0x2203, 0x00b4, 0x02dc, 0x02c7, 0x02d8, 0x02dd, 0x02da,
0x02d9, 0x00b8, 0x02db, 0x00a1, 0x00bf, 0x2236, 0x222e, 0x2211,
0x220f, 0x00a4, 0x2109, 0x2030, 0x25c1, 0x25c0, 0x25b7, 0x25b6,
0x2664, 0x2660, 0x2661, 0x2665, 0x2667, 0x2663, 0x25c9, 0x25c8,
0x25a3, 0x25d0, 0x25d1, 0x2592, 0x25a4, 0x25a5, 0x25a8, 0x25a7,
0x25a6, 0x25a9, 0x2668, 0x260f, 0x260e, 0x261c, 0x261e, 0x00b6,
0x2020, 0x2021, 0x2195, 0x2197, 0x2199, 0x2196, 0x2198, 0x266d,
0x2669, 0x266a, 0x266c, 0x327f, 0x321c, 0x2116, 0x33c7, 0x2122,
0x33c2, 0x33d8, 0x2121, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xff01, 0xff02, 0xff03, 0xff04,
0xff05, 0xff06, 0xff07, 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c,
0xff0d, 0xff0e, 0xff0f, 0xff10, 0xff11, 0xff12, 0xff13, 0xff14,
0xff15, 0xff16, 0xff17, 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1c,
0xff1d, 0xff1e, 0xff1f, 0xff20, 0xff21, 0xff22, 0xff23, 0xff24,
0xff25, 0xff26, 0xff27, 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c,
0xff2d, 0xff2e, 0xff2f, 0xff30, 0xff31, 0xff32, 0xff33, 0xff34,
0xff35, 0xff36, 0xff37, 0xff38, 0xff39, 0xff3a, 0xff3b, 0xffe6,
0xff3d, 0xff3e, 0xff3f, 0xff40, 0xff41, 0xff42, 0xff43, 0xff44,
0xff45, 0xff46, 0xff47, 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c,
0xff4d, 0xff4e, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xff4f, 0xff50, 0xff51, 0xff52,
0xff53, 0xff54, 0xff55, 0xff56, 0xff57, 0xff58, 0xff59, 0xff5a,
0xff5b, 0xff5c, 0xff5d, 0xffe3, 0x3131, 0x3132, 0x3133, 0x3134,
0x3135, 0x3136, 0x3137, 0x3138, 0x3139, 0x313a, 0x313b, 0x313c,
0x313d, 0x313e, 0x313f, 0x3140, 0x3141, 0x3142, 0x3143, 0x3144,
0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314a, 0x314b, 0x314c,
0x314d, 0x314e, 0x314f, 0x3150, 0x3151, 0x3152, 0x3153, 0x3154,
0x3155, 0x3156, 0x3157, 0x3158, 0x3159, 0x315a, 0x315b, 0x315c,
0x315d, 0x315e, 0x315f, 0x3160, 0x3161, 0x3162, 0x3163, 0x3164,
0x3165, 0x3166, 0x3167, 0x3168, 0x3169, 0x316a, 0x316b, 0x316c,
0x316d, 0x316e, 0x316f, 0x3170, 0x3171, 0x3172, 0x3173, 0x3174,
0x3175, 0x3176, 0x3177, 0x3178, 0x3179, 0x317a, 0x317b, 0x317c,
0x317d, 0x317e, 0x317f, 0x3180, 0x3181, 0x3182, 0x3183, 0x3184,
0x3185, 0x3186, 0x3187, 0x3188, 0x3189, 0x318a, 0x318b, 0x318c,
0x318d, 0x318e, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175,
0x2176, 0x2177, 0x2178, 0x2179, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166,
0x2167, 0x2168, 0x2169, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396,
0x0397, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e,
0x039f, 0x03a0, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
0x03a8, 0x03a9, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6,
0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x03bf, 0x03c0, 0x03c1, 0x03c3, 0x03c4, 0x03c5,
0x03c6, 0x03c7, 0x03c8, 0x03c9, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x2500, 0x2502, 0x250c, 0x2510, 0x2518, 0x2514,
0x251c, 0x252c, 0x2524, 0x2534, 0x253c, 0x2501, 0x2503, 0x250f,
0x2513, 0x251b, 0x2517, 0x2523, 0x2533, 0x252b, 0x253b, 0x254b,
0x2520, 0x252f, 0x2528, 0x2537, 0x253f, 0x251d, 0x2530, 0x2525,
0x2538, 0x2542, 0x2512, 0x2511, 0x251a, 0x2519, 0x2516, 0x2515,
0x250e, 0x250d, 0x251e, 0x251f, 0x2521, 0x2522, 0x2526, 0x2527,
0x2529, 0x252a, 0x252d, 0x252e, 0x2531, 0x2532, 0x2535, 0x2536,
0x2539, 0x253a, 0x253d, 0x253e, 0x2540, 0x2541, 0x2543, 0x2544,
0x2545, 0x2546, 0x2547, 0x2548, 0x2549, 0x254a, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x3395, 0x3396, 0x3397, 0x2113, 0x3398, 0x33c4, 0x33a3, 0x33a4,
0x33a5, 0x33a6, 0x3399, 0x339a, 0x339b, 0x339c, 0x339d, 0x339e,
0x339f, 0x33a0, 0x33a1, 0x33a2, 0x33ca, 0x338d, 0x338e, 0x338f,
0x33cf, 0x3388, 0x3389, 0x33c8, 0x33a7, 0x33a8, 0x33b0, 0x33b1,
0x33b2, 0x33b3, 0x33b4, 0x33b5, 0x33b6, 0x33b7, 0x33b8, 0x33b9,
0x3380, 0x3381, 0x3382, 0x3383, 0x3384, 0x33ba, 0x33bb, 0x33bc,
0x33bd, 0x33be, 0x33bf, 0x3390, 0x3391, 0x3392, 0x3393, 0x3394,
0x2126, 0x33c0, 0x33c1, 0x338a, 0x338b, 0x338c, 0x33d6, 0x33c5,
0x33ad, 0x33ae, 0x33af, 0x33db, 0x33a9, 0x33aa, 0x33ab, 0x33ac,
0x33dd, 0x33d0, 0x33d3, 0x33c3, 0x33c9, 0x33dc, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x33c6, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x00c6, 0x00d0, 0x00aa, 0x0126, 0xfffd, 0x0132, 0xfffd, 0x013f,
0x0141, 0x00d8, 0x0152, 0x00ba, 0x00de, 0x0166, 0x014a, 0xfffd,
0x3260, 0x3261, 0x3262, 0x3263, 0x3264, 0x3265, 0x3266, 0x3267,
0x3268, 0x3269, 0x326a, 0x326b, 0x326c, 0x326d, 0x326e, 0x326f,
0x3270, 0x3271, 0x3272, 0x3273, 0x3274, 0x3275, 0x3276, 0x3277,
0x3278, 0x3279, 0x327a, 0x327b, 0x24d0, 0x24d1, 0x24d2, 0x24d3,
0x24d4, 0x24d5, 0x24d6, 0x24d7, 0x24d8, 0x24d9, 0x24da, 0x24db,
0x24dc, 0x24dd, 0x24de, 0x24df, 0x24e0, 0x24e1, 0x24e2, 0x24e3,
0x24e4, 0x24e5, 0x24e6, 0x24e7, 0x24e8, 0x24e9, 0x2460, 0x2461,
0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468, 0x2469,
0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x00bd, 0x2153, 0x2154,
0x00bc, 0x00be, 0x215b, 0x215c, 0x215d, 0x215e, 0x00e6, 0x0111,
0x00f0, 0x0127, 0x0131, 0x0133, 0x0138, 0x0140, 0x0142, 0x00f8,
0x0153, 0x00df, 0x00fe, 0x0167, 0x014b, 0x0149, 0x3200, 0x3201,
0x3202, 0x3203, 0x3204, 0x3205, 0x3206, 0x3207, 0x3208, 0x3209,
0x320a, 0x320b, 0x320c, 0x320d, 0x320e, 0x320f, 0x3210, 0x3211,
0x3212, 0x3213, 0x3214, 0x3215, 0x3216, 0x3217, 0x3218, 0x3219,
0x321a, 0x321b, 0x249c, 0x249d, 0x249e, 0x249f, 0x24a0, 0x24a1,
0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7, 0x24a8, 0x24a9,
0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af, 0x24b0, 0x24b1,
0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x2474, 0x2475, 0x2476, 0x2477,
0x2478, 0x2479, 0x247a, 0x247b, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x247c, 0x247d,
0x247e, 0x247f, 0x2480, 0x2481, 0x2482, 0x00b9, 0x00b2, 0x00b3,
0x2074, 0x207f, 0x2081, 0x2082, 0x2083, 0x2084, 0x3041, 0x3042,
0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, 0x3049, 0x304a,
0x304b, 0x304c, 0x304d, 0x304e, 0x304f, 0x3050, 0x3051, 0x3052,
0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305a,
0x305b, 0x305c, 0x305d, 0x305e, 0x305f, 0x3060, 0x3061, 0x3062,
0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306a,
0x306b, 0x306c, 0x306d, 0x306e, 0x306f, 0x3070, 0x3071, 0x3072,
0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, 0x3079, 0x307a,
0x307b, 0x307c, 0x307d, 0x307e, 0x307f, 0x3080, 0x3081, 0x3082,
0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, 0x3089, 0x308a,
0x308b, 0x308c, 0x308d, 0x308e, 0x308f, 0x3090, 0x3091, 0x3092,
0x3093, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x30a1, 0x30a2, 0x30a3, 0x30a4,
0x30a5, 0x30a6, 0x30a7, 0x30a8, 0x30a9, 0x30aa, 0x30ab, 0x30ac,
0x30ad, 0x30ae, 0x30af, 0x30b0, 0x30b1, 0x30b2, 0x30b3, 0x30b4,
0x30b5, 0x30b6, 0x30b7, 0x30b8, 0x30b9, 0x30ba, 0x30bb, 0x30bc,
0x30bd, 0x30be, 0x30bf, 0x30c0, 0x30c1, 0x30c2, 0x30c3, 0x30c4,
0x30c5, 0x30c6, 0x30c7, 0x30c8, 0x30c9, 0x30ca, 0x30cb, 0x30cc,
0x30cd, 0x30ce, 0x30cf, 0x30d0, 0x30d1, 0x30d2, 0x30d3, 0x30d4,
0x30d5, 0x30d6, 0x30d7, 0x30d8, 0x30d9, 0x30da, 0x30db, 0x30dc,
0x30dd, 0x30de, 0x30df, 0x30e0, 0x30e1, 0x30e2, 0x30e3, 0x30e4,
0x30e5, 0x30e6, 0x30e7, 0x30e8, 0x30e9, 0x30ea, 0x30eb, 0x30ec,
0x30ed, 0x30ee, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x30ef, 0x30f0, 0x30f1, 0x30f2,
0x30f3, 0x30f4, 0x30f5, 0x30f6, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x0410, 0x0411, 0x0412, 0x0413,
0x0414, 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a,
0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422,
0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a,
0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x0430, 0x0431, 0x0432, 0x0433,
0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a,
0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442,
0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a,
0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
};
static const unsigned short ksc5601_1992_hanja[669*8+4] = {
0x4f3d, 0x4f73, 0x5047, 0x50f9, 0x52a0, 0x53ef, 0x5475, 0x54e5,
0x5609, 0x5ac1, 0x5bb6, 0x6687, 0x67b6, 0x67b7, 0x67ef, 0x6b4c,
0x73c2, 0x75c2, 0x7a3c, 0x82db, 0x8304, 0x8857, 0x8888, 0x8a36,
0x8cc8, 0x8dcf, 0x8efb, 0x8fe6, 0x99d5, 0x523b, 0x5374, 0x5404,
0x606a, 0x6164, 0x6bbc, 0x73cf, 0x811a, 0x89ba, 0x89d2, 0x95a3,
0x4f83, 0x520a, 0x58be, 0x5978, 0x59e6, 0x5e72, 0x5e79, 0x61c7,
0x63c0, 0x6746, 0x67ec, 0x687f, 0x6f97, 0x764e, 0x770b, 0x78f5,
0x7a08, 0x7aff, 0x7c21, 0x809d, 0x826e, 0x8271, 0x8aeb, 0x9593,
0x4e6b, 0x559d, 0x66f7, 0x6e34, 0x78a3, 0x7aed, 0x845b, 0x8910,
0x874e, 0x97a8, 0x52d8, 0x574e, 0x582a, 0x5d4c, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x611f, 0x61be, 0x6221, 0x6562, 0x67d1, 0x6a44, 0x6e1b, 0x7518,
0x75b3, 0x76e3, 0x77b0, 0x7d3a, 0x90af, 0x9451, 0x9452, 0x9f95,
0x5323, 0x5cac, 0x7532, 0x80db, 0x9240, 0x9598, 0x525b, 0x5808,
0x59dc, 0x5ca1, 0x5d17, 0x5eb7, 0x5f3a, 0x5f4a, 0x6177, 0x6c5f,
0x757a, 0x7586, 0x7ce0, 0x7d73, 0x7db1, 0x7f8c, 0x8154, 0x8221,
0x8591, 0x8941, 0x8b1b, 0x92fc, 0x964d, 0x9c47, 0x4ecb, 0x4ef7,
0x500b, 0x51f1, 0x584f, 0x6137, 0x613e, 0x6168, 0x6539, 0x69ea,
0x6f11, 0x75a5, 0x7686, 0x76d6, 0x7b87, 0x82a5, 0x84cb, 0xf900,
0x93a7, 0x958b, 0x5580, 0x5ba2, 0x5751, 0xf901, 0x7cb3, 0x7fb9,
0x91b5, 0x5028, 0x53bb, 0x5c45, 0x5de8, 0x62d2, 0x636e, 0x64da,
0x64e7, 0x6e20, 0x70ac, 0x795b, 0x8ddd, 0x8e1e, 0xf902, 0x907d,
0x9245, 0x92f8, 0x4e7e, 0x4ef6, 0x5065, 0x5dfe, 0x5efa, 0x6106,
0x6957, 0x8171, 0x8654, 0x8e47, 0x9375, 0x9a2b, 0x4e5e, 0x5091,
0x6770, 0x6840, 0x5109, 0x528d, 0x5292, 0x6aa2, 0x77bc, 0x9210,
0x9ed4, 0x52ab, 0x602f, 0x8ff2, 0x5048, 0x61a9, 0x63ed, 0x64ca,
0x683c, 0x6a84, 0x6fc0, 0x8188, 0x89a1, 0x9694, 0x5805, 0x727d,
0x72ac, 0x7504, 0x7d79, 0x7e6d, 0x80a9, 0x898b, 0x8b74, 0x9063,
0x9d51, 0x6289, 0x6c7a, 0x6f54, 0x7d50, 0x7f3a, 0x8a23, 0x517c,
0x614a, 0x7b9d, 0x8b19, 0x9257, 0x938c, 0x4eac, 0x4fd3, 0x501e,
0x50be, 0x5106, 0x52c1, 0x52cd, 0x537f, 0x5770, 0x5883, 0x5e9a,
0x5f91, 0x6176, 0x61ac, 0x64ce, 0x656c, 0x666f, 0x66bb, 0x66f4,
0x6897, 0x6d87, 0x7085, 0x70f1, 0x749f, 0x74a5, 0x74ca, 0x75d9,
0x786c, 0x78ec, 0x7adf, 0x7af6, 0x7d45, 0x7d93, 0x8015, 0x803f,
0x811b, 0x8396, 0x8b66, 0x8f15, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x9015, 0x93e1,
0x9803, 0x9838, 0x9a5a, 0x9be8, 0x4fc2, 0x5553, 0x583a, 0x5951,
0x5b63, 0x5c46, 0x60b8, 0x6212, 0x6842, 0x68b0, 0x68e8, 0x6eaa,
0x754c, 0x7678, 0x78ce, 0x7a3d, 0x7cfb, 0x7e6b, 0x7e7c, 0x8a08,
0x8aa1, 0x8c3f, 0x968e, 0x9dc4, 0x53e4, 0x53e9, 0x544a, 0x5471,
0x56fa, 0x59d1, 0x5b64, 0x5c3b, 0x5eab, 0x62f7, 0x6537, 0x6545,
0x6572, 0x66a0, 0x67af, 0x69c1, 0x6cbd, 0x75fc, 0x7690, 0x777e,
0x7a3f, 0x7f94, 0x8003, 0x80a1, 0x818f, 0x82e6, 0x82fd, 0x83f0,
0x85c1, 0x8831, 0x88b4, 0x8aa5, 0xf903, 0x8f9c, 0x932e, 0x96c7,
0x9867, 0x9ad8, 0x9f13, 0x54ed, 0x659b, 0x66f2, 0x688f, 0x7a40,
0x8c37, 0x9d60, 0x56f0, 0x5764, 0x5d11, 0x6606, 0x68b1, 0x68cd,
0x6efe, 0x7428, 0x889e, 0x9be4, 0x6c68, 0xf904, 0x9aa8, 0x4f9b,
0x516c, 0x5171, 0x529f, 0x5b54, 0x5de5, 0x6050, 0x606d, 0x62f1,
0x63a7, 0x653b, 0x73d9, 0x7a7a, 0x86a3, 0x8ca2, 0x978f, 0x4e32,
0x5be1, 0x6208, 0x679c, 0x74dc, 0x79d1, 0x83d3, 0x8a87, 0x8ab2,
0x8de8, 0x904e, 0x934b, 0x9846, 0x5ed3, 0x69e8, 0x85ff, 0x90ed,
0xf905, 0x51a0, 0x5b98, 0x5bec, 0x6163, 0x68fa, 0x6b3e, 0x704c,
0x742f, 0x74d8, 0x7ba1, 0x7f50, 0x83c5, 0x89c0, 0x8cab, 0x95dc,
0x9928, 0x522e, 0x605d, 0x62ec, 0x9002, 0x4f8a, 0x5149, 0x5321,
0x58d9, 0x5ee3, 0x66e0, 0x6d38, 0x709a, 0x72c2, 0x73d6, 0x7b50,
0x80f1, 0x945b, 0x5366, 0x639b, 0x7f6b, 0x4e56, 0x5080, 0x584a,
0x58de, 0x602a, 0x6127, 0x62d0, 0x69d0, 0x9b41, 0x5b8f, 0x7d18,
0x80b1, 0x8f5f, 0x4ea4, 0x50d1, 0x54ac, 0x55ac, 0x5b0c, 0x5da0,
0x5de7, 0x652a, 0x654e, 0x6821, 0x6a4b, 0x72e1, 0x768e, 0x77ef,
0x7d5e, 0x7ff9, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x81a0, 0x854e, 0x86df, 0x8f03,
0x8f4e, 0x90ca, 0x9903, 0x9a55, 0x9bab, 0x4e18, 0x4e45, 0x4e5d,
0x4ec7, 0x4ff1, 0x5177, 0x52fe, 0x5340, 0x53e3, 0x53e5, 0x548e,
0x5614, 0x5775, 0x57a2, 0x5bc7, 0x5d87, 0x5ed0, 0x61fc, 0x62d8,
0x6551, 0x67b8, 0x67e9, 0x69cb, 0x6b50, 0x6bc6, 0x6bec, 0x6c42,
0x6e9d, 0x7078, 0x72d7, 0x7396, 0x7403, 0x77bf, 0x77e9, 0x7a76,
0x7d7f, 0x8009, 0x81fc, 0x8205, 0x820a, 0x82df, 0x8862, 0x8b33,
0x8cfc, 0x8ec0, 0x9011, 0x90b1, 0x9264, 0x92b6, 0x99d2, 0x9a45,
0x9ce9, 0x9dd7, 0x9f9c, 0x570b, 0x5c40, 0x83ca, 0x97a0, 0x97ab,
0x9eb4, 0x541b, 0x7a98, 0x7fa4, 0x88d9, 0x8ecd, 0x90e1, 0x5800,
0x5c48, 0x6398, 0x7a9f, 0x5bae, 0x5f13, 0x7a79, 0x7aae, 0x828e,
0x8eac, 0x5026, 0x5238, 0x52f8, 0x5377, 0x5708, 0x62f3, 0x6372,
0x6b0a, 0x6dc3, 0x7737, 0x53a5, 0x7357, 0x8568, 0x8e76, 0x95d5,
0x673a, 0x6ac3, 0x6f70, 0x8a6d, 0x8ecc, 0x994b, 0xf906, 0x6677,
0x6b78, 0x8cb4, 0x9b3c, 0xf907, 0x53eb, 0x572d, 0x594e, 0x63c6,
0x69fb, 0x73ea, 0x7845, 0x7aba, 0x7ac5, 0x7cfe, 0x8475, 0x898f,
0x8d73, 0x9035, 0x95a8, 0x52fb, 0x5747, 0x7547, 0x7b60, 0x83cc,
0x921e, 0xf908, 0x6a58, 0x514b, 0x524b, 0x5287, 0x621f, 0x68d8,
0x6975, 0x9699, 0x50c5, 0x52a4, 0x52e4, 0x61c3, 0x65a4, 0x6839,
0x69ff, 0x747e, 0x7b4b, 0x82b9, 0x83eb, 0x89b2, 0x8b39, 0x8fd1,
0x9949, 0xf909, 0x4eca, 0x5997, 0x64d2, 0x6611, 0x6a8e, 0x7434,
0x7981, 0x79bd, 0x82a9, 0x887e, 0x887f, 0x895f, 0xf90a, 0x9326,
0x4f0b, 0x53ca, 0x6025, 0x6271, 0x6c72, 0x7d1a, 0x7d66, 0x4e98,
0x5162, 0x77dc, 0x80af, 0x4f01, 0x4f0e, 0x5176, 0x5180, 0x55dc,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x5668, 0x573b, 0x57fa, 0x57fc, 0x5914, 0x5947,
0x5993, 0x5bc4, 0x5c90, 0x5d0e, 0x5df1, 0x5e7e, 0x5fcc, 0x6280,
0x65d7, 0x65e3, 0x671e, 0x671f, 0x675e, 0x68cb, 0x68c4, 0x6a5f,
0x6b3a, 0x6c23, 0x6c7d, 0x6c82, 0x6dc7, 0x7398, 0x7426, 0x742a,
0x7482, 0x74a3, 0x7578, 0x757f, 0x7881, 0x78ef, 0x7941, 0x7947,
0x7948, 0x797a, 0x7b95, 0x7d00, 0x7dba, 0x7f88, 0x8006, 0x802d,
0x808c, 0x8a18, 0x8b4f, 0x8c48, 0x8d77, 0x9321, 0x9324, 0x98e2,
0x9951, 0x9a0e, 0x9a0f, 0x9a65, 0x9e92, 0x7dca, 0x4f76, 0x5409,
0x62ee, 0x6854, 0x91d1, 0x55ab, 0x513a, 0xf90b, 0xf90c, 0x5a1c,
0x61e6, 0xf90d, 0x62cf, 0x62ff, 0xf90e, 0xf90f, 0xf910, 0xf911,
0xf912, 0xf913, 0x90a3, 0xf914, 0xf915, 0xf916, 0xf917, 0xf918,
0x8afe, 0xf919, 0xf91a, 0xf91b, 0xf91c, 0x6696, 0xf91d, 0x7156,
0xf91e, 0xf91f, 0x96e3, 0xf920, 0x634f, 0x637a, 0x5357, 0xf921,
0x678f, 0x6960, 0x6e73, 0xf922, 0x7537, 0xf923, 0xf924, 0xf925,
0x7d0d, 0xf926, 0xf927, 0x8872, 0x56ca, 0x5a18, 0xf928, 0xf929,
0xf92a, 0xf92b, 0xf92c, 0x4e43, 0xf92d, 0x5167, 0x5948, 0x67f0,
0x8010, 0xf92e, 0x5973, 0x5e74, 0x649a, 0x79ca, 0x5ff5, 0x606c,
0x62c8, 0x637b, 0x5be7, 0x5bd7, 0x52aa, 0xf92f, 0x5974, 0x5f29,
0x6012, 0xf930, 0xf931, 0xf932, 0x7459, 0xf933, 0xf934, 0xf935,
0xf936, 0xf937, 0xf938, 0x99d1, 0xf939, 0xf93a, 0xf93b, 0xf93c,
0xf93d, 0xf93e, 0xf93f, 0xf940, 0xf941, 0xf942, 0xf943, 0x6fc3,
0xf944, 0xf945, 0x81bf, 0x8fb2, 0x60f1, 0xf946, 0xf947, 0x8166,
0xf948, 0xf949, 0x5c3f, 0xf94a, 0xf94b, 0xf94c, 0xf94d, 0xf94e,
0xf94f, 0xf950, 0xf951, 0x5ae9, 0x8a25, 0x677b, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x7d10, 0xf952, 0xf953, 0xf954, 0xf955, 0xf956, 0xf957, 0x80fd,
0xf958, 0xf959, 0x5c3c, 0x6ce5, 0x533f, 0x6eba, 0x591a, 0x8336,
0x4e39, 0x4eb6, 0x4f46, 0x55ae, 0x5718, 0x58c7, 0x5f56, 0x65b7,
0x65e6, 0x6a80, 0x6bb5, 0x6e4d, 0x77ed, 0x7aef, 0x7c1e, 0x7dde,
0x86cb, 0x8892, 0x9132, 0x935b, 0x64bb, 0x6fbe, 0x737a, 0x75b8,
0x9054, 0x5556, 0x574d, 0x61ba, 0x64d4, 0x66c7, 0x6de1, 0x6e5b,
0x6f6d, 0x6fb9, 0x75f0, 0x8043, 0x81bd, 0x8541, 0x8983, 0x8ac7,
0x8b5a, 0x931f, 0x6c93, 0x7553, 0x7b54, 0x8e0f, 0x905d, 0x5510,
0x5802, 0x5858, 0x5e62, 0x6207, 0x649e, 0x68e0, 0x7576, 0x7cd6,
0x87b3, 0x9ee8, 0x4ee3, 0x5788, 0x576e, 0x5927, 0x5c0d, 0x5cb1,
0x5e36, 0x5f85, 0x6234, 0x64e1, 0x73b3, 0x81fa, 0x888b, 0x8cb8,
0x968a, 0x9edb, 0x5b85, 0x5fb7, 0x60b3, 0x5012, 0x5200, 0x5230,
0x5716, 0x5835, 0x5857, 0x5c0e, 0x5c60, 0x5cf6, 0x5d8b, 0x5ea6,
0x5f92, 0x60bc, 0x6311, 0x6389, 0x6417, 0x6843, 0x68f9, 0x6ac2,
0x6dd8, 0x6e21, 0x6ed4, 0x6fe4, 0x71fe, 0x76dc, 0x7779, 0x79b1,
0x7a3b, 0x8404, 0x89a9, 0x8ced, 0x8df3, 0x8e48, 0x9003, 0x9014,
0x9053, 0x90fd, 0x934d, 0x9676, 0x97dc, 0x6bd2, 0x7006, 0x7258,
0x72a2, 0x7368, 0x7763, 0x79bf, 0x7be4, 0x7e9b, 0x8b80, 0x58a9,
0x60c7, 0x6566, 0x65fd, 0x66be, 0x6c8c, 0x711e, 0x71c9, 0x8c5a,
0x9813, 0x4e6d, 0x7a81, 0x4edd, 0x51ac, 0x51cd, 0x52d5, 0x540c,
0x61a7, 0x6771, 0x6850, 0x68df, 0x6d1e, 0x6f7c, 0x75bc, 0x77b3,
0x7ae5, 0x80f4, 0x8463, 0x9285, 0x515c, 0x6597, 0x675c, 0x6793,
0x75d8, 0x7ac7, 0x8373, 0xf95a, 0x8c46, 0x9017, 0x982d, 0x5c6f,
0x81c0, 0x829a, 0x9041, 0x906f, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x920d, 0x5f97,
0x5d9d, 0x6a59, 0x71c8, 0x767b, 0x7b49, 0x85e4, 0x8b04, 0x9127,
0x9a30, 0x5587, 0x61f6, 0xf95b, 0x7669, 0x7f85, 0x863f, 0x87ba,
0x88f8, 0x908f, 0xf95c, 0x6d1b, 0x70d9, 0x73de, 0x7d61, 0x843d,
0xf95d, 0x916a, 0x99f1, 0xf95e, 0x4e82, 0x5375, 0x6b04, 0x6b12,
0x703e, 0x721b, 0x862d, 0x9e1e, 0x524c, 0x8fa3, 0x5d50, 0x64e5,
0x652c, 0x6b16, 0x6feb, 0x7c43, 0x7e9c, 0x85cd, 0x8964, 0x89bd,
0x62c9, 0x81d8, 0x881f, 0x5eca, 0x6717, 0x6d6a, 0x72fc, 0x7405,
0x746f, 0x8782, 0x90de, 0x4f86, 0x5d0d, 0x5fa0, 0x840a, 0x51b7,
0x63a0, 0x7565, 0x4eae, 0x5006, 0x5169, 0x51c9, 0x6881, 0x6a11,
0x7cae, 0x7cb1, 0x7ce7, 0x826f, 0x8ad2, 0x8f1b, 0x91cf, 0x4fb6,
0x5137, 0x52f5, 0x5442, 0x5eec, 0x616e, 0x623e, 0x65c5, 0x6ada,
0x6ffe, 0x792a, 0x85dc, 0x8823, 0x95ad, 0x9a62, 0x9a6a, 0x9e97,
0x9ece, 0x529b, 0x66c6, 0x6b77, 0x701d, 0x792b, 0x8f62, 0x9742,
0x6190, 0x6200, 0x6523, 0x6f23, 0x7149, 0x7489, 0x7df4, 0x806f,
0x84ee, 0x8f26, 0x9023, 0x934a, 0x51bd, 0x5217, 0x52a3, 0x6d0c,
0x70c8, 0x88c2, 0x5ec9, 0x6582, 0x6bae, 0x6fc2, 0x7c3e, 0x7375,
0x4ee4, 0x4f36, 0x56f9, 0xf95f, 0x5cba, 0x5dba, 0x601c, 0x73b2,
0x7b2d, 0x7f9a, 0x7fce, 0x8046, 0x901e, 0x9234, 0x96f6, 0x9748,
0x9818, 0x9f61, 0x4f8b, 0x6fa7, 0x79ae, 0x91b4, 0x96b7, 0x52de,
0xf960, 0x6488, 0x64c4, 0x6ad3, 0x6f5e, 0x7018, 0x7210, 0x76e7,
0x8001, 0x8606, 0x865c, 0x8def, 0x8f05, 0x9732, 0x9b6f, 0x9dfa,
0x9e75, 0x788c, 0x797f, 0x7da0, 0x83c9, 0x9304, 0x9e7f, 0x9e93,
0x8ad6, 0x58df, 0x5f04, 0x6727, 0x7027, 0x74cf, 0x7c60, 0x807e,
0x5121, 0x7028, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x7262, 0x78ca, 0x8cc2, 0x8cda,
0x8cf4, 0x96f7, 0x4e86, 0x50da, 0x5bee, 0x5ed6, 0x6599, 0x71ce,
0x7642, 0x77ad, 0x804a, 0x84fc, 0x907c, 0x9b27, 0x9f8d, 0x58d8,
0x5a41, 0x5c62, 0x6a13, 0x6dda, 0x6f0f, 0x763b, 0x7d2f, 0x7e37,
0x851e, 0x8938, 0x93e4, 0x964b, 0x5289, 0x65d2, 0x67f3, 0x69b4,
0x6d41, 0x6e9c, 0x700f, 0x7409, 0x7460, 0x7559, 0x7624, 0x786b,
0x8b2c, 0x985e, 0x516d, 0x622e, 0x9678, 0x4f96, 0x502b, 0x5d19,
0x6dea, 0x7db8, 0x8f2a, 0x5f8b, 0x6144, 0x6817, 0xf961, 0x9686,
0x52d2, 0x808b, 0x51dc, 0x51cc, 0x695e, 0x7a1c, 0x7dbe, 0x83f1,
0x9675, 0x4fda, 0x5229, 0x5398, 0x540f, 0x550e, 0x5c65, 0x60a7,
0x674e, 0x68a8, 0x6d6c, 0x7281, 0x72f8, 0x7406, 0x7483, 0xf962,
0x75e2, 0x7c6c, 0x7f79, 0x7fb8, 0x8389, 0x88cf, 0x88e1, 0x91cc,
0x91d0, 0x96e2, 0x9bc9, 0x541d, 0x6f7e, 0x71d0, 0x7498, 0x85fa,
0x8eaa, 0x96a3, 0x9c57, 0x9e9f, 0x6797, 0x6dcb, 0x7433, 0x81e8,
0x9716, 0x782c, 0x7acb, 0x7b20, 0x7c92, 0x6469, 0x746a, 0x75f2,
0x78bc, 0x78e8, 0x99ac, 0x9b54, 0x9ebb, 0x5bde, 0x5e55, 0x6f20,
0x819c, 0x83ab, 0x9088, 0x4e07, 0x534d, 0x5a29, 0x5dd2, 0x5f4e,
0x6162, 0x633d, 0x6669, 0x66fc, 0x6eff, 0x6f2b, 0x7063, 0x779e,
0x842c, 0x8513, 0x883b, 0x8f13, 0x9945, 0x9c3b, 0x551c, 0x62b9,
0x672b, 0x6cab, 0x8309, 0x896a, 0x977a, 0x4ea1, 0x5984, 0x5fd8,
0x5fd9, 0x671b, 0x7db2, 0x7f54, 0x8292, 0x832b, 0x83bd, 0x8f1e,
0x9099, 0x57cb, 0x59b9, 0x5a92, 0x5bd0, 0x6627, 0x679a, 0x6885,
0x6bcf, 0x7164, 0x7f75, 0x8cb7, 0x8ce3, 0x9081, 0x9b45, 0x8108,
0x8c8a, 0x964c, 0x9a40, 0x9ea5, 0x5b5f, 0x6c13, 0x731b, 0x76f2,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x76df, 0x840c, 0x51aa, 0x8993, 0x514d, 0x5195,
0x52c9, 0x68c9, 0x6c94, 0x7704, 0x7720, 0x7dbf, 0x7dec, 0x9762,
0x9eb5, 0x6ec5, 0x8511, 0x51a5, 0x540d, 0x547d, 0x660e, 0x669d,
0x6927, 0x6e9f, 0x76bf, 0x7791, 0x8317, 0x84c2, 0x879f, 0x9169,
0x9298, 0x9cf4, 0x8882, 0x4fae, 0x5192, 0x52df, 0x59c6, 0x5e3d,
0x6155, 0x6478, 0x6479, 0x66ae, 0x67d0, 0x6a21, 0x6bcd, 0x6bdb,
0x725f, 0x7261, 0x7441, 0x7738, 0x77db, 0x8017, 0x82bc, 0x8305,
0x8b00, 0x8b28, 0x8c8c, 0x6728, 0x6c90, 0x7267, 0x76ee, 0x7766,
0x7a46, 0x9da9, 0x6b7f, 0x6c92, 0x5922, 0x6726, 0x8499, 0x536f,
0x5893, 0x5999, 0x5edf, 0x63cf, 0x6634, 0x6773, 0x6e3a, 0x732b,
0x7ad7, 0x82d7, 0x9328, 0x52d9, 0x5deb, 0x61ae, 0x61cb, 0x620a,
0x62c7, 0x64ab, 0x65e0, 0x6959, 0x6b66, 0x6bcb, 0x7121, 0x73f7,
0x755d, 0x7e46, 0x821e, 0x8302, 0x856a, 0x8aa3, 0x8cbf, 0x9727,
0x9d61, 0x58a8, 0x9ed8, 0x5011, 0x520e, 0x543b, 0x554f, 0x6587,
0x6c76, 0x7d0a, 0x7d0b, 0x805e, 0x868a, 0x9580, 0x96ef, 0x52ff,
0x6c95, 0x7269, 0x5473, 0x5a9a, 0x5c3e, 0x5d4b, 0x5f4c, 0x5fae,
0x672a, 0x68b6, 0x6963, 0x6e3c, 0x6e44, 0x7709, 0x7c73, 0x7f8e,
0x8587, 0x8b0e, 0x8ff7, 0x9761, 0x9ef4, 0x5cb7, 0x60b6, 0x610d,
0x61ab, 0x654f, 0x65fb, 0x65fc, 0x6c11, 0x6cef, 0x739f, 0x73c9,
0x7de1, 0x9594, 0x5bc6, 0x871c, 0x8b10, 0x525d, 0x535a, 0x62cd,
0x640f, 0x64b2, 0x6734, 0x6a38, 0x6cca, 0x73c0, 0x749e, 0x7b94,
0x7c95, 0x7e1b, 0x818a, 0x8236, 0x8584, 0x8feb, 0x96f9, 0x99c1,
0x4f34, 0x534a, 0x53cd, 0x53db, 0x62cc, 0x642c, 0x6500, 0x6591,
0x69c3, 0x6cee, 0x6f58, 0x73ed, 0x7554, 0x7622, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x76e4, 0x76fc, 0x78d0, 0x78fb, 0x792c, 0x7d46, 0x822c, 0x87e0,
0x8fd4, 0x9812, 0x98ef, 0x52c3, 0x62d4, 0x64a5, 0x6e24, 0x6f51,
0x767c, 0x8dcb, 0x91b1, 0x9262, 0x9aee, 0x9b43, 0x5023, 0x508d,
0x574a, 0x59a8, 0x5c28, 0x5e47, 0x5f77, 0x623f, 0x653e, 0x65b9,
0x65c1, 0x6609, 0x678b, 0x699c, 0x6ec2, 0x78c5, 0x7d21, 0x80aa,
0x8180, 0x822b, 0x82b3, 0x84a1, 0x868c, 0x8a2a, 0x8b17, 0x90a6,
0x9632, 0x9f90, 0x500d, 0x4ff3, 0xf963, 0x57f9, 0x5f98, 0x62dc,
0x6392, 0x676f, 0x6e43, 0x7119, 0x76c3, 0x80cc, 0x80da, 0x88f4,
0x88f5, 0x8919, 0x8ce0, 0x8f29, 0x914d, 0x966a, 0x4f2f, 0x4f70,
0x5e1b, 0x67cf, 0x6822, 0x767d, 0x767e, 0x9b44, 0x5e61, 0x6a0a,
0x7169, 0x71d4, 0x756a, 0xf964, 0x7e41, 0x8543, 0x85e9, 0x98dc,
0x4f10, 0x7b4f, 0x7f70, 0x95a5, 0x51e1, 0x5e06, 0x68b5, 0x6c3e,
0x6c4e, 0x6cdb, 0x72af, 0x7bc4, 0x8303, 0x6cd5, 0x743a, 0x50fb,
0x5288, 0x58c1, 0x64d8, 0x6a97, 0x74a7, 0x7656, 0x78a7, 0x8617,
0x95e2, 0x9739, 0xf965, 0x535e, 0x5f01, 0x8b8a, 0x8fa8, 0x8faf,
0x908a, 0x5225, 0x77a5, 0x9c49, 0x9f08, 0x4e19, 0x5002, 0x5175,
0x5c5b, 0x5e77, 0x661e, 0x663a, 0x67c4, 0x68c5, 0x70b3, 0x7501,
0x75c5, 0x79c9, 0x7add, 0x8f27, 0x9920, 0x9a08, 0x4fdd, 0x5821,
0x5831, 0x5bf6, 0x666e, 0x6b65, 0x6d11, 0x6e7a, 0x6f7d, 0x73e4,
0x752b, 0x83e9, 0x88dc, 0x8913, 0x8b5c, 0x8f14, 0x4f0f, 0x50d5,
0x5310, 0x535c, 0x5b93, 0x5fa9, 0x670d, 0x798f, 0x8179, 0x832f,
0x8514, 0x8907, 0x8986, 0x8f39, 0x8f3b, 0x99a5, 0x9c12, 0x672c,
0x4e76, 0x4ff8, 0x5949, 0x5c01, 0x5cef, 0x5cf0, 0x6367, 0x68d2,
0x70fd, 0x71a2, 0x742b, 0x7e2b, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x84ec, 0x8702,
0x9022, 0x92d2, 0x9cf3, 0x4e0d, 0x4ed8, 0x4fef, 0x5085, 0x5256,
0x526f, 0x5426, 0x5490, 0x57e0, 0x592b, 0x5a66, 0x5b5a, 0x5b75,
0x5bcc, 0x5e9c, 0xf966, 0x6276, 0x6577, 0x65a7, 0x6d6e, 0x6ea5,
0x7236, 0x7b26, 0x7c3f, 0x7f36, 0x8150, 0x8151, 0x819a, 0x8240,
0x8299, 0x83a9, 0x8a03, 0x8ca0, 0x8ce6, 0x8cfb, 0x8d74, 0x8dba,
0x90e8, 0x91dc, 0x961c, 0x9644, 0x99d9, 0x9ce7, 0x5317, 0x5206,
0x5429, 0x5674, 0x58b3, 0x5954, 0x596e, 0x5fff, 0x61a4, 0x626e,
0x6610, 0x6c7e, 0x711a, 0x76c6, 0x7c89, 0x7cde, 0x7d1b, 0x82ac,
0x8cc1, 0x96f0, 0xf967, 0x4f5b, 0x5f17, 0x5f7f, 0x62c2, 0x5d29,
0x670b, 0x68da, 0x787c, 0x7e43, 0x9d6c, 0x4e15, 0x5099, 0x5315,
0x532a, 0x5351, 0x5983, 0x5a62, 0x5e87, 0x60b2, 0x618a, 0x6249,
0x6279, 0x6590, 0x6787, 0x69a7, 0x6bd4, 0x6bd6, 0x6bd7, 0x6bd8,
0x6cb8, 0xf968, 0x7435, 0x75fa, 0x7812, 0x7891, 0x79d5, 0x79d8,
0x7c83, 0x7dcb, 0x7fe1, 0x80a5, 0x813e, 0x81c2, 0x83f2, 0x871a,
0x88e8, 0x8ab9, 0x8b6c, 0x8cbb, 0x9119, 0x975e, 0x98db, 0x9f3b,
0x56ac, 0x5b2a, 0x5f6c, 0x658c, 0x6ab3, 0x6baf, 0x6d5c, 0x6ff1,
0x7015, 0x725d, 0x73ad, 0x8ca7, 0x8cd3, 0x983b, 0x6191, 0x6c37,
0x8058, 0x9a01, 0x4e4d, 0x4e8b, 0x4e9b, 0x4ed5, 0x4f3a, 0x4f3c,
0x4f7f, 0x4fdf, 0x50ff, 0x53f2, 0x53f8, 0x5506, 0x55e3, 0x56db,
0x58eb, 0x5962, 0x5a11, 0x5beb, 0x5bfa, 0x5c04, 0x5df3, 0x5e2b,
0x5f99, 0x601d, 0x6368, 0x659c, 0x65af, 0x67f6, 0x67fb, 0x68ad,
0x6b7b, 0x6c99, 0x6cd7, 0x6e23, 0x7009, 0x7345, 0x7802, 0x793e,
0x7940, 0x7960, 0x79c1, 0x7be9, 0x7d17, 0x7d72, 0x8086, 0x820d,
0x838e, 0x84d1, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x86c7, 0x88df, 0x8a50, 0x8a5e,
0x8b1d, 0x8cdc, 0x8d66, 0x8fad, 0x90aa, 0x98fc, 0x99df, 0x9e9d,
0x524a, 0xf969, 0x6714, 0xf96a, 0x5098, 0x522a, 0x5c71, 0x6563,
0x6c55, 0x73ca, 0x7523, 0x759d, 0x7b97, 0x849c, 0x9178, 0x9730,
0x4e77, 0x6492, 0x6bba, 0x715e, 0x85a9, 0x4e09, 0xf96b, 0x6749,
0x68ee, 0x6e17, 0x829f, 0x8518, 0x886b, 0x63f7, 0x6f81, 0x9212,
0x98af, 0x4e0a, 0x50b7, 0x50cf, 0x511f, 0x5546, 0x55aa, 0x5617,
0x5b40, 0x5c19, 0x5ce0, 0x5e38, 0x5e8a, 0x5ea0, 0x5ec2, 0x60f3,
0x6851, 0x6a61, 0x6e58, 0x723d, 0x7240, 0x72c0, 0x76f8, 0x7965,
0x7bb1, 0x7fd4, 0x88f3, 0x89f4, 0x8a73, 0x8c61, 0x8cde, 0x971c,
0x585e, 0x74bd, 0x8cfd, 0x55c7, 0xf96c, 0x7a61, 0x7d22, 0x8272,
0x7272, 0x751f, 0x7525, 0xf96d, 0x7b19, 0x5885, 0x58fb, 0x5dbc,
0x5e8f, 0x5eb6, 0x5f90, 0x6055, 0x6292, 0x637f, 0x654d, 0x6691,
0x66d9, 0x66f8, 0x6816, 0x68f2, 0x7280, 0x745e, 0x7b6e, 0x7d6e,
0x7dd6, 0x7f72, 0x80e5, 0x8212, 0x85af, 0x897f, 0x8a93, 0x901d,
0x92e4, 0x9ecd, 0x9f20, 0x5915, 0x596d, 0x5e2d, 0x60dc, 0x6614,
0x6673, 0x6790, 0x6c50, 0x6dc5, 0x6f5f, 0x77f3, 0x78a9, 0x84c6,
0x91cb, 0x932b, 0x4ed9, 0x50ca, 0x5148, 0x5584, 0x5b0b, 0x5ba3,
0x6247, 0x657e, 0x65cb, 0x6e32, 0x717d, 0x7401, 0x7444, 0x7487,
0x74bf, 0x766c, 0x79aa, 0x7dda, 0x7e55, 0x7fa8, 0x817a, 0x81b3,
0x8239, 0x861a, 0x87ec, 0x8a75, 0x8de3, 0x9078, 0x9291, 0x9425,
0x994d, 0x9bae, 0x5368, 0x5c51, 0x6954, 0x6cc4, 0x6d29, 0x6e2b,
0x820c, 0x859b, 0x893b, 0x8a2d, 0x8aaa, 0x96ea, 0x9f67, 0x5261,
0x66b9, 0x6bb2, 0x7e96, 0x87fe, 0x8d0d, 0x9583, 0x965d, 0x651d,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x6d89, 0x71ee, 0xf96e, 0x57ce, 0x59d3, 0x5bac,
0x6027, 0x60fa, 0x6210, 0x661f, 0x665f, 0x7329, 0x73f9, 0x76db,
0x7701, 0x7b6c, 0x8056, 0x8072, 0x8165, 0x8aa0, 0x9192, 0x4e16,
0x52e2, 0x6b72, 0x6d17, 0x7a05, 0x7b39, 0x7d30, 0xf96f, 0x8cb0,
0x53ec, 0x562f, 0x5851, 0x5bb5, 0x5c0f, 0x5c11, 0x5de2, 0x6240,
0x6383, 0x6414, 0x662d, 0x68b3, 0x6cbc, 0x6d88, 0x6eaf, 0x701f,
0x70a4, 0x71d2, 0x7526, 0x758f, 0x758e, 0x7619, 0x7b11, 0x7be0,
0x7c2b, 0x7d20, 0x7d39, 0x852c, 0x856d, 0x8607, 0x8a34, 0x900d,
0x9061, 0x90b5, 0x92b7, 0x97f6, 0x9a37, 0x4fd7, 0x5c6c, 0x675f,
0x6d91, 0x7c9f, 0x7e8c, 0x8b16, 0x8d16, 0x901f, 0x5b6b, 0x5dfd,
0x640d, 0x84c0, 0x905c, 0x98e1, 0x7387, 0x5b8b, 0x609a, 0x677e,
0x6dde, 0x8a1f, 0x8aa6, 0x9001, 0x980c, 0x5237, 0xf970, 0x7051,
0x788e, 0x9396, 0x8870, 0x91d7, 0x4fee, 0x53d7, 0x55fd, 0x56da,
0x5782, 0x58fd, 0x5ac2, 0x5b88, 0x5cab, 0x5cc0, 0x5e25, 0x6101,
0x620d, 0x624b, 0x6388, 0x641c, 0x6536, 0x6578, 0x6a39, 0x6b8a,
0x6c34, 0x6d19, 0x6f31, 0x71e7, 0x72e9, 0x7378, 0x7407, 0x74b2,
0x7626, 0x7761, 0x79c0, 0x7a57, 0x7aea, 0x7cb9, 0x7d8f, 0x7dac,
0x7e61, 0x7f9e, 0x8129, 0x8331, 0x8490, 0x84da, 0x85ea, 0x8896,
0x8ab0, 0x8b90, 0x8f38, 0x9042, 0x9083, 0x916c, 0x9296, 0x92b9,
0x968b, 0x96a7, 0x96a8, 0x96d6, 0x9700, 0x9808, 0x9996, 0x9ad3,
0x9b1a, 0x53d4, 0x587e, 0x5919, 0x5b70, 0x5bbf, 0x6dd1, 0x6f5a,
0x719f, 0x7421, 0x74b9, 0x8085, 0x83fd, 0x5de1, 0x5f87, 0x5faa,
0x6042, 0x65ec, 0x6812, 0x696f, 0x6a53, 0x6b89, 0x6d35, 0x6df3,
0x73e3, 0x76fe, 0x77ac, 0x7b4d, 0x7d14, 0x8123, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x821c, 0x8340, 0x84f4, 0x8563, 0x8a62, 0x8ac4, 0x9187, 0x931e,
0x9806, 0x99b4, 0x620c, 0x8853, 0x8ff0, 0x9265, 0x5d07, 0x5d27,
0x5d69, 0x745f, 0x819d, 0x8768, 0x6fd5, 0x62fe, 0x7fd2, 0x8936,
0x8972, 0x4e1e, 0x4e58, 0x50e7, 0x52dd, 0x5347, 0x627f, 0x6607,
0x7e69, 0x8805, 0x965e, 0x4f8d, 0x5319, 0x5636, 0x59cb, 0x5aa4,
0x5c38, 0x5c4e, 0x5c4d, 0x5e02, 0x5f11, 0x6043, 0x65bd, 0x662f,
0x6642, 0x67be, 0x67f4, 0x731c, 0x77e2, 0x793a, 0x7fc5, 0x8494,
0x84cd, 0x8996, 0x8a66, 0x8a69, 0x8ae1, 0x8c55, 0x8c7a, 0x57f4,
0x5bd4, 0x5f0f, 0x606f, 0x62ed, 0x690d, 0x6b96, 0x6e5c, 0x7184,
0x7bd2, 0x8755, 0x8b58, 0x8efe, 0x98df, 0x98fe, 0x4f38, 0x4f81,
0x4fe1, 0x547b, 0x5a20, 0x5bb8, 0x613c, 0x65b0, 0x6668, 0x71fc,
0x7533, 0x795e, 0x7d33, 0x814e, 0x81e3, 0x8398, 0x85aa, 0x85ce,
0x8703, 0x8a0a, 0x8eab, 0x8f9b, 0xf971, 0x8fc5, 0x5931, 0x5ba4,
0x5be6, 0x6089, 0x5be9, 0x5c0b, 0x5fc3, 0x6c81, 0xf972, 0x6df1,
0x700b, 0x751a, 0x82af, 0x8af6, 0x4ec0, 0x5341, 0xf973, 0x96d9,
0x6c0f, 0x4e9e, 0x4fc4, 0x5152, 0x555e, 0x5a25, 0x5ce8, 0x6211,
0x7259, 0x82bd, 0x83aa, 0x86fe, 0x8859, 0x8a1d, 0x963f, 0x96c5,
0x9913, 0x9d09, 0x9d5d, 0x580a, 0x5cb3, 0x5dbd, 0x5e44, 0x60e1,
0x6115, 0x63e1, 0x6a02, 0x6e25, 0x9102, 0x9354, 0x984e, 0x9c10,
0x9f77, 0x5b89, 0x5cb8, 0x6309, 0x664f, 0x6848, 0x773c, 0x96c1,
0x978d, 0x9854, 0x9b9f, 0x65a1, 0x8b01, 0x8ecb, 0x95bc, 0x5535,
0x5ca9, 0x5dd6, 0x5eb5, 0x6697, 0x764c, 0x83f4, 0x95c7, 0x58d3,
0x62bc, 0x72ce, 0x9d28, 0x4ef0, 0x592e, 0x600f, 0x663b, 0x6b83,
0x79e7, 0x9d26, 0x5393, 0x54c0, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x57c3, 0x5d16,
0x611b, 0x66d6, 0x6daf, 0x788d, 0x827e, 0x9698, 0x9744, 0x5384,
0x627c, 0x6396, 0x6db2, 0x7e0a, 0x814b, 0x984d, 0x6afb, 0x7f4c,
0x9daf, 0x9e1a, 0x4e5f, 0x503b, 0x51b6, 0x591c, 0x60f9, 0x63f6,
0x6930, 0x723a, 0x8036, 0xf974, 0x91ce, 0x5f31, 0xf975, 0xf976,
0x7d04, 0x82e5, 0x846f, 0x84bb, 0x85e5, 0x8e8d, 0xf977, 0x4f6f,
0xf978, 0xf979, 0x58e4, 0x5b43, 0x6059, 0x63da, 0x6518, 0x656d,
0x6698, 0xf97a, 0x694a, 0x6a23, 0x6d0b, 0x7001, 0x716c, 0x75d2,
0x760d, 0x79b3, 0x7a70, 0xf97b, 0x7f8a, 0xf97c, 0x8944, 0xf97d,
0x8b93, 0x91c0, 0x967d, 0xf97e, 0x990a, 0x5704, 0x5fa1, 0x65bc,
0x6f01, 0x7600, 0x79a6, 0x8a9e, 0x99ad, 0x9b5a, 0x9f6c, 0x5104,
0x61b6, 0x6291, 0x6a8d, 0x81c6, 0x5043, 0x5830, 0x5f66, 0x7109,
0x8a00, 0x8afa, 0x5b7c, 0x8616, 0x4ffa, 0x513c, 0x56b4, 0x5944,
0x63a9, 0x6df9, 0x5daa, 0x696d, 0x5186, 0x4e88, 0x4f59, 0xf97f,
0xf980, 0xf981, 0x5982, 0xf982, 0xf983, 0x6b5f, 0x6c5d, 0xf984,
0x74b5, 0x7916, 0xf985, 0x8207, 0x8245, 0x8339, 0x8f3f, 0x8f5d,
0xf986, 0x9918, 0xf987, 0xf988, 0xf989, 0x4ea6, 0xf98a, 0x57df,
0x5f79, 0x6613, 0xf98b, 0xf98c, 0x75ab, 0x7e79, 0x8b6f, 0xf98d,
0x9006, 0x9a5b, 0x56a5, 0x5827, 0x59f8, 0x5a1f, 0x5bb4, 0xf98e,
0x5ef6, 0xf98f, 0xf990, 0x6350, 0x633b, 0xf991, 0x693d, 0x6c87,
0x6cbf, 0x6d8e, 0x6d93, 0x6df5, 0x6f14, 0xf992, 0x70df, 0x7136,
0x7159, 0xf993, 0x71c3, 0x71d5, 0xf994, 0x784f, 0x786f, 0xf995,
0x7b75, 0x7de3, 0xf996, 0x7e2f, 0xf997, 0x884d, 0x8edf, 0xf998,
0xf999, 0xf99a, 0x925b, 0xf99b, 0x9cf6, 0xf99c, 0xf99d, 0xf99e,
0x6085, 0x6d85, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xf99f, 0x71b1, 0xf9a0, 0xf9a1,
0x95b1, 0x53ad, 0xf9a2, 0xf9a3, 0xf9a4, 0x67d3, 0xf9a5, 0x708e,
0x7130, 0x7430, 0x8276, 0x82d2, 0xf9a6, 0x95bb, 0x9ae5, 0x9e7d,
0x66c4, 0xf9a7, 0x71c1, 0x8449, 0xf9a8, 0xf9a9, 0x584b, 0xf9aa,
0xf9ab, 0x5db8, 0x5f71, 0xf9ac, 0x6620, 0x668e, 0x6979, 0x69ae,
0x6c38, 0x6cf3, 0x6e36, 0x6f41, 0x6fda, 0x701b, 0x702f, 0x7150,
0x71df, 0x7370, 0xf9ad, 0x745b, 0xf9ae, 0x74d4, 0x76c8, 0x7a4e,
0x7e93, 0xf9af, 0xf9b0, 0x82f1, 0x8a60, 0x8fce, 0xf9b1, 0x9348,
0xf9b2, 0x9719, 0xf9b3, 0xf9b4, 0x4e42, 0x502a, 0xf9b5, 0x5208,
0x53e1, 0x66f3, 0x6c6d, 0x6fca, 0x730a, 0x777f, 0x7a62, 0x82ae,
0x85dd, 0x8602, 0xf9b6, 0x88d4, 0x8a63, 0x8b7d, 0x8c6b, 0xf9b7,
0x92b3, 0xf9b8, 0x9713, 0x9810, 0x4e94, 0x4f0d, 0x4fc9, 0x50b2,
0x5348, 0x543e, 0x5433, 0x55da, 0x5862, 0x58ba, 0x5967, 0x5a1b,
0x5be4, 0x609f, 0xf9b9, 0x61ca, 0x6556, 0x65ff, 0x6664, 0x68a7,
0x6c5a, 0x6fb3, 0x70cf, 0x71ac, 0x7352, 0x7b7d, 0x8708, 0x8aa4,
0x9c32, 0x9f07, 0x5c4b, 0x6c83, 0x7344, 0x7389, 0x923a, 0x6eab,
0x7465, 0x761f, 0x7a69, 0x7e15, 0x860a, 0x5140, 0x58c5, 0x64c1,
0x74ee, 0x7515, 0x7670, 0x7fc1, 0x9095, 0x96cd, 0x9954, 0x6e26,
0x74e6, 0x7aa9, 0x7aaa, 0x81e5, 0x86d9, 0x8778, 0x8a1b, 0x5a49,
0x5b8c, 0x5b9b, 0x68a1, 0x6900, 0x6d63, 0x73a9, 0x7413, 0x742c,
0x7897, 0x7de9, 0x7feb, 0x8118, 0x8155, 0x839e, 0x8c4c, 0x962e,
0x9811, 0x66f0, 0x5f80, 0x65fa, 0x6789, 0x6c6a, 0x738b, 0x502d,
0x5a03, 0x6b6a, 0x77ee, 0x5916, 0x5d6c, 0x5dcd, 0x7325, 0x754f,
0xf9ba, 0xf9bb, 0x50e5, 0x51f9, 0x582f, 0x592d, 0x5996, 0x59da,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x5be5, 0xf9bc, 0xf9bd, 0x5da2, 0x62d7, 0x6416,
0x6493, 0x64fe, 0xf9be, 0x66dc, 0xf9bf, 0x6a48, 0xf9c0, 0x71ff,
0x7464, 0xf9c1, 0x7a88, 0x7aaf, 0x7e47, 0x7e5e, 0x8000, 0x8170,
0xf9c2, 0x87ef, 0x8981, 0x8b20, 0x9059, 0xf9c3, 0x9080, 0x9952,
0x617e, 0x6b32, 0x6d74, 0x7e1f, 0x8925, 0x8fb1, 0x4fd1, 0x50ad,
0x5197, 0x52c7, 0x57c7, 0x5889, 0x5bb9, 0x5eb8, 0x6142, 0x6995,
0x6d8c, 0x6e67, 0x6eb6, 0x7194, 0x7462, 0x7528, 0x752c, 0x8073,
0x8338, 0x84c9, 0x8e0a, 0x9394, 0x93de, 0xf9c4, 0x4e8e, 0x4f51,
0x5076, 0x512a, 0x53c8, 0x53cb, 0x53f3, 0x5b87, 0x5bd3, 0x5c24,
0x611a, 0x6182, 0x65f4, 0x725b, 0x7397, 0x7440, 0x76c2, 0x7950,
0x7991, 0x79b9, 0x7d06, 0x7fbd, 0x828b, 0x85d5, 0x865e, 0x8fc2,
0x9047, 0x90f5, 0x91ea, 0x9685, 0x96e8, 0x96e9, 0x52d6, 0x5f67,
0x65ed, 0x6631, 0x682f, 0x715c, 0x7a36, 0x90c1, 0x980a, 0x4e91,
0xf9c5, 0x6a52, 0x6b9e, 0x6f90, 0x7189, 0x8018, 0x82b8, 0x8553,
0x904b, 0x9695, 0x96f2, 0x97fb, 0x851a, 0x9b31, 0x4e90, 0x718a,
0x96c4, 0x5143, 0x539f, 0x54e1, 0x5713, 0x5712, 0x57a3, 0x5a9b,
0x5ac4, 0x5bc3, 0x6028, 0x613f, 0x63f4, 0x6c85, 0x6d39, 0x6e72,
0x6e90, 0x7230, 0x733f, 0x7457, 0x82d1, 0x8881, 0x8f45, 0x9060,
0xf9c6, 0x9662, 0x9858, 0x9d1b, 0x6708, 0x8d8a, 0x925e, 0x4f4d,
0x5049, 0x50de, 0x5371, 0x570d, 0x59d4, 0x5a01, 0x5c09, 0x6170,
0x6690, 0x6e2d, 0x7232, 0x744b, 0x7def, 0x80c3, 0x840e, 0x8466,
0x853f, 0x875f, 0x885b, 0x8918, 0x8b02, 0x9055, 0x97cb, 0x9b4f,
0x4e73, 0x4f91, 0x5112, 0x516a, 0xf9c7, 0x552f, 0x55a9, 0x5b7a,
0x5ba5, 0x5e7c, 0x5e7d, 0x5ebe, 0x60a0, 0x60df, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x6108, 0x6109, 0x63c4, 0x6538, 0x6709, 0xf9c8, 0x67d4, 0x67da,
0xf9c9, 0x6961, 0x6962, 0x6cb9, 0x6d27, 0xf9ca, 0x6e38, 0xf9cb,
0x6fe1, 0x7336, 0x7337, 0xf9cc, 0x745c, 0x7531, 0xf9cd, 0x7652,
0xf9ce, 0xf9cf, 0x7dad, 0x81fe, 0x8438, 0x88d5, 0x8a98, 0x8adb,
0x8aed, 0x8e30, 0x8e42, 0x904a, 0x903e, 0x907a, 0x9149, 0x91c9,
0x936e, 0xf9d0, 0xf9d1, 0x5809, 0xf9d2, 0x6bd3, 0x8089, 0x80b2,
0xf9d3, 0xf9d4, 0x5141, 0x596b, 0x5c39, 0xf9d5, 0xf9d6, 0x6f64,
0x73a7, 0x80e4, 0x8d07, 0xf9d7, 0x9217, 0x958f, 0xf9d8, 0xf9d9,
0xf9da, 0xf9db, 0x807f, 0x620e, 0x701c, 0x7d68, 0x878d, 0xf9dc,
0x57a0, 0x6069, 0x6147, 0x6bb7, 0x8abe, 0x9280, 0x96b1, 0x4e59,
0x541f, 0x6deb, 0x852d, 0x9670, 0x97f3, 0x98ee, 0x63d6, 0x6ce3,
0x9091, 0x51dd, 0x61c9, 0x81ba, 0x9df9, 0x4f9d, 0x501a, 0x5100,
0x5b9c, 0x610f, 0x61ff, 0x64ec, 0x6905, 0x6bc5, 0x7591, 0x77e3,
0x7fa9, 0x8264, 0x858f, 0x87fb, 0x8863, 0x8abc, 0x8b70, 0x91ab,
0x4e8c, 0x4ee5, 0x4f0a, 0xf9dd, 0xf9de, 0x5937, 0x59e8, 0xf9df,
0x5df2, 0x5f1b, 0x5f5b, 0x6021, 0xf9e0, 0xf9e1, 0xf9e2, 0xf9e3,
0x723e, 0x73e5, 0xf9e4, 0x7570, 0x75cd, 0xf9e5, 0x79fb, 0xf9e6,
0x800c, 0x8033, 0x8084, 0x82e1, 0x8351, 0xf9e7, 0xf9e8, 0x8cbd,
0x8cb3, 0x9087, 0xf9e9, 0xf9ea, 0x98f4, 0x990c, 0xf9eb, 0xf9ec,
0x7037, 0x76ca, 0x7fca, 0x7fcc, 0x7ffc, 0x8b1a, 0x4eba, 0x4ec1,
0x5203, 0x5370, 0xf9ed, 0x54bd, 0x56e0, 0x59fb, 0x5bc5, 0x5f15,
0x5fcd, 0x6e6e, 0xf9ee, 0xf9ef, 0x7d6a, 0x8335, 0xf9f0, 0x8693,
0x8a8d, 0xf9f1, 0x976d, 0x9777, 0xf9f2, 0xf9f3, 0x4e00, 0x4f5a,
0x4f7e, 0x58f9, 0x65e5, 0x6ea2, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x9038, 0x93b0,
0x99b9, 0x4efb, 0x58ec, 0x598a, 0x59d9, 0x6041, 0xf9f4, 0xf9f5,
0x7a14, 0xf9f6, 0x834f, 0x8cc3, 0x5165, 0x5344, 0xf9f7, 0xf9f8,
0xf9f9, 0x4ecd, 0x5269, 0x5b55, 0x82bf, 0x4ed4, 0x523a, 0x54a8,
0x59c9, 0x59ff, 0x5b50, 0x5b57, 0x5b5c, 0x6063, 0x6148, 0x6ecb,
0x7099, 0x716e, 0x7386, 0x74f7, 0x75b5, 0x78c1, 0x7d2b, 0x8005,
0x81ea, 0x8328, 0x8517, 0x85c9, 0x8aee, 0x8cc7, 0x96cc, 0x4f5c,
0x52fa, 0x56bc, 0x65ab, 0x6628, 0x707c, 0x70b8, 0x7235, 0x7dbd,
0x828d, 0x914c, 0x96c0, 0x9d72, 0x5b71, 0x68e7, 0x6b98, 0x6f7a,
0x76de, 0x5c91, 0x66ab, 0x6f5b, 0x7bb4, 0x7c2a, 0x8836, 0x96dc,
0x4e08, 0x4ed7, 0x5320, 0x5834, 0x58bb, 0x58ef, 0x596c, 0x5c07,
0x5e33, 0x5e84, 0x5f35, 0x638c, 0x66b2, 0x6756, 0x6a1f, 0x6aa3,
0x6b0c, 0x6f3f, 0x7246, 0xf9fa, 0x7350, 0x748b, 0x7ae0, 0x7ca7,
0x8178, 0x81df, 0x81e7, 0x838a, 0x846c, 0x8523, 0x8594, 0x85cf,
0x88dd, 0x8d13, 0x91ac, 0x9577, 0x969c, 0x518d, 0x54c9, 0x5728,
0x5bb0, 0x624d, 0x6750, 0x683d, 0x6893, 0x6e3d, 0x6ed3, 0x707d,
0x7e21, 0x88c1, 0x8ca1, 0x8f09, 0x9f4b, 0x9f4e, 0x722d, 0x7b8f,
0x8acd, 0x931a, 0x4f47, 0x4f4e, 0x5132, 0x5480, 0x59d0, 0x5e95,
0x62b5, 0x6775, 0x696e, 0x6a17, 0x6cae, 0x6e1a, 0x72d9, 0x732a,
0x75bd, 0x7bb8, 0x7d35, 0x82e7, 0x83f9, 0x8457, 0x85f7, 0x8a5b,
0x8caf, 0x8e87, 0x9019, 0x90b8, 0x96ce, 0x9f5f, 0x52e3, 0x540a,
0x5ae1, 0x5bc2, 0x6458, 0x6575, 0x6ef4, 0x72c4, 0xf9fb, 0x7684,
0x7a4d, 0x7b1b, 0x7c4d, 0x7e3e, 0x7fdf, 0x837b, 0x8b2b, 0x8cca,
0x8d64, 0x8de1, 0x8e5f, 0x8fea, 0x8ff9, 0x9069, 0x93d1, 0x4f43,
0x4f7a, 0x50b3, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x5168, 0x5178, 0x524d, 0x526a,
0x5861, 0x587c, 0x5960, 0x5c08, 0x5c55, 0x5edb, 0x609b, 0x6230,
0x6813, 0x6bbf, 0x6c08, 0x6fb1, 0x714e, 0x7420, 0x7530, 0x7538,
0x7551, 0x7672, 0x7b4c, 0x7b8b, 0x7bad, 0x7bc6, 0x7e8f, 0x8a6e,
0x8f3e, 0x8f49, 0x923f, 0x9293, 0x9322, 0x942b, 0x96fb, 0x985a,
0x986b, 0x991e, 0x5207, 0x622a, 0x6298, 0x6d59, 0x7664, 0x7aca,
0x7bc0, 0x7d76, 0x5360, 0x5cbe, 0x5e97, 0x6f38, 0x70b9, 0x7c98,
0x9711, 0x9b8e, 0x9ede, 0x63a5, 0x647a, 0x8776, 0x4e01, 0x4e95,
0x4ead, 0x505c, 0x5075, 0x5448, 0x59c3, 0x5b9a, 0x5e40, 0x5ead,
0x5ef7, 0x5f81, 0x60c5, 0x633a, 0x653f, 0x6574, 0x65cc, 0x6676,
0x6678, 0x67fe, 0x6968, 0x6a89, 0x6b63, 0x6c40, 0x6dc0, 0x6de8,
0x6e1f, 0x6e5e, 0x701e, 0x70a1, 0x738e, 0x73fd, 0x753a, 0x775b,
0x7887, 0x798e, 0x7a0b, 0x7a7d, 0x7cbe, 0x7d8e, 0x8247, 0x8a02,
0x8aea, 0x8c9e, 0x912d, 0x914a, 0x91d8, 0x9266, 0x92cc, 0x9320,
0x9706, 0x9756, 0x975c, 0x9802, 0x9f0e, 0x5236, 0x5291, 0x557c,
0x5824, 0x5e1d, 0x5f1f, 0x608c, 0x63d0, 0x68af, 0x6fdf, 0x796d,
0x7b2c, 0x81cd, 0x85ba, 0x88fd, 0x8af8, 0x8e44, 0x918d, 0x9664,
0x969b, 0x973d, 0x984c, 0x9f4a, 0x4fce, 0x5146, 0x51cb, 0x52a9,
0x5632, 0x5f14, 0x5f6b, 0x63aa, 0x64cd, 0x65e9, 0x6641, 0x66fa,
0x66f9, 0x671d, 0x689d, 0x68d7, 0x69fd, 0x6f15, 0x6f6e, 0x7167,
0x71e5, 0x722a, 0x74aa, 0x773a, 0x7956, 0x795a, 0x79df, 0x7a20,
0x7a95, 0x7c97, 0x7cdf, 0x7d44, 0x7e70, 0x8087, 0x85fb, 0x86a4,
0x8a54, 0x8abf, 0x8d99, 0x8e81, 0x9020, 0x906d, 0x91e3, 0x963b,
0x96d5, 0x9ce5, 0x65cf, 0x7c07, 0x8db3, 0x93c3, 0x5b58, 0x5c0a,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x5352, 0x62d9, 0x731d, 0x5027, 0x5b97, 0x5f9e,
0x60b0, 0x616b, 0x68d5, 0x6dd9, 0x742e, 0x7a2e, 0x7d42, 0x7d9c,
0x7e31, 0x816b, 0x8e2a, 0x8e35, 0x937e, 0x9418, 0x4f50, 0x5750,
0x5de6, 0x5ea7, 0x632b, 0x7f6a, 0x4e3b, 0x4f4f, 0x4f8f, 0x505a,
0x59dd, 0x80c4, 0x546a, 0x5468, 0x55fe, 0x594f, 0x5b99, 0x5dde,
0x5eda, 0x665d, 0x6731, 0x67f1, 0x682a, 0x6ce8, 0x6d32, 0x6e4a,
0x6f8d, 0x70b7, 0x73e0, 0x7587, 0x7c4c, 0x7d02, 0x7d2c, 0x7da2,
0x821f, 0x86db, 0x8a3b, 0x8a85, 0x8d70, 0x8e8a, 0x8f33, 0x9031,
0x914e, 0x9152, 0x9444, 0x99d0, 0x7af9, 0x7ca5, 0x4fca, 0x5101,
0x51c6, 0x57c8, 0x5bef, 0x5cfb, 0x6659, 0x6a3d, 0x6d5a, 0x6e96,
0x6fec, 0x710c, 0x756f, 0x7ae3, 0x8822, 0x9021, 0x9075, 0x96cb,
0x99ff, 0x8301, 0x4e2d, 0x4ef2, 0x8846, 0x91cd, 0x537d, 0x6adb,
0x696b, 0x6c41, 0x847a, 0x589e, 0x618e, 0x66fe, 0x62ef, 0x70dd,
0x7511, 0x75c7, 0x7e52, 0x84b8, 0x8b49, 0x8d08, 0x4e4b, 0x53ea,
0x54ab, 0x5730, 0x5740, 0x5fd7, 0x6301, 0x6307, 0x646f, 0x652f,
0x65e8, 0x667a, 0x679d, 0x67b3, 0x6b62, 0x6c60, 0x6c9a, 0x6f2c,
0x77e5, 0x7825, 0x7949, 0x7957, 0x7d19, 0x80a2, 0x8102, 0x81f3,
0x829d, 0x82b7, 0x8718, 0x8a8c, 0xf9fc, 0x8d04, 0x8dbe, 0x9072,
0x76f4, 0x7a19, 0x7a37, 0x7e54, 0x8077, 0x5507, 0x55d4, 0x5875,
0x632f, 0x6422, 0x6649, 0x664b, 0x686d, 0x699b, 0x6b84, 0x6d25,
0x6eb1, 0x73cd, 0x7468, 0x74a1, 0x755b, 0x75b9, 0x76e1, 0x771e,
0x778b, 0x79e6, 0x7e09, 0x7e1d, 0x81fb, 0x852f, 0x8897, 0x8a3a,
0x8cd1, 0x8eeb, 0x8fb0, 0x9032, 0x93ad, 0x9663, 0x9673, 0x9707,
0x4f84, 0x53f1, 0x59ea, 0x5ac9, 0x5e19, 0x684e, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x74c6, 0x75be, 0x79e9, 0x7a92, 0x81a3, 0x86ed, 0x8cea, 0x8dcc,
0x8fed, 0x659f, 0x6715, 0xf9fd, 0x57f7, 0x6f57, 0x7ddd, 0x8f2f,
0x93f6, 0x96c6, 0x5fb5, 0x61f2, 0x6f84, 0x4e14, 0x4f98, 0x501f,
0x53c9, 0x55df, 0x5d6f, 0x5dee, 0x6b21, 0x6b64, 0x78cb, 0x7b9a,
0xf9fe, 0x8e49, 0x8eca, 0x906e, 0x6349, 0x643e, 0x7740, 0x7a84,
0x932f, 0x947f, 0x9f6a, 0x64b0, 0x6faf, 0x71e6, 0x74a8, 0x74da,
0x7ac4, 0x7c12, 0x7e82, 0x7cb2, 0x7e98, 0x8b9a, 0x8d0a, 0x947d,
0x9910, 0x994c, 0x5239, 0x5bdf, 0x64e6, 0x672d, 0x7d2e, 0x50ed,
0x53c3, 0x5879, 0x6158, 0x6159, 0x61fa, 0x65ac, 0x7ad9, 0x8b92,
0x8b96, 0x5009, 0x5021, 0x5275, 0x5531, 0x5a3c, 0x5ee0, 0x5f70,
0x6134, 0x655e, 0x660c, 0x6636, 0x66a2, 0x69cd, 0x6ec4, 0x6f32,
0x7316, 0x7621, 0x7a93, 0x8139, 0x8259, 0x83d6, 0x84bc, 0x50b5,
0x57f0, 0x5bc0, 0x5be8, 0x5f69, 0x63a1, 0x7826, 0x7db5, 0x83dc,
0x8521, 0x91c7, 0x91f5, 0x518a, 0x67f5, 0x7b56, 0x8cac, 0x51c4,
0x59bb, 0x60bd, 0x8655, 0x501c, 0xf9ff, 0x5254, 0x5c3a, 0x617d,
0x621a, 0x62d3, 0x64f2, 0x65a5, 0x6ecc, 0x7620, 0x810a, 0x8e60,
0x965f, 0x96bb, 0x4edf, 0x5343, 0x5598, 0x5929, 0x5ddd, 0x64c5,
0x6cc9, 0x6dfa, 0x7394, 0x7a7f, 0x821b, 0x85a6, 0x8ce4, 0x8e10,
0x9077, 0x91e7, 0x95e1, 0x9621, 0x97c6, 0x51f8, 0x54f2, 0x5586,
0x5fb9, 0x64a4, 0x6f88, 0x7db4, 0x8f1f, 0x8f4d, 0x9435, 0x50c9,
0x5c16, 0x6cbe, 0x6dfb, 0x751b, 0x77bb, 0x7c3d, 0x7c64, 0x8a79,
0x8ac2, 0x581e, 0x59be, 0x5e16, 0x6377, 0x7252, 0x758a, 0x776b,
0x8adc, 0x8cbc, 0x8f12, 0x5ef3, 0x6674, 0x6df8, 0x807d, 0x83c1,
0x8acb, 0x9751, 0x9bd6, 0xfa00, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x5243, 0x66ff,
0x6d95, 0x6eef, 0x7de0, 0x8ae6, 0x902e, 0x905e, 0x9ad4, 0x521d,
0x527f, 0x54e8, 0x6194, 0x6284, 0x62db, 0x68a2, 0x6912, 0x695a,
0x6a35, 0x7092, 0x7126, 0x785d, 0x7901, 0x790e, 0x79d2, 0x7a0d,
0x8096, 0x8278, 0x82d5, 0x8349, 0x8549, 0x8c82, 0x8d85, 0x9162,
0x918b, 0x91ae, 0x4fc3, 0x56d1, 0x71ed, 0x77d7, 0x8700, 0x89f8,
0x5bf8, 0x5fd6, 0x6751, 0x90a8, 0x53e2, 0x585a, 0x5bf5, 0x60a4,
0x6181, 0x6460, 0x7e3d, 0x8070, 0x8525, 0x9283, 0x64ae, 0x50ac,
0x5d14, 0x6700, 0x589c, 0x62bd, 0x63a8, 0x690e, 0x6978, 0x6a1e,
0x6e6b, 0x76ba, 0x79cb, 0x82bb, 0x8429, 0x8acf, 0x8da8, 0x8ffd,
0x9112, 0x914b, 0x919c, 0x9310, 0x9318, 0x939a, 0x96db, 0x9a36,
0x9c0d, 0x4e11, 0x755c, 0x795d, 0x7afa, 0x7b51, 0x7bc9, 0x7e2e,
0x84c4, 0x8e59, 0x8e74, 0x8ef8, 0x9010, 0x6625, 0x693f, 0x7443,
0x51fa, 0x672e, 0x9edc, 0x5145, 0x5fe0, 0x6c96, 0x87f2, 0x885d,
0x8877, 0x60b4, 0x81b5, 0x8403, 0x8d05, 0x53d6, 0x5439, 0x5634,
0x5a36, 0x5c31, 0x708a, 0x7fe0, 0x805a, 0x8106, 0x81ed, 0x8da3,
0x9189, 0x9a5f, 0x9df2, 0x5074, 0x4ec4, 0x53a0, 0x60fb, 0x6e2c,
0x5c64, 0x4f88, 0x5024, 0x55e4, 0x5cd9, 0x5e5f, 0x6065, 0x6894,
0x6cbb, 0x6dc4, 0x71be, 0x75d4, 0x75f4, 0x7661, 0x7a1a, 0x7a49,
0x7dc7, 0x7dfb, 0x7f6e, 0x81f4, 0x86a9, 0x8f1c, 0x96c9, 0x99b3,
0x9f52, 0x5247, 0x52c5, 0x98ed, 0x89aa, 0x4e03, 0x67d2, 0x6f06,
0x4fb5, 0x5be2, 0x6795, 0x6c88, 0x6d78, 0x741b, 0x7827, 0x91dd,
0x937c, 0x87c4, 0x79e4, 0x7a31, 0x5feb, 0x4ed6, 0x54a4, 0x553e,
0x58ae, 0x59a5, 0x60f0, 0x6253, 0x62d6, 0x6736, 0x6955, 0x8235,
0x9640, 0x99b1, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x99dd, 0x502c, 0x5353, 0x5544,
0x577c, 0xfa01, 0x6258, 0xfa02, 0x64e2, 0x666b, 0x67dd, 0x6fc1,
0x6fef, 0x7422, 0x7438, 0x8a17, 0x9438, 0x5451, 0x5606, 0x5766,
0x5f48, 0x619a, 0x6b4e, 0x7058, 0x70ad, 0x7dbb, 0x8a95, 0x596a,
0x812b, 0x63a2, 0x7708, 0x803d, 0x8caa, 0x5854, 0x642d, 0x69bb,
0x5b95, 0x5e11, 0x6e6f, 0xfa03, 0x8569, 0x514c, 0x53f0, 0x592a,
0x6020, 0x614b, 0x6b86, 0x6c70, 0x6cf0, 0x7b1e, 0x80ce, 0x82d4,
0x8dc6, 0x90b0, 0x98b1, 0xfa04, 0x64c7, 0x6fa4, 0x6491, 0x6504,
0x514e, 0x5410, 0x571f, 0x8a0e, 0x615f, 0x6876, 0xfa05, 0x75db,
0x7b52, 0x7d71, 0x901a, 0x5806, 0x69cc, 0x817f, 0x892a, 0x9000,
0x9839, 0x5078, 0x5957, 0x59ac, 0x6295, 0x900f, 0x9b2a, 0x615d,
0x7279, 0x95d6, 0x5761, 0x5a46, 0x5df4, 0x628a, 0x64ad, 0x64fa,
0x6777, 0x6ce2, 0x6d3e, 0x722c, 0x7436, 0x7834, 0x7f77, 0x82ad,
0x8ddb, 0x9817, 0x5224, 0x5742, 0x677f, 0x7248, 0x74e3, 0x8ca9,
0x8fa6, 0x9211, 0x962a, 0x516b, 0x53ed, 0x634c, 0x4f69, 0x5504,
0x6096, 0x6557, 0x6c9b, 0x6d7f, 0x724c, 0x72fd, 0x7a17, 0x8987,
0x8c9d, 0x5f6d, 0x6f8e, 0x70f9, 0x81a8, 0x610e, 0x4fbf, 0x504f,
0x6241, 0x7247, 0x7bc7, 0x7de8, 0x7fe9, 0x904d, 0x97ad, 0x9a19,
0x8cb6, 0x576a, 0x5e73, 0x67b0, 0x840d, 0x8a55, 0x5420, 0x5b16,
0x5e63, 0x5ee2, 0x5f0a, 0x6583, 0x80ba, 0x853d, 0x9589, 0x965b,
0x4f48, 0x5305, 0x530d, 0x530f, 0x5486, 0x54fa, 0x5703, 0x5e03,
0x6016, 0x629b, 0x62b1, 0x6355, 0xfa06, 0x6ce1, 0x6d66, 0x75b1,
0x7832, 0x80de, 0x812f, 0x82de, 0x8461, 0x84b2, 0x888d, 0x8912,
0x900b, 0x92ea, 0x98fd, 0x9b91, 0x5e45, 0x66b4, 0x66dd, 0x7011,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0x7206, 0xfa07, 0x4ff5, 0x527d, 0x5f6a, 0x6153,
0x6753, 0x6a19, 0x6f02, 0x74e2, 0x7968, 0x8868, 0x8c79, 0x98c7,
0x98c4, 0x9a43, 0x54c1, 0x7a1f, 0x6953, 0x8af7, 0x8c4a, 0x98a8,
0x99ae, 0x5f7c, 0x62ab, 0x75b2, 0x76ae, 0x88ab, 0x907f, 0x9642,
0x5339, 0x5f3c, 0x5fc5, 0x6ccc, 0x73cc, 0x7562, 0x758b, 0x7b46,
0x82fe, 0x999d, 0x4e4f, 0x903c, 0x4e0b, 0x4f55, 0x53a6, 0x590f,
0x5ec8, 0x6630, 0x6cb3, 0x7455, 0x8377, 0x8766, 0x8cc0, 0x9050,
0x971e, 0x9c15, 0x58d1, 0x5b78, 0x8650, 0x8b14, 0x9db4, 0x5bd2,
0x6068, 0x608d, 0x65f1, 0x6c57, 0x6f22, 0x6fa3, 0x701a, 0x7f55,
0x7ff0, 0x9591, 0x9592, 0x9650, 0x97d3, 0x5272, 0x8f44, 0x51fd,
0x542b, 0x54b8, 0x5563, 0x558a, 0x6abb, 0x6db5, 0x7dd8, 0x8266,
0x929c, 0x9677, 0x9e79, 0x5408, 0x54c8, 0x76d2, 0x86e4, 0x95a4,
0x95d4, 0x965c, 0x4ea2, 0x4f09, 0x59ee, 0x5ae6, 0x5df7, 0x6052,
0x6297, 0x676d, 0x6841, 0x6c86, 0x6e2f, 0x7f38, 0x809b, 0x822a,
0xfa08, 0xfa09, 0x9805, 0x4ea5, 0x5055, 0x54b3, 0x5793, 0x595a,
0x5b69, 0x5bb3, 0x61c8, 0x6977, 0x6d77, 0x7023, 0x87f9, 0x89e3,
0x8a72, 0x8ae7, 0x9082, 0x99ed, 0x9ab8, 0x52be, 0x6838, 0x5016,
0x5e78, 0x674f, 0x8347, 0x884c, 0x4eab, 0x5411, 0x56ae, 0x73e6,
0x9115, 0x97ff, 0x9909, 0x9957, 0x9999, 0x5653, 0x589f, 0x865b,
0x8a31, 0x61b2, 0x6af6, 0x737b, 0x8ed2, 0x6b47, 0x96aa, 0x9a57,
0x5955, 0x7200, 0x8d6b, 0x9769, 0x4fd4, 0x5cf4, 0x5f26, 0x61f8,
0x665b, 0x6ceb, 0x70ab, 0x7384, 0x73b9, 0x73fe, 0x7729, 0x774d,
0x7d43, 0x7d62, 0x7e23, 0x8237, 0x8852, 0xfa0a, 0x8ce2, 0x9249,
0x986f, 0x5b51, 0x7a74, 0x8840, 0x9801, 0x5acc, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0x4fe0, 0x5354, 0x593e, 0x5cfd, 0x633e, 0x6d79, 0x72f9, 0x8105,
0x8107, 0x83a2, 0x92cf, 0x9830, 0x4ea8, 0x5144, 0x5211, 0x578b,
0x5f62, 0x6cc2, 0x6ece, 0x7005, 0x7050, 0x70af, 0x7192, 0x73e9,
0x7469, 0x834a, 0x87a2, 0x8861, 0x9008, 0x90a2, 0x93a3, 0x99a8,
0x516e, 0x5f57, 0x60e0, 0x6167, 0x66b3, 0x8559, 0x8e4a, 0x91af,
0x978b, 0x4e4e, 0x4e92, 0x547c, 0x58d5, 0x58fa, 0x597d, 0x5cb5,
0x5f27, 0x6236, 0x6248, 0x660a, 0x6667, 0x6beb, 0x6d69, 0x6dcf,
0x6e56, 0x6ef8, 0x6f94, 0x6fe0, 0x6fe9, 0x705d, 0x72d0, 0x7425,
0x745a, 0x74e0, 0x7693, 0x795c, 0x7cca, 0x7e1e, 0x80e1, 0x82a6,
0x846b, 0x84bf, 0x864e, 0x865f, 0x8774, 0x8b77, 0x8c6a, 0x93ac,
0x9800, 0x9865, 0x60d1, 0x6216, 0x9177, 0x5a5a, 0x660f, 0x6df7,
0x6e3e, 0x743f, 0x9b42, 0x5ffd, 0x60da, 0x7b0f, 0x54c4, 0x5f18,
0x6c5e, 0x6cd3, 0x6d2a, 0x70d8, 0x7d05, 0x8679, 0x8a0c, 0x9d3b,
0x5316, 0x548c, 0x5b05, 0x6a3a, 0x706b, 0x7575, 0x798d, 0x79be,
0x82b1, 0x83ef, 0x8a71, 0x8b41, 0x8ca8, 0x9774, 0xfa0b, 0x64f4,
0x652b, 0x78ba, 0x78bb, 0x7a6b, 0x4e38, 0x559a, 0x5950, 0x5ba6,
0x5e7b, 0x60a3, 0x63db, 0x6b61, 0x6665, 0x6853, 0x6e19, 0x7165,
0x74b0, 0x7d08, 0x9084, 0x9a69, 0x9c25, 0x6d3b, 0x6ed1, 0x733e,
0x8c41, 0x95ca, 0x51f0, 0x5e4c, 0x5fa8, 0x604d, 0x60f6, 0x6130,
0x614c, 0x6643, 0x6644, 0x69a5, 0x6cc1, 0x6e5f, 0x6ec9, 0x6f62,
0x714c, 0x749c, 0x7687, 0x7bc1, 0x7c27, 0x8352, 0x8757, 0x9051,
0x968d, 0x9ec3, 0x532f, 0x56de, 0x5efb, 0x5f8a, 0x6062, 0x6094,
0x61f7, 0x6666, 0x6703, 0x6a9c, 0x6dee, 0x6fae, 0x7070, 0x736a,
0x7e6a, 0x81be, 0x8334, 0x86d4, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd,
0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0xfffd, 0x8aa8, 0x8cc4,
0x5283, 0x7372, 0x5b96, 0x6a6b, 0x9404, 0x54ee, 0x5686, 0x5b5d,
0x6548, 0x6585, 0x66c9, 0x689f, 0x6d8d, 0x6dc6, 0x723b, 0x80b4,
0x9175, 0x9a4d, 0x4faf, 0x5019, 0x539a, 0x540e, 0x543c, 0x5589,
0x55c5, 0x5e3f, 0x5f8c, 0x673d, 0x7166, 0x73dd, 0x9005, 0x52db,
0x52f3, 0x5864, 0x58ce, 0x7104, 0x718f, 0x71fb, 0x85b0, 0x8a13,
0x6688, 0x85a8, 0x55a7, 0x6684, 0x714a, 0x8431, 0x5349, 0x5599,
0x6bc1, 0x5f59, 0x5fbd, 0x63ee, 0x6689, 0x7147, 0x8af1, 0x8f1d,
0x9ebe, 0x4f11, 0x643a, 0x70cb, 0x7566, 0x8667, 0x6064, 0x8b4e,
0x9df8, 0x5147, 0x51f6, 0x5308, 0x6d36, 0x80f8, 0x9ed1, 0x6615,
0x6b23, 0x7098, 0x75d5, 0x5403, 0x5c79, 0x7d07, 0x8a16, 0x6b20,
0x6b3d, 0x6b46, 0x5438, 0x6070, 0x6d3d, 0x7fd5, 0x8208, 0x50d6,
0x51de, 0x559c, 0x566b, 0x56cd, 0x59ec, 0x5b09, 0x5e0c, 0x6199,
0x6198, 0x6231, 0x665e, 0x66e6, 0x7199, 0x71b9, 0x71ba, 0x72a7,
0x79a7, 0x7a00, 0x7fb2, 0x8a70,
};
/*
* JohabtoUCS : ksc5601_1992_mbtowc
*/
static int
ksc5601_1992_mbtowc(conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
{
unsigned char c1 = s[0];
if ((c1 >= 0x88 && c1 <= 0xd3) || (c1 >= 0xd8 && c1 <= 0xde) || (c1 >= 0xe0 && c1 <= 0xf9)) {
/* Not handling Jamo characters with starting bytes of 0x84 to 0x87. */
if (n >= 2) {
unsigned short wc;
unsigned char c2 = s[1];
if ( c1 >= 0x88 && c1 <= 0xd3 &&
((c2 >= 0x41 && c2 <= 0x7e) || (c2 >= 0x81 && c2 <= 0xfd)) ) {
/* For hangul. */
wc = ksc5601_1992_hangul[ GETID(c1, c2, FIRST1) - (0x43)*(c1-0x88)];
if (wc != UNICODE_REPLACEMENT_CHAR) {
*pwc = (ucs4_t) wc;
return 2;
}
} else if ( c1 >= 0xd8 && c1 <= 0xde &&
( (c2 >=0x31 && c2<=0x7e) || (c2 >=0x91 && c2<=0xfe)) ) {
wc = ksc5601_1992_user[GETID(c1, c2, FIRST2) - 0x32 * (c1-0xd8)];
if (wc != UNICODE_REPLACEMENT_CHAR) {
*pwc = (ucs4_t) wc;
return 2;
}
} else if ( c1 >= 0xe0 && c1 <= 0xf9 &&
( (c2 >=0x31 && c2<=0x7e) || (c2 >=0x91 && c2<=0xfe)) ) {
wc = ksc5601_1992_hanja[GETID(c1, c2, FIRST3) - 0x32 * (c1-0xe0)];
if (wc != UNICODE_REPLACEMENT_CHAR) {
*pwc = (ucs4_t) wc;
return 2;
}
} else
return RET_ILSEQ;
}
return RET_TOOFEW(0);
}
return RET_ILSEQ;
}
static const unsigned short ucs_hangul[HANG_NUM] = {
0x8861, 0x8862, 0x8863, 0x8864, 0x8865, 0x8866, 0x8867, 0x8868,
0x8869, 0x886a, 0x886b, 0x886c, 0x886d, 0x886e, 0x886f, 0x8870,
0x8871, 0x8873, 0x8874, 0x8875, 0x8876, 0x8877, 0x8878, 0x8879,
0x887a, 0x887b, 0x887c, 0x887d, 0x8881, 0x8882, 0x8883, 0x8884,
0x8885, 0x8886, 0x8887, 0x8888, 0x8889, 0x888a, 0x888b, 0x888c,
0x888d, 0x888e, 0x888f, 0x8890, 0x8891, 0x8893, 0x8894, 0x8895,
0x8896, 0x8897, 0x8898, 0x8899, 0x889a, 0x889b, 0x889c, 0x889d,
0x88a1, 0x88a2, 0x88a3, 0x88a4, 0x88a5, 0x88a6, 0x88a7, 0x88a8,
0x88a9, 0x88aa, 0x88ab, 0x88ac, 0x88ad, 0x88ae, 0x88af, 0x88b0,
0x88b1, 0x88b3, 0x88b4, 0x88b5, 0x88b6, 0x88b7, 0x88b8, 0x88b9,
0x88ba, 0x88bb, 0x88bc, 0x88bd, 0x88c1, 0x88c2, 0x88c3, 0x88c4,
0x88c5, 0x88c6, 0x88c7, 0x88c8, 0x88c9, 0x88ca, 0x88cb, 0x88cc,
0x88cd, 0x88ce, 0x88cf, 0x88d0, 0x88d1, 0x88d3, 0x88d4, 0x88d5,
0x88d6, 0x88d7, 0x88d8, 0x88d9, 0x88da, 0x88db, 0x88dc, 0x88dd,
0x88e1, 0x88e2, 0x88e3, 0x88e4, 0x88e5, 0x88e6, 0x88e7, 0x88e8,
0x88e9, 0x88ea, 0x88eb, 0x88ec, 0x88ed, 0x88ee, 0x88ef, 0x88f0,
0x88f1, 0x88f3, 0x88f4, 0x88f5, 0x88f6, 0x88f7, 0x88f8, 0x88f9,
0x88fa, 0x88fb, 0x88fc, 0x88fd, 0x8941, 0x8942, 0x8943, 0x8944,
0x8945, 0x8946, 0x8947, 0x8948, 0x8949, 0x894a, 0x894b, 0x894c,
0x894d, 0x894e, 0x894f, 0x8950, 0x8951, 0x8953, 0x8954, 0x8955,
0x8956, 0x8957, 0x8958, 0x8959, 0x895a, 0x895b, 0x895c, 0x895d,
0x8961, 0x8962, 0x8963, 0x8964, 0x8965, 0x8966, 0x8967, 0x8968,
0x8969, 0x896a, 0x896b, 0x896c, 0x896d, 0x896e, 0x896f, 0x8970,
0x8971, 0x8973, 0x8974, 0x8975, 0x8976, 0x8977, 0x8978, 0x8979,
0x897a, 0x897b, 0x897c, 0x897d, 0x8981, 0x8982, 0x8983, 0x8984,
0x8985, 0x8986, 0x8987, 0x8988, 0x8989, 0x898a, 0x898b, 0x898c,
0x898d, 0x898e, 0x898f, 0x8990, 0x8991, 0x8993, 0x8994, 0x8995,
0x8996, 0x8997, 0x8998, 0x8999, 0x899a, 0x899b, 0x899c, 0x899d,
0x89a1, 0x89a2, 0x89a3, 0x89a4, 0x89a5, 0x89a6, 0x89a7, 0x89a8,
0x89a9, 0x89aa, 0x89ab, 0x89ac, 0x89ad, 0x89ae, 0x89af, 0x89b0,
0x89b1, 0x89b3, 0x89b4, 0x89b5, 0x89b6, 0x89b7, 0x89b8, 0x89b9,
0x89ba, 0x89bb, 0x89bc, 0x89bd, 0x89c1, 0x89c2, 0x89c3, 0x89c4,
0x89c5, 0x89c6, 0x89c7, 0x89c8, 0x89c9, 0x89ca, 0x89cb, 0x89cc,
0x89cd, 0x89ce, 0x89cf, 0x89d0, 0x89d1, 0x89d3, 0x89d4, 0x89d5,
0x89d6, 0x89d7, 0x89d8, 0x89d9, 0x89da, 0x89db, 0x89dc, 0x89dd,
0x89e1, 0x89e2, 0x89e3, 0x89e4, 0x89e5, 0x89e6, 0x89e7, 0x89e8,
0x89e9, 0x89ea, 0x89eb, 0x89ec, 0x89ed, 0x89ee, 0x89ef, 0x89f0,
0x89f1, 0x89f3, 0x89f4, 0x89f5, 0x89f6, 0x89f7, 0x89f8, 0x89f9,
0x89fa, 0x89fb, 0x89fc, 0x89fd, 0x8a41, 0x8a42, 0x8a43, 0x8a44,
0x8a45, 0x8a46, 0x8a47, 0x8a48, 0x8a49, 0x8a4a, 0x8a4b, 0x8a4c,
0x8a4d, 0x8a4e, 0x8a4f, 0x8a50, 0x8a51, 0x8a53, 0x8a54, 0x8a55,
0x8a56, 0x8a57, 0x8a58, 0x8a59, 0x8a5a, 0x8a5b, 0x8a5c, 0x8a5d,
0x8a61, 0x8a62, 0x8a63, 0x8a64, 0x8a65, 0x8a66, 0x8a67, 0x8a68,
0x8a69, 0x8a6a, 0x8a6b, 0x8a6c, 0x8a6d, 0x8a6e, 0x8a6f, 0x8a70,
0x8a71, 0x8a73, 0x8a74, 0x8a75, 0x8a76, 0x8a77, 0x8a78, 0x8a79,
0x8a7a, 0x8a7b, 0x8a7c, 0x8a7d, 0x8a81, 0x8a82, 0x8a83, 0x8a84,
0x8a85, 0x8a86, 0x8a87, 0x8a88, 0x8a89, 0x8a8a, 0x8a8b, 0x8a8c,
0x8a8d, 0x8a8e, 0x8a8f, 0x8a90, 0x8a91, 0x8a93, 0x8a94, 0x8a95,
0x8a96, 0x8a97, 0x8a98, 0x8a99, 0x8a9a, 0x8a9b, 0x8a9c, 0x8a9d,
0x8aa1, 0x8aa2, 0x8aa3, 0x8aa4, 0x8aa5, 0x8aa6, 0x8aa7, 0x8aa8,
0x8aa9, 0x8aaa, 0x8aab, 0x8aac, 0x8aad, 0x8aae, 0x8aaf, 0x8ab0,
0x8ab1, 0x8ab3, 0x8ab4, 0x8ab5, 0x8ab6, 0x8ab7, 0x8ab8, 0x8ab9,
0x8aba, 0x8abb, 0x8abc, 0x8abd, 0x8ac1, 0x8ac2, 0x8ac3, 0x8ac4,
0x8ac5, 0x8ac6, 0x8ac7, 0x8ac8, 0x8ac9, 0x8aca, 0x8acb, 0x8acc,
0x8acd, 0x8ace, 0x8acf, 0x8ad0, 0x8ad1, 0x8ad3, 0x8ad4, 0x8ad5,
0x8ad6, 0x8ad7, 0x8ad8, 0x8ad9, 0x8ada, 0x8adb, 0x8adc, 0x8add,
0x8ae1, 0x8ae2, 0x8ae3, 0x8ae4, 0x8ae5, 0x8ae6, 0x8ae7, 0x8ae8,
0x8ae9, 0x8aea, 0x8aeb, 0x8aec, 0x8aed, 0x8aee, 0x8aef, 0x8af0,
0x8af1, 0x8af3, 0x8af4, 0x8af5, 0x8af6, 0x8af7, 0x8af8, 0x8af9,
0x8afa, 0x8afb, 0x8afc, 0x8afd, 0x8b41, 0x8b42, 0x8b43, 0x8b44,
0x8b45, 0x8b46, 0x8b47, 0x8b48, 0x8b49, 0x8b4a, 0x8b4b, 0x8b4c,
0x8b4d, 0x8b4e, 0x8b4f, 0x8b50, 0x8b51, 0x8b53, 0x8b54, 0x8b55,
0x8b56, 0x8b57, 0x8b58, 0x8b59, 0x8b5a, 0x8b5b, 0x8b5c, 0x8b5d,
0x8b61, 0x8b62, 0x8b63, 0x8b64, 0x8b65, 0x8b66, 0x8b67, 0x8b68,
0x8b69, 0x8b6a, 0x8b6b, 0x8b6c, 0x8b6d, 0x8b6e, 0x8b6f, 0x8b70,
0x8b71, 0x8b73, 0x8b74, 0x8b75, 0x8b76, 0x8b77, 0x8b78, 0x8b79,
0x8b7a, 0x8b7b, 0x8b7c, 0x8b7d, 0x8b81, 0x8b82, 0x8b83, 0x8b84,
0x8b85, 0x8b86, 0x8b87, 0x8b88, 0x8b89, 0x8b8a, 0x8b8b, 0x8b8c,
0x8b8d, 0x8b8e, 0x8b8f, 0x8b90, 0x8b91, 0x8b93, 0x8b94, 0x8b95,
0x8b96, 0x8b97, 0x8b98, 0x8b99, 0x8b9a, 0x8b9b, 0x8b9c, 0x8b9d,
0x8ba1, 0x8ba2, 0x8ba3, 0x8ba4, 0x8ba5, 0x8ba6, 0x8ba7, 0x8ba8,
0x8ba9, 0x8baa, 0x8bab, 0x8bac, 0x8bad, 0x8bae, 0x8baf, 0x8bb0,
0x8bb1, 0x8bb3, 0x8bb4, 0x8bb5, 0x8bb6, 0x8bb7, 0x8bb8, 0x8bb9,
0x8bba, 0x8bbb, 0x8bbc, 0x8bbd, 0x8c61, 0x8c62, 0x8c63, 0x8c64,
0x8c65, 0x8c66, 0x8c67, 0x8c68, 0x8c69, 0x8c6a, 0x8c6b, 0x8c6c,
0x8c6d, 0x8c6e, 0x8c6f, 0x8c70, 0x8c71, 0x8c73, 0x8c74, 0x8c75,
0x8c76, 0x8c77, 0x8c78, 0x8c79, 0x8c7a, 0x8c7b, 0x8c7c, 0x8c7d,
0x8c81, 0x8c82, 0x8c83, 0x8c84, 0x8c85, 0x8c86, 0x8c87, 0x8c88,
0x8c89, 0x8c8a, 0x8c8b, 0x8c8c, 0x8c8d, 0x8c8e, 0x8c8f, 0x8c90,
0x8c91, 0x8c93, 0x8c94, 0x8c95, 0x8c96, 0x8c97, 0x8c98, 0x8c99,
0x8c9a, 0x8c9b, 0x8c9c, 0x8c9d, 0x8ca1, 0x8ca2, 0x8ca3, 0x8ca4,
0x8ca5, 0x8ca6, 0x8ca7, 0x8ca8, 0x8ca9, 0x8caa, 0x8cab, 0x8cac,
0x8cad, 0x8cae, 0x8caf, 0x8cb0, 0x8cb1, 0x8cb3, 0x8cb4, 0x8cb5,
0x8cb6, 0x8cb7, 0x8cb8, 0x8cb9, 0x8cba, 0x8cbb, 0x8cbc, 0x8cbd,
0x8cc1, 0x8cc2, 0x8cc3, 0x8cc4, 0x8cc5, 0x8cc6, 0x8cc7, 0x8cc8,
0x8cc9, 0x8cca, 0x8ccb, 0x8ccc, 0x8ccd, 0x8cce, 0x8ccf, 0x8cd0,
0x8cd1, 0x8cd3, 0x8cd4, 0x8cd5, 0x8cd6, 0x8cd7, 0x8cd8, 0x8cd9,
0x8cda, 0x8cdb, 0x8cdc, 0x8cdd, 0x8ce1, 0x8ce2, 0x8ce3, 0x8ce4,
0x8ce5, 0x8ce6, 0x8ce7, 0x8ce8, 0x8ce9, 0x8cea, 0x8ceb, 0x8cec,
0x8ced, 0x8cee, 0x8cef, 0x8cf0, 0x8cf1, 0x8cf3, 0x8cf4, 0x8cf5,
0x8cf6, 0x8cf7, 0x8cf8, 0x8cf9, 0x8cfa, 0x8cfb, 0x8cfc, 0x8cfd,
0x8d41, 0x8d42, 0x8d43, 0x8d44, 0x8d45, 0x8d46, 0x8d47, 0x8d48,
0x8d49, 0x8d4a, 0x8d4b, 0x8d4c, 0x8d4d, 0x8d4e, 0x8d4f, 0x8d50,
0x8d51, 0x8d53, 0x8d54, 0x8d55, 0x8d56, 0x8d57, 0x8d58, 0x8d59,
0x8d5a, 0x8d5b, 0x8d5c, 0x8d5d, 0x8d61, 0x8d62, 0x8d63, 0x8d64,
0x8d65, 0x8d66, 0x8d67, 0x8d68, 0x8d69, 0x8d6a, 0x8d6b, 0x8d6c,
0x8d6d, 0x8d6e, 0x8d6f, 0x8d70, 0x8d71, 0x8d73, 0x8d74, 0x8d75,
0x8d76, 0x8d77, 0x8d78, 0x8d79, 0x8d7a, 0x8d7b, 0x8d7c, 0x8d7d,
0x8d81, 0x8d82, 0x8d83, 0x8d84, 0x8d85, 0x8d86, 0x8d87, 0x8d88,
0x8d89, 0x8d8a, 0x8d8b, 0x8d8c, 0x8d8d, 0x8d8e, 0x8d8f, 0x8d90,
0x8d91, 0x8d93, 0x8d94, 0x8d95, 0x8d96, 0x8d97, 0x8d98, 0x8d99,
0x8d9a, 0x8d9b, 0x8d9c, 0x8d9d, 0x8da1, 0x8da2, 0x8da3, 0x8da4,
0x8da5, 0x8da6, 0x8da7, 0x8da8, 0x8da9, 0x8daa, 0x8dab, 0x8dac,
0x8dad, 0x8dae, 0x8daf, 0x8db0, 0x8db1, 0x8db3, 0x8db4, 0x8db5,
0x8db6, 0x8db7, 0x8db8, 0x8db9, 0x8dba, 0x8dbb, 0x8dbc, 0x8dbd,
0x8dc1, 0x8dc2, 0x8dc3, 0x8dc4, 0x8dc5, 0x8dc6, 0x8dc7, 0x8dc8,
0x8dc9, 0x8dca, 0x8dcb, 0x8dcc, 0x8dcd, 0x8dce, 0x8dcf, 0x8dd0,
0x8dd1, 0x8dd3, 0x8dd4, 0x8dd5, 0x8dd6, 0x8dd7, 0x8dd8, 0x8dd9,
0x8dda, 0x8ddb, 0x8ddc, 0x8ddd, 0x8de1, 0x8de2, 0x8de3, 0x8de4,
0x8de5, 0x8de6, 0x8de7, 0x8de8, 0x8de9, 0x8dea, 0x8deb, 0x8dec,
0x8ded, 0x8dee, 0x8def, 0x8df0, 0x8df1, 0x8df3, 0x8df4, 0x8df5,
0x8df6, 0x8df7, 0x8df8, 0x8df9, 0x8dfa, 0x8dfb, 0x8dfc, 0x8dfd,
0x8e41, 0x8e42, 0x8e43, 0x8e44, 0x8e45, 0x8e46, 0x8e47, 0x8e48,
0x8e49, 0x8e4a, 0x8e4b, 0x8e4c, 0x8e4d, 0x8e4e, 0x8e4f, 0x8e50,
0x8e51, 0x8e53, 0x8e54, 0x8e55, 0x8e56, 0x8e57, 0x8e58, 0x8e59,
0x8e5a, 0x8e5b, 0x8e5c, 0x8e5d, 0x8e61, 0x8e62, 0x8e63, 0x8e64,
0x8e65, 0x8e66, 0x8e67, 0x8e68, 0x8e69, 0x8e6a, 0x8e6b, 0x8e6c,
0x8e6d, 0x8e6e, 0x8e6f, 0x8e70, 0x8e71, 0x8e73, 0x8e74, 0x8e75,
0x8e76, 0x8e77, 0x8e78, 0x8e79, 0x8e7a, 0x8e7b, 0x8e7c, 0x8e7d,
0x8e81, 0x8e82, 0x8e83, 0x8e84, 0x8e85, 0x8e86, 0x8e87, 0x8e88,
0x8e89, 0x8e8a, 0x8e8b, 0x8e8c, 0x8e8d, 0x8e8e, 0x8e8f, 0x8e90,
0x8e91, 0x8e93, 0x8e94, 0x8e95, 0x8e96, 0x8e97, 0x8e98, 0x8e99,
0x8e9a, 0x8e9b, 0x8e9c, 0x8e9d, 0x8ea1, 0x8ea2, 0x8ea3, 0x8ea4,
0x8ea5, 0x8ea6, 0x8ea7, 0x8ea8, 0x8ea9, 0x8eaa, 0x8eab, 0x8eac,
0x8ead, 0x8eae, 0x8eaf, 0x8eb0, 0x8eb1, 0x8eb3, 0x8eb4, 0x8eb5,
0x8eb6, 0x8eb7, 0x8eb8, 0x8eb9, 0x8eba, 0x8ebb, 0x8ebc, 0x8ebd,
0x8ec1, 0x8ec2, 0x8ec3, 0x8ec4, 0x8ec5, 0x8ec6, 0x8ec7, 0x8ec8,
0x8ec9, 0x8eca, 0x8ecb, 0x8ecc, 0x8ecd, 0x8ece, 0x8ecf, 0x8ed0,
0x8ed1, 0x8ed3, 0x8ed4, 0x8ed5, 0x8ed6, 0x8ed7, 0x8ed8, 0x8ed9,
0x8eda, 0x8edb, 0x8edc, 0x8edd, 0x8ee1, 0x8ee2, 0x8ee3, 0x8ee4,
0x8ee5, 0x8ee6, 0x8ee7, 0x8ee8, 0x8ee9, 0x8eea, 0x8eeb, 0x8eec,
0x8eed, 0x8eee, 0x8eef, 0x8ef0, 0x8ef1, 0x8ef3, 0x8ef4, 0x8ef5,
0x8ef6, 0x8ef7, 0x8ef8, 0x8ef9, 0x8efa, 0x8efb, 0x8efc, 0x8efd,
0x8f41, 0x8f42, 0x8f43, 0x8f44, 0x8f45, 0x8f46, 0x8f47, 0x8f48,
0x8f49, 0x8f4a, 0x8f4b, 0x8f4c, 0x8f4d, 0x8f4e, 0x8f4f, 0x8f50,
0x8f51, 0x8f53, 0x8f54, 0x8f55, 0x8f56, 0x8f57, 0x8f58, 0x8f59,
0x8f5a, 0x8f5b, 0x8f5c, 0x8f5d, 0x8f61, 0x8f62, 0x8f63, 0x8f64,
0x8f65, 0x8f66, 0x8f67, 0x8f68, 0x8f69, 0x8f6a, 0x8f6b, 0x8f6c,
0x8f6d, 0x8f6e, 0x8f6f, 0x8f70, 0x8f71, 0x8f73, 0x8f74, 0x8f75,
0x8f76, 0x8f77, 0x8f78, 0x8f79, 0x8f7a, 0x8f7b, 0x8f7c, 0x8f7d,
0x8f81, 0x8f82, 0x8f83, 0x8f84, 0x8f85, 0x8f86, 0x8f87, 0x8f88,
0x8f89, 0x8f8a, 0x8f8b, 0x8f8c, 0x8f8d, 0x8f8e, 0x8f8f, 0x8f90,
0x8f91, 0x8f93, 0x8f94, 0x8f95, 0x8f96, 0x8f97, 0x8f98, 0x8f99,
0x8f9a, 0x8f9b, 0x8f9c, 0x8f9d, 0x8fa1, 0x8fa2, 0x8fa3, 0x8fa4,
0x8fa5, 0x8fa6, 0x8fa7, 0x8fa8, 0x8fa9, 0x8faa, 0x8fab, 0x8fac,
0x8fad, 0x8fae, 0x8faf, 0x8fb0, 0x8fb1, 0x8fb3, 0x8fb4, 0x8fb5,
0x8fb6, 0x8fb7, 0x8fb8, 0x8fb9, 0x8fba, 0x8fbb, 0x8fbc, 0x8fbd,
0x9061, 0x9062, 0x9063, 0x9064, 0x9065, 0x9066, 0x9067, 0x9068,
0x9069, 0x906a, 0x906b, 0x906c, 0x906d, 0x906e, 0x906f, 0x9070,
0x9071, 0x9073, 0x9074, 0x9075, 0x9076, 0x9077, 0x9078, 0x9079,
0x907a, 0x907b, 0x907c, 0x907d, 0x9081, 0x9082, 0x9083, 0x9084,
0x9085, 0x9086, 0x9087, 0x9088, 0x9089, 0x908a, 0x908b, 0x908c,
0x908d, 0x908e, 0x908f, 0x9090, 0x9091, 0x9093, 0x9094, 0x9095,
0x9096, 0x9097, 0x9098, 0x9099, 0x909a, 0x909b, 0x909c, 0x909d,
0x90a1, 0x90a2, 0x90a3, 0x90a4, 0x90a5, 0x90a6, 0x90a7, 0x90a8,
0x90a9, 0x90aa, 0x90ab, 0x90ac, 0x90ad, 0x90ae, 0x90af, 0x90b0,
0x90b1, 0x90b3, 0x90b4, 0x90b5, 0x90b6, 0x90b7, 0x90b8, 0x90b9,
0x90ba, 0x90bb, 0x90bc, 0x90bd, 0x90c1, 0x90c2, 0x90c3, 0x90c4,
0x90c5, 0x90c6, 0x90c7, 0x90c8, 0x90c9, 0x90ca, 0x90cb, 0x90cc,
0x90cd, 0x90ce, 0x90cf, 0x90d0, 0x90d1, 0x90d3, 0x90d4, 0x90d5,
0x90d6, 0x90d7, 0x90d8, 0x90d9, 0x90da, 0x90db, 0x90dc, 0x90dd,
0x90e1, 0x90e2, 0x90e3, 0x90e4, 0x90e5, 0x90e6, 0x90e7, 0x90e8,
0x90e9, 0x90ea, 0x90eb, 0x90ec, 0x90ed, 0x90ee, 0x90ef, 0x90f0,
0x90f1, 0x90f3, 0x90f4, 0x90f5, 0x90f6, 0x90f7, 0x90f8, 0x90f9,
0x90fa, 0x90fb, 0x90fc, 0x90fd, 0x9141, 0x9142, 0x9143, 0x9144,
0x9145, 0x9146, 0x9147, 0x9148, 0x9149, 0x914a, 0x914b, 0x914c,
0x914d, 0x914e, 0x914f, 0x9150, 0x9151, 0x9153, 0x9154, 0x9155,
0x9156, 0x9157, 0x9158, 0x9159, 0x915a, 0x915b, 0x915c, 0x915d,
0x9161, 0x9162, 0x9163, 0x9164, 0x9165, 0x9166, 0x9167, 0x9168,
0x9169, 0x916a, 0x916b, 0x916c, 0x916d, 0x916e, 0x916f, 0x9170,
0x9171, 0x9173, 0x9174, 0x9175, 0x9176, 0x9177, 0x9178, 0x9179,
0x917a, 0x917b, 0x917c, 0x917d, 0x9181, 0x9182, 0x9183, 0x9184,
0x9185, 0x9186, 0x9187, 0x9188, 0x9189, 0x918a, 0x918b, 0x918c,
0x918d, 0x918e, 0x918f, 0x9190, 0x9191, 0x9193, 0x9194, 0x9195,
0x9196, 0x9197, 0x9198, 0x9199, 0x919a, 0x919b, 0x919c, 0x919d,
0x91a1, 0x91a2, 0x91a3, 0x91a4, 0x91a5, 0x91a6, 0x91a7, 0x91a8,
0x91a9, 0x91aa, 0x91ab, 0x91ac, 0x91ad, 0x91ae, 0x91af, 0x91b0,
0x91b1, 0x91b3, 0x91b4, 0x91b5, 0x91b6, 0x91b7, 0x91b8, 0x91b9,
0x91ba, 0x91bb, 0x91bc, 0x91bd, 0x91c1, 0x91c2, 0x91c3, 0x91c4,
0x91c5, 0x91c6, 0x91c7, 0x91c8, 0x91c9, 0x91ca, 0x91cb, 0x91cc,
0x91cd, 0x91ce, 0x91cf, 0x91d0, 0x91d1, 0x91d3, 0x91d4, 0x91d5,
0x91d6, 0x91d7, 0x91d8, 0x91d9, 0x91da, 0x91db, 0x91dc, 0x91dd,
0x91e1, 0x91e2, 0x91e3, 0x91e4, 0x91e5, 0x91e6, 0x91e7, 0x91e8,
0x91e9, 0x91ea, 0x91eb, 0x91ec, 0x91ed, 0x91ee, 0x91ef, 0x91f0,
0x91f1, 0x91f3, 0x91f4, 0x91f5, 0x91f6, 0x91f7, 0x91f8, 0x91f9,
0x91fa, 0x91fb, 0x91fc, 0x91fd, 0x9241, 0x9242, 0x9243, 0x9244,
0x9245, 0x9246, 0x9247, 0x9248, 0x9249, 0x924a, 0x924b, 0x924c,
0x924d, 0x924e, 0x924f, 0x9250, 0x9251, 0x9253, 0x9254, 0x9255,
0x9256, 0x9257, 0x9258, 0x9259, 0x925a, 0x925b, 0x925c, 0x925d,
0x9261, 0x9262, 0x9263, 0x9264, 0x9265, 0x9266, 0x9267, 0x9268,
0x9269, 0x926a, 0x926b, 0x926c, 0x926d, 0x926e, 0x926f, 0x9270,
0x9271, 0x9273, 0x9274, 0x9275, 0x9276, 0x9277, 0x9278, 0x9279,
0x927a, 0x927b, 0x927c, 0x927d, 0x9281, 0x9282, 0x9283, 0x9284,
0x9285, 0x9286, 0x9287, 0x9288, 0x9289, 0x928a, 0x928b, 0x928c,
0x928d, 0x928e, 0x928f, 0x9290, 0x9291, 0x9293, 0x9294, 0x9295,
0x9296, 0x9297, 0x9298, 0x9299, 0x929a, 0x929b, 0x929c, 0x929d,
0x92a1, 0x92a2, 0x92a3, 0x92a4, 0x92a5, 0x92a6, 0x92a7, 0x92a8,
0x92a9, 0x92aa, 0x92ab, 0x92ac, 0x92ad, 0x92ae, 0x92af, 0x92b0,
0x92b1, 0x92b3, 0x92b4, 0x92b5, 0x92b6, 0x92b7, 0x92b8, 0x92b9,
0x92ba, 0x92bb, 0x92bc, 0x92bd, 0x92c1, 0x92c2, 0x92c3, 0x92c4,
0x92c5, 0x92c6, 0x92c7, 0x92c8, 0x92c9, 0x92ca, 0x92cb, 0x92cc,
0x92cd, 0x92ce, 0x92cf, 0x92d0, 0x92d1, 0x92d3, 0x92d4, 0x92d5,
0x92d6, 0x92d7, 0x92d8, 0x92d9, 0x92da, 0x92db, 0x92dc, 0x92dd,
0x92e1, 0x92e2, 0x92e3, 0x92e4, 0x92e5, 0x92e6, 0x92e7, 0x92e8,
0x92e9, 0x92ea, 0x92eb, 0x92ec, 0x92ed, 0x92ee, 0x92ef, 0x92f0,
0x92f1, 0x92f3, 0x92f4, 0x92f5, 0x92f6, 0x92f7, 0x92f8, 0x92f9,
0x92fa, 0x92fb, 0x92fc, 0x92fd, 0x9341, 0x9342, 0x9343, 0x9344,
0x9345, 0x9346, 0x9347, 0x9348, 0x9349, 0x934a, 0x934b, 0x934c,
0x934d, 0x934e, 0x934f, 0x9350, 0x9351, 0x9353, 0x9354, 0x9355,
0x9356, 0x9357, 0x9358, 0x9359, 0x935a, 0x935b, 0x935c, 0x935d,
0x9361, 0x9362, 0x9363, 0x9364, 0x9365, 0x9366, 0x9367, 0x9368,
0x9369, 0x936a, 0x936b, 0x936c, 0x936d, 0x936e, 0x936f, 0x9370,
0x9371, 0x9373, 0x9374, 0x9375, 0x9376, 0x9377, 0x9378, 0x9379,
0x937a, 0x937b, 0x937c, 0x937d, 0x9381, 0x9382, 0x9383, 0x9384,
0x9385, 0x9386, 0x9387, 0x9388, 0x9389, 0x938a, 0x938b, 0x938c,
0x938d, 0x938e, 0x938f, 0x9390, 0x9391, 0x9393, 0x9394, 0x9395,
0x9396, 0x9397, 0x9398, 0x9399, 0x939a, 0x939b, 0x939c, 0x939d,
0x93a1, 0x93a2, 0x93a3, 0x93a4, 0x93a5, 0x93a6, 0x93a7, 0x93a8,
0x93a9, 0x93aa, 0x93ab, 0x93ac, 0x93ad, 0x93ae, 0x93af, 0x93b0,
0x93b1, 0x93b3, 0x93b4, 0x93b5, 0x93b6, 0x93b7, 0x93b8, 0x93b9,
0x93ba, 0x93bb, 0x93bc, 0x93bd, 0x9461, 0x9462, 0x9463, 0x9464,
0x9465, 0x9466, 0x9467, 0x9468, 0x9469, 0x946a, 0x946b, 0x946c,
0x946d, 0x946e, 0x946f, 0x9470, 0x9471, 0x9473, 0x9474, 0x9475,
0x9476, 0x9477, 0x9478, 0x9479, 0x947a, 0x947b, 0x947c, 0x947d,
0x9481, 0x9482, 0x9483, 0x9484, 0x9485, 0x9486, 0x9487, 0x9488,
0x9489, 0x948a, 0x948b, 0x948c, 0x948d, 0x948e, 0x948f, 0x9490,
0x9491, 0x9493, 0x9494, 0x9495, 0x9496, 0x9497, 0x9498, 0x9499,
0x949a, 0x949b, 0x949c, 0x949d, 0x94a1, 0x94a2, 0x94a3, 0x94a4,
0x94a5, 0x94a6, 0x94a7, 0x94a8, 0x94a9, 0x94aa, 0x94ab, 0x94ac,
0x94ad, 0x94ae, 0x94af, 0x94b0, 0x94b1, 0x94b3, 0x94b4, 0x94b5,
0x94b6, 0x94b7, 0x94b8, 0x94b9, 0x94ba, 0x94bb, 0x94bc, 0x94bd,
0x94c1, 0x94c2, 0x94c3, 0x94c4, 0x94c5, 0x94c6, 0x94c7, 0x94c8,
0x94c9, 0x94ca, 0x94cb, 0x94cc, 0x94cd, 0x94ce, 0x94cf, 0x94d0,
0x94d1, 0x94d3, 0x94d4, 0x94d5, 0x94d6, 0x94d7, 0x94d8, 0x94d9,
0x94da, 0x94db, 0x94dc, 0x94dd, 0x94e1, 0x94e2, 0x94e3, 0x94e4,
0x94e5, 0x94e6, 0x94e7, 0x94e8, 0x94e9, 0x94ea, 0x94eb, 0x94ec,
0x94ed, 0x94ee, 0x94ef, 0x94f0, 0x94f1, 0x94f3, 0x94f4, 0x94f5,
0x94f6, 0x94f7, 0x94f8, 0x94f9, 0x94fa, 0x94fb, 0x94fc, 0x94fd,
0x9541, 0x9542, 0x9543, 0x9544, 0x9545, 0x9546, 0x9547, 0x9548,
0x9549, 0x954a, 0x954b, 0x954c, 0x954d, 0x954e, 0x954f, 0x9550,
0x9551, 0x9553, 0x9554, 0x9555, 0x9556, 0x9557, 0x9558, 0x9559,
0x955a, 0x955b, 0x955c, 0x955d, 0x9561, 0x9562, 0x9563, 0x9564,
0x9565, 0x9566, 0x9567, 0x9568, 0x9569, 0x956a, 0x956b, 0x956c,
0x956d, 0x956e, 0x956f, 0x9570, 0x9571, 0x9573, 0x9574, 0x9575,
0x9576, 0x9577, 0x9578, 0x9579, 0x957a, 0x957b, 0x957c, 0x957d,
0x9581, 0x9582, 0x9583, 0x9584, 0x9585, 0x9586, 0x9587, 0x9588,
0x9589, 0x958a, 0x958b, 0x958c, 0x958d, 0x958e, 0x958f, 0x9590,
0x9591, 0x9593, 0x9594, 0x9595, 0x9596, 0x9597, 0x9598, 0x9599,
0x959a, 0x959b, 0x959c, 0x959d, 0x95a1, 0x95a2, 0x95a3, 0x95a4,
0x95a5, 0x95a6, 0x95a7, 0x95a8, 0x95a9, 0x95aa, 0x95ab, 0x95ac,
0x95ad, 0x95ae, 0x95af, 0x95b0, 0x95b1, 0x95b3, 0x95b4, 0x95b5,
0x95b6, 0x95b7, 0x95b8, 0x95b9, 0x95ba, 0x95bb, 0x95bc, 0x95bd,
0x95c1, 0x95c2, 0x95c3, 0x95c4, 0x95c5, 0x95c6, 0x95c7, 0x95c8,
0x95c9, 0x95ca, 0x95cb, 0x95cc, 0x95cd, 0x95ce, 0x95cf, 0x95d0,
0x95d1, 0x95d3, 0x95d4, 0x95d5, 0x95d6, 0x95d7, 0x95d8, 0x95d9,
0x95da, 0x95db, 0x95dc, 0x95dd, 0x95e1, 0x95e2, 0x95e3, 0x95e4,
0x95e5, 0x95e6, 0x95e7, 0x95e8, 0x95e9, 0x95ea, 0x95eb, 0x95ec,
0x95ed, 0x95ee, 0x95ef, 0x95f0, 0x95f1, 0x95f3, 0x95f4, 0x95f5,
0x95f6, 0x95f7, 0x95f8, 0x95f9, 0x95fa, 0x95fb, 0x95fc, 0x95fd,
0x9641, 0x9642, 0x9643, 0x9644, 0x9645, 0x9646, 0x9647, 0x9648,
0x9649, 0x964a, 0x964b, 0x964c, 0x964d, 0x964e, 0x964f, 0x9650,
0x9651, 0x9653, 0x9654, 0x9655, 0x9656, 0x9657, 0x9658, 0x9659,
0x965a, 0x965b, 0x965c, 0x965d, 0x9661, 0x9662, 0x9663, 0x9664,
0x9665, 0x9666, 0x9667, 0x9668, 0x9669, 0x966a, 0x966b, 0x966c,
0x966d, 0x966e, 0x966f, 0x9670, 0x9671, 0x9673, 0x9674, 0x9675,
0x9676, 0x9677, 0x9678, 0x9679, 0x967a, 0x967b, 0x967c, 0x967d,
0x9681, 0x9682, 0x9683, 0x9684, 0x9685, 0x9686, 0x9687, 0x9688,
0x9689, 0x968a, 0x968b, 0x968c, 0x968d, 0x968e, 0x968f, 0x9690,
0x9691, 0x9693, 0x9694, 0x9695, 0x9696, 0x9697, 0x9698, 0x9699,
0x969a, 0x969b, 0x969c, 0x969d, 0x96a1, 0x96a2, 0x96a3, 0x96a4,
0x96a5, 0x96a6, 0x96a7, 0x96a8, 0x96a9, 0x96aa, 0x96ab, 0x96ac,
0x96ad, 0x96ae, 0x96af, 0x96b0, 0x96b1, 0x96b3, 0x96b4, 0x96b5,
0x96b6, 0x96b7, 0x96b8, 0x96b9, 0x96ba, 0x96bb, 0x96bc, 0x96bd,
0x96c1, 0x96c2, 0x96c3, 0x96c4, 0x96c5, 0x96c6, 0x96c7, 0x96c8,
0x96c9, 0x96ca, 0x96cb, 0x96cc, 0x96cd, 0x96ce, 0x96cf, 0x96d0,
0x96d1, 0x96d3, 0x96d4, 0x96d5, 0x96d6, 0x96d7, 0x96d8, 0x96d9,
0x96da, 0x96db, 0x96dc, 0x96dd, 0x96e1, 0x96e2, 0x96e3, 0x96e4,
0x96e5, 0x96e6, 0x96e7, 0x96e8, 0x96e9, 0x96ea, 0x96eb, 0x96ec,
0x96ed, 0x96ee, 0x96ef, 0x96f0, 0x96f1, 0x96f3, 0x96f4, 0x96f5,
0x96f6, 0x96f7, 0x96f8, 0x96f9, 0x96fa, 0x96fb, 0x96fc, 0x96fd,
0x9741, 0x9742, 0x9743, 0x9744, 0x9745, 0x9746, 0x9747, 0x9748,
0x9749, 0x974a, 0x974b, 0x974c, 0x974d, 0x974e, 0x974f, 0x9750,
0x9751, 0x9753, 0x9754, 0x9755, 0x9756, 0x9757, 0x9758, 0x9759,
0x975a, 0x975b, 0x975c, 0x975d, 0x9761, 0x9762, 0x9763, 0x9764,
0x9765, 0x9766, 0x9767, 0x9768, 0x9769, 0x976a, 0x976b, 0x976c,
0x976d, 0x976e, 0x976f, 0x9770, 0x9771, 0x9773, 0x9774, 0x9775,
0x9776, 0x9777, 0x9778, 0x9779, 0x977a, 0x977b, 0x977c, 0x977d,
0x9781, 0x9782, 0x9783, 0x9784, 0x9785, 0x9786, 0x9787, 0x9788,
0x9789, 0x978a, 0x978b, 0x978c, 0x978d, 0x978e, 0x978f, 0x9790,
0x9791, 0x9793, 0x9794, 0x9795, 0x9796, 0x9797, 0x9798, 0x9799,
0x979a, 0x979b, 0x979c, 0x979d, 0x97a1, 0x97a2, 0x97a3, 0x97a4,
0x97a5, 0x97a6, 0x97a7, 0x97a8, 0x97a9, 0x97aa, 0x97ab, 0x97ac,
0x97ad, 0x97ae, 0x97af, 0x97b0, 0x97b1, 0x97b3, 0x97b4, 0x97b5,
0x97b6, 0x97b7, 0x97b8, 0x97b9, 0x97ba, 0x97bb, 0x97bc, 0x97bd,
0x9861, 0x9862, 0x9863, 0x9864, 0x9865, 0x9866, 0x9867, 0x9868,
0x9869, 0x986a, 0x986b, 0x986c, 0x986d, 0x986e, 0x986f, 0x9870,
0x9871, 0x9873, 0x9874, 0x9875, 0x9876, 0x9877, 0x9878, 0x9879,
0x987a, 0x987b, 0x987c, 0x987d, 0x9881, 0x9882, 0x9883, 0x9884,
0x9885, 0x9886, 0x9887, 0x9888, 0x9889, 0x988a, 0x988b, 0x988c,
0x988d, 0x988e, 0x988f, 0x9890, 0x9891, 0x9893, 0x9894, 0x9895,
0x9896, 0x9897, 0x9898, 0x9899, 0x989a, 0x989b, 0x989c, 0x989d,
0x98a1, 0x98a2, 0x98a3, 0x98a4, 0x98a5, 0x98a6, 0x98a7, 0x98a8,
0x98a9, 0x98aa, 0x98ab, 0x98ac, 0x98ad, 0x98ae, 0x98af, 0x98b0,
0x98b1, 0x98b3, 0x98b4, 0x98b5, 0x98b6, 0x98b7, 0x98b8, 0x98b9,
0x98ba, 0x98bb, 0x98bc, 0x98bd, 0x98c1, 0x98c2, 0x98c3, 0x98c4,
0x98c5, 0x98c6, 0x98c7, 0x98c8, 0x98c9, 0x98ca, 0x98cb, 0x98cc,
0x98cd, 0x98ce, 0x98cf, 0x98d0, 0x98d1, 0x98d3, 0x98d4, 0x98d5,
0x98d6, 0x98d7, 0x98d8, 0x98d9, 0x98da, 0x98db, 0x98dc, 0x98dd,
0x98e1, 0x98e2, 0x98e3, 0x98e4, 0x98e5, 0x98e6, 0x98e7, 0x98e8,
0x98e9, 0x98ea, 0x98eb, 0x98ec, 0x98ed, 0x98ee, 0x98ef, 0x98f0,
0x98f1, 0x98f3, 0x98f4, 0x98f5, 0x98f6, 0x98f7, 0x98f8, 0x98f9,
0x98fa, 0x98fb, 0x98fc, 0x98fd, 0x9941, 0x9942, 0x9943, 0x9944,
0x9945, 0x9946, 0x9947, 0x9948, 0x9949, 0x994a, 0x994b, 0x994c,
0x994d, 0x994e, 0x994f, 0x9950, 0x9951, 0x9953, 0x9954, 0x9955,
0x9956, 0x9957, 0x9958, 0x9959, 0x995a, 0x995b, 0x995c, 0x995d,
0x9961, 0x9962, 0x9963, 0x9964, 0x9965, 0x9966, 0x9967, 0x9968,
0x9969, 0x996a, 0x996b, 0x996c, 0x996d, 0x996e, 0x996f, 0x9970,
0x9971, 0x9973, 0x9974, 0x9975, 0x9976, 0x9977, 0x9978, 0x9979,
0x997a, 0x997b, 0x997c, 0x997d, 0x9981, 0x9982, 0x9983, 0x9984,
0x9985, 0x9986, 0x9987, 0x9988, 0x9989, 0x998a, 0x998b, 0x998c,
0x998d, 0x998e, 0x998f, 0x9990, 0x9991, 0x9993, 0x9994, 0x9995,
0x9996, 0x9997, 0x9998, 0x9999, 0x999a, 0x999b, 0x999c, 0x999d,
0x99a1, 0x99a2, 0x99a3, 0x99a4, 0x99a5, 0x99a6, 0x99a7, 0x99a8,
0x99a9, 0x99aa, 0x99ab, 0x99ac, 0x99ad, 0x99ae, 0x99af, 0x99b0,
0x99b1, 0x99b3, 0x99b4, 0x99b5, 0x99b6, 0x99b7, 0x99b8, 0x99b9,
0x99ba, 0x99bb, 0x99bc, 0x99bd, 0x99c1, 0x99c2, 0x99c3, 0x99c4,
0x99c5, 0x99c6, 0x99c7, 0x99c8, 0x99c9, 0x99ca, 0x99cb, 0x99cc,
0x99cd, 0x99ce, 0x99cf, 0x99d0, 0x99d1, 0x99d3, 0x99d4, 0x99d5,
0x99d6, 0x99d7, 0x99d8, 0x99d9, 0x99da, 0x99db, 0x99dc, 0x99dd,
0x99e1, 0x99e2, 0x99e3, 0x99e4, 0x99e5, 0x99e6, 0x99e7, 0x99e8,
0x99e9, 0x99ea, 0x99eb, 0x99ec, 0x99ed, 0x99ee, 0x99ef, 0x99f0,
0x99f1, 0x99f3, 0x99f4, 0x99f5, 0x99f6, 0x99f7, 0x99f8, 0x99f9,
0x99fa, 0x99fb, 0x99fc, 0x99fd, 0x9a41, 0x9a42, 0x9a43, 0x9a44,
0x9a45, 0x9a46, 0x9a47, 0x9a48, 0x9a49, 0x9a4a, 0x9a4b, 0x9a4c,
0x9a4d, 0x9a4e, 0x9a4f, 0x9a50, 0x9a51, 0x9a53, 0x9a54, 0x9a55,
0x9a56, 0x9a57, 0x9a58, 0x9a59, 0x9a5a, 0x9a5b, 0x9a5c, 0x9a5d,
0x9a61, 0x9a62, 0x9a63, 0x9a64, 0x9a65, 0x9a66, 0x9a67, 0x9a68,
0x9a69, 0x9a6a, 0x9a6b, 0x9a6c, 0x9a6d, 0x9a6e, 0x9a6f, 0x9a70,
0x9a71, 0x9a73, 0x9a74, 0x9a75, 0x9a76, 0x9a77, 0x9a78, 0x9a79,
0x9a7a, 0x9a7b, 0x9a7c, 0x9a7d, 0x9a81, 0x9a82, 0x9a83, 0x9a84,
0x9a85, 0x9a86, 0x9a87, 0x9a88, 0x9a89, 0x9a8a, 0x9a8b, 0x9a8c,
0x9a8d, 0x9a8e, 0x9a8f, 0x9a90, 0x9a91, 0x9a93, 0x9a94, 0x9a95,
0x9a96, 0x9a97, 0x9a98, 0x9a99, 0x9a9a, 0x9a9b, 0x9a9c, 0x9a9d,
0x9aa1, 0x9aa2, 0x9aa3, 0x9aa4, 0x9aa5, 0x9aa6, 0x9aa7, 0x9aa8,
0x9aa9, 0x9aaa, 0x9aab, 0x9aac, 0x9aad, 0x9aae, 0x9aaf, 0x9ab0,
0x9ab1, 0x9ab3, 0x9ab4, 0x9ab5, 0x9ab6, 0x9ab7, 0x9ab8, 0x9ab9,
0x9aba, 0x9abb, 0x9abc, 0x9abd, 0x9ac1, 0x9ac2, 0x9ac3, 0x9ac4,
0x9ac5, 0x9ac6, 0x9ac7, 0x9ac8, 0x9ac9, 0x9aca, 0x9acb, 0x9acc,
0x9acd, 0x9ace, 0x9acf, 0x9ad0, 0x9ad1, 0x9ad3, 0x9ad4, 0x9ad5,
0x9ad6, 0x9ad7, 0x9ad8, 0x9ad9, 0x9ada, 0x9adb, 0x9adc, 0x9add,
0x9ae1, 0x9ae2, 0x9ae3, 0x9ae4, 0x9ae5, 0x9ae6, 0x9ae7, 0x9ae8,
0x9ae9, 0x9aea, 0x9aeb, 0x9aec, 0x9aed, 0x9aee, 0x9aef, 0x9af0,
0x9af1, 0x9af3, 0x9af4, 0x9af5, 0x9af6, 0x9af7, 0x9af8, 0x9af9,
0x9afa, 0x9afb, 0x9afc, 0x9afd, 0x9b41, 0x9b42, 0x9b43, 0x9b44,
0x9b45, 0x9b46, 0x9b47, 0x9b48, 0x9b49, 0x9b4a, 0x9b4b, 0x9b4c,
0x9b4d, 0x9b4e, 0x9b4f, 0x9b50, 0x9b51, 0x9b53, 0x9b54, 0x9b55,
0x9b56, 0x9b57, 0x9b58, 0x9b59, 0x9b5a, 0x9b5b, 0x9b5c, 0x9b5d,
0x9b61, 0x9b62, 0x9b63, 0x9b64, 0x9b65, 0x9b66, 0x9b67, 0x9b68,
0x9b69, 0x9b6a, 0x9b6b, 0x9b6c, 0x9b6d, 0x9b6e, 0x9b6f, 0x9b70,
0x9b71, 0x9b73, 0x9b74, 0x9b75, 0x9b76, 0x9b77, 0x9b78, 0x9b79,
0x9b7a, 0x9b7b, 0x9b7c, 0x9b7d, 0x9b81, 0x9b82, 0x9b83, 0x9b84,
0x9b85, 0x9b86, 0x9b87, 0x9b88, 0x9b89, 0x9b8a, 0x9b8b, 0x9b8c,
0x9b8d, 0x9b8e, 0x9b8f, 0x9b90, 0x9b91, 0x9b93, 0x9b94, 0x9b95,
0x9b96, 0x9b97, 0x9b98, 0x9b99, 0x9b9a, 0x9b9b, 0x9b9c, 0x9b9d,
0x9ba1, 0x9ba2, 0x9ba3, 0x9ba4, 0x9ba5, 0x9ba6, 0x9ba7, 0x9ba8,
0x9ba9, 0x9baa, 0x9bab, 0x9bac, 0x9bad, 0x9bae, 0x9baf, 0x9bb0,
0x9bb1, 0x9bb3, 0x9bb4, 0x9bb5, 0x9bb6, 0x9bb7, 0x9bb8, 0x9bb9,
0x9bba, 0x9bbb, 0x9bbc, 0x9bbd, 0x9c61, 0x9c62, 0x9c63, 0x9c64,
0x9c65, 0x9c66, 0x9c67, 0x9c68, 0x9c69, 0x9c6a, 0x9c6b, 0x9c6c,
0x9c6d, 0x9c6e, 0x9c6f, 0x9c70, 0x9c71, 0x9c73, 0x9c74, 0x9c75,
0x9c76, 0x9c77, 0x9c78, 0x9c79, 0x9c7a, 0x9c7b, 0x9c7c, 0x9c7d,
0x9c81, 0x9c82, 0x9c83, 0x9c84, 0x9c85, 0x9c86, 0x9c87, 0x9c88,
0x9c89, 0x9c8a, 0x9c8b, 0x9c8c, 0x9c8d, 0x9c8e, 0x9c8f, 0x9c90,
0x9c91, 0x9c93, 0x9c94, 0x9c95, 0x9c96, 0x9c97, 0x9c98, 0x9c99,
0x9c9a, 0x9c9b, 0x9c9c, 0x9c9d, 0x9ca1, 0x9ca2, 0x9ca3, 0x9ca4,
0x9ca5, 0x9ca6, 0x9ca7, 0x9ca8, 0x9ca9, 0x9caa, 0x9cab, 0x9cac,
0x9cad, 0x9cae, 0x9caf, 0x9cb0, 0x9cb1, 0x9cb3, 0x9cb4, 0x9cb5,
0x9cb6, 0x9cb7, 0x9cb8, 0x9cb9, 0x9cba, 0x9cbb, 0x9cbc, 0x9cbd,
0x9cc1, 0x9cc2, 0x9cc3, 0x9cc4, 0x9cc5, 0x9cc6, 0x9cc7, 0x9cc8,
0x9cc9, 0x9cca, 0x9ccb, 0x9ccc, 0x9ccd, 0x9cce, 0x9ccf, 0x9cd0,
0x9cd1, 0x9cd3, 0x9cd4, 0x9cd5, 0x9cd6, 0x9cd7, 0x9cd8, 0x9cd9,
0x9cda, 0x9cdb, 0x9cdc, 0x9cdd, 0x9ce1, 0x9ce2, 0x9ce3, 0x9ce4,
0x9ce5, 0x9ce6, 0x9ce7, 0x9ce8, 0x9ce9, 0x9cea, 0x9ceb, 0x9cec,
0x9ced, 0x9cee, 0x9cef, 0x9cf0, 0x9cf1, 0x9cf3, 0x9cf4, 0x9cf5,
0x9cf6, 0x9cf7, 0x9cf8, 0x9cf9, 0x9cfa, 0x9cfb, 0x9cfc, 0x9cfd,
0x9d41, 0x9d42, 0x9d43, 0x9d44, 0x9d45, 0x9d46, 0x9d47, 0x9d48,
0x9d49, 0x9d4a, 0x9d4b, 0x9d4c, 0x9d4d, 0x9d4e, 0x9d4f, 0x9d50,
0x9d51, 0x9d53, 0x9d54, 0x9d55, 0x9d56, 0x9d57, 0x9d58, 0x9d59,
0x9d5a, 0x9d5b, 0x9d5c, 0x9d5d, 0x9d61, 0x9d62, 0x9d63, 0x9d64,
0x9d65, 0x9d66, 0x9d67, 0x9d68, 0x9d69, 0x9d6a, 0x9d6b, 0x9d6c,
0x9d6d, 0x9d6e, 0x9d6f, 0x9d70, 0x9d71, 0x9d73, 0x9d74, 0x9d75,
0x9d76, 0x9d77, 0x9d78, 0x9d79, 0x9d7a, 0x9d7b, 0x9d7c, 0x9d7d,
0x9d81, 0x9d82, 0x9d83, 0x9d84, 0x9d85, 0x9d86, 0x9d87, 0x9d88,
0x9d89, 0x9d8a, 0x9d8b, 0x9d8c, 0x9d8d, 0x9d8e, 0x9d8f, 0x9d90,
0x9d91, 0x9d93, 0x9d94, 0x9d95, 0x9d96, 0x9d97, 0x9d98, 0x9d99,
0x9d9a, 0x9d9b, 0x9d9c, 0x9d9d, 0x9da1, 0x9da2, 0x9da3, 0x9da4,
0x9da5, 0x9da6, 0x9da7, 0x9da8, 0x9da9, 0x9daa, 0x9dab, 0x9dac,
0x9dad, 0x9dae, 0x9daf, 0x9db0, 0x9db1, 0x9db3, 0x9db4, 0x9db5,
0x9db6, 0x9db7, 0x9db8, 0x9db9, 0x9dba, 0x9dbb, 0x9dbc, 0x9dbd,
0x9dc1, 0x9dc2, 0x9dc3, 0x9dc4, 0x9dc5, 0x9dc6, 0x9dc7, 0x9dc8,
0x9dc9, 0x9dca, 0x9dcb, 0x9dcc, 0x9dcd, 0x9dce, 0x9dcf, 0x9dd0,
0x9dd1, 0x9dd3, 0x9dd4, 0x9dd5, 0x9dd6, 0x9dd7, 0x9dd8, 0x9dd9,
0x9dda, 0x9ddb, 0x9ddc, 0x9ddd, 0x9de1, 0x9de2, 0x9de3, 0x9de4,
0x9de5, 0x9de6, 0x9de7, 0x9de8, 0x9de9, 0x9dea, 0x9deb, 0x9dec,
0x9ded, 0x9dee, 0x9def, 0x9df0, 0x9df1, 0x9df3, 0x9df4, 0x9df5,
0x9df6, 0x9df7, 0x9df8, 0x9df9, 0x9dfa, 0x9dfb, 0x9dfc, 0x9dfd,
0x9e41, 0x9e42, 0x9e43, 0x9e44, 0x9e45, 0x9e46, 0x9e47, 0x9e48,
0x9e49, 0x9e4a, 0x9e4b, 0x9e4c, 0x9e4d, 0x9e4e, 0x9e4f, 0x9e50,
0x9e51, 0x9e53, 0x9e54, 0x9e55, 0x9e56, 0x9e57, 0x9e58, 0x9e59,
0x9e5a, 0x9e5b, 0x9e5c, 0x9e5d, 0x9e61, 0x9e62, 0x9e63, 0x9e64,
0x9e65, 0x9e66, 0x9e67, 0x9e68, 0x9e69, 0x9e6a, 0x9e6b, 0x9e6c,
0x9e6d, 0x9e6e, 0x9e6f, 0x9e70, 0x9e71, 0x9e73, 0x9e74, 0x9e75,
0x9e76, 0x9e77, 0x9e78, 0x9e79, 0x9e7a, 0x9e7b, 0x9e7c, 0x9e7d,
0x9e81, 0x9e82, 0x9e83, 0x9e84, 0x9e85, 0x9e86, 0x9e87, 0x9e88,
0x9e89, 0x9e8a, 0x9e8b, 0x9e8c, 0x9e8d, 0x9e8e, 0x9e8f, 0x9e90,
0x9e91, 0x9e93, 0x9e94, 0x9e95, 0x9e96, 0x9e97, 0x9e98, 0x9e99,
0x9e9a, 0x9e9b, 0x9e9c, 0x9e9d, 0x9ea1, 0x9ea2, 0x9ea3, 0x9ea4,
0x9ea5, 0x9ea6, 0x9ea7, 0x9ea8, 0x9ea9, 0x9eaa, 0x9eab, 0x9eac,
0x9ead, 0x9eae, 0x9eaf, 0x9eb0, 0x9eb1, 0x9eb3, 0x9eb4, 0x9eb5,
0x9eb6, 0x9eb7, 0x9eb8, 0x9eb9, 0x9eba, 0x9ebb, 0x9ebc, 0x9ebd,
0x9ec1, 0x9ec2, 0x9ec3, 0x9ec4, 0x9ec5, 0x9ec6, 0x9ec7, 0x9ec8,
0x9ec9, 0x9eca, 0x9ecb, 0x9ecc, 0x9ecd, 0x9ece, 0x9ecf, 0x9ed0,
0x9ed1, 0x9ed3, 0x9ed4, 0x9ed5, 0x9ed6, 0x9ed7, 0x9ed8, 0x9ed9,
0x9eda, 0x9edb, 0x9edc, 0x9edd, 0x9ee1, 0x9ee2, 0x9ee3, 0x9ee4,
0x9ee5, 0x9ee6, 0x9ee7, 0x9ee8, 0x9ee9, 0x9eea, 0x9eeb, 0x9eec,
0x9eed, 0x9eee, 0x9eef, 0x9ef0, 0x9ef1, 0x9ef3, 0x9ef4, 0x9ef5,
0x9ef6, 0x9ef7, 0x9ef8, 0x9ef9, 0x9efa, 0x9efb, 0x9efc, 0x9efd,
0x9f41, 0x9f42, 0x9f43, 0x9f44, 0x9f45, 0x9f46, 0x9f47, 0x9f48,
0x9f49, 0x9f4a, 0x9f4b, 0x9f4c, 0x9f4d, 0x9f4e, 0x9f4f, 0x9f50,
0x9f51, 0x9f53, 0x9f54, 0x9f55, 0x9f56, 0x9f57, 0x9f58, 0x9f59,
0x9f5a, 0x9f5b, 0x9f5c, 0x9f5d, 0x9f61, 0x9f62, 0x9f63, 0x9f64,
0x9f65, 0x9f66, 0x9f67, 0x9f68, 0x9f69, 0x9f6a, 0x9f6b, 0x9f6c,
0x9f6d, 0x9f6e, 0x9f6f, 0x9f70, 0x9f71, 0x9f73, 0x9f74, 0x9f75,
0x9f76, 0x9f77, 0x9f78, 0x9f79, 0x9f7a, 0x9f7b, 0x9f7c, 0x9f7d,
0x9f81, 0x9f82, 0x9f83, 0x9f84, 0x9f85, 0x9f86, 0x9f87, 0x9f88,
0x9f89, 0x9f8a, 0x9f8b, 0x9f8c, 0x9f8d, 0x9f8e, 0x9f8f, 0x9f90,
0x9f91, 0x9f93, 0x9f94, 0x9f95, 0x9f96, 0x9f97, 0x9f98, 0x9f99,
0x9f9a, 0x9f9b, 0x9f9c, 0x9f9d, 0x9fa1, 0x9fa2, 0x9fa3, 0x9fa4,
0x9fa5, 0x9fa6, 0x9fa7, 0x9fa8, 0x9fa9, 0x9faa, 0x9fab, 0x9fac,
0x9fad, 0x9fae, 0x9faf, 0x9fb0, 0x9fb1, 0x9fb3, 0x9fb4, 0x9fb5,
0x9fb6, 0x9fb7, 0x9fb8, 0x9fb9, 0x9fba, 0x9fbb, 0x9fbc, 0x9fbd,
0xa061, 0xa062, 0xa063, 0xa064, 0xa065, 0xa066, 0xa067, 0xa068,
0xa069, 0xa06a, 0xa06b, 0xa06c, 0xa06d, 0xa06e, 0xa06f, 0xa070,
0xa071, 0xa073, 0xa074, 0xa075, 0xa076, 0xa077, 0xa078, 0xa079,
0xa07a, 0xa07b, 0xa07c, 0xa07d, 0xa081, 0xa082, 0xa083, 0xa084,
0xa085, 0xa086, 0xa087, 0xa088, 0xa089, 0xa08a, 0xa08b, 0xa08c,
0xa08d, 0xa08e, 0xa08f, 0xa090, 0xa091, 0xa093, 0xa094, 0xa095,
0xa096, 0xa097, 0xa098, 0xa099, 0xa09a, 0xa09b, 0xa09c, 0xa09d,
0xa0a1, 0xa0a2, 0xa0a3, 0xa0a4, 0xa0a5, 0xa0a6, 0xa0a7, 0xa0a8,
0xa0a9, 0xa0aa, 0xa0ab, 0xa0ac, 0xa0ad, 0xa0ae, 0xa0af, 0xa0b0,
0xa0b1, 0xa0b3, 0xa0b4, 0xa0b5, 0xa0b6, 0xa0b7, 0xa0b8, 0xa0b9,
0xa0ba, 0xa0bb, 0xa0bc, 0xa0bd, 0xa0c1, 0xa0c2, 0xa0c3, 0xa0c4,
0xa0c5, 0xa0c6, 0xa0c7, 0xa0c8, 0xa0c9, 0xa0ca, 0xa0cb, 0xa0cc,
0xa0cd, 0xa0ce, 0xa0cf, 0xa0d0, 0xa0d1, 0xa0d3, 0xa0d4, 0xa0d5,
0xa0d6, 0xa0d7, 0xa0d8, 0xa0d9, 0xa0da, 0xa0db, 0xa0dc, 0xa0dd,
0xa0e1, 0xa0e2, 0xa0e3, 0xa0e4, 0xa0e5, 0xa0e6, 0xa0e7, 0xa0e8,
0xa0e9, 0xa0ea, 0xa0eb, 0xa0ec, 0xa0ed, 0xa0ee, 0xa0ef, 0xa0f0,
0xa0f1, 0xa0f3, 0xa0f4, 0xa0f5, 0xa0f6, 0xa0f7, 0xa0f8, 0xa0f9,
0xa0fa, 0xa0fb, 0xa0fc, 0xa0fd, 0xa141, 0xa142, 0xa143, 0xa144,
0xa145, 0xa146, 0xa147, 0xa148, 0xa149, 0xa14a, 0xa14b, 0xa14c,
0xa14d, 0xa14e, 0xa14f, 0xa150, 0xa151, 0xa153, 0xa154, 0xa155,
0xa156, 0xa157, 0xa158, 0xa159, 0xa15a, 0xa15b, 0xa15c, 0xa15d,
0xa161, 0xa162, 0xa163, 0xa164, 0xa165, 0xa166, 0xa167, 0xa168,
0xa169, 0xa16a, 0xa16b, 0xa16c, 0xa16d, 0xa16e, 0xa16f, 0xa170,
0xa171, 0xa173, 0xa174, 0xa175, 0xa176, 0xa177, 0xa178, 0xa179,
0xa17a, 0xa17b, 0xa17c, 0xa17d, 0xa181, 0xa182, 0xa183, 0xa184,
0xa185, 0xa186, 0xa187, 0xa188, 0xa189, 0xa18a, 0xa18b, 0xa18c,
0xa18d, 0xa18e, 0xa18f, 0xa190, 0xa191, 0xa193, 0xa194, 0xa195,
0xa196, 0xa197, 0xa198, 0xa199, 0xa19a, 0xa19b, 0xa19c, 0xa19d,
0xa1a1, 0xa1a2, 0xa1a3, 0xa1a4, 0xa1a5, 0xa1a6, 0xa1a7, 0xa1a8,
0xa1a9, 0xa1aa, 0xa1ab, 0xa1ac, 0xa1ad, 0xa1ae, 0xa1af, 0xa1b0,
0xa1b1, 0xa1b3, 0xa1b4, 0xa1b5, 0xa1b6, 0xa1b7, 0xa1b8, 0xa1b9,
0xa1ba, 0xa1bb, 0xa1bc, 0xa1bd, 0xa1c1, 0xa1c2, 0xa1c3, 0xa1c4,
0xa1c5, 0xa1c6, 0xa1c7, 0xa1c8, 0xa1c9, 0xa1ca, 0xa1cb, 0xa1cc,
0xa1cd, 0xa1ce, 0xa1cf, 0xa1d0, 0xa1d1, 0xa1d3, 0xa1d4, 0xa1d5,
0xa1d6, 0xa1d7, 0xa1d8, 0xa1d9, 0xa1da, 0xa1db, 0xa1dc, 0xa1dd,
0xa1e1, 0xa1e2, 0xa1e3, 0xa1e4, 0xa1e5, 0xa1e6, 0xa1e7, 0xa1e8,
0xa1e9, 0xa1ea, 0xa1eb, 0xa1ec, 0xa1ed, 0xa1ee, 0xa1ef, 0xa1f0,
0xa1f1, 0xa1f3, 0xa1f4, 0xa1f5, 0xa1f6, 0xa1f7, 0xa1f8, 0xa1f9,
0xa1fa, 0xa1fb, 0xa1fc, 0xa1fd, 0xa241, 0xa242, 0xa243, 0xa244,
0xa245, 0xa246, 0xa247, 0xa248, 0xa249, 0xa24a, 0xa24b, 0xa24c,
0xa24d, 0xa24e, 0xa24f, 0xa250, 0xa251, 0xa253, 0xa254, 0xa255,
0xa256, 0xa257, 0xa258, 0xa259, 0xa25a, 0xa25b, 0xa25c, 0xa25d,
0xa261, 0xa262, 0xa263, 0xa264, 0xa265, 0xa266, 0xa267, 0xa268,
0xa269, 0xa26a, 0xa26b, 0xa26c, 0xa26d, 0xa26e, 0xa26f, 0xa270,
0xa271, 0xa273, 0xa274, 0xa275, 0xa276, 0xa277, 0xa278, 0xa279,
0xa27a, 0xa27b, 0xa27c, 0xa27d, 0xa281, 0xa282, 0xa283, 0xa284,
0xa285, 0xa286, 0xa287, 0xa288, 0xa289, 0xa28a, 0xa28b, 0xa28c,
0xa28d, 0xa28e, 0xa28f, 0xa290, 0xa291, 0xa293, 0xa294, 0xa295,
0xa296, 0xa297, 0xa298, 0xa299, 0xa29a, 0xa29b, 0xa29c, 0xa29d,
0xa2a1, 0xa2a2, 0xa2a3, 0xa2a4, 0xa2a5, 0xa2a6, 0xa2a7, 0xa2a8,
0xa2a9, 0xa2aa, 0xa2ab, 0xa2ac, 0xa2ad, 0xa2ae, 0xa2af, 0xa2b0,
0xa2b1, 0xa2b3, 0xa2b4, 0xa2b5, 0xa2b6, 0xa2b7, 0xa2b8, 0xa2b9,
0xa2ba, 0xa2bb, 0xa2bc, 0xa2bd, 0xa2c1, 0xa2c2, 0xa2c3, 0xa2c4,
0xa2c5, 0xa2c6, 0xa2c7, 0xa2c8, 0xa2c9, 0xa2ca, 0xa2cb, 0xa2cc,
0xa2cd, 0xa2ce, 0xa2cf, 0xa2d0, 0xa2d1, 0xa2d3, 0xa2d4, 0xa2d5,
0xa2d6, 0xa2d7, 0xa2d8, 0xa2d9, 0xa2da, 0xa2db, 0xa2dc, 0xa2dd,
0xa2e1, 0xa2e2, 0xa2e3, 0xa2e4, 0xa2e5, 0xa2e6, 0xa2e7, 0xa2e8,
0xa2e9, 0xa2ea, 0xa2eb, 0xa2ec, 0xa2ed, 0xa2ee, 0xa2ef, 0xa2f0,
0xa2f1, 0xa2f3, 0xa2f4, 0xa2f5, 0xa2f6, 0xa2f7, 0xa2f8, 0xa2f9,
0xa2fa, 0xa2fb, 0xa2fc, 0xa2fd, 0xa341, 0xa342, 0xa343, 0xa344,
0xa345, 0xa346, 0xa347, 0xa348, 0xa349, 0xa34a, 0xa34b, 0xa34c,
0xa34d, 0xa34e, 0xa34f, 0xa350, 0xa351, 0xa353, 0xa354, 0xa355,
0xa356, 0xa357, 0xa358, 0xa359, 0xa35a, 0xa35b, 0xa35c, 0xa35d,
0xa361, 0xa362, 0xa363, 0xa364, 0xa365, 0xa366, 0xa367, 0xa368,
0xa369, 0xa36a, 0xa36b, 0xa36c, 0xa36d, 0xa36e, 0xa36f, 0xa370,
0xa371, 0xa373, 0xa374, 0xa375, 0xa376, 0xa377, 0xa378, 0xa379,
0xa37a, 0xa37b, 0xa37c, 0xa37d, 0xa381, 0xa382, 0xa383, 0xa384,
0xa385, 0xa386, 0xa387, 0xa388, 0xa389, 0xa38a, 0xa38b, 0xa38c,
0xa38d, 0xa38e, 0xa38f, 0xa390, 0xa391, 0xa393, 0xa394, 0xa395,
0xa396, 0xa397, 0xa398, 0xa399, 0xa39a, 0xa39b, 0xa39c, 0xa39d,
0xa3a1, 0xa3a2, 0xa3a3, 0xa3a4, 0xa3a5, 0xa3a6, 0xa3a7, 0xa3a8,
0xa3a9, 0xa3aa, 0xa3ab, 0xa3ac, 0xa3ad, 0xa3ae, 0xa3af, 0xa3b0,
0xa3b1, 0xa3b3, 0xa3b4, 0xa3b5, 0xa3b6, 0xa3b7, 0xa3b8, 0xa3b9,
0xa3ba, 0xa3bb, 0xa3bc, 0xa3bd, 0xa461, 0xa462, 0xa463, 0xa464,
0xa465, 0xa466, 0xa467, 0xa468, 0xa469, 0xa46a, 0xa46b, 0xa46c,
0xa46d, 0xa46e, 0xa46f, 0xa470, 0xa471, 0xa473, 0xa474, 0xa475,
0xa476, 0xa477, 0xa478, 0xa479, 0xa47a, 0xa47b, 0xa47c, 0xa47d,
0xa481, 0xa482, 0xa483, 0xa484, 0xa485, 0xa486, 0xa487, 0xa488,
0xa489, 0xa48a, 0xa48b, 0xa48c, 0xa48d, 0xa48e, 0xa48f, 0xa490,
0xa491, 0xa493, 0xa494, 0xa495, 0xa496, 0xa497, 0xa498, 0xa499,
0xa49a, 0xa49b, 0xa49c, 0xa49d, 0xa4a1, 0xa4a2, 0xa4a3, 0xa4a4,
0xa4a5, 0xa4a6, 0xa4a7, 0xa4a8, 0xa4a9, 0xa4aa, 0xa4ab, 0xa4ac,
0xa4ad, 0xa4ae, 0xa4af, 0xa4b0, 0xa4b1, 0xa4b3, 0xa4b4, 0xa4b5,
0xa4b6, 0xa4b7, 0xa4b8, 0xa4b9, 0xa4ba, 0xa4bb, 0xa4bc, 0xa4bd,
0xa4c1, 0xa4c2, 0xa4c3, 0xa4c4, 0xa4c5, 0xa4c6, 0xa4c7, 0xa4c8,
0xa4c9, 0xa4ca, 0xa4cb, 0xa4cc, 0xa4cd, 0xa4ce, 0xa4cf, 0xa4d0,
0xa4d1, 0xa4d3, 0xa4d4, 0xa4d5, 0xa4d6, 0xa4d7, 0xa4d8, 0xa4d9,
0xa4da, 0xa4db, 0xa4dc, 0xa4dd, 0xa4e1, 0xa4e2, 0xa4e3, 0xa4e4,
0xa4e5, 0xa4e6, 0xa4e7, 0xa4e8, 0xa4e9, 0xa4ea, 0xa4eb, 0xa4ec,
0xa4ed, 0xa4ee, 0xa4ef, 0xa4f0, 0xa4f1, 0xa4f3, 0xa4f4, 0xa4f5,
0xa4f6, 0xa4f7, 0xa4f8, 0xa4f9, 0xa4fa, 0xa4fb, 0xa4fc, 0xa4fd,
0xa541, 0xa542, 0xa543, 0xa544, 0xa545, 0xa546, 0xa547, 0xa548,
0xa549, 0xa54a, 0xa54b, 0xa54c, 0xa54d, 0xa54e, 0xa54f, 0xa550,
0xa551, 0xa553, 0xa554, 0xa555, 0xa556, 0xa557, 0xa558, 0xa559,
0xa55a, 0xa55b, 0xa55c, 0xa55d, 0xa561, 0xa562, 0xa563, 0xa564,
0xa565, 0xa566, 0xa567, 0xa568, 0xa569, 0xa56a, 0xa56b, 0xa56c,
0xa56d, 0xa56e, 0xa56f, 0xa570, 0xa571, 0xa573, 0xa574, 0xa575,
0xa576, 0xa577, 0xa578, 0xa579, 0xa57a, 0xa57b, 0xa57c, 0xa57d,
0xa581, 0xa582, 0xa583, 0xa584, 0xa585, 0xa586, 0xa587, 0xa588,
0xa589, 0xa58a, 0xa58b, 0xa58c, 0xa58d, 0xa58e, 0xa58f, 0xa590,
0xa591, 0xa593, 0xa594, 0xa595, 0xa596, 0xa597, 0xa598, 0xa599,
0xa59a, 0xa59b, 0xa59c, 0xa59d, 0xa5a1, 0xa5a2, 0xa5a3, 0xa5a4,
0xa5a5, 0xa5a6, 0xa5a7, 0xa5a8, 0xa5a9, 0xa5aa, 0xa5ab, 0xa5ac,
0xa5ad, 0xa5ae, 0xa5af, 0xa5b0, 0xa5b1, 0xa5b3, 0xa5b4, 0xa5b5,
0xa5b6, 0xa5b7, 0xa5b8, 0xa5b9, 0xa5ba, 0xa5bb, 0xa5bc, 0xa5bd,
0xa5c1, 0xa5c2, 0xa5c3, 0xa5c4, 0xa5c5, 0xa5c6, 0xa5c7, 0xa5c8,
0xa5c9, 0xa5ca, 0xa5cb, 0xa5cc, 0xa5cd, 0xa5ce, 0xa5cf, 0xa5d0,
0xa5d1, 0xa5d3, 0xa5d4, 0xa5d5, 0xa5d6, 0xa5d7, 0xa5d8, 0xa5d9,
0xa5da, 0xa5db, 0xa5dc, 0xa5dd, 0xa5e1, 0xa5e2, 0xa5e3, 0xa5e4,
0xa5e5, 0xa5e6, 0xa5e7, 0xa5e8, 0xa5e9, 0xa5ea, 0xa5eb, 0xa5ec,
0xa5ed, 0xa5ee, 0xa5ef, 0xa5f0, 0xa5f1, 0xa5f3, 0xa5f4, 0xa5f5,
0xa5f6, 0xa5f7, 0xa5f8, 0xa5f9, 0xa5fa, 0xa5fb, 0xa5fc, 0xa5fd,
0xa641, 0xa642, 0xa643, 0xa644, 0xa645, 0xa646, 0xa647, 0xa648,
0xa649, 0xa64a, 0xa64b, 0xa64c, 0xa64d, 0xa64e, 0xa64f, 0xa650,
0xa651, 0xa653, 0xa654, 0xa655, 0xa656, 0xa657, 0xa658, 0xa659,
0xa65a, 0xa65b, 0xa65c, 0xa65d, 0xa661, 0xa662, 0xa663, 0xa664,
0xa665, 0xa666, 0xa667, 0xa668, 0xa669, 0xa66a, 0xa66b, 0xa66c,
0xa66d, 0xa66e, 0xa66f, 0xa670, 0xa671, 0xa673, 0xa674, 0xa675,
0xa676, 0xa677, 0xa678, 0xa679, 0xa67a, 0xa67b, 0xa67c, 0xa67d,
0xa681, 0xa682, 0xa683, 0xa684, 0xa685, 0xa686, 0xa687, 0xa688,
0xa689, 0xa68a, 0xa68b, 0xa68c, 0xa68d, 0xa68e, 0xa68f, 0xa690,
0xa691, 0xa693, 0xa694, 0xa695, 0xa696, 0xa697, 0xa698, 0xa699,
0xa69a, 0xa69b, 0xa69c, 0xa69d, 0xa6a1, 0xa6a2, 0xa6a3, 0xa6a4,
0xa6a5, 0xa6a6, 0xa6a7, 0xa6a8, 0xa6a9, 0xa6aa, 0xa6ab, 0xa6ac,
0xa6ad, 0xa6ae, 0xa6af, 0xa6b0, 0xa6b1, 0xa6b3, 0xa6b4, 0xa6b5,
0xa6b6, 0xa6b7, 0xa6b8, 0xa6b9, 0xa6ba, 0xa6bb, 0xa6bc, 0xa6bd,
0xa6c1, 0xa6c2, 0xa6c3, 0xa6c4, 0xa6c5, 0xa6c6, 0xa6c7, 0xa6c8,
0xa6c9, 0xa6ca, 0xa6cb, 0xa6cc, 0xa6cd, 0xa6ce, 0xa6cf, 0xa6d0,
0xa6d1, 0xa6d3, 0xa6d4, 0xa6d5, 0xa6d6, 0xa6d7, 0xa6d8, 0xa6d9,
0xa6da, 0xa6db, 0xa6dc, 0xa6dd, 0xa6e1, 0xa6e2, 0xa6e3, 0xa6e4,
0xa6e5, 0xa6e6, 0xa6e7, 0xa6e8, 0xa6e9, 0xa6ea, 0xa6eb, 0xa6ec,
0xa6ed, 0xa6ee, 0xa6ef, 0xa6f0, 0xa6f1, 0xa6f3, 0xa6f4, 0xa6f5,
0xa6f6, 0xa6f7, 0xa6f8, 0xa6f9, 0xa6fa, 0xa6fb, 0xa6fc, 0xa6fd,
0xa741, 0xa742, 0xa743, 0xa744, 0xa745, 0xa746, 0xa747, 0xa748,
0xa749, 0xa74a, 0xa74b, 0xa74c, 0xa74d, 0xa74e, 0xa74f, 0xa750,
0xa751, 0xa753, 0xa754, 0xa755, 0xa756, 0xa757, 0xa758, 0xa759,
0xa75a, 0xa75b, 0xa75c, 0xa75d, 0xa761, 0xa762, 0xa763, 0xa764,
0xa765, 0xa766, 0xa767, 0xa768, 0xa769, 0xa76a, 0xa76b, 0xa76c,
0xa76d, 0xa76e, 0xa76f, 0xa770, 0xa771, 0xa773, 0xa774, 0xa775,
0xa776, 0xa777, 0xa778, 0xa779, 0xa77a, 0xa77b, 0xa77c, 0xa77d,
0xa781, 0xa782, 0xa783, 0xa784, 0xa785, 0xa786, 0xa787, 0xa788,
0xa789, 0xa78a, 0xa78b, 0xa78c, 0xa78d, 0xa78e, 0xa78f, 0xa790,
0xa791, 0xa793, 0xa794, 0xa795, 0xa796, 0xa797, 0xa798, 0xa799,
0xa79a, 0xa79b, 0xa79c, 0xa79d, 0xa7a1, 0xa7a2, 0xa7a3, 0xa7a4,
0xa7a5, 0xa7a6, 0xa7a7, 0xa7a8, 0xa7a9, 0xa7aa, 0xa7ab, 0xa7ac,
0xa7ad, 0xa7ae, 0xa7af, 0xa7b0, 0xa7b1, 0xa7b3, 0xa7b4, 0xa7b5,
0xa7b6, 0xa7b7, 0xa7b8, 0xa7b9, 0xa7ba, 0xa7bb, 0xa7bc, 0xa7bd,
0xa861, 0xa862, 0xa863, 0xa864, 0xa865, 0xa866, 0xa867, 0xa868,
0xa869, 0xa86a, 0xa86b, 0xa86c, 0xa86d, 0xa86e, 0xa86f, 0xa870,
0xa871, 0xa873, 0xa874, 0xa875, 0xa876, 0xa877, 0xa878, 0xa879,
0xa87a, 0xa87b, 0xa87c, 0xa87d, 0xa881, 0xa882, 0xa883, 0xa884,
0xa885, 0xa886, 0xa887, 0xa888, 0xa889, 0xa88a, 0xa88b, 0xa88c,
0xa88d, 0xa88e, 0xa88f, 0xa890, 0xa891, 0xa893, 0xa894, 0xa895,
0xa896, 0xa897, 0xa898, 0xa899, 0xa89a, 0xa89b, 0xa89c, 0xa89d,
0xa8a1, 0xa8a2, 0xa8a3, 0xa8a4, 0xa8a5, 0xa8a6, 0xa8a7, 0xa8a8,
0xa8a9, 0xa8aa, 0xa8ab, 0xa8ac, 0xa8ad, 0xa8ae, 0xa8af, 0xa8b0,
0xa8b1, 0xa8b3, 0xa8b4, 0xa8b5, 0xa8b6, 0xa8b7, 0xa8b8, 0xa8b9,
0xa8ba, 0xa8bb, 0xa8bc, 0xa8bd, 0xa8c1, 0xa8c2, 0xa8c3, 0xa8c4,
0xa8c5, 0xa8c6, 0xa8c7, 0xa8c8, 0xa8c9, 0xa8ca, 0xa8cb, 0xa8cc,
0xa8cd, 0xa8ce, 0xa8cf, 0xa8d0, 0xa8d1, 0xa8d3, 0xa8d4, 0xa8d5,
0xa8d6, 0xa8d7, 0xa8d8, 0xa8d9, 0xa8da, 0xa8db, 0xa8dc, 0xa8dd,
0xa8e1, 0xa8e2, 0xa8e3, 0xa8e4, 0xa8e5, 0xa8e6, 0xa8e7, 0xa8e8,
0xa8e9, 0xa8ea, 0xa8eb, 0xa8ec, 0xa8ed, 0xa8ee, 0xa8ef, 0xa8f0,
0xa8f1, 0xa8f3, 0xa8f4, 0xa8f5, 0xa8f6, 0xa8f7, 0xa8f8, 0xa8f9,
0xa8fa, 0xa8fb, 0xa8fc, 0xa8fd, 0xa941, 0xa942, 0xa943, 0xa944,
0xa945, 0xa946, 0xa947, 0xa948, 0xa949, 0xa94a, 0xa94b, 0xa94c,
0xa94d, 0xa94e, 0xa94f, 0xa950, 0xa951, 0xa953, 0xa954, 0xa955,
0xa956, 0xa957, 0xa958, 0xa959, 0xa95a, 0xa95b, 0xa95c, 0xa95d,
0xa961, 0xa962, 0xa963, 0xa964, 0xa965, 0xa966, 0xa967, 0xa968,
0xa969, 0xa96a, 0xa96b, 0xa96c, 0xa96d, 0xa96e, 0xa96f, 0xa970,
0xa971, 0xa973, 0xa974, 0xa975, 0xa976, 0xa977, 0xa978, 0xa979,
0xa97a, 0xa97b, 0xa97c, 0xa97d, 0xa981, 0xa982, 0xa983, 0xa984,
0xa985, 0xa986, 0xa987, 0xa988, 0xa989, 0xa98a, 0xa98b, 0xa98c,
0xa98d, 0xa98e, 0xa98f, 0xa990, 0xa991, 0xa993, 0xa994, 0xa995,
0xa996, 0xa997, 0xa998, 0xa999, 0xa99a, 0xa99b, 0xa99c, 0xa99d,
0xa9a1, 0xa9a2, 0xa9a3, 0xa9a4, 0xa9a5, 0xa9a6, 0xa9a7, 0xa9a8,
0xa9a9, 0xa9aa, 0xa9ab, 0xa9ac, 0xa9ad, 0xa9ae, 0xa9af, 0xa9b0,
0xa9b1, 0xa9b3, 0xa9b4, 0xa9b5, 0xa9b6, 0xa9b7, 0xa9b8, 0xa9b9,
0xa9ba, 0xa9bb, 0xa9bc, 0xa9bd, 0xa9c1, 0xa9c2, 0xa9c3, 0xa9c4,
0xa9c5, 0xa9c6, 0xa9c7, 0xa9c8, 0xa9c9, 0xa9ca, 0xa9cb, 0xa9cc,
0xa9cd, 0xa9ce, 0xa9cf, 0xa9d0, 0xa9d1, 0xa9d3, 0xa9d4, 0xa9d5,
0xa9d6, 0xa9d7, 0xa9d8, 0xa9d9, 0xa9da, 0xa9db, 0xa9dc, 0xa9dd,
0xa9e1, 0xa9e2, 0xa9e3, 0xa9e4, 0xa9e5, 0xa9e6, 0xa9e7, 0xa9e8,
0xa9e9, 0xa9ea, 0xa9eb, 0xa9ec, 0xa9ed, 0xa9ee, 0xa9ef, 0xa9f0,
0xa9f1, 0xa9f3, 0xa9f4, 0xa9f5, 0xa9f6, 0xa9f7, 0xa9f8, 0xa9f9,
0xa9fa, 0xa9fb, 0xa9fc, 0xa9fd, 0xaa41, 0xaa42, 0xaa43, 0xaa44,
0xaa45, 0xaa46, 0xaa47, 0xaa48, 0xaa49, 0xaa4a, 0xaa4b, 0xaa4c,
0xaa4d, 0xaa4e, 0xaa4f, 0xaa50, 0xaa51, 0xaa53, 0xaa54, 0xaa55,
0xaa56, 0xaa57, 0xaa58, 0xaa59, 0xaa5a, 0xaa5b, 0xaa5c, 0xaa5d,
0xaa61, 0xaa62, 0xaa63, 0xaa64, 0xaa65, 0xaa66, 0xaa67, 0xaa68,
0xaa69, 0xaa6a, 0xaa6b, 0xaa6c, 0xaa6d, 0xaa6e, 0xaa6f, 0xaa70,
0xaa71, 0xaa73, 0xaa74, 0xaa75, 0xaa76, 0xaa77, 0xaa78, 0xaa79,
0xaa7a, 0xaa7b, 0xaa7c, 0xaa7d, 0xaa81, 0xaa82, 0xaa83, 0xaa84,
0xaa85, 0xaa86, 0xaa87, 0xaa88, 0xaa89, 0xaa8a, 0xaa8b, 0xaa8c,
0xaa8d, 0xaa8e, 0xaa8f, 0xaa90, 0xaa91, 0xaa93, 0xaa94, 0xaa95,
0xaa96, 0xaa97, 0xaa98, 0xaa99, 0xaa9a, 0xaa9b, 0xaa9c, 0xaa9d,
0xaaa1, 0xaaa2, 0xaaa3, 0xaaa4, 0xaaa5, 0xaaa6, 0xaaa7, 0xaaa8,
0xaaa9, 0xaaaa, 0xaaab, 0xaaac, 0xaaad, 0xaaae, 0xaaaf, 0xaab0,
0xaab1, 0xaab3, 0xaab4, 0xaab5, 0xaab6, 0xaab7, 0xaab8, 0xaab9,
0xaaba, 0xaabb, 0xaabc, 0xaabd, 0xaac1, 0xaac2, 0xaac3, 0xaac4,
0xaac5, 0xaac6, 0xaac7, 0xaac8, 0xaac9, 0xaaca, 0xaacb, 0xaacc,
0xaacd, 0xaace, 0xaacf, 0xaad0, 0xaad1, 0xaad3, 0xaad4, 0xaad5,
0xaad6, 0xaad7, 0xaad8, 0xaad9, 0xaada, 0xaadb, 0xaadc, 0xaadd,
0xaae1, 0xaae2, 0xaae3, 0xaae4, 0xaae5, 0xaae6, 0xaae7, 0xaae8,
0xaae9, 0xaaea, 0xaaeb, 0xaaec, 0xaaed, 0xaaee, 0xaaef, 0xaaf0,
0xaaf1, 0xaaf3, 0xaaf4, 0xaaf5, 0xaaf6, 0xaaf7, 0xaaf8, 0xaaf9,
0xaafa, 0xaafb, 0xaafc, 0xaafd, 0xab41, 0xab42, 0xab43, 0xab44,
0xab45, 0xab46, 0xab47, 0xab48, 0xab49, 0xab4a, 0xab4b, 0xab4c,
0xab4d, 0xab4e, 0xab4f, 0xab50, 0xab51, 0xab53, 0xab54, 0xab55,
0xab56, 0xab57, 0xab58, 0xab59, 0xab5a, 0xab5b, 0xab5c, 0xab5d,
0xab61, 0xab62, 0xab63, 0xab64, 0xab65, 0xab66, 0xab67, 0xab68,
0xab69, 0xab6a, 0xab6b, 0xab6c, 0xab6d, 0xab6e, 0xab6f, 0xab70,
0xab71, 0xab73, 0xab74, 0xab75, 0xab76, 0xab77, 0xab78, 0xab79,
0xab7a, 0xab7b, 0xab7c, 0xab7d, 0xab81, 0xab82, 0xab83, 0xab84,
0xab85, 0xab86, 0xab87, 0xab88, 0xab89, 0xab8a, 0xab8b, 0xab8c,
0xab8d, 0xab8e, 0xab8f, 0xab90, 0xab91, 0xab93, 0xab94, 0xab95,
0xab96, 0xab97, 0xab98, 0xab99, 0xab9a, 0xab9b, 0xab9c, 0xab9d,
0xaba1, 0xaba2, 0xaba3, 0xaba4, 0xaba5, 0xaba6, 0xaba7, 0xaba8,
0xaba9, 0xabaa, 0xabab, 0xabac, 0xabad, 0xabae, 0xabaf, 0xabb0,
0xabb1, 0xabb3, 0xabb4, 0xabb5, 0xabb6, 0xabb7, 0xabb8, 0xabb9,
0xabba, 0xabbb, 0xabbc, 0xabbd, 0xac61, 0xac62, 0xac63, 0xac64,
0xac65, 0xac66, 0xac67, 0xac68, 0xac69, 0xac6a, 0xac6b, 0xac6c,
0xac6d, 0xac6e, 0xac6f, 0xac70, 0xac71, 0xac73, 0xac74, 0xac75,
0xac76, 0xac77, 0xac78, 0xac79, 0xac7a, 0xac7b, 0xac7c, 0xac7d,
0xac81, 0xac82, 0xac83, 0xac84, 0xac85, 0xac86, 0xac87, 0xac88,
0xac89, 0xac8a, 0xac8b, 0xac8c, 0xac8d, 0xac8e, 0xac8f, 0xac90,
0xac91, 0xac93, 0xac94, 0xac95, 0xac96, 0xac97, 0xac98, 0xac99,
0xac9a, 0xac9b, 0xac9c, 0xac9d, 0xaca1, 0xaca2, 0xaca3, 0xaca4,
0xaca5, 0xaca6, 0xaca7, 0xaca8, 0xaca9, 0xacaa, 0xacab, 0xacac,
0xacad, 0xacae, 0xacaf, 0xacb0, 0xacb1, 0xacb3, 0xacb4, 0xacb5,
0xacb6, 0xacb7, 0xacb8, 0xacb9, 0xacba, 0xacbb, 0xacbc, 0xacbd,
0xacc1, 0xacc2, 0xacc3, 0xacc4, 0xacc5, 0xacc6, 0xacc7, 0xacc8,
0xacc9, 0xacca, 0xaccb, 0xaccc, 0xaccd, 0xacce, 0xaccf, 0xacd0,
0xacd1, 0xacd3, 0xacd4, 0xacd5, 0xacd6, 0xacd7, 0xacd8, 0xacd9,
0xacda, 0xacdb, 0xacdc, 0xacdd, 0xace1, 0xace2, 0xace3, 0xace4,
0xace5, 0xace6, 0xace7, 0xace8, 0xace9, 0xacea, 0xaceb, 0xacec,
0xaced, 0xacee, 0xacef, 0xacf0, 0xacf1, 0xacf3, 0xacf4, 0xacf5,
0xacf6, 0xacf7, 0xacf8, 0xacf9, 0xacfa, 0xacfb, 0xacfc, 0xacfd,
0xad41, 0xad42, 0xad43, 0xad44, 0xad45, 0xad46, 0xad47, 0xad48,
0xad49, 0xad4a, 0xad4b, 0xad4c, 0xad4d, 0xad4e, 0xad4f, 0xad50,
0xad51, 0xad53, 0xad54, 0xad55, 0xad56, 0xad57, 0xad58, 0xad59,
0xad5a, 0xad5b, 0xad5c, 0xad5d, 0xad61, 0xad62, 0xad63, 0xad64,
0xad65, 0xad66, 0xad67, 0xad68, 0xad69, 0xad6a, 0xad6b, 0xad6c,
0xad6d, 0xad6e, 0xad6f, 0xad70, 0xad71, 0xad73, 0xad74, 0xad75,
0xad76, 0xad77, 0xad78, 0xad79, 0xad7a, 0xad7b, 0xad7c, 0xad7d,
0xad81, 0xad82, 0xad83, 0xad84, 0xad85, 0xad86, 0xad87, 0xad88,
0xad89, 0xad8a, 0xad8b, 0xad8c, 0xad8d, 0xad8e, 0xad8f, 0xad90,
0xad91, 0xad93, 0xad94, 0xad95, 0xad96, 0xad97, 0xad98, 0xad99,
0xad9a, 0xad9b, 0xad9c, 0xad9d, 0xada1, 0xada2, 0xada3, 0xada4,
0xada5, 0xada6, 0xada7, 0xada8, 0xada9, 0xadaa, 0xadab, 0xadac,
0xadad, 0xadae, 0xadaf, 0xadb0, 0xadb1, 0xadb3, 0xadb4, 0xadb5,
0xadb6, 0xadb7, 0xadb8, 0xadb9, 0xadba, 0xadbb, 0xadbc, 0xadbd,
0xadc1, 0xadc2, 0xadc3, 0xadc4, 0xadc5, 0xadc6, 0xadc7, 0xadc8,
0xadc9, 0xadca, 0xadcb, 0xadcc, 0xadcd, 0xadce, 0xadcf, 0xadd0,
0xadd1, 0xadd3, 0xadd4, 0xadd5, 0xadd6, 0xadd7, 0xadd8, 0xadd9,
0xadda, 0xaddb, 0xaddc, 0xaddd, 0xade1, 0xade2, 0xade3, 0xade4,
0xade5, 0xade6, 0xade7, 0xade8, 0xade9, 0xadea, 0xadeb, 0xadec,
0xaded, 0xadee, 0xadef, 0xadf0, 0xadf1, 0xadf3, 0xadf4, 0xadf5,
0xadf6, 0xadf7, 0xadf8, 0xadf9, 0xadfa, 0xadfb, 0xadfc, 0xadfd,
0xae41, 0xae42, 0xae43, 0xae44, 0xae45, 0xae46, 0xae47, 0xae48,
0xae49, 0xae4a, 0xae4b, 0xae4c, 0xae4d, 0xae4e, 0xae4f, 0xae50,
0xae51, 0xae53, 0xae54, 0xae55, 0xae56, 0xae57, 0xae58, 0xae59,
0xae5a, 0xae5b, 0xae5c, 0xae5d, 0xae61, 0xae62, 0xae63, 0xae64,
0xae65, 0xae66, 0xae67, 0xae68, 0xae69, 0xae6a, 0xae6b, 0xae6c,
0xae6d, 0xae6e, 0xae6f, 0xae70, 0xae71, 0xae73, 0xae74, 0xae75,
0xae76, 0xae77, 0xae78, 0xae79, 0xae7a, 0xae7b, 0xae7c, 0xae7d,
0xae81, 0xae82, 0xae83, 0xae84, 0xae85, 0xae86, 0xae87, 0xae88,
0xae89, 0xae8a, 0xae8b, 0xae8c, 0xae8d, 0xae8e, 0xae8f, 0xae90,
0xae91, 0xae93, 0xae94, 0xae95, 0xae96, 0xae97, 0xae98, 0xae99,
0xae9a, 0xae9b, 0xae9c, 0xae9d, 0xaea1, 0xaea2, 0xaea3, 0xaea4,
0xaea5, 0xaea6, 0xaea7, 0xaea8, 0xaea9, 0xaeaa, 0xaeab, 0xaeac,
0xaead, 0xaeae, 0xaeaf, 0xaeb0, 0xaeb1, 0xaeb3, 0xaeb4, 0xaeb5,
0xaeb6, 0xaeb7, 0xaeb8, 0xaeb9, 0xaeba, 0xaebb, 0xaebc, 0xaebd,
0xaec1, 0xaec2, 0xaec3, 0xaec4, 0xaec5, 0xaec6, 0xaec7, 0xaec8,
0xaec9, 0xaeca, 0xaecb, 0xaecc, 0xaecd, 0xaece, 0xaecf, 0xaed0,
0xaed1, 0xaed3, 0xaed4, 0xaed5, 0xaed6, 0xaed7, 0xaed8, 0xaed9,
0xaeda, 0xaedb, 0xaedc, 0xaedd, 0xaee1, 0xaee2, 0xaee3, 0xaee4,
0xaee5, 0xaee6, 0xaee7, 0xaee8, 0xaee9, 0xaeea, 0xaeeb, 0xaeec,
0xaeed, 0xaeee, 0xaeef, 0xaef0, 0xaef1, 0xaef3, 0xaef4, 0xaef5,
0xaef6, 0xaef7, 0xaef8, 0xaef9, 0xaefa, 0xaefb, 0xaefc, 0xaefd,
0xaf41, 0xaf42, 0xaf43, 0xaf44, 0xaf45, 0xaf46, 0xaf47, 0xaf48,
0xaf49, 0xaf4a, 0xaf4b, 0xaf4c, 0xaf4d, 0xaf4e, 0xaf4f, 0xaf50,
0xaf51, 0xaf53, 0xaf54, 0xaf55, 0xaf56, 0xaf57, 0xaf58, 0xaf59,
0xaf5a, 0xaf5b, 0xaf5c, 0xaf5d, 0xaf61, 0xaf62, 0xaf63, 0xaf64,
0xaf65, 0xaf66, 0xaf67, 0xaf68, 0xaf69, 0xaf6a, 0xaf6b, 0xaf6c,
0xaf6d, 0xaf6e, 0xaf6f, 0xaf70, 0xaf71, 0xaf73, 0xaf74, 0xaf75,
0xaf76, 0xaf77, 0xaf78, 0xaf79, 0xaf7a, 0xaf7b, 0xaf7c, 0xaf7d,
0xaf81, 0xaf82, 0xaf83, 0xaf84, 0xaf85, 0xaf86, 0xaf87, 0xaf88,
0xaf89, 0xaf8a, 0xaf8b, 0xaf8c, 0xaf8d, 0xaf8e, 0xaf8f, 0xaf90,
0xaf91, 0xaf93, 0xaf94, 0xaf95, 0xaf96, 0xaf97, 0xaf98, 0xaf99,
0xaf9a, 0xaf9b, 0xaf9c, 0xaf9d, 0xafa1, 0xafa2, 0xafa3, 0xafa4,
0xafa5, 0xafa6, 0xafa7, 0xafa8, 0xafa9, 0xafaa, 0xafab, 0xafac,
0xafad, 0xafae, 0xafaf, 0xafb0, 0xafb1, 0xafb3, 0xafb4, 0xafb5,
0xafb6, 0xafb7, 0xafb8, 0xafb9, 0xafba, 0xafbb, 0xafbc, 0xafbd,
0xb061, 0xb062, 0xb063, 0xb064, 0xb065, 0xb066, 0xb067, 0xb068,
0xb069, 0xb06a, 0xb06b, 0xb06c, 0xb06d, 0xb06e, 0xb06f, 0xb070,
0xb071, 0xb073, 0xb074, 0xb075, 0xb076, 0xb077, 0xb078, 0xb079,
0xb07a, 0xb07b, 0xb07c, 0xb07d, 0xb081, 0xb082, 0xb083, 0xb084,
0xb085, 0xb086, 0xb087, 0xb088, 0xb089, 0xb08a, 0xb08b, 0xb08c,
0xb08d, 0xb08e, 0xb08f, 0xb090, 0xb091, 0xb093, 0xb094, 0xb095,
0xb096, 0xb097, 0xb098, 0xb099, 0xb09a, 0xb09b, 0xb09c, 0xb09d,
0xb0a1, 0xb0a2, 0xb0a3, 0xb0a4, 0xb0a5, 0xb0a6, 0xb0a7, 0xb0a8,
0xb0a9, 0xb0aa, 0xb0ab, 0xb0ac, 0xb0ad, 0xb0ae, 0xb0af, 0xb0b0,
0xb0b1, 0xb0b3, 0xb0b4, 0xb0b5, 0xb0b6, 0xb0b7, 0xb0b8, 0xb0b9,
0xb0ba, 0xb0bb, 0xb0bc, 0xb0bd, 0xb0c1, 0xb0c2, 0xb0c3, 0xb0c4,
0xb0c5, 0xb0c6, 0xb0c7, 0xb0c8, 0xb0c9, 0xb0ca, 0xb0cb, 0xb0cc,
0xb0cd, 0xb0ce, 0xb0cf, 0xb0d0, 0xb0d1, 0xb0d3, 0xb0d4, 0xb0d5,
0xb0d6, 0xb0d7, 0xb0d8, 0xb0d9, 0xb0da, 0xb0db, 0xb0dc, 0xb0dd,
0xb0e1, 0xb0e2, 0xb0e3, 0xb0e4, 0xb0e5, 0xb0e6, 0xb0e7, 0xb0e8,
0xb0e9, 0xb0ea, 0xb0eb, 0xb0ec, 0xb0ed, 0xb0ee, 0xb0ef, 0xb0f0,
0xb0f1, 0xb0f3, 0xb0f4, 0xb0f5, 0xb0f6, 0xb0f7, 0xb0f8, 0xb0f9,
0xb0fa, 0xb0fb, 0xb0fc, 0xb0fd, 0xb141, 0xb142, 0xb143, 0xb144,
0xb145, 0xb146, 0xb147, 0xb148, 0xb149, 0xb14a, 0xb14b, 0xb14c,
0xb14d, 0xb14e, 0xb14f, 0xb150, 0xb151, 0xb153, 0xb154, 0xb155,
0xb156, 0xb157, 0xb158, 0xb159, 0xb15a, 0xb15b, 0xb15c, 0xb15d,
0xb161, 0xb162, 0xb163, 0xb164, 0xb165, 0xb166, 0xb167, 0xb168,
0xb169, 0xb16a, 0xb16b, 0xb16c, 0xb16d, 0xb16e, 0xb16f, 0xb170,
0xb171, 0xb173, 0xb174, 0xb175, 0xb176, 0xb177, 0xb178, 0xb179,
0xb17a, 0xb17b, 0xb17c, 0xb17d, 0xb181, 0xb182, 0xb183, 0xb184,
0xb185, 0xb186, 0xb187, 0xb188, 0xb189, 0xb18a, 0xb18b, 0xb18c,
0xb18d, 0xb18e, 0xb18f, 0xb190, 0xb191, 0xb193, 0xb194, 0xb195,
0xb196, 0xb197, 0xb198, 0xb199, 0xb19a, 0xb19b, 0xb19c, 0xb19d,
0xb1a1, 0xb1a2, 0xb1a3, 0xb1a4, 0xb1a5, 0xb1a6, 0xb1a7, 0xb1a8,
0xb1a9, 0xb1aa, 0xb1ab, 0xb1ac, 0xb1ad, 0xb1ae, 0xb1af, 0xb1b0,
0xb1b1, 0xb1b3, 0xb1b4, 0xb1b5, 0xb1b6, 0xb1b7, 0xb1b8, 0xb1b9,
0xb1ba, 0xb1bb, 0xb1bc, 0xb1bd, 0xb1c1, 0xb1c2, 0xb1c3, 0xb1c4,
0xb1c5, 0xb1c6, 0xb1c7, 0xb1c8, 0xb1c9, 0xb1ca, 0xb1cb, 0xb1cc,
0xb1cd, 0xb1ce, 0xb1cf, 0xb1d0, 0xb1d1, 0xb1d3, 0xb1d4, 0xb1d5,
0xb1d6, 0xb1d7, 0xb1d8, 0xb1d9, 0xb1da, 0xb1db, 0xb1dc, 0xb1dd,
0xb1e1, 0xb1e2, 0xb1e3, 0xb1e4, 0xb1e5, 0xb1e6, 0xb1e7, 0xb1e8,
0xb1e9, 0xb1ea, 0xb1eb, 0xb1ec, 0xb1ed, 0xb1ee, 0xb1ef, 0xb1f0,
0xb1f1, 0xb1f3, 0xb1f4, 0xb1f5, 0xb1f6, 0xb1f7, 0xb1f8, 0xb1f9,
0xb1fa, 0xb1fb, 0xb1fc, 0xb1fd, 0xb241, 0xb242, 0xb243, 0xb244,
0xb245, 0xb246, 0xb247, 0xb248, 0xb249, 0xb24a, 0xb24b, 0xb24c,
0xb24d, 0xb24e, 0xb24f, 0xb250, 0xb251, 0xb253, 0xb254, 0xb255,
0xb256, 0xb257, 0xb258, 0xb259, 0xb25a, 0xb25b, 0xb25c, 0xb25d,
0xb261, 0xb262, 0xb263, 0xb264, 0xb265, 0xb266, 0xb267, 0xb268,
0xb269, 0xb26a, 0xb26b, 0xb26c, 0xb26d, 0xb26e, 0xb26f, 0xb270,
0xb271, 0xb273, 0xb274, 0xb275, 0xb276, 0xb277, 0xb278, 0xb279,
0xb27a, 0xb27b, 0xb27c, 0xb27d, 0xb281, 0xb282, 0xb283, 0xb284,
0xb285, 0xb286, 0xb287, 0xb288, 0xb289, 0xb28a, 0xb28b, 0xb28c,
0xb28d, 0xb28e, 0xb28f, 0xb290, 0xb291, 0xb293, 0xb294, 0xb295,
0xb296, 0xb297, 0xb298, 0xb299, 0xb29a, 0xb29b, 0xb29c, 0xb29d,
0xb2a1, 0xb2a2, 0xb2a3, 0xb2a4, 0xb2a5, 0xb2a6, 0xb2a7, 0xb2a8,
0xb2a9, 0xb2aa, 0xb2ab, 0xb2ac, 0xb2ad, 0xb2ae, 0xb2af, 0xb2b0,
0xb2b1, 0xb2b3, 0xb2b4, 0xb2b5, 0xb2b6, 0xb2b7, 0xb2b8, 0xb2b9,
0xb2ba, 0xb2bb, 0xb2bc, 0xb2bd, 0xb2c1, 0xb2c2, 0xb2c3, 0xb2c4,
0xb2c5, 0xb2c6, 0xb2c7, 0xb2c8, 0xb2c9, 0xb2ca, 0xb2cb, 0xb2cc,
0xb2cd, 0xb2ce, 0xb2cf, 0xb2d0, 0xb2d1, 0xb2d3, 0xb2d4, 0xb2d5,
0xb2d6, 0xb2d7, 0xb2d8, 0xb2d9, 0xb2da, 0xb2db, 0xb2dc, 0xb2dd,
0xb2e1, 0xb2e2, 0xb2e3, 0xb2e4, 0xb2e5, 0xb2e6, 0xb2e7, 0xb2e8,
0xb2e9, 0xb2ea, 0xb2eb, 0xb2ec, 0xb2ed, 0xb2ee, 0xb2ef, 0xb2f0,
0xb2f1, 0xb2f3, 0xb2f4, 0xb2f5, 0xb2f6, 0xb2f7, 0xb2f8, 0xb2f9,
0xb2fa, 0xb2fb, 0xb2fc, 0xb2fd, 0xb341, 0xb342, 0xb343, 0xb344,
0xb345, 0xb346, 0xb347, 0xb348, 0xb349, 0xb34a, 0xb34b, 0xb34c,
0xb34d, 0xb34e, 0xb34f, 0xb350, 0xb351, 0xb353, 0xb354, 0xb355,
0xb356, 0xb357, 0xb358, 0xb359, 0xb35a, 0xb35b, 0xb35c, 0xb35d,
0xb361, 0xb362, 0xb363, 0xb364, 0xb365, 0xb366, 0xb367, 0xb368,
0xb369, 0xb36a, 0xb36b, 0xb36c, 0xb36d, 0xb36e, 0xb36f, 0xb370,
0xb371, 0xb373, 0xb374, 0xb375, 0xb376, 0xb377, 0xb378, 0xb379,
0xb37a, 0xb37b, 0xb37c, 0xb37d, 0xb381, 0xb382, 0xb383, 0xb384,
0xb385, 0xb386, 0xb387, 0xb388, 0xb389, 0xb38a, 0xb38b, 0xb38c,
0xb38d, 0xb38e, 0xb38f, 0xb390, 0xb391, 0xb393, 0xb394, 0xb395,
0xb396, 0xb397, 0xb398, 0xb399, 0xb39a, 0xb39b, 0xb39c, 0xb39d,
0xb3a1, 0xb3a2, 0xb3a3, 0xb3a4, 0xb3a5, 0xb3a6, 0xb3a7, 0xb3a8,
0xb3a9, 0xb3aa, 0xb3ab, 0xb3ac, 0xb3ad, 0xb3ae, 0xb3af, 0xb3b0,
0xb3b1, 0xb3b3, 0xb3b4, 0xb3b5, 0xb3b6, 0xb3b7, 0xb3b8, 0xb3b9,
0xb3ba, 0xb3bb, 0xb3bc, 0xb3bd, 0xb461, 0xb462, 0xb463, 0xb464,
0xb465, 0xb466, 0xb467, 0xb468, 0xb469, 0xb46a, 0xb46b, 0xb46c,
0xb46d, 0xb46e, 0xb46f, 0xb470, 0xb471, 0xb473, 0xb474, 0xb475,
0xb476, 0xb477, 0xb478, 0xb479, 0xb47a, 0xb47b, 0xb47c, 0xb47d,
0xb481, 0xb482, 0xb483, 0xb484, 0xb485, 0xb486, 0xb487, 0xb488,
0xb489, 0xb48a, 0xb48b, 0xb48c, 0xb48d, 0xb48e, 0xb48f, 0xb490,
0xb491, 0xb493, 0xb494, 0xb495, 0xb496, 0xb497, 0xb498, 0xb499,
0xb49a, 0xb49b, 0xb49c, 0xb49d, 0xb4a1, 0xb4a2, 0xb4a3, 0xb4a4,
0xb4a5, 0xb4a6, 0xb4a7, 0xb4a8, 0xb4a9, 0xb4aa, 0xb4ab, 0xb4ac,
0xb4ad, 0xb4ae, 0xb4af, 0xb4b0, 0xb4b1, 0xb4b3, 0xb4b4, 0xb4b5,
0xb4b6, 0xb4b7, 0xb4b8, 0xb4b9, 0xb4ba, 0xb4bb, 0xb4bc, 0xb4bd,
0xb4c1, 0xb4c2, 0xb4c3, 0xb4c4, 0xb4c5, 0xb4c6, 0xb4c7, 0xb4c8,
0xb4c9, 0xb4ca, 0xb4cb, 0xb4cc, 0xb4cd, 0xb4ce, 0xb4cf, 0xb4d0,
0xb4d1, 0xb4d3, 0xb4d4, 0xb4d5, 0xb4d6, 0xb4d7, 0xb4d8, 0xb4d9,
0xb4da, 0xb4db, 0xb4dc, 0xb4dd, 0xb4e1, 0xb4e2, 0xb4e3, 0xb4e4,
0xb4e5, 0xb4e6, 0xb4e7, 0xb4e8, 0xb4e9, 0xb4ea, 0xb4eb, 0xb4ec,
0xb4ed, 0xb4ee, 0xb4ef, 0xb4f0, 0xb4f1, 0xb4f3, 0xb4f4, 0xb4f5,
0xb4f6, 0xb4f7, 0xb4f8, 0xb4f9, 0xb4fa, 0xb4fb, 0xb4fc, 0xb4fd,
0xb541, 0xb542, 0xb543, 0xb544, 0xb545, 0xb546, 0xb547, 0xb548,
0xb549, 0xb54a, 0xb54b, 0xb54c, 0xb54d, 0xb54e, 0xb54f, 0xb550,
0xb551, 0xb553, 0xb554, 0xb555, 0xb556, 0xb557, 0xb558, 0xb559,
0xb55a, 0xb55b, 0xb55c, 0xb55d, 0xb561, 0xb562, 0xb563, 0xb564,
0xb565, 0xb566, 0xb567, 0xb568, 0xb569, 0xb56a, 0xb56b, 0xb56c,
0xb56d, 0xb56e, 0xb56f, 0xb570, 0xb571, 0xb573, 0xb574, 0xb575,
0xb576, 0xb577, 0xb578, 0xb579, 0xb57a, 0xb57b, 0xb57c, 0xb57d,
0xb581, 0xb582, 0xb583, 0xb584, 0xb585, 0xb586, 0xb587, 0xb588,
0xb589, 0xb58a, 0xb58b, 0xb58c, 0xb58d, 0xb58e, 0xb58f, 0xb590,
0xb591, 0xb593, 0xb594, 0xb595, 0xb596, 0xb597, 0xb598, 0xb599,
0xb59a, 0xb59b, 0xb59c, 0xb59d, 0xb5a1, 0xb5a2, 0xb5a3, 0xb5a4,
0xb5a5, 0xb5a6, 0xb5a7, 0xb5a8, 0xb5a9, 0xb5aa, 0xb5ab, 0xb5ac,
0xb5ad, 0xb5ae, 0xb5af, 0xb5b0, 0xb5b1, 0xb5b3, 0xb5b4, 0xb5b5,
0xb5b6, 0xb5b7, 0xb5b8, 0xb5b9, 0xb5ba, 0xb5bb, 0xb5bc, 0xb5bd,
0xb5c1, 0xb5c2, 0xb5c3, 0xb5c4, 0xb5c5, 0xb5c6, 0xb5c7, 0xb5c8,
0xb5c9, 0xb5ca, 0xb5cb, 0xb5cc, 0xb5cd, 0xb5ce, 0xb5cf, 0xb5d0,
0xb5d1, 0xb5d3, 0xb5d4, 0xb5d5, 0xb5d6, 0xb5d7, 0xb5d8, 0xb5d9,
0xb5da, 0xb5db, 0xb5dc, 0xb5dd, 0xb5e1, 0xb5e2, 0xb5e3, 0xb5e4,
0xb5e5, 0xb5e6, 0xb5e7, 0xb5e8, 0xb5e9, 0xb5ea, 0xb5eb, 0xb5ec,
0xb5ed, 0xb5ee, 0xb5ef, 0xb5f0, 0xb5f1, 0xb5f3, 0xb5f4, 0xb5f5,
0xb5f6, 0xb5f7, 0xb5f8, 0xb5f9, 0xb5fa, 0xb5fb, 0xb5fc, 0xb5fd,
0xb641, 0xb642, 0xb643, 0xb644, 0xb645, 0xb646, 0xb647, 0xb648,
0xb649, 0xb64a, 0xb64b, 0xb64c, 0xb64d, 0xb64e, 0xb64f, 0xb650,
0xb651, 0xb653, 0xb654, 0xb655, 0xb656, 0xb657, 0xb658, 0xb659,
0xb65a, 0xb65b, 0xb65c, 0xb65d, 0xb661, 0xb662, 0xb663, 0xb664,
0xb665, 0xb666, 0xb667, 0xb668, 0xb669, 0xb66a, 0xb66b, 0xb66c,
0xb66d, 0xb66e, 0xb66f, 0xb670, 0xb671, 0xb673, 0xb674, 0xb675,
0xb676, 0xb677, 0xb678, 0xb679, 0xb67a, 0xb67b, 0xb67c, 0xb67d,
0xb681, 0xb682, 0xb683, 0xb684, 0xb685, 0xb686, 0xb687, 0xb688,
0xb689, 0xb68a, 0xb68b, 0xb68c, 0xb68d, 0xb68e, 0xb68f, 0xb690,
0xb691, 0xb693, 0xb694, 0xb695, 0xb696, 0xb697, 0xb698, 0xb699,
0xb69a, 0xb69b, 0xb69c, 0xb69d, 0xb6a1, 0xb6a2, 0xb6a3, 0xb6a4,
0xb6a5, 0xb6a6, 0xb6a7, 0xb6a8, 0xb6a9, 0xb6aa, 0xb6ab, 0xb6ac,
0xb6ad, 0xb6ae, 0xb6af, 0xb6b0, 0xb6b1, 0xb6b3, 0xb6b4, 0xb6b5,
0xb6b6, 0xb6b7, 0xb6b8, 0xb6b9, 0xb6ba, 0xb6bb, 0xb6bc, 0xb6bd,
0xb6c1, 0xb6c2, 0xb6c3, 0xb6c4, 0xb6c5, 0xb6c6, 0xb6c7, 0xb6c8,
0xb6c9, 0xb6ca, 0xb6cb, 0xb6cc, 0xb6cd, 0xb6ce, 0xb6cf, 0xb6d0,
0xb6d1, 0xb6d3, 0xb6d4, 0xb6d5, 0xb6d6, 0xb6d7, 0xb6d8, 0xb6d9,
0xb6da, 0xb6db, 0xb6dc, 0xb6dd, 0xb6e1, 0xb6e2, 0xb6e3, 0xb6e4,
0xb6e5, 0xb6e6, 0xb6e7, 0xb6e8, 0xb6e9, 0xb6ea, 0xb6eb, 0xb6ec,
0xb6ed, 0xb6ee, 0xb6ef, 0xb6f0, 0xb6f1, 0xb6f3, 0xb6f4, 0xb6f5,
0xb6f6, 0xb6f7, 0xb6f8, 0xb6f9, 0xb6fa, 0xb6fb, 0xb6fc, 0xb6fd,
0xb741, 0xb742, 0xb743, 0xb744, 0xb745, 0xb746, 0xb747, 0xb748,
0xb749, 0xb74a, 0xb74b, 0xb74c, 0xb74d, 0xb74e, 0xb74f, 0xb750,
0xb751, 0xb753, 0xb754, 0xb755, 0xb756, 0xb757, 0xb758, 0xb759,
0xb75a, 0xb75b, 0xb75c, 0xb75d, 0xb761, 0xb762, 0xb763, 0xb764,
0xb765, 0xb766, 0xb767, 0xb768, 0xb769, 0xb76a, 0xb76b, 0xb76c,
0xb76d, 0xb76e, 0xb76f, 0xb770, 0xb771, 0xb773, 0xb774, 0xb775,
0xb776, 0xb777, 0xb778, 0xb779, 0xb77a, 0xb77b, 0xb77c, 0xb77d,
0xb781, 0xb782, 0xb783, 0xb784, 0xb785, 0xb786, 0xb787, 0xb788,
0xb789, 0xb78a, 0xb78b, 0xb78c, 0xb78d, 0xb78e, 0xb78f, 0xb790,
0xb791, 0xb793, 0xb794, 0xb795, 0xb796, 0xb797, 0xb798, 0xb799,
0xb79a, 0xb79b, 0xb79c, 0xb79d, 0xb7a1, 0xb7a2, 0xb7a3, 0xb7a4,
0xb7a5, 0xb7a6, 0xb7a7, 0xb7a8, 0xb7a9, 0xb7aa, 0xb7ab, 0xb7ac,
0xb7ad, 0xb7ae, 0xb7af, 0xb7b0, 0xb7b1, 0xb7b3, 0xb7b4, 0xb7b5,
0xb7b6, 0xb7b7, 0xb7b8, 0xb7b9, 0xb7ba, 0xb7bb, 0xb7bc, 0xb7bd,
0xb861, 0xb862, 0xb863, 0xb864, 0xb865, 0xb866, 0xb867, 0xb868,
0xb869, 0xb86a, 0xb86b, 0xb86c, 0xb86d, 0xb86e, 0xb86f, 0xb870,
0xb871, 0xb873, 0xb874, 0xb875, 0xb876, 0xb877, 0xb878, 0xb879,
0xb87a, 0xb87b, 0xb87c, 0xb87d, 0xb881, 0xb882, 0xb883, 0xb884,
0xb885, 0xb886, 0xb887, 0xb888, 0xb889, 0xb88a, 0xb88b, 0xb88c,
0xb88d, 0xb88e, 0xb88f, 0xb890, 0xb891, 0xb893, 0xb894, 0xb895,
0xb896, 0xb897, 0xb898, 0xb899, 0xb89a, 0xb89b, 0xb89c, 0xb89d,
0xb8a1, 0xb8a2, 0xb8a3, 0xb8a4, 0xb8a5, 0xb8a6, 0xb8a7, 0xb8a8,
0xb8a9, 0xb8aa, 0xb8ab, 0xb8ac, 0xb8ad, 0xb8ae, 0xb8af, 0xb8b0,
0xb8b1, 0xb8b3, 0xb8b4, 0xb8b5, 0xb8b6, 0xb8b7, 0xb8b8, 0xb8b9,
0xb8ba, 0xb8bb, 0xb8bc, 0xb8bd, 0xb8c1, 0xb8c2, 0xb8c3, 0xb8c4,
0xb8c5, 0xb8c6, 0xb8c7, 0xb8c8, 0xb8c9, 0xb8ca, 0xb8cb, 0xb8cc,
0xb8cd, 0xb8ce, 0xb8cf, 0xb8d0, 0xb8d1, 0xb8d3, 0xb8d4, 0xb8d5,
0xb8d6, 0xb8d7, 0xb8d8, 0xb8d9, 0xb8da, 0xb8db, 0xb8dc, 0xb8dd,
0xb8e1, 0xb8e2, 0xb8e3, 0xb8e4, 0xb8e5, 0xb8e6, 0xb8e7, 0xb8e8,
0xb8e9, 0xb8ea, 0xb8eb, 0xb8ec, 0xb8ed, 0xb8ee, 0xb8ef, 0xb8f0,
0xb8f1, 0xb8f3, 0xb8f4, 0xb8f5, 0xb8f6, 0xb8f7, 0xb8f8, 0xb8f9,
0xb8fa, 0xb8fb, 0xb8fc, 0xb8fd, 0xb941, 0xb942, 0xb943, 0xb944,
0xb945, 0xb946, 0xb947, 0xb948, 0xb949, 0xb94a, 0xb94b, 0xb94c,
0xb94d, 0xb94e, 0xb94f, 0xb950, 0xb951, 0xb953, 0xb954, 0xb955,
0xb956, 0xb957, 0xb958, 0xb959, 0xb95a, 0xb95b, 0xb95c, 0xb95d,
0xb961, 0xb962, 0xb963, 0xb964, 0xb965, 0xb966, 0xb967, 0xb968,
0xb969, 0xb96a, 0xb96b, 0xb96c, 0xb96d, 0xb96e, 0xb96f, 0xb970,
0xb971, 0xb973, 0xb974, 0xb975, 0xb976, 0xb977, 0xb978, 0xb979,
0xb97a, 0xb97b, 0xb97c, 0xb97d, 0xb981, 0xb982, 0xb983, 0xb984,
0xb985, 0xb986, 0xb987, 0xb988, 0xb989, 0xb98a, 0xb98b, 0xb98c,
0xb98d, 0xb98e, 0xb98f, 0xb990, 0xb991, 0xb993, 0xb994, 0xb995,
0xb996, 0xb997, 0xb998, 0xb999, 0xb99a, 0xb99b, 0xb99c, 0xb99d,
0xb9a1, 0xb9a2, 0xb9a3, 0xb9a4, 0xb9a5, 0xb9a6, 0xb9a7, 0xb9a8,
0xb9a9, 0xb9aa, 0xb9ab, 0xb9ac, 0xb9ad, 0xb9ae, 0xb9af, 0xb9b0,
0xb9b1, 0xb9b3, 0xb9b4, 0xb9b5, 0xb9b6, 0xb9b7, 0xb9b8, 0xb9b9,
0xb9ba, 0xb9bb, 0xb9bc, 0xb9bd, 0xb9c1, 0xb9c2, 0xb9c3, 0xb9c4,
0xb9c5, 0xb9c6, 0xb9c7, 0xb9c8, 0xb9c9, 0xb9ca, 0xb9cb, 0xb9cc,
0xb9cd, 0xb9ce, 0xb9cf, 0xb9d0, 0xb9d1, 0xb9d3, 0xb9d4, 0xb9d5,
0xb9d6, 0xb9d7, 0xb9d8, 0xb9d9, 0xb9da, 0xb9db, 0xb9dc, 0xb9dd,
0xb9e1, 0xb9e2, 0xb9e3, 0xb9e4, 0xb9e5, 0xb9e6, 0xb9e7, 0xb9e8,
0xb9e9, 0xb9ea, 0xb9eb, 0xb9ec, 0xb9ed, 0xb9ee, 0xb9ef, 0xb9f0,
0xb9f1, 0xb9f3, 0xb9f4, 0xb9f5, 0xb9f6, 0xb9f7, 0xb9f8, 0xb9f9,
0xb9fa, 0xb9fb, 0xb9fc, 0xb9fd, 0xba41, 0xba42, 0xba43, 0xba44,
0xba45, 0xba46, 0xba47, 0xba48, 0xba49, 0xba4a, 0xba4b, 0xba4c,
0xba4d, 0xba4e, 0xba4f, 0xba50, 0xba51, 0xba53, 0xba54, 0xba55,
0xba56, 0xba57, 0xba58, 0xba59, 0xba5a, 0xba5b, 0xba5c, 0xba5d,
0xba61, 0xba62, 0xba63, 0xba64, 0xba65, 0xba66, 0xba67, 0xba68,
0xba69, 0xba6a, 0xba6b, 0xba6c, 0xba6d, 0xba6e, 0xba6f, 0xba70,
0xba71, 0xba73, 0xba74, 0xba75, 0xba76, 0xba77, 0xba78, 0xba79,
0xba7a, 0xba7b, 0xba7c, 0xba7d, 0xba81, 0xba82, 0xba83, 0xba84,
0xba85, 0xba86, 0xba87, 0xba88, 0xba89, 0xba8a, 0xba8b, 0xba8c,
0xba8d, 0xba8e, 0xba8f, 0xba90, 0xba91, 0xba93, 0xba94, 0xba95,
0xba96, 0xba97, 0xba98, 0xba99, 0xba9a, 0xba9b, 0xba9c, 0xba9d,
0xbaa1, 0xbaa2, 0xbaa3, 0xbaa4, 0xbaa5, 0xbaa6, 0xbaa7, 0xbaa8,
0xbaa9, 0xbaaa, 0xbaab, 0xbaac, 0xbaad, 0xbaae, 0xbaaf, 0xbab0,
0xbab1, 0xbab3, 0xbab4, 0xbab5, 0xbab6, 0xbab7, 0xbab8, 0xbab9,
0xbaba, 0xbabb, 0xbabc, 0xbabd, 0xbac1, 0xbac2, 0xbac3, 0xbac4,
0xbac5, 0xbac6, 0xbac7, 0xbac8, 0xbac9, 0xbaca, 0xbacb, 0xbacc,
0xbacd, 0xbace, 0xbacf, 0xbad0, 0xbad1, 0xbad3, 0xbad4, 0xbad5,
0xbad6, 0xbad7, 0xbad8, 0xbad9, 0xbada, 0xbadb, 0xbadc, 0xbadd,
0xbae1, 0xbae2, 0xbae3, 0xbae4, 0xbae5, 0xbae6, 0xbae7, 0xbae8,
0xbae9, 0xbaea, 0xbaeb, 0xbaec, 0xbaed, 0xbaee, 0xbaef, 0xbaf0,
0xbaf1, 0xbaf3, 0xbaf4, 0xbaf5, 0xbaf6, 0xbaf7, 0xbaf8, 0xbaf9,
0xbafa, 0xbafb, 0xbafc, 0xbafd, 0xbb41, 0xbb42, 0xbb43, 0xbb44,
0xbb45, 0xbb46, 0xbb47, 0xbb48, 0xbb49, 0xbb4a, 0xbb4b, 0xbb4c,
0xbb4d, 0xbb4e, 0xbb4f, 0xbb50, 0xbb51, 0xbb53, 0xbb54, 0xbb55,
0xbb56, 0xbb57, 0xbb58, 0xbb59, 0xbb5a, 0xbb5b, 0xbb5c, 0xbb5d,
0xbb61, 0xbb62, 0xbb63, 0xbb64, 0xbb65, 0xbb66, 0xbb67, 0xbb68,
0xbb69, 0xbb6a, 0xbb6b, 0xbb6c, 0xbb6d, 0xbb6e, 0xbb6f, 0xbb70,
0xbb71, 0xbb73, 0xbb74, 0xbb75, 0xbb76, 0xbb77, 0xbb78, 0xbb79,
0xbb7a, 0xbb7b, 0xbb7c, 0xbb7d, 0xbb81, 0xbb82, 0xbb83, 0xbb84,
0xbb85, 0xbb86, 0xbb87, 0xbb88, 0xbb89, 0xbb8a, 0xbb8b, 0xbb8c,
0xbb8d, 0xbb8e, 0xbb8f, 0xbb90, 0xbb91, 0xbb93, 0xbb94, 0xbb95,
0xbb96, 0xbb97, 0xbb98, 0xbb99, 0xbb9a, 0xbb9b, 0xbb9c, 0xbb9d,
0xbba1, 0xbba2, 0xbba3, 0xbba4, 0xbba5, 0xbba6, 0xbba7, 0xbba8,
0xbba9, 0xbbaa, 0xbbab, 0xbbac, 0xbbad, 0xbbae, 0xbbaf, 0xbbb0,
0xbbb1, 0xbbb3, 0xbbb4, 0xbbb5, 0xbbb6, 0xbbb7, 0xbbb8, 0xbbb9,
0xbbba, 0xbbbb, 0xbbbc, 0xbbbd, 0xbc61, 0xbc62, 0xbc63, 0xbc64,
0xbc65, 0xbc66, 0xbc67, 0xbc68, 0xbc69, 0xbc6a, 0xbc6b, 0xbc6c,
0xbc6d, 0xbc6e, 0xbc6f, 0xbc70, 0xbc71, 0xbc73, 0xbc74, 0xbc75,
0xbc76, 0xbc77, 0xbc78, 0xbc79, 0xbc7a, 0xbc7b, 0xbc7c, 0xbc7d,
0xbc81, 0xbc82, 0xbc83, 0xbc84, 0xbc85, 0xbc86, 0xbc87, 0xbc88,
0xbc89, 0xbc8a, 0xbc8b, 0xbc8c, 0xbc8d, 0xbc8e, 0xbc8f, 0xbc90,
0xbc91, 0xbc93, 0xbc94, 0xbc95, 0xbc96, 0xbc97, 0xbc98, 0xbc99,
0xbc9a, 0xbc9b, 0xbc9c, 0xbc9d, 0xbca1, 0xbca2, 0xbca3, 0xbca4,
0xbca5, 0xbca6, 0xbca7, 0xbca8, 0xbca9, 0xbcaa, 0xbcab, 0xbcac,
0xbcad, 0xbcae, 0xbcaf, 0xbcb0, 0xbcb1, 0xbcb3, 0xbcb4, 0xbcb5,
0xbcb6, 0xbcb7, 0xbcb8, 0xbcb9, 0xbcba, 0xbcbb, 0xbcbc, 0xbcbd,
0xbcc1, 0xbcc2, 0xbcc3, 0xbcc4, 0xbcc5, 0xbcc6, 0xbcc7, 0xbcc8,
0xbcc9, 0xbcca, 0xbccb, 0xbccc, 0xbccd, 0xbcce, 0xbccf, 0xbcd0,
0xbcd1, 0xbcd3, 0xbcd4, 0xbcd5, 0xbcd6, 0xbcd7, 0xbcd8, 0xbcd9,
0xbcda, 0xbcdb, 0xbcdc, 0xbcdd, 0xbce1, 0xbce2, 0xbce3, 0xbce4,
0xbce5, 0xbce6, 0xbce7, 0xbce8, 0xbce9, 0xbcea, 0xbceb, 0xbcec,
0xbced, 0xbcee, 0xbcef, 0xbcf0, 0xbcf1, 0xbcf3, 0xbcf4, 0xbcf5,
0xbcf6, 0xbcf7, 0xbcf8, 0xbcf9, 0xbcfa, 0xbcfb, 0xbcfc, 0xbcfd,
0xbd41, 0xbd42, 0xbd43, 0xbd44, 0xbd45, 0xbd46, 0xbd47, 0xbd48,
0xbd49, 0xbd4a, 0xbd4b, 0xbd4c, 0xbd4d, 0xbd4e, 0xbd4f, 0xbd50,
0xbd51, 0xbd53, 0xbd54, 0xbd55, 0xbd56, 0xbd57, 0xbd58, 0xbd59,
0xbd5a, 0xbd5b, 0xbd5c, 0xbd5d, 0xbd61, 0xbd62, 0xbd63, 0xbd64,
0xbd65, 0xbd66, 0xbd67, 0xbd68, 0xbd69, 0xbd6a, 0xbd6b, 0xbd6c,
0xbd6d, 0xbd6e, 0xbd6f, 0xbd70, 0xbd71, 0xbd73, 0xbd74, 0xbd75,
0xbd76, 0xbd77, 0xbd78, 0xbd79, 0xbd7a, 0xbd7b, 0xbd7c, 0xbd7d,
0xbd81, 0xbd82, 0xbd83, 0xbd84, 0xbd85, 0xbd86, 0xbd87, 0xbd88,
0xbd89, 0xbd8a, 0xbd8b, 0xbd8c, 0xbd8d, 0xbd8e, 0xbd8f, 0xbd90,
0xbd91, 0xbd93, 0xbd94, 0xbd95, 0xbd96, 0xbd97, 0xbd98, 0xbd99,
0xbd9a, 0xbd9b, 0xbd9c, 0xbd9d, 0xbda1, 0xbda2, 0xbda3, 0xbda4,
0xbda5, 0xbda6, 0xbda7, 0xbda8, 0xbda9, 0xbdaa, 0xbdab, 0xbdac,
0xbdad, 0xbdae, 0xbdaf, 0xbdb0, 0xbdb1, 0xbdb3, 0xbdb4, 0xbdb5,
0xbdb6, 0xbdb7, 0xbdb8, 0xbdb9, 0xbdba, 0xbdbb, 0xbdbc, 0xbdbd,
0xbdc1, 0xbdc2, 0xbdc3, 0xbdc4, 0xbdc5, 0xbdc6, 0xbdc7, 0xbdc8,
0xbdc9, 0xbdca, 0xbdcb, 0xbdcc, 0xbdcd, 0xbdce, 0xbdcf, 0xbdd0,
0xbdd1, 0xbdd3, 0xbdd4, 0xbdd5, 0xbdd6, 0xbdd7, 0xbdd8, 0xbdd9,
0xbdda, 0xbddb, 0xbddc, 0xbddd, 0xbde1, 0xbde2, 0xbde3, 0xbde4,
0xbde5, 0xbde6, 0xbde7, 0xbde8, 0xbde9, 0xbdea, 0xbdeb, 0xbdec,
0xbded, 0xbdee, 0xbdef, 0xbdf0, 0xbdf1, 0xbdf3, 0xbdf4, 0xbdf5,
0xbdf6, 0xbdf7, 0xbdf8, 0xbdf9, 0xbdfa, 0xbdfb, 0xbdfc, 0xbdfd,
0xbe41, 0xbe42, 0xbe43, 0xbe44, 0xbe45, 0xbe46, 0xbe47, 0xbe48,
0xbe49, 0xbe4a, 0xbe4b, 0xbe4c, 0xbe4d, 0xbe4e, 0xbe4f, 0xbe50,
0xbe51, 0xbe53, 0xbe54, 0xbe55, 0xbe56, 0xbe57, 0xbe58, 0xbe59,
0xbe5a, 0xbe5b, 0xbe5c, 0xbe5d, 0xbe61, 0xbe62, 0xbe63, 0xbe64,
0xbe65, 0xbe66, 0xbe67, 0xbe68, 0xbe69, 0xbe6a, 0xbe6b, 0xbe6c,
0xbe6d, 0xbe6e, 0xbe6f, 0xbe70, 0xbe71, 0xbe73, 0xbe74, 0xbe75,
0xbe76, 0xbe77, 0xbe78, 0xbe79, 0xbe7a, 0xbe7b, 0xbe7c, 0xbe7d,
0xbe81, 0xbe82, 0xbe83, 0xbe84, 0xbe85, 0xbe86, 0xbe87, 0xbe88,
0xbe89, 0xbe8a, 0xbe8b, 0xbe8c, 0xbe8d, 0xbe8e, 0xbe8f, 0xbe90,
0xbe91, 0xbe93, 0xbe94, 0xbe95, 0xbe96, 0xbe97, 0xbe98, 0xbe99,
0xbe9a, 0xbe9b, 0xbe9c, 0xbe9d, 0xbea1, 0xbea2, 0xbea3, 0xbea4,
0xbea5, 0xbea6, 0xbea7, 0xbea8, 0xbea9, 0xbeaa, 0xbeab, 0xbeac,
0xbead, 0xbeae, 0xbeaf, 0xbeb0, 0xbeb1, 0xbeb3, 0xbeb4, 0xbeb5,
0xbeb6, 0xbeb7, 0xbeb8, 0xbeb9, 0xbeba, 0xbebb, 0xbebc, 0xbebd,
0xbec1, 0xbec2, 0xbec3, 0xbec4, 0xbec5, 0xbec6, 0xbec7, 0xbec8,
0xbec9, 0xbeca, 0xbecb, 0xbecc, 0xbecd, 0xbece, 0xbecf, 0xbed0,
0xbed1, 0xbed3, 0xbed4, 0xbed5, 0xbed6, 0xbed7, 0xbed8, 0xbed9,
0xbeda, 0xbedb, 0xbedc, 0xbedd, 0xbee1, 0xbee2, 0xbee3, 0xbee4,
0xbee5, 0xbee6, 0xbee7, 0xbee8, 0xbee9, 0xbeea, 0xbeeb, 0xbeec,
0xbeed, 0xbeee, 0xbeef, 0xbef0, 0xbef1, 0xbef3, 0xbef4, 0xbef5,
0xbef6, 0xbef7, 0xbef8, 0xbef9, 0xbefa, 0xbefb, 0xbefc, 0xbefd,
0xbf41, 0xbf42, 0xbf43, 0xbf44, 0xbf45, 0xbf46, 0xbf47, 0xbf48,
0xbf49, 0xbf4a, 0xbf4b, 0xbf4c, 0xbf4d, 0xbf4e, 0xbf4f, 0xbf50,
0xbf51, 0xbf53, 0xbf54, 0xbf55, 0xbf56, 0xbf57, 0xbf58, 0xbf59,
0xbf5a, 0xbf5b, 0xbf5c, 0xbf5d, 0xbf61, 0xbf62, 0xbf63, 0xbf64,
0xbf65, 0xbf66, 0xbf67, 0xbf68, 0xbf69, 0xbf6a, 0xbf6b, 0xbf6c,
0xbf6d, 0xbf6e, 0xbf6f, 0xbf70, 0xbf71, 0xbf73, 0xbf74, 0xbf75,
0xbf76, 0xbf77, 0xbf78, 0xbf79, 0xbf7a, 0xbf7b, 0xbf7c, 0xbf7d,
0xbf81, 0xbf82, 0xbf83, 0xbf84, 0xbf85, 0xbf86, 0xbf87, 0xbf88,
0xbf89, 0xbf8a, 0xbf8b, 0xbf8c, 0xbf8d, 0xbf8e, 0xbf8f, 0xbf90,
0xbf91, 0xbf93, 0xbf94, 0xbf95, 0xbf96, 0xbf97, 0xbf98, 0xbf99,
0xbf9a, 0xbf9b, 0xbf9c, 0xbf9d, 0xbfa1, 0xbfa2, 0xbfa3, 0xbfa4,
0xbfa5, 0xbfa6, 0xbfa7, 0xbfa8, 0xbfa9, 0xbfaa, 0xbfab, 0xbfac,
0xbfad, 0xbfae, 0xbfaf, 0xbfb0, 0xbfb1, 0xbfb3, 0xbfb4, 0xbfb5,
0xbfb6, 0xbfb7, 0xbfb8, 0xbfb9, 0xbfba, 0xbfbb, 0xbfbc, 0xbfbd,
0xc061, 0xc062, 0xc063, 0xc064, 0xc065, 0xc066, 0xc067, 0xc068,
0xc069, 0xc06a, 0xc06b, 0xc06c, 0xc06d, 0xc06e, 0xc06f, 0xc070,
0xc071, 0xc073, 0xc074, 0xc075, 0xc076, 0xc077, 0xc078, 0xc079,
0xc07a, 0xc07b, 0xc07c, 0xc07d, 0xc081, 0xc082, 0xc083, 0xc084,
0xc085, 0xc086, 0xc087, 0xc088, 0xc089, 0xc08a, 0xc08b, 0xc08c,
0xc08d, 0xc08e, 0xc08f, 0xc090, 0xc091, 0xc093, 0xc094, 0xc095,
0xc096, 0xc097, 0xc098, 0xc099, 0xc09a, 0xc09b, 0xc09c, 0xc09d,
0xc0a1, 0xc0a2, 0xc0a3, 0xc0a4, 0xc0a5, 0xc0a6, 0xc0a7, 0xc0a8,
0xc0a9, 0xc0aa, 0xc0ab, 0xc0ac, 0xc0ad, 0xc0ae, 0xc0af, 0xc0b0,
0xc0b1, 0xc0b3, 0xc0b4, 0xc0b5, 0xc0b6, 0xc0b7, 0xc0b8, 0xc0b9,
0xc0ba, 0xc0bb, 0xc0bc, 0xc0bd, 0xc0c1, 0xc0c2, 0xc0c3, 0xc0c4,
0xc0c5, 0xc0c6, 0xc0c7, 0xc0c8, 0xc0c9, 0xc0ca, 0xc0cb, 0xc0cc,
0xc0cd, 0xc0ce, 0xc0cf, 0xc0d0, 0xc0d1, 0xc0d3, 0xc0d4, 0xc0d5,
0xc0d6, 0xc0d7, 0xc0d8, 0xc0d9, 0xc0da, 0xc0db, 0xc0dc, 0xc0dd,
0xc0e1, 0xc0e2, 0xc0e3, 0xc0e4, 0xc0e5, 0xc0e6, 0xc0e7, 0xc0e8,
0xc0e9, 0xc0ea, 0xc0eb, 0xc0ec, 0xc0ed, 0xc0ee, 0xc0ef, 0xc0f0,
0xc0f1, 0xc0f3, 0xc0f4, 0xc0f5, 0xc0f6, 0xc0f7, 0xc0f8, 0xc0f9,
0xc0fa, 0xc0fb, 0xc0fc, 0xc0fd, 0xc141, 0xc142, 0xc143, 0xc144,
0xc145, 0xc146, 0xc147, 0xc148, 0xc149, 0xc14a, 0xc14b, 0xc14c,
0xc14d, 0xc14e, 0xc14f, 0xc150, 0xc151, 0xc153, 0xc154, 0xc155,
0xc156, 0xc157, 0xc158, 0xc159, 0xc15a, 0xc15b, 0xc15c, 0xc15d,
0xc161, 0xc162, 0xc163, 0xc164, 0xc165, 0xc166, 0xc167, 0xc168,
0xc169, 0xc16a, 0xc16b, 0xc16c, 0xc16d, 0xc16e, 0xc16f, 0xc170,
0xc171, 0xc173, 0xc174, 0xc175, 0xc176, 0xc177, 0xc178, 0xc179,
0xc17a, 0xc17b, 0xc17c, 0xc17d, 0xc181, 0xc182, 0xc183, 0xc184,
0xc185, 0xc186, 0xc187, 0xc188, 0xc189, 0xc18a, 0xc18b, 0xc18c,
0xc18d, 0xc18e, 0xc18f, 0xc190, 0xc191, 0xc193, 0xc194, 0xc195,
0xc196, 0xc197, 0xc198, 0xc199, 0xc19a, 0xc19b, 0xc19c, 0xc19d,
0xc1a1, 0xc1a2, 0xc1a3, 0xc1a4, 0xc1a5, 0xc1a6, 0xc1a7, 0xc1a8,
0xc1a9, 0xc1aa, 0xc1ab, 0xc1ac, 0xc1ad, 0xc1ae, 0xc1af, 0xc1b0,
0xc1b1, 0xc1b3, 0xc1b4, 0xc1b5, 0xc1b6, 0xc1b7, 0xc1b8, 0xc1b9,
0xc1ba, 0xc1bb, 0xc1bc, 0xc1bd, 0xc1c1, 0xc1c2, 0xc1c3, 0xc1c4,
0xc1c5, 0xc1c6, 0xc1c7, 0xc1c8, 0xc1c9, 0xc1ca, 0xc1cb, 0xc1cc,
0xc1cd, 0xc1ce, 0xc1cf, 0xc1d0, 0xc1d1, 0xc1d3, 0xc1d4, 0xc1d5,
0xc1d6, 0xc1d7, 0xc1d8, 0xc1d9, 0xc1da, 0xc1db, 0xc1dc, 0xc1dd,
0xc1e1, 0xc1e2, 0xc1e3, 0xc1e4, 0xc1e5, 0xc1e6, 0xc1e7, 0xc1e8,
0xc1e9, 0xc1ea, 0xc1eb, 0xc1ec, 0xc1ed, 0xc1ee, 0xc1ef, 0xc1f0,
0xc1f1, 0xc1f3, 0xc1f4, 0xc1f5, 0xc1f6, 0xc1f7, 0xc1f8, 0xc1f9,
0xc1fa, 0xc1fb, 0xc1fc, 0xc1fd, 0xc241, 0xc242, 0xc243, 0xc244,
0xc245, 0xc246, 0xc247, 0xc248, 0xc249, 0xc24a, 0xc24b, 0xc24c,
0xc24d, 0xc24e, 0xc24f, 0xc250, 0xc251, 0xc253, 0xc254, 0xc255,
0xc256, 0xc257, 0xc258, 0xc259, 0xc25a, 0xc25b, 0xc25c, 0xc25d,
0xc261, 0xc262, 0xc263, 0xc264, 0xc265, 0xc266, 0xc267, 0xc268,
0xc269, 0xc26a, 0xc26b, 0xc26c, 0xc26d, 0xc26e, 0xc26f, 0xc270,
0xc271, 0xc273, 0xc274, 0xc275, 0xc276, 0xc277, 0xc278, 0xc279,
0xc27a, 0xc27b, 0xc27c, 0xc27d, 0xc281, 0xc282, 0xc283, 0xc284,
0xc285, 0xc286, 0xc287, 0xc288, 0xc289, 0xc28a, 0xc28b, 0xc28c,
0xc28d, 0xc28e, 0xc28f, 0xc290, 0xc291, 0xc293, 0xc294, 0xc295,
0xc296, 0xc297, 0xc298, 0xc299, 0xc29a, 0xc29b, 0xc29c, 0xc29d,
0xc2a1, 0xc2a2, 0xc2a3, 0xc2a4, 0xc2a5, 0xc2a6, 0xc2a7, 0xc2a8,
0xc2a9, 0xc2aa, 0xc2ab, 0xc2ac, 0xc2ad, 0xc2ae, 0xc2af, 0xc2b0,
0xc2b1, 0xc2b3, 0xc2b4, 0xc2b5, 0xc2b6, 0xc2b7, 0xc2b8, 0xc2b9,
0xc2ba, 0xc2bb, 0xc2bc, 0xc2bd, 0xc2c1, 0xc2c2, 0xc2c3, 0xc2c4,
0xc2c5, 0xc2c6, 0xc2c7, 0xc2c8, 0xc2c9, 0xc2ca, 0xc2cb, 0xc2cc,
0xc2cd, 0xc2ce, 0xc2cf, 0xc2d0, 0xc2d1, 0xc2d3, 0xc2d4, 0xc2d5,
0xc2d6, 0xc2d7, 0xc2d8, 0xc2d9, 0xc2da, 0xc2db, 0xc2dc, 0xc2dd,
0xc2e1, 0xc2e2, 0xc2e3, 0xc2e4, 0xc2e5, 0xc2e6, 0xc2e7, 0xc2e8,
0xc2e9, 0xc2ea, 0xc2eb, 0xc2ec, 0xc2ed, 0xc2ee, 0xc2ef, 0xc2f0,
0xc2f1, 0xc2f3, 0xc2f4, 0xc2f5, 0xc2f6, 0xc2f7, 0xc2f8, 0xc2f9,
0xc2fa, 0xc2fb, 0xc2fc, 0xc2fd, 0xc341, 0xc342, 0xc343, 0xc344,
0xc345, 0xc346, 0xc347, 0xc348, 0xc349, 0xc34a, 0xc34b, 0xc34c,
0xc34d, 0xc34e, 0xc34f, 0xc350, 0xc351, 0xc353, 0xc354, 0xc355,
0xc356, 0xc357, 0xc358, 0xc359, 0xc35a, 0xc35b, 0xc35c, 0xc35d,
0xc361, 0xc362, 0xc363, 0xc364, 0xc365, 0xc366, 0xc367, 0xc368,
0xc369, 0xc36a, 0xc36b, 0xc36c, 0xc36d, 0xc36e, 0xc36f, 0xc370,
0xc371, 0xc373, 0xc374, 0xc375, 0xc376, 0xc377, 0xc378, 0xc379,
0xc37a, 0xc37b, 0xc37c, 0xc37d, 0xc381, 0xc382, 0xc383, 0xc384,
0xc385, 0xc386, 0xc387, 0xc388, 0xc389, 0xc38a, 0xc38b, 0xc38c,
0xc38d, 0xc38e, 0xc38f, 0xc390, 0xc391, 0xc393, 0xc394, 0xc395,
0xc396, 0xc397, 0xc398, 0xc399, 0xc39a, 0xc39b, 0xc39c, 0xc39d,
0xc3a1, 0xc3a2, 0xc3a3, 0xc3a4, 0xc3a5, 0xc3a6, 0xc3a7, 0xc3a8,
0xc3a9, 0xc3aa, 0xc3ab, 0xc3ac, 0xc3ad, 0xc3ae, 0xc3af, 0xc3b0,
0xc3b1, 0xc3b3, 0xc3b4, 0xc3b5, 0xc3b6, 0xc3b7, 0xc3b8, 0xc3b9,
0xc3ba, 0xc3bb, 0xc3bc, 0xc3bd, 0xc461, 0xc462, 0xc463, 0xc464,
0xc465, 0xc466, 0xc467, 0xc468, 0xc469, 0xc46a, 0xc46b, 0xc46c,
0xc46d, 0xc46e, 0xc46f, 0xc470, 0xc471, 0xc473, 0xc474, 0xc475,
0xc476, 0xc477, 0xc478, 0xc479, 0xc47a, 0xc47b, 0xc47c, 0xc47d,
0xc481, 0xc482, 0xc483, 0xc484, 0xc485, 0xc486, 0xc487, 0xc488,
0xc489, 0xc48a, 0xc48b, 0xc48c, 0xc48d, 0xc48e, 0xc48f, 0xc490,
0xc491, 0xc493, 0xc494, 0xc495, 0xc496, 0xc497, 0xc498, 0xc499,
0xc49a, 0xc49b, 0xc49c, 0xc49d, 0xc4a1, 0xc4a2, 0xc4a3, 0xc4a4,
0xc4a5, 0xc4a6, 0xc4a7, 0xc4a8, 0xc4a9, 0xc4aa, 0xc4ab, 0xc4ac,
0xc4ad, 0xc4ae, 0xc4af, 0xc4b0, 0xc4b1, 0xc4b3, 0xc4b4, 0xc4b5,
0xc4b6, 0xc4b7, 0xc4b8, 0xc4b9, 0xc4ba, 0xc4bb, 0xc4bc, 0xc4bd,
0xc4c1, 0xc4c2, 0xc4c3, 0xc4c4, 0xc4c5, 0xc4c6, 0xc4c7, 0xc4c8,
0xc4c9, 0xc4ca, 0xc4cb, 0xc4cc, 0xc4cd, 0xc4ce, 0xc4cf, 0xc4d0,
0xc4d1, 0xc4d3, 0xc4d4, 0xc4d5, 0xc4d6, 0xc4d7, 0xc4d8, 0xc4d9,
0xc4da, 0xc4db, 0xc4dc, 0xc4dd, 0xc4e1, 0xc4e2, 0xc4e3, 0xc4e4,
0xc4e5, 0xc4e6, 0xc4e7, 0xc4e8, 0xc4e9, 0xc4ea, 0xc4eb, 0xc4ec,
0xc4ed, 0xc4ee, 0xc4ef, 0xc4f0, 0xc4f1, 0xc4f3, 0xc4f4, 0xc4f5,
0xc4f6, 0xc4f7, 0xc4f8, 0xc4f9, 0xc4fa, 0xc4fb, 0xc4fc, 0xc4fd,
0xc541, 0xc542, 0xc543, 0xc544, 0xc545, 0xc546, 0xc547, 0xc548,
0xc549, 0xc54a, 0xc54b, 0xc54c, 0xc54d, 0xc54e, 0xc54f, 0xc550,
0xc551, 0xc553, 0xc554, 0xc555, 0xc556, 0xc557, 0xc558, 0xc559,
0xc55a, 0xc55b, 0xc55c, 0xc55d, 0xc561, 0xc562, 0xc563, 0xc564,
0xc565, 0xc566, 0xc567, 0xc568, 0xc569, 0xc56a, 0xc56b, 0xc56c,
0xc56d, 0xc56e, 0xc56f, 0xc570, 0xc571, 0xc573, 0xc574, 0xc575,
0xc576, 0xc577, 0xc578, 0xc579, 0xc57a, 0xc57b, 0xc57c, 0xc57d,
0xc581, 0xc582, 0xc583, 0xc584, 0xc585, 0xc586, 0xc587, 0xc588,
0xc589, 0xc58a, 0xc58b, 0xc58c, 0xc58d, 0xc58e, 0xc58f, 0xc590,
0xc591, 0xc593, 0xc594, 0xc595, 0xc596, 0xc597, 0xc598, 0xc599,
0xc59a, 0xc59b, 0xc59c, 0xc59d, 0xc5a1, 0xc5a2, 0xc5a3, 0xc5a4,
0xc5a5, 0xc5a6, 0xc5a7, 0xc5a8, 0xc5a9, 0xc5aa, 0xc5ab, 0xc5ac,
0xc5ad, 0xc5ae, 0xc5af, 0xc5b0, 0xc5b1, 0xc5b3, 0xc5b4, 0xc5b5,
0xc5b6, 0xc5b7, 0xc5b8, 0xc5b9, 0xc5ba, 0xc5bb, 0xc5bc, 0xc5bd,
0xc5c1, 0xc5c2, 0xc5c3, 0xc5c4, 0xc5c5, 0xc5c6, 0xc5c7, 0xc5c8,
0xc5c9, 0xc5ca, 0xc5cb, 0xc5cc, 0xc5cd, 0xc5ce, 0xc5cf, 0xc5d0,
0xc5d1, 0xc5d3, 0xc5d4, 0xc5d5, 0xc5d6, 0xc5d7, 0xc5d8, 0xc5d9,
0xc5da, 0xc5db, 0xc5dc, 0xc5dd, 0xc5e1, 0xc5e2, 0xc5e3, 0xc5e4,
0xc5e5, 0xc5e6, 0xc5e7, 0xc5e8, 0xc5e9, 0xc5ea, 0xc5eb, 0xc5ec,
0xc5ed, 0xc5ee, 0xc5ef, 0xc5f0, 0xc5f1, 0xc5f3, 0xc5f4, 0xc5f5,
0xc5f6, 0xc5f7, 0xc5f8, 0xc5f9, 0xc5fa, 0xc5fb, 0xc5fc, 0xc5fd,
0xc641, 0xc642, 0xc643, 0xc644, 0xc645, 0xc646, 0xc647, 0xc648,
0xc649, 0xc64a, 0xc64b, 0xc64c, 0xc64d, 0xc64e, 0xc64f, 0xc650,
0xc651, 0xc653, 0xc654, 0xc655, 0xc656, 0xc657, 0xc658, 0xc659,
0xc65a, 0xc65b, 0xc65c, 0xc65d, 0xc661, 0xc662, 0xc663, 0xc664,
0xc665, 0xc666, 0xc667, 0xc668, 0xc669, 0xc66a, 0xc66b, 0xc66c,
0xc66d, 0xc66e, 0xc66f, 0xc670, 0xc671, 0xc673, 0xc674, 0xc675,
0xc676, 0xc677, 0xc678, 0xc679, 0xc67a, 0xc67b, 0xc67c, 0xc67d,
0xc681, 0xc682, 0xc683, 0xc684, 0xc685, 0xc686, 0xc687, 0xc688,
0xc689, 0xc68a, 0xc68b, 0xc68c, 0xc68d, 0xc68e, 0xc68f, 0xc690,
0xc691, 0xc693, 0xc694, 0xc695, 0xc696, 0xc697, 0xc698, 0xc699,
0xc69a, 0xc69b, 0xc69c, 0xc69d, 0xc6a1, 0xc6a2, 0xc6a3, 0xc6a4,
0xc6a5, 0xc6a6, 0xc6a7, 0xc6a8, 0xc6a9, 0xc6aa, 0xc6ab, 0xc6ac,
0xc6ad, 0xc6ae, 0xc6af, 0xc6b0, 0xc6b1, 0xc6b3, 0xc6b4, 0xc6b5,
0xc6b6, 0xc6b7, 0xc6b8, 0xc6b9, 0xc6ba, 0xc6bb, 0xc6bc, 0xc6bd,
0xc6c1, 0xc6c2, 0xc6c3, 0xc6c4, 0xc6c5, 0xc6c6, 0xc6c7, 0xc6c8,
0xc6c9, 0xc6ca, 0xc6cb, 0xc6cc, 0xc6cd, 0xc6ce, 0xc6cf, 0xc6d0,
0xc6d1, 0xc6d3, 0xc6d4, 0xc6d5, 0xc6d6, 0xc6d7, 0xc6d8, 0xc6d9,
0xc6da, 0xc6db, 0xc6dc, 0xc6dd, 0xc6e1, 0xc6e2, 0xc6e3, 0xc6e4,
0xc6e5, 0xc6e6, 0xc6e7, 0xc6e8, 0xc6e9, 0xc6ea, 0xc6eb, 0xc6ec,
0xc6ed, 0xc6ee, 0xc6ef, 0xc6f0, 0xc6f1, 0xc6f3, 0xc6f4, 0xc6f5,
0xc6f6, 0xc6f7, 0xc6f8, 0xc6f9, 0xc6fa, 0xc6fb, 0xc6fc, 0xc6fd,
0xc741, 0xc742, 0xc743, 0xc744, 0xc745, 0xc746, 0xc747, 0xc748,
0xc749, 0xc74a, 0xc74b, 0xc74c, 0xc74d, 0xc74e, 0xc74f, 0xc750,
0xc751, 0xc753, 0xc754, 0xc755, 0xc756, 0xc757, 0xc758, 0xc759,
0xc75a, 0xc75b, 0xc75c, 0xc75d, 0xc761, 0xc762, 0xc763, 0xc764,
0xc765, 0xc766, 0xc767, 0xc768, 0xc769, 0xc76a, 0xc76b, 0xc76c,
0xc76d, 0xc76e, 0xc76f, 0xc770, 0xc771, 0xc773, 0xc774, 0xc775,
0xc776, 0xc777, 0xc778, 0xc779, 0xc77a, 0xc77b, 0xc77c, 0xc77d,
0xc781, 0xc782, 0xc783, 0xc784, 0xc785, 0xc786, 0xc787, 0xc788,
0xc789, 0xc78a, 0xc78b, 0xc78c, 0xc78d, 0xc78e, 0xc78f, 0xc790,
0xc791, 0xc793, 0xc794, 0xc795, 0xc796, 0xc797, 0xc798, 0xc799,
0xc79a, 0xc79b, 0xc79c, 0xc79d, 0xc7a1, 0xc7a2, 0xc7a3, 0xc7a4,
0xc7a5, 0xc7a6, 0xc7a7, 0xc7a8, 0xc7a9, 0xc7aa, 0xc7ab, 0xc7ac,
0xc7ad, 0xc7ae, 0xc7af, 0xc7b0, 0xc7b1, 0xc7b3, 0xc7b4, 0xc7b5,
0xc7b6, 0xc7b7, 0xc7b8, 0xc7b9, 0xc7ba, 0xc7bb, 0xc7bc, 0xc7bd,
0xc861, 0xc862, 0xc863, 0xc864, 0xc865, 0xc866, 0xc867, 0xc868,
0xc869, 0xc86a, 0xc86b, 0xc86c, 0xc86d, 0xc86e, 0xc86f, 0xc870,
0xc871, 0xc873, 0xc874, 0xc875, 0xc876, 0xc877, 0xc878, 0xc879,
0xc87a, 0xc87b, 0xc87c, 0xc87d, 0xc881, 0xc882, 0xc883, 0xc884,
0xc885, 0xc886, 0xc887, 0xc888, 0xc889, 0xc88a, 0xc88b, 0xc88c,
0xc88d, 0xc88e, 0xc88f, 0xc890, 0xc891, 0xc893, 0xc894, 0xc895,
0xc896, 0xc897, 0xc898, 0xc899, 0xc89a, 0xc89b, 0xc89c, 0xc89d,
0xc8a1, 0xc8a2, 0xc8a3, 0xc8a4, 0xc8a5, 0xc8a6, 0xc8a7, 0xc8a8,
0xc8a9, 0xc8aa, 0xc8ab, 0xc8ac, 0xc8ad, 0xc8ae, 0xc8af, 0xc8b0,
0xc8b1, 0xc8b3, 0xc8b4, 0xc8b5, 0xc8b6, 0xc8b7, 0xc8b8, 0xc8b9,
0xc8ba, 0xc8bb, 0xc8bc, 0xc8bd, 0xc8c1, 0xc8c2, 0xc8c3, 0xc8c4,
0xc8c5, 0xc8c6, 0xc8c7, 0xc8c8, 0xc8c9, 0xc8ca, 0xc8cb, 0xc8cc,
0xc8cd, 0xc8ce, 0xc8cf, 0xc8d0, 0xc8d1, 0xc8d3, 0xc8d4, 0xc8d5,
0xc8d6, 0xc8d7, 0xc8d8, 0xc8d9, 0xc8da, 0xc8db, 0xc8dc, 0xc8dd,
0xc8e1, 0xc8e2, 0xc8e3, 0xc8e4, 0xc8e5, 0xc8e6, 0xc8e7, 0xc8e8,
0xc8e9, 0xc8ea, 0xc8eb, 0xc8ec, 0xc8ed, 0xc8ee, 0xc8ef, 0xc8f0,
0xc8f1, 0xc8f3, 0xc8f4, 0xc8f5, 0xc8f6, 0xc8f7, 0xc8f8, 0xc8f9,
0xc8fa, 0xc8fb, 0xc8fc, 0xc8fd, 0xc941, 0xc942, 0xc943, 0xc944,
0xc945, 0xc946, 0xc947, 0xc948, 0xc949, 0xc94a, 0xc94b, 0xc94c,
0xc94d, 0xc94e, 0xc94f, 0xc950, 0xc951, 0xc953, 0xc954, 0xc955,
0xc956, 0xc957, 0xc958, 0xc959, 0xc95a, 0xc95b, 0xc95c, 0xc95d,
0xc961, 0xc962, 0xc963, 0xc964, 0xc965, 0xc966, 0xc967, 0xc968,
0xc969, 0xc96a, 0xc96b, 0xc96c, 0xc96d, 0xc96e, 0xc96f, 0xc970,
0xc971, 0xc973, 0xc974, 0xc975, 0xc976, 0xc977, 0xc978, 0xc979,
0xc97a, 0xc97b, 0xc97c, 0xc97d, 0xc981, 0xc982, 0xc983, 0xc984,
0xc985, 0xc986, 0xc987, 0xc988, 0xc989, 0xc98a, 0xc98b, 0xc98c,
0xc98d, 0xc98e, 0xc98f, 0xc990, 0xc991, 0xc993, 0xc994, 0xc995,
0xc996, 0xc997, 0xc998, 0xc999, 0xc99a, 0xc99b, 0xc99c, 0xc99d,
0xc9a1, 0xc9a2, 0xc9a3, 0xc9a4, 0xc9a5, 0xc9a6, 0xc9a7, 0xc9a8,
0xc9a9, 0xc9aa, 0xc9ab, 0xc9ac, 0xc9ad, 0xc9ae, 0xc9af, 0xc9b0,
0xc9b1, 0xc9b3, 0xc9b4, 0xc9b5, 0xc9b6, 0xc9b7, 0xc9b8, 0xc9b9,
0xc9ba, 0xc9bb, 0xc9bc, 0xc9bd, 0xc9c1, 0xc9c2, 0xc9c3, 0xc9c4,
0xc9c5, 0xc9c6, 0xc9c7, 0xc9c8, 0xc9c9, 0xc9ca, 0xc9cb, 0xc9cc,
0xc9cd, 0xc9ce, 0xc9cf, 0xc9d0, 0xc9d1, 0xc9d3, 0xc9d4, 0xc9d5,
0xc9d6, 0xc9d7, 0xc9d8, 0xc9d9, 0xc9da, 0xc9db, 0xc9dc, 0xc9dd,
0xc9e1, 0xc9e2, 0xc9e3, 0xc9e4, 0xc9e5, 0xc9e6, 0xc9e7, 0xc9e8,
0xc9e9, 0xc9ea, 0xc9eb, 0xc9ec, 0xc9ed, 0xc9ee, 0xc9ef, 0xc9f0,
0xc9f1, 0xc9f3, 0xc9f4, 0xc9f5, 0xc9f6, 0xc9f7, 0xc9f8, 0xc9f9,
0xc9fa, 0xc9fb, 0xc9fc, 0xc9fd, 0xca41, 0xca42, 0xca43, 0xca44,
0xca45, 0xca46, 0xca47, 0xca48, 0xca49, 0xca4a, 0xca4b, 0xca4c,
0xca4d, 0xca4e, 0xca4f, 0xca50, 0xca51, 0xca53, 0xca54, 0xca55,
0xca56, 0xca57, 0xca58, 0xca59, 0xca5a, 0xca5b, 0xca5c, 0xca5d,
0xca61, 0xca62, 0xca63, 0xca64, 0xca65, 0xca66, 0xca67, 0xca68,
0xca69, 0xca6a, 0xca6b, 0xca6c, 0xca6d, 0xca6e, 0xca6f, 0xca70,
0xca71, 0xca73, 0xca74, 0xca75, 0xca76, 0xca77, 0xca78, 0xca79,
0xca7a, 0xca7b, 0xca7c, 0xca7d, 0xca81, 0xca82, 0xca83, 0xca84,
0xca85, 0xca86, 0xca87, 0xca88, 0xca89, 0xca8a, 0xca8b, 0xca8c,
0xca8d, 0xca8e, 0xca8f, 0xca90, 0xca91, 0xca93, 0xca94, 0xca95,
0xca96, 0xca97, 0xca98, 0xca99, 0xca9a, 0xca9b, 0xca9c, 0xca9d,
0xcaa1, 0xcaa2, 0xcaa3, 0xcaa4, 0xcaa5, 0xcaa6, 0xcaa7, 0xcaa8,
0xcaa9, 0xcaaa, 0xcaab, 0xcaac, 0xcaad, 0xcaae, 0xcaaf, 0xcab0,
0xcab1, 0xcab3, 0xcab4, 0xcab5, 0xcab6, 0xcab7, 0xcab8, 0xcab9,
0xcaba, 0xcabb, 0xcabc, 0xcabd, 0xcac1, 0xcac2, 0xcac3, 0xcac4,
0xcac5, 0xcac6, 0xcac7, 0xcac8, 0xcac9, 0xcaca, 0xcacb, 0xcacc,
0xcacd, 0xcace, 0xcacf, 0xcad0, 0xcad1, 0xcad3, 0xcad4, 0xcad5,
0xcad6, 0xcad7, 0xcad8, 0xcad9, 0xcada, 0xcadb, 0xcadc, 0xcadd,
0xcae1, 0xcae2, 0xcae3, 0xcae4, 0xcae5, 0xcae6, 0xcae7, 0xcae8,
0xcae9, 0xcaea, 0xcaeb, 0xcaec, 0xcaed, 0xcaee, 0xcaef, 0xcaf0,
0xcaf1, 0xcaf3, 0xcaf4, 0xcaf5, 0xcaf6, 0xcaf7, 0xcaf8, 0xcaf9,
0xcafa, 0xcafb, 0xcafc, 0xcafd, 0xcb41, 0xcb42, 0xcb43, 0xcb44,
0xcb45, 0xcb46, 0xcb47, 0xcb48, 0xcb49, 0xcb4a, 0xcb4b, 0xcb4c,
0xcb4d, 0xcb4e, 0xcb4f, 0xcb50, 0xcb51, 0xcb53, 0xcb54, 0xcb55,
0xcb56, 0xcb57, 0xcb58, 0xcb59, 0xcb5a, 0xcb5b, 0xcb5c, 0xcb5d,
0xcb61, 0xcb62, 0xcb63, 0xcb64, 0xcb65, 0xcb66, 0xcb67, 0xcb68,
0xcb69, 0xcb6a, 0xcb6b, 0xcb6c, 0xcb6d, 0xcb6e, 0xcb6f, 0xcb70,
0xcb71, 0xcb73, 0xcb74, 0xcb75, 0xcb76, 0xcb77, 0xcb78, 0xcb79,
0xcb7a, 0xcb7b, 0xcb7c, 0xcb7d, 0xcb81, 0xcb82, 0xcb83, 0xcb84,
0xcb85, 0xcb86, 0xcb87, 0xcb88, 0xcb89, 0xcb8a, 0xcb8b, 0xcb8c,
0xcb8d, 0xcb8e, 0xcb8f, 0xcb90, 0xcb91, 0xcb93, 0xcb94, 0xcb95,
0xcb96, 0xcb97, 0xcb98, 0xcb99, 0xcb9a, 0xcb9b, 0xcb9c, 0xcb9d,
0xcba1, 0xcba2, 0xcba3, 0xcba4, 0xcba5, 0xcba6, 0xcba7, 0xcba8,
0xcba9, 0xcbaa, 0xcbab, 0xcbac, 0xcbad, 0xcbae, 0xcbaf, 0xcbb0,
0xcbb1, 0xcbb3, 0xcbb4, 0xcbb5, 0xcbb6, 0xcbb7, 0xcbb8, 0xcbb9,
0xcbba, 0xcbbb, 0xcbbc, 0xcbbd, 0xcc61, 0xcc62, 0xcc63, 0xcc64,
0xcc65, 0xcc66, 0xcc67, 0xcc68, 0xcc69, 0xcc6a, 0xcc6b, 0xcc6c,
0xcc6d, 0xcc6e, 0xcc6f, 0xcc70, 0xcc71, 0xcc73, 0xcc74, 0xcc75,
0xcc76, 0xcc77, 0xcc78, 0xcc79, 0xcc7a, 0xcc7b, 0xcc7c, 0xcc7d,
0xcc81, 0xcc82, 0xcc83, 0xcc84, 0xcc85, 0xcc86, 0xcc87, 0xcc88,
0xcc89, 0xcc8a, 0xcc8b, 0xcc8c, 0xcc8d, 0xcc8e, 0xcc8f, 0xcc90,
0xcc91, 0xcc93, 0xcc94, 0xcc95, 0xcc96, 0xcc97, 0xcc98, 0xcc99,
0xcc9a, 0xcc9b, 0xcc9c, 0xcc9d, 0xcca1, 0xcca2, 0xcca3, 0xcca4,
0xcca5, 0xcca6, 0xcca7, 0xcca8, 0xcca9, 0xccaa, 0xccab, 0xccac,
0xccad, 0xccae, 0xccaf, 0xccb0, 0xccb1, 0xccb3, 0xccb4, 0xccb5,
0xccb6, 0xccb7, 0xccb8, 0xccb9, 0xccba, 0xccbb, 0xccbc, 0xccbd,
0xccc1, 0xccc2, 0xccc3, 0xccc4, 0xccc5, 0xccc6, 0xccc7, 0xccc8,
0xccc9, 0xccca, 0xcccb, 0xcccc, 0xcccd, 0xccce, 0xcccf, 0xccd0,
0xccd1, 0xccd3, 0xccd4, 0xccd5, 0xccd6, 0xccd7, 0xccd8, 0xccd9,
0xccda, 0xccdb, 0xccdc, 0xccdd, 0xcce1, 0xcce2, 0xcce3, 0xcce4,
0xcce5, 0xcce6, 0xcce7, 0xcce8, 0xcce9, 0xccea, 0xcceb, 0xccec,
0xcced, 0xccee, 0xccef, 0xccf0, 0xccf1, 0xccf3, 0xccf4, 0xccf5,
0xccf6, 0xccf7, 0xccf8, 0xccf9, 0xccfa, 0xccfb, 0xccfc, 0xccfd,
0xcd41, 0xcd42, 0xcd43, 0xcd44, 0xcd45, 0xcd46, 0xcd47, 0xcd48,
0xcd49, 0xcd4a, 0xcd4b, 0xcd4c, 0xcd4d, 0xcd4e, 0xcd4f, 0xcd50,
0xcd51, 0xcd53, 0xcd54, 0xcd55, 0xcd56, 0xcd57, 0xcd58, 0xcd59,
0xcd5a, 0xcd5b, 0xcd5c, 0xcd5d, 0xcd61, 0xcd62, 0xcd63, 0xcd64,
0xcd65, 0xcd66, 0xcd67, 0xcd68, 0xcd69, 0xcd6a, 0xcd6b, 0xcd6c,
0xcd6d, 0xcd6e, 0xcd6f, 0xcd70, 0xcd71, 0xcd73, 0xcd74, 0xcd75,
0xcd76, 0xcd77, 0xcd78, 0xcd79, 0xcd7a, 0xcd7b, 0xcd7c, 0xcd7d,
0xcd81, 0xcd82, 0xcd83, 0xcd84, 0xcd85, 0xcd86, 0xcd87, 0xcd88,
0xcd89, 0xcd8a, 0xcd8b, 0xcd8c, 0xcd8d, 0xcd8e, 0xcd8f, 0xcd90,
0xcd91, 0xcd93, 0xcd94, 0xcd95, 0xcd96, 0xcd97, 0xcd98, 0xcd99,
0xcd9a, 0xcd9b, 0xcd9c, 0xcd9d, 0xcda1, 0xcda2, 0xcda3, 0xcda4,
0xcda5, 0xcda6, 0xcda7, 0xcda8, 0xcda9, 0xcdaa, 0xcdab, 0xcdac,
0xcdad, 0xcdae, 0xcdaf, 0xcdb0, 0xcdb1, 0xcdb3, 0xcdb4, 0xcdb5,
0xcdb6, 0xcdb7, 0xcdb8, 0xcdb9, 0xcdba, 0xcdbb, 0xcdbc, 0xcdbd,
0xcdc1, 0xcdc2, 0xcdc3, 0xcdc4, 0xcdc5, 0xcdc6, 0xcdc7, 0xcdc8,
0xcdc9, 0xcdca, 0xcdcb, 0xcdcc, 0xcdcd, 0xcdce, 0xcdcf, 0xcdd0,
0xcdd1, 0xcdd3, 0xcdd4, 0xcdd5, 0xcdd6, 0xcdd7, 0xcdd8, 0xcdd9,
0xcdda, 0xcddb, 0xcddc, 0xcddd, 0xcde1, 0xcde2, 0xcde3, 0xcde4,
0xcde5, 0xcde6, 0xcde7, 0xcde8, 0xcde9, 0xcdea, 0xcdeb, 0xcdec,
0xcded, 0xcdee, 0xcdef, 0xcdf0, 0xcdf1, 0xcdf3, 0xcdf4, 0xcdf5,
0xcdf6, 0xcdf7, 0xcdf8, 0xcdf9, 0xcdfa, 0xcdfb, 0xcdfc, 0xcdfd,
0xce41, 0xce42, 0xce43, 0xce44, 0xce45, 0xce46, 0xce47, 0xce48,
0xce49, 0xce4a, 0xce4b, 0xce4c, 0xce4d, 0xce4e, 0xce4f, 0xce50,
0xce51, 0xce53, 0xce54, 0xce55, 0xce56, 0xce57, 0xce58, 0xce59,
0xce5a, 0xce5b, 0xce5c, 0xce5d, 0xce61, 0xce62, 0xce63, 0xce64,
0xce65, 0xce66, 0xce67, 0xce68, 0xce69, 0xce6a, 0xce6b, 0xce6c,
0xce6d, 0xce6e, 0xce6f, 0xce70, 0xce71, 0xce73, 0xce74, 0xce75,
0xce76, 0xce77, 0xce78, 0xce79, 0xce7a, 0xce7b, 0xce7c, 0xce7d,
0xce81, 0xce82, 0xce83, 0xce84, 0xce85, 0xce86, 0xce87, 0xce88,
0xce89, 0xce8a, 0xce8b, 0xce8c, 0xce8d, 0xce8e, 0xce8f, 0xce90,
0xce91, 0xce93, 0xce94, 0xce95, 0xce96, 0xce97, 0xce98, 0xce99,
0xce9a, 0xce9b, 0xce9c, 0xce9d, 0xcea1, 0xcea2, 0xcea3, 0xcea4,
0xcea5, 0xcea6, 0xcea7, 0xcea8, 0xcea9, 0xceaa, 0xceab, 0xceac,
0xcead, 0xceae, 0xceaf, 0xceb0, 0xceb1, 0xceb3, 0xceb4, 0xceb5,
0xceb6, 0xceb7, 0xceb8, 0xceb9, 0xceba, 0xcebb, 0xcebc, 0xcebd,
0xcec1, 0xcec2, 0xcec3, 0xcec4, 0xcec5, 0xcec6, 0xcec7, 0xcec8,
0xcec9, 0xceca, 0xcecb, 0xcecc, 0xcecd, 0xcece, 0xcecf, 0xced0,
0xced1, 0xced3, 0xced4, 0xced5, 0xced6, 0xced7, 0xced8, 0xced9,
0xceda, 0xcedb, 0xcedc, 0xcedd, 0xcee1, 0xcee2, 0xcee3, 0xcee4,
0xcee5, 0xcee6, 0xcee7, 0xcee8, 0xcee9, 0xceea, 0xceeb, 0xceec,
0xceed, 0xceee, 0xceef, 0xcef0, 0xcef1, 0xcef3, 0xcef4, 0xcef5,
0xcef6, 0xcef7, 0xcef8, 0xcef9, 0xcefa, 0xcefb, 0xcefc, 0xcefd,
0xcf41, 0xcf42, 0xcf43, 0xcf44, 0xcf45, 0xcf46, 0xcf47, 0xcf48,
0xcf49, 0xcf4a, 0xcf4b, 0xcf4c, 0xcf4d, 0xcf4e, 0xcf4f, 0xcf50,
0xcf51, 0xcf53, 0xcf54, 0xcf55, 0xcf56, 0xcf57, 0xcf58, 0xcf59,
0xcf5a, 0xcf5b, 0xcf5c, 0xcf5d, 0xcf61, 0xcf62, 0xcf63, 0xcf64,
0xcf65, 0xcf66, 0xcf67, 0xcf68, 0xcf69, 0xcf6a, 0xcf6b, 0xcf6c,
0xcf6d, 0xcf6e, 0xcf6f, 0xcf70, 0xcf71, 0xcf73, 0xcf74, 0xcf75,
0xcf76, 0xcf77, 0xcf78, 0xcf79, 0xcf7a, 0xcf7b, 0xcf7c, 0xcf7d,
0xcf81, 0xcf82, 0xcf83, 0xcf84, 0xcf85, 0xcf86, 0xcf87, 0xcf88,
0xcf89, 0xcf8a, 0xcf8b, 0xcf8c, 0xcf8d, 0xcf8e, 0xcf8f, 0xcf90,
0xcf91, 0xcf93, 0xcf94, 0xcf95, 0xcf96, 0xcf97, 0xcf98, 0xcf99,
0xcf9a, 0xcf9b, 0xcf9c, 0xcf9d, 0xcfa1, 0xcfa2, 0xcfa3, 0xcfa4,
0xcfa5, 0xcfa6, 0xcfa7, 0xcfa8, 0xcfa9, 0xcfaa, 0xcfab, 0xcfac,
0xcfad, 0xcfae, 0xcfaf, 0xcfb0, 0xcfb1, 0xcfb3, 0xcfb4, 0xcfb5,
0xcfb6, 0xcfb7, 0xcfb8, 0xcfb9, 0xcfba, 0xcfbb, 0xcfbc, 0xcfbd,
0xd061, 0xd062, 0xd063, 0xd064, 0xd065, 0xd066, 0xd067, 0xd068,
0xd069, 0xd06a, 0xd06b, 0xd06c, 0xd06d, 0xd06e, 0xd06f, 0xd070,
0xd071, 0xd073, 0xd074, 0xd075, 0xd076, 0xd077, 0xd078, 0xd079,
0xd07a, 0xd07b, 0xd07c, 0xd07d, 0xd081, 0xd082, 0xd083, 0xd084,
0xd085, 0xd086, 0xd087, 0xd088, 0xd089, 0xd08a, 0xd08b, 0xd08c,
0xd08d, 0xd08e, 0xd08f, 0xd090, 0xd091, 0xd093, 0xd094, 0xd095,
0xd096, 0xd097, 0xd098, 0xd099, 0xd09a, 0xd09b, 0xd09c, 0xd09d,
0xd0a1, 0xd0a2, 0xd0a3, 0xd0a4, 0xd0a5, 0xd0a6, 0xd0a7, 0xd0a8,
0xd0a9, 0xd0aa, 0xd0ab, 0xd0ac, 0xd0ad, 0xd0ae, 0xd0af, 0xd0b0,
0xd0b1, 0xd0b3, 0xd0b4, 0xd0b5, 0xd0b6, 0xd0b7, 0xd0b8, 0xd0b9,
0xd0ba, 0xd0bb, 0xd0bc, 0xd0bd, 0xd0c1, 0xd0c2, 0xd0c3, 0xd0c4,
0xd0c5, 0xd0c6, 0xd0c7, 0xd0c8, 0xd0c9, 0xd0ca, 0xd0cb, 0xd0cc,
0xd0cd, 0xd0ce, 0xd0cf, 0xd0d0, 0xd0d1, 0xd0d3, 0xd0d4, 0xd0d5,
0xd0d6, 0xd0d7, 0xd0d8, 0xd0d9, 0xd0da, 0xd0db, 0xd0dc, 0xd0dd,
0xd0e1, 0xd0e2, 0xd0e3, 0xd0e4, 0xd0e5, 0xd0e6, 0xd0e7, 0xd0e8,
0xd0e9, 0xd0ea, 0xd0eb, 0xd0ec, 0xd0ed, 0xd0ee, 0xd0ef, 0xd0f0,
0xd0f1, 0xd0f3, 0xd0f4, 0xd0f5, 0xd0f6, 0xd0f7, 0xd0f8, 0xd0f9,
0xd0fa, 0xd0fb, 0xd0fc, 0xd0fd, 0xd141, 0xd142, 0xd143, 0xd144,
0xd145, 0xd146, 0xd147, 0xd148, 0xd149, 0xd14a, 0xd14b, 0xd14c,
0xd14d, 0xd14e, 0xd14f, 0xd150, 0xd151, 0xd153, 0xd154, 0xd155,
0xd156, 0xd157, 0xd158, 0xd159, 0xd15a, 0xd15b, 0xd15c, 0xd15d,
0xd161, 0xd162, 0xd163, 0xd164, 0xd165, 0xd166, 0xd167, 0xd168,
0xd169, 0xd16a, 0xd16b, 0xd16c, 0xd16d, 0xd16e, 0xd16f, 0xd170,
0xd171, 0xd173, 0xd174, 0xd175, 0xd176, 0xd177, 0xd178, 0xd179,
0xd17a, 0xd17b, 0xd17c, 0xd17d, 0xd181, 0xd182, 0xd183, 0xd184,
0xd185, 0xd186, 0xd187, 0xd188, 0xd189, 0xd18a, 0xd18b, 0xd18c,
0xd18d, 0xd18e, 0xd18f, 0xd190, 0xd191, 0xd193, 0xd194, 0xd195,
0xd196, 0xd197, 0xd198, 0xd199, 0xd19a, 0xd19b, 0xd19c, 0xd19d,
0xd1a1, 0xd1a2, 0xd1a3, 0xd1a4, 0xd1a5, 0xd1a6, 0xd1a7, 0xd1a8,
0xd1a9, 0xd1aa, 0xd1ab, 0xd1ac, 0xd1ad, 0xd1ae, 0xd1af, 0xd1b0,
0xd1b1, 0xd1b3, 0xd1b4, 0xd1b5, 0xd1b6, 0xd1b7, 0xd1b8, 0xd1b9,
0xd1ba, 0xd1bb, 0xd1bc, 0xd1bd, 0xd1c1, 0xd1c2, 0xd1c3, 0xd1c4,
0xd1c5, 0xd1c6, 0xd1c7, 0xd1c8, 0xd1c9, 0xd1ca, 0xd1cb, 0xd1cc,
0xd1cd, 0xd1ce, 0xd1cf, 0xd1d0, 0xd1d1, 0xd1d3, 0xd1d4, 0xd1d5,
0xd1d6, 0xd1d7, 0xd1d8, 0xd1d9, 0xd1da, 0xd1db, 0xd1dc, 0xd1dd,
0xd1e1, 0xd1e2, 0xd1e3, 0xd1e4, 0xd1e5, 0xd1e6, 0xd1e7, 0xd1e8,
0xd1e9, 0xd1ea, 0xd1eb, 0xd1ec, 0xd1ed, 0xd1ee, 0xd1ef, 0xd1f0,
0xd1f1, 0xd1f3, 0xd1f4, 0xd1f5, 0xd1f6, 0xd1f7, 0xd1f8, 0xd1f9,
0xd1fa, 0xd1fb, 0xd1fc, 0xd1fd, 0xd241, 0xd242, 0xd243, 0xd244,
0xd245, 0xd246, 0xd247, 0xd248, 0xd249, 0xd24a, 0xd24b, 0xd24c,
0xd24d, 0xd24e, 0xd24f, 0xd250, 0xd251, 0xd253, 0xd254, 0xd255,
0xd256, 0xd257, 0xd258, 0xd259, 0xd25a, 0xd25b, 0xd25c, 0xd25d,
0xd261, 0xd262, 0xd263, 0xd264, 0xd265, 0xd266, 0xd267, 0xd268,
0xd269, 0xd26a, 0xd26b, 0xd26c, 0xd26d, 0xd26e, 0xd26f, 0xd270,
0xd271, 0xd273, 0xd274, 0xd275, 0xd276, 0xd277, 0xd278, 0xd279,
0xd27a, 0xd27b, 0xd27c, 0xd27d, 0xd281, 0xd282, 0xd283, 0xd284,
0xd285, 0xd286, 0xd287, 0xd288, 0xd289, 0xd28a, 0xd28b, 0xd28c,
0xd28d, 0xd28e, 0xd28f, 0xd290, 0xd291, 0xd293, 0xd294, 0xd295,
0xd296, 0xd297, 0xd298, 0xd299, 0xd29a, 0xd29b, 0xd29c, 0xd29d,
0xd2a1, 0xd2a2, 0xd2a3, 0xd2a4, 0xd2a5, 0xd2a6, 0xd2a7, 0xd2a8,
0xd2a9, 0xd2aa, 0xd2ab, 0xd2ac, 0xd2ad, 0xd2ae, 0xd2af, 0xd2b0,
0xd2b1, 0xd2b3, 0xd2b4, 0xd2b5, 0xd2b6, 0xd2b7, 0xd2b8, 0xd2b9,
0xd2ba, 0xd2bb, 0xd2bc, 0xd2bd, 0xd2c1, 0xd2c2, 0xd2c3, 0xd2c4,
0xd2c5, 0xd2c6, 0xd2c7, 0xd2c8, 0xd2c9, 0xd2ca, 0xd2cb, 0xd2cc,
0xd2cd, 0xd2ce, 0xd2cf, 0xd2d0, 0xd2d1, 0xd2d3, 0xd2d4, 0xd2d5,
0xd2d6, 0xd2d7, 0xd2d8, 0xd2d9, 0xd2da, 0xd2db, 0xd2dc, 0xd2dd,
0xd2e1, 0xd2e2, 0xd2e3, 0xd2e4, 0xd2e5, 0xd2e6, 0xd2e7, 0xd2e8,
0xd2e9, 0xd2ea, 0xd2eb, 0xd2ec, 0xd2ed, 0xd2ee, 0xd2ef, 0xd2f0,
0xd2f1, 0xd2f3, 0xd2f4, 0xd2f5, 0xd2f6, 0xd2f7, 0xd2f8, 0xd2f9,
0xd2fa, 0xd2fb, 0xd2fc, 0xd2fd, 0xd341, 0xd342, 0xd343, 0xd344,
0xd345, 0xd346, 0xd347, 0xd348, 0xd349, 0xd34a, 0xd34b, 0xd34c,
0xd34d, 0xd34e, 0xd34f, 0xd350, 0xd351, 0xd353, 0xd354, 0xd355,
0xd356, 0xd357, 0xd358, 0xd359, 0xd35a, 0xd35b, 0xd35c, 0xd35d,
0xd361, 0xd362, 0xd363, 0xd364, 0xd365, 0xd366, 0xd367, 0xd368,
0xd369, 0xd36a, 0xd36b, 0xd36c, 0xd36d, 0xd36e, 0xd36f, 0xd370,
0xd371, 0xd373, 0xd374, 0xd375, 0xd376, 0xd377, 0xd378, 0xd379,
0xd37a, 0xd37b, 0xd37c, 0xd37d, 0xd381, 0xd382, 0xd383, 0xd384,
0xd385, 0xd386, 0xd387, 0xd388, 0xd389, 0xd38a, 0xd38b, 0xd38c,
0xd38d, 0xd38e, 0xd38f, 0xd390, 0xd391, 0xd393, 0xd394, 0xd395,
0xd396, 0xd397, 0xd398, 0xd399, 0xd39a, 0xd39b, 0xd39c, 0xd39d,
0xd3a1, 0xd3a2, 0xd3a3, 0xd3a4, 0xd3a5, 0xd3a6, 0xd3a7, 0xd3a8,
0xd3a9, 0xd3aa, 0xd3ab, 0xd3ac, 0xd3ad, 0xd3ae, 0xd3af, 0xd3b0,
0xd3b1, 0xd3b3, 0xd3b4, 0xd3b5, 0xd3b6, 0xd3b7, 0xd3b8, 0xd3b9,
0xd3ba, 0xd3bb, 0xd3bc, 0xd3bd,
};
/*
*Private Use Zone for Korean.
*/
static const unsigned short ucs_tab_f7[188] = {
0xd831, 0xd832, 0xd833, 0xd834, 0xd835, 0xd836, 0xd837, 0xd838,
0xd839, 0xd83a, 0xd83b, 0xd83c, 0xd83d, 0xd83e, 0xd83f, 0xd840,
0xd841, 0xd842, 0xd843, 0xd844, 0xd845, 0xd846, 0xd847, 0xd848,
0xd849, 0xd84a, 0xd84b, 0xd84c, 0xd84d, 0xd84e, 0xd84f, 0xd850,
0xd851, 0xd852, 0xd853, 0xd854, 0xd855, 0xd856, 0xd857, 0xd858,
0xd859, 0xd85a, 0xd85b, 0xd85c, 0xd85d, 0xd85e, 0xd85f, 0xd860,
0xd861, 0xd862, 0xd863, 0xd864, 0xd865, 0xd866, 0xd867, 0xd868,
0xd869, 0xd86a, 0xd86b, 0xd86c, 0xd86d, 0xd86e, 0xd86f, 0xd870,
0xd871, 0xd872, 0xd873, 0xd874, 0xd875, 0xd876, 0xd877, 0xd878,
0xd879, 0xd87a, 0xd87b, 0xd87c, 0xd87d, 0xd87e, 0xd891, 0xd892,
0xd893, 0xd894, 0xd895, 0xd896, 0xd897, 0xd898, 0xd899, 0xd89a,
0xd89b, 0xd89c, 0xd89d, 0xd89e, 0xd89f, 0xd8a0, 0xd8a1, 0xd8a2,
0xd8a3, 0xd8a4, 0xd8a5, 0xd8a6, 0xd8a7, 0xd8a8, 0xd8a9, 0xd8aa,
0xd8ab, 0xd8ac, 0xd8ad, 0xd8ae, 0xd8af, 0xd8b0, 0xd8b1, 0xd8b2,
0xd8b3, 0xd8b4, 0xd8b5, 0xd8b6, 0xd8b7, 0xd8b8, 0xd8b9, 0xd8ba,
0xd8bb, 0xd8bc, 0xd8bd, 0xd8be, 0xd8bf, 0xd8c0, 0xd8c1, 0xd8c2,
0xd8c3, 0xd8c4, 0xd8c5, 0xd8c6, 0xd8c7, 0xd8c8, 0xd8c9, 0xd8ca,
0xd8cb, 0xd8cc, 0xd8cd, 0xd8ce, 0xd8cf, 0xd8d0, 0xd8d1, 0xd8d2,
0xd8d3, 0xd8d4, 0xd8d5, 0xd8d6, 0xd8d7, 0xd8d8, 0xd8d9, 0xd8da,
0xd8db, 0xd8dc, 0xd8dd, 0xd8de, 0xd8df, 0xd8e0, 0xd8e1, 0xd8e2,
0xd8e3, 0xd8e4, 0xd8e5, 0xd8e6, 0xd8e7, 0xd8e8, 0xd8e9, 0xd8ea,
0xd8eb, 0xd8ec, 0xd8ed, 0xd8ee, 0xd8ef, 0xd8f0, 0xd8f1, 0xd8f2,
0xd8f3, 0xd8f4, 0xd8f5, 0xd8f6, 0xd8f7, 0xd8f8, 0xd8f9, 0xd8fa,
0xd8fb, 0xd8fc, 0xd8fd, 0xd8fe,
};
/*
* UCStoJohap : ksc5601_1992_wctomb
*/
static int
ksc5601_1992_wctomb(conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
unsigned char buf[2];
unsigned short h;
int ret = RET_ILSEQ;
if (n < 2) {
return RET_TOOSMALL;
}
if (wc >= 0xac00 && wc < 0xd7a4) {
/* JOHAB Hangul. */
unsigned short c = ucs_hangul[wc-0xAC00];
r[0] = (c >> 8); r[1] = (c & 0xff);
return 2;
}
if (wc>=0xf700 && wc<=0xf7bb) {
unsigned short c = ucs_tab_f7[wc-0xf700];
r[0] = (c >> 8); r[1] = (c & 0xff);
return 2;
}
if (wc == 0x30FB) {
h = 0xd934;
} else if (wc == 0x2013) {
h = 0xD939;
} else if (wc == 0x2014) {
h = 0xD93A;
} else if (wc == 0x2016) {
h = 0xD93B;
} else if (wc == 0xFF5E){
h = 0xD93D;
} else if (wc == 0x00AB) {
h = 0xD97C;
} else if (wc == 0x00BB) {
h = 0xD97D;
} else if (wc == 0x02DC) {
h = 0xD9A6;
} else if (wc==0x2236) {
h = 0xD9B0;
} else if (wc==0x25C9) {
h = 0xD9C1;
} else if ((wc >= 0x3041 && wc <= 0x309F) || (wc >= 0x30A0 && wc <= 0x30FF)) {
/* Hiragana and Katakana should be handled in jis0208 as below else block
is KSC specific and breaks Hiragana/Katakana */
return RET_ILSEQ;
} else {
/* Try KSC5601, now KS X 1001. */
ret = ksc5601_wctomb(conv, buf, wc, 2);
if (ret != RET_ILSEQ) {
if (ret != 2) abort();
if (n < 2)
return RET_TOOSMALL;
if (((buf[0] >= 0x21 && buf[0] <= 0x2c) || (buf[0] >= 0x4a && buf[0] <= 0x7d))
&& (buf[1] >= 0x21 && buf[1] <= 0x7e)) {
/*Pre-calculations: 0x191=0x1b2-0x21; 0x176=0x197-0x21 */
unsigned int t = buf[0] < 0x4A ? (buf[0]+0x191) : (buf[0]+0x176);
unsigned char t2 = ((t & 1) ? 0x5e : 0) + (buf[1] - 0x21);
r[0] = t >> 1;
r[1] = (t2 < 0x4e ? t2+0x31 : t2+0x43);
return 2;
}
}
return ret;
}
r[0] = (h >> 8); r[1] = (h & 0xff);
return 2;
}
#endif /* _KSC5601_1992_H */
|
25307205d2ba5734e9af6bf9a38ab1e754082d3d
|
88ae8695987ada722184307301e221e1ba3cc2fa
|
/third_party/wayland-protocols/gtk/gtk/gtkmountoperation-x11.c
|
0dd2ae74801eb3dfa6d36d4d88aa7279b50ad12d
|
[
"Apache-2.0",
"LGPL-2.0-or-later",
"MIT",
"GPL-1.0-or-later",
"LGPL-2.0-only",
"LGPL-2.1-only",
"BSD-3-Clause"
] |
permissive
|
iridium-browser/iridium-browser
|
71d9c5ff76e014e6900b825f67389ab0ccd01329
|
5ee297f53dc7f8e70183031cff62f37b0f19d25f
|
refs/heads/master
| 2023-08-03T16:44:16.844552
| 2023-07-20T15:17:00
| 2023-07-23T16:09:30
| 220,016,632
| 341
| 40
|
BSD-3-Clause
| 2021-08-13T13:54:45
| 2019-11-06T14:32:31
| null |
UTF-8
|
C
| false
| false
| 27,734
|
c
|
gtkmountoperation-x11.c
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* GTK - The GIMP Toolkit
* Copyright (C) David Zeuthen <davidz@redhat.com>
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005-2007 Vincent Untz
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include <string.h>
#include <stdlib.h>
#include <gio/gio.h>
#include "x11/gdkx.h"
#include <X11/Xatom.h>
#include <gtk/gtkicontheme.h>
#include "gtkintl.h"
/* for the kill(2) system call and errno - POSIX.1-2001 and later */
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
#if defined(__OpenBSD__)
#include <sys/sysctl.h>
#endif
#include "gtkmountoperationprivate.h"
/* ---------------------------------------------------------------------------------------------------- */
/* these functions are based on code from libwnck (LGPLv2) */
static gboolean get_window_list (GdkDisplay *display,
Display *xdisplay,
Window xwindow,
Atom atom,
Window **windows,
int *len);
static char* get_utf8_property (GdkDisplay *display,
Display *xdisplay,
Window xwindow,
Atom atom);
static gboolean get_cardinal (GdkDisplay *display,
Display *xdisplay,
Window xwindow,
Atom atom,
int *val);
static gboolean read_rgb_icon (GdkDisplay *display,
Display *xdisplay,
Window xwindow,
int ideal_width,
int ideal_height,
int *width,
int *height,
guchar **pixdata);
static gboolean
get_cardinal (GdkDisplay *display,
Display *xdisplay,
Window xwindow,
Atom atom,
int *val)
{
Atom type;
int format;
gulong nitems;
gulong bytes_after;
gulong *num;
int err, result;
*val = 0;
gdk_x11_display_error_trap_push (display);
type = None;
result = XGetWindowProperty (xdisplay,
xwindow,
atom,
0, G_MAXLONG,
False, XA_CARDINAL, &type, &format, &nitems,
&bytes_after, (void*)&num);
XSync (xdisplay, False);
err = gdk_x11_display_error_trap_pop (display);
if (err != Success ||
result != Success)
return FALSE;
if (type != XA_CARDINAL)
{
XFree (num);
return FALSE;
}
*val = *num;
XFree (num);
return TRUE;
}
static char*
get_utf8_property (GdkDisplay *display,
Display *xdisplay,
Window xwindow,
Atom atom)
{
Atom type;
int format;
gulong nitems;
gulong bytes_after;
char *val;
int err, result;
char *retval;
Atom utf8_string;
utf8_string = gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING");
gdk_x11_display_error_trap_push (display);
type = None;
val = NULL;
result = XGetWindowProperty (xdisplay,
xwindow,
atom,
0, G_MAXLONG,
False, utf8_string,
&type, &format, &nitems,
&bytes_after, (guchar **)&val);
XSync (xdisplay, False);
err = gdk_x11_display_error_trap_pop (display);
if (err != Success ||
result != Success)
return NULL;
if (type != utf8_string ||
format != 8 ||
nitems == 0)
{
if (val)
XFree (val);
return NULL;
}
if (!g_utf8_validate (val, nitems, NULL))
{
g_warning ("Property %s contained invalid UTF-8",
gdk_x11_get_xatom_name_for_display (display, atom));
XFree (val);
return NULL;
}
retval = g_strndup (val, nitems);
XFree (val);
return retval;
}
static gboolean
find_largest_sizes (gulong *data,
gulong nitems,
int *width,
int *height)
{
*width = 0;
*height = 0;
while (nitems > 0)
{
int w, h;
if (nitems < 3)
return FALSE; /* no space for w, h */
w = data[0];
h = data[1];
if (nitems < ((w * h) + 2))
return FALSE; /* not enough data */
*width = MAX (w, *width);
*height = MAX (h, *height);
data += (w * h) + 2;
nitems -= (w * h) + 2;
}
return TRUE;
}
static gboolean
find_best_size (gulong *data,
gulong nitems,
int ideal_width,
int ideal_height,
int *width,
int *height,
gulong **start)
{
int best_w;
int best_h;
gulong *best_start;
int max_width, max_height;
*width = 0;
*height = 0;
*start = NULL;
if (!find_largest_sizes (data, nitems, &max_width, &max_height))
return FALSE;
if (ideal_width < 0)
ideal_width = max_width;
if (ideal_height < 0)
ideal_height = max_height;
best_w = 0;
best_h = 0;
best_start = NULL;
while (nitems > 0)
{
int w, h;
gboolean replace;
replace = FALSE;
if (nitems < 3)
return FALSE; /* no space for w, h */
w = data[0];
h = data[1];
if (nitems < ((w * h) + 2))
break; /* not enough data */
if (best_start == NULL)
{
replace = TRUE;
}
else
{
/* work with averages */
const int ideal_size = (ideal_width + ideal_height) / 2;
int best_size = (best_w + best_h) / 2;
int this_size = (w + h) / 2;
/* larger than desired is always better than smaller */
if (best_size < ideal_size &&
this_size >= ideal_size)
replace = TRUE;
/* if we have too small, pick anything bigger */
else if (best_size < ideal_size &&
this_size > best_size)
replace = TRUE;
/* if we have too large, pick anything smaller
* but still >= the ideal
*/
else if (best_size > ideal_size &&
this_size >= ideal_size &&
this_size < best_size)
replace = TRUE;
}
if (replace)
{
best_start = data + 2;
best_w = w;
best_h = h;
}
data += (w * h) + 2;
nitems -= (w * h) + 2;
}
if (best_start)
{
*start = best_start;
*width = best_w;
*height = best_h;
return TRUE;
}
else
return FALSE;
}
static void
argbdata_to_pixdata (gulong *argb_data,
int len,
guchar **pixdata)
{
guchar *p;
int i;
*pixdata = g_new (guchar, len * 4);
p = *pixdata;
/* One could speed this up a lot. */
i = 0;
while (i < len)
{
guint argb;
guint rgba;
argb = argb_data[i];
rgba = (argb << 8) | (argb >> 24);
*p = rgba >> 24;
++p;
*p = (rgba >> 16) & 0xff;
++p;
*p = (rgba >> 8) & 0xff;
++p;
*p = rgba & 0xff;
++p;
++i;
}
}
static gboolean
read_rgb_icon (GdkDisplay *display,
Display *xdisplay,
Window xwindow,
int ideal_width,
int ideal_height,
int *width,
int *height,
guchar **pixdata)
{
Atom type;
int format;
gulong nitems;
gulong bytes_after;
int result, err;
gulong *data;
gulong *best;
int w, h;
gdk_x11_display_error_trap_push (display);
type = None;
data = NULL;
result = XGetWindowProperty (xdisplay,
xwindow,
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON"),
0, G_MAXLONG,
False, XA_CARDINAL, &type, &format, &nitems,
&bytes_after, (void*)&data);
XSync (xdisplay, False);
err = gdk_x11_display_error_trap_pop (display);
if (err != Success ||
result != Success)
return FALSE;
if (type != XA_CARDINAL)
{
XFree (data);
return FALSE;
}
if (!find_best_size (data, nitems,
ideal_width, ideal_height,
&w, &h, &best))
{
XFree (data);
return FALSE;
}
*width = w;
*height = h;
argbdata_to_pixdata (best, w * h, pixdata);
XFree (data);
return TRUE;
}
static void
free_pixels (guchar *pixels, gpointer data)
{
g_free (pixels);
}
static GdkTexture *
scaled_from_pixdata (guchar *pixdata,
int w,
int h,
int new_w,
int new_h)
{
GdkPixbuf *src;
GdkPixbuf *dest;
GdkTexture *ret;
src = gdk_pixbuf_new_from_data (pixdata,
GDK_COLORSPACE_RGB,
TRUE,
8,
w, h, w * 4,
free_pixels,
NULL);
if (src == NULL)
return NULL;
if (w != h)
{
GdkPixbuf *tmp;
int size;
size = MAX (w, h);
tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, size, size);
if (tmp != NULL)
{
gdk_pixbuf_fill (tmp, 0);
gdk_pixbuf_copy_area (src, 0, 0, w, h,
tmp,
(size - w) / 2, (size - h) / 2);
g_object_unref (src);
src = tmp;
}
}
if (w != new_w || h != new_h)
{
dest = gdk_pixbuf_scale_simple (src, new_w, new_h, GDK_INTERP_BILINEAR);
g_object_unref (G_OBJECT (src));
}
else
{
dest = src;
}
ret = gdk_texture_new_for_pixbuf (dest);
g_object_unref (dest);
return ret;
}
static gboolean
get_window_list (GdkDisplay *display,
Display *xdisplay,
Window xwindow,
Atom atom,
Window **windows,
int *len)
{
Atom type;
int format;
gulong nitems;
gulong bytes_after;
Window *data;
int err, result;
*windows = NULL;
*len = 0;
gdk_x11_display_error_trap_push (display);
type = None;
result = XGetWindowProperty (xdisplay,
xwindow,
atom,
0, G_MAXLONG,
False, XA_WINDOW, &type, &format, &nitems,
&bytes_after, (void*)&data);
XSync (xdisplay, False);
err = gdk_x11_display_error_trap_pop (display);
if (err != Success ||
result != Success)
return FALSE;
if (type != XA_WINDOW)
{
XFree (data);
return FALSE;
}
*windows = g_new (Window, nitems);
memcpy (*windows, data, sizeof (Window) * nitems);
*len = nitems;
XFree (data);
return TRUE;
}
/* ---------------------------------------------------------------------------------------------------- */
struct _GtkMountOperationLookupContext
{
/* Hash from pid (int) -> XID (int)
*
* Note that XIDs are at most 27 bits - however, also note that sizeof(XID) == 8 on
* x86_64 - that's just xlib brokenness. So it's safe to stuff the XID into a pointer.
*/
GHashTable *pid_to_window;
GdkDisplay *display;
};
GtkMountOperationLookupContext *
_gtk_mount_operation_lookup_context_get (GdkDisplay *display)
{
GtkMountOperationLookupContext *context;
Window *mapping;
int mapping_length;
int n;
context = g_new0 (GtkMountOperationLookupContext, 1);
context->pid_to_window = g_hash_table_new (g_direct_hash, g_direct_equal);
context->display = display;
mapping = NULL;
mapping_length = 0;
get_window_list (context->display,
gdk_x11_display_get_xdisplay (context->display),
gdk_x11_display_get_xrootwindow (context->display),
gdk_x11_get_xatom_by_name_for_display (context->display,
"_NET_CLIENT_LIST"),
&mapping,
&mapping_length);
for (n = 0; n < mapping_length; n++)
{
int pid;
if (!get_cardinal (context->display,
GDK_DISPLAY_XDISPLAY (context->display),
mapping[n],
gdk_x11_get_xatom_by_name_for_display (context->display,
"_NET_WM_PID"),
&pid))
continue;
g_hash_table_insert (context->pid_to_window,
GINT_TO_POINTER (pid),
GINT_TO_POINTER ((int) mapping[n]));
}
g_free (mapping);
return context;
}
void
_gtk_mount_operation_lookup_context_free (GtkMountOperationLookupContext *context)
{
g_hash_table_unref (context->pid_to_window);
g_free (context);
}
/* ---------------------------------------------------------------------------------------------------- */
#ifdef __linux__
static GPid
pid_get_parent (GPid pid)
{
GPid ppid;
char **tokens;
char *stat_filename;
char *stat_contents;
gsize stat_len;
ppid = 0;
tokens = NULL;
stat_contents = NULL;
stat_filename = NULL;
/* fail if trying to get the parent of the init process (no such thing) */
if (pid == 1)
goto out;
stat_filename = g_strdup_printf ("/proc/%d/status", pid);
if (g_file_get_contents (stat_filename,
&stat_contents,
&stat_len,
NULL))
{
guint n;
tokens = g_strsplit (stat_contents, "\n", 0);
for (n = 0; tokens[n] != NULL; n++)
{
if (g_str_has_prefix (tokens[n], "PPid:"))
{
char *endp;
endp = NULL;
ppid = strtoll (tokens[n] + sizeof "PPid:" - 1, &endp, 10);
if (endp == NULL || *endp != '\0')
{
g_warning ("Error parsing contents of `%s'. Parent pid is malformed.",
stat_filename);
ppid = 0;
goto out;
}
break;
}
}
}
out:
g_strfreev (tokens);
g_free (stat_contents);
g_free (stat_filename);
return ppid;
}
static char *
pid_get_env (GPid pid,
const char *key)
{
char *ret;
char *env_filename;
char *env;
gsize env_len;
gsize key_len;
char *end;
ret = NULL;
key_len = strlen (key);
env_filename = g_strdup_printf ("/proc/%d/environ", pid);
if (g_file_get_contents (env_filename,
&env,
&env_len,
NULL))
{
guint n;
/* /proc/<pid>/environ in Linux is split at '\0' points, g_strsplit() can't handle that... */
n = 0;
while (TRUE)
{
if (n >= env_len || env[n] == '\0')
break;
if (g_str_has_prefix (env + n, key) && (*(env + n + key_len) == '='))
{
ret = g_strdup (env + n + key_len + 1);
/* skip invalid UTF-8 */
if (!g_utf8_validate (ret, -1, (const char **) &end))
*end = '\0';
break;
}
for (; n < env_len && env[n] != '\0'; n++)
;
n++;
}
g_free (env);
}
g_free (env_filename);
return ret;
}
static char *
pid_get_command_line (GPid pid)
{
char *cmdline_filename;
char *cmdline_contents;
gsize cmdline_len;
guint n;
char *end;
cmdline_contents = NULL;
cmdline_filename = g_strdup_printf ("/proc/%d/cmdline", pid);
if (!g_file_get_contents (cmdline_filename,
&cmdline_contents,
&cmdline_len,
NULL))
goto out;
/* /proc/<pid>/cmdline separates args by NUL-bytes - replace with spaces */
for (n = 0; n < cmdline_len - 1; n++)
{
if (cmdline_contents[n] == '\0')
cmdline_contents[n] = ' ';
}
/* skip invalid UTF-8 */
if (!g_utf8_validate (cmdline_contents, -1, (const char **) &end))
*end = '\0';
out:
g_free (cmdline_filename);
return cmdline_contents;
}
/* ---------------------------------------------------------------------------------------------------- */
#elif defined(__OpenBSD__)
/* ---------------------------------------------------------------------------------------------------- */
static GPid
pid_get_parent (GPid pid)
{
struct kinfo_proc *kp = NULL;
size_t len;
GPid ppid = 0;
/* fail if trying to get the parent of the init process (no such thing) */
if (pid == 1)
goto out;
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid,
sizeof(struct kinfo_proc), 0 };
if (sysctl (mib, G_N_ELEMENTS (mib), NULL, &len, NULL, 0) == -1)
goto out;
mib[5] = (len / sizeof(struct kinfo_proc));
kp = g_malloc0 (len);
if (sysctl (mib, G_N_ELEMENTS (mib), kp, &len, NULL, 0) < 0)
goto out;
ppid = kp->p_ppid;
out:
if (kp)
g_free (kp);
return ppid;
}
static char *
pid_get_env (GPid pid, const char *key)
{
size_t len;
char **strs;
char *ret = NULL;
char *end;
int key_len;
int i;
int mib[] = { CTL_KERN, KERN_PROC_ARGS, pid, KERN_PROC_ENV };
if (sysctl (mib, G_N_ELEMENTS (mib), NULL, &len, NULL, 0) == -1)
return ret;
strs = g_malloc0 (len);
key_len = strlen (key);
if (sysctl (mib, G_N_ELEMENTS (mib), strs, &len, NULL, 0) != -1)
{
for (i = 0; strs[i] != NULL; i++)
{
if (g_str_has_prefix (strs[i], key) && (*(strs[i] + key_len) == '='))
{
ret = g_strdup (strs[i] + key_len + 1);
/* skip invalid UTF-8 */
if (!g_utf8_validate (ret, -1, (const char **) &end))
*end = '\0';
break;
}
}
}
g_free (strs);
return ret;
}
static char *
pid_get_command_line (GPid pid)
{
size_t len;
char **strs;
char *ret, *end;
int mib[] = { CTL_KERN, KERN_PROC_ARGS, pid, KERN_PROC_ARGV };
if (sysctl (mib, G_N_ELEMENTS (mib), NULL, &len, NULL, 0) == -1)
return NULL;
strs = g_malloc0 (len);
if (sysctl (mib, G_N_ELEMENTS (mib), strs, &len, NULL, 0) == -1) {
g_free (strs);
return NULL;
}
ret = g_strjoinv (" ", strs);
/* skip invalid UTF-8 */
if (!g_utf8_validate (ret, -1, (const char **) &end))
*end = '\0';
g_free (strs);
return ret;
}
#else
/* TODO: please implement for your OS - must return valid UTF-8 */
static GPid
pid_get_parent (GPid pid)
{
return 0;
}
static char *
pid_get_env (GPid pid,
const char *key)
{
return NULL;
}
static char *
pid_get_command_line (GPid pid)
{
return NULL;
}
#endif
/* ---------------------------------------------------------------------------------------------------- */
static char *
get_name_for_window_with_pid (GtkMountOperationLookupContext *context,
GPid pid)
{
Window window;
Window windowid_window;
char *ret;
ret = NULL;
window = GPOINTER_TO_INT (g_hash_table_lookup (context->pid_to_window, GINT_TO_POINTER (pid)));
if (window == None)
{
char *windowid_value;
/* check for $WINDOWID (set by terminals) and see if we can get the title that way */
windowid_value = pid_get_env (pid, "WINDOWID");
if (windowid_value != NULL)
{
char *endp;
endp = NULL;
windowid_window = (Window) g_ascii_strtoll (windowid_value, &endp, 10);
if (endp != NULL && *endp == '\0')
{
window = windowid_window;
}
g_free (windowid_value);
}
/* otherwise, check for parents */
if (window == None)
{
do
{
pid = pid_get_parent (pid);
if (pid == 0)
break;
window = GPOINTER_TO_INT (g_hash_table_lookup (context->pid_to_window, GINT_TO_POINTER (pid)));
if (window != None)
break;
}
while (TRUE);
}
}
if (window != None)
{
ret = get_utf8_property (context->display,
GDK_DISPLAY_XDISPLAY (context->display),
window,
gdk_x11_get_xatom_by_name_for_display (context->display,
"_NET_WM_NAME"));
if (ret == NULL)
ret = get_utf8_property (context->display,
GDK_DISPLAY_XDISPLAY (context->display),
window, gdk_x11_get_xatom_by_name_for_display (context->display,
"_NET_WM_ICON_NAME"));
}
return ret;
}
/* ---------------------------------------------------------------------------------------------------- */
static GdkTexture *
get_texture_for_window_with_pid (GtkMountOperationLookupContext *context,
GPid pid,
int size_pixels)
{
Window window;
GdkTexture *ret;
ret = NULL;
window = GPOINTER_TO_INT (g_hash_table_lookup (context->pid_to_window, GINT_TO_POINTER (pid)));
if (window == None)
{
/* otherwise, check for parents */
do
{
pid = pid_get_parent (pid);
if (pid == 0)
break;
window = GPOINTER_TO_INT (g_hash_table_lookup (context->pid_to_window, GINT_TO_POINTER (pid)));
if (window != None)
break;
}
while (TRUE);
}
if (window != None)
{
int width;
int height;
guchar *pixdata;
if (read_rgb_icon (context->display,
GDK_DISPLAY_XDISPLAY (context->display),
window,
size_pixels, size_pixels,
&width, &height,
&pixdata))
{
/* steals pixdata */
ret = scaled_from_pixdata (pixdata,
width, height,
size_pixels, size_pixels);
}
}
return ret;
}
/* ---------------------------------------------------------------------------------------------------- */
static const char *well_known_commands[] =
{
/* translators: this string is a name for the 'less' command */
"less", N_("Terminal Pager"),
"top", N_("Top Command"),
"bash", N_("Bourne Again Shell"),
"sh", N_("Bourne Shell"),
"zsh", N_("Z Shell"),
NULL,
};
gboolean
_gtk_mount_operation_lookup_info (GtkMountOperationLookupContext *context,
GPid pid,
int size_pixels,
char **out_name,
char **out_command_line,
GdkTexture **out_texture)
{
g_return_val_if_fail (out_name != NULL && *out_name == NULL, FALSE);
g_return_val_if_fail (out_command_line != NULL && *out_command_line == NULL, FALSE);
g_return_val_if_fail (out_texture != NULL && *out_texture == NULL, FALSE);
/* We perform two different lookups for name and icon size.. this is
* because we want the name from the window with WINDOWID and this
* normally does not give you an icon
*
* (the canonical example is a tab in gnome-terminal - the shell/command running
* in the shell will have WINDOWID set - but this window won't have an icon - so
* we want to continue up until the gnome-terminal window so we can get that icon)
*/
*out_command_line = pid_get_command_line (pid);
*out_name = get_name_for_window_with_pid (context, pid);
*out_texture = get_texture_for_window_with_pid (context, pid, size_pixels);
/* if we didn't manage to find the name via X, fall back to the basename
* of the first element of the command line and, for maximum geek-comfort,
* map a few well-known commands to proper translated names
*/
if (*out_name == NULL && *out_command_line != NULL &&
strlen (*out_command_line) > 0 && (*out_command_line)[0] != ' ')
{
guint n;
char *s;
char *p;
/* find the first character after the first argument */
s = strchr (*out_command_line, ' ');
if (s == NULL)
s = *out_command_line + strlen (*out_command_line);
for (p = s; p > *out_command_line; p--)
{
if (*p == '/')
{
p++;
break;
}
}
*out_name = g_strndup (p, s - p);
for (n = 0; well_known_commands[n] != NULL; n += 2)
{
/* sometimes the command is prefixed with a -, e.g. '-bash' instead
* of 'bash' - handle that as well
*/
if ((strcmp (well_known_commands[n], *out_name) == 0) ||
((*out_name)[0] == '-' && (strcmp (well_known_commands[n], (*out_name) + 1) == 0)))
{
g_free (*out_name);
*out_name = g_strdup (_(well_known_commands[n+1]));
break;
}
}
}
return TRUE;
}
gboolean
_gtk_mount_operation_kill_process (GPid pid,
GError **error)
{
gboolean ret;
ret = TRUE;
if (kill ((pid_t) pid, SIGTERM) != 0)
{
int errsv = errno;
/* TODO: On EPERM, we could use a setuid helper using polkit (very easy to implement
* via pkexec(1)) to allow the user to e.g. authenticate to gain the authorization
* to kill the process. But that's not how things currently work.
*/
ret = FALSE;
g_set_error (error,
G_IO_ERROR,
g_io_error_from_errno (errsv),
_("Cannot end process with PID %d: %s"),
pid,
g_strerror (errsv));
}
return ret;
}
|
9fe31d6a43208574335ce30b85204a241229ac22
|
eb9dde739035eddb051412a209d739d5b1792287
|
/vendor/github.com/DataDog/zstd/zstd_compress_literals.c
|
c8bf02243a83aafe581d6a7c6b13d20cc2544093
|
[
"BSD-3-Clause",
"BSD-2-Clause",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] |
permissive
|
kedacore/keda
|
ab7cf9c218d932fe1ed5ca63513a43d0c10cb66e
|
046d2bbf85ca2dc5501ee1768bccd784bbb73179
|
refs/heads/main
| 2023-09-01T12:53:13.302943
| 2023-08-29T10:25:45
| 2023-08-29T10:25:45
| 170,411,418
| 6,811
| 1,016
|
Apache-2.0
| 2023-09-13T10:50:56
| 2019-02-13T00:12:33
|
Go
|
UTF-8
|
C
| false
| false
| 6,411
|
c
|
zstd_compress_literals.c
|
#ifndef USE_EXTERNAL_ZSTD
/*
* Copyright (c) Yann Collet, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/
/*-*************************************
* Dependencies
***************************************/
#include "zstd_compress_literals.h"
size_t ZSTD_noCompressLiterals (void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
BYTE* const ostart = (BYTE*)dst;
U32 const flSize = 1 + (srcSize>31) + (srcSize>4095);
RETURN_ERROR_IF(srcSize + flSize > dstCapacity, dstSize_tooSmall, "");
switch(flSize)
{
case 1: /* 2 - 1 - 5 */
ostart[0] = (BYTE)((U32)set_basic + (srcSize<<3));
break;
case 2: /* 2 - 2 - 12 */
MEM_writeLE16(ostart, (U16)((U32)set_basic + (1<<2) + (srcSize<<4)));
break;
case 3: /* 2 - 2 - 20 */
MEM_writeLE32(ostart, (U32)((U32)set_basic + (3<<2) + (srcSize<<4)));
break;
default: /* not necessary : flSize is {1,2,3} */
assert(0);
}
ZSTD_memcpy(ostart + flSize, src, srcSize);
DEBUGLOG(5, "Raw literals: %u -> %u", (U32)srcSize, (U32)(srcSize + flSize));
return srcSize + flSize;
}
size_t ZSTD_compressRleLiteralsBlock (void* dst, size_t dstCapacity, const void* src, size_t srcSize)
{
BYTE* const ostart = (BYTE*)dst;
U32 const flSize = 1 + (srcSize>31) + (srcSize>4095);
(void)dstCapacity; /* dstCapacity already guaranteed to be >=4, hence large enough */
switch(flSize)
{
case 1: /* 2 - 1 - 5 */
ostart[0] = (BYTE)((U32)set_rle + (srcSize<<3));
break;
case 2: /* 2 - 2 - 12 */
MEM_writeLE16(ostart, (U16)((U32)set_rle + (1<<2) + (srcSize<<4)));
break;
case 3: /* 2 - 2 - 20 */
MEM_writeLE32(ostart, (U32)((U32)set_rle + (3<<2) + (srcSize<<4)));
break;
default: /* not necessary : flSize is {1,2,3} */
assert(0);
}
ostart[flSize] = *(const BYTE*)src;
DEBUGLOG(5, "RLE literals: %u -> %u", (U32)srcSize, (U32)flSize + 1);
return flSize+1;
}
size_t ZSTD_compressLiterals (ZSTD_hufCTables_t const* prevHuf,
ZSTD_hufCTables_t* nextHuf,
ZSTD_strategy strategy, int disableLiteralCompression,
void* dst, size_t dstCapacity,
const void* src, size_t srcSize,
void* entropyWorkspace, size_t entropyWorkspaceSize,
const int bmi2,
unsigned suspectUncompressible)
{
size_t const minGain = ZSTD_minGain(srcSize, strategy);
size_t const lhSize = 3 + (srcSize >= 1 KB) + (srcSize >= 16 KB);
BYTE* const ostart = (BYTE*)dst;
U32 singleStream = srcSize < 256;
symbolEncodingType_e hType = set_compressed;
size_t cLitSize;
DEBUGLOG(5,"ZSTD_compressLiterals (disableLiteralCompression=%i srcSize=%u)",
disableLiteralCompression, (U32)srcSize);
/* Prepare nextEntropy assuming reusing the existing table */
ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
if (disableLiteralCompression)
return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize);
/* small ? don't even attempt compression (speed opt) */
# define COMPRESS_LITERALS_SIZE_MIN 63
{ size_t const minLitSize = (prevHuf->repeatMode == HUF_repeat_valid) ? 6 : COMPRESS_LITERALS_SIZE_MIN;
if (srcSize <= minLitSize) return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize);
}
RETURN_ERROR_IF(dstCapacity < lhSize+1, dstSize_tooSmall, "not enough space for compression");
{ HUF_repeat repeat = prevHuf->repeatMode;
int const preferRepeat = strategy < ZSTD_lazy ? srcSize <= 1024 : 0;
if (repeat == HUF_repeat_valid && lhSize == 3) singleStream = 1;
cLitSize = singleStream ?
HUF_compress1X_repeat(
ostart+lhSize, dstCapacity-lhSize, src, srcSize,
HUF_SYMBOLVALUE_MAX, HUF_TABLELOG_DEFAULT, entropyWorkspace, entropyWorkspaceSize,
(HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2, suspectUncompressible) :
HUF_compress4X_repeat(
ostart+lhSize, dstCapacity-lhSize, src, srcSize,
HUF_SYMBOLVALUE_MAX, HUF_TABLELOG_DEFAULT, entropyWorkspace, entropyWorkspaceSize,
(HUF_CElt*)nextHuf->CTable, &repeat, preferRepeat, bmi2, suspectUncompressible);
if (repeat != HUF_repeat_none) {
/* reused the existing table */
DEBUGLOG(5, "Reusing previous huffman table");
hType = set_repeat;
}
}
if ((cLitSize==0) || (cLitSize >= srcSize - minGain) || ERR_isError(cLitSize)) {
ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
return ZSTD_noCompressLiterals(dst, dstCapacity, src, srcSize);
}
if (cLitSize==1) {
ZSTD_memcpy(nextHuf, prevHuf, sizeof(*prevHuf));
return ZSTD_compressRleLiteralsBlock(dst, dstCapacity, src, srcSize);
}
if (hType == set_compressed) {
/* using a newly constructed table */
nextHuf->repeatMode = HUF_repeat_check;
}
/* Build header */
switch(lhSize)
{
case 3: /* 2 - 2 - 10 - 10 */
{ U32 const lhc = hType + ((!singleStream) << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<14);
MEM_writeLE24(ostart, lhc);
break;
}
case 4: /* 2 - 2 - 14 - 14 */
{ U32 const lhc = hType + (2 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<18);
MEM_writeLE32(ostart, lhc);
break;
}
case 5: /* 2 - 2 - 18 - 18 */
{ U32 const lhc = hType + (3 << 2) + ((U32)srcSize<<4) + ((U32)cLitSize<<22);
MEM_writeLE32(ostart, lhc);
ostart[4] = (BYTE)(cLitSize >> 10);
break;
}
default: /* not possible : lhSize is {3,4,5} */
assert(0);
}
DEBUGLOG(5, "Compressed literals: %u -> %u", (U32)srcSize, (U32)(lhSize+cLitSize));
return lhSize+cLitSize;
}
#endif /* USE_EXTERNAL_ZSTD */
|
ca28b02124cff23d221466afd384e265cc1dd674
|
88ae8695987ada722184307301e221e1ba3cc2fa
|
/third_party/ffmpeg/libavutil/mips/generic_macros_msa.h
|
9beb0443ed31034a5b2f7455ec295ff4f66c1856
|
[
"LGPL-2.1-only",
"LGPL-3.0-only",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LGPL-2.1-or-later",
"GPL-3.0-or-later",
"LGPL-3.0-or-later",
"IJG",
"LicenseRef-scancode-other-permissive",
"MIT",
"GPL-2.0-or-later",
"Apache-2.0",
"GPL-3.0-only",
"BSD-3-Clause"
] |
permissive
|
iridium-browser/iridium-browser
|
71d9c5ff76e014e6900b825f67389ab0ccd01329
|
5ee297f53dc7f8e70183031cff62f37b0f19d25f
|
refs/heads/master
| 2023-08-03T16:44:16.844552
| 2023-07-20T15:17:00
| 2023-07-23T16:09:30
| 220,016,632
| 341
| 40
|
BSD-3-Clause
| 2021-08-13T13:54:45
| 2019-11-06T14:32:31
| null |
UTF-8
|
C
| false
| false
| 143,115
|
h
|
generic_macros_msa.h
|
/*
* Copyright (c) 2015 Manojkumar Bhosale (Manojkumar.Bhosale@imgtec.com)
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_MIPS_GENERIC_MACROS_MSA_H
#define AVUTIL_MIPS_GENERIC_MACROS_MSA_H
#include <stdint.h>
#include <msa.h>
#include <config.h>
#define ALIGNMENT 16
#define ALLOC_ALIGNED(align) __attribute__ ((aligned((align) << 1)))
#define LD_V(RTYPE, psrc) *((RTYPE *)(psrc))
#define LD_UB(...) LD_V(v16u8, __VA_ARGS__)
#define LD_SB(...) LD_V(v16i8, __VA_ARGS__)
#define LD_UH(...) LD_V(v8u16, __VA_ARGS__)
#define LD_SH(...) LD_V(v8i16, __VA_ARGS__)
#define LD_UW(...) LD_V(v4u32, __VA_ARGS__)
#define LD_SW(...) LD_V(v4i32, __VA_ARGS__)
#define ST_V(RTYPE, in, pdst) *((RTYPE *)(pdst)) = (in)
#define ST_UB(...) ST_V(v16u8, __VA_ARGS__)
#define ST_SB(...) ST_V(v16i8, __VA_ARGS__)
#define ST_UH(...) ST_V(v8u16, __VA_ARGS__)
#define ST_SH(...) ST_V(v8i16, __VA_ARGS__)
#define ST_UW(...) ST_V(v4u32, __VA_ARGS__)
#define ST_SW(...) ST_V(v4i32, __VA_ARGS__)
#if HAVE_MIPS32R6 || HAVE_MIPS64R6
#define LH(psrc) \
( { \
uint16_t val_lh_m = *(uint16_t *)(psrc); \
val_lh_m; \
} )
#define LW(psrc) \
( { \
uint32_t val_lw_m = *(uint32_t *)(psrc); \
val_lw_m; \
} )
#if (__mips == 64)
#define LD(psrc) \
( { \
uint64_t val_ld_m = *(uint64_t *)(psrc); \
val_ld_m; \
} )
#else // !(__mips == 64)
#define LD(psrc) \
( { \
uint8_t *psrc_ld_m = (uint8_t *) (psrc); \
uint32_t val0_ld_m, val1_ld_m; \
uint64_t val_ld_m = 0; \
\
val0_ld_m = LW(psrc_ld_m); \
val1_ld_m = LW(psrc_ld_m + 4); \
\
val_ld_m = (uint64_t) (val1_ld_m); \
val_ld_m = (uint64_t) ((val_ld_m << 32) & 0xFFFFFFFF00000000); \
val_ld_m = (uint64_t) (val_ld_m | (uint64_t) val0_ld_m); \
\
val_ld_m; \
} )
#endif // (__mips == 64)
#define SH(val, pdst) *(uint16_t *)(pdst) = (val);
#define SW(val, pdst) *(uint32_t *)(pdst) = (val);
#define SD(val, pdst) *(uint64_t *)(pdst) = (val);
#else // !HAVE_MIPS32R6 && !HAVE_MIPS64R6
#define LH(psrc) \
( { \
uint8_t *psrc_lh_m = (uint8_t *) (psrc); \
uint16_t val_lh_m; \
\
__asm__ volatile ( \
"ulh %[val_lh_m], %[psrc_lh_m] \n\t" \
\
: [val_lh_m] "=r" (val_lh_m) \
: [psrc_lh_m] "m" (*psrc_lh_m) \
); \
\
val_lh_m; \
} )
#define LW(psrc) \
( { \
uint8_t *psrc_lw_m = (uint8_t *) (psrc); \
uint32_t val_lw_m; \
\
__asm__ volatile ( \
"lwr %[val_lw_m], 0(%[psrc_lw_m]) \n\t" \
"lwl %[val_lw_m], 3(%[psrc_lw_m]) \n\t" \
\
: [val_lw_m] "=&r"(val_lw_m) \
: [psrc_lw_m] "r"(psrc_lw_m) \
); \
\
val_lw_m; \
} )
#if (__mips == 64)
#define LD(psrc) \
( { \
uint8_t *psrc_ld_m = (uint8_t *) (psrc); \
uint64_t val_ld_m = 0; \
\
__asm__ volatile ( \
"ldr %[val_ld_m], 0(%[psrc_ld_m]) \n\t" \
"ldl %[val_ld_m], 7(%[psrc_ld_m]) \n\t" \
\
: [val_ld_m] "=&r" (val_ld_m) \
: [psrc_ld_m] "r" (psrc_ld_m) \
); \
\
val_ld_m; \
} )
#else // !(__mips == 64)
#define LD(psrc) \
( { \
uint8_t *psrc_ld_m = (uint8_t *) (psrc); \
uint32_t val0_ld_m, val1_ld_m; \
uint64_t val_ld_m = 0; \
\
val0_ld_m = LW(psrc_ld_m); \
val1_ld_m = LW(psrc_ld_m + 4); \
\
val_ld_m = (uint64_t) (val1_ld_m); \
val_ld_m = (uint64_t) ((val_ld_m << 32) & 0xFFFFFFFF00000000); \
val_ld_m = (uint64_t) (val_ld_m | (uint64_t) val0_ld_m); \
\
val_ld_m; \
} )
#endif // (__mips == 64)
#define SH(val, pdst) \
{ \
uint8_t *pdst_sh_m = (uint8_t *) (pdst); \
uint16_t val_sh_m = (val); \
\
__asm__ volatile ( \
"ush %[val_sh_m], %[pdst_sh_m] \n\t" \
\
: [pdst_sh_m] "=m" (*pdst_sh_m) \
: [val_sh_m] "r" (val_sh_m) \
); \
}
#define SW(val, pdst) \
{ \
uint8_t *pdst_sw_m = (uint8_t *) (pdst); \
uint32_t val_sw_m = (val); \
\
__asm__ volatile ( \
"usw %[val_sw_m], %[pdst_sw_m] \n\t" \
\
: [pdst_sw_m] "=m" (*pdst_sw_m) \
: [val_sw_m] "r" (val_sw_m) \
); \
}
#define SD(val, pdst) \
{ \
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
uint32_t val0_sd_m, val1_sd_m; \
\
val0_sd_m = (uint32_t) ((val) & 0x00000000FFFFFFFF); \
val1_sd_m = (uint32_t) (((val) >> 32) & 0x00000000FFFFFFFF); \
\
SW(val0_sd_m, pdst_sd_m); \
SW(val1_sd_m, pdst_sd_m + 4); \
}
#endif // HAVE_MIPS32R6 || HAVE_MIPS64R6
/* Description : Load 4 words with stride
Arguments : Inputs - psrc (source pointer to load from)
- stride
Outputs - out0, out1, out2, out3
Details : Loads word in 'out0' from (psrc)
Loads word in 'out1' from (psrc + stride)
Loads word in 'out2' from (psrc + 2 * stride)
Loads word in 'out3' from (psrc + 3 * stride)
*/
#define LW4(psrc, stride, out0, out1, out2, out3) \
{ \
out0 = LW((psrc)); \
out1 = LW((psrc) + stride); \
out2 = LW((psrc) + 2 * stride); \
out3 = LW((psrc) + 3 * stride); \
}
#define LW2(psrc, stride, out0, out1) \
{ \
out0 = LW((psrc)); \
out1 = LW((psrc) + stride); \
}
/* Description : Load double words with stride
Arguments : Inputs - psrc (source pointer to load from)
- stride
Outputs - out0, out1
Details : Loads double word in 'out0' from (psrc)
Loads double word in 'out1' from (psrc + stride)
*/
#define LD2(psrc, stride, out0, out1) \
{ \
out0 = LD((psrc)); \
out1 = LD((psrc) + stride); \
}
#define LD4(psrc, stride, out0, out1, out2, out3) \
{ \
LD2((psrc), stride, out0, out1); \
LD2((psrc) + 2 * stride, stride, out2, out3); \
}
/* Description : Store 4 words with stride
Arguments : Inputs - in0, in1, in2, in3, pdst, stride
Details : Stores word from 'in0' to (pdst)
Stores word from 'in1' to (pdst + stride)
Stores word from 'in2' to (pdst + 2 * stride)
Stores word from 'in3' to (pdst + 3 * stride)
*/
#define SW4(in0, in1, in2, in3, pdst, stride) \
{ \
SW(in0, (pdst)) \
SW(in1, (pdst) + stride); \
SW(in2, (pdst) + 2 * stride); \
SW(in3, (pdst) + 3 * stride); \
}
/* Description : Store 4 double words with stride
Arguments : Inputs - in0, in1, in2, in3, pdst, stride
Details : Stores double word from 'in0' to (pdst)
Stores double word from 'in1' to (pdst + stride)
Stores double word from 'in2' to (pdst + 2 * stride)
Stores double word from 'in3' to (pdst + 3 * stride)
*/
#define SD4(in0, in1, in2, in3, pdst, stride) \
{ \
SD(in0, (pdst)) \
SD(in1, (pdst) + stride); \
SD(in2, (pdst) + 2 * stride); \
SD(in3, (pdst) + 3 * stride); \
}
/* Description : Load vector elements with stride
Arguments : Inputs - psrc (source pointer to load from)
- stride
Outputs - out0, out1
Return Type - as per RTYPE
Details : Loads elements in 'out0' from (psrc)
Loads elements in 'out1' from (psrc + stride)
*/
#define LD_V2(RTYPE, psrc, stride, out0, out1) \
{ \
out0 = LD_V(RTYPE, (psrc)); \
out1 = LD_V(RTYPE, (psrc) + stride); \
}
#define LD_UB2(...) LD_V2(v16u8, __VA_ARGS__)
#define LD_SB2(...) LD_V2(v16i8, __VA_ARGS__)
#define LD_UH2(...) LD_V2(v8u16, __VA_ARGS__)
#define LD_SH2(...) LD_V2(v8i16, __VA_ARGS__)
#define LD_SW2(...) LD_V2(v4i32, __VA_ARGS__)
#define LD_V3(RTYPE, psrc, stride, out0, out1, out2) \
{ \
LD_V2(RTYPE, (psrc), stride, out0, out1); \
out2 = LD_V(RTYPE, (psrc) + 2 * stride); \
}
#define LD_UB3(...) LD_V3(v16u8, __VA_ARGS__)
#define LD_SB3(...) LD_V3(v16i8, __VA_ARGS__)
#define LD_V4(RTYPE, psrc, stride, out0, out1, out2, out3) \
{ \
LD_V2(RTYPE, (psrc), stride, out0, out1); \
LD_V2(RTYPE, (psrc) + 2 * stride , stride, out2, out3); \
}
#define LD_UB4(...) LD_V4(v16u8, __VA_ARGS__)
#define LD_SB4(...) LD_V4(v16i8, __VA_ARGS__)
#define LD_UH4(...) LD_V4(v8u16, __VA_ARGS__)
#define LD_SH4(...) LD_V4(v8i16, __VA_ARGS__)
#define LD_SW4(...) LD_V4(v4i32, __VA_ARGS__)
#define LD_V5(RTYPE, psrc, stride, out0, out1, out2, out3, out4) \
{ \
LD_V4(RTYPE, (psrc), stride, out0, out1, out2, out3); \
out4 = LD_V(RTYPE, (psrc) + 4 * stride); \
}
#define LD_UB5(...) LD_V5(v16u8, __VA_ARGS__)
#define LD_SB5(...) LD_V5(v16i8, __VA_ARGS__)
#define LD_V6(RTYPE, psrc, stride, out0, out1, out2, out3, out4, out5) \
{ \
LD_V4(RTYPE, (psrc), stride, out0, out1, out2, out3); \
LD_V2(RTYPE, (psrc) + 4 * stride, stride, out4, out5); \
}
#define LD_UB6(...) LD_V6(v16u8, __VA_ARGS__)
#define LD_SB6(...) LD_V6(v16i8, __VA_ARGS__)
#define LD_UH6(...) LD_V6(v8u16, __VA_ARGS__)
#define LD_SH6(...) LD_V6(v8i16, __VA_ARGS__)
#define LD_V7(RTYPE, psrc, stride, \
out0, out1, out2, out3, out4, out5, out6) \
{ \
LD_V5(RTYPE, (psrc), stride, out0, out1, out2, out3, out4); \
LD_V2(RTYPE, (psrc) + 5 * stride, stride, out5, out6); \
}
#define LD_UB7(...) LD_V7(v16u8, __VA_ARGS__)
#define LD_SB7(...) LD_V7(v16i8, __VA_ARGS__)
#define LD_V8(RTYPE, psrc, stride, \
out0, out1, out2, out3, out4, out5, out6, out7) \
{ \
LD_V4(RTYPE, (psrc), stride, out0, out1, out2, out3); \
LD_V4(RTYPE, (psrc) + 4 * stride, stride, out4, out5, out6, out7); \
}
#define LD_UB8(...) LD_V8(v16u8, __VA_ARGS__)
#define LD_SB8(...) LD_V8(v16i8, __VA_ARGS__)
#define LD_UH8(...) LD_V8(v8u16, __VA_ARGS__)
#define LD_SH8(...) LD_V8(v8i16, __VA_ARGS__)
#define LD_SW8(...) LD_V8(v4i32, __VA_ARGS__)
#define LD_V16(RTYPE, psrc, stride, \
out0, out1, out2, out3, out4, out5, out6, out7, \
out8, out9, out10, out11, out12, out13, out14, out15) \
{ \
LD_V8(RTYPE, (psrc), stride, \
out0, out1, out2, out3, out4, out5, out6, out7); \
LD_V8(RTYPE, (psrc) + 8 * stride, stride, \
out8, out9, out10, out11, out12, out13, out14, out15); \
}
#define LD_SH16(...) LD_V16(v8i16, __VA_ARGS__)
/* Description : Store vectors with stride
Arguments : Inputs - in0, in1, stride
Outputs - pdst (destination pointer to store to)
Details : Stores elements from 'in0' to (pdst)
Stores elements from 'in1' to (pdst + stride)
*/
#define ST_V2(RTYPE, in0, in1, pdst, stride) \
{ \
ST_V(RTYPE, in0, (pdst)); \
ST_V(RTYPE, in1, (pdst) + stride); \
}
#define ST_UB2(...) ST_V2(v16u8, __VA_ARGS__)
#define ST_SB2(...) ST_V2(v16i8, __VA_ARGS__)
#define ST_UH2(...) ST_V2(v8u16, __VA_ARGS__)
#define ST_SH2(...) ST_V2(v8i16, __VA_ARGS__)
#define ST_SW2(...) ST_V2(v4i32, __VA_ARGS__)
#define ST_V4(RTYPE, in0, in1, in2, in3, pdst, stride) \
{ \
ST_V2(RTYPE, in0, in1, (pdst), stride); \
ST_V2(RTYPE, in2, in3, (pdst) + 2 * stride, stride); \
}
#define ST_UB4(...) ST_V4(v16u8, __VA_ARGS__)
#define ST_SB4(...) ST_V4(v16i8, __VA_ARGS__)
#define ST_SH4(...) ST_V4(v8i16, __VA_ARGS__)
#define ST_SW4(...) ST_V4(v4i32, __VA_ARGS__)
#define ST_V6(RTYPE, in0, in1, in2, in3, in4, in5, pdst, stride) \
{ \
ST_V4(RTYPE, in0, in1, in2, in3, (pdst), stride); \
ST_V2(RTYPE, in4, in5, (pdst) + 4 * stride, stride); \
}
#define ST_SH6(...) ST_V6(v8i16, __VA_ARGS__)
#define ST_V8(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
{ \
ST_V4(RTYPE, in0, in1, in2, in3, (pdst), stride); \
ST_V4(RTYPE, in4, in5, in6, in7, (pdst) + 4 * stride, stride); \
}
#define ST_UB8(...) ST_V8(v16u8, __VA_ARGS__)
#define ST_SH8(...) ST_V8(v8i16, __VA_ARGS__)
#define ST_SW8(...) ST_V8(v4i32, __VA_ARGS__)
/* Description : Store half word elements of vector with stride
* Arguments : Inputs - in source vector
* - pdst (destination pointer to store to)
* - stride
* Details : Stores half word 'idx0' from 'in' to (pdst)
* Stores half word 'idx1' from 'in' to (pdst + stride)
* Similar for other elements
*/
#define ST_H1(in, idx, pdst) \
{ \
uint16_t out0_m; \
out0_m = __msa_copy_u_h((v8i16) in, idx); \
SH(out0_m, (pdst)); \
}
#define ST_H2(in, idx0, idx1, pdst, stride) \
{ \
uint16_t out0_m, out1_m; \
out0_m = __msa_copy_u_h((v8i16) in, idx0); \
out1_m = __msa_copy_u_h((v8i16) in, idx1); \
SH(out0_m, (pdst)); \
SH(out1_m, (pdst) + stride); \
}
#define ST_H4(in, idx0, idx1, idx2, idx3, pdst, stride) \
{ \
uint16_t out0_m, out1_m, out2_m, out3_m; \
out0_m = __msa_copy_u_h((v8i16) in, idx0); \
out1_m = __msa_copy_u_h((v8i16) in, idx1); \
out2_m = __msa_copy_u_h((v8i16) in, idx2); \
out3_m = __msa_copy_u_h((v8i16) in, idx3); \
SH(out0_m, (pdst)); \
SH(out1_m, (pdst) + stride); \
SH(out2_m, (pdst) + 2 * stride); \
SH(out3_m, (pdst) + 3 * stride); \
}
#define ST_H8(in, idx0, idx1, idx2, idx3, idx4, idx5, \
idx6, idx7, pdst, stride) \
{ \
ST_H4(in, idx0, idx1, idx2, idx3, pdst, stride) \
ST_H4(in, idx4, idx5, idx6, idx7, (pdst) + 4*stride, stride) \
}
/* Description : Store word elements of vector with stride
* Arguments : Inputs - in source vector
* - pdst (destination pointer to store to)
* - stride
* Details : Stores word 'idx0' from 'in' to (pdst)
* Stores word 'idx1' from 'in' to (pdst + stride)
* Similar for other elements
*/
#define ST_W1(in, idx, pdst) \
{ \
uint32_t out0_m; \
out0_m = __msa_copy_u_w((v4i32) in, idx); \
SW(out0_m, (pdst)); \
}
#define ST_W2(in, idx0, idx1, pdst, stride) \
{ \
uint32_t out0_m, out1_m; \
out0_m = __msa_copy_u_w((v4i32) in, idx0); \
out1_m = __msa_copy_u_w((v4i32) in, idx1); \
SW(out0_m, (pdst)); \
SW(out1_m, (pdst) + stride); \
}
#define ST_W4(in, idx0, idx1, idx2, idx3, pdst, stride) \
{ \
uint32_t out0_m, out1_m, out2_m, out3_m; \
out0_m = __msa_copy_u_w((v4i32) in, idx0); \
out1_m = __msa_copy_u_w((v4i32) in, idx1); \
out2_m = __msa_copy_u_w((v4i32) in, idx2); \
out3_m = __msa_copy_u_w((v4i32) in, idx3); \
SW(out0_m, (pdst)); \
SW(out1_m, (pdst) + stride); \
SW(out2_m, (pdst) + 2*stride); \
SW(out3_m, (pdst) + 3*stride); \
}
#define ST_W8(in0, in1, idx0, idx1, idx2, idx3, \
idx4, idx5, idx6, idx7, pdst, stride) \
{ \
ST_W4(in0, idx0, idx1, idx2, idx3, pdst, stride) \
ST_W4(in1, idx4, idx5, idx6, idx7, pdst + 4*stride, stride) \
}
/* Description : Store double word elements of vector with stride
* Arguments : Inputs - in source vector
* - pdst (destination pointer to store to)
* - stride
* Details : Stores double word 'idx0' from 'in' to (pdst)
* Stores double word 'idx1' from 'in' to (pdst + stride)
* Similar for other elements
*/
#define ST_D1(in, idx, pdst) \
{ \
uint64_t out0_m; \
out0_m = __msa_copy_u_d((v2i64) in, idx); \
SD(out0_m, (pdst)); \
}
#define ST_D2(in, idx0, idx1, pdst, stride) \
{ \
uint64_t out0_m, out1_m; \
out0_m = __msa_copy_u_d((v2i64) in, idx0); \
out1_m = __msa_copy_u_d((v2i64) in, idx1); \
SD(out0_m, (pdst)); \
SD(out1_m, (pdst) + stride); \
}
#define ST_D4(in0, in1, idx0, idx1, idx2, idx3, pdst, stride) \
{ \
uint64_t out0_m, out1_m, out2_m, out3_m; \
out0_m = __msa_copy_u_d((v2i64) in0, idx0); \
out1_m = __msa_copy_u_d((v2i64) in0, idx1); \
out2_m = __msa_copy_u_d((v2i64) in1, idx2); \
out3_m = __msa_copy_u_d((v2i64) in1, idx3); \
SD(out0_m, (pdst)); \
SD(out1_m, (pdst) + stride); \
SD(out2_m, (pdst) + 2 * stride); \
SD(out3_m, (pdst) + 3 * stride); \
}
#define ST_D8(in0, in1, in2, in3, idx0, idx1, idx2, idx3, \
idx4, idx5, idx6, idx7, pdst, stride) \
{ \
ST_D4(in0, in1, idx0, idx1, idx2, idx3, pdst, stride) \
ST_D4(in2, in3, idx4, idx5, idx6, idx7, pdst + 4 * stride, stride) \
}
/* Description : Store as 12x8 byte block to destination memory from
input vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
Details : Index 0 double word element from input vector 'in0' is copied
and stored to destination memory at (pblk_12x8_m) followed by
index 2 word element from same input vector 'in0' at
(pblk_12x8_m + 8)
Similar to remaining lines
*/
#define ST12x8_UB(in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
{ \
uint64_t out0_m, out1_m, out2_m, out3_m; \
uint64_t out4_m, out5_m, out6_m, out7_m; \
uint32_t out8_m, out9_m, out10_m, out11_m; \
uint32_t out12_m, out13_m, out14_m, out15_m; \
uint8_t *pblk_12x8_m = (uint8_t *) (pdst); \
\
out0_m = __msa_copy_u_d((v2i64) in0, 0); \
out1_m = __msa_copy_u_d((v2i64) in1, 0); \
out2_m = __msa_copy_u_d((v2i64) in2, 0); \
out3_m = __msa_copy_u_d((v2i64) in3, 0); \
out4_m = __msa_copy_u_d((v2i64) in4, 0); \
out5_m = __msa_copy_u_d((v2i64) in5, 0); \
out6_m = __msa_copy_u_d((v2i64) in6, 0); \
out7_m = __msa_copy_u_d((v2i64) in7, 0); \
\
out8_m = __msa_copy_u_w((v4i32) in0, 2); \
out9_m = __msa_copy_u_w((v4i32) in1, 2); \
out10_m = __msa_copy_u_w((v4i32) in2, 2); \
out11_m = __msa_copy_u_w((v4i32) in3, 2); \
out12_m = __msa_copy_u_w((v4i32) in4, 2); \
out13_m = __msa_copy_u_w((v4i32) in5, 2); \
out14_m = __msa_copy_u_w((v4i32) in6, 2); \
out15_m = __msa_copy_u_w((v4i32) in7, 2); \
\
SD(out0_m, pblk_12x8_m); \
SW(out8_m, pblk_12x8_m + 8); \
pblk_12x8_m += stride; \
SD(out1_m, pblk_12x8_m); \
SW(out9_m, pblk_12x8_m + 8); \
pblk_12x8_m += stride; \
SD(out2_m, pblk_12x8_m); \
SW(out10_m, pblk_12x8_m + 8); \
pblk_12x8_m += stride; \
SD(out3_m, pblk_12x8_m); \
SW(out11_m, pblk_12x8_m + 8); \
pblk_12x8_m += stride; \
SD(out4_m, pblk_12x8_m); \
SW(out12_m, pblk_12x8_m + 8); \
pblk_12x8_m += stride; \
SD(out5_m, pblk_12x8_m); \
SW(out13_m, pblk_12x8_m + 8); \
pblk_12x8_m += stride; \
SD(out6_m, pblk_12x8_m); \
SW(out14_m, pblk_12x8_m + 8); \
pblk_12x8_m += stride; \
SD(out7_m, pblk_12x8_m); \
SW(out15_m, pblk_12x8_m + 8); \
}
/* Description : average with rounding (in0 + in1 + 1) / 2.
Arguments : Inputs - in0, in1, in2, in3,
Outputs - out0, out1
Return Type - as per RTYPE
Details : Each byte element from 'in0' vector is added with each byte
element from 'in1' vector. The addition of the elements plus 1
(for rounding) is done unsigned with full precision,
i.e. the result has one extra bit. Unsigned division by 2
(or logical shift right by one bit) is performed before writing
the result to vector 'out0'
Similar for the pair of 'in2' and 'in3'
*/
#define AVER_UB2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_aver_u_b((v16u8) in0, (v16u8) in1); \
out1 = (RTYPE) __msa_aver_u_b((v16u8) in2, (v16u8) in3); \
}
#define AVER_UB2_UB(...) AVER_UB2(v16u8, __VA_ARGS__)
#define AVER_UB4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
AVER_UB2(RTYPE, in0, in1, in2, in3, out0, out1) \
AVER_UB2(RTYPE, in4, in5, in6, in7, out2, out3) \
}
#define AVER_UB4_UB(...) AVER_UB4(v16u8, __VA_ARGS__)
/* Description : Immediate number of columns to slide
Arguments : Inputs - s, d, slide_val
Outputs - out
Return Type - as per RTYPE
Details : Byte elements from 'd' vector are slide into 's' by
number of elements specified by 'slide_val'
*/
#define SLDI_B(RTYPE, d, s, slide_val, out) \
{ \
out = (RTYPE) __msa_sldi_b((v16i8) d, (v16i8) s, slide_val); \
}
#define SLDI_B2(RTYPE, d0, s0, d1, s1, slide_val, out0, out1) \
{ \
SLDI_B(RTYPE, d0, s0, slide_val, out0) \
SLDI_B(RTYPE, d1, s1, slide_val, out1) \
}
#define SLDI_B2_UB(...) SLDI_B2(v16u8, __VA_ARGS__)
#define SLDI_B2_SB(...) SLDI_B2(v16i8, __VA_ARGS__)
#define SLDI_B2_SH(...) SLDI_B2(v8i16, __VA_ARGS__)
#define SLDI_B2_SW(...) SLDI_B2(v4i32, __VA_ARGS__)
#define SLDI_B3(RTYPE, d0, s0, d1, s1, d2, s2, slide_val, \
out0, out1, out2) \
{ \
SLDI_B2(RTYPE, d0, s0, d1, s1, slide_val, out0, out1) \
SLDI_B(RTYPE, d2, s2, slide_val, out2) \
}
#define SLDI_B3_UB(...) SLDI_B3(v16u8, __VA_ARGS__)
#define SLDI_B3_SB(...) SLDI_B3(v16i8, __VA_ARGS__)
#define SLDI_B3_UH(...) SLDI_B3(v8u16, __VA_ARGS__)
#define SLDI_B4(RTYPE, d0, s0, d1, s1, d2, s2, d3, s3, \
slide_val, out0, out1, out2, out3) \
{ \
SLDI_B2(RTYPE, d0, s0, d1, s1, slide_val, out0, out1) \
SLDI_B2(RTYPE, d2, s2, d3, s3, slide_val, out2, out3) \
}
#define SLDI_B4_UB(...) SLDI_B4(v16u8, __VA_ARGS__)
#define SLDI_B4_SB(...) SLDI_B4(v16i8, __VA_ARGS__)
#define SLDI_B4_SH(...) SLDI_B4(v8i16, __VA_ARGS__)
/* Description : Shuffle byte vector elements as per mask vector
Arguments : Inputs - in0, in1, in2, in3, mask0, mask1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Selective byte elements from in0 & in1 are copied to out0 as
per control vector mask0
Selective byte elements from in2 & in3 are copied to out1 as
per control vector mask1
*/
#define VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) \
{ \
out0 = (RTYPE) __msa_vshf_b((v16i8) mask0, (v16i8) in1, (v16i8) in0); \
out1 = (RTYPE) __msa_vshf_b((v16i8) mask1, (v16i8) in3, (v16i8) in2); \
}
#define VSHF_B2_UB(...) VSHF_B2(v16u8, __VA_ARGS__)
#define VSHF_B2_SB(...) VSHF_B2(v16i8, __VA_ARGS__)
#define VSHF_B2_UH(...) VSHF_B2(v8u16, __VA_ARGS__)
#define VSHF_B2_SH(...) VSHF_B2(v8i16, __VA_ARGS__)
#define VSHF_B3(RTYPE, in0, in1, in2, in3, in4, in5, mask0, mask1, mask2, \
out0, out1, out2) \
{ \
VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1); \
out2 = (RTYPE) __msa_vshf_b((v16i8) mask2, (v16i8) in5, (v16i8) in4); \
}
#define VSHF_B3_SB(...) VSHF_B3(v16i8, __VA_ARGS__)
#define VSHF_B4(RTYPE, in0, in1, mask0, mask1, mask2, mask3, \
out0, out1, out2, out3) \
{ \
VSHF_B2(RTYPE, in0, in1, in0, in1, mask0, mask1, out0, out1); \
VSHF_B2(RTYPE, in0, in1, in0, in1, mask2, mask3, out2, out3); \
}
#define VSHF_B4_SB(...) VSHF_B4(v16i8, __VA_ARGS__)
#define VSHF_B4_SH(...) VSHF_B4(v8i16, __VA_ARGS__)
/* Description : Shuffle halfword vector elements as per mask vector
Arguments : Inputs - in0, in1, in2, in3, mask0, mask1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Selective halfword elements from in0 & in1 are copied to out0
as per control vector mask0
Selective halfword elements from in2 & in3 are copied to out1
as per control vector mask1
*/
#define VSHF_H2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) \
{ \
out0 = (RTYPE) __msa_vshf_h((v8i16) mask0, (v8i16) in1, (v8i16) in0); \
out1 = (RTYPE) __msa_vshf_h((v8i16) mask1, (v8i16) in3, (v8i16) in2); \
}
#define VSHF_H2_SH(...) VSHF_H2(v8i16, __VA_ARGS__)
#define VSHF_H3(RTYPE, in0, in1, in2, in3, in4, in5, mask0, mask1, mask2, \
out0, out1, out2) \
{ \
VSHF_H2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1); \
out2 = (RTYPE) __msa_vshf_h((v8i16) mask2, (v8i16) in5, (v8i16) in4); \
}
#define VSHF_H3_SH(...) VSHF_H3(v8i16, __VA_ARGS__)
/* Description : Shuffle byte vector elements as per mask vector
Arguments : Inputs - in0, in1, in2, in3, mask0, mask1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Selective byte elements from in0 & in1 are copied to out0 as
per control vector mask0
Selective byte elements from in2 & in3 are copied to out1 as
per control vector mask1
*/
#define VSHF_W2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) \
{ \
out0 = (RTYPE) __msa_vshf_w((v4i32) mask0, (v4i32) in1, (v4i32) in0); \
out1 = (RTYPE) __msa_vshf_w((v4i32) mask1, (v4i32) in3, (v4i32) in2); \
}
#define VSHF_W2_SB(...) VSHF_W2(v16i8, __VA_ARGS__)
/* Description : Dot product of byte vector elements
Arguments : Inputs - mult0, mult1
cnst0, cnst1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Unsigned byte elements from mult0 are multiplied with
unsigned byte elements from cnst0 producing a result
twice the size of input i.e. unsigned halfword.
Then this multiplication results of adjacent odd-even elements
are added together and stored to the out vector
(2 unsigned halfword results)
*/
#define DOTP_UB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \
{ \
out0 = (RTYPE) __msa_dotp_u_h((v16u8) mult0, (v16u8) cnst0); \
out1 = (RTYPE) __msa_dotp_u_h((v16u8) mult1, (v16u8) cnst1); \
}
#define DOTP_UB2_UH(...) DOTP_UB2(v8u16, __VA_ARGS__)
#define DOTP_UB4(RTYPE, mult0, mult1, mult2, mult3, \
cnst0, cnst1, cnst2, cnst3, \
out0, out1, out2, out3) \
{ \
DOTP_UB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1); \
DOTP_UB2(RTYPE, mult2, mult3, cnst2, cnst3, out2, out3); \
}
#define DOTP_UB4_UH(...) DOTP_UB4(v8u16, __VA_ARGS__)
/* Description : Dot product of byte vector elements
Arguments : Inputs - mult0, mult1
cnst0, cnst1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Signed byte elements from mult0 are multiplied with
signed byte elements from cnst0 producing a result
twice the size of input i.e. signed halfword.
Then this multiplication results of adjacent odd-even elements
are added together and stored to the out vector
(2 signed halfword results)
*/
#define DOTP_SB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \
{ \
out0 = (RTYPE) __msa_dotp_s_h((v16i8) mult0, (v16i8) cnst0); \
out1 = (RTYPE) __msa_dotp_s_h((v16i8) mult1, (v16i8) cnst1); \
}
#define DOTP_SB2_SH(...) DOTP_SB2(v8i16, __VA_ARGS__)
#define DOTP_SB3(RTYPE, mult0, mult1, mult2, cnst0, cnst1, cnst2, \
out0, out1, out2) \
{ \
DOTP_SB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1); \
out2 = (RTYPE) __msa_dotp_s_h((v16i8) mult2, (v16i8) cnst2); \
}
#define DOTP_SB3_SH(...) DOTP_SB3(v8i16, __VA_ARGS__)
#define DOTP_SB4(RTYPE, mult0, mult1, mult2, mult3, \
cnst0, cnst1, cnst2, cnst3, out0, out1, out2, out3) \
{ \
DOTP_SB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1); \
DOTP_SB2(RTYPE, mult2, mult3, cnst2, cnst3, out2, out3); \
}
#define DOTP_SB4_SH(...) DOTP_SB4(v8i16, __VA_ARGS__)
/* Description : Dot product of halfword vector elements
Arguments : Inputs - mult0, mult1
cnst0, cnst1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Signed halfword elements from mult0 are multiplied with
signed halfword elements from cnst0 producing a result
twice the size of input i.e. signed word.
Then this multiplication results of adjacent odd-even elements
are added together and stored to the out vector
(2 signed word results)
*/
#define DOTP_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \
{ \
out0 = (RTYPE) __msa_dotp_s_w((v8i16) mult0, (v8i16) cnst0); \
out1 = (RTYPE) __msa_dotp_s_w((v8i16) mult1, (v8i16) cnst1); \
}
#define DOTP_SH2_SW(...) DOTP_SH2(v4i32, __VA_ARGS__)
#define DOTP_SH4(RTYPE, mult0, mult1, mult2, mult3, \
cnst0, cnst1, cnst2, cnst3, \
out0, out1, out2, out3) \
{ \
DOTP_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1); \
DOTP_SH2(RTYPE, mult2, mult3, cnst2, cnst3, out2, out3); \
}
#define DOTP_SH4_SW(...) DOTP_SH4(v4i32, __VA_ARGS__)
/* Description : Dot product & addition of byte vector elements
Arguments : Inputs - mult0, mult1
cnst0, cnst1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Signed byte elements from mult0 are multiplied with
signed byte elements from cnst0 producing a result
twice the size of input i.e. signed halfword.
Then this multiplication results of adjacent odd-even elements
are added to the out vector
(2 signed halfword results)
*/
#define DPADD_SB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \
{ \
out0 = (RTYPE) __msa_dpadd_s_h((v8i16) out0, \
(v16i8) mult0, (v16i8) cnst0); \
out1 = (RTYPE) __msa_dpadd_s_h((v8i16) out1, \
(v16i8) mult1, (v16i8) cnst1); \
}
#define DPADD_SB2_SH(...) DPADD_SB2(v8i16, __VA_ARGS__)
#define DPADD_SB4(RTYPE, mult0, mult1, mult2, mult3, \
cnst0, cnst1, cnst2, cnst3, out0, out1, out2, out3) \
{ \
DPADD_SB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1); \
DPADD_SB2(RTYPE, mult2, mult3, cnst2, cnst3, out2, out3); \
}
#define DPADD_SB4_SH(...) DPADD_SB4(v8i16, __VA_ARGS__)
/* Description : Dot product & addition of byte vector elements
Arguments : Inputs - mult0, mult1
cnst0, cnst1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Unsigned byte elements from mult0 are multiplied with
unsigned byte elements from cnst0 producing a result
twice the size of input i.e. unsigned halfword.
Then this multiplication results of adjacent odd-even elements
are added to the out vector
(2 unsigned halfword results)
*/
#define DPADD_UB2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \
{ \
out0 = (RTYPE) __msa_dpadd_u_h((v8u16) out0, \
(v16u8) mult0, (v16u8) cnst0); \
out1 = (RTYPE) __msa_dpadd_u_h((v8u16) out1, \
(v16u8) mult1, (v16u8) cnst1); \
}
#define DPADD_UB2_UH(...) DPADD_UB2(v8u16, __VA_ARGS__)
/* Description : Dot product & addition of halfword vector elements
Arguments : Inputs - mult0, mult1
cnst0, cnst1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Signed halfword elements from mult0 are multiplied with
signed halfword elements from cnst0 producing a result
twice the size of input i.e. signed word.
Then this multiplication results of adjacent odd-even elements
are added to the out vector
(2 signed word results)
*/
#define DPADD_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1) \
{ \
out0 = (RTYPE) __msa_dpadd_s_w((v4i32) out0, \
(v8i16) mult0, (v8i16) cnst0); \
out1 = (RTYPE) __msa_dpadd_s_w((v4i32) out1, \
(v8i16) mult1, (v8i16) cnst1); \
}
#define DPADD_SH2_SW(...) DPADD_SH2(v4i32, __VA_ARGS__)
#define DPADD_SH4(RTYPE, mult0, mult1, mult2, mult3, \
cnst0, cnst1, cnst2, cnst3, out0, out1, out2, out3) \
{ \
DPADD_SH2(RTYPE, mult0, mult1, cnst0, cnst1, out0, out1); \
DPADD_SH2(RTYPE, mult2, mult3, cnst2, cnst3, out2, out3); \
}
#define DPADD_SH4_SW(...) DPADD_SH4(v4i32, __VA_ARGS__)
/* Description : Minimum values between unsigned elements of
either vector are copied to the output vector
Arguments : Inputs - in0, in1, min_vec
Outputs - in0, in1, (in place)
Return Type - as per RTYPE
Details : Minimum of unsigned halfword element values from 'in0' and
'min_value' are written to output vector 'in0'
*/
#define MIN_UH2(RTYPE, in0, in1, min_vec) \
{ \
in0 = (RTYPE) __msa_min_u_h((v8u16) in0, min_vec); \
in1 = (RTYPE) __msa_min_u_h((v8u16) in1, min_vec); \
}
#define MIN_UH2_UH(...) MIN_UH2(v8u16, __VA_ARGS__)
#define MIN_UH4(RTYPE, in0, in1, in2, in3, min_vec) \
{ \
MIN_UH2(RTYPE, in0, in1, min_vec); \
MIN_UH2(RTYPE, in2, in3, min_vec); \
}
#define MIN_UH4_UH(...) MIN_UH4(v8u16, __VA_ARGS__)
/* Description : Clips all halfword elements of input vector between min & max
out = ((in) < (min)) ? (min) : (((in) > (max)) ? (max) : (in))
Arguments : Inputs - in (input vector)
- min (min threshold)
- max (max threshold)
Outputs - in (output vector with clipped elements)
Return Type - signed halfword
*/
#define CLIP_SH(in, min, max) \
{ \
in = __msa_max_s_h((v8i16) min, (v8i16) in); \
in = __msa_min_s_h((v8i16) max, (v8i16) in); \
}
/* Description : Clips all signed halfword elements of input vector
between 0 & 255
Arguments : Inputs - in (input vector)
Outputs - in (output vector with clipped elements)
Return Type - signed halfwords
*/
#define CLIP_SH_0_255(in) \
{ \
in = __msa_maxi_s_h((v8i16) in, 0); \
in = (v8i16) __msa_sat_u_h((v8u16) in, 7); \
}
#define CLIP_SH2_0_255(in0, in1) \
{ \
CLIP_SH_0_255(in0); \
CLIP_SH_0_255(in1); \
}
#define CLIP_SH4_0_255(in0, in1, in2, in3) \
{ \
CLIP_SH2_0_255(in0, in1); \
CLIP_SH2_0_255(in2, in3); \
}
#define CLIP_SH8_0_255(in0, in1, in2, in3, \
in4, in5, in6, in7) \
{ \
CLIP_SH4_0_255(in0, in1, in2, in3); \
CLIP_SH4_0_255(in4, in5, in6, in7); \
}
/* Description : Clips all signed word elements of input vector
between 0 & 255
Arguments : Inputs - in (input vector)
Outputs - in (output vector with clipped elements)
Return Type - signed word
*/
#define CLIP_SW_0_255(in) \
{ \
in = __msa_maxi_s_w((v4i32) in, 0); \
in = (v4i32) __msa_sat_u_w((v4u32) in, 7); \
}
#define CLIP_SW2_0_255(in0, in1) \
{ \
CLIP_SW_0_255(in0); \
CLIP_SW_0_255(in1); \
}
#define CLIP_SW4_0_255(in0, in1, in2, in3) \
{ \
CLIP_SW2_0_255(in0, in1); \
CLIP_SW2_0_255(in2, in3); \
}
#define CLIP_SW8_0_255(in0, in1, in2, in3, \
in4, in5, in6, in7) \
{ \
CLIP_SW4_0_255(in0, in1, in2, in3); \
CLIP_SW4_0_255(in4, in5, in6, in7); \
}
/* Description : Addition of 4 signed word elements
4 signed word elements of input vector are added together and
resulted integer sum is returned
Arguments : Inputs - in (signed word vector)
Outputs - sum_m (i32 sum)
Return Type - signed word
*/
#define HADD_SW_S32(in) \
( { \
v2i64 res0_m, res1_m; \
int32_t sum_m; \
\
res0_m = __msa_hadd_s_d((v4i32) in, (v4i32) in); \
res1_m = __msa_splati_d(res0_m, 1); \
res0_m += res1_m; \
sum_m = __msa_copy_s_w((v4i32) res0_m, 0); \
sum_m; \
} )
/* Description : Addition of 8 unsigned halfword elements
8 unsigned halfword elements of input vector are added
together and resulted integer sum is returned
Arguments : Inputs - in (unsigned halfword vector)
Outputs - sum_m (u32 sum)
Return Type - unsigned word
*/
#define HADD_UH_U32(in) \
( { \
v4u32 res_m; \
v2u64 res0_m, res1_m; \
uint32_t sum_m; \
\
res_m = __msa_hadd_u_w((v8u16) in, (v8u16) in); \
res0_m = __msa_hadd_u_d(res_m, res_m); \
res1_m = (v2u64) __msa_splati_d((v2i64) res0_m, 1); \
res0_m += res1_m; \
sum_m = __msa_copy_u_w((v4i32) res0_m, 0); \
sum_m; \
} )
/* Description : Horizontal addition of signed byte vector elements
Arguments : Inputs - in0, in1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Each signed odd byte element from 'in0' is added to
even signed byte element from 'in0' (pairwise) and the
halfword result is stored in 'out0'
*/
#define HADD_SB2(RTYPE, in0, in1, out0, out1) \
{ \
out0 = (RTYPE) __msa_hadd_s_h((v16i8) in0, (v16i8) in0); \
out1 = (RTYPE) __msa_hadd_s_h((v16i8) in1, (v16i8) in1); \
}
#define HADD_SB2_SH(...) HADD_SB2(v8i16, __VA_ARGS__)
#define HADD_SB4(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) \
{ \
HADD_SB2(RTYPE, in0, in1, out0, out1); \
HADD_SB2(RTYPE, in2, in3, out2, out3); \
}
#define HADD_SB4_UH(...) HADD_SB4(v8u16, __VA_ARGS__)
#define HADD_SB4_SH(...) HADD_SB4(v8i16, __VA_ARGS__)
/* Description : Horizontal addition of unsigned byte vector elements
Arguments : Inputs - in0, in1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Each unsigned odd byte element from 'in0' is added to
even unsigned byte element from 'in0' (pairwise) and the
halfword result is stored in 'out0'
*/
#define HADD_UB2(RTYPE, in0, in1, out0, out1) \
{ \
out0 = (RTYPE) __msa_hadd_u_h((v16u8) in0, (v16u8) in0); \
out1 = (RTYPE) __msa_hadd_u_h((v16u8) in1, (v16u8) in1); \
}
#define HADD_UB2_UH(...) HADD_UB2(v8u16, __VA_ARGS__)
#define HADD_UB3(RTYPE, in0, in1, in2, out0, out1, out2) \
{ \
HADD_UB2(RTYPE, in0, in1, out0, out1); \
out2 = (RTYPE) __msa_hadd_u_h((v16u8) in2, (v16u8) in2); \
}
#define HADD_UB3_UH(...) HADD_UB3(v8u16, __VA_ARGS__)
#define HADD_UB4(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) \
{ \
HADD_UB2(RTYPE, in0, in1, out0, out1); \
HADD_UB2(RTYPE, in2, in3, out2, out3); \
}
#define HADD_UB4_UB(...) HADD_UB4(v16u8, __VA_ARGS__)
#define HADD_UB4_UH(...) HADD_UB4(v8u16, __VA_ARGS__)
#define HADD_UB4_SH(...) HADD_UB4(v8i16, __VA_ARGS__)
/* Description : Horizontal subtraction of unsigned byte vector elements
Arguments : Inputs - in0, in1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Each unsigned odd byte element from 'in0' is subtracted from
even unsigned byte element from 'in0' (pairwise) and the
halfword result is stored in 'out0'
*/
#define HSUB_UB2(RTYPE, in0, in1, out0, out1) \
{ \
out0 = (RTYPE) __msa_hsub_u_h((v16u8) in0, (v16u8) in0); \
out1 = (RTYPE) __msa_hsub_u_h((v16u8) in1, (v16u8) in1); \
}
#define HSUB_UB2_UH(...) HSUB_UB2(v8u16, __VA_ARGS__)
#define HSUB_UB2_SH(...) HSUB_UB2(v8i16, __VA_ARGS__)
#define HSUB_UB4(RTYPE, in0, in1, in2, in3, out0, out1, out2, out3) \
{ \
HSUB_UB2(RTYPE, in0, in1, out0, out1); \
HSUB_UB2(RTYPE, in2, in3, out2, out3); \
}
#define HSUB_UB4_UH(...) HSUB_UB4(v8u16, __VA_ARGS__)
#define HSUB_UB4_SH(...) HSUB_UB4(v8i16, __VA_ARGS__)
/* Description : SAD (Sum of Absolute Difference)
Arguments : Inputs - in0, in1, ref0, ref1 (unsigned byte src & ref)
Outputs - sad_m (halfword vector with sad)
Return Type - unsigned halfword
Details : Absolute difference of all the byte elements from 'in0' with
'ref0' is calculated and preserved in 'diff0'. From the 16
unsigned absolute diff values, even-odd pairs are added
together to generate 8 halfword results.
*/
#define SAD_UB2_UH(in0, in1, ref0, ref1) \
( { \
v16u8 diff0_m, diff1_m; \
v8u16 sad_m = { 0 }; \
\
diff0_m = __msa_asub_u_b((v16u8) in0, (v16u8) ref0); \
diff1_m = __msa_asub_u_b((v16u8) in1, (v16u8) ref1); \
\
sad_m += __msa_hadd_u_h((v16u8) diff0_m, (v16u8) diff0_m); \
sad_m += __msa_hadd_u_h((v16u8) diff1_m, (v16u8) diff1_m); \
\
sad_m; \
} )
/* Description : Insert specified word elements from input vectors to 1
destination vector
Arguments : Inputs - in0, in1, in2, in3 (4 input vectors)
Outputs - out (output vector)
Return Type - as per RTYPE
*/
#define INSERT_W2(RTYPE, in0, in1, out) \
{ \
out = (RTYPE) __msa_insert_w((v4i32) out, 0, in0); \
out = (RTYPE) __msa_insert_w((v4i32) out, 1, in1); \
}
#define INSERT_W2_UB(...) INSERT_W2(v16u8, __VA_ARGS__)
#define INSERT_W2_SB(...) INSERT_W2(v16i8, __VA_ARGS__)
#define INSERT_W4(RTYPE, in0, in1, in2, in3, out) \
{ \
out = (RTYPE) __msa_insert_w((v4i32) out, 0, in0); \
out = (RTYPE) __msa_insert_w((v4i32) out, 1, in1); \
out = (RTYPE) __msa_insert_w((v4i32) out, 2, in2); \
out = (RTYPE) __msa_insert_w((v4i32) out, 3, in3); \
}
#define INSERT_W4_UB(...) INSERT_W4(v16u8, __VA_ARGS__)
#define INSERT_W4_SB(...) INSERT_W4(v16i8, __VA_ARGS__)
#define INSERT_W4_SH(...) INSERT_W4(v8i16, __VA_ARGS__)
#define INSERT_W4_SW(...) INSERT_W4(v4i32, __VA_ARGS__)
/* Description : Insert specified double word elements from input vectors to 1
destination vector
Arguments : Inputs - in0, in1 (2 input vectors)
Outputs - out (output vector)
Return Type - as per RTYPE
*/
#define INSERT_D2(RTYPE, in0, in1, out) \
{ \
out = (RTYPE) __msa_insert_d((v2i64) out, 0, in0); \
out = (RTYPE) __msa_insert_d((v2i64) out, 1, in1); \
}
#define INSERT_D2_UB(...) INSERT_D2(v16u8, __VA_ARGS__)
#define INSERT_D2_SB(...) INSERT_D2(v16i8, __VA_ARGS__)
#define INSERT_D2_SH(...) INSERT_D2(v8i16, __VA_ARGS__)
#define INSERT_D2_SD(...) INSERT_D2(v2i64, __VA_ARGS__)
/* Description : Interleave even byte elements from vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Even byte elements of 'in0' and even byte
elements of 'in1' are interleaved and copied to 'out0'
Even byte elements of 'in2' and even byte
elements of 'in3' are interleaved and copied to 'out1'
*/
#define ILVEV_B2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvev_b((v16i8) in1, (v16i8) in0); \
out1 = (RTYPE) __msa_ilvev_b((v16i8) in3, (v16i8) in2); \
}
#define ILVEV_B2_UB(...) ILVEV_B2(v16u8, __VA_ARGS__)
#define ILVEV_B2_SB(...) ILVEV_B2(v16i8, __VA_ARGS__)
#define ILVEV_B2_SH(...) ILVEV_B2(v8i16, __VA_ARGS__)
#define ILVEV_B2_SD(...) ILVEV_B2(v2i64, __VA_ARGS__)
/* Description : Interleave even halfword elements from vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Even halfword elements of 'in0' and even halfword
elements of 'in1' are interleaved and copied to 'out0'
Even halfword elements of 'in2' and even halfword
elements of 'in3' are interleaved and copied to 'out1'
*/
#define ILVEV_H2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvev_h((v8i16) in1, (v8i16) in0); \
out1 = (RTYPE) __msa_ilvev_h((v8i16) in3, (v8i16) in2); \
}
#define ILVEV_H2_UB(...) ILVEV_H2(v16u8, __VA_ARGS__)
#define ILVEV_H2_SH(...) ILVEV_H2(v8i16, __VA_ARGS__)
#define ILVEV_H2_SW(...) ILVEV_H2(v4i32, __VA_ARGS__)
/* Description : Interleave even word elements from vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Even word elements of 'in0' and even word
elements of 'in1' are interleaved and copied to 'out0'
Even word elements of 'in2' and even word
elements of 'in3' are interleaved and copied to 'out1'
*/
#define ILVEV_W2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvev_w((v4i32) in1, (v4i32) in0); \
out1 = (RTYPE) __msa_ilvev_w((v4i32) in3, (v4i32) in2); \
}
#define ILVEV_W2_UB(...) ILVEV_W2(v16u8, __VA_ARGS__)
#define ILVEV_W2_SB(...) ILVEV_W2(v16i8, __VA_ARGS__)
#define ILVEV_W2_UH(...) ILVEV_W2(v8u16, __VA_ARGS__)
#define ILVEV_W2_SD(...) ILVEV_W2(v2i64, __VA_ARGS__)
/* Description : Interleave even double word elements from vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Even double word elements of 'in0' and even double word
elements of 'in1' are interleaved and copied to 'out0'
Even double word elements of 'in2' and even double word
elements of 'in3' are interleaved and copied to 'out1'
*/
#define ILVEV_D2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvev_d((v2i64) in1, (v2i64) in0); \
out1 = (RTYPE) __msa_ilvev_d((v2i64) in3, (v2i64) in2); \
}
#define ILVEV_D2_UB(...) ILVEV_D2(v16u8, __VA_ARGS__)
#define ILVEV_D2_SB(...) ILVEV_D2(v16i8, __VA_ARGS__)
#define ILVEV_D2_SW(...) ILVEV_D2(v4i32, __VA_ARGS__)
/* Description : Interleave left half of byte elements from vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Left half of byte elements of in0 and left half of byte
elements of in1 are interleaved and copied to out0.
Left half of byte elements of in2 and left half of byte
elements of in3 are interleaved and copied to out1.
*/
#define ILVL_B2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvl_b((v16i8) in0, (v16i8) in1); \
out1 = (RTYPE) __msa_ilvl_b((v16i8) in2, (v16i8) in3); \
}
#define ILVL_B2_UB(...) ILVL_B2(v16u8, __VA_ARGS__)
#define ILVL_B2_SB(...) ILVL_B2(v16i8, __VA_ARGS__)
#define ILVL_B2_UH(...) ILVL_B2(v8u16, __VA_ARGS__)
#define ILVL_B2_SH(...) ILVL_B2(v8i16, __VA_ARGS__)
#define ILVL_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
ILVL_B2(RTYPE, in0, in1, in2, in3, out0, out1); \
ILVL_B2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVL_B4_UB(...) ILVL_B4(v16u8, __VA_ARGS__)
#define ILVL_B4_SB(...) ILVL_B4(v16i8, __VA_ARGS__)
#define ILVL_B4_UH(...) ILVL_B4(v8u16, __VA_ARGS__)
#define ILVL_B4_SH(...) ILVL_B4(v8i16, __VA_ARGS__)
/* Description : Interleave left half of halfword elements from vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Left half of halfword elements of in0 and left half of halfword
elements of in1 are interleaved and copied to out0.
Left half of halfword elements of in2 and left half of halfword
elements of in3 are interleaved and copied to out1.
*/
#define ILVL_H2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvl_h((v8i16) in0, (v8i16) in1); \
out1 = (RTYPE) __msa_ilvl_h((v8i16) in2, (v8i16) in3); \
}
#define ILVL_H2_SH(...) ILVL_H2(v8i16, __VA_ARGS__)
#define ILVL_H2_SW(...) ILVL_H2(v4i32, __VA_ARGS__)
#define ILVL_H4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
ILVL_H2(RTYPE, in0, in1, in2, in3, out0, out1); \
ILVL_H2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVL_H4_SH(...) ILVL_H4(v8i16, __VA_ARGS__)
#define ILVL_H4_SW(...) ILVL_H4(v4i32, __VA_ARGS__)
/* Description : Interleave left half of word elements from vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Left half of word elements of in0 and left half of word
elements of in1 are interleaved and copied to out0.
Left half of word elements of in2 and left half of word
elements of in3 are interleaved and copied to out1.
*/
#define ILVL_W2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvl_w((v4i32) in0, (v4i32) in1); \
out1 = (RTYPE) __msa_ilvl_w((v4i32) in2, (v4i32) in3); \
}
#define ILVL_W2_UB(...) ILVL_W2(v16u8, __VA_ARGS__)
#define ILVL_W2_SB(...) ILVL_W2(v16i8, __VA_ARGS__)
#define ILVL_W2_SH(...) ILVL_W2(v8i16, __VA_ARGS__)
/* Description : Interleave right half of byte elements from vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7
Outputs - out0, out1, out2, out3
Return Type - as per RTYPE
Details : Right half of byte elements of in0 and right half of byte
elements of in1 are interleaved and copied to out0.
Right half of byte elements of in2 and right half of byte
elements of in3 are interleaved and copied to out1.
Similar for other pairs
*/
#define ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvr_b((v16i8) in0, (v16i8) in1); \
out1 = (RTYPE) __msa_ilvr_b((v16i8) in2, (v16i8) in3); \
}
#define ILVR_B2_UB(...) ILVR_B2(v16u8, __VA_ARGS__)
#define ILVR_B2_SB(...) ILVR_B2(v16i8, __VA_ARGS__)
#define ILVR_B2_UH(...) ILVR_B2(v8u16, __VA_ARGS__)
#define ILVR_B2_SH(...) ILVR_B2(v8i16, __VA_ARGS__)
#define ILVR_B2_SW(...) ILVR_B2(v4i32, __VA_ARGS__)
#define ILVR_B3(RTYPE, in0, in1, in2, in3, in4, in5, out0, out1, out2) \
{ \
ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1); \
out2 = (RTYPE) __msa_ilvr_b((v16i8) in4, (v16i8) in5); \
}
#define ILVR_B3_UB(...) ILVR_B3(v16u8, __VA_ARGS__)
#define ILVR_B3_SB(...) ILVR_B3(v16i8, __VA_ARGS__)
#define ILVR_B3_UH(...) ILVR_B3(v8u16, __VA_ARGS__)
#define ILVR_B3_SH(...) ILVR_B3(v8i16, __VA_ARGS__)
#define ILVR_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1); \
ILVR_B2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVR_B4_UB(...) ILVR_B4(v16u8, __VA_ARGS__)
#define ILVR_B4_SB(...) ILVR_B4(v16i8, __VA_ARGS__)
#define ILVR_B4_UH(...) ILVR_B4(v8u16, __VA_ARGS__)
#define ILVR_B4_SH(...) ILVR_B4(v8i16, __VA_ARGS__)
#define ILVR_B4_SW(...) ILVR_B4(v4i32, __VA_ARGS__)
#define ILVR_B8(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
in8, in9, in10, in11, in12, in13, in14, in15, \
out0, out1, out2, out3, out4, out5, out6, out7) \
{ \
ILVR_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3); \
ILVR_B4(RTYPE, in8, in9, in10, in11, in12, in13, in14, in15, \
out4, out5, out6, out7); \
}
#define ILVR_B8_UH(...) ILVR_B8(v8u16, __VA_ARGS__)
#define ILVR_B8_SW(...) ILVR_B8(v4i32, __VA_ARGS__)
/* Description : Interleave right half of halfword elements from vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7
Outputs - out0, out1, out2, out3
Return Type - as per RTYPE
Details : Right half of halfword elements of in0 and right half of
halfword elements of in1 are interleaved and copied to out0.
Right half of halfword elements of in2 and right half of
halfword elements of in3 are interleaved and copied to out1.
Similar for other pairs
*/
#define ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvr_h((v8i16) in0, (v8i16) in1); \
out1 = (RTYPE) __msa_ilvr_h((v8i16) in2, (v8i16) in3); \
}
#define ILVR_H2_SH(...) ILVR_H2(v8i16, __VA_ARGS__)
#define ILVR_H2_SW(...) ILVR_H2(v4i32, __VA_ARGS__)
#define ILVR_H3(RTYPE, in0, in1, in2, in3, in4, in5, out0, out1, out2) \
{ \
ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1); \
out2 = (RTYPE) __msa_ilvr_h((v8i16) in4, (v8i16) in5); \
}
#define ILVR_H3_SH(...) ILVR_H3(v8i16, __VA_ARGS__)
#define ILVR_H4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
ILVR_H2(RTYPE, in0, in1, in2, in3, out0, out1); \
ILVR_H2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVR_H4_SH(...) ILVR_H4(v8i16, __VA_ARGS__)
#define ILVR_H4_SW(...) ILVR_H4(v4i32, __VA_ARGS__)
#define ILVR_W2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvr_w((v4i32) in0, (v4i32) in1); \
out1 = (RTYPE) __msa_ilvr_w((v4i32) in2, (v4i32) in3); \
}
#define ILVR_W2_UB(...) ILVR_W2(v16u8, __VA_ARGS__)
#define ILVR_W2_SB(...) ILVR_W2(v16i8, __VA_ARGS__)
#define ILVR_W2_SH(...) ILVR_W2(v8i16, __VA_ARGS__)
#define ILVR_W4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
ILVR_W2(RTYPE, in0, in1, in2, in3, out0, out1); \
ILVR_W2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVR_W4_SB(...) ILVR_W4(v16i8, __VA_ARGS__)
#define ILVR_W4_UB(...) ILVR_W4(v16u8, __VA_ARGS__)
/* Description : Interleave right half of double word elements from vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7
Outputs - out0, out1, out2, out3
Return Type - as per RTYPE
Details : Right half of double word elements of in0 and right half of
double word elements of in1 are interleaved and copied to out0.
Right half of double word elements of in2 and right half of
double word elements of in3 are interleaved and copied to out1.
*/
#define ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvr_d((v2i64) in0, (v2i64) in1); \
out1 = (RTYPE) __msa_ilvr_d((v2i64) in2, (v2i64) in3); \
}
#define ILVR_D2_UB(...) ILVR_D2(v16u8, __VA_ARGS__)
#define ILVR_D2_SB(...) ILVR_D2(v16i8, __VA_ARGS__)
#define ILVR_D2_SH(...) ILVR_D2(v8i16, __VA_ARGS__)
#define ILVR_D3(RTYPE, in0, in1, in2, in3, in4, in5, out0, out1, out2) \
{ \
ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1); \
out2 = (RTYPE) __msa_ilvr_d((v2i64) in4, (v2i64) in5); \
}
#define ILVR_D3_SB(...) ILVR_D3(v16i8, __VA_ARGS__)
#define ILVR_D4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
ILVR_D2(RTYPE, in0, in1, in2, in3, out0, out1); \
ILVR_D2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ILVR_D4_SB(...) ILVR_D4(v16i8, __VA_ARGS__)
#define ILVR_D4_UB(...) ILVR_D4(v16u8, __VA_ARGS__)
/* Description : Interleave left half of double word elements from vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Left half of double word elements of in0 and left half of
double word elements of in1 are interleaved and copied to out0.
Left half of double word elements of in2 and left half of
double word elements of in3 are interleaved and copied to out1.
*/
#define ILVL_D2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvl_d((v2i64) in0, (v2i64) in1); \
out1 = (RTYPE) __msa_ilvl_d((v2i64) in2, (v2i64) in3); \
}
#define ILVL_D2_UB(...) ILVL_D2(v16u8, __VA_ARGS__)
#define ILVL_D2_SB(...) ILVL_D2(v16i8, __VA_ARGS__)
#define ILVL_D2_SH(...) ILVL_D2(v8i16, __VA_ARGS__)
/* Description : Interleave both left and right half of input vectors
Arguments : Inputs - in0, in1
Outputs - out0, out1
Return Type - as per RTYPE
Details : Right half of byte elements from 'in0' and 'in1' are
interleaved and stored to 'out0'
Left half of byte elements from 'in0' and 'in1' are
interleaved and stored to 'out1'
*/
#define ILVRL_B2(RTYPE, in0, in1, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvr_b((v16i8) in0, (v16i8) in1); \
out1 = (RTYPE) __msa_ilvl_b((v16i8) in0, (v16i8) in1); \
}
#define ILVRL_B2_UB(...) ILVRL_B2(v16u8, __VA_ARGS__)
#define ILVRL_B2_SB(...) ILVRL_B2(v16i8, __VA_ARGS__)
#define ILVRL_B2_UH(...) ILVRL_B2(v8u16, __VA_ARGS__)
#define ILVRL_B2_SH(...) ILVRL_B2(v8i16, __VA_ARGS__)
#define ILVRL_B2_SW(...) ILVRL_B2(v4i32, __VA_ARGS__)
#define ILVRL_H2(RTYPE, in0, in1, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvr_h((v8i16) in0, (v8i16) in1); \
out1 = (RTYPE) __msa_ilvl_h((v8i16) in0, (v8i16) in1); \
}
#define ILVRL_H2_UB(...) ILVRL_H2(v16u8, __VA_ARGS__)
#define ILVRL_H2_SB(...) ILVRL_H2(v16i8, __VA_ARGS__)
#define ILVRL_H2_SH(...) ILVRL_H2(v8i16, __VA_ARGS__)
#define ILVRL_H2_SW(...) ILVRL_H2(v4i32, __VA_ARGS__)
#define ILVRL_W2(RTYPE, in0, in1, out0, out1) \
{ \
out0 = (RTYPE) __msa_ilvr_w((v4i32) in0, (v4i32) in1); \
out1 = (RTYPE) __msa_ilvl_w((v4i32) in0, (v4i32) in1); \
}
#define ILVRL_W2_UB(...) ILVRL_W2(v16u8, __VA_ARGS__)
#define ILVRL_W2_SH(...) ILVRL_W2(v8i16, __VA_ARGS__)
#define ILVRL_W2_SW(...) ILVRL_W2(v4i32, __VA_ARGS__)
/* Description : Maximum values between signed elements of vector and
5-bit signed immediate value are copied to the output vector
Arguments : Inputs - in0, in1, in2, in3, max_val
Outputs - in0, in1, in2, in3 (in place)
Return Type - as per RTYPE
Details : Maximum of signed halfword element values from 'in0' and
'max_val' are written to output vector 'in0'
*/
#define MAXI_SH2(RTYPE, in0, in1, max_val) \
{ \
in0 = (RTYPE) __msa_maxi_s_h((v8i16) in0, max_val); \
in1 = (RTYPE) __msa_maxi_s_h((v8i16) in1, max_val); \
}
#define MAXI_SH2_UH(...) MAXI_SH2(v8u16, __VA_ARGS__)
#define MAXI_SH2_SH(...) MAXI_SH2(v8i16, __VA_ARGS__)
#define MAXI_SH4(RTYPE, in0, in1, in2, in3, max_val) \
{ \
MAXI_SH2(RTYPE, in0, in1, max_val); \
MAXI_SH2(RTYPE, in2, in3, max_val); \
}
#define MAXI_SH4_UH(...) MAXI_SH4(v8u16, __VA_ARGS__)
#define MAXI_SH4_SH(...) MAXI_SH4(v8i16, __VA_ARGS__)
#define MAXI_SH8(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, max_val) \
{ \
MAXI_SH4(RTYPE, in0, in1, in2, in3, max_val); \
MAXI_SH4(RTYPE, in4, in5, in6, in7, max_val); \
}
#define MAXI_SH8_UH(...) MAXI_SH8(v8u16, __VA_ARGS__)
#define MAXI_SH8_SH(...) MAXI_SH8(v8i16, __VA_ARGS__)
/* Description : Saturate the halfword element values to the max
unsigned value of (sat_val+1 bits)
The element data width remains unchanged
Arguments : Inputs - in0, in1, in2, in3, sat_val
Outputs - in0, in1, in2, in3 (in place)
Return Type - as per RTYPE
Details : Each unsigned halfword element from 'in0' is saturated to the
value generated with (sat_val+1) bit range
Results are in placed to original vectors
*/
#define SAT_UH2(RTYPE, in0, in1, sat_val) \
{ \
in0 = (RTYPE) __msa_sat_u_h((v8u16) in0, sat_val); \
in1 = (RTYPE) __msa_sat_u_h((v8u16) in1, sat_val); \
}
#define SAT_UH2_UH(...) SAT_UH2(v8u16, __VA_ARGS__)
#define SAT_UH2_SH(...) SAT_UH2(v8i16, __VA_ARGS__)
#define SAT_UH4(RTYPE, in0, in1, in2, in3, sat_val) \
{ \
SAT_UH2(RTYPE, in0, in1, sat_val); \
SAT_UH2(RTYPE, in2, in3, sat_val); \
}
#define SAT_UH4_UH(...) SAT_UH4(v8u16, __VA_ARGS__)
#define SAT_UH4_SH(...) SAT_UH4(v8i16, __VA_ARGS__)
#define SAT_UH8(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, sat_val) \
{ \
SAT_UH4(RTYPE, in0, in1, in2, in3, sat_val); \
SAT_UH4(RTYPE, in4, in5, in6, in7, sat_val); \
}
#define SAT_UH8_UH(...) SAT_UH8(v8u16, __VA_ARGS__)
#define SAT_UH8_SH(...) SAT_UH8(v8i16, __VA_ARGS__)
/* Description : Saturate the halfword element values to the max
unsigned value of (sat_val+1 bits)
The element data width remains unchanged
Arguments : Inputs - in0, in1, in2, in3, sat_val
Outputs - in0, in1, in2, in3 (in place)
Return Type - as per RTYPE
Details : Each unsigned halfword element from 'in0' is saturated to the
value generated with (sat_val+1) bit range
Results are in placed to original vectors
*/
#define SAT_SH2(RTYPE, in0, in1, sat_val) \
{ \
in0 = (RTYPE) __msa_sat_s_h((v8i16) in0, sat_val); \
in1 = (RTYPE) __msa_sat_s_h((v8i16) in1, sat_val); \
}
#define SAT_SH2_SH(...) SAT_SH2(v8i16, __VA_ARGS__)
#define SAT_SH3(RTYPE, in0, in1, in2, sat_val) \
{ \
SAT_SH2(RTYPE, in0, in1, sat_val); \
in2 = (RTYPE) __msa_sat_s_h((v8i16) in2, sat_val); \
}
#define SAT_SH3_SH(...) SAT_SH3(v8i16, __VA_ARGS__)
#define SAT_SH4(RTYPE, in0, in1, in2, in3, sat_val) \
{ \
SAT_SH2(RTYPE, in0, in1, sat_val); \
SAT_SH2(RTYPE, in2, in3, sat_val); \
}
#define SAT_SH4_SH(...) SAT_SH4(v8i16, __VA_ARGS__)
/* Description : Saturate the word element values to the max
unsigned value of (sat_val+1 bits)
The element data width remains unchanged
Arguments : Inputs - in0, in1, in2, in3, sat_val
Outputs - in0, in1, in2, in3 (in place)
Return Type - as per RTYPE
Details : Each unsigned word element from 'in0' is saturated to the
value generated with (sat_val+1) bit range
Results are in placed to original vectors
*/
#define SAT_SW2(RTYPE, in0, in1, sat_val) \
{ \
in0 = (RTYPE) __msa_sat_s_w((v4i32) in0, sat_val); \
in1 = (RTYPE) __msa_sat_s_w((v4i32) in1, sat_val); \
}
#define SAT_SW2_SW(...) SAT_SW2(v4i32, __VA_ARGS__)
#define SAT_SW4(RTYPE, in0, in1, in2, in3, sat_val) \
{ \
SAT_SW2(RTYPE, in0, in1, sat_val); \
SAT_SW2(RTYPE, in2, in3, sat_val); \
}
#define SAT_SW4_SW(...) SAT_SW4(v4i32, __VA_ARGS__)
/* Description : Indexed halfword element values are replicated to all
elements in output vector
Arguments : Inputs - in, idx0, idx1
Outputs - out0, out1
Return Type - as per RTYPE
Details : 'idx0' element value from 'in' vector is replicated to all
elements in 'out0' vector
Valid index range for halfword operation is 0-7
*/
#define SPLATI_H2(RTYPE, in, idx0, idx1, out0, out1) \
{ \
out0 = (RTYPE) __msa_splati_h((v8i16) in, idx0); \
out1 = (RTYPE) __msa_splati_h((v8i16) in, idx1); \
}
#define SPLATI_H2_SB(...) SPLATI_H2(v16i8, __VA_ARGS__)
#define SPLATI_H2_SH(...) SPLATI_H2(v8i16, __VA_ARGS__)
#define SPLATI_H3(RTYPE, in, idx0, idx1, idx2, \
out0, out1, out2) \
{ \
SPLATI_H2(RTYPE, in, idx0, idx1, out0, out1); \
out2 = (RTYPE) __msa_splati_h((v8i16) in, idx2); \
}
#define SPLATI_H3_SB(...) SPLATI_H3(v16i8, __VA_ARGS__)
#define SPLATI_H3_SH(...) SPLATI_H3(v8i16, __VA_ARGS__)
#define SPLATI_H4(RTYPE, in, idx0, idx1, idx2, idx3, \
out0, out1, out2, out3) \
{ \
SPLATI_H2(RTYPE, in, idx0, idx1, out0, out1); \
SPLATI_H2(RTYPE, in, idx2, idx3, out2, out3); \
}
#define SPLATI_H4_SB(...) SPLATI_H4(v16i8, __VA_ARGS__)
#define SPLATI_H4_SH(...) SPLATI_H4(v8i16, __VA_ARGS__)
/* Description : Indexed word element values are replicated to all
elements in output vector
Arguments : Inputs - in, stidx
Outputs - out0, out1
Return Type - as per RTYPE
Details : 'stidx' element value from 'in' vector is replicated to all
elements in 'out0' vector
'stidx + 1' element value from 'in' vector is replicated to all
elements in 'out1' vector
Valid index range for halfword operation is 0-3
*/
#define SPLATI_W2(RTYPE, in, stidx, out0, out1) \
{ \
out0 = (RTYPE) __msa_splati_w((v4i32) in, stidx); \
out1 = (RTYPE) __msa_splati_w((v4i32) in, (stidx+1)); \
}
#define SPLATI_W2_SH(...) SPLATI_W2(v8i16, __VA_ARGS__)
#define SPLATI_W2_SW(...) SPLATI_W2(v4i32, __VA_ARGS__)
#define SPLATI_W4(RTYPE, in, out0, out1, out2, out3) \
{ \
SPLATI_W2(RTYPE, in, 0, out0, out1); \
SPLATI_W2(RTYPE, in, 2, out2, out3); \
}
#define SPLATI_W4_SH(...) SPLATI_W4(v8i16, __VA_ARGS__)
#define SPLATI_W4_SW(...) SPLATI_W4(v4i32, __VA_ARGS__)
/* Description : Pack even byte elements of vector pairs
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Even byte elements of in0 are copied to the left half of
out0 & even byte elements of in1 are copied to the right
half of out0.
Even byte elements of in2 are copied to the left half of
out1 & even byte elements of in3 are copied to the right
half of out1.
*/
#define PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_pckev_b((v16i8) in0, (v16i8) in1); \
out1 = (RTYPE) __msa_pckev_b((v16i8) in2, (v16i8) in3); \
}
#define PCKEV_B2_SB(...) PCKEV_B2(v16i8, __VA_ARGS__)
#define PCKEV_B2_UB(...) PCKEV_B2(v16u8, __VA_ARGS__)
#define PCKEV_B2_SH(...) PCKEV_B2(v8i16, __VA_ARGS__)
#define PCKEV_B2_SW(...) PCKEV_B2(v4i32, __VA_ARGS__)
#define PCKEV_B3(RTYPE, in0, in1, in2, in3, in4, in5, out0, out1, out2) \
{ \
PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1); \
out2 = (RTYPE) __msa_pckev_b((v16i8) in4, (v16i8) in5); \
}
#define PCKEV_B3_UB(...) PCKEV_B3(v16u8, __VA_ARGS__)
#define PCKEV_B3_SB(...) PCKEV_B3(v16i8, __VA_ARGS__)
#define PCKEV_B4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
PCKEV_B2(RTYPE, in0, in1, in2, in3, out0, out1); \
PCKEV_B2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define PCKEV_B4_SB(...) PCKEV_B4(v16i8, __VA_ARGS__)
#define PCKEV_B4_UB(...) PCKEV_B4(v16u8, __VA_ARGS__)
#define PCKEV_B4_SH(...) PCKEV_B4(v8i16, __VA_ARGS__)
#define PCKEV_B4_SW(...) PCKEV_B4(v4i32, __VA_ARGS__)
/* Description : Pack even halfword elements of vector pairs
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Even halfword elements of in0 are copied to the left half of
out0 & even halfword elements of in1 are copied to the right
half of out0.
Even halfword elements of in2 are copied to the left half of
out1 & even halfword elements of in3 are copied to the right
half of out1.
*/
#define PCKEV_H2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_pckev_h((v8i16) in0, (v8i16) in1); \
out1 = (RTYPE) __msa_pckev_h((v8i16) in2, (v8i16) in3); \
}
#define PCKEV_H2_SH(...) PCKEV_H2(v8i16, __VA_ARGS__)
#define PCKEV_H2_SW(...) PCKEV_H2(v4i32, __VA_ARGS__)
#define PCKEV_H4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
PCKEV_H2(RTYPE, in0, in1, in2, in3, out0, out1); \
PCKEV_H2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define PCKEV_H4_SH(...) PCKEV_H4(v8i16, __VA_ARGS__)
#define PCKEV_H4_SW(...) PCKEV_H4(v4i32, __VA_ARGS__)
/* Description : Pack even double word elements of vector pairs
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Even double elements of in0 are copied to the left half of
out0 & even double elements of in1 are copied to the right
half of out0.
Even double elements of in2 are copied to the left half of
out1 & even double elements of in3 are copied to the right
half of out1.
*/
#define PCKEV_D2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_pckev_d((v2i64) in0, (v2i64) in1); \
out1 = (RTYPE) __msa_pckev_d((v2i64) in2, (v2i64) in3); \
}
#define PCKEV_D2_UB(...) PCKEV_D2(v16u8, __VA_ARGS__)
#define PCKEV_D2_SB(...) PCKEV_D2(v16i8, __VA_ARGS__)
#define PCKEV_D2_SH(...) PCKEV_D2(v8i16, __VA_ARGS__)
#define PCKEV_D4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
PCKEV_D2(RTYPE, in0, in1, in2, in3, out0, out1); \
PCKEV_D2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define PCKEV_D4_UB(...) PCKEV_D4(v16u8, __VA_ARGS__)
/* Description : Pack odd double word elements of vector pairs
Arguments : Inputs - in0, in1
Outputs - out0, out1
Return Type - as per RTYPE
Details : As operation is on same input 'in0' vector, index 1 double word
element is overwritten to index 0 and result is written to out0
As operation is on same input 'in1' vector, index 1 double word
element is overwritten to index 0 and result is written to out1
*/
#define PCKOD_D2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_pckod_d((v2i64) in0, (v2i64) in1); \
out1 = (RTYPE) __msa_pckod_d((v2i64) in2, (v2i64) in3); \
}
#define PCKOD_D2_UB(...) PCKOD_D2(v16u8, __VA_ARGS__)
#define PCKOD_D2_SH(...) PCKOD_D2(v8i16, __VA_ARGS__)
#define PCKOD_D2_SD(...) PCKOD_D2(v2i64, __VA_ARGS__)
/* Description : Each byte element is logically xor'ed with immediate 128
Arguments : Inputs - in0, in1
Outputs - in0, in1 (in-place)
Return Type - as per RTYPE
Details : Each unsigned byte element from input vector 'in0' is
logically xor'ed with 128 and result is in-place stored in
'in0' vector
Each unsigned byte element from input vector 'in1' is
logically xor'ed with 128 and result is in-place stored in
'in1' vector
Similar for other pairs
*/
#define XORI_B2_128(RTYPE, in0, in1) \
{ \
in0 = (RTYPE) __msa_xori_b((v16u8) in0, 128); \
in1 = (RTYPE) __msa_xori_b((v16u8) in1, 128); \
}
#define XORI_B2_128_UB(...) XORI_B2_128(v16u8, __VA_ARGS__)
#define XORI_B2_128_SB(...) XORI_B2_128(v16i8, __VA_ARGS__)
#define XORI_B2_128_SH(...) XORI_B2_128(v8i16, __VA_ARGS__)
#define XORI_B3_128(RTYPE, in0, in1, in2) \
{ \
XORI_B2_128(RTYPE, in0, in1); \
in2 = (RTYPE) __msa_xori_b((v16u8) in2, 128); \
}
#define XORI_B3_128_SB(...) XORI_B3_128(v16i8, __VA_ARGS__)
#define XORI_B4_128(RTYPE, in0, in1, in2, in3) \
{ \
XORI_B2_128(RTYPE, in0, in1); \
XORI_B2_128(RTYPE, in2, in3); \
}
#define XORI_B4_128_UB(...) XORI_B4_128(v16u8, __VA_ARGS__)
#define XORI_B4_128_SB(...) XORI_B4_128(v16i8, __VA_ARGS__)
#define XORI_B4_128_SH(...) XORI_B4_128(v8i16, __VA_ARGS__)
#define XORI_B5_128(RTYPE, in0, in1, in2, in3, in4) \
{ \
XORI_B3_128(RTYPE, in0, in1, in2); \
XORI_B2_128(RTYPE, in3, in4); \
}
#define XORI_B5_128_SB(...) XORI_B5_128(v16i8, __VA_ARGS__)
#define XORI_B6_128(RTYPE, in0, in1, in2, in3, in4, in5) \
{ \
XORI_B4_128(RTYPE, in0, in1, in2, in3); \
XORI_B2_128(RTYPE, in4, in5); \
}
#define XORI_B6_128_SB(...) XORI_B6_128(v16i8, __VA_ARGS__)
#define XORI_B7_128(RTYPE, in0, in1, in2, in3, in4, in5, in6) \
{ \
XORI_B4_128(RTYPE, in0, in1, in2, in3); \
XORI_B3_128(RTYPE, in4, in5, in6); \
}
#define XORI_B7_128_SB(...) XORI_B7_128(v16i8, __VA_ARGS__)
#define XORI_B8_128(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7) \
{ \
XORI_B4_128(RTYPE, in0, in1, in2, in3); \
XORI_B4_128(RTYPE, in4, in5, in6, in7); \
}
#define XORI_B8_128_SB(...) XORI_B8_128(v16i8, __VA_ARGS__)
#define XORI_B8_128_UB(...) XORI_B8_128(v16u8, __VA_ARGS__)
/* Description : Addition of signed halfword elements and signed saturation
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Return Type - as per RTYPE
Details : Signed halfword elements from 'in0' are added to signed
halfword elements of 'in1'. The result is then signed saturated
between -32768 to +32767 (as per halfword data type)
Similar for other pairs
*/
#define ADDS_SH2(RTYPE, in0, in1, in2, in3, out0, out1) \
{ \
out0 = (RTYPE) __msa_adds_s_h((v8i16) in0, (v8i16) in1); \
out1 = (RTYPE) __msa_adds_s_h((v8i16) in2, (v8i16) in3); \
}
#define ADDS_SH2_SH(...) ADDS_SH2(v8i16, __VA_ARGS__)
#define ADDS_SH4(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
ADDS_SH2(RTYPE, in0, in1, in2, in3, out0, out1); \
ADDS_SH2(RTYPE, in4, in5, in6, in7, out2, out3); \
}
#define ADDS_SH4_UH(...) ADDS_SH4(v8u16, __VA_ARGS__)
#define ADDS_SH4_SH(...) ADDS_SH4(v8i16, __VA_ARGS__)
/* Description : Shift left all elements of vector (generic for all data types)
Arguments : Inputs - in0, in1, in2, in3, shift
Outputs - in0, in1, in2, in3 (in place)
Return Type - as per input vector RTYPE
Details : Each element of vector 'in0' is left shifted by 'shift' and
result is in place written to 'in0'
Similar for other pairs
*/
#define SLLI_2V(in0, in1, shift) \
{ \
in0 = in0 << shift; \
in1 = in1 << shift; \
}
#define SLLI_4V(in0, in1, in2, in3, shift) \
{ \
in0 = in0 << shift; \
in1 = in1 << shift; \
in2 = in2 << shift; \
in3 = in3 << shift; \
}
/* Description : Arithmetic shift right all elements of vector
(generic for all data types)
Arguments : Inputs - in0, in1, in2, in3, shift
Outputs - in0, in1, in2, in3 (in place)
Return Type - as per input vector RTYPE
Details : Each element of vector 'in0' is right shifted by 'shift' and
result is in place written to 'in0'
Here, 'shift' is GP variable passed in
Similar for other pairs
*/
#define SRA_4V(in0, in1, in2, in3, shift) \
{ \
in0 = in0 >> shift; \
in1 = in1 >> shift; \
in2 = in2 >> shift; \
in3 = in3 >> shift; \
}
/* Description : Shift right logical all halfword elements of vector
Arguments : Inputs - in0, in1, in2, in3, shift
Outputs - in0, in1, in2, in3 (in place)
Return Type - as per RTYPE
Details : Each element of vector 'in0' is shifted right logical by
number of bits respective element holds in vector 'shift' and
result is in place written to 'in0'
Here, 'shift' is a vector passed in
Similar for other pairs
*/
#define SRL_H4(RTYPE, in0, in1, in2, in3, shift) \
{ \
in0 = (RTYPE) __msa_srl_h((v8i16) in0, (v8i16) shift); \
in1 = (RTYPE) __msa_srl_h((v8i16) in1, (v8i16) shift); \
in2 = (RTYPE) __msa_srl_h((v8i16) in2, (v8i16) shift); \
in3 = (RTYPE) __msa_srl_h((v8i16) in3, (v8i16) shift); \
}
#define SRL_H4_UH(...) SRL_H4(v8u16, __VA_ARGS__)
#define SRLR_H4(RTYPE, in0, in1, in2, in3, shift) \
{ \
in0 = (RTYPE) __msa_srlr_h((v8i16) in0, (v8i16) shift); \
in1 = (RTYPE) __msa_srlr_h((v8i16) in1, (v8i16) shift); \
in2 = (RTYPE) __msa_srlr_h((v8i16) in2, (v8i16) shift); \
in3 = (RTYPE) __msa_srlr_h((v8i16) in3, (v8i16) shift); \
}
#define SRLR_H4_UH(...) SRLR_H4(v8u16, __VA_ARGS__)
#define SRLR_H4_SH(...) SRLR_H4(v8i16, __VA_ARGS__)
#define SRLR_H8(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, shift) \
{ \
SRLR_H4(RTYPE, in0, in1, in2, in3, shift); \
SRLR_H4(RTYPE, in4, in5, in6, in7, shift); \
}
#define SRLR_H8_UH(...) SRLR_H8(v8u16, __VA_ARGS__)
#define SRLR_H8_SH(...) SRLR_H8(v8i16, __VA_ARGS__)
/* Description : Shift right arithmetic rounded halfwords
Arguments : Inputs - in0, in1, shift
Outputs - in0, in1, (in place)
Return Type - as per RTYPE
Details : Each element of vector 'in0' is shifted right arithmetic by
number of bits respective element holds in vector 'shift'.
The last discarded bit is added to shifted value for rounding
and the result is in place written to 'in0'
Here, 'shift' is a vector passed in
Similar for other pairs
*/
#define SRAR_H2(RTYPE, in0, in1, shift) \
{ \
in0 = (RTYPE) __msa_srar_h((v8i16) in0, (v8i16) shift); \
in1 = (RTYPE) __msa_srar_h((v8i16) in1, (v8i16) shift); \
}
#define SRAR_H2_UH(...) SRAR_H2(v8u16, __VA_ARGS__)
#define SRAR_H2_SH(...) SRAR_H2(v8i16, __VA_ARGS__)
#define SRAR_H3(RTYPE, in0, in1, in2, shift) \
{ \
SRAR_H2(RTYPE, in0, in1, shift) \
in2 = (RTYPE) __msa_srar_h((v8i16) in2, (v8i16) shift); \
}
#define SRAR_H3_SH(...) SRAR_H3(v8i16, __VA_ARGS__)
#define SRAR_H4(RTYPE, in0, in1, in2, in3, shift) \
{ \
SRAR_H2(RTYPE, in0, in1, shift) \
SRAR_H2(RTYPE, in2, in3, shift) \
}
#define SRAR_H4_UH(...) SRAR_H4(v8u16, __VA_ARGS__)
#define SRAR_H4_SH(...) SRAR_H4(v8i16, __VA_ARGS__)
/* Description : Shift right arithmetic rounded words
Arguments : Inputs - in0, in1, shift
Outputs - in0, in1, (in place)
Return Type - as per RTYPE
Details : Each element of vector 'in0' is shifted right arithmetic by
number of bits respective element holds in vector 'shift'.
The last discarded bit is added to shifted value for rounding
and the result is in place written to 'in0'
Here, 'shift' is a vector passed in
Similar for other pairs
*/
#define SRAR_W2(RTYPE, in0, in1, shift) \
{ \
in0 = (RTYPE) __msa_srar_w((v4i32) in0, (v4i32) shift); \
in1 = (RTYPE) __msa_srar_w((v4i32) in1, (v4i32) shift); \
}
#define SRAR_W2_SW(...) SRAR_W2(v4i32, __VA_ARGS__)
#define SRAR_W4(RTYPE, in0, in1, in2, in3, shift) \
{ \
SRAR_W2(RTYPE, in0, in1, shift) \
SRAR_W2(RTYPE, in2, in3, shift) \
}
#define SRAR_W4_SW(...) SRAR_W4(v4i32, __VA_ARGS__)
/* Description : Shift right arithmetic rounded (immediate)
Arguments : Inputs - in0, in1, in2, in3, shift
Outputs - in0, in1, in2, in3 (in place)
Return Type - as per RTYPE
Details : Each element of vector 'in0' is shifted right arithmetic by
value in 'shift'.
The last discarded bit is added to shifted value for rounding
and the result is in place written to 'in0'
Similar for other pairs
*/
#define SRARI_H2(RTYPE, in0, in1, shift) \
{ \
in0 = (RTYPE) __msa_srari_h((v8i16) in0, shift); \
in1 = (RTYPE) __msa_srari_h((v8i16) in1, shift); \
}
#define SRARI_H2_UH(...) SRARI_H2(v8u16, __VA_ARGS__)
#define SRARI_H2_SH(...) SRARI_H2(v8i16, __VA_ARGS__)
#define SRARI_H4(RTYPE, in0, in1, in2, in3, shift) \
{ \
SRARI_H2(RTYPE, in0, in1, shift); \
SRARI_H2(RTYPE, in2, in3, shift); \
}
#define SRARI_H4_UH(...) SRARI_H4(v8u16, __VA_ARGS__)
#define SRARI_H4_SH(...) SRARI_H4(v8i16, __VA_ARGS__)
/* Description : Shift right arithmetic rounded (immediate)
Arguments : Inputs - in0, in1, shift
Outputs - in0, in1 (in place)
Return Type - as per RTYPE
Details : Each element of vector 'in0' is shifted right arithmetic by
value in 'shift'.
The last discarded bit is added to shifted value for rounding
and the result is in place written to 'in0'
Similar for other pairs
*/
#define SRARI_W2(RTYPE, in0, in1, shift) \
{ \
in0 = (RTYPE) __msa_srari_w((v4i32) in0, shift); \
in1 = (RTYPE) __msa_srari_w((v4i32) in1, shift); \
}
#define SRARI_W2_SW(...) SRARI_W2(v4i32, __VA_ARGS__)
#define SRARI_W4(RTYPE, in0, in1, in2, in3, shift) \
{ \
SRARI_W2(RTYPE, in0, in1, shift); \
SRARI_W2(RTYPE, in2, in3, shift); \
}
#define SRARI_W4_SH(...) SRARI_W4(v8i16, __VA_ARGS__)
#define SRARI_W4_SW(...) SRARI_W4(v4i32, __VA_ARGS__)
/* Description : Multiplication of pairs of vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Details : Each element from 'in0' is multiplied with elements from 'in1'
and result is written to 'out0'
Similar for other pairs
*/
#define MUL2(in0, in1, in2, in3, out0, out1) \
{ \
out0 = in0 * in1; \
out1 = in2 * in3; \
}
#define MUL4(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3) \
{ \
MUL2(in0, in1, in2, in3, out0, out1); \
MUL2(in4, in5, in6, in7, out2, out3); \
}
/* Description : Addition of 2 pairs of vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Details : Each element from 2 pairs vectors is added and 2 results are
produced
*/
#define ADD2(in0, in1, in2, in3, out0, out1) \
{ \
out0 = in0 + in1; \
out1 = in2 + in3; \
}
#define ADD4(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3) \
{ \
ADD2(in0, in1, in2, in3, out0, out1); \
ADD2(in4, in5, in6, in7, out2, out3); \
}
/* Description : Subtraction of 2 pairs of vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1
Details : Each element from 2 pairs vectors is subtracted and 2 results
are produced
*/
#define SUB2(in0, in1, in2, in3, out0, out1) \
{ \
out0 = in0 - in1; \
out1 = in2 - in3; \
}
#define SUB4(in0, in1, in2, in3, in4, in5, in6, in7, out0, out1, out2, out3) \
{ \
out0 = in0 - in1; \
out1 = in2 - in3; \
out2 = in4 - in5; \
out3 = in6 - in7; \
}
/* Description : Sign extend byte elements from right half of the vector
Arguments : Input - in (byte vector)
Output - out (sign extended halfword vector)
Return Type - signed halfword
Details : Sign bit of byte elements from input vector 'in' is
extracted and interleaved with same vector 'in' to generate
8 halfword elements keeping sign intact
*/
#define UNPCK_R_SB_SH(in, out) \
{ \
v16i8 sign_m; \
\
sign_m = __msa_clti_s_b((v16i8) in, 0); \
out = (v8i16) __msa_ilvr_b(sign_m, (v16i8) in); \
}
/* Description : Sign extend halfword elements from right half of the vector
Arguments : Inputs - in (input halfword vector)
Outputs - out (sign extended word vectors)
Return Type - signed word
Details : Sign bit of halfword elements from input vector 'in' is
extracted and interleaved with same vector 'in0' to generate
4 word elements keeping sign intact
*/
#define UNPCK_R_SH_SW(in, out) \
{ \
v8i16 sign_m; \
\
sign_m = __msa_clti_s_h((v8i16) in, 0); \
out = (v4i32) __msa_ilvr_h(sign_m, (v8i16) in); \
}
/* Description : Sign extend byte elements from input vector and return
halfword results in pair of vectors
Arguments : Inputs - in (1 input byte vector)
Outputs - out0, out1 (sign extended 2 halfword vectors)
Return Type - signed halfword
Details : Sign bit of byte elements from input vector 'in' is
extracted and interleaved right with same vector 'in0' to
generate 8 signed halfword elements in 'out0'
Then interleaved left with same vector 'in0' to
generate 8 signed halfword elements in 'out1'
*/
#define UNPCK_SB_SH(in, out0, out1) \
{ \
v16i8 tmp_m; \
\
tmp_m = __msa_clti_s_b((v16i8) in, 0); \
ILVRL_B2_SH(tmp_m, in, out0, out1); \
}
/* Description : Zero extend unsigned byte elements to halfword elements
Arguments : Inputs - in (1 input unsigned byte vector)
Outputs - out0, out1 (unsigned 2 halfword vectors)
Return Type - signed halfword
Details : Zero extended right half of vector is returned in 'out0'
Zero extended left half of vector is returned in 'out1'
*/
#define UNPCK_UB_SH(in, out0, out1) \
{ \
v16i8 zero_m = { 0 }; \
\
ILVRL_B2_SH(zero_m, in, out0, out1); \
}
/* Description : Sign extend halfword elements from input vector and return
result in pair of vectors
Arguments : Inputs - in (1 input halfword vector)
Outputs - out0, out1 (sign extended 2 word vectors)
Return Type - signed word
Details : Sign bit of halfword elements from input vector 'in' is
extracted and interleaved right with same vector 'in0' to
generate 4 signed word elements in 'out0'
Then interleaved left with same vector 'in0' to
generate 4 signed word elements in 'out1'
*/
#define UNPCK_SH_SW(in, out0, out1) \
{ \
v8i16 tmp_m; \
\
tmp_m = __msa_clti_s_h((v8i16) in, 0); \
ILVRL_H2_SW(tmp_m, in, out0, out1); \
}
/* Description : Swap two variables
Arguments : Inputs - in0, in1
Outputs - in0, in1 (in-place)
Details : Swapping of two input variables using xor
*/
#define SWAP(in0, in1) \
{ \
in0 = in0 ^ in1; \
in1 = in0 ^ in1; \
in0 = in0 ^ in1; \
}
/* Description : Butterfly of 4 input vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1, out2, out3
Details : Butterfly operation
*/
#define BUTTERFLY_4(in0, in1, in2, in3, out0, out1, out2, out3) \
{ \
out0 = in0 + in3; \
out1 = in1 + in2; \
\
out2 = in1 - in2; \
out3 = in0 - in3; \
}
/* Description : Butterfly of 8 input vectors
Arguments : Inputs - in0 ... in7
Outputs - out0 .. out7
Details : Butterfly operation
*/
#define BUTTERFLY_8(in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3, out4, out5, out6, out7) \
{ \
out0 = in0 + in7; \
out1 = in1 + in6; \
out2 = in2 + in5; \
out3 = in3 + in4; \
\
out4 = in3 - in4; \
out5 = in2 - in5; \
out6 = in1 - in6; \
out7 = in0 - in7; \
}
/* Description : Butterfly of 16 input vectors
Arguments : Inputs - in0 ... in15
Outputs - out0 .. out15
Details : Butterfly operation
*/
#define BUTTERFLY_16(in0, in1, in2, in3, in4, in5, in6, in7, \
in8, in9, in10, in11, in12, in13, in14, in15, \
out0, out1, out2, out3, out4, out5, out6, out7, \
out8, out9, out10, out11, out12, out13, out14, out15) \
{ \
out0 = in0 + in15; \
out1 = in1 + in14; \
out2 = in2 + in13; \
out3 = in3 + in12; \
out4 = in4 + in11; \
out5 = in5 + in10; \
out6 = in6 + in9; \
out7 = in7 + in8; \
\
out8 = in7 - in8; \
out9 = in6 - in9; \
out10 = in5 - in10; \
out11 = in4 - in11; \
out12 = in3 - in12; \
out13 = in2 - in13; \
out14 = in1 - in14; \
out15 = in0 - in15; \
}
/* Description : Transposes input 4x4 byte block
Arguments : Inputs - in0, in1, in2, in3 (input 4x4 byte block)
Outputs - out0, out1, out2, out3 (output 4x4 byte block)
Return Type - unsigned byte
Details :
*/
#define TRANSPOSE4x4_UB_UB(in0, in1, in2, in3, out0, out1, out2, out3) \
{ \
v16i8 zero_m = { 0 }; \
v16i8 s0_m, s1_m, s2_m, s3_m; \
\
ILVR_D2_SB(in1, in0, in3, in2, s0_m, s1_m); \
ILVRL_B2_SB(s1_m, s0_m, s2_m, s3_m); \
\
out0 = (v16u8) __msa_ilvr_b(s3_m, s2_m); \
out1 = (v16u8) __msa_sldi_b(zero_m, (v16i8) out0, 4); \
out2 = (v16u8) __msa_sldi_b(zero_m, (v16i8) out1, 4); \
out3 = (v16u8) __msa_sldi_b(zero_m, (v16i8) out2, 4); \
}
/* Description : Transposes input 8x4 byte block into 4x8
Arguments : Inputs - in0, in1, in2, in3 (input 8x4 byte block)
Outputs - out0, out1, out2, out3 (output 4x8 byte block)
Return Type - as per RTYPE
Details :
*/
#define TRANSPOSE8x4_UB(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3) \
{ \
v16i8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
\
ILVEV_W2_SB(in0, in4, in1, in5, tmp0_m, tmp1_m); \
tmp2_m = __msa_ilvr_b(tmp1_m, tmp0_m); \
ILVEV_W2_SB(in2, in6, in3, in7, tmp0_m, tmp1_m); \
\
tmp3_m = __msa_ilvr_b(tmp1_m, tmp0_m); \
ILVRL_H2_SB(tmp3_m, tmp2_m, tmp0_m, tmp1_m); \
\
ILVRL_W2(RTYPE, tmp1_m, tmp0_m, out0, out2); \
out1 = (RTYPE) __msa_ilvl_d((v2i64) out2, (v2i64) out0); \
out3 = (RTYPE) __msa_ilvl_d((v2i64) out0, (v2i64) out2); \
}
#define TRANSPOSE8x4_UB_UB(...) TRANSPOSE8x4_UB(v16u8, __VA_ARGS__)
#define TRANSPOSE8x4_UB_UH(...) TRANSPOSE8x4_UB(v8u16, __VA_ARGS__)
/* Description : Transposes input 8x8 byte block
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7
(input 8x8 byte block)
Outputs - out0, out1, out2, out3, out4, out5, out6, out7
(output 8x8 byte block)
Return Type - as per RTYPE
Details :
*/
#define TRANSPOSE8x8_UB(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3, out4, out5, out6, out7) \
{ \
v16i8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
v16i8 tmp4_m, tmp5_m, tmp6_m, tmp7_m; \
v16i8 zeros = { 0 }; \
\
ILVR_B4_SB(in2, in0, in3, in1, in6, in4, in7, in5, \
tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
ILVRL_B2_SB(tmp1_m, tmp0_m, tmp4_m, tmp5_m); \
ILVRL_B2_SB(tmp3_m, tmp2_m, tmp6_m, tmp7_m); \
ILVRL_W2(RTYPE, tmp6_m, tmp4_m, out0, out2); \
ILVRL_W2(RTYPE, tmp7_m, tmp5_m, out4, out6); \
SLDI_B4(RTYPE, zeros, out0, zeros, out2, zeros, out4, zeros, out6, \
8, out1, out3, out5, out7); \
}
#define TRANSPOSE8x8_UB_UB(...) TRANSPOSE8x8_UB(v16u8, __VA_ARGS__)
#define TRANSPOSE8x8_UB_UH(...) TRANSPOSE8x8_UB(v8u16, __VA_ARGS__)
/* Description : Transposes 16x4 block into 4x16 with byte elements in vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7,
in8, in9, in10, in11, in12, in13, in14, in15
Outputs - out0, out1, out2, out3
Return Type - unsigned byte
Details :
*/
#define TRANSPOSE16x4_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
in8, in9, in10, in11, in12, in13, in14, in15, \
out0, out1, out2, out3) \
{ \
v2i64 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
\
ILVEV_W2_SD(in0, in4, in8, in12, tmp0_m, tmp1_m); \
out1 = (v16u8) __msa_ilvev_d(tmp1_m, tmp0_m); \
\
ILVEV_W2_SD(in1, in5, in9, in13, tmp0_m, tmp1_m); \
out3 = (v16u8) __msa_ilvev_d(tmp1_m, tmp0_m); \
\
ILVEV_W2_SD(in2, in6, in10, in14, tmp0_m, tmp1_m); \
\
tmp2_m = __msa_ilvev_d(tmp1_m, tmp0_m); \
ILVEV_W2_SD(in3, in7, in11, in15, tmp0_m, tmp1_m); \
\
tmp3_m = __msa_ilvev_d(tmp1_m, tmp0_m); \
ILVEV_B2_SD(out1, out3, tmp2_m, tmp3_m, tmp0_m, tmp1_m); \
out0 = (v16u8) __msa_ilvev_h((v8i16) tmp1_m, (v8i16) tmp0_m); \
out2 = (v16u8) __msa_ilvod_h((v8i16) tmp1_m, (v8i16) tmp0_m); \
\
tmp0_m = (v2i64) __msa_ilvod_b((v16i8) out3, (v16i8) out1); \
tmp1_m = (v2i64) __msa_ilvod_b((v16i8) tmp3_m, (v16i8) tmp2_m); \
out1 = (v16u8) __msa_ilvev_h((v8i16) tmp1_m, (v8i16) tmp0_m); \
out3 = (v16u8) __msa_ilvod_h((v8i16) tmp1_m, (v8i16) tmp0_m); \
}
/* Description : Transposes 16x8 block into 8x16 with byte elements in vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7,
in8, in9, in10, in11, in12, in13, in14, in15
Outputs - out0, out1, out2, out3, out4, out5, out6, out7
Return Type - unsigned byte
Details :
*/
#define TRANSPOSE16x8_UB_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
in8, in9, in10, in11, in12, in13, in14, in15, \
out0, out1, out2, out3, out4, out5, out6, out7) \
{ \
v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
v16u8 tmp4_m, tmp5_m, tmp6_m, tmp7_m; \
\
ILVEV_D2_UB(in0, in8, in1, in9, out7, out6); \
ILVEV_D2_UB(in2, in10, in3, in11, out5, out4); \
ILVEV_D2_UB(in4, in12, in5, in13, out3, out2); \
ILVEV_D2_UB(in6, in14, in7, in15, out1, out0); \
\
tmp0_m = (v16u8) __msa_ilvev_b((v16i8) out6, (v16i8) out7); \
tmp4_m = (v16u8) __msa_ilvod_b((v16i8) out6, (v16i8) out7); \
tmp1_m = (v16u8) __msa_ilvev_b((v16i8) out4, (v16i8) out5); \
tmp5_m = (v16u8) __msa_ilvod_b((v16i8) out4, (v16i8) out5); \
out5 = (v16u8) __msa_ilvev_b((v16i8) out2, (v16i8) out3); \
tmp6_m = (v16u8) __msa_ilvod_b((v16i8) out2, (v16i8) out3); \
out7 = (v16u8) __msa_ilvev_b((v16i8) out0, (v16i8) out1); \
tmp7_m = (v16u8) __msa_ilvod_b((v16i8) out0, (v16i8) out1); \
\
ILVEV_H2_UB(tmp0_m, tmp1_m, out5, out7, tmp2_m, tmp3_m); \
out0 = (v16u8) __msa_ilvev_w((v4i32) tmp3_m, (v4i32) tmp2_m); \
out4 = (v16u8) __msa_ilvod_w((v4i32) tmp3_m, (v4i32) tmp2_m); \
\
tmp2_m = (v16u8) __msa_ilvod_h((v8i16) tmp1_m, (v8i16) tmp0_m); \
tmp3_m = (v16u8) __msa_ilvod_h((v8i16) out7, (v8i16) out5); \
out2 = (v16u8) __msa_ilvev_w((v4i32) tmp3_m, (v4i32) tmp2_m); \
out6 = (v16u8) __msa_ilvod_w((v4i32) tmp3_m, (v4i32) tmp2_m); \
\
ILVEV_H2_UB(tmp4_m, tmp5_m, tmp6_m, tmp7_m, tmp2_m, tmp3_m); \
out1 = (v16u8) __msa_ilvev_w((v4i32) tmp3_m, (v4i32) tmp2_m); \
out5 = (v16u8) __msa_ilvod_w((v4i32) tmp3_m, (v4i32) tmp2_m); \
\
tmp2_m = (v16u8) __msa_ilvod_h((v8i16) tmp5_m, (v8i16) tmp4_m); \
tmp3_m = (v16u8) __msa_ilvod_h((v8i16) tmp7_m, (v8i16) tmp6_m); \
out3 = (v16u8) __msa_ilvev_w((v4i32) tmp3_m, (v4i32) tmp2_m); \
out7 = (v16u8) __msa_ilvod_w((v4i32) tmp3_m, (v4i32) tmp2_m); \
}
/* Description : Transposes 4x4 block with half word elements in vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1, out2, out3
Return Type - signed halfword
Details :
*/
#define TRANSPOSE4x4_SH_SH(in0, in1, in2, in3, out0, out1, out2, out3) \
{ \
v8i16 s0_m, s1_m; \
\
ILVR_H2_SH(in1, in0, in3, in2, s0_m, s1_m); \
ILVRL_W2_SH(s1_m, s0_m, out0, out2); \
out1 = (v8i16) __msa_ilvl_d((v2i64) out0, (v2i64) out0); \
out3 = (v8i16) __msa_ilvl_d((v2i64) out0, (v2i64) out2); \
}
/* Description : Transposes 8x8 block with half word elements in vectors
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7
Outputs - out0, out1, out2, out3, out4, out5, out6, out7
Return Type - as per RTYPE
Details :
*/
#define TRANSPOSE8x8_H(RTYPE, in0, in1, in2, in3, in4, in5, in6, in7, \
out0, out1, out2, out3, out4, out5, out6, out7) \
{ \
v8i16 s0_m, s1_m; \
v8i16 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
v8i16 tmp4_m, tmp5_m, tmp6_m, tmp7_m; \
\
ILVR_H2_SH(in6, in4, in7, in5, s0_m, s1_m); \
ILVRL_H2_SH(s1_m, s0_m, tmp0_m, tmp1_m); \
ILVL_H2_SH(in6, in4, in7, in5, s0_m, s1_m); \
ILVRL_H2_SH(s1_m, s0_m, tmp2_m, tmp3_m); \
ILVR_H2_SH(in2, in0, in3, in1, s0_m, s1_m); \
ILVRL_H2_SH(s1_m, s0_m, tmp4_m, tmp5_m); \
ILVL_H2_SH(in2, in0, in3, in1, s0_m, s1_m); \
ILVRL_H2_SH(s1_m, s0_m, tmp6_m, tmp7_m); \
PCKEV_D4(RTYPE, tmp0_m, tmp4_m, tmp1_m, tmp5_m, tmp2_m, tmp6_m, \
tmp3_m, tmp7_m, out0, out2, out4, out6); \
out1 = (RTYPE) __msa_pckod_d((v2i64) tmp0_m, (v2i64) tmp4_m); \
out3 = (RTYPE) __msa_pckod_d((v2i64) tmp1_m, (v2i64) tmp5_m); \
out5 = (RTYPE) __msa_pckod_d((v2i64) tmp2_m, (v2i64) tmp6_m); \
out7 = (RTYPE) __msa_pckod_d((v2i64) tmp3_m, (v2i64) tmp7_m); \
}
#define TRANSPOSE8x8_UH_UH(...) TRANSPOSE8x8_H(v8u16, __VA_ARGS__)
#define TRANSPOSE8x8_SH_SH(...) TRANSPOSE8x8_H(v8i16, __VA_ARGS__)
/* Description : Transposes 4x4 block with word elements in vectors
Arguments : Inputs - in0, in1, in2, in3
Outputs - out0, out1, out2, out3
Return Type - signed word
Details :
*/
#define TRANSPOSE4x4_SW_SW(in0, in1, in2, in3, out0, out1, out2, out3) \
{ \
v4i32 s0_m, s1_m, s2_m, s3_m; \
\
ILVRL_W2_SW(in1, in0, s0_m, s1_m); \
ILVRL_W2_SW(in3, in2, s2_m, s3_m); \
\
out0 = (v4i32) __msa_ilvr_d((v2i64) s2_m, (v2i64) s0_m); \
out1 = (v4i32) __msa_ilvl_d((v2i64) s2_m, (v2i64) s0_m); \
out2 = (v4i32) __msa_ilvr_d((v2i64) s3_m, (v2i64) s1_m); \
out3 = (v4i32) __msa_ilvl_d((v2i64) s3_m, (v2i64) s1_m); \
}
/* Description : Average byte elements from pair of vectors and store 8x4 byte
block in destination memory
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
Details : Each byte element from input vector pair 'in0' and 'in1' are
averaged (a + b)/2 and stored in 'tmp0_m'
Each byte element from input vector pair 'in2' and 'in3' are
averaged (a + b)/2 and stored in 'tmp1_m'
Each byte element from input vector pair 'in4' and 'in5' are
averaged (a + b)/2 and stored in 'tmp2_m'
Each byte element from input vector pair 'in6' and 'in7' are
averaged (a + b)/2 and stored in 'tmp3_m'
The half vector results from all 4 vectors are stored in
destination memory as 8x4 byte block
*/
#define AVE_ST8x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
{ \
uint64_t out0_m, out1_m, out2_m, out3_m; \
v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
\
tmp0_m = __msa_ave_u_b((v16u8) in0, (v16u8) in1); \
tmp1_m = __msa_ave_u_b((v16u8) in2, (v16u8) in3); \
tmp2_m = __msa_ave_u_b((v16u8) in4, (v16u8) in5); \
tmp3_m = __msa_ave_u_b((v16u8) in6, (v16u8) in7); \
\
out0_m = __msa_copy_u_d((v2i64) tmp0_m, 0); \
out1_m = __msa_copy_u_d((v2i64) tmp1_m, 0); \
out2_m = __msa_copy_u_d((v2i64) tmp2_m, 0); \
out3_m = __msa_copy_u_d((v2i64) tmp3_m, 0); \
SD4(out0_m, out1_m, out2_m, out3_m, pdst, stride); \
}
/* Description : Average byte elements from pair of vectors and store 16x4 byte
block in destination memory
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
Details : Each byte element from input vector pair 'in0' and 'in1' are
averaged (a + b)/2 and stored in 'tmp0_m'
Each byte element from input vector pair 'in2' and 'in3' are
averaged (a + b)/2 and stored in 'tmp1_m'
Each byte element from input vector pair 'in4' and 'in5' are
averaged (a + b)/2 and stored in 'tmp2_m'
Each byte element from input vector pair 'in6' and 'in7' are
averaged (a + b)/2 and stored in 'tmp3_m'
The results from all 4 vectors are stored in destination
memory as 16x4 byte block
*/
#define AVE_ST16x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
{ \
v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
\
tmp0_m = __msa_ave_u_b((v16u8) in0, (v16u8) in1); \
tmp1_m = __msa_ave_u_b((v16u8) in2, (v16u8) in3); \
tmp2_m = __msa_ave_u_b((v16u8) in4, (v16u8) in5); \
tmp3_m = __msa_ave_u_b((v16u8) in6, (v16u8) in7); \
\
ST_UB4(tmp0_m, tmp1_m, tmp2_m, tmp3_m, pdst, stride); \
}
/* Description : Average rounded byte elements from pair of vectors and store
8x4 byte block in destination memory
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
Details : Each byte element from input vector pair 'in0' and 'in1' are
average rounded (a + b + 1)/2 and stored in 'tmp0_m'
Each byte element from input vector pair 'in2' and 'in3' are
average rounded (a + b + 1)/2 and stored in 'tmp1_m'
Each byte element from input vector pair 'in4' and 'in5' are
average rounded (a + b + 1)/2 and stored in 'tmp2_m'
Each byte element from input vector pair 'in6' and 'in7' are
average rounded (a + b + 1)/2 and stored in 'tmp3_m'
The half vector results from all 4 vectors are stored in
destination memory as 8x4 byte block
*/
#define AVER_ST8x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
{ \
uint64_t out0_m, out1_m, out2_m, out3_m; \
v16u8 tp0_m, tp1_m, tp2_m, tp3_m; \
\
AVER_UB4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
tp0_m, tp1_m, tp2_m, tp3_m); \
\
out0_m = __msa_copy_u_d((v2i64) tp0_m, 0); \
out1_m = __msa_copy_u_d((v2i64) tp1_m, 0); \
out2_m = __msa_copy_u_d((v2i64) tp2_m, 0); \
out3_m = __msa_copy_u_d((v2i64) tp3_m, 0); \
SD4(out0_m, out1_m, out2_m, out3_m, pdst, stride); \
}
/* Description : Average rounded byte elements from pair of vectors and store
16x4 byte block in destination memory
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
Details : Each byte element from input vector pair 'in0' and 'in1' are
average rounded (a + b + 1)/2 and stored in 'tmp0_m'
Each byte element from input vector pair 'in2' and 'in3' are
average rounded (a + b + 1)/2 and stored in 'tmp1_m'
Each byte element from input vector pair 'in4' and 'in5' are
average rounded (a + b + 1)/2 and stored in 'tmp2_m'
Each byte element from input vector pair 'in6' and 'in7' are
average rounded (a + b + 1)/2 and stored in 'tmp3_m'
The vector results from all 4 vectors are stored in
destination memory as 16x4 byte block
*/
#define AVER_ST16x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride) \
{ \
v16u8 t0_m, t1_m, t2_m, t3_m; \
\
AVER_UB4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
t0_m, t1_m, t2_m, t3_m); \
ST_UB4(t0_m, t1_m, t2_m, t3_m, pdst, stride); \
}
/* Description : Average rounded byte elements from pair of vectors,
average rounded with destination and store 8x4 byte block
in destination memory
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
Details : Each byte element from input vector pair 'in0' and 'in1' are
average rounded (a + b + 1)/2 and stored in 'tmp0_m'
Each byte element from input vector pair 'in2' and 'in3' are
average rounded (a + b + 1)/2 and stored in 'tmp1_m'
Each byte element from input vector pair 'in4' and 'in5' are
average rounded (a + b + 1)/2 and stored in 'tmp2_m'
Each byte element from input vector pair 'in6' and 'in7' are
average rounded (a + b + 1)/2 and stored in 'tmp3_m'
The half vector results from all 4 vectors are stored in
destination memory as 8x4 byte block
*/
#define AVER_DST_ST8x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
pdst, stride) \
{ \
v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
v16u8 dst0_m, dst1_m, dst2_m, dst3_m; \
\
LD_UB4(pdst, stride, dst0_m, dst1_m, dst2_m, dst3_m); \
AVER_UB4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
AVER_ST8x4_UB(dst0_m, tmp0_m, dst1_m, tmp1_m, \
dst2_m, tmp2_m, dst3_m, tmp3_m, pdst, stride); \
}
/* Description : Average rounded byte elements from pair of vectors,
average rounded with destination and store 16x4 byte block
in destination memory
Arguments : Inputs - in0, in1, in2, in3, in4, in5, in6, in7, pdst, stride
Details : Each byte element from input vector pair 'in0' and 'in1' are
average rounded (a + b + 1)/2 and stored in 'tmp0_m'
Each byte element from input vector pair 'in2' and 'in3' are
average rounded (a + b + 1)/2 and stored in 'tmp1_m'
Each byte element from input vector pair 'in4' and 'in5' are
average rounded (a + b + 1)/2 and stored in 'tmp2_m'
Each byte element from input vector pair 'in6' and 'in7' are
average rounded (a + b + 1)/2 and stored in 'tmp3_m'
The vector results from all 4 vectors are stored in
destination memory as 16x4 byte block
*/
#define AVER_DST_ST16x4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
pdst, stride) \
{ \
v16u8 tmp0_m, tmp1_m, tmp2_m, tmp3_m; \
v16u8 dst0_m, dst1_m, dst2_m, dst3_m; \
\
LD_UB4(pdst, stride, dst0_m, dst1_m, dst2_m, dst3_m); \
AVER_UB4_UB(in0, in1, in2, in3, in4, in5, in6, in7, \
tmp0_m, tmp1_m, tmp2_m, tmp3_m); \
AVER_ST16x4_UB(dst0_m, tmp0_m, dst1_m, tmp1_m, \
dst2_m, tmp2_m, dst3_m, tmp3_m, pdst, stride); \
}
/* Description : Add block 4x4
Arguments : Inputs - in0, in1, in2, in3, pdst, stride
Details : Least significant 4 bytes from each input vector are added to
the destination bytes, clipped between 0-255 and then stored.
*/
#define ADDBLK_ST4x4_UB(in0, in1, in2, in3, pdst, stride) \
{ \
uint32_t src0_m, src1_m, src2_m, src3_m; \
uint32_t out0_m, out1_m, out2_m, out3_m; \
v8i16 inp0_m, inp1_m, res0_m, res1_m; \
v16i8 dst0_m = { 0 }; \
v16i8 dst1_m = { 0 }; \
v16i8 zero_m = { 0 }; \
\
ILVR_D2_SH(in1, in0, in3, in2, inp0_m, inp1_m) \
LW4(pdst, stride, src0_m, src1_m, src2_m, src3_m); \
INSERT_W2_SB(src0_m, src1_m, dst0_m); \
INSERT_W2_SB(src2_m, src3_m, dst1_m); \
ILVR_B2_SH(zero_m, dst0_m, zero_m, dst1_m, res0_m, res1_m); \
ADD2(res0_m, inp0_m, res1_m, inp1_m, res0_m, res1_m); \
CLIP_SH2_0_255(res0_m, res1_m); \
PCKEV_B2_SB(res0_m, res0_m, res1_m, res1_m, dst0_m, dst1_m); \
\
out0_m = __msa_copy_u_w((v4i32) dst0_m, 0); \
out1_m = __msa_copy_u_w((v4i32) dst0_m, 1); \
out2_m = __msa_copy_u_w((v4i32) dst1_m, 0); \
out3_m = __msa_copy_u_w((v4i32) dst1_m, 1); \
SW4(out0_m, out1_m, out2_m, out3_m, pdst, stride); \
}
/* Description : Dot product and addition of 3 signed halfword input vectors
Arguments : Inputs - in0, in1, in2, coeff0, coeff1, coeff2
Outputs - out0_m
Return Type - signed halfword
Details : Dot product of 'in0' with 'coeff0'
Dot product of 'in1' with 'coeff1'
Dot product of 'in2' with 'coeff2'
Addition of all the 3 vector results
out0_m = (in0 * coeff0) + (in1 * coeff1) + (in2 * coeff2)
*/
#define DPADD_SH3_SH(in0, in1, in2, coeff0, coeff1, coeff2) \
( { \
v8i16 out0_m; \
\
out0_m = __msa_dotp_s_h((v16i8) in0, (v16i8) coeff0); \
out0_m = __msa_dpadd_s_h(out0_m, (v16i8) in1, (v16i8) coeff1); \
out0_m = __msa_dpadd_s_h(out0_m, (v16i8) in2, (v16i8) coeff2); \
\
out0_m; \
} )
/* Description : Pack even elements of input vectors & xor with 128
Arguments : Inputs - in0, in1
Outputs - out_m
Return Type - unsigned byte
Details : Signed byte even elements from 'in0' and 'in1' are packed
together in one vector and the resulted vector is xor'ed with
128 to shift the range from signed to unsigned byte
*/
#define PCKEV_XORI128_UB(in0, in1) \
( { \
v16u8 out_m; \
out_m = (v16u8) __msa_pckev_b((v16i8) in1, (v16i8) in0); \
out_m = (v16u8) __msa_xori_b((v16u8) out_m, 128); \
out_m; \
} )
/* Description : Converts inputs to unsigned bytes, interleave, average & store
as 8x4 unsigned byte block
Arguments : Inputs - in0, in1, in2, in3, dst0, dst1, pdst, stride
*/
#define CONVERT_UB_AVG_ST8x4_UB(in0, in1, in2, in3, \
dst0, dst1, pdst, stride) \
{ \
v16u8 tmp0_m, tmp1_m; \
uint8_t *pdst_m = (uint8_t *) (pdst); \
\
tmp0_m = PCKEV_XORI128_UB(in0, in1); \
tmp1_m = PCKEV_XORI128_UB(in2, in3); \
AVER_UB2_UB(tmp0_m, dst0, tmp1_m, dst1, tmp0_m, tmp1_m); \
ST_D4(tmp0_m, tmp1_m, 0, 1, 0, 1, pdst_m, stride); \
}
/* Description : Pack even byte elements, extract 0 & 2 index words from pair
of results and store 4 words in destination memory as per
stride
Arguments : Inputs - in0, in1, in2, in3, pdst, stride
*/
#define PCKEV_ST4x4_UB(in0, in1, in2, in3, pdst, stride) \
{ \
uint32_t out0_m, out1_m, out2_m, out3_m; \
v16i8 tmp0_m, tmp1_m; \
\
PCKEV_B2_SB(in1, in0, in3, in2, tmp0_m, tmp1_m); \
\
out0_m = __msa_copy_u_w((v4i32) tmp0_m, 0); \
out1_m = __msa_copy_u_w((v4i32) tmp0_m, 2); \
out2_m = __msa_copy_u_w((v4i32) tmp1_m, 0); \
out3_m = __msa_copy_u_w((v4i32) tmp1_m, 2); \
\
SW4(out0_m, out1_m, out2_m, out3_m, pdst, stride); \
}
/* Description : Pack even byte elements and store byte vector in destination
memory
Arguments : Inputs - in0, in1, pdst
*/
#define PCKEV_ST_SB(in0, in1, pdst) \
{ \
v16i8 tmp_m; \
tmp_m = __msa_pckev_b((v16i8) in1, (v16i8) in0); \
ST_SB(tmp_m, (pdst)); \
}
/* Description : Horizontal 2 tap filter kernel code
Arguments : Inputs - in0, in1, mask, coeff, shift
*/
#define HORIZ_2TAP_FILT_UH(in0, in1, mask, coeff, shift) \
( { \
v16i8 tmp0_m; \
v8u16 tmp1_m; \
\
tmp0_m = __msa_vshf_b((v16i8) mask, (v16i8) in1, (v16i8) in0); \
tmp1_m = __msa_dotp_u_h((v16u8) tmp0_m, (v16u8) coeff); \
tmp1_m = (v8u16) __msa_srari_h((v8i16) tmp1_m, shift); \
tmp1_m = __msa_sat_u_h(tmp1_m, shift); \
\
tmp1_m; \
} )
#endif /* AVUTIL_MIPS_GENERIC_MACROS_MSA_H */
|
c51650aefe3e63991240c36180c12537b861c349
|
fbe68d84e97262d6d26dd65c704a7b50af2b3943
|
/third_party/virtualbox/include/iprt/errno.h
|
0ecc7f115ecc9a7b528d893b955880dfa771d508
|
[
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"CDDL-1.0",
"LicenseRef-scancode-warranty-disclaimer",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"GPL-2.0-or-later",
"MPL-1.0",
"LicenseRef-scancode-generic-exception",
"Apache-2.0",
"OpenSSL",
"MIT"
] |
permissive
|
thalium/icebox
|
c4e6573f2b4f0973b6c7bb0bf068fe9e795fdcfb
|
6f78952d58da52ea4f0e55b2ab297f28e80c1160
|
refs/heads/master
| 2022-08-14T00:19:36.984579
| 2022-02-22T13:10:31
| 2022-02-22T13:10:31
| 190,019,914
| 585
| 109
|
MIT
| 2022-01-13T20:58:15
| 2019-06-03T14:18:12
|
C++
|
UTF-8
|
C
| false
| false
| 8,057
|
h
|
errno.h
|
/** @file
* IPRT - errno.h wrapper.
*/
/*
* Copyright (C) 2012-2017 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___iprt_errno_h___
#define ___iprt_errno_h___
#ifndef IPRT_NO_CRT
# if defined(RT_OS_DARWIN) && defined(KERNEL)
# include <sys/errno.h>
# elif defined(RT_OS_LINUX) && defined(__KERNEL__)
# include <linux/errno.h>
# elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
# include <sys/errno.h>
# elif defined(RT_OS_NETBSD) && defined(_KERNEL)
# include <sys/errno.h>
# else
# include <errno.h>
# endif
#endif
/*
* Supply missing errno values according to the current RT_OS_XXX definition.
*
* Note! These supplements are for making no-CRT mode, as well as making UNIXy
* code that makes used of odd errno defines internally, work smoothly.
*
* When adding more error codes, always check the following errno.h sources:
* - RT_OS_DARWIN: http://fxr.watson.org/fxr/source/bsd/sys/errno.h?v=xnu-1699.24.8
* - RT_OS_FREEBSD: http://fxr.watson.org/fxr/source/sys/errno.h?v=DFBSD
* - RT_OS_NETBSD: http://fxr.watson.org/fxr/source/sys/errno.h?v=NETBSD
* - RT_OS_OPENBSD: http://fxr.watson.org/fxr/source/sys/errno.h?v=OPENBSD
* - RT_OS_OS2: http://svn.netlabs.org/libc/browser/trunk/libc/include/sys/errno.h
* - RT_OS_LINUX: http://fxr.watson.org/fxr/source/include/asm-generic/errno.h?v=linux-2.6
* - RT_OS_SOLARIS: http://fxr.watson.org/fxr/source/common/sys/errno.h?v=OPENSOLARIS
* - RT_OS_WINDOWS: tools/win.x86/vcc/v8sp1/include/errno.h
*/
#if defined(RT_OS_DARWIN) \
|| defined(RT_OS_FREEBSD) \
|| defined(RT_OS_NETBSD) \
|| defined(RT_OS_OPENBSD) \
|| defined(RT_OS_OS2)
# define RT_ERRNO_OS_BSD
#endif
#ifdef RT_OS_SOLARIS
# define RT_ERRNO_OS_SYSV_HARDCORE /* ?? */
#endif
/* The relatively similar part. */
#ifndef EPERM
# define EPERM (1)
#endif
#ifndef ENOENT
# define ENOENT (2)
#endif
#ifndef ESRCH
# define ESRCH (3)
#endif
#ifndef EINTR
# define EINTR (4)
#endif
#ifndef EIO
# define EIO (5)
#endif
#ifndef ENXIO
# define ENXIO (6)
#endif
#ifndef E2BIG
# define E2BIG (7)
#endif
#ifndef ENOEXEC
# define ENOEXEC (8)
#endif
#ifndef EBADF
# define EBADF (9)
#endif
#ifndef ECHILD
# define ECHILD (10)
#endif
#ifndef EAGAIN
# if defined(RT_ERRNO_OS_BSD)
# define EAGAIN (35)
# else
# define EAGAIN (11)
# endif
#endif
#ifndef EWOULDBLOCK
# define EWOULDBLOCK EAGAIN
#endif
#ifndef EDEADLK
# if defined(RT_ERRNO_OS_BSD)
# define EDEADLK (11)
# elif defined(RT_OS_LINUX)
# define EDEADLK (35)
# elif defined(RT_OS_WINDOWS)
# define EDEADLK (36)
# else
# define EDEADLK (45)
# endif
#endif
#ifndef EDEADLOCK
# define EDEADLOCK EDEADLK
#endif
#ifndef ENOMEM
# define ENOMEM (12)
#endif
#ifndef EACCES
# define EACCES (13)
#endif
#ifndef EFAULT
# define EFAULT (14)
#endif
#ifndef ENOTBLK
# define ENOTBLK (15)
#endif
#ifndef EBUSY
# define EBUSY (16)
#endif
#ifndef EEXIST
# define EEXIST (17)
#endif
#ifndef EXDEV
# define EXDEV (18)
#endif
#ifndef ENODEV
# define ENODEV (19)
#endif
#ifndef ENOTDIR
# define ENOTDIR (20)
#endif
#ifndef EISDIR
# define EISDIR (21)
#endif
#ifndef EINVAL
# define EINVAL (22)
#endif
#ifndef ENFILE
# define ENFILE (23)
#endif
#ifndef EMFILE
# define EMFILE (24)
#endif
#ifndef ENOTTY
# define ENOTTY (25)
#endif
#ifndef ETXTBSY
# define ETXTBSY (26)
#endif
#ifndef EFBIG
# define EFBIG (27)
#endif
#ifndef ENOSPC
# define ENOSPC (28)
#endif
#ifndef ESPIPE
# define ESPIPE (29)
#endif
#ifndef EROFS
# define EROFS (30)
#endif
#ifndef EMLINK
# define EMLINK (31)
#endif
#ifndef EPIPE
# define EPIPE (32)
#endif
#ifndef EDOM
# define EDOM (33)
#endif
#ifndef ERANGE
# define ERANGE (34)
#endif
/* 35 - also EAGAIN on BSD and EDEADLK on Linux. */
#ifndef ENOMSG
# if defined(RT_OS_DARWIN)
# define ENOMSG (91)
# elif defined(RT_OS_FREEBSD)
# define ENOMSG (83)
# elif defined(RT_OS_LINUX)
# define ENOMSG (42)
# else
# define ENOMSG (35)
# endif
#endif
/* 36 - Also EDEADLK on Windows. */
#ifndef EIDRM
# if defined(RT_OS_DARWIN)
# define EIDRM (90)
# elif defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
# define EIDRM (82)
# elif defined(RT_OS_OPENBSD)
# define EIDRM (89)
# elif defined(RT_OS_LINUX)
# define EIDRM (43)
# elif defined(RT_OS_WINDOWS)
# define EIDRM (600)
# else
# define EIDRM (36)
# endif
#endif
#ifndef EINPROGRESS
# if defined(RT_ERRNO_OS_BSD)
# define EINPROGRESS (36)
# elif defined(RT_OS_LINUX)
# define EINPROGRESS (115)
# else
# define EINPROGRESS (150)
# endif
#endif
#ifndef ENAMETOOLONG
# if defined(RT_ERRNO_OS_BSD)
# define ENAMETOOLONG (63)
# elif defined(RT_OS_LINUX)
# define ENAMETOOLONG (36)
# else
# define ENAMETOOLONG (78)
# endif
#endif
/* 37 */
#ifndef ECHRNG
# if defined(RT_ERRNO_OS_SYSV_HARDCORE)
# define ECHRNG (37)
# else
# define ECHRNG (599)
# endif
#endif
#ifndef ENOLCK
# if defined(RT_ERRNO_OS_BSD)
# define ENOLCK (77)
# elif defined(RT_OS_LINUX)
# define ENOLCK (37)
# else
# define ENOLCK (46)
# endif
#endif
#ifndef EALREADY
# if defined(RT_ERRNO_OS_BSD)
# define EALREADY (37)
# elif defined(RT_OS_LINUX)
# define EALREADY (114)
# else
# define EALREADY (149)
# endif
#endif
/** @todo errno constants {37..44}. */
/* 45 - also EDEADLK on Solaris, EL2NSYNC on Linux. */
#ifndef ENOTSUP
# if defined(RT_ERRNO_OS_BSD)
# define ENOTSUP (45)
# elif defined(RT_OS_LINUX)
# define ENOTSUP (95)
# else
# define ENOTSUP (48)
# endif
#endif
#ifndef EOPNOTSUPP
# if defined(RT_ERRNO_OS_BSD)
# define EOPNOTSUPP ENOTSUP
# elif defined(RT_OS_LINUX)
# define EOPNOTSUPP ENOTSUP
# else
# define EOPNOTSUPP (122)
# endif
#endif
/** @todo errno constants {46..74}. */
/* 75 - note that Solaris has constant with value 75. */
#ifndef EOVERFLOW
# if defined(RT_OS_OPENBSD)
# define EOVERFLOW (87)
# elif defined(RT_ERRNO_OS_BSD)
# define EOVERFLOW (84)
# elif defined(RT_OS_LINUX)
# define EOVERFLOW (75)
# else
# define EOVERFLOW (79)
# endif
#endif
#ifndef EPROGMISMATCH
# if defined(RT_ERRNO_OS_BSD)
# define EPROGMISMATCH (75)
# else
# define EPROGMISMATCH (598)
# endif
#endif
/** @todo errno constants {76..}. */
#endif
|
9f0641755778c2a02a1e5dadab4958e65a487d60
|
8838eb997879add5759b6dfb23f9a646464e53ca
|
/third-party/lib/npf/embox_compat.h
|
962aebc16a0016b90b806597b15042de2f076b7a
|
[
"BSD-2-Clause"
] |
permissive
|
embox/embox
|
d6aacec876978522f01cdc4b8de37a668c6f4c80
|
98e3c06e33f3fdac10a29c069c20775568e0a6d1
|
refs/heads/master
| 2023-09-04T03:02:20.165042
| 2023-09-02T14:55:31
| 2023-09-02T14:55:31
| 33,078,138
| 1,087
| 325
|
BSD-2-Clause
| 2023-09-14T16:58:34
| 2015-03-29T15:27:48
|
C
|
UTF-8
|
C
| false
| false
| 593
|
h
|
embox_compat.h
|
/**
* @file
*
* @date Sep 9, 2021
* @author Anton Bondarev
*/
#ifndef THIRD_PARTY_LIB_NPF_EMBOX_COMPAT_H_
#define THIRD_PARTY_LIB_NPF_EMBOX_COMPAT_H_
#include <errno.h>
#define EPROGMISMATCH ENOSUPP
#define __KERNEL_RCSID(x,y)
#define __linux__
#include <nv.h>
typedef nvlist_t * nvlist_ref_t;
#define MAP_FILE 0
#ifndef __UNCONST
#define __UNCONST(a) ((void*)(uintptr_t)(const void*)a)
#endif
#define __unused
static inline int nvlist_xfer_ioctl(int fd, unsigned long cmd, nvlist_t *req, nvlist_t **resp) {
return -1;
}
#endif /* THIRD_PARTY_LIB_NPF_EMBOX_COMPAT_H_ */
|
fa353f2ffff0e7e18f86e0187a4a7e3776633472
|
a45c0c63999ba4a6489812d68fd0be4350726761
|
/chapter2/test_scope.c
|
01910b190924a474ec733d894cce82939e7d8a27
|
[] |
no_license
|
dogriffiths/HeadFirstC
|
4320bd5436aac55018f6dc1be78b4f03b4cdb967
|
4d06df0675124c96183c6a7caca39262e789d69e
|
refs/heads/master
| 2023-08-31T04:06:56.898582
| 2023-08-07T13:14:17
| 2023-08-07T13:14:17
| 5,558,835
| 164
| 110
| null | 2023-08-07T13:14:18
| 2012-08-26T09:13:00
|
C
|
UTF-8
|
C
| false
| false
| 586
|
c
|
test_scope.c
|
#include <stdio.h>
char * get_message() {
char * msg = "Aren't pointers fun?";
printf("msg address = %p\n", msg);
return msg;
}
int main() {
char * string = get_message();
printf("Address = %p\n", string);
printf("Address = %p\n", "Aren't pointers fun?");
char * s0 = "Aren't pointers fun?";
char s1[] = "Aren't pointers fun?";
if (s0 == "Aren't pointers fun?") {
puts("The C compiler reused the string");
}
if (s1 == "Aren't pointers fun?") {
puts("The C compiler reused the string in an array - I DON'T BELIEVE IT!");
}
puts(string);
return 0;
}
|
5f0b62bc6d05f9649e02d5cfcae6cb2b895cc543
|
376e1818d427b5e4d32fa6dd6c7b71e9fd88afdb
|
/textproc/ebview/patches/patch-src_dialog.c
|
6fe008cca28b909b9ea2487a25cd6f93e9d9b4d4
|
[] |
no_license
|
NetBSD/pkgsrc
|
a0732c023519650ef821ab89c23ab6ab59e25bdb
|
d042034ec4896cc5b47ed6f2e5b8802d9bc5c556
|
refs/heads/trunk
| 2023-09-01T07:40:12.138283
| 2023-09-01T05:25:19
| 2023-09-01T05:25:19
| 88,439,572
| 321
| 138
| null | 2023-07-12T22:34:14
| 2017-04-16T20:04:15
| null |
UTF-8
|
C
| false
| false
| 1,402
|
c
|
patch-src_dialog.c
|
$NetBSD: patch-src_dialog.c,v 1.1 2013/12/15 19:49:36 joerg Exp $
--- src/dialog.c.orig 2013-12-15 15:25:57.000000000 +0000
+++ src/dialog.c
@@ -25,7 +25,7 @@
#include "statusbar.h"
gboolean active=FALSE;
-static gchar g_message[1024];
+static gchar my_message[1024];
void center_dialog(GtkWidget *window, GtkWidget *dialog){
gint window_x, window_y;
@@ -69,7 +69,7 @@ gboolean idle_warning(gpointer data){
GTK_DIALOG_DESTROY_WITH_PARENT /* | GTK_DIALOG_NO_SEPARATOR */,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
- g_message);
+ my_message);
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
active = FALSE;
@@ -98,7 +98,7 @@ gboolean idle_error(gpointer data){
GTK_DIALOG_DESTROY_WITH_PARENT /* | GTK_DIALOG_NO_SEPARATOR */,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
- g_message);
+ my_message);
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
@@ -114,7 +114,7 @@ void popup_warning(char *message){
LOG(LOG_DEBUG, "IN : popup_warning");
g_idle_add(idle_warning, (gpointer)message);
- strcpy(g_message, message);
+ strcpy(my_message, message);
LOG(LOG_DEBUG, "OUT : popup_warning");
}
@@ -123,7 +123,7 @@ void popup_error(char *message){
LOG(LOG_DEBUG, "IN : popup_error");
- strcpy(g_message, message);
+ strcpy(my_message, message);
g_idle_add(idle_error, (gpointer)message);
|
e00bd2158ab983cb828f4d8cb3c1a771ecfbf9bc
|
e5ec9a33aaca93a653df46e7d3c351ece1b4abc5
|
/ZQCNN/math/zq_avx_mathfun.h
|
8a10a08c9bedf44d5d5bba0c8148a11229e5ad55
|
[
"MIT"
] |
permissive
|
zuoqing1988/ZQCNN
|
0b0dbe79acf3094c252e6016dca0dbf37134ce37
|
9c89e94debaa9a241d2ac0cbc7d32c7bb8436490
|
refs/heads/master
| 2022-08-28T08:09:58.698706
| 2022-08-22T04:20:27
| 2022-08-22T04:20:27
| 132,091,868
| 2,152
| 487
|
MIT
| 2020-10-23T07:37:06
| 2018-05-04T05:30:54
|
Objective-C
|
UTF-8
|
C
| false
| false
| 2,515
|
h
|
zq_avx_mathfun.h
|
/*
AVX implementation of sin, cos, sincos, exp and log
Based on "sse_mathfun.h", by Julien Pommier
http://gruntthepeon.free.fr/ssemath/
Copyright (C) 2012 Giovanni Garberoglio
Interdisciplinary Laboratory for Computational Science (LISC)
Fondazione Bruno Kessler and University of Trento
via Sommarive, 18
I-38123 Trento (Italy)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
(this is the zlib license)
*/
#ifndef _ZQ_AVX_MATHFUN_H_
#define _ZQ_AVX_MATHFUN_H_
#include "../ZQ_CNN_CompileConfig.h"
#if ZQ_CNN_USE_SSETYPE >= ZQ_CNN_SSETYPE_AVX
#include <immintrin.h>
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
/* natural logarithm computed for 8 simultaneous float
return NaN for x <= 0
*/
__m256 zq_mm256_log_ps(__m256 x);
__m256 zq_mm256_exp_ps(__m256 x);
/* evaluation of 8 sines at onces using AVX intrisics
The code is the exact rewriting of the cephes sinf function.
Precision is excellent as long as x < 8192 (I did not bother to
take into account the special handling they have for greater values
-- it does not return garbage for arguments over 8192, though, but
the extra precision is missing).
Note that it is such that sinf((float)M_PI) = 8.74e-8, which is the
surprising but correct result.
*/
__m256 zq_mm256_sin_ps(__m256 x);
/* almost the same as sin_ps */
__m256 zq_mm256_cos_ps(__m256 x);
/* since sin256_ps and cos256_ps are almost identical, sincos256_ps could replace both of them..
it is almost as fast, and gives you a free cosine with your sine */
void zq_mm256_sincos_ps(__m256 x, __m256 *s, __m256 *c);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif
#endif
|
6e03df3f136beea089fa1e3fb0bf1da566eba277
|
50dd46b8ece33f3cdd174284b15d1d51f89669d4
|
/third_party/edk2/EdkCompatibilityPkg/Compatibility/Include/Ppi/EcpPciCfg.h
|
6b0f55750a1caf4d43468bdb595a33861de5a939
|
[
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"BSD-2-Clause",
"OpenSSL"
] |
permissive
|
google/google-ctf
|
f99da1ee07729bbccb869fff1cbaed6a80e43bcc
|
df02323eaf945d15e124801c74abaadca2749dc7
|
refs/heads/master
| 2023-08-31T14:30:27.548081
| 2023-08-29T13:04:20
| 2023-08-29T13:04:20
| 131,317,137
| 4,136
| 607
|
Apache-2.0
| 2023-08-30T22:17:02
| 2018-04-27T15:56:03
|
Go
|
UTF-8
|
C
| false
| false
| 2,367
|
h
|
EcpPciCfg.h
|
/** @file
This PPI is the same as the PPI in the framework PciCfg, with one exception.
Specifically, this PPI does not include a modify API, while the PPI in the framework PciCfg does.
Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _PEI_PCI_CFG_H_
#define _PEI_PCI_CFG_H_
#include <Ppi/PciCfg.h>
#define ECP_PEI_PCI_CFG_PPI_GUID \
{0xb0ee53d4, 0xa049, 0x4a79, { 0xb2, 0xff, 0x19, 0xd9, 0xfa, 0xef, 0xaa, 0x94}}
typedef struct _ECP_PEI_PCI_CFG_PPI ECP_PEI_PCI_CFG_PPI;
/**
A PCI read and write operation.
Writes to, or reads from, a given location in the PCI configuration space.
@param PeiServices An indirect pointer to the PEI Services Table
published by the PEI Foundation.
@param This The pointer to local data for the interface.
@param Width The width of the access. Enumerated in bytes.
@param Address The physical address of the access. The format of
the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
@param Buffer A pointer to the buffer of data.
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_DEVICE_ERROR There was a problem with the transaction.
@retval EFI_DEVICE_NOT_READY The device is not capable of supporting the
operation at this time.
**/
typedef
EFI_STATUS
(EFIAPI *ECP_PEI_PCI_CFG_PPI_IO)(
IN EFI_PEI_SERVICES **PeiServices,
IN EFI_PEI_PCI_CFG_PPI * This,
IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
IN UINT64 Address,
IN OUT VOID *Buffer
);
struct _ECP_PEI_PCI_CFG_PPI {
ECP_PEI_PCI_CFG_PPI_IO Read;
ECP_PEI_PCI_CFG_PPI_IO Write;
};
extern EFI_GUID gEcpPeiPciCfgPpiGuid;
#endif
|
4f4c60ba89e099e3a0cfce38853f777cc87177bf
|
aa3befea459382dc5c01c925653d54f435b3fb0f
|
/arch/arm64/src/a64/a64_de.h
|
7daaa2d9d182098fb06a1a8b0c9593ddb0e40fd6
|
[
"MIT-open-group",
"BSD-3-Clause",
"HPND-sell-variant",
"BSD-4-Clause-UC",
"LicenseRef-scancode-warranty-disclaimer",
"MIT-0",
"LicenseRef-scancode-bsd-atmel",
"LicenseRef-scancode-gary-s-brown",
"LicenseRef-scancode-proprietary-license",
"SunPro",
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"LicenseRef-scancode-other-permissive",
"HPND",
"ISC",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"GPL-1.0-or-later",
"CC-BY-2.0",
"CC-BY-4.0"
] |
permissive
|
apache/nuttx
|
14519a7bff4a87935d94fb8fb2b19edb501c7cec
|
606b6d9310fb25c7d92c6f95bf61737e3c79fa0f
|
refs/heads/master
| 2023-08-25T06:55:45.822534
| 2023-08-23T16:03:31
| 2023-08-24T21:25:47
| 228,103,273
| 407
| 241
|
Apache-2.0
| 2023-09-14T18:26:05
| 2019-12-14T23:27:55
|
C
|
UTF-8
|
C
| false
| false
| 4,405
|
h
|
a64_de.h
|
/****************************************************************************
* arch/arm64/src/a64/a64_de.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/
#ifndef __ARCH_ARM64_SRC_A64_A64_DE_H
#define __ARCH_ARM64_SRC_A64_A64_DE_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: a64_de_init
*
* Description:
* Initialize the Display Engine on the SoC. Mixer 0 will be configured
* to stream pixel data to Timing Controller TCON0. Should be called
* before any Display Engine operation.
*
* Input Parameters:
* None
*
* Returned Value:
* Zero (OK) on success; ERROR if timeout.
*
****************************************************************************/
int a64_de_init(void);
/****************************************************************************
* Name: a64_de_blender_init
*
* Description:
* Initialize the UI Blender for Display Engine. Should be called after
* a64_de_init() and before a64_de_ui_channel_init().
*
* Input Parameters:
* None
*
* Returned Value:
* OK is always returned at present.
*
****************************************************************************/
int a64_de_blender_init(void);
/****************************************************************************
* Name: a64_de_ui_channel_init
*
* Description:
* Initialize a UI Channel for Display Engine. Display Engine will
* stream the pixel data from the Frame Buffer Memory (over DMA) to the
* UI Blender. There are 3 UI Channels: Base UI Channel (Channel 1) and
* 2 Overlay UI Channels (Channels 2 and 3). Should be called after
* a64_de_blender_init() and before a64_de_enable().
*
* Input Parameters:
* channel - UI Channel Number: 1, 2 or 3
* fbmem - Start of Frame Buffer Memory (address should be 32-bit),
* or NULL if this UI Channel should be disabled
* fblen - Length of Frame Buffer Memory in bytes
* xres - Horizontal resolution in pixel columns
* yres - Vertical resolution in pixel rows
* xoffset - Horizontal offset in pixel columns
* yoffset - Vertical offset in pixel rows
*
* Returned Value:
* OK is always returned at present.
*
****************************************************************************/
int a64_de_ui_channel_init(uint8_t channel,
const void *fbmem,
size_t fblen,
uint16_t xres,
uint16_t yres,
uint16_t xoffset,
uint16_t yoffset);
/****************************************************************************
* Name: a64_de_enable
*
* Description:
* Set the UI Blender Route, enable the Blender Pipes and enable the
* Display Engine. Should be called after all 3 UI Channels have been
* initialized.
*
* Input Parameters:
* channels - Number of UI Channels to enable: 1 or 3
*
* Returned Value:
* OK is always returned at present.
*
****************************************************************************/
int a64_de_enable(uint8_t channels);
#endif /* __ARCH_ARM64_SRC_A64_A64_DE_H */
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.