/*    perl.h
 *
 *    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 *    2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by Larry Wall and others
 *
 *    You may distribute under the terms of either the GNU General Public
 *    License or the Artistic License, as specified in the README file.
 *
 */

#ifndef H_PERL
#define H_PERL 1

#ifdef PERL_FOR_X2P
/*
 * This file is being used for x2p stuff.
 * Above symbol is defined via -D in 'x2p/Makefile.SH'
 * Decouple x2p stuff from some of perls more extreme eccentricities.
 */
#undef MULTIPLICITY
#undef USE_STDIO
#define USE_STDIO
#endif /* PERL_FOR_X2P */

#ifdef PERL_MICRO
#   include "uconfig.h"
#else
#   include "config.h"
#endif

/*
=for apidoc_section $debugging
=for apidoc CmnW ||_aDEPTH
Some functions when compiled under DEBUGGING take an extra final argument named
C<depth>, indicating the C stack depth.  This argument is omitted otherwise.
This macro expands to either S<C<, depth>> under DEBUGGING, or to nothing at
all when not under DEBUGGING, reducing the number of C<#ifdef>'s in the code.

The program is responsible for maintaining the correct value for C<depth>.

=for apidoc CyW ||_pDEPTH
This is used in the prototype declarations for functions that take a L</C<_aDEPTH>>
final parameter, much like L<C<pTHX_>|perlguts/Background and MULTIPLICITY>
is used in functions that take a thread context initial parameter.

=cut
 */

#ifdef DEBUGGING
#  define _pDEPTH ,U32 depth
#  define _aDEPTH ,depth
#else
#  define _pDEPTH
#  define _aDEPTH
#endif

/* NOTE 1: that with gcc -std=c89 the __STDC_VERSION__ is *not* defined
 * because the __STDC_VERSION__ became a thing only with C90.  Therefore,
 * with gcc, HAS_C99 will never become true as long as we use -std=c89.

 * NOTE 2: headers lie.  Do not expect that if HAS_C99 gets to be true,
 * all the C99 features are there and are correct. */
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
    defined(_STDC_C99) || defined(__c99)
#  define HAS_C99 1
#endif

/* See L<perlguts/"The Perl API"> for detailed notes on
 * MULTIPLICITY and PERL_IMPLICIT_SYS */

/* XXX NOTE that from here --> to <-- the same logic is
 * repeated in makedef.pl, so be certain to update
 * both places when editing. */

#ifdef USE_ITHREADS
#  if !defined(MULTIPLICITY)
#    define MULTIPLICITY
#  endif
#endif

/* PERL_IMPLICIT_CONTEXT is a legacy synonym for MULTIPLICITY */
#ifdef MULTIPLICITY
#  ifndef PERL_IMPLICIT_CONTEXT
#    define PERL_IMPLICIT_CONTEXT
#  endif
#endif
#if defined(PERL_IMPLICIT_CONTEXT) && !defined(MULTIPLICITY)
#  define MULTIPLICITY
#endif

/* undef WIN32 when building on Cygwin (for libwin32) - gph */
#ifdef __CYGWIN__
#   undef WIN32
#   undef _WIN32
#endif

/* Use the reentrant APIs like localtime_r and getpwent_r */
/* Win32 has naturally threadsafe libraries, no need to use any _r variants.
 * XXX KEEP makedef.pl copy of this code in sync */
#if defined(USE_ITHREADS) && !defined(USE_REENTRANT_API) && !defined(WIN32)
#   define USE_REENTRANT_API
#endif

/* <--- here ends the logic shared by perl.h and makedef.pl */

/*
=for apidoc_section $directives
=for apidoc AmnUu|void|EXTERN_C
When not compiling using C++, expands to nothing.
Otherwise is used in a declaration of a function to indicate the function
should have external C linkage.  This is required for things to work for just
about all functions with external linkage compiled into perl.
Often, you can use C<L</START_EXTERN_C>> ... C<L</END_EXTERN_C>> blocks
surrounding all your code that you need to have this linkage.

Example usage:

 EXTERN_C int flock(int fd, int op);

=for apidoc Amnu||START_EXTERN_C
When not compiling using C++, expands to nothing.
Otherwise begins a section of code in which every function will effectively
have C<L</EXTERN_C>> applied to it, that is to have external C linkage.  The
section is ended by a C<L</END_EXTERN_C>>.

=for apidoc Amnu||END_EXTERN_C
When not compiling using C++, expands to nothing.
Otherwise ends a section of code already begun by a C<L</START_EXTERN_C>>.

=cut
*/

#undef START_EXTERN_C
#undef END_EXTERN_C
#undef EXTERN_C
#ifdef __cplusplus
#  define EXTERN_C extern "C"
#  define START_EXTERN_C EXTERN_C {
#  define END_EXTERN_C }
#else
#  define START_EXTERN_C
#  define END_EXTERN_C
#  define EXTERN_C extern
#endif

/* Fallback definitions in case we don't have definitions from config.h.
   This should only matter for systems that don't use Configure and
   haven't been modified to define PERL_STATIC_INLINE yet.
*/
#if !defined(PERL_STATIC_INLINE)
#  ifdef HAS_STATIC_INLINE
#    define PERL_STATIC_INLINE static inline
#  else
#    define PERL_STATIC_INLINE static
#  endif
#endif

/*
=for apidoc_section $concurrency
=for apidoc AmU|void|dTHXa|PerlInterpreter * a
On threaded perls, set C<pTHX> to C<a>; on unthreaded perls, do nothing

=for apidoc AmU|void|dTHXoa|PerlInterpreter * a
Now a synonym for C<L</dTHXa>>.

=cut
*/

#ifdef MULTIPLICITY
#  define tTHX	PerlInterpreter*
#  define pTHX  tTHX my_perl PERL_UNUSED_DECL
#  define aTHX	my_perl
#  define aTHXa(a) aTHX = (tTHX)a
#  define dTHXa(a)	pTHX = (tTHX)a
#  define dTHX		pTHX = PERL_GET_THX
#  define pTHX_		pTHX,
#  define aTHX_		aTHX,
#  define pTHX_1	2
#  define pTHX_2	3
#  define pTHX_3	4
#  define pTHX_4	5
#  define pTHX_5	6
#  define pTHX_6	7
#  define pTHX_7	8
#  define pTHX_8	9
#  define pTHX_9	10
#  define pTHX_12	13
#  if defined(DEBUGGING) && !defined(PERL_TRACK_MEMPOOL)
#    define PERL_TRACK_MEMPOOL
#  endif
#else
#  undef PERL_TRACK_MEMPOOL
#endif

#ifdef DEBUGGING
#  define dTHX_DEBUGGING dTHX
#else
#  define dTHX_DEBUGGING dNOOP
#endif

#define STATIC static

#ifndef PERL_CORE
/* Do not use these macros. They were part of PERL_OBJECT, which was an
 * implementation of multiplicity using C++ objects. They have been left
 * here solely for the sake of XS code which has incorrectly
 * cargo-culted them.
 *
 * The only one Devel::PPPort handles is this; list it as deprecated

=for apidoc_section $concurrency
=for apidoc AmD|void|CPERLscope|void x
Now a no-op.

=cut
 */
#  define CPERLscope(x) x
#  define CPERLarg void
#  define CPERLarg_
#  define _CPERLarg
#  define PERL_OBJECT_THIS
#  define _PERL_OBJECT_THIS
#  define PERL_OBJECT_THIS_
#  define CALL_FPTR(fptr) (*fptr)
#  define MEMBER_TO_FPTR(name) name
#endif /* !PERL_CORE */

#define CALLRUNOPS  PL_runops

#define CALLREGCOMP(sv, flags) Perl_pregcomp(aTHX_ (sv),(flags))

#define CALLREGCOMP_ENG(prog, sv, flags) (prog)->comp(aTHX_ sv, flags)
#define CALLREGEXEC(prog,stringarg,strend,strbeg,minend,sv,data,flags) \
    RX_ENGINE(prog)->exec(aTHX_ (prog),(stringarg),(strend), \
        (strbeg),(minend),(sv),(data),(flags))
#define CALLREG_INTUIT_START(prog,sv,strbeg,strpos,strend,flags,data) \
    RX_ENGINE(prog)->intuit(aTHX_ (prog), (sv), (strbeg), (strpos), \
        (strend),(flags),(data))
#define CALLREG_INTUIT_STRING(prog) \
    RX_ENGINE(prog)->checkstr(aTHX_ (prog))

#define CALLREGFREE(prog) \
    Perl_pregfree(aTHX_ (prog))

#define CALLREGFREE_PVT(prog) \
    if(prog && RX_ENGINE(prog)) RX_ENGINE(prog)->rxfree(aTHX_ (prog))

#define CALLREG_NUMBUF_FETCH(rx,paren,usesv)                                \
    RX_ENGINE(rx)->numbered_buff_FETCH(aTHX_ (rx),(paren),(usesv))

#define CALLREG_NUMBUF_STORE(rx,paren,value) \
    RX_ENGINE(rx)->numbered_buff_STORE(aTHX_ (rx),(paren),(value))

#define CALLREG_NUMBUF_LENGTH(rx,sv,paren)                              \
    RX_ENGINE(rx)->numbered_buff_LENGTH(aTHX_ (rx),(sv),(paren))

#define CALLREG_NAMED_BUFF_FETCH(rx, key, flags) \
    RX_ENGINE(rx)->named_buff(aTHX_ (rx), (key), NULL, ((flags) | RXapif_FETCH))

#define CALLREG_NAMED_BUFF_STORE(rx, key, value, flags) \
    RX_ENGINE(rx)->named_buff(aTHX_ (rx), (key), (value), ((flags) | RXapif_STORE))

#define CALLREG_NAMED_BUFF_DELETE(rx, key, flags) \
    RX_ENGINE(rx)->named_buff(aTHX_ (rx),(key), NULL, ((flags) | RXapif_DELETE))

#define CALLREG_NAMED_BUFF_CLEAR(rx, flags) \
    RX_ENGINE(rx)->named_buff(aTHX_ (rx), NULL, NULL, ((flags) | RXapif_CLEAR))

#define CALLREG_NAMED_BUFF_EXISTS(rx, key, flags) \
    RX_ENGINE(rx)->named_buff(aTHX_ (rx), (key), NULL, ((flags) | RXapif_EXISTS))

#define CALLREG_NAMED_BUFF_FIRSTKEY(rx, flags) \
    RX_ENGINE(rx)->named_buff_iter(aTHX_ (rx), NULL, ((flags) | RXapif_FIRSTKEY))

#define CALLREG_NAMED_BUFF_NEXTKEY(rx, lastkey, flags) \
    RX_ENGINE(rx)->named_buff_iter(aTHX_ (rx), (lastkey), ((flags) | RXapif_NEXTKEY))

#define CALLREG_NAMED_BUFF_SCALAR(rx, flags) \
    RX_ENGINE(rx)->named_buff(aTHX_ (rx), NULL, NULL, ((flags) | RXapif_SCALAR))

#define CALLREG_NAMED_BUFF_COUNT(rx) \
    RX_ENGINE(rx)->named_buff(aTHX_ (rx), NULL, NULL, RXapif_REGNAMES_COUNT)

#define CALLREG_NAMED_BUFF_ALL(rx, flags) \
    RX_ENGINE(rx)->named_buff(aTHX_ (rx), NULL, NULL, flags)

#define CALLREG_PACKAGE(rx) \
    RX_ENGINE(rx)->qr_package(aTHX_ (rx))

#if defined(USE_ITHREADS)
#  define CALLREGDUPE(prog,param) \
    Perl_re_dup(aTHX_ (prog),(param))

#  define CALLREGDUPE_PVT(prog,param) \
    (prog ? RX_ENGINE(prog)->dupe(aTHX_ (prog),(param)) \
          : (REGEXP *)NULL)
#endif

/* some compilers impersonate gcc */
#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)
#  define PERL_IS_GCC 1
#endif

#define PERL_GCC_VERSION_GE(major,minor,patch)                              \
    (((100000 * __GNUC__) + (1000 * __GNUC_MINOR__) + __GNUC_PATCHLEVEL__)  \
        >= ((100000 * (major)) + (1000 * (minor)) + (patch)))
#define PERL_GCC_VERSION_GT(major,minor,patch)                              \
    (((100000 * __GNUC__) + (1000 * __GNUC_MINOR__) + __GNUC_PATCHLEVEL__)  \
        > ((100000 * (major)) + (1000 * (minor)) + (patch)))
#define PERL_GCC_VERSION_LE(major,minor,patch)                              \
    (((100000 * __GNUC__) + (1000 * __GNUC_MINOR__) + __GNUC_PATCHLEVEL__)  \
        <= ((100000 * (major)) + (1000 * (minor)) + (patch)))
#define PERL_GCC_VERSION_LT(major,minor,patch)                              \
    (((100000 * __GNUC__) + (1000 * __GNUC_MINOR__) + __GNUC_PATCHLEVEL__)  \
        < ((100000 * (major)) + (1000 * (minor)) + (patch)))

/* In case Configure was not used (we are using a "canned config"
 * such as Win32, or a cross-compilation setup, for example) try going
 * by the gcc major and minor versions.  One useful URL is
 * http://www.ohse.de/uwe/articles/gcc-attributes.html,
 * but contrary to this information warn_unused_result seems
 * not to be in gcc 3.3.5, at least. --jhi
 * Also, when building extensions with an installed perl, this allows
 * the user to upgrade gcc and get the right attributes, rather than
 * relying on the list generated at Configure time.  --AD
 * Set these up now otherwise we get confused when some of the <*thread.h>
 * includes below indirectly pull in <perlio.h> (which needs to know if we
 * have HASATTRIBUTE_FORMAT).
 */

#ifndef PERL_MICRO
#  if defined __GNUC__ && !defined(__INTEL_COMPILER)
#    if PERL_GCC_VERSION_GE(3,1,0)
#      define HASATTRIBUTE_DEPRECATED
#    endif
#    if PERL_GCC_VERSION_GE(3,0,0)  /* XXX Verify this version */
#      define HASATTRIBUTE_FORMAT
#      if defined __MINGW32__
#        define PRINTF_FORMAT_NULL_OK
#      endif
#    endif
#    if PERL_GCC_VERSION_GE(3,0,0)
#      define HASATTRIBUTE_MALLOC
#    endif
#    if PERL_GCC_VERSION_GE(3,3,0)
#      define HASATTRIBUTE_NONNULL
#    endif
#    if PERL_GCC_VERSION_GE(2,5,0)
#      define HASATTRIBUTE_NORETURN
#    endif
#    if PERL_GCC_VERSION_GE(3,0,0)
#      define HASATTRIBUTE_PURE
#    endif
#    if PERL_GCC_VERSION_GE(3,4,0)
#      define HASATTRIBUTE_UNUSED
#    endif
#    if __GNUC__ == 3 && __GNUC_MINOR__ == 3 && !defined(__cplusplus)
#      define HASATTRIBUTE_UNUSED /* gcc-3.3, but not g++-3.3. */
#    endif
#    if PERL_GCC_VERSION_GE(3,4,0)
#      define HASATTRIBUTE_WARN_UNUSED_RESULT
#    endif
     /* always_inline is buggy in gcc <= 4.6 and causes compilation errors */
#    if PERL_GCC_VERSION_GE(4,7,0)
#      define HASATTRIBUTE_ALWAYS_INLINE
#    endif
#  endif
#endif /* #ifndef PERL_MICRO */

#ifdef HASATTRIBUTE_DEPRECATED
#  define __attribute__deprecated__         __attribute__((deprecated))
#endif
#ifdef HASATTRIBUTE_FORMAT
#  define __attribute__format__(x,y,z)      __attribute__((format(x,y,z)))
#endif
#ifdef HASATTRIBUTE_MALLOC
#  define __attribute__malloc__             __attribute__((__malloc__))
#endif
#ifdef HASATTRIBUTE_NONNULL
#  define __attribute__nonnull__(a)         __attribute__((nonnull(a)))
#endif
#ifdef HASATTRIBUTE_NORETURN
#  define __attribute__noreturn__           __attribute__((noreturn))
#endif
#ifdef HASATTRIBUTE_PURE
#  define __attribute__pure__               __attribute__((pure))
#endif
#ifdef HASATTRIBUTE_UNUSED
#  define __attribute__unused__             __attribute__((unused))
#endif
#ifdef HASATTRIBUTE_WARN_UNUSED_RESULT
#  define __attribute__warn_unused_result__ __attribute__((warn_unused_result))
#endif
#ifdef HASATTRIBUTE_ALWAYS_INLINE
/* always_inline is buggy in gcc <= 4.6 and causes compilation errors */
#  if !defined(PERL_IS_GCC) || PERL_GCC_VERSION_GE(4,7,0)
#    define __attribute__always_inline__      __attribute__((always_inline))
#  endif
#endif

/* If we haven't defined the attributes yet, define them to blank. */
#ifndef __attribute__deprecated__
#  define __attribute__deprecated__
#endif
#ifndef __attribute__format__
#  define __attribute__format__(x,y,z)
#endif
#ifndef __attribute__malloc__
#  define __attribute__malloc__
#endif
#ifndef __attribute__nonnull__
#  define __attribute__nonnull__(a)
#endif
#ifndef __attribute__noreturn__
#  define __attribute__noreturn__
#endif
#ifndef __attribute__pure__
#  define __attribute__pure__
#endif
#ifndef __attribute__unused__
#  define __attribute__unused__
#endif
#ifndef __attribute__warn_unused_result__
#  define __attribute__warn_unused_result__
#endif
#ifndef __attribute__always_inline__
#  define __attribute__always_inline__
#endif

/* Some OS warn on NULL format to printf */
#ifdef PRINTF_FORMAT_NULL_OK
#  define __attribute__format__null_ok__(x,y,z)  __attribute__format__(x,y,z)
#else
#  define __attribute__format__null_ok__(x,y,z)
#endif

/*
 * Because of backward compatibility reasons the PERL_UNUSED_DECL
 * cannot be changed from postfix to PERL_UNUSED_DECL(x).  Sigh.
 *
 * Note that there are C compilers such as MetroWerks CodeWarrior
 * which do not have an "inlined" way (like the gcc __attribute__) of
 * marking unused variables (they need e.g. a #pragma) and therefore
 * cpp macros like PERL_UNUSED_DECL cannot work for this purpose, even
 * if it were PERL_UNUSED_DECL(x), which it cannot be (see above).

=for apidoc_section $directives
=for apidoc AmnU||PERL_UNUSED_DECL
Tells the compiler that the parameter in the function prototype just before it
is not necessarily expected to be used in the function.  Not that many
compilers understand this, so this should only be used in cases where
C<L</PERL_UNUSED_ARG>> can't conveniently be used.

Example usage:

=over

 Signal_t
 Perl_perly_sighandler(int sig, Siginfo_t *sip PERL_UNUSED_DECL,
                       void *uap PERL_UNUSED_DECL, bool safe)

=back

=cut
 */

#ifndef PERL_UNUSED_DECL
#  define PERL_UNUSED_DECL __attribute__unused__
#endif

/* gcc -Wall:
 * for silencing unused variables that are actually used most of the time,
 * but we cannot quite get rid of, such as "ax" in PPCODE+noargs xsubs,
 * or variables/arguments that are used only in certain configurations.

=for apidoc Ams||PERL_UNUSED_ARG|void x
This is used to suppress compiler warnings that a parameter to a function is
not used.  This situation can arise, for example, when a parameter is needed
under some configuration conditions, but not others, so that C preprocessor
conditional compilation causes it be used just some times.

=for apidoc Amns||PERL_UNUSED_CONTEXT
This is used to suppress compiler warnings that the thread context parameter to
a function is not used.  This situation can arise, for example, when a
C preprocessor conditional compilation causes it be used just some times.

=for apidoc Ams||PERL_UNUSED_VAR|void x
This is used to suppress compiler warnings that the variable I<x> is not used.
This situation can arise, for example, when a C preprocessor conditional
compilation causes it be used just some times.

=cut
 */
#ifndef PERL_UNUSED_ARG
#  define PERL_UNUSED_ARG(x) ((void)sizeof(x))
#endif
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(x) ((void)sizeof(x))
#endif

#if defined(USE_ITHREADS)
#  define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
#else
#  define PERL_UNUSED_CONTEXT
#endif

/* gcc (-ansi) -pedantic doesn't allow gcc statement expressions,
 * g++ allows them but seems to have problems with them
 * (insane errors ensue).
 * g++ does not give insane errors now (RMB 2008-01-30, gcc 4.2.2).
 */
#if defined(PERL_GCC_PEDANTIC) || \
    (defined(__GNUC__) && defined(__cplusplus) && \
        (PERL_GCC_VERSION_LT(4,2,0)))
#  ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
#    define PERL_GCC_BRACE_GROUPS_FORBIDDEN
#  endif
#endif

/*

=for apidoc Am||PERL_UNUSED_RESULT|void x

This macro indicates to discard the return value of the function call inside
it, I<e.g.>,

 PERL_UNUSED_RESULT(foo(a, b))

The main reason for this is that the combination of C<gcc -Wunused-result>
(part of C<-Wall>) and the C<__attribute__((warn_unused_result))> cannot
be silenced with casting to C<void>.  This causes trouble when the system
header files use the attribute.

Use C<PERL_UNUSED_RESULT> sparingly, though, since usually the warning
is there for a good reason: you might lose success/failure information,
or leak resources, or changes in resources.

But sometimes you just want to ignore the return value, I<e.g.>, on
codepaths soon ending up in abort, or in "best effort" attempts,
or in situations where there is no good way to handle failures.

Sometimes C<PERL_UNUSED_RESULT> might not be the most natural way:
another possibility is that you can capture the return value
and use C<L</PERL_UNUSED_VAR>> on that.

=cut

The __typeof__() is used instead of typeof() since typeof() is not
available under strict C89, and because of compilers masquerading
as gcc (clang and icc), we want exactly the gcc extension
__typeof__ and nothing else.

*/
#ifndef PERL_UNUSED_RESULT
#  if defined(__GNUC__) && defined(HASATTRIBUTE_WARN_UNUSED_RESULT)
#    define PERL_UNUSED_RESULT(v) STMT_START { __typeof__(v) z = (v); (void)sizeof(z); } STMT_END
#  else
#    define PERL_UNUSED_RESULT(v) ((void)(v))
#  endif
#endif

/* on gcc (and clang), specify that a warning should be temporarily
 * ignored; e.g.
 *
 *    GCC_DIAG_IGNORE_DECL(-Wmultichar);
 *    char b = 'ab';
 *    GCC_DIAG_RESTORE_DECL;
 *
 * based on http://dbp-consulting.com/tutorials/SuppressingGCCWarnings.html
 *
 * Note that "pragma GCC diagnostic push/pop" was added in GCC 4.6, Mar 2011;
 * clang only pretends to be GCC 4.2, but still supports push/pop.
 *
 * Note on usage: all macros must be used at a place where a declaration
 * or statement can occur, i.e., not in the middle of an expression.
 * *_DIAG_IGNORE() and *_DIAG_RESTORE can be used in any such place, but
 * must be used without a following semicolon.  *_DIAG_IGNORE_DECL() and
 * *_DIAG_RESTORE_DECL must be used with a following semicolon, and behave
 * syntactically as declarations (like dNOOP).  *_DIAG_IGNORE_STMT()
 * and *_DIAG_RESTORE_STMT must be used with a following semicolon,
 * and behave syntactically as statements (like NOOP).
 *
 */

#if defined(__clang__) || defined(__clang) || PERL_GCC_VERSION_GE(4,6,0)
#  define GCC_DIAG_PRAGMA(x) _Pragma (#x)
/* clang has "clang diagnostic" pragmas, but also understands gcc. */
#  define GCC_DIAG_IGNORE(x) _Pragma("GCC diagnostic push") \
                             GCC_DIAG_PRAGMA(GCC diagnostic ignored #x)
#  define GCC_DIAG_RESTORE   _Pragma("GCC diagnostic pop")
#else
#  define GCC_DIAG_IGNORE(w)
#  define GCC_DIAG_RESTORE
#endif
#define GCC_DIAG_IGNORE_DECL(x) GCC_DIAG_IGNORE(x) dNOOP
#define GCC_DIAG_RESTORE_DECL GCC_DIAG_RESTORE dNOOP
#define GCC_DIAG_IGNORE_STMT(x) GCC_DIAG_IGNORE(x) NOOP
#define GCC_DIAG_RESTORE_STMT GCC_DIAG_RESTORE NOOP
/* for clang specific pragmas */
#if defined(__clang__) || defined(__clang)
#  define CLANG_DIAG_PRAGMA(x) _Pragma (#x)
#  define CLANG_DIAG_IGNORE(x) _Pragma("clang diagnostic push") \
                               CLANG_DIAG_PRAGMA(clang diagnostic ignored #x)
#  define CLANG_DIAG_RESTORE   _Pragma("clang diagnostic pop")
#else
#  define CLANG_DIAG_IGNORE(w)
#  define CLANG_DIAG_RESTORE
#endif
#define CLANG_DIAG_IGNORE_DECL(x) CLANG_DIAG_IGNORE(x) dNOOP
#define CLANG_DIAG_RESTORE_DECL CLANG_DIAG_RESTORE dNOOP
#define CLANG_DIAG_IGNORE_STMT(x) CLANG_DIAG_IGNORE(x) NOOP
#define CLANG_DIAG_RESTORE_STMT CLANG_DIAG_RESTORE NOOP

#if defined(_MSC_VER)
#  define MSVC_DIAG_IGNORE(x) __pragma(warning(push)) \
                              __pragma(warning(disable : x))
#  define MSVC_DIAG_RESTORE   __pragma(warning(pop))
#else
#  define MSVC_DIAG_IGNORE(x)
#  define MSVC_DIAG_RESTORE
#endif
#define MSVC_DIAG_IGNORE_DECL(x) MSVC_DIAG_IGNORE(x) dNOOP
#define MSVC_DIAG_RESTORE_DECL MSVC_DIAG_RESTORE dNOOP
#define MSVC_DIAG_IGNORE_STMT(x) MSVC_DIAG_IGNORE(x) NOOP
#define MSVC_DIAG_RESTORE_STMT MSVC_DIAG_RESTORE NOOP

/*
=for apidoc Amns||NOOP
Do nothing; typically used as a placeholder to replace something that used to
do something.

=for apidoc Amns||dNOOP
Declare nothing; typically used as a placeholder to replace something that used
to declare something.  Works on compilers that require declarations before any
code.

=cut
*/
#define NOOP /*EMPTY*/(void)0
#define dNOOP struct Perl___notused_struct

#ifndef pTHX
/* Don't bother defining tTHX ; using it outside
 * code guarded by MULTIPLICITY is an error.
 */
#  define pTHX		void
#  define pTHX_
#  define aTHX
#  define aTHX_
#  define aTHXa(a)      NOOP
#  define dTHXa(a)	dNOOP
#  define dTHX		dNOOP
#  define pTHX_1	1
#  define pTHX_2	2
#  define pTHX_3	3
#  define pTHX_4	4
#  define pTHX_5	5
#  define pTHX_6	6
#  define pTHX_7	7
#  define pTHX_8	8
#  define pTHX_9	9
#  define pTHX_12	12
#endif

/*
=for apidoc_section $concurrency
=for apidoc AmnU||dVAR
This is now a synonym for dNOOP: declare nothing

=for apidoc_section $XS
=for apidoc Amns||dMY_CXT_SV
Now a placeholder that declares nothing

=cut
*/

#ifndef PERL_CORE
    /* Backwards compatibility macro for XS code. It used to be part of the
     * PERL_GLOBAL_STRUCT(_PRIVATE) feature, which no longer exists */
#  define dVAR		dNOOP

    /* these are only defined for compatibility; should not be used internally.
     * */
#  define dMY_CXT_SV    dNOOP
#  ifndef pTHXo
#    define pTHXo		pTHX
#    define pTHXo_	pTHX_
#    define aTHXo		aTHX
#    define aTHXo_	aTHX_
#    define dTHXo		dTHX
#    define dTHXoa(x)	dTHXa(x)
#  endif
#endif

#ifndef pTHXx
#  define pTHXx		PerlInterpreter *my_perl
#  define pTHXx_	pTHXx,
#  define aTHXx		my_perl
#  define aTHXx_	aTHXx,
#  define dTHXx		dTHX
#endif

/* Under PERL_IMPLICIT_SYS (used in Windows for fork emulation)
 * PerlIO_foo() expands to PL_StdIO->pFOO(PL_StdIO, ...).
 * dTHXs is therefore needed for all functions using PerlIO_foo(). */
#ifdef PERL_IMPLICIT_SYS
#    define dTHXs		dTHX
#else
#    define dTHXs		dNOOP
#endif

#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
#  ifndef PERL_USE_GCC_BRACE_GROUPS
#    define PERL_USE_GCC_BRACE_GROUPS
#  endif
#endif

/*
=for apidoc_section $directives
=for apidoc AmnUu|void|STMT_START
=for apidoc_item ||STMT_END

This allows a series of statements in a macro to be used as a single statement,
as in

 if (x) STMT_START { ... } STMT_END else ...

Note that you can't return a value out of them, which limits their utility.
But see C<L</PERL_USE_GCC_BRACE_GROUPS>>.

=for apidoc AmnuU|bool|PERL_USE_GCC_BRACE_GROUPS

This C pre-processor value, if defined, indicates that it is permissible to use
the GCC brace groups extension.  This extension, of the form

 ({ statement ... })

turns the block consisting of I<statements ...> into an expression with a
value, unlike plain C language blocks.  This can present optimization
possibilities, B<BUT> you generally need to specify an alternative in case this
ability doesn't exist or has otherwise been forbidden.

Example usage:

=over

 #ifdef PERL_USE_GCC_BRACE_GROUPS
   ...
 #else
   ...
 #endif

=back

=cut

 Trying to select a version that gives no warnings...
*/
#if !(defined(STMT_START) && defined(STMT_END))
#   define STMT_START	do
#   define STMT_END	while (0)
#endif

#ifndef BYTEORDER  /* Should never happen -- byteorder is in config.h */
#   define BYTEORDER 0x1234
#endif

#if 'A' == 65 && 'I' == 73 && 'J' == 74 && 'Z' == 90
#define ASCIIish
#else
#undef  ASCIIish
#endif

/*
 * The following contortions are brought to you on behalf of all the
 * standards, semi-standards, de facto standards, not-so-de-facto standards
 * of the world, as well as all the other botches anyone ever thought of.
 * The basic theory is that if we work hard enough here, the rest of the
 * code can be a lot prettier.  Well, so much for theory.  Sorry, Henry...
 */

/* define this once if either system, instead of cluttering up the src */
#if defined(WIN32)
#define DOSISH 1
#endif

/* These exist only for back-compat with XS modules. */
#ifndef PERL_CORE
#define VOL volatile
#define CAN_PROTOTYPE
#define _(args) args
#define I_LIMITS
#define I_STDARG
#define STANDARD_C
#endif

/* By compiling a perl with -DNO_TAINT_SUPPORT or -DSILENT_NO_TAINT_SUPPORT,
 * you get a perl without taint support, but doubtlessly with a lesser
 * degree of support. Do not do so unless you know exactly what it means
 * technically, have a good reason to do so, and know exactly how the
 * perl will be used. perls with -DSILENT_NO_TAINT_SUPPORT are considered
 * a potential security risk due to flat out ignoring the security-relevant
 * taint flags. This being said, a perl without taint support compiled in
 * has marginal run-time performance benefits.
 * SILENT_NO_TAINT_SUPPORT implies NO_TAINT_SUPPORT.
 * SILENT_NO_TAINT_SUPPORT is the same as NO_TAINT_SUPPORT except it
 * silently ignores -t/-T instead of throwing an exception.
 *
 * DANGER! Using NO_TAINT_SUPPORT or SILENT_NO_TAINT_SUPPORT
 *         voids your nonexistent warranty!
 */
#if defined(SILENT_NO_TAINT_SUPPORT) && !defined(NO_TAINT_SUPPORT)
#  define NO_TAINT_SUPPORT 1
#endif

/* NO_TAINT_SUPPORT can be set to transform virtually all taint-related
 * operations into no-ops for a very modest speed-up. Enable only if you
 * know what you're doing: tests and CPAN modules' tests are bound to fail.
 */
#ifdef NO_TAINT_SUPPORT
#   define TAINT		NOOP
#   define TAINT_NOT		NOOP
#   define TAINT_IF(c)		NOOP
#   define TAINT_ENV()		NOOP
#   define TAINT_PROPER(s)	NOOP
#   define TAINT_set(s)		NOOP
#   define TAINT_get		0
#   define TAINTING_get		0
#   define TAINTING_set(s)	NOOP
#   define TAINT_WARN_get       0
#   define TAINT_WARN_set(s)    NOOP
#else

/*
=for apidoc_section $tainting
=for apidoc Cm|void|TAINT

If we aren't in taint checking mode, do nothing;
otherwise indicate to L</C<TAINT_set>> and L</C<TAINT_PROPER>> that some
unspecified element is tainted.

=for apidoc Cm|void|TAINT_NOT

Remove any taintedness previously set by, I<e.g.>, C<TAINT>.

=for apidoc Cm|void|TAINT_IF|bool c

If C<c> evaluates to true, call L</C<TAINT>> to indicate that something is
tainted; otherwise do nothing.

=for apidoc Cmn|void|TAINT_ENV

Looks at several components of L<C<%ENV>|perlvar/%ENV> for taintedness, and
calls L</C<taint_proper>> if any are tainted.  The components it searches are
things like C<$PATH>.

=for apidoc Cm|void|TAINT_PROPER|const char * s

If no element is tainted, do nothing;
otherwise output a message (containing C<s>) that indicates there is a
tainting violation.  If such violations are fatal, it croaks.

=for apidoc Cm|void|TAINT_set|bool s

If C<s> is true, L</C<TAINT_get>> returns true;
If C<s> is false, L</C<TAINT_get>> returns false;

=for apidoc Cm|bool|TAINT_get

Returns a boolean as to whether some element is tainted or not.

=for apidoc Cm|bool|TAINTING_get

Returns a boolean as to whether taint checking is enabled or not.

=for apidoc Cm|void|TAINTING_set|bool s

Turn taint checking mode off/on

=for apidoc Cm|bool|TAINT_WARN_get

Returns false if tainting violations are fatal;
Returns true if they're just warnings

=for apidoc Cm|void|TAINT_WARN_set|bool s

C<s> being true indicates L</C<TAINT_WARN_get>> should return that tainting
violations are just warnings

C<s> being false indicates L</C<TAINT_WARN_get>> should return that tainting
violations are fatal.

=cut
*/
    /* Set to tainted if we are running under tainting mode */
#   define TAINT		(PL_tainted = PL_tainting)

#   define TAINT_NOT	(PL_tainted = FALSE)        /* Untaint */
#   define TAINT_IF(c)	if (UNLIKELY(c)) { TAINT; } /* Conditionally taint */
#   define TAINT_ENV()	if (UNLIKELY(PL_tainting)) { taint_env(); }
                                /* croak or warn if tainting */
#   define TAINT_PROPER(s)	if (UNLIKELY(PL_tainting)) {                \
                                    taint_proper(NULL, s);                  \
                                }
#   define TAINT_set(s)		(PL_tainted = cBOOL(s))
#   define TAINT_get		(cBOOL(UNLIKELY(PL_tainted)))    /* Is something tainted? */
#   define TAINTING_get		(cBOOL(UNLIKELY(PL_tainting)))
#   define TAINTING_set(s)	(PL_tainting = cBOOL(s))
#   define TAINT_WARN_get       (PL_taint_warn)
#   define TAINT_WARN_set(s)    (PL_taint_warn = cBOOL(s))
#endif

/* flags used internally only within pp_subst and pp_substcont */
#ifdef PERL_CORE
#  define SUBST_TAINT_STR      1	/* string tainted */
#  define SUBST_TAINT_PAT      2	/* pattern tainted */
#  define SUBST_TAINT_REPL     4	/* replacement tainted */
#  define SUBST_TAINT_RETAINT  8	/* use re'taint' in scope */
#  define SUBST_TAINT_BOOLRET 16	/* return is boolean (don't taint) */
#endif

/* XXX All process group stuff is handled in pp_sys.c.  Should these
   defines move there?  If so, I could simplify this a lot. --AD  9/96.
*/
/* Process group stuff changed from traditional BSD to POSIX.
   perlfunc.pod documents the traditional BSD-style syntax, so we'll
   try to preserve that, if possible.
*/
#ifdef HAS_SETPGID
#  define BSD_SETPGRP(pid, pgrp)	setpgid((pid), (pgrp))
#elif defined(HAS_SETPGRP) && defined(USE_BSD_SETPGRP)
#  define BSD_SETPGRP(pid, pgrp)	setpgrp((pid), (pgrp))
#elif defined(HAS_SETPGRP2)
#  define BSD_SETPGRP(pid, pgrp)	setpgrp2((pid), (pgrp))
#endif
#if defined(BSD_SETPGRP) && !defined(HAS_SETPGRP)
#  define HAS_SETPGRP  /* Well, effectively it does . . . */
#endif

/* getpgid isn't POSIX, but at least Solaris and Linux have it, and it makes
    our life easier :-) so we'll try it.
*/
#ifdef HAS_GETPGID
#  define BSD_GETPGRP(pid)		getpgid((pid))
#elif defined(HAS_GETPGRP) && defined(USE_BSD_GETPGRP)
#  define BSD_GETPGRP(pid)		getpgrp((pid))
#elif defined(HAS_GETPGRP2)
#  define BSD_GETPGRP(pid)		getpgrp2((pid))
#endif
#if defined(BSD_GETPGRP) && !defined(HAS_GETPGRP)
#  define HAS_GETPGRP  /* Well, effectively it does . . . */
#endif

/* These are not exact synonyms, since setpgrp() and getpgrp() may
   have different behaviors, but perl.h used to define USE_BSDPGRP
   (prior to 5.003_05) so some extension might depend on it.
*/
#if defined(USE_BSD_SETPGRP) || defined(USE_BSD_GETPGRP)
#  ifndef USE_BSDPGRP
#    define USE_BSDPGRP
#  endif
#endif

/* HP-UX 10.X CMA (Common Multithreaded Architecture) insists that
   pthread.h must be included before all other header files.
*/
#if defined(USE_ITHREADS) && defined(PTHREAD_H_FIRST) && defined(I_PTHREAD)
#  include <pthread.h>
#endif

#include <sys/types.h>

#  ifdef I_WCHAR
#    include <wchar.h>
#  endif

# include <stdarg.h>

#ifdef I_STDINT
# include <stdint.h>
#endif

#include <ctype.h>
#include <float.h>
#include <limits.h>

#ifdef METHOD 	/* Defined by OSF/1 v3.0 by ctype.h */
#undef METHOD
#endif

#ifdef PERL_MICRO
#   define NO_LOCALE
#endif

#ifdef I_LOCALE
#   include <locale.h>
#endif

#ifdef NEED_XLOCALE_H
#   include <xlocale.h>
#endif

/* If not forbidden, we enable locale handling if either 1) the POSIX 2008
 * functions are available, or 2) just the setlocale() function.  This logic is
 * repeated in t/loc_tools.pl and makedef.pl;  The three should be kept in
 * sync. */
#if   ! defined(NO_LOCALE)

#  if ! defined(NO_POSIX_2008_LOCALE)           \
   &&   defined(HAS_NEWLOCALE)                  \
   &&   defined(HAS_USELOCALE)                  \
   &&   defined(HAS_DUPLOCALE)                  \
   &&   defined(HAS_FREELOCALE)                 \
   &&   defined(LC_ALL_MASK)

    /* For simplicity, the code is written to assume that any platform advanced
     * enough to have the Posix 2008 locale functions has LC_ALL.  The final
     * test above makes sure that assumption is valid */

#    define HAS_POSIX_2008_LOCALE
#    define USE_LOCALE
#  elif defined(HAS_SETLOCALE)
#    define USE_LOCALE
#  endif
#endif

#ifdef USE_LOCALE
#   define HAS_SKIP_LOCALE_INIT /* Solely for XS code to test for this
                                   #define */
#   if !defined(NO_LOCALE_COLLATE) && defined(LC_COLLATE) \
       && defined(HAS_STRXFRM)
#	define USE_LOCALE_COLLATE
#   endif
#   if !defined(NO_LOCALE_CTYPE) && defined(LC_CTYPE)
#	define USE_LOCALE_CTYPE
#   endif
#   if !defined(NO_LOCALE_NUMERIC) && defined(LC_NUMERIC)
#	define USE_LOCALE_NUMERIC
#   endif
#   if !defined(NO_LOCALE_MESSAGES) && defined(LC_MESSAGES)
#	define USE_LOCALE_MESSAGES
#   endif
#   if !defined(NO_LOCALE_MONETARY) && defined(LC_MONETARY)
#	define USE_LOCALE_MONETARY
#   endif
#   if !defined(NO_LOCALE_TIME) && defined(LC_TIME)
#	define USE_LOCALE_TIME
#   endif
#   if !defined(NO_LOCALE_ADDRESS) && defined(LC_ADDRESS)
#	define USE_LOCALE_ADDRESS
#   endif
#   if !defined(NO_LOCALE_IDENTIFICATION) && defined(LC_IDENTIFICATION)
#	define USE_LOCALE_IDENTIFICATION
#   endif
#   if !defined(NO_LOCALE_MEASUREMENT) && defined(LC_MEASUREMENT)
#	define USE_LOCALE_MEASUREMENT
#   endif
#   if !defined(NO_LOCALE_PAPER) && defined(LC_PAPER)
#	define USE_LOCALE_PAPER
#   endif
#   if !defined(NO_LOCALE_TELEPHONE) && defined(LC_TELEPHONE)
#	define USE_LOCALE_TELEPHONE
#   endif
#   if !defined(NO_LOCALE_SYNTAX) && defined(LC_SYNTAX)
#	define USE_LOCALE_SYNTAX
#   endif
#   if !defined(NO_LOCALE_TOD) && defined(LC_TOD)
#	define USE_LOCALE_TOD
#   endif

/* XXX The next few defines are unfortunately duplicated in makedef.pl, and
 * changes here MUST also be made there */

#  if ! defined(HAS_SETLOCALE) && defined(HAS_POSIX_2008_LOCALE)
#      define USE_POSIX_2008_LOCALE
#      ifndef USE_THREAD_SAFE_LOCALE
#        define USE_THREAD_SAFE_LOCALE
#      endif
                                   /* If compiled with
                                    * -DUSE_THREAD_SAFE_LOCALE, will do so even
                                    * on unthreaded builds */
#  elif   (defined(USE_ITHREADS) || defined(USE_THREAD_SAFE_LOCALE))         \
       && (    defined(HAS_POSIX_2008_LOCALE)                                \
           || (defined(WIN32) && defined(_MSC_VER)))                         \
       && ! defined(NO_THREAD_SAFE_LOCALE)
#    ifndef USE_THREAD_SAFE_LOCALE
#      define USE_THREAD_SAFE_LOCALE
#    endif
#    ifdef HAS_POSIX_2008_LOCALE
#      define USE_POSIX_2008_LOCALE
#    endif
#  endif
#endif

/*  Microsoft documentation reads in the change log for VS 2015:
 *     "The localeconv function declared in locale.h now works correctly when
 *     per-thread locale is enabled. In previous versions of the library, this
 *     function would return the lconv data for the global locale, not the
 *     thread's locale."
 */
#if defined(WIN32) && defined(USE_THREAD_SAFE_LOCALE) && _MSC_VER < 1900
#  define TS_W32_BROKEN_LOCALECONV
#endif

#include <setjmp.h>

#ifdef I_SYS_PARAM
#   ifdef PARAM_NEEDS_TYPES
#	include <sys/types.h>
#   endif
#   include <sys/param.h>
#endif

/* On BSD-derived systems, <sys/param.h> defines BSD to a year-month
   value something like 199306.  This may be useful if no more-specific
   feature test is available.
*/
#if defined(BSD)
#   ifndef BSDish
#       define BSDish
#   endif
#endif

/* Use all the "standard" definitions */
#include <stdlib.h>

/* If this causes problems, set i_unistd=undef in the hint file.  */
#ifdef I_UNISTD
#    if defined(__amigaos4__)
#        ifdef I_NETINET_IN
#            include <netinet/in.h>
#        endif
#   endif
#   include <unistd.h>
#   if defined(__amigaos4__)
/* Under AmigaOS 4 newlib.library provides an environ.  However using
 * it doesn't give us enough control over inheritance of variables by
 * subshells etc. so replace with custom version based on abc-shell
 * code. */
extern char **myenviron;
#       undef environ
#       define environ myenviron
#   endif
#endif

/* for WCOREDUMP */
#ifdef I_SYS_WAIT
#   include <sys/wait.h>
#endif

#if defined(HAS_SYSCALL) && !defined(HAS_SYSCALL_PROTO)
EXTERN_C int syscall(int, ...);
#endif

#if defined(HAS_USLEEP) && !defined(HAS_USLEEP_PROTO)
EXTERN_C int usleep(unsigned int);
#endif

/* Macros for correct constant construction.  These are in C99 <stdint.h>
 * (so they will not be available in strict C89 mode), but they are nice, so
 * let's define them if necessary.
=for apidoc_section $integer
=for apidoc    Am|I16|INT16_C|number
=for apidoc_item |I32|INT32_C|number
=for apidoc_item |I64|INT64_C|number

Returns a token the C compiler recognizes for the constant C<number> of the
corresponding integer type on the machine.

If the machine does not have a 64-bit type, C<INT64_C> is undefined.
Use C<L</INTMAX_C>> to get the largest type available on the platform.

=for apidoc    Am|U16|UINT16_C|number
=for apidoc_item |U32|UINT32_C|number
=for apidoc_item |U64|UINT64_C|number

Returns a token the C compiler recognizes for the constant C<number> of the
corresponding unsigned integer type on the machine.

If the machine does not have a 64-bit type, C<UINT64_C> is undefined.
Use C<L</UINTMAX_C>> to get the largest type available on the platform.


=cut
*/
#ifndef UINT16_C
#  if INTSIZE >= 2
#    define UINT16_C(x) ((U16_TYPE)x##U)
#  else
#    define UINT16_C(x) ((U16_TYPE)x##UL)
#  endif
#endif

#ifndef UINT32_C
#  if INTSIZE >= 4
#    define UINT32_C(x) ((U32_TYPE)x##U)
#  else
#    define UINT32_C(x) ((U32_TYPE)x##UL)
#  endif
#endif

#ifdef I_STDINT
    typedef intmax_t  PERL_INTMAX_T;
    typedef uintmax_t PERL_UINTMAX_T;
#endif

/* N.B.  We use QUADKIND here instead of HAS_QUAD here, because that doesn't
 * actually mean what it has always been documented to mean (see RT #119753)
 * and is explicitly turned off outside of core with dire warnings about
 * removing the undef. */

#if defined(QUADKIND)
#  undef PeRl_INT64_C
#  undef PeRl_UINT64_C
/* Prefer the native integer types (int and long) over long long
 * (which is not C89) and Win32-specific __int64. */
#  if QUADKIND == QUAD_IS_INT && INTSIZE == 8
#    define PeRl_INT64_C(c)	(c)
#    define PeRl_UINT64_C(c)	CAT2(c,U)
#  endif
#  if QUADKIND == QUAD_IS_LONG && LONGSIZE == 8
#    define PeRl_INT64_C(c)	CAT2(c,L)
#    define PeRl_UINT64_C(c)	CAT2(c,UL)
#  endif
#  if QUADKIND == QUAD_IS_LONG_LONG && defined(HAS_LONG_LONG)
#    define PeRl_INT64_C(c)	CAT2(c,LL)
#    define PeRl_UINT64_C(c)	CAT2(c,ULL)
#  endif
#  if QUADKIND == QUAD_IS___INT64
#    define PeRl_INT64_C(c)	CAT2(c,I64)
#    define PeRl_UINT64_C(c)	CAT2(c,UI64)
#  endif
#  ifndef PeRl_INT64_C
#    define PeRl_INT64_C(c)	((I64)(c)) /* last resort */
#    define PeRl_UINT64_C(c)	((U64TYPE)(c))
#  endif
/* In OS X the INT64_C/UINT64_C are defined with LL/ULL, which will
 * not fly with C89-pedantic gcc, so let's undefine them first so that
 * we can redefine them with our native integer preferring versions. */
#  if defined(PERL_DARWIN) && defined(PERL_GCC_PEDANTIC)
#    undef INT64_C
#    undef UINT64_C
#  endif
#  ifndef INT64_C
#    define INT64_C(c) PeRl_INT64_C(c)
#  endif
#  ifndef UINT64_C
#    define UINT64_C(c) PeRl_UINT64_C(c)
#  endif

/*
=for apidoc_section $integer
=for apidoc Am||INTMAX_C|number
Returns a token the C compiler recognizes for the constant C<number> of the
widest integer type on the machine.  For example, if the machine has C<long
long>s, C<INTMAX_C(-1)> would yield

 -1LL

See also, for example, C<L</INT32_C>>.

Use L</IV> to declare variables of the maximum usable size on this platform.

=for apidoc Am||UINTMAX_C|number
Returns a token the C compiler recognizes for the constant C<number> of the
widest unsigned integer type on the machine.  For example, if the machine has
C<long>s, C<UINTMAX_C(1)> would yield

 1UL

See also, for example, C<L</UINT32_C>>.

Use L</UV> to declare variables of the maximum usable size on this platform.

=cut
*/

#  ifndef I_STDINT
    typedef I64TYPE PERL_INTMAX_T;
    typedef U64TYPE PERL_UINTMAX_T;
#  endif
#  ifndef INTMAX_C
#    define INTMAX_C(c) INT64_C(c)
#  endif
#  ifndef UINTMAX_C
#    define UINTMAX_C(c) UINT64_C(c)
#  endif

#else  /* below QUADKIND is undefined */

/* Perl doesn't work on 16 bit systems, so must be 32 bit */
#  ifndef I_STDINT
    typedef I32TYPE PERL_INTMAX_T;
    typedef U32TYPE PERL_UINTMAX_T;
#  endif
#  ifndef INTMAX_C
#    define INTMAX_C(c) INT32_C(c)
#  endif
#  ifndef UINTMAX_C
#    define UINTMAX_C(c) UINT32_C(c)
#  endif

#endif  /* no QUADKIND */

#ifdef PERL_CORE

/* byte-swapping functions for big-/little-endian conversion */
# define _swab_16_(x) ((U16)( \
         (((U16)(x) & UINT16_C(0x00ff)) << 8) | \
         (((U16)(x) & UINT16_C(0xff00)) >> 8) ))

# define _swab_32_(x) ((U32)( \
         (((U32)(x) & UINT32_C(0x000000ff)) << 24) | \
         (((U32)(x) & UINT32_C(0x0000ff00)) <<  8) | \
         (((U32)(x) & UINT32_C(0x00ff0000)) >>  8) | \
         (((U32)(x) & UINT32_C(0xff000000)) >> 24) ))

# ifdef HAS_QUAD
#  define _swab_64_(x) ((U64)( \
          (((U64)(x) & UINT64_C(0x00000000000000ff)) << 56) | \
          (((U64)(x) & UINT64_C(0x000000000000ff00)) << 40) | \
          (((U64)(x) & UINT64_C(0x0000000000ff0000)) << 24) | \
          (((U64)(x) & UINT64_C(0x00000000ff000000)) <<  8) | \
          (((U64)(x) & UINT64_C(0x000000ff00000000)) >>  8) | \
          (((U64)(x) & UINT64_C(0x0000ff0000000000)) >> 24) | \
          (((U64)(x) & UINT64_C(0x00ff000000000000)) >> 40) | \
          (((U64)(x) & UINT64_C(0xff00000000000000)) >> 56) ))
# endif

/* Maximum level of recursion */
#ifndef PERL_SUB_DEPTH_WARN
#define PERL_SUB_DEPTH_WARN 100
#endif

#endif /* PERL_CORE */

/* Maximum number of args that may be passed to an OP_MULTICONCAT op.
 * It determines the size of local arrays in S_maybe_multiconcat() and
 * pp_multiconcat().
 */
#define PERL_MULTICONCAT_MAXARG 64

/* The indexes of fields of a multiconcat aux struct.
 * The fixed fields are followed by nargs+1 const segment lengths,
 * and if utf8 and non-utf8 differ, a second nargs+1 set for utf8.
 */

#define PERL_MULTICONCAT_IX_NARGS     0 /* number of arguments */
#define PERL_MULTICONCAT_IX_PLAIN_PV  1 /* non-utf8 constant string */
#define PERL_MULTICONCAT_IX_PLAIN_LEN 2 /* non-utf8 constant string length */
#define PERL_MULTICONCAT_IX_UTF8_PV   3 /* utf8 constant string */
#define PERL_MULTICONCAT_IX_UTF8_LEN  4 /* utf8 constant string length */
#define PERL_MULTICONCAT_IX_LENGTHS   5 /* first of nargs+1 const segment lens */
#define PERL_MULTICONCAT_HEADER_SIZE 5 /* The number of fields of a
                                           multiconcat header */

/* We no longer default to creating a new SV for GvSV.
   Do this before embed.  */
#ifndef PERL_CREATE_GVSV
#  ifndef PERL_DONT_CREATE_GVSV
#    define PERL_DONT_CREATE_GVSV
#  endif
#endif

#if !defined(HAS_WAITPID) && !defined(HAS_WAIT4) || defined(HAS_WAITPID_RUNTIME)
#define PERL_USES_PL_PIDSTATUS
#endif

#if !defined(OS2) && !defined(WIN32)
#define PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION
#endif

#define MEM_SIZE Size_t

/* Round all values passed to malloc up, by default to a multiple of
   sizeof(size_t)
*/
#ifndef PERL_STRLEN_ROUNDUP_QUANTUM
#define PERL_STRLEN_ROUNDUP_QUANTUM Size_t_size
#endif

/* sv_grow() will expand strings by at least a certain percentage of
   the previously *used* length to avoid excessive calls to realloc().
   The default is 25% of the current length.
*/
#ifndef PERL_STRLEN_EXPAND_SHIFT
#  define PERL_STRLEN_EXPAND_SHIFT 2
#endif

/* This use of offsetof() requires /Zc:offsetof- for VS2017 (and presumably
 * onwards) when building Socket.xs, but we can just use a different definition
 * for STRUCT_OFFSET instead. */
#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1910
#  define STRUCT_OFFSET(s,m)  (Size_t)(&(((s *)0)->m))
#else
#  include <stddef.h>
#  define STRUCT_OFFSET(s,m)  offsetof(s,m)
#endif

/* ptrdiff_t is C11, so undef it under pedantic builds.  (Actually it is
 * in C89, but apparently there are platforms where it doesn't exist.  See
 * thread beginning at http://nntp.perl.org/group/perl.perl5.porters/251541.)
 * */
#ifdef PERL_GCC_PEDANTIC
#   undef HAS_PTRDIFF_T
#endif

#ifdef HAS_PTRDIFF_T
#  define Ptrdiff_t ptrdiff_t
#else
#  define Ptrdiff_t SSize_t
#endif

#  include <string.h>

/* This comes after <stdlib.h> so we don't try to change the standard
 * library prototypes; we'll use our own in proto.h instead. */

#ifdef MYMALLOC
#  ifdef PERL_POLLUTE_MALLOC
#   ifndef PERL_EXTMALLOC_DEF
#    define Perl_malloc		malloc
#    define Perl_calloc		calloc
#    define Perl_realloc	realloc
#    define Perl_mfree		free
#   endif
#  else
#    define EMBEDMYMALLOC	/* for compatibility */
#  endif

#  define safemalloc  Perl_malloc
#  define safecalloc  Perl_calloc
#  define saferealloc Perl_realloc
#  define safefree    Perl_mfree
#  define CHECK_MALLOC_TOO_LATE_FOR_(code)	STMT_START {		\
        if (!TAINTING_get && MallocCfg_ptr[MallocCfg_cfg_env_read])	\
                code;							\
    } STMT_END
#  define CHECK_MALLOC_TOO_LATE_FOR(ch)				\
        CHECK_MALLOC_TOO_LATE_FOR_(MALLOC_TOO_LATE_FOR(ch))
#  define panic_write2(s)		write(2, s, strlen(s))
#  define CHECK_MALLOC_TAINT(newval)				\
        CHECK_MALLOC_TOO_LATE_FOR_(				\
                if (newval) {					\
                  PERL_UNUSED_RESULT(panic_write2("panic: tainting with $ENV{PERL_MALLOC_OPT}\n"));\
                  exit(1); })
#  define MALLOC_CHECK_TAINT(argc,argv,env)	STMT_START {	\
        if (doing_taint(argc,argv,env)) {			\
                MallocCfg_ptr[MallocCfg_skip_cfg_env] = 1;	\
    }} STMT_END;
#else  /* MYMALLOC */
#  define safemalloc  safesysmalloc
#  define safecalloc  safesyscalloc
#  define saferealloc safesysrealloc
#  define safefree    safesysfree
#  define CHECK_MALLOC_TOO_LATE_FOR(ch)		((void)0)
#  define CHECK_MALLOC_TAINT(newval)		((void)0)
#  define MALLOC_CHECK_TAINT(argc,argv,env)
#endif /* MYMALLOC */

/* diag_listed_as: "-T" is on the #! line, it must also be used on the command line */
#define TOO_LATE_FOR_(ch,what)	Perl_croak(aTHX_ "\"-%c\" is on the #! line, it must also be used on the command line%s", (char)(ch), what)
#define TOO_LATE_FOR(ch)	TOO_LATE_FOR_(ch, "")
#define MALLOC_TOO_LATE_FOR(ch)	TOO_LATE_FOR_(ch, " with $ENV{PERL_MALLOC_OPT}")
#define MALLOC_CHECK_TAINT2(argc,argv)	MALLOC_CHECK_TAINT(argc,argv,NULL)

/*
=for apidoc Am|void|memzero|void * d|Size_t l
Set the C<l> bytes starting at C<*d> to all zeroes.

=cut
*/
#ifndef memzero
#   define memzero(d,l) memset(d,0,l)
#endif

#ifdef I_NETINET_IN
#   include <netinet/in.h>
#endif

#ifdef I_ARPA_INET
#   include <arpa/inet.h>
#endif

#ifdef I_SYS_STAT
#   include <sys/stat.h>
#endif

/* Microsoft VC's sys/stat.h defines all S_Ixxx macros except S_IFIFO.
   This definition should ideally go into win32/win32.h, but S_IFIFO is
   used later here in perl.h before win32/win32.h is being included. */
#if !defined(S_IFIFO) && defined(_S_IFIFO)
#   define S_IFIFO _S_IFIFO
#endif

/* The stat macros for Unisoft System V/88 (and derivatives
   like UTekV) are broken, sometimes giving false positives.  Undefine
   them here and let the code below set them to proper values.

   The ghs macro stands for GreenHills Software C-1.8.5 which
   is the C compiler for sysV88 and the various derivatives.
   This header file bug is corrected in gcc-2.5.8 and later versions.
   --Kaveh Ghazi (ghazi@noc.rutgers.edu) 10/3/94.  */

#if defined(m88k) && defined(ghs)
#   undef S_ISDIR
#   undef S_ISCHR
#   undef S_ISBLK
#   undef S_ISREG
#   undef S_ISFIFO
#   undef S_ISLNK
#endif

#include <time.h>

#ifdef I_SYS_TIME
#   ifdef I_SYS_TIME_KERNEL
#	define KERNEL
#   endif
#   include <sys/time.h>
#   ifdef I_SYS_TIME_KERNEL
#	undef KERNEL
#   endif
#endif

#if defined(HAS_TIMES) && defined(I_SYS_TIMES)
#    include <sys/times.h>
#endif

#include <errno.h>

#if defined(WIN32) && defined(PERL_IMPLICIT_SYS)
#  define WIN32SCK_IS_STDSCK		/* don't pull in custom wsock layer */
#endif

#if defined(HAS_SOCKET) && !defined(WIN32) /* WIN32 handles sockets via win32.h */
# include <sys/socket.h>
# if defined(USE_SOCKS) && defined(I_SOCKS)
#   if !defined(INCLUDE_PROTOTYPES)
#       define INCLUDE_PROTOTYPES /* for <socks.h> */
#       define PERL_SOCKS_NEED_PROTOTYPES
#   endif
#   include <socks.h>
#   ifdef PERL_SOCKS_NEED_PROTOTYPES /* keep cpp space clean */
#       undef INCLUDE_PROTOTYPES
#       undef PERL_SOCKS_NEED_PROTOTYPES
#   endif
# endif
# ifdef I_NETDB
#  include <netdb.h>
# endif
# ifndef ENOTSOCK
#  ifdef I_NET_ERRNO
#   include <net/errno.h>
#  endif
# endif
#endif

/* sockatmark() is so new (2001) that many places might have it hidden
 * behind some -D_BLAH_BLAH_SOURCE guard.  The __THROW magic is required
 * e.g. in Gentoo, see http://bugs.gentoo.org/show_bug.cgi?id=12605 */
#if defined(HAS_SOCKATMARK) && !defined(HAS_SOCKATMARK_PROTO)
# if defined(__THROW) && defined(__GLIBC__)
int sockatmark(int) __THROW;
# else
int sockatmark(int);
# endif
#endif

#if defined(__osf__) && defined(__cplusplus) && !defined(_XOPEN_SOURCE_EXTENDED) /* Tru64 "cxx" (C++), see hints/dec_osf.sh for why the _XOPEN_SOURCE_EXTENDED cannot be defined. */
EXTERN_C int fchdir(int);
EXTERN_C int flock(int, int);
EXTERN_C int fseeko(FILE *, off_t, int);
EXTERN_C off_t ftello(FILE *);
#endif

#if defined(__SUNPRO_CC) /* SUNWspro CC (C++) */
EXTERN_C char *crypt(const char *, const char *);
#endif

#if defined(__cplusplus) && defined(__CYGWIN__)
EXTERN_C char *crypt(const char *, const char *);
#endif

/*
=for apidoc_section $errno

=for apidoc m|void|SETERRNO|int errcode|int vmserrcode

Set C<errno>, and on VMS set C<vaxc$errno>.

=for apidoc mn|void|dSAVEDERRNO

Declare variables needed to save C<errno> and any operating system
specific error number.

=for apidoc mn|void|dSAVE_ERRNO

Declare variables needed to save C<errno> and any operating system
specific error number, and save them for optional later restoration
by C<RESTORE_ERRNO>.

=for apidoc mn|void|SAVE_ERRNO

Save C<errno> and any operating system specific error number for
optional later restoration by C<RESTORE_ERRNO>.  Requires
C<dSAVEDERRNO> or C<dSAVE_ERRNO> in scope.

=for apidoc mn|void|RESTORE_ERRNO

Restore C<errno> and any operating system specific error number that
was saved by C<dSAVE_ERRNO> or C<RESTORE_ERRNO>.

=cut
*/

#ifdef SETERRNO
# undef SETERRNO  /* SOCKS might have defined this */
#endif

#ifdef VMS
#   define SETERRNO(errcode,vmserrcode) \
        STMT_START {			\
            set_errno(errcode);		\
            set_vaxc_errno(vmserrcode);	\
        } STMT_END
#   define dSAVEDERRNO    int saved_errno; unsigned saved_vms_errno
#   define dSAVE_ERRNO    int saved_errno = errno; unsigned saved_vms_errno = vaxc$errno
#   define SAVE_ERRNO     ( saved_errno = errno, saved_vms_errno = vaxc$errno )
#   define RESTORE_ERRNO  SETERRNO(saved_errno, saved_vms_errno)

#   define LIB_INVARG 		LIB$_INVARG
#   define RMS_DIR    		RMS$_DIR
#   define RMS_FAC    		RMS$_FAC
#   define RMS_FEX    		RMS$_FEX
#   define RMS_FNF    		RMS$_FNF
#   define RMS_IFI    		RMS$_IFI
#   define RMS_ISI    		RMS$_ISI
#   define RMS_PRV    		RMS$_PRV
#   define SS_ACCVIO      	SS$_ACCVIO
#   define SS_DEVOFFLINE	SS$_DEVOFFLINE
#   define SS_IVCHAN  		SS$_IVCHAN
#   define SS_NORMAL  		SS$_NORMAL
#   define SS_NOPRIV  		SS$_NOPRIV
#   define SS_BUFFEROVF		SS$_BUFFEROVF
#else
#   define LIB_INVARG 		0
#   define RMS_DIR    		0
#   define RMS_FAC    		0
#   define RMS_FEX    		0
#   define RMS_FNF    		0
#   define RMS_IFI    		0
#   define RMS_ISI    		0
#   define RMS_PRV    		0
#   define SS_ACCVIO      	0
#   define SS_DEVOFFLINE	0
#   define SS_IVCHAN  		0
#   define SS_NORMAL  		0
#   define SS_NOPRIV  		0
#   define SS_BUFFEROVF		0
#endif

#ifdef WIN32
#   define dSAVEDERRNO  int saved_errno; DWORD saved_win32_errno
#   define dSAVE_ERRNO  int saved_errno = errno; DWORD saved_win32_errno = GetLastError()
#   define SAVE_ERRNO   ( saved_errno = errno, saved_win32_errno = GetLastError() )
#   define RESTORE_ERRNO ( errno = saved_errno, SetLastError(saved_win32_errno) )
#endif

#ifdef OS2
#   define dSAVEDERRNO  int saved_errno; unsigned long saved_os2_errno
#   define dSAVE_ERRNO  int saved_errno = errno; unsigned long saved_os2_errno = Perl_rc
#   define SAVE_ERRNO   ( saved_errno = errno, saved_os2_errno = Perl_rc )
#   define RESTORE_ERRNO ( errno = saved_errno, Perl_rc = saved_os2_errno )
#endif

#ifndef SETERRNO
#   define SETERRNO(errcode,vmserrcode) (errno = (errcode))
#endif

#ifndef dSAVEDERRNO
#   define dSAVEDERRNO    int saved_errno
#   define dSAVE_ERRNO    int saved_errno = errno
#   define SAVE_ERRNO     (saved_errno = errno)
#   define RESTORE_ERRNO  (errno = saved_errno)
#endif

/*
=for apidoc_section $warning

=for apidoc Amn|SV *|ERRSV

Returns the SV for C<$@>, creating it if needed.

=for apidoc Am|void|CLEAR_ERRSV

Clear the contents of C<$@>, setting it to the empty string.

This replaces any read-only SV with a fresh SV and removes any magic.

=for apidoc Am|void|SANE_ERRSV

Clean up ERRSV so we can safely set it.

This replaces any read-only SV with a fresh writable copy and removes
any magic.

=cut
*/

#define ERRSV GvSVn(PL_errgv)

/* contains inlined gv_add_by_type */
#define CLEAR_ERRSV() STMT_START {					\
    SV ** const svp = &GvSV(PL_errgv);					\
    if (!*svp) {							\
        *svp = newSVpvs("");                                            \
    } else if (SvREADONLY(*svp)) {					\
        SvREFCNT_dec_NN(*svp);						\
        *svp = newSVpvs("");						\
    } else {								\
        SV *const errsv = *svp;						\
        SvPVCLEAR(errsv);                                               \
        SvPOK_only(errsv);						\
        if (SvMAGICAL(errsv)) {						\
            mg_free(errsv);						\
        }								\
    }									\
    } STMT_END

/* contains inlined gv_add_by_type */
#define SANE_ERRSV() STMT_START {					\
    SV ** const svp = &GvSV(PL_errgv);					\
    if (!*svp) {							\
        *svp = newSVpvs("");                                            \
    } else if (SvREADONLY(*svp)) {					\
        SV *dupsv = newSVsv(*svp);					\
        SvREFCNT_dec_NN(*svp);						\
        *svp = dupsv;							\
    } else {								\
        SV *const errsv = *svp;						\
        if (SvMAGICAL(errsv)) {						\
            mg_free(errsv);						\
        }								\
    }									\
    } STMT_END


#ifdef PERL_CORE
# define DEFSV (0 + GvSVn(PL_defgv))
# define DEFSV_set(sv) \
    (SvREFCNT_dec(GvSV(PL_defgv)), GvSV(PL_defgv) = SvREFCNT_inc(sv))
# define SAVE_DEFSV                \
    (                               \
        save_gp(PL_defgv, 0),        \
        GvINTRO_off(PL_defgv),        \
        SAVEGENERICSV(GvSV(PL_defgv)), \
        GvSV(PL_defgv) = NULL           \
    )
#else
# define DEFSV GvSVn(PL_defgv)
# define DEFSV_set(sv) (GvSV(PL_defgv) = (sv))
# define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
#endif

/*
=for apidoc_section $SV
=for apidoc Amn|SV *|DEFSV
Returns the SV associated with C<$_>

=for apidoc Am|void|DEFSV_set|SV * sv
Associate C<sv> with C<$_>

=for apidoc Amn|void|SAVE_DEFSV
Localize C<$_>.  See L<perlguts/Localizing changes>.

=cut
*/

#ifndef errno
        extern int errno;     /* ANSI allows errno to be an lvalue expr.
                               * For example in multithreaded environments
                               * something like this might happen:
                               * extern int *_errno(void);
                               * #define errno (*_errno()) */
#endif

#define UNKNOWN_ERRNO_MSG "(unknown)"

#ifdef VMS
#define Strerror(e) strerror((e), vaxc$errno)
#else
#define Strerror(e) strerror(e)
#endif

#ifdef I_SYS_IOCTL
#   ifndef _IOCTL_
#	include <sys/ioctl.h>
#   endif
#endif

#if defined(mc300) || defined(mc500) || defined(mc700) || defined(mc6000)
#   ifdef HAS_SOCKETPAIR
#	undef HAS_SOCKETPAIR
#   endif
#   ifdef I_NDBM
#	undef I_NDBM
#   endif
#endif

#ifndef HAS_SOCKETPAIR
#   ifdef HAS_SOCKET
#	define socketpair Perl_my_socketpair
#   endif
#endif

#if INTSIZE == 2
#   define htoni htons
#   define ntohi ntohs
#else
#   define htoni htonl
#   define ntohi ntohl
#endif

/* Configure already sets Direntry_t */
#if defined(I_DIRENT)
#  include <dirent.h>
#elif defined(I_SYS_NDIR)
#  include <sys/ndir.h>
#elif defined(I_SYS_DIR)
#  include <sys/dir.h>
#endif

/*
 * The following gobbledygook brought to you on behalf of __STDC__.
 * (I could just use #ifndef __STDC__, but this is more bulletproof
 * in the face of half-implementations.)
 */

#if defined(I_SYSMODE)
#include <sys/mode.h>
#endif

#ifndef S_IFMT
#   ifdef _S_IFMT
#	define S_IFMT _S_IFMT
#   else
#	define S_IFMT 0170000
#   endif
#endif

#ifndef S_ISDIR
#   define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
#endif

#ifndef S_ISCHR
#   define S_ISCHR(m) ((m & S_IFMT) == S_IFCHR)
#endif

#ifndef S_ISBLK
#   ifdef S_IFBLK
#	define S_ISBLK(m) ((m & S_IFMT) == S_IFBLK)
#   else
#	define S_ISBLK(m) (0)
#   endif
#endif

#ifndef S_ISREG
#   define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
#endif

#ifndef S_ISFIFO
#   ifdef S_IFIFO
#	define S_ISFIFO(m) ((m & S_IFMT) == S_IFIFO)
#   else
#	define S_ISFIFO(m) (0)
#   endif
#endif

#ifndef S_ISLNK
#  ifdef _S_ISLNK
#    define S_ISLNK(m) _S_ISLNK(m)
#  elif defined(_S_IFLNK)
#    define S_ISLNK(m) ((m & S_IFMT) == _S_IFLNK)
#  elif defined(S_IFLNK)
#    define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
#  else
#    define S_ISLNK(m) (0)
#  endif
#endif

#ifndef S_ISSOCK
#  ifdef _S_ISSOCK
#    define S_ISSOCK(m) _S_ISSOCK(m)
#  elif defined(_S_IFSOCK)
#    define S_ISSOCK(m) ((m & S_IFMT) == _S_IFSOCK)
#  elif defined(S_IFSOCK)
#    define S_ISSOCK(m) ((m & S_IFMT) == S_IFSOCK)
#  else
#    define S_ISSOCK(m) (0)
#  endif
#endif

#ifndef S_IRUSR
#   ifdef S_IREAD
#	define S_IRUSR S_IREAD
#	define S_IWUSR S_IWRITE
#	define S_IXUSR S_IEXEC
#   else
#	define S_IRUSR 0400
#	define S_IWUSR 0200
#	define S_IXUSR 0100
#   endif
#endif

#ifndef S_IRGRP
#   ifdef S_IRUSR
#       define S_IRGRP (S_IRUSR>>3)
#       define S_IWGRP (S_IWUSR>>3)
#       define S_IXGRP (S_IXUSR>>3)
#   else
#       define S_IRGRP 0040
#       define S_IWGRP 0020
#       define S_IXGRP 0010
#   endif
#endif

#ifndef S_IROTH
#   ifdef S_IRUSR
#       define S_IROTH (S_IRUSR>>6)
#       define S_IWOTH (S_IWUSR>>6)
#       define S_IXOTH (S_IXUSR>>6)
#   else
#       define S_IROTH 0040
#       define S_IWOTH 0020
#       define S_IXOTH 0010
#   endif
#endif

#ifndef S_ISUID
#   define S_ISUID 04000
#endif

#ifndef S_ISGID
#   define S_ISGID 02000
#endif

#ifndef S_IRWXU
#   define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
#endif

#ifndef S_IRWXG
#   define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
#endif

#ifndef S_IRWXO
#   define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
#endif

/* Haiku R1 seems to define S_IREAD and S_IWRITE in <posix/fcntl.h>
 * which would get included through <sys/file.h >, but that is 3000
 * lines in the future.  --jhi */

#if !defined(S_IREAD) && !defined(__HAIKU__)
#   define S_IREAD S_IRUSR
#endif

#if !defined(S_IWRITE) && !defined(__HAIKU__)
#   define S_IWRITE S_IWUSR
#endif

#ifndef S_IEXEC
#   define S_IEXEC S_IXUSR
#endif

#if defined(cray) || defined(gould) || defined(i860) || defined(pyr)
#   define SLOPPYDIVIDE
#endif

#ifdef UV
#undef UV
#endif

/* This used to be conditionally defined based on whether we had a sprintf()
 * that correctly returns the string length (as required by C89), but we no
 * longer need that. XS modules can (and do) use this name, so it must remain
 * a part of the API that's visible to modules.

=for apidoc_section $string
=for apidoc ATmD|int|my_sprintf|NN char *buffer|NN const char *pat|...

Do NOT use this due to the possibility of overflowing C<buffer>.  Instead use
my_snprintf()

=cut
*/
#define my_sprintf sprintf

/*
 * If we have v?snprintf() and the C99 variadic macros, we can just
 * use just the v?snprintf().  It is nice to try to trap the buffer
 * overflow, however, so if we are DEBUGGING, and we cannot use the
 * gcc statement expressions, then use the function wrappers which try
 * to trap the overflow.  If we can use the gcc statement expressions,
 * we can try that even with the version that uses the C99 variadic
 * macros.
 */

/* Note that we do not check against snprintf()/vsnprintf() returning
 * negative values because that is non-standard behaviour and we use
 * snprintf/vsnprintf only iff HAS_VSNPRINTF has been defined, and
 * that should be true only if the snprintf()/vsnprintf() are true
 * to the standard. */

#define PERL_SNPRINTF_CHECK(len, max, api) STMT_START { if ((max) > 0 && (Size_t)len > (max)) Perl_croak_nocontext("panic: %s buffer overflow", STRINGIFY(api)); } STMT_END

#ifdef USE_QUADMATH
#  define my_snprintf Perl_my_snprintf
#  define PERL_MY_SNPRINTF_GUARDED
#elif defined(HAS_SNPRINTF) && defined(HAS_C99_VARIADIC_MACROS) && !(defined(DEBUGGING) && !defined(PERL_USE_GCC_BRACE_GROUPS)) && !defined(PERL_GCC_PEDANTIC)
#  ifdef PERL_USE_GCC_BRACE_GROUPS
#      define my_snprintf(buffer, max, ...) ({ int len = snprintf(buffer, max, __VA_ARGS__); PERL_SNPRINTF_CHECK(len, max, snprintf); len; })
#      define PERL_MY_SNPRINTF_GUARDED
#  else
#    define my_snprintf(buffer, max, ...) snprintf(buffer, max, __VA_ARGS__)
#  endif
#else
#  define my_snprintf  Perl_my_snprintf
#  define PERL_MY_SNPRINTF_GUARDED
#endif

/* There is no quadmath_vsnprintf, and therefore my_vsnprintf()
 * dies if called under USE_QUADMATH. */
#if defined(HAS_VSNPRINTF) && defined(HAS_C99_VARIADIC_MACROS) && !(defined(DEBUGGING) && !defined(PERL_USE_GCC_BRACE_GROUPS)) && !defined(PERL_GCC_PEDANTIC)
#  ifdef PERL_USE_GCC_BRACE_GROUPS
#      define my_vsnprintf(buffer, max, ...) ({ int len = vsnprintf(buffer, max, __VA_ARGS__); PERL_SNPRINTF_CHECK(len, max, vsnprintf); len; })
#      define PERL_MY_VSNPRINTF_GUARDED
#  else
#    define my_vsnprintf(buffer, max, ...) vsnprintf(buffer, max, __VA_ARGS__)
#  endif
#else
#  define my_vsnprintf Perl_my_vsnprintf
#  define PERL_MY_VSNPRINTF_GUARDED
#endif

/* You will definitely need to use the PERL_MY_SNPRINTF_POST_GUARD()
 * or PERL_MY_VSNPRINTF_POST_GUARD() if you otherwise decide to ignore
 * the result of my_snprintf() or my_vsnprintf().  (No, you should not
 * completely ignore it: otherwise you cannot know whether your output
 * was too long.)
 *
 * int len = my_sprintf(buf, max, ...);
 * PERL_MY_SNPRINTF_POST_GUARD(len, max);
 *
 * The trick is that in certain platforms [a] the my_sprintf() already
 * contains the sanity check, while in certain platforms [b] it needs
 * to be done as a separate step.  The POST_GUARD is that step-- in [a]
 * platforms the POST_GUARD actually does nothing since the check has
 * already been done.  Watch out for the max being the same in both calls.
 *
 * If you actually use the snprintf/vsnprintf return value already,
 * you assumedly are checking its validity somehow.  But you can
 * insert the POST_GUARD() also in that case. */

#ifndef PERL_MY_SNPRINTF_GUARDED
#  define PERL_MY_SNPRINTF_POST_GUARD(len, max) PERL_SNPRINTF_CHECK(len, max, snprintf)
#else
#  define PERL_MY_SNPRINTF_POST_GUARD(len, max) PERL_UNUSED_VAR(len)
#endif

#ifndef  PERL_MY_VSNPRINTF_GUARDED
#  define PERL_MY_VSNPRINTF_POST_GUARD(len, max) PERL_SNPRINTF_CHECK(len, max, vsnprintf)
#else
#  define PERL_MY_VSNPRINTF_POST_GUARD(len, max) PERL_UNUSED_VAR(len)
#endif

#ifdef HAS_STRLCAT
#  define my_strlcat    strlcat
#endif

#if defined(PERL_CORE) || defined(PERL_EXT)
#  ifdef HAS_MEMRCHR
#    define my_memrchr	memrchr
#  else
#    define my_memrchr	S_my_memrchr
#  endif
#endif

#ifdef HAS_STRLCPY
#  define my_strlcpy	strlcpy
#endif

#ifdef HAS_STRNLEN
#  define my_strnlen	strnlen
#endif

/*
    The IV type is supposed to be long enough to hold any integral
    value or a pointer.
    --Andy Dougherty	August 1996
*/

typedef IVTYPE IV;
typedef UVTYPE UV;

#if defined(USE_64_BIT_INT) && defined(HAS_QUAD)
#  if QUADKIND == QUAD_IS_INT64_T && defined(INT64_MAX)
#    define IV_MAX ((IV)INT64_MAX)
#    define IV_MIN ((IV)INT64_MIN)
#    define UV_MAX ((UV)UINT64_MAX)
#    ifndef UINT64_MIN
#      define UINT64_MIN 0
#    endif
#    define UV_MIN ((UV)UINT64_MIN)
#  else
#    define IV_MAX PERL_QUAD_MAX
#    define IV_MIN PERL_QUAD_MIN
#    define UV_MAX PERL_UQUAD_MAX
#    define UV_MIN PERL_UQUAD_MIN
#  endif
#  define IV_IS_QUAD
#  define UV_IS_QUAD
#else
#  if defined(INT32_MAX) && IVSIZE == 4
#    define IV_MAX ((IV)INT32_MAX)
#    define IV_MIN ((IV)INT32_MIN)
#    ifndef UINT32_MAX_BROKEN /* e.g. HP-UX with gcc messes this up */
#        define UV_MAX ((UV)UINT32_MAX)
#    else
#        define UV_MAX ((UV)4294967295U)
#    endif
#    ifndef UINT32_MIN
#      define UINT32_MIN 0
#    endif
#    define UV_MIN ((UV)UINT32_MIN)
#  else
#    define IV_MAX PERL_LONG_MAX
#    define IV_MIN PERL_LONG_MIN
#    define UV_MAX PERL_ULONG_MAX
#    define UV_MIN PERL_ULONG_MIN
#  endif
#  if IVSIZE == 8
#    define IV_IS_QUAD
#    define UV_IS_QUAD
#    ifndef HAS_QUAD
#      define HAS_QUAD
#    endif
#  else
#    undef IV_IS_QUAD
#    undef UV_IS_QUAD
#if !defined(PERL_CORE)
/* We think that removing this decade-old undef this will cause too much
   breakage on CPAN for too little gain. (See RT #119753)
   However, we do need HAS_QUAD in the core for use by the drand48 code. */
#    undef HAS_QUAD
#endif
#  endif
#endif

#define Size_t_MAX (~(Size_t)0)
#define SSize_t_MAX (SSize_t)(~(Size_t)0 >> 1)

#define IV_DIG (BIT_DIGITS(IVSIZE * 8))
#define UV_DIG (BIT_DIGITS(UVSIZE * 8))

#ifndef NO_PERL_PRESERVE_IVUV
#define PERL_PRESERVE_IVUV	/* We like our integers to stay integers. */
#endif

/*
 *  The macros INT2PTR and NUM2PTR are (despite their names)
 *  bi-directional: they will convert int/float to or from pointers.
 *  However the conversion to int/float are named explicitly:
 *  PTR2IV, PTR2UV, PTR2NV.
 *
 *  For int conversions we do not need two casts if pointers are
 *  the same size as IV and UV.   Otherwise we need an explicit
 *  cast (PTRV) to avoid compiler warnings.
 *
 *  These are mentioned in perlguts
 */
#if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
#  define PTRV			UV
#  define INT2PTR(any,d)	(any)(d)
#elif PTRSIZE == LONGSIZE
#  define PTRV			unsigned long
#  define PTR2ul(p)		(unsigned long)(p)
#else
#  define PTRV			unsigned
#endif

#ifndef INT2PTR
#  define INT2PTR(any,d)	(any)(PTRV)(d)
#endif

#ifndef PTR2ul
#  define PTR2ul(p)	INT2PTR(unsigned long,p)
#endif

/*
=for apidoc_section $casting
=for apidoc Cyh|type|NUM2PTR|type|int value
You probably want to be using L<C</INT2PTR>> instead.

=cut
*/

#define NUM2PTR(any,d)	(any)(PTRV)(d)
#define PTR2IV(p)	INT2PTR(IV,p)
#define PTR2UV(p)	INT2PTR(UV,p)
#define PTR2NV(p)	NUM2PTR(NV,p)
#define PTR2nat(p)	(PTRV)(p)	/* pointer to integer of PTRSIZE */

/* According to strict ANSI C89 one cannot freely cast between
 * data pointers and function (code) pointers.  There are at least
 * two ways around this.  One (used below) is to do two casts,
 * first the other pointer to an (unsigned) integer, and then
 * the integer to the other pointer.  The other way would be
 * to use unions to "overlay" the pointers.  For an example of
 * the latter technique, see union dirpu in struct xpvio in sv.h.
 * The only feasible use is probably temporarily storing
 * function pointers in a data pointer (such as a void pointer). */

#define DPTR2FPTR(t,p) ((t)PTR2nat(p))	/* data pointer to function pointer */
#define FPTR2DPTR(t,p) ((t)PTR2nat(p))	/* function pointer to data pointer */

#ifdef USE_LONG_DOUBLE
#  if LONG_DOUBLESIZE == DOUBLESIZE
#    define LONG_DOUBLE_EQUALS_DOUBLE
#    undef USE_LONG_DOUBLE /* Ouch! */
#  endif
#endif

/* The following is all to get LDBL_DIG, in order to pick a nice
   default value for printing floating point numbers in Gconvert.
   (see config.h)
*/
#ifndef HAS_LDBL_DIG
#  if LONG_DOUBLESIZE == 10
#    define LDBL_DIG 18 /* assume IEEE */
#  elif LONG_DOUBLESIZE == 12
#    define LDBL_DIG 18 /* gcc? */
#  elif LONG_DOUBLESIZE == 16
#    define LDBL_DIG 33 /* assume IEEE */
#  elif LONG_DOUBLESIZE == DOUBLESIZE
#    define LDBL_DIG DBL_DIG /* bummer */
#  endif
#endif

/* On MS Windows,with 64-bit mingw-w64 compilers, we
   need to attend to a __float128 alignment issue if
   USE_QUADMATH is defined. Otherwise we simply:
   typedef NVTYPE NV
   32-bit mingw.org compilers might also require
   aligned(32) - at least that's what I found with my
   Math::Foat128 module. But this is as yet untested
   here, so no allowance is being made for mingw.org
   compilers at this stage. -- sisyphus January 2021
*/
#if (defined(USE_LONG_DOUBLE) || defined(USE_QUADMATH)) && defined(__MINGW64__)
   /* 64-bit build, mingw-w64 compiler only */
   typedef NVTYPE NV __attribute__ ((aligned(8)));
#else
   typedef NVTYPE NV;
#endif

#ifdef I_IEEEFP
#   include <ieeefp.h>
#endif

#if defined(__DECC) && defined(__osf__)
/* Also Tru64 cc has broken NaN comparisons. */
#  define NAN_COMPARE_BROKEN
#endif
#if defined(__sgi)
#  define NAN_COMPARE_BROKEN
#endif

#ifdef USE_LONG_DOUBLE
#   ifdef I_SUNMATH
#       include <sunmath.h>
#   endif
#   if defined(LDBL_DIG)
#       define NV_DIG LDBL_DIG
#       ifdef LDBL_MANT_DIG
#           define NV_MANT_DIG LDBL_MANT_DIG
#       endif
#       ifdef LDBL_MIN
#           define NV_MIN LDBL_MIN
#       endif
#       ifdef LDBL_MAX
#           define NV_MAX LDBL_MAX
#       endif
#       ifdef LDBL_MIN_EXP
#           define NV_MIN_EXP LDBL_MIN_EXP
#       endif
#       ifdef LDBL_MAX_EXP
#           define NV_MAX_EXP LDBL_MAX_EXP
#       endif
#       ifdef LDBL_MIN_10_EXP
#           define NV_MIN_10_EXP LDBL_MIN_10_EXP
#       endif
#       ifdef LDBL_MAX_10_EXP
#           define NV_MAX_10_EXP LDBL_MAX_10_EXP
#       endif
#       ifdef LDBL_EPSILON
#           define NV_EPSILON LDBL_EPSILON
#       endif
#       ifdef LDBL_MAX
#           define NV_MAX LDBL_MAX
/* Having LDBL_MAX doesn't necessarily mean that we have LDBL_MIN... -Allen */
#       elif defined(HUGE_VALL)
#           define NV_MAX HUGE_VALL
#       endif
#   endif
#   if defined(HAS_SQRTL)
#       define Perl_acos acosl
#       define Perl_asin asinl
#       define Perl_atan atanl
#       define Perl_atan2 atan2l
#       define Perl_ceil ceill
#       define Perl_cos cosl
#       define Perl_cosh coshl
#       define Perl_exp expl
#       define Perl_fabs fabsl
#       define Perl_floor floorl
#       define Perl_fmod fmodl
#       define Perl_log logl
#       define Perl_log10 log10l
#       define Perl_pow powl
#       define Perl_sin sinl
#       define Perl_sinh sinhl
#       define Perl_sqrt sqrtl
#       define Perl_tan tanl
#       define Perl_tanh tanhl
#   endif
/* e.g. libsunmath doesn't have modfl and frexpl as of mid-March 2000 */
#   ifndef Perl_modf
#       ifdef HAS_MODFL
#           define Perl_modf(x,y) modfl(x,y)
/* eg glibc 2.2 series seems to provide modfl on ppc and arm, but has no
   prototype in <math.h> */
#           ifndef HAS_MODFL_PROTO
EXTERN_C long double modfl(long double, long double *);
#	    endif
#       elif (defined(HAS_TRUNCL) || defined(HAS_AINTL)) && defined(HAS_COPYSIGNL)
        extern long double Perl_my_modfl(long double x, long double *ip);
#           define Perl_modf(x,y) Perl_my_modfl(x,y)
#       endif
#   endif
#   ifndef Perl_frexp
#       ifdef HAS_FREXPL
#           define Perl_frexp(x,y) frexpl(x,y)
#       elif defined(HAS_ILOGBL) && defined(HAS_SCALBNL)
extern long double Perl_my_frexpl(long double x, int *e);
#           define Perl_frexp(x,y) Perl_my_frexpl(x,y)
#       endif
#   endif
#   ifndef Perl_ldexp
#       ifdef HAS_LDEXPL
#           define Perl_ldexp(x, y) ldexpl(x,y)
#       elif defined(HAS_SCALBNL) && FLT_RADIX == 2
#           define Perl_ldexp(x,y) scalbnl(x,y)
#       endif
#   endif
#   ifndef Perl_isnan
#       if defined(HAS_ISNANL) && !(defined(isnan) && defined(HAS_C99))
#           define Perl_isnan(x) isnanl(x)
#       elif defined(__sgi) && defined(__c99)  /* XXX Configure test needed */
#           define Perl_isnan(x) isnan(x)
#       endif
#   endif
#   ifndef Perl_isinf
#       if defined(HAS_ISINFL) && !(defined(isinf) && defined(HAS_C99))
#           define Perl_isinf(x) isinfl(x)
#       elif defined(__sgi) && defined(__c99)  /* XXX Configure test needed */
#           define Perl_isinf(x) isinf(x)
#       elif defined(LDBL_MAX) && !defined(NAN_COMPARE_BROKEN)
#           define Perl_isinf(x) ((x) > LDBL_MAX || (x) < -LDBL_MAX)
#       endif
#   endif
#   ifndef Perl_isfinite
#       define Perl_isfinite(x) Perl_isfinitel(x)
#   endif
#elif defined(USE_QUADMATH) && defined(I_QUADMATH)
#   include <quadmath.h>
#   define NV_DIG FLT128_DIG
#   define NV_MANT_DIG FLT128_MANT_DIG
#   define NV_MIN FLT128_MIN
#   define NV_MAX FLT128_MAX
#   define NV_MIN_EXP FLT128_MIN_EXP
#   define NV_MAX_EXP FLT128_MAX_EXP
#   define NV_EPSILON FLT128_EPSILON
#   define NV_MIN_10_EXP FLT128_MIN_10_EXP
#   define NV_MAX_10_EXP FLT128_MAX_10_EXP
#   define Perl_acos acosq
#   define Perl_asin asinq
#   define Perl_atan atanq
#   define Perl_atan2 atan2q
#   define Perl_ceil ceilq
#   define Perl_cos cosq
#   define Perl_cosh coshq
#   define Perl_exp expq
#   define Perl_fabs fabsq
#   define Perl_floor floorq
#   define Perl_fmod fmodq
#   define Perl_log logq
#   define Perl_log10 log10q
#   define Perl_signbit signbitq
#   define Perl_pow powq
#   define Perl_sin sinq
#   define Perl_sinh sinhq
#   define Perl_sqrt sqrtq
#   define Perl_tan tanq
#   define Perl_tanh tanhq
#   define Perl_modf(x,y) modfq(x,y)
#   define Perl_frexp(x,y) frexpq(x,y)
#   define Perl_ldexp(x, y) ldexpq(x,y)
#   define Perl_isinf(x) isinfq(x)
#   define Perl_isnan(x) isnanq(x)
#   define Perl_isfinite(x) !(isnanq(x) || isinfq(x))
#   define Perl_fp_class(x) ((x) == 0.0Q ? 0 : isinfq(x) ? 3 : isnanq(x) ? 4 : PERL_ABS(x) < FLT128_MIN ? 2 : 1)
#   define Perl_fp_class_inf(x)    (Perl_fp_class(x) == 3)
#   define Perl_fp_class_nan(x)    (Perl_fp_class(x) == 4)
#   define Perl_fp_class_norm(x)   (Perl_fp_class(x) == 1)
#   define Perl_fp_class_denorm(x) (Perl_fp_class(x) == 2)
#   define Perl_fp_class_zero(x)   (Perl_fp_class(x) == 0)
#else
#   define NV_DIG DBL_DIG
#   define NV_MANT_DIG DBL_MANT_DIG
#   define NV_MIN DBL_MIN
#   define NV_MAX DBL_MAX
#   define NV_MIN_EXP DBL_MIN_EXP
#   define NV_MAX_EXP DBL_MAX_EXP
#   define NV_MIN_10_EXP DBL_MIN_10_EXP
#   define NV_MAX_10_EXP DBL_MAX_10_EXP
#   define NV_EPSILON DBL_EPSILON
#   define NV_MAX DBL_MAX
#   define NV_MIN DBL_MIN

/* These math interfaces are C89. */
#   define Perl_acos acos
#   define Perl_asin asin
#   define Perl_atan atan
#   define Perl_atan2 atan2
#   define Perl_ceil ceil
#   define Perl_cos cos
#   define Perl_cosh cosh
#   define Perl_exp exp
#   define Perl_fabs fabs
#   define Perl_floor floor
#   define Perl_fmod fmod
#   define Perl_log log
#   define Perl_log10 log10
#   define Perl_pow pow
#   define Perl_sin sin
#   define Perl_sinh sinh
#   define Perl_sqrt sqrt
#   define Perl_tan tan
#   define Perl_tanh tanh

#   define Perl_modf(x,y) modf(x,y)
#   define Perl_frexp(x,y) frexp(x,y)
#   define Perl_ldexp(x,y) ldexp(x,y)

#   ifndef Perl_isnan
#       ifdef HAS_ISNAN
#           define Perl_isnan(x) isnan(x)
#       endif
#   endif
#   ifndef Perl_isinf
#       if defined(HAS_ISINF)
#           define Perl_isinf(x) isinf(x)
#       elif defined(DBL_MAX) && !defined(NAN_COMPARE_BROKEN)
#           define Perl_isinf(x) ((x) > DBL_MAX || (x) < -DBL_MAX)
#       endif
#   endif
#   ifndef Perl_isfinite
#     ifdef HAS_ISFINITE
#       define Perl_isfinite(x) isfinite(x)
#     elif defined(HAS_FINITE)
#       define Perl_isfinite(x) finite(x)
#     endif
#   endif
#endif

/* fpclassify(): C99.  It is supposed to be a macro that switches on
* the sizeof() of its argument, so there's no need for e.g. fpclassifyl().*/
#if !defined(Perl_fp_class) && defined(HAS_FPCLASSIFY)
#    include <math.h>
#    if defined(FP_INFINITE) && defined(FP_NAN)
#        define Perl_fp_class(x)	fpclassify(x)
#        define Perl_fp_class_inf(x)	(Perl_fp_class(x)==FP_INFINITE)
#        define Perl_fp_class_nan(x)	(Perl_fp_class(x)==FP_NAN)
#        define Perl_fp_class_norm(x)	(Perl_fp_class(x)==FP_NORMAL)
#        define Perl_fp_class_denorm(x)	(Perl_fp_class(x)==FP_SUBNORMAL)
#        define Perl_fp_class_zero(x)	(Perl_fp_class(x)==FP_ZERO)
#    elif defined(FP_PLUS_INF) && defined(FP_QNAN)
/* Some versions of HP-UX (10.20) have (only) fpclassify() but which is
 * actually not the C99 fpclassify, with its own set of return defines. */
#        define Perl_fp_class(x)	fpclassify(x)
#        define Perl_fp_class_pinf(x)	(Perl_fp_class(x)==FP_PLUS_INF)
#        define Perl_fp_class_ninf(x)	(Perl_fp_class(x)==FP_MINUS_INF)
#        define Perl_fp_class_snan(x)	(Perl_fp_class(x)==FP_SNAN)
#        define Perl_fp_class_qnan(x)	(Perl_fp_class(x)==FP_QNAN)
#        define Perl_fp_class_pnorm(x)	(Perl_fp_class(x)==FP_PLUS_NORM)
#        define Perl_fp_class_nnorm(x)	(Perl_fp_class(x)==FP_MINUS_NORM)
#        define Perl_fp_class_pdenorm(x)	(Perl_fp_class(x)==FP_PLUS_DENORM)
#        define Perl_fp_class_ndenorm(x)	(Perl_fp_class(x)==FP_MINUS_DENORM)
#        define Perl_fp_class_pzero(x)	(Perl_fp_class(x)==FP_PLUS_ZERO)
#        define Perl_fp_class_nzero(x)	(Perl_fp_class(x)==FP_MINUS_ZERO)
#    else
#        undef Perl_fp_class /* Unknown set of defines */
#    endif
#endif

/* fp_classify(): Legacy: VMS, maybe Unicos? The values, however,
 * are identical to the C99 fpclassify(). */
#if !defined(Perl_fp_class) && defined(HAS_FP_CLASSIFY)
#    include <math.h>
#    ifdef __VMS
     /* FP_INFINITE and others are here rather than in math.h as C99 stipulates */
#        include <fp.h>
     /* oh, and the isnormal macro has a typo in it! */
#    undef isnormal
#    define isnormal(x) Perl_fp_class_norm(x)
#    endif
#    if defined(FP_INFINITE) && defined(FP_NAN)
#        define Perl_fp_class(x)	fp_classify(x)
#        define Perl_fp_class_inf(x)	(Perl_fp_class(x)==FP_INFINITE)
#        define Perl_fp_class_nan(x)	(Perl_fp_class(x)==FP_NAN)
#        define Perl_fp_class_norm(x)	(Perl_fp_class(x)==FP_NORMAL)
#        define Perl_fp_class_denorm(x)	(Perl_fp_class(x)==FP_SUBNORMAL)
#        define Perl_fp_class_zero(x)	(Perl_fp_class(x)==FP_ZERO)
#    else
#        undef Perl_fp_class /* Unknown set of defines */
#    endif
#endif

/* Feel free to check with me for the SGI manpages, SGI testing,
 * etcetera, if you want to try getting this to work with IRIX.
 *
 * - Allen <allens@cpan.org> */

/* fpclass(): SysV, at least Solaris and some versions of IRIX. */
#if !defined(Perl_fp_class) && (defined(HAS_FPCLASS)||defined(HAS_FPCLASSL))
/* Solaris and IRIX have fpclass/fpclassl, but they are using
 * an enum typedef, not cpp symbols, and Configure doesn't detect that.
 * Define some symbols also as cpp symbols so we can detect them. */
#    if defined(__sun) || defined(__sgi) /* XXX Configure test instead */
#     define FP_PINF FP_PINF
#     define FP_QNAN FP_QNAN
#    endif
#    include <math.h>
#    ifdef I_IEEEFP
#        include <ieeefp.h>
#    endif
#    ifdef I_FP
#        include <fp.h>
#    endif
#    if defined(USE_LONG_DOUBLE) && defined(HAS_FPCLASSL)
#        define Perl_fp_class(x)	fpclassl(x)
#    else
#        define Perl_fp_class(x)	fpclass(x)
#    endif
#    if defined(FP_CLASS_PINF) && defined(FP_CLASS_SNAN)
#        define Perl_fp_class_snan(x)	(Perl_fp_class(x)==FP_CLASS_SNAN)
#        define Perl_fp_class_qnan(x)	(Perl_fp_class(x)==FP_CLASS_QNAN)
#        define Perl_fp_class_ninf(x)	(Perl_fp_class(x)==FP_CLASS_NINF)
#        define Perl_fp_class_pinf(x)	(Perl_fp_class(x)==FP_CLASS_PINF)
#        define Perl_fp_class_nnorm(x)	(Perl_fp_class(x)==FP_CLASS_NNORM)
#        define Perl_fp_class_pnorm(x)	(Perl_fp_class(x)==FP_CLASS_PNORM)
#        define Perl_fp_class_ndenorm(x)	(Perl_fp_class(x)==FP_CLASS_NDENORM)
#        define Perl_fp_class_pdenorm(x)	(Perl_fp_class(x)==FP_CLASS_PDENORM)
#        define Perl_fp_class_nzero(x)	(Perl_fp_class(x)==FP_CLASS_NZERO)
#        define Perl_fp_class_pzero(x)	(Perl_fp_class(x)==FP_CLASS_PZERO)
#    elif defined(FP_PINF) && defined(FP_QNAN)
#        define Perl_fp_class_snan(x)	(Perl_fp_class(x)==FP_SNAN)
#        define Perl_fp_class_qnan(x)	(Perl_fp_class(x)==FP_QNAN)
#        define Perl_fp_class_ninf(x)	(Perl_fp_class(x)==FP_NINF)
#        define Perl_fp_class_pinf(x)	(Perl_fp_class(x)==FP_PINF)
#        define Perl_fp_class_nnorm(x)	(Perl_fp_class(x)==FP_NNORM)
#        define Perl_fp_class_pnorm(x)	(Perl_fp_class(x)==FP_PNORM)
#        define Perl_fp_class_ndenorm(x)	(Perl_fp_class(x)==FP_NDENORM)
#        define Perl_fp_class_pdenorm(x)	(Perl_fp_class(x)==FP_PDENORM)
#        define Perl_fp_class_nzero(x)	(Perl_fp_class(x)==FP_NZERO)
#        define Perl_fp_class_pzero(x)	(Perl_fp_class(x)==FP_PZERO)
#    else
#        undef Perl_fp_class /* Unknown set of defines */
#    endif
#endif

/* fp_class(): Legacy: at least Tru64, some versions of IRIX. */
#if !defined(Perl_fp_class) && (defined(HAS_FP_CLASS)||defined(HAS_FP_CLASSL))
#    include <math.h>
#    if !defined(FP_SNAN) && defined(I_FP_CLASS)
#        include <fp_class.h>
#    endif
#    if defined(FP_POS_INF) && defined(FP_QNAN)
#        ifdef __sgi /* XXX Configure test instead */
#            ifdef USE_LONG_DOUBLE
#                define Perl_fp_class(x)	fp_class_l(x)
#            else
#                define Perl_fp_class(x)	fp_class_d(x)
#            endif
#        else
#            if defined(USE_LONG_DOUBLE) && defined(HAS_FP_CLASSL)
#                define Perl_fp_class(x)	fp_classl(x)
#            else
#                define Perl_fp_class(x)	fp_class(x)
#            endif
#        endif
#        if defined(FP_POS_INF) && defined(FP_QNAN)
#            define Perl_fp_class_snan(x)	(Perl_fp_class(x)==FP_SNAN)
#            define Perl_fp_class_qnan(x)	(Perl_fp_class(x)==FP_QNAN)
#            define Perl_fp_class_ninf(x)	(Perl_fp_class(x)==FP_NEG_INF)
#            define Perl_fp_class_pinf(x)	(Perl_fp_class(x)==FP_POS_INF)
#            define Perl_fp_class_nnorm(x)	(Perl_fp_class(x)==FP_NEG_NORM)
#            define Perl_fp_class_pnorm(x)	(Perl_fp_class(x)==FP_POS_NORM)
#            define Perl_fp_class_ndenorm(x)	(Perl_fp_class(x)==FP_NEG_DENORM)
#            define Perl_fp_class_pdenorm(x)	(Perl_fp_class(x)==FP_POS_DENORM)
#            define Perl_fp_class_nzero(x)	(Perl_fp_class(x)==FP_NEG_ZERO)
#            define Perl_fp_class_pzero(x)	(Perl_fp_class(x)==FP_POS_ZERO)
#        else
#            undef Perl_fp_class /* Unknown set of defines */
#        endif
#    endif
#endif

/* class(), _class(): Legacy: AIX. */
#if !defined(Perl_fp_class) && defined(HAS_CLASS)
#    include <math.h>
#    if defined(FP_PLUS_NORM) && defined(FP_PLUS_INF)
#        ifndef _cplusplus
#            define Perl_fp_class(x)	class(x)
#        else
#            define Perl_fp_class(x)	_class(x)
#        endif
#        if defined(FP_PLUS_INF) && defined(FP_NANQ)
#            define Perl_fp_class_snan(x)	(Perl_fp_class(x)==FP_NANS)
#            define Perl_fp_class_qnan(x)	(Perl_fp_class(x)==FP_NANQ)
#            define Perl_fp_class_ninf(x)	(Perl_fp_class(x)==FP_MINUS_INF)
#            define Perl_fp_class_pinf(x)	(Perl_fp_class(x)==FP_PLUS_INF)
#            define Perl_fp_class_nnorm(x)	(Perl_fp_class(x)==FP_MINUS_NORM)
#            define Perl_fp_class_pnorm(x)	(Perl_fp_class(x)==FP_PLUS_NORM)
#            define Perl_fp_class_ndenorm(x)	(Perl_fp_class(x)==FP_MINUS_DENORM)
#            define Perl_fp_class_pdenorm(x)	(Perl_fp_class(x)==FP_PLUS_DENORM)
#            define Perl_fp_class_nzero(x)	(Perl_fp_class(x)==FP_MINUS_ZERO)
#            define Perl_fp_class_pzero(x)	(Perl_fp_class(x)==FP_PLUS_ZERO)
#        else
#            undef Perl_fp_class /* Unknown set of defines */
#        endif
#    endif
#endif

/* Win32: _fpclass(), _isnan(), _finite(). */
#ifdef _MSC_VER
#  ifndef Perl_isnan
#    define Perl_isnan(x) _isnan(x)
#  endif
#  ifndef Perl_isfinite
#    define Perl_isfinite(x) _finite(x)
#  endif
#  ifndef Perl_fp_class_snan
/* No simple way to #define Perl_fp_class because _fpclass()
 * returns a set of bits. */
#    define Perl_fp_class_snan(x) (_fpclass(x) & _FPCLASS_SNAN)
#    define Perl_fp_class_qnan(x) (_fpclass(x) & _FPCLASS_QNAN)
#    define Perl_fp_class_nan(x) (_fpclass(x) & (_FPCLASS_SNAN|_FPCLASS_QNAN))
#    define Perl_fp_class_ninf(x) (_fpclass(x) & _FPCLASS_NINF)
#    define Perl_fp_class_pinf(x) (_fpclass(x) & _FPCLASS_PINF)
#    define Perl_fp_class_inf(x) (_fpclass(x) & (_FPCLASS_NINF|_FPCLASS_PINF))
#    define Perl_fp_class_nnorm(x) (_fpclass(x) & _FPCLASS_NN)
#    define Perl_fp_class_pnorm(x) (_fpclass(x) & _FPCLASS_PN)
#    define Perl_fp_class_norm(x) (_fpclass(x) & (_FPCLASS_NN|_FPCLASS_PN))
#    define Perl_fp_class_ndenorm(x) (_fpclass(x) & _FPCLASS_ND)
#    define Perl_fp_class_pdenorm(x) (_fpclass(x) & _FPCLASS_PD)
#    define Perl_fp_class_denorm(x) (_fpclass(x) & (_FPCLASS_ND|_FPCLASS_PD))
#    define Perl_fp_class_nzero(x) (_fpclass(x) & _FPCLASS_NZ)
#    define Perl_fp_class_pzero(x) (_fpclass(x) & _FPCLASS_PZ)
#    define Perl_fp_class_zero(x) (_fpclass(x) & (_FPCLASS_NZ|_FPCLASS_PZ))
#  endif
#endif

#if !defined(Perl_fp_class_inf) && \
  defined(Perl_fp_class_pinf) && defined(Perl_fp_class_ninf)
#  define Perl_fp_class_inf(x) \
    (Perl_fp_class_pinf(x) || Perl_fp_class_ninf(x))
#endif

#if !defined(Perl_fp_class_nan) && \
  defined(Perl_fp_class_snan) && defined(Perl_fp_class_qnan)
#  define Perl_fp_class_nan(x) \
    (Perl_fp_class_snan(x) || Perl_fp_class_qnan(x))
#endif

#if !defined(Perl_fp_class_zero) && \
  defined(Perl_fp_class_pzero) && defined(Perl_fp_class_nzero)
#  define Perl_fp_class_zero(x) \
    (Perl_fp_class_pzero(x) || Perl_fp_class_nzero(x))
#endif

#if !defined(Perl_fp_class_norm) && \
  defined(Perl_fp_class_pnorm) && defined(Perl_fp_class_nnorm)
#  define Perl_fp_class_norm(x) \
    (Perl_fp_class_pnorm(x) || Perl_fp_class_nnorm(x))
#endif

#if !defined(Perl_fp_class_denorm) && \
  defined(Perl_fp_class_pdenorm) && defined(Perl_fp_class_ndenorm)
#  define Perl_fp_class_denorm(x) \
    (Perl_fp_class_pdenorm(x) || Perl_fp_class_ndenorm(x))
#endif

#ifndef Perl_isnan
#   ifdef Perl_fp_class_nan
#       define Perl_isnan(x) Perl_fp_class_nan(x)
#   elif defined(HAS_UNORDERED)
#       define Perl_isnan(x) unordered((x), 0.0)
#   else
#       define Perl_isnan(x) ((x)!=(x))
#   endif
#endif

#ifndef Perl_isinf
#   ifdef Perl_fp_class_inf
#       define Perl_isinf(x) Perl_fp_class_inf(x)
#   endif
#endif

#ifndef Perl_isfinite
#   if defined(HAS_ISFINITE) && !defined(isfinite)
#     define Perl_isfinite(x) isfinite((double)(x))
#   elif defined(HAS_FINITE)
#       define Perl_isfinite(x) finite((double)(x))
#   elif defined(Perl_fp_class_finite)
#     define Perl_isfinite(x) Perl_fp_class_finite(x)
#   else
/* For the infinities the multiplication returns nan,
 * for the nan the multiplication also returns nan,
 * for everything else (that is, finite) zero should be returned. */
#     define Perl_isfinite(x) (((x) * 0) == 0)
#   endif
#endif

#ifndef Perl_isinf
#   if defined(Perl_isfinite) && defined(Perl_isnan)
#       define Perl_isinf(x) !(Perl_isfinite(x)||Perl_isnan(x))
#   endif
#endif

/* We need Perl_isfinitel (ends with ell) (if available) even when
 * not USE_LONG_DOUBLE because the printf code (sv_catpvfn_flags)
 * needs that. */
#if defined(HAS_LONG_DOUBLE) && !defined(Perl_isfinitel)
/* If isfinite() is a macro and looks like we have C99,
 * we assume it's the type-aware C99 isfinite(). */
#    if defined(HAS_ISFINITE) && defined(isfinite) && defined(HAS_C99)
#        define Perl_isfinitel(x) isfinite(x)
#    elif defined(HAS_ISFINITEL)
#        define Perl_isfinitel(x) isfinitel(x)
#    elif defined(HAS_FINITEL)
#        define Perl_isfinitel(x) finitel(x)
#    elif defined(HAS_ISINFL) && defined(HAS_ISNANL)
#        define Perl_isfinitel(x) !(isinfl(x)||isnanl(x))
#    else
#        define Perl_isfinitel(x) ((x) * 0 == 0)  /* See Perl_isfinite. */
#    endif
#endif

/* The default is to use Perl's own atof() implementation (in numeric.c).
 * Usually that is the one to use but for some platforms (e.g. UNICOS)
 * it is however best to use the native implementation of atof.
 * You can experiment with using your native one by -DUSE_PERL_ATOF=0.
 * Some good tests to try out with either setting are t/base/num.t,
 * t/op/numconvert.t, and t/op/pack.t. Note that if using long doubles
 * you may need to be using a different function than atof! */

#ifndef USE_PERL_ATOF
#   ifndef _UNICOS
#       define USE_PERL_ATOF
#   endif
#else
#   if USE_PERL_ATOF == 0
#       undef USE_PERL_ATOF
#   endif
#endif

#ifdef USE_PERL_ATOF
#   define Perl_atof(s) Perl_my_atof(s)
#   define Perl_atof2(s, n) Perl_my_atof3(aTHX_ (s), &(n), 0)
#else
#   define Perl_atof(s) (NV)atof(s)
#   define Perl_atof2(s, n) ((n) = atof(s))
#endif
#define my_atof2(a,b) my_atof3(a,b,0)

/*
=for apidoc_section $numeric
=for apidoc   AmT|NV|Perl_acos|NV x
=for apidoc_item |NV|Perl_asin|NV x
=for apidoc_item |NV|Perl_atan|NV x
=for apidoc_item |NV|Perl_atan2|NV x|NV y
=for apidoc_item |NV|Perl_ceil|NV x
=for apidoc_item |NV|Perl_cos|NV x
=for apidoc_item |NV|Perl_cosh|NV x
=for apidoc_item |NV|Perl_exp|NV x
=for apidoc_item |NV|Perl_floor|NV x
=for apidoc_item |NV|Perl_fmod|NV x|NV y
=for apidoc_item |NV|Perl_frexp|NV x|int *exp
=for apidoc_item |IV|Perl_isfinite|NV x
=for apidoc_item |IV|Perl_isinf|NV x
=for apidoc_item |IV|Perl_isnan|NV x
=for apidoc_item |NV|Perl_ldexp|NV x|int exp
=for apidoc_item |NV|Perl_log|NV x
=for apidoc_item |NV|Perl_log10|NV x
=for apidoc_item |NV|Perl_modf|NV x|NV *iptr
=for apidoc_item |NV|Perl_pow|NV x|NV y
=for apidoc_item |NV|Perl_sin|NV x
=for apidoc_item |NV|Perl_sinh|NV x
=for apidoc_item |NV|Perl_sqrt|NV x
=for apidoc_item |NV|Perl_tan|NV x
=for apidoc_item |NV|Perl_tanh|NV x

These perform the corresponding mathematical operation on the operand(s), using
the libc function designed for the task that has just enough precision for an
NV on this platform.  If no such function with sufficient precision exists,
the highest precision one available is used.

=cut
*/

/*
 * CHAR_MIN and CHAR_MAX are not included here, as the (char) type may be
 * ambiguous. It may be equivalent to (signed char) or (unsigned char)
 * depending on local options. Until Configure detects this (or at least
 * detects whether the "signed" keyword is available) the CHAR ranges
 * will not be included. UCHAR functions normally.
 *                                                           - kja
 */

#define PERL_UCHAR_MIN ((unsigned char)0)
#define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)

#define PERL_USHORT_MIN ((unsigned short)0)
#define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)

#define PERL_SHORT_MAX ((short)SHRT_MAX)
#define PERL_SHORT_MIN ((short)SHRT_MIN)

#define PERL_UINT_MAX ((unsigned int)UINT_MAX)
#define PERL_UINT_MIN ((unsigned int)0)

#define PERL_INT_MAX ((int)INT_MAX)
#define PERL_INT_MIN ((int)INT_MIN)

#define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
#define PERL_ULONG_MIN ((unsigned long)0L)

#define PERL_LONG_MAX ((long)LONG_MAX)
#define PERL_LONG_MIN ((long)LONG_MIN)

#ifdef UV_IS_QUAD
#    define PERL_UQUAD_MAX	(~(UV)0)
#    define PERL_UQUAD_MIN	((UV)0)
#    define PERL_QUAD_MAX 	((IV) (PERL_UQUAD_MAX >> 1))
#    define PERL_QUAD_MIN 	(-PERL_QUAD_MAX - ((3 & -1) == 3))
#endif

/*
=for apidoc_section $integer

=for apidoc AmnU||PERL_INT_MAX
=for apidoc_item ||PERL_INT_MIN
=for apidoc_item ||PERL_LONG_MAX
=for apidoc_item ||PERL_LONG_MIN
=for apidoc_item ||PERL_SHORT_MAX
=for apidoc_item ||PERL_SHORT_MIN
=for apidoc_item ||PERL_UCHAR_MAX
=for apidoc_item ||PERL_UCHAR_MIN
=for apidoc_item ||PERL_UINT_MAX
=for apidoc_item ||PERL_UINT_MIN
=for apidoc_item ||PERL_ULONG_MAX
=for apidoc_item ||PERL_ULONG_MIN
=for apidoc_item ||PERL_USHORT_MAX
=for apidoc_item ||PERL_USHORT_MIN
=for apidoc_item ||PERL_QUAD_MAX
=for apidoc_item ||PERL_QUAD_MIN
=for apidoc_item ||PERL_UQUAD_MAX
=for apidoc_item ||PERL_UQUAD_MIN

These give the largest and smallest number representable in the current
platform in variables of the corresponding types.

For signed types, the smallest representable number is the most negative
number, the one furthest away from zero.

For C99 and later compilers, these correspond to things like C<INT_MAX>, which
are available to the C code.  But these constants, furnished by Perl,
allow code compiled on earlier compilers to portably have access to the same
constants.

=cut

*/

typedef MEM_SIZE STRLEN;

typedef struct op OP;
typedef struct cop COP;
typedef struct unop UNOP;
typedef struct unop_aux UNOP_AUX;
typedef struct binop BINOP;
typedef struct listop LISTOP;
typedef struct logop LOGOP;
typedef struct pmop PMOP;
typedef struct svop SVOP;
typedef struct padop PADOP;
typedef struct pvop PVOP;
typedef struct loop LOOP;
typedef struct methop METHOP;

#ifdef PERL_CORE
typedef struct opslab OPSLAB;
typedef struct opslot OPSLOT;
#endif

typedef struct block_hooks BHK;
typedef struct custom_op XOP;

typedef struct interpreter PerlInterpreter;

/* SGI's <sys/sema.h> has struct sv */
#if defined(__sgi)
#   define STRUCT_SV perl_sv
#else
#   define STRUCT_SV sv
#endif
typedef struct STRUCT_SV SV;
typedef struct av AV;
typedef struct hv HV;
typedef struct cv CV;
typedef struct p5rx REGEXP;
typedef struct gp GP;
typedef struct gv GV;
typedef struct io IO;
typedef struct context PERL_CONTEXT;
typedef struct block BLOCK;
typedef struct invlist INVLIST;

typedef struct magic MAGIC;
typedef struct xpv XPV;
typedef struct xpviv XPVIV;
typedef struct xpvuv XPVUV;
typedef struct xpvnv XPVNV;
typedef struct xpvmg XPVMG;
typedef struct xpvlv XPVLV;
typedef struct xpvinvlist XINVLIST;
typedef struct xpvav XPVAV;
typedef struct xpvhv XPVHV;
typedef struct xpvgv XPVGV;
typedef struct xpvcv XPVCV;
typedef struct xpvbm XPVBM;
typedef struct xpvfm XPVFM;
typedef struct xpvio XPVIO;
typedef struct mgvtbl MGVTBL;
typedef union any ANY;
typedef struct ptr_tbl_ent PTR_TBL_ENT_t;
typedef struct ptr_tbl PTR_TBL_t;
typedef struct clone_params CLONE_PARAMS;

/* a pad is currently just an AV; but that might change,
 * so hide the type.  */
typedef struct padlist PADLIST;
typedef AV PAD;
typedef struct padnamelist PADNAMELIST;
typedef struct padname PADNAME;

/* always enable PERL_OP_PARENT  */
#if !defined(PERL_OP_PARENT)
#  define PERL_OP_PARENT
#endif

/* enable PERL_COPY_ON_WRITE by default */
#if !defined(PERL_COPY_ON_WRITE) && !defined(PERL_NO_COW)
#  define PERL_COPY_ON_WRITE
#endif

#ifdef PERL_COPY_ON_WRITE
#  define PERL_ANY_COW
#else
# define PERL_SAWAMPERSAND
#endif

#if defined(PERL_DEBUG_READONLY_OPS) && !defined(USE_ITHREADS)
# error PERL_DEBUG_READONLY_OPS only works with ithreads
#endif

#include "handy.h"
#include "charclass_invlists.h"

#if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_RAWIO)
#   if LSEEKSIZE == 8 && !defined(USE_64_BIT_RAWIO)
#       define USE_64_BIT_RAWIO	/* implicit */
#   endif
#endif

/* Notice the use of HAS_FSEEKO: now we are obligated to always use
 * fseeko/ftello if possible.  Don't go #defining ftell to ftello yourself,
 * however, because operating systems like to do that themself. */
#ifndef FSEEKSIZE
#   ifdef HAS_FSEEKO
#       define FSEEKSIZE LSEEKSIZE
#   else
#       define FSEEKSIZE LONGSIZE
#   endif
#endif

#if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_STDIO)
#   if FSEEKSIZE == 8 && !defined(USE_64_BIT_STDIO)
#       define USE_64_BIT_STDIO /* implicit */
#   endif
#endif

#ifdef USE_64_BIT_RAWIO
#   ifdef HAS_OFF64_T
#       undef Off_t
#       define Off_t off64_t
#       undef LSEEKSIZE
#       define LSEEKSIZE 8
#   endif
/* Most 64-bit environments have defines like _LARGEFILE_SOURCE that
 * will trigger defines like the ones below.  Some 64-bit environments,
 * however, do not.  Therefore we have to explicitly mix and match. */
#   if defined(USE_OPEN64)
#       define open open64
#   endif
#   if defined(USE_LSEEK64)
#       define lseek lseek64
#   else
#       if defined(USE_LLSEEK)
#           define lseek llseek
#       endif
#   endif
#   if defined(USE_STAT64)
#       define stat stat64
#   endif
#   if defined(USE_FSTAT64)
#       define fstat fstat64
#   endif
#   if defined(USE_LSTAT64)
#       define lstat lstat64
#   endif
#   if defined(USE_FLOCK64)
#       define flock flock64
#   endif
#   if defined(USE_LOCKF64)
#       define lockf lockf64
#   endif
#   if defined(USE_FCNTL64)
#       define fcntl fcntl64
#   endif
#   if defined(USE_TRUNCATE64)
#       define truncate truncate64
#   endif
#   if defined(USE_FTRUNCATE64)
#       define ftruncate ftruncate64
#   endif
#endif

#ifdef USE_64_BIT_STDIO
#   ifdef HAS_FPOS64_T
#       undef Fpos_t
#       define Fpos_t fpos64_t
#   endif
/* Most 64-bit environments have defines like _LARGEFILE_SOURCE that
 * will trigger defines like the ones below.  Some 64-bit environments,
 * however, do not. */
#   if defined(USE_FOPEN64)
#       define fopen fopen64
#   endif
#   if defined(USE_FSEEK64)
#       define fseek fseek64 /* don't do fseeko here, see perlio.c */
#   endif
#   if defined(USE_FTELL64)
#       define ftell ftell64 /* don't do ftello here, see perlio.c */
#   endif
#   if defined(USE_FSETPOS64)
#       define fsetpos fsetpos64
#   endif
#   if defined(USE_FGETPOS64)
#       define fgetpos fgetpos64
#   endif
#   if defined(USE_TMPFILE64)
#       define tmpfile tmpfile64
#   endif
#   if defined(USE_FREOPEN64)
#       define freopen freopen64
#   endif
#endif

#if defined(OS2)
#  include "iperlsys.h"
#endif

#ifdef DOSISH
#   if defined(OS2)
#       include "os2ish.h"
#   else
#       include "dosish.h"
#   endif
#elif defined(VMS)
#   include "vmsish.h"
#elif defined(PLAN9)
#   include "./plan9/plan9ish.h"
#elif defined(__VOS__)
#   ifdef __GNUC__
#     include "./vos/vosish.h"
#   else
#     include "vos/vosish.h"
#   endif
#elif defined(__HAIKU__)
#   include "haiku/haikuish.h"
#else
#   include "unixish.h"
#endif

#ifdef __amigaos4__
#    include "amigaos.h"
#    undef FD_CLOEXEC /* a lie in AmigaOS */
#endif

/* NSIG logic from Configure --> */
#ifndef NSIG
#  ifdef _NSIG
#    define NSIG (_NSIG)
#  elif defined(SIGMAX)
#    define NSIG (SIGMAX+1)
#  elif defined(SIG_MAX)
#    define NSIG (SIG_MAX+1)
#  elif defined(_SIG_MAX)
#    define NSIG (_SIG_MAX+1)
#  elif defined(MAXSIG)
#    define NSIG (MAXSIG+1)
#  elif defined(MAX_SIG)
#    define NSIG (MAX_SIG+1)
#  elif defined(SIGARRAYSIZE)
#    define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
#  elif defined(_sys_nsig)
#    define NSIG (_sys_nsig) /* Solaris 2.5 */
#  else
     /* Default to some arbitrary number that's big enough to get most
      * of the common signals.  */
#    define NSIG 50
#  endif
#endif
/* <-- NSIG logic from Configure */

#ifndef NO_ENVIRON_ARRAY
#  define USE_ENVIRON_ARRAY
#endif

#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
    /* having sigaction(2) means that the OS supports both 1-arg and 3-arg
     * signal handlers. But the perl core itself only fully supports 1-arg
     * handlers, so don't enable for now.
     * NB: POSIX::sigaction() supports both.
     *
     * # define PERL_USE_3ARG_SIGHANDLER
     */
#endif

/* Siginfo_t:
 * This is an alias for the OS's siginfo_t, except that where the OS
 * doesn't support it, declare a dummy version instead. This allows us to
 * have signal handler functions which always have a Siginfo_t parameter
 * regardless of platform, (and which will just be passed a NULL value
 * where the OS doesn't support HAS_SIGACTION).
 */

#if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
    typedef siginfo_t Siginfo_t;
#else
#ifdef si_signo /* minix */
#undef si_signo
#endif
    typedef struct {
        int si_signo;
    } Siginfo_t;
#endif


/*
 * initialise to avoid floating-point exceptions from overflow, etc
 */
#ifndef PERL_FPU_INIT
#  ifdef HAS_FPSETMASK
#    if HAS_FLOATINGPOINT_H
#      include <floatingpoint.h>
#    endif
/* Some operating systems have this as a macro, which in turn expands to a comma
   expression, and the last sub-expression is something that gets calculated,
   and then they have the gall to warn that a value computed is not used. Hence
   cast to void.  */
#    define PERL_FPU_INIT (void)fpsetmask(0)
#  elif defined(SIGFPE) && defined(SIG_IGN) && !defined(PERL_MICRO)
#    define PERL_FPU_INIT       PL_sigfpe_saved = (Sighandler_t) signal(SIGFPE, SIG_IGN)
#    define PERL_FPU_PRE_EXEC   { Sigsave_t xfpe; rsignal_save(SIGFPE, PL_sigfpe_saved, &xfpe);
#    define PERL_FPU_POST_EXEC    rsignal_restore(SIGFPE, &xfpe); }
#  else
#    define PERL_FPU_INIT
#  endif
#endif
#ifndef PERL_FPU_PRE_EXEC
#  define PERL_FPU_PRE_EXEC   {
#  define PERL_FPU_POST_EXEC  }
#endif

/* In Tru64 the cc -ieee enables the IEEE math but disables traps.
 * We need to reenable the "invalid" trap because otherwise generation
 * of NaN values leaves the IEEE fp flags in bad state, leaving any further
 * fp ops behaving strangely (Inf + 1 resulting in zero, for example). */
#ifdef __osf__
#  include <machine/fpu.h>
#  define PERL_SYS_FPU_INIT \
     STMT_START { \
         ieee_set_fp_control(IEEE_TRAP_ENABLE_INV); \
         signal(SIGFPE, SIG_IGN); \
     } STMT_END
#endif
/* In IRIX the default for Flush to Zero bit is true,
 * which means that results going below the minimum of normal
 * floating points go to zero, instead of going denormal/subnormal.
 * This is unlike almost any other system running Perl, so let's clear it.
 * [perl #123767] IRIX64 blead (ddce084a) opbasic/arith.t failure, originally
 * [perl #120426] small numbers shouldn't round to zero if they have extra floating digits
 *
 * XXX The flush-to-zero behaviour should be a Configure scan.
 * To change the behaviour usually requires some system-specific
 * incantation, though, like the below. */
#ifdef __sgi
#  include <sys/fpu.h>
#  define PERL_SYS_FPU_INIT \
     STMT_START { \
         union fpc_csr csr; \
         csr.fc_word = get_fpc_csr(); \
         csr.fc_struct.flush = 0; \
         set_fpc_csr(csr.fc_word); \
     } STMT_END
#endif

#ifndef PERL_SYS_FPU_INIT
#  define PERL_SYS_FPU_INIT NOOP
#endif

#ifndef PERL_SYS_INIT3_BODY
#  define PERL_SYS_INIT3_BODY(argvp,argcp,envp) PERL_SYS_INIT_BODY(argvp,argcp)
#endif

/*
=for apidoc_section $embedding

=for apidoc   Am|void|PERL_SYS_INIT |int *argc|char*** argv
=for apidoc_item|    |PERL_SYS_INIT3|int *argc|char*** argv|char*** env

These provide system-specific tune up of the C runtime environment necessary to
run Perl interpreters.  Only one should be used, and it should be called only
once, before creating any Perl interpreters.

They differ in that C<PERL_SYS_INIT3> also initializes C<env>.

=for apidoc Am|void|PERL_SYS_TERM|
Provides system-specific clean up of the C runtime environment after
running Perl interpreters.  This should be called only once, after
freeing any remaining Perl interpreters.

=cut
 */

#define PERL_SYS_INIT(argc, argv)	Perl_sys_init(argc, argv)
#define PERL_SYS_INIT3(argc, argv, env)	Perl_sys_init3(argc, argv, env)
#define PERL_SYS_TERM()			Perl_sys_term()

#ifndef PERL_WRITE_MSG_TO_CONSOLE
#  define PERL_WRITE_MSG_TO_CONSOLE(io, msg, len) PerlIO_write(io, msg, len)
#endif

#ifndef MAXPATHLEN
#  ifdef PATH_MAX
#    ifdef _POSIX_PATH_MAX
#       if PATH_MAX > _POSIX_PATH_MAX
/* POSIX 1990 (and pre) was ambiguous about whether PATH_MAX
 * included the null byte or not.  Later amendments of POSIX,
 * XPG4, the Austin Group, and the Single UNIX Specification
 * all explicitly include the null byte in the PATH_MAX.
 * Ditto for _POSIX_PATH_MAX. */
#         define MAXPATHLEN PATH_MAX
#       else
#         define MAXPATHLEN _POSIX_PATH_MAX
#       endif
#    else
#      define MAXPATHLEN (PATH_MAX+1)
#    endif
#  else
#    define MAXPATHLEN 1024	/* Err on the large side. */
#  endif
#endif

/* clang Thread Safety Analysis/Annotations/Attributes
 * http://clang.llvm.org/docs/ThreadSafetyAnalysis.html
 *
 * Available since clang 3.6-ish (appeared in 3.4, but shaky still in 3.5).
 * Apple XCode hijacks __clang_major__ and __clang_minor__
 * (6.1 means really clang 3.6), so needs extra hijinks
 * (could probably also test the contents of __apple_build_version__).
 */
#if defined(USE_ITHREADS) && defined(I_PTHREAD) && \
    defined(__clang__) && \
    !defined(SWIG) && \
  ((!defined(__apple_build_version__) &&               \
    ((__clang_major__ == 3 && __clang_minor__ >= 6) || \
     (__clang_major__ >= 4))) || \
   (defined(__apple_build_version__) &&                \
    ((__clang_major__ == 6 && __clang_minor__ >= 1) || \
     (__clang_major__ >= 7))))
#  define PERL_TSA__(x)   __attribute__((x))
#  define PERL_TSA_ACTIVE
#else
#  define PERL_TSA__(x)   /* No TSA, make TSA attributes no-ops. */
#  undef PERL_TSA_ACTIVE
#endif

/* PERL_TSA_CAPABILITY() is used to annotate typedefs.
 * typedef old_type PERL_TSA_CAPABILITY("mutex") new_type;
 */
#define PERL_TSA_CAPABILITY(x) \
    PERL_TSA__(capability(x))

/* In the below examples the mutex must be lexically visible, usually
 * either as global variables, or as function arguments. */

/* PERL_TSA_GUARDED_BY() is used to annotate global variables.
 *
 * Foo foo PERL_TSA_GUARDED_BY(mutex);
 */
#define PERL_TSA_GUARDED_BY(x) \
    PERL_TSA__(guarded_by(x))

/* PERL_TSA_PT_GUARDED_BY() is used to annotate global pointers.
 * The data _behind_ the pointer is guarded.
 *
 * Foo* ptr PERL_TSA_PT_GUARDED_BY(mutex);
 */
#define PERL_TSA_PT_GUARDED_BY(x) \
    PERL_TSA__(pt_guarded_by(x))

/* PERL_TSA_REQUIRES() is used to annotate functions.
 * The caller MUST hold the resource when calling the function.
 *
 * void Foo() PERL_TSA_REQUIRES(mutex);
 */
#define PERL_TSA_REQUIRES(x) \
    PERL_TSA__(requires_capability(x))

/* PERL_TSA_EXCLUDES() is used to annotate functions.
 * The caller MUST NOT hold resource when calling the function.
 *
 * EXCLUDES should be used when the function first acquires
 * the resource and then releases it.  Use to avoid deadlock.
 *
 * void Foo() PERL_TSA_EXCLUDES(mutex);
 */
#define PERL_TSA_EXCLUDES(x) \
    PERL_TSA__(locks_excluded(x))

/* PERL_TSA_ACQUIRE() is used to annotate functions.
 * The caller MUST NOT hold the resource when calling the function,
 * and the function will acquire the resource.
 *
 * void Foo() PERL_TSA_ACQUIRE(mutex);
 */
#define PERL_TSA_ACQUIRE(x) \
    PERL_TSA__(acquire_capability(x))

/* PERL_TSA_RELEASE() is used to annotate functions.
 * The caller MUST hold the resource when calling the function,
 * and the function will release the resource.
 *
 * void Foo() PERL_TSA_RELEASE(mutex);
 */
#define PERL_TSA_RELEASE(x) \
    PERL_TSA__(release_capability(x))

/* PERL_TSA_NO_TSA is used to annotate functions.
 * Used when being intentionally unsafe, or when the code is too
 * complicated for the analysis.  Use sparingly.
 *
 * void Foo() PERL_TSA_NO_TSA;
 */
#define PERL_TSA_NO_TSA \
    PERL_TSA__(no_thread_safety_analysis)

/* There are more annotations/attributes available, see the clang
 * documentation for details. */

#if defined(USE_ITHREADS)
#  if   defined(WIN32)
#    include <win32thread.h>
#  elif defined(OS2)
#    include "os2thread.h"
#  elif defined(I_MACH_CTHREADS)
#    include <mach/cthreads.h>
typedef cthread_t	perl_os_thread;
typedef mutex_t		perl_mutex;
typedef condition_t	perl_cond;
typedef void *		perl_key;
#  elif defined(I_PTHREAD) /* Posix threads */
#    include <pthread.h>
typedef pthread_t	perl_os_thread;
typedef pthread_mutex_t PERL_TSA_CAPABILITY("mutex") perl_mutex;
typedef pthread_cond_t	perl_cond;
typedef pthread_key_t	perl_key;
#  endif

/* Many readers; single writer */
typedef struct {
    perl_mutex lock;
    perl_cond  wakeup;
    SSize_t    readers_count;
} perl_RnW1_mutex_t;


#endif /* USE_ITHREADS */

#ifdef PERL_TSA_ACTIVE
/* Since most pthread mutex interfaces have not been annotated, we
 * need to have these wrappers. The NO_TSA annotation is quite ugly
 * but it cannot be avoided in plain C, unlike in C++, where one could
 * e.g. use ACQUIRE() with no arg on a mutex lock method.
 *
 * The bodies of these wrappers are in util.c
 *
 * TODO: however, some platforms are starting to get these clang
 * thread safety annotations for pthreads, for example FreeBSD.
 * Do we need a way to a bypass these wrappers? */
EXTERN_C int perl_tsa_mutex_lock(perl_mutex* mutex)
  PERL_TSA_ACQUIRE(*mutex)
  PERL_TSA_NO_TSA;
EXTERN_C int perl_tsa_mutex_unlock(perl_mutex* mutex)
  PERL_TSA_RELEASE(*mutex)
  PERL_TSA_NO_TSA;
#endif

#if defined(WIN32)
#  include "win32.h"
#endif

#define STATUS_UNIX	PL_statusvalue
#ifdef VMS
#   define STATUS_NATIVE	PL_statusvalue_vms
/*
 * vaxc$errno is only guaranteed to be valid if errno == EVMSERR, otherwise
 * its contents can not be trusted.  Unfortunately, Perl seems to check
 * it on exit, so it when PL_statusvalue_vms is updated, vaxc$errno should
 * be updated also.
 */
#  include <stsdef.h>
#  include <ssdef.h>
/* Presume this because if VMS changes it, it will require a new
 * set of APIs for waiting on children for binary compatibility.
 */
#  define child_offset_bits (8)
#  ifndef C_FAC_POSIX
#  define C_FAC_POSIX 0x35A000
#  endif

/*  STATUS_EXIT - validates and returns a NATIVE exit status code for the
 * platform from the existing UNIX or Native status values.
 */

#   define STATUS_EXIT \
        (((I32)PL_statusvalue_vms == -1 ? SS$_ABORT : PL_statusvalue_vms) | \
           (VMSISH_HUSHED ? STS$M_INHIB_MSG : 0))


/* STATUS_NATIVE_CHILD_SET - Calculate UNIX status that matches the child
 * exit code and shifts the UNIX value over the correct number of bits to
 * be a child status.  Usually the number of bits is 8, but that could be
 * platform dependent.  The NATIVE status code is presumed to have either
 * from a child process.
 */

/* This is complicated.  The child processes return a true native VMS
   status which must be saved.  But there is an assumption in Perl that
   the UNIX child status has some relationship to errno values, so
   Perl tries to translate it to text in some of the tests.
   In order to get the string translation correct, for the error, errno
   must be EVMSERR, but that generates a different text message
   than what the test programs are expecting.  So an errno value must
   be derived from the native status value when an error occurs.
   That will hide the true native status message.  With this version of
   perl, the true native child status can always be retrieved so that
   is not a problem.  But in this case, Pl_statusvalue and errno may
   have different values in them.
 */

#   define STATUS_NATIVE_CHILD_SET(n) \
        STMT_START {							\
            I32 evalue = (I32)n;					\
            if (evalue == EVMSERR) {					\
              PL_statusvalue_vms = vaxc$errno;				\
              PL_statusvalue = evalue;					\
            } else {							\
              PL_statusvalue_vms = evalue;				\
              if (evalue == -1) {					\
                PL_statusvalue = -1;					\
                PL_statusvalue_vms = SS$_ABORT; /* Should not happen */ \
              } else							\
                PL_statusvalue = Perl_vms_status_to_unix(evalue, 1);	\
              set_vaxc_errno(evalue);					\
              if ((PL_statusvalue_vms & C_FAC_POSIX) == C_FAC_POSIX)	\
                  set_errno(EVMSERR);					\
              else set_errno(Perl_vms_status_to_unix(evalue, 0));	\
              PL_statusvalue = PL_statusvalue << child_offset_bits;	\
            }								\
        } STMT_END

#   ifdef VMSISH_STATUS
#	define STATUS_CURRENT	(VMSISH_STATUS ? STATUS_NATIVE : STATUS_UNIX)
#   else
#	define STATUS_CURRENT	STATUS_UNIX
#   endif

  /* STATUS_UNIX_SET - takes a UNIX/POSIX errno value and attempts to update
   * the NATIVE status to an equivalent value.  Can not be used to translate
   * exit code values as exit code values are not guaranteed to have any
   * relationship at all to errno values.
   * This is used when Perl is forcing errno to have a specific value.
   */
#   define STATUS_UNIX_SET(n)				\
        STMT_START {					\
            I32 evalue = (I32)n;			\
            PL_statusvalue = evalue;			\
            if (PL_statusvalue != -1) {			\
                if (PL_statusvalue != EVMSERR) {	\
                  PL_statusvalue &= 0xFFFF;		\
                  if (MY_POSIX_EXIT)			\
                    PL_statusvalue_vms=PL_statusvalue ? SS$_ABORT : SS$_NORMAL;\
                  else PL_statusvalue_vms = Perl_unix_status_to_vms(evalue); \
                }					\
                else {					\
                  PL_statusvalue_vms = vaxc$errno;	\
                }					\
            }						\
            else PL_statusvalue_vms = SS$_ABORT;	\
            set_vaxc_errno(PL_statusvalue_vms);		\
        } STMT_END

  /* STATUS_UNIX_EXIT_SET - Takes a UNIX/POSIX exit code and sets
   * the NATIVE error status based on it.
   *
   * When in the default mode to comply with the Perl VMS documentation,
   * 0 is a success and any other code sets the NATIVE status to a failure
   * code of SS$_ABORT.
   *
   * In the new POSIX EXIT mode, native status will be set so that the
   * actual exit code will can be retrieved by the calling program or
   * shell.
   *
   * If the exit code is not clearly a UNIX parent or child exit status,
   * it will be passed through as a VMS status.
   */

#   define STATUS_UNIX_EXIT_SET(n)			\
        STMT_START {					\
            I32 evalue = (I32)n;			\
            PL_statusvalue = evalue;			\
            if (MY_POSIX_EXIT) { \
              if (evalue <= 0xFF00) {		\
                  if (evalue > 0xFF)			\
                    evalue = ((U8) (evalue >> child_offset_bits)); \
                  PL_statusvalue_vms =		\
                    (C_FAC_POSIX | (evalue << 3 ) |	\
                    ((evalue == 1) ? (STS$K_ERROR | STS$M_INHIB_MSG) : 1)); \
              } else /* forgive them Perl, for they have sinned */ \
                PL_statusvalue_vms = evalue; \
            } else { \
              if (evalue == 0)			\
                PL_statusvalue_vms = SS$_NORMAL;	\
              else if (evalue <= 0xFF00) \
                PL_statusvalue_vms = SS$_ABORT; \
              else { /* forgive them Perl, for they have sinned */ \
                  if (evalue != EVMSERR) PL_statusvalue_vms = evalue; \
                  else PL_statusvalue_vms = vaxc$errno;	\
                  /* And obviously used a VMS status value instead of UNIX */ \
                  PL_statusvalue = EVMSERR;		\
              } \
              set_vaxc_errno(PL_statusvalue_vms);	\
            }						\
        } STMT_END


  /* STATUS_EXIT_SET - Takes a NATIVE/UNIX/POSIX exit code
   * and sets the NATIVE error status based on it.  This special case
   * is needed to maintain compatibility with past VMS behavior.
   *
   * In the default mode on VMS, this number is passed through as
   * both the NATIVE and UNIX status.  Which makes it different
   * that the STATUS_UNIX_EXIT_SET.
   *
   * In the new POSIX EXIT mode, native status will be set so that the
   * actual exit code will can be retrieved by the calling program or
   * shell.
   *
   * A POSIX exit code is from 0 to 255.  If the exit code is higher
   * than this, it needs to be assumed that it is a VMS exit code and
   * passed through.
   */

#   define STATUS_EXIT_SET(n)				\
        STMT_START {					\
            I32 evalue = (I32)n;			\
            PL_statusvalue = evalue;			\
            if (MY_POSIX_EXIT)				\
                if (evalue > 255) PL_statusvalue_vms = evalue; else {	\
                  PL_statusvalue_vms = \
                    (C_FAC_POSIX | (evalue << 3 ) |	\
                     ((evalue == 1) ? (STS$K_ERROR | STS$M_INHIB_MSG) : 1));} \
            else					\
                PL_statusvalue_vms = evalue ? evalue : SS$_NORMAL; \
            set_vaxc_errno(PL_statusvalue_vms);		\
        } STMT_END


 /* This macro forces a success status */
#   define STATUS_ALL_SUCCESS	\
        (PL_statusvalue = 0, PL_statusvalue_vms = SS$_NORMAL)

 /* This macro forces a failure status */
#   define STATUS_ALL_FAILURE	(PL_statusvalue = 1, \
     vaxc$errno = PL_statusvalue_vms = MY_POSIX_EXIT ? \
        (C_FAC_POSIX | (1 << 3) | STS$K_ERROR | STS$M_INHIB_MSG) : SS$_ABORT)

#elif defined(__amigaos4__)
 /* A somewhat experimental attempt to simulate posix return code values */
#   define STATUS_NATIVE	PL_statusvalue_posix
#   define STATUS_NATIVE_CHILD_SET(n)                      \
        STMT_START {                                       \
            PL_statusvalue_posix = (n);                    \
            if (PL_statusvalue_posix < 0) {                \
                PL_statusvalue = -1;                       \
            }                                              \
            else {                                         \
                PL_statusvalue = n << 8;                   \
            }                                              \
        } STMT_END
#   define STATUS_UNIX_SET(n)		\
        STMT_START {			\
            PL_statusvalue = (n);		\
            if (PL_statusvalue != -1)	\
                PL_statusvalue &= 0xFFFF;	\
        } STMT_END
#   define STATUS_UNIX_EXIT_SET(n) STATUS_UNIX_SET(n)
#   define STATUS_EXIT_SET(n) STATUS_UNIX_SET(n)
#   define STATUS_CURRENT STATUS_UNIX
#   define STATUS_EXIT STATUS_UNIX
#   define STATUS_ALL_SUCCESS	(PL_statusvalue = 0, PL_statusvalue_posix = 0)
#   define STATUS_ALL_FAILURE	(PL_statusvalue = 1, PL_statusvalue_posix = 1)

#else
#   define STATUS_NATIVE	PL_statusvalue_posix
#   if defined(WCOREDUMP)
#       define STATUS_NATIVE_CHILD_SET(n)                  \
            STMT_START {                                   \
                PL_statusvalue_posix = (n);                \
                if (PL_statusvalue_posix == -1)            \
                    PL_statusvalue = -1;                   \
                else {                                     \
                    PL_statusvalue =                       \
                        (WIFEXITED(PL_statusvalue_posix) ? (WEXITSTATUS(PL_statusvalue_posix) << 8) : 0) |  \
                        (WIFSIGNALED(PL_statusvalue_posix) ? (WTERMSIG(PL_statusvalue_posix) & 0x7F) : 0) | \
                        (WIFSIGNALED(PL_statusvalue_posix) && WCOREDUMP(PL_statusvalue_posix) ? 0x80 : 0);  \
                }                                          \
            } STMT_END
#   elif defined(WIFEXITED)
#       define STATUS_NATIVE_CHILD_SET(n)                  \
            STMT_START {                                   \
                PL_statusvalue_posix = (n);                \
                if (PL_statusvalue_posix == -1)            \
                    PL_statusvalue = -1;                   \
                else {                                     \
                    PL_statusvalue =                       \
                        (WIFEXITED(PL_statusvalue_posix) ? (WEXITSTATUS(PL_statusvalue_posix) << 8) : 0) |  \
                        (WIFSIGNALED(PL_statusvalue_posix) ? (WTERMSIG(PL_statusvalue_posix) & 0x7F) : 0);  \
                }                                          \
            } STMT_END
#   else
#       define STATUS_NATIVE_CHILD_SET(n)                  \
            STMT_START {                                   \
                PL_statusvalue_posix = (n);                \
                if (PL_statusvalue_posix == -1)            \
                    PL_statusvalue = -1;                   \
                else {                                     \
                    PL_statusvalue =                       \
                        PL_statusvalue_posix & 0xFFFF;     \
                }                                          \
            } STMT_END
#   endif
#   define STATUS_UNIX_SET(n)		\
        STMT_START {			\
            PL_statusvalue = (n);		\
            if (PL_statusvalue != -1)	\
                PL_statusvalue &= 0xFFFF;	\
        } STMT_END
#   define STATUS_UNIX_EXIT_SET(n) STATUS_UNIX_SET(n)
#   define STATUS_EXIT_SET(n) STATUS_UNIX_SET(n)
#   define STATUS_CURRENT STATUS_UNIX
#   define STATUS_EXIT STATUS_UNIX
#   define STATUS_ALL_SUCCESS	(PL_statusvalue = 0, PL_statusvalue_posix = 0)
#   define STATUS_ALL_FAILURE	(PL_statusvalue = 1, PL_statusvalue_posix = 1)
#endif

/* flags in PL_exit_flags for nature of exit() */
#define PERL_EXIT_EXPECTED	0x01
#define PERL_EXIT_DESTRUCT_END  0x02  /* Run END in perl_destruct */
#define PERL_EXIT_WARN		0x04  /* Warn if Perl_my_exit() or Perl_my_failure_exit() called */
#define PERL_EXIT_ABORT		0x08  /* Call abort() if Perl_my_exit() or Perl_my_failure_exit() called */

#ifndef PERL_CORE
/* format to use for version numbers in file/directory names */
/* XXX move to Configure? */
/* This was only ever used for the current version, and that can be done at
   compile time, as PERL_FS_VERSION, so should we just delete it?  */
#  ifndef PERL_FS_VER_FMT
#    define PERL_FS_VER_FMT	"%d.%d.%d"
#  endif
#endif

#ifndef PERL_FS_VERSION
#  define PERL_FS_VERSION	PERL_VERSION_STRING
#endif

/*

=for apidoc_section $io
=for apidoc Amn|void|PERL_FLUSHALL_FOR_CHILD

This defines a way to flush all output buffers.  This may be a
performance issue, so we allow people to disable it.  Also, if
we are using stdio, there are broken implementations of fflush(NULL)
out there, Solaris being the most prominent.

=cut
 */

#ifndef PERL_FLUSHALL_FOR_CHILD
# if defined(USE_PERLIO) || defined(FFLUSH_NULL)
#  define PERL_FLUSHALL_FOR_CHILD	PerlIO_flush((PerlIO*)NULL)
# elif defined(FFLUSH_ALL)
#  define PERL_FLUSHALL_FOR_CHILD	my_fflush_all()
# else
#  define PERL_FLUSHALL_FOR_CHILD	NOOP
# endif
#endif

#ifndef PERL_WAIT_FOR_CHILDREN
#  define PERL_WAIT_FOR_CHILDREN	NOOP
#endif

/* the traditional thread-unsafe notion of "current interpreter". */
#ifndef PERL_SET_INTERP
#  define PERL_SET_INTERP(i)		(PL_curinterp = (PerlInterpreter*)(i))
#endif

#ifndef PERL_GET_INTERP
#  define PERL_GET_INTERP		(PL_curinterp)
#endif

#if defined(MULTIPLICITY) && !defined(PERL_GET_THX)
#  define PERL_GET_THX		((PerlInterpreter *)PERL_GET_CONTEXT)
#  define PERL_SET_THX(t)		PERL_SET_CONTEXT(t)
#endif

/*
    This replaces the previous %_ "hack" by the "%p" hacks.
    All that is required is that the perl source does not
    use "%-p" or "%-<number>p" or "%<number>p" formats.
    These formats will still work in perl code.
    See comments in sv.c for further details.

    Robin Barker 2005-07-14

    No longer use %1p for VDf = %vd.  RMB 2007-10-19
*/

#ifndef SVf_
#  define SVf_(n) "-" STRINGIFY(n) "p"
#endif

#ifndef SVf
#  define SVf "-p"
#endif

#ifndef SVf32
#  define SVf32 SVf_(32)
#endif

#ifndef SVf256
#  define SVf256 SVf_(256)
#endif

#define SVfARG(p) ((void*)(p))

#ifndef HEKf
#  define HEKf "2p"
#endif

/* Not ideal, but we cannot easily include a number in an already-numeric
 * format sequence. */
#ifndef HEKf256
#  define HEKf256 "3p"
#endif

#define HEKfARG(p) ((void*)(p))

/* Documented in perlguts
 *
 * %4p is a custom format
 */
#ifndef UTF8f
#  define UTF8f "d%" UVuf "%4p"
#endif
#define UTF8fARG(u,l,p) (int)cBOOL(u), (UV)(l), (void*)(p)

#define PNf UTF8f
#define PNfARG(pn) (int)1, (UV)PadnameLEN(pn), (void *)PadnamePV(pn)

#ifdef PERL_CORE
/* not used; but needed for backward compatibility with XS code? - RMB
=for apidoc_section $io_formats
=for apidoc AmnD|const char *|UVf

Obsolete form of C<UVuf>, which you should convert to instead use

=cut
*/
#  undef UVf
#elif !defined(UVf)
#  define UVf UVuf
#endif

#if !defined(DEBUGGING) && !defined(NDEBUG)
#  define NDEBUG 1
#endif
#include <assert.h>

/* For functions that are marked as __attribute__noreturn__, it's not
   appropriate to call return.  In either case, include the lint directive.
 */
#ifdef HASATTRIBUTE_NORETURN
#  define NORETURN_FUNCTION_END NOT_REACHED;
#else
#  define NORETURN_FUNCTION_END NOT_REACHED; return 0
#endif

#ifdef HAS_BUILTIN_EXPECT
#  define EXPECT(expr,val)                  __builtin_expect(expr,val)
#else
#  define EXPECT(expr,val)                  (expr)
#endif

/*
=for apidoc_section $directives

=for apidoc Am||LIKELY|bool expr

Returns the input unchanged, but at the same time it gives a branch prediction
hint to the compiler that this condition is likely to be true.

=for apidoc Am||UNLIKELY|bool expr

Returns the input unchanged, but at the same time it gives a branch prediction
hint to the compiler that this condition is likely to be false.

=cut
*/
#define LIKELY(cond)                        EXPECT(cBOOL(cond),TRUE)
#define UNLIKELY(cond)                      EXPECT(cBOOL(cond),FALSE)

#ifdef HAS_BUILTIN_CHOOSE_EXPR
/* placeholder */
#endif

/* STATIC_ASSERT_DECL/STATIC_ASSERT_STMT are like assert(), but for compile
   time invariants. That is, their argument must be a constant expression that
   can be verified by the compiler. This expression can contain anything that's
   known to the compiler, e.g. #define constants, enums, or sizeof (...). If
   the expression evaluates to 0, compilation fails.
   Because they generate no runtime code (i.e.  their use is "free"), they're
   always active, even under non-DEBUGGING builds.
   STATIC_ASSERT_DECL expands to a declaration and is suitable for use at
   file scope (outside of any function).
   STATIC_ASSERT_STMT expands to a statement and is suitable for use inside a
   function.
*/
#if (! defined(__IBMC__) || __IBMC__ >= 1210)                               \
 && ((   defined(static_assert) && (   defined(_ISOC11_SOURCE)              \
                                    || (__STDC_VERSION__ - 0) >= 201101L))  \
     || (defined(__cplusplus) && __cplusplus >= 201103L))
/* XXX static_assert is a macro defined in <assert.h> in C11 or a compiler
   builtin in C++11.  But IBM XL C V11 does not support _Static_assert, no
   matter what <assert.h> says.
*/
#  define STATIC_ASSERT_DECL(COND) static_assert(COND, #COND)
#else
/* We use a bit-field instead of an array because gcc accepts
   'typedef char x[n]' where n is not a compile-time constant.
   We want to enforce constantness.
*/
#  define STATIC_ASSERT_2(COND, SUFFIX) \
    typedef struct { \
        unsigned int _static_assertion_failed_##SUFFIX : (COND) ? 1 : -1; \
    } _static_assertion_failed_##SUFFIX PERL_UNUSED_DECL
#  define STATIC_ASSERT_1(COND, SUFFIX) STATIC_ASSERT_2(COND, SUFFIX)
#  define STATIC_ASSERT_DECL(COND)    STATIC_ASSERT_1(COND, __LINE__)
#endif
/* We need this wrapper even in C11 because 'case X: static_assert(...);' is an
   error (static_assert is a declaration, and only statements can have labels).
*/
#define STATIC_ASSERT_STMT(COND)      STMT_START { STATIC_ASSERT_DECL(COND); } STMT_END

#ifndef __has_builtin
#  define __has_builtin(x) 0 /* not a clang style compiler */
#endif

/*
=for apidoc Am||ASSUME|bool expr
C<ASSUME> is like C<assert()>, but it has a benefit in a release build. It is a
hint to a compiler about a statement of fact in a function call free
expression, which allows the compiler to generate better machine code.  In a
debug build, C<ASSUME(x)> is a synonym for C<assert(x)>. C<ASSUME(0)> means the
control path is unreachable. In a for loop, C<ASSUME> can be used to hint that
a loop will run at least X times. C<ASSUME> is based off MSVC's C<__assume>
intrinsic function, see its documents for more details.

=cut
*/

#if __has_builtin(__builtin_unreachable)
#    define HAS_BUILTIN_UNREACHABLE
#elif PERL_GCC_VERSION_GE(4,5,0)
#    define HAS_BUILTIN_UNREACHABLE
#endif

#ifdef DEBUGGING
#  define ASSUME(x) assert(x)
#elif defined(_MSC_VER)
#  define ASSUME(x) __assume(x)
#elif defined(__ARMCC_VERSION) /* untested */
#  define ASSUME(x) __promise(x)
#elif defined(HAS_BUILTIN_UNREACHABLE)
    /* Compilers can take the hint from something being unreachable */
#    define ASSUME(x) ((x) ? (void) 0 : __builtin_unreachable())
#else
    /* Not DEBUGGING, so assert() is a no-op, but a random compiler might
     * define assert() to its own special optimization token so pass it through
     * to C lib as a last resort */
#  define ASSUME(x) assert(x)
#endif

#ifdef HAS_BUILTIN_UNREACHABLE
#  define NOT_REACHED                                                       \
        STMT_START {                                                        \
            ASSUME(!"UNREACHABLE"); __builtin_unreachable();                \
        } STMT_END
#  undef HAS_BUILTIN_UNREACHABLE /* Don't leak out this internal symbol */
#elif ! defined(__GNUC__) && (defined(__sun) || defined(__hpux))
    /* These just complain that NOT_REACHED isn't reached */
#  define NOT_REACHED
#else
#  define NOT_REACHED  ASSUME(!"UNREACHABLE")
#endif

/* Some unistd.h's give a prototype for pause() even though
   HAS_PAUSE ends up undefined.  This causes the #define
   below to be rejected by the compiler.  Sigh.
*/
#ifdef HAS_PAUSE
#define Pause	pause
#else
#define Pause() sleep((32767<<16)+32767)
#endif

#ifndef IOCPARM_LEN
#   ifdef IOCPARM_MASK
        /* on BSDish systems we're safe */
#	define IOCPARM_LEN(x)  (((x) >> 16) & IOCPARM_MASK)
#   elif defined(_IOC_SIZE) && defined(__GLIBC__)
        /* on Linux systems we're safe; except when we're not [perl #38223] */
#	define IOCPARM_LEN(x) (_IOC_SIZE(x) < 256 ? 256 : _IOC_SIZE(x))
#   else
        /* otherwise guess at what's safe */
#	define IOCPARM_LEN(x)	256
#   endif
#endif

#if defined(__CYGWIN__)
/* USEMYBINMODE
 *   This symbol, if defined, indicates that the program should
 *   use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
 *   that a file is in "binary" mode -- that is, that no translation
 *   of bytes occurs on read or write operations.
 */
#  define USEMYBINMODE /**/
#  include <io.h> /* for setmode() prototype */
#  define my_binmode(fp, iotype, mode) \
            cBOOL(PerlLIO_setmode(fileno(fp), mode) != -1)
#endif

#ifdef __CYGWIN__
void init_os_extras(void);
#endif

#ifdef UNION_ANY_DEFINITION
UNION_ANY_DEFINITION;
#else
union any {
    void*	any_ptr;
    SV*         any_sv;
    SV**        any_svp;
    GV*         any_gv;
    AV*         any_av;
    HV*         any_hv;
    OP*         any_op;
    char*       any_pv;
    char**      any_pvp;
    I32		any_i32;
    U32		any_u32;
    IV		any_iv;
    UV		any_uv;
    long	any_long;
    bool	any_bool;
    void	(*any_dptr) (void*);
    void	(*any_dxptr) (pTHX_ void*);
};
#endif

typedef I32 (*filter_t) (pTHX_ int, SV *, int);

#define FILTER_READ(idx, sv, len)  filter_read(idx, sv, len)
#define FILTER_DATA(idx) \
            (PL_parser ? AvARRAY(PL_parser->rsfp_filters)[idx] : NULL)
#define FILTER_ISREADER(idx) \
            (PL_parser && PL_parser->rsfp_filters \
                && idx >= AvFILLp(PL_parser->rsfp_filters))
#define PERL_FILTER_EXISTS(i) \
            (PL_parser && PL_parser->rsfp_filters \
                && (Size_t) (i) < av_count(PL_parser->rsfp_filters))

#if defined(_AIX) && !defined(_AIX43)
#if defined(USE_REENTRANT) || defined(_REENTRANT) || defined(_THREAD_SAFE)
/* We cannot include <crypt.h> to get the struct crypt_data
 * because of setkey prototype problems when threading */
typedef        struct crypt_data {     /* straight from /usr/include/crypt.h */
    /* From OSF, Not needed in AIX
       char C[28], D[28];
    */
    char E[48];
    char KS[16][48];
    char block[66];
    char iobuf[16];
} CRYPTD;
#endif /* threading */
#endif /* AIX */

#ifndef PERL_CALLCONV
#  ifdef __cplusplus
#    define PERL_CALLCONV  EXTERN_C
#  else
#    define PERL_CALLCONV
#  endif
#endif
#ifndef PERL_CALLCONV_NO_RET
#    define PERL_CALLCONV_NO_RET PERL_CALLCONV
#endif

/* PERL_STATIC_NO_RET is supposed to be equivalent to STATIC on builds that
   dont have a noreturn as a declaration specifier
*/
#ifndef PERL_STATIC_NO_RET
#  define PERL_STATIC_NO_RET STATIC
#endif

/* PERL_STATIC_INLINE_NO_RET is supposed to be equivalent to PERL_STATIC_INLINE
 * on builds that dont have a noreturn as a declaration specifier
*/
#ifndef PERL_STATIC_INLINE_NO_RET
#  define PERL_STATIC_INLINE_NO_RET PERL_STATIC_INLINE
#endif

#ifndef PERL_STATIC_FORCE_INLINE
#  define PERL_STATIC_FORCE_INLINE PERL_STATIC_INLINE
#endif

#ifndef PERL_STATIC_FORCE_INLINE_NO_RET
#  define PERL_STATIC_FORCE_INLINE_NO_RET PERL_STATIC_INLINE
#endif

#if !defined(OS2)
#  include "iperlsys.h"
#endif

#ifdef __LIBCATAMOUNT__
#undef HAS_PASSWD  /* unixish.h but not unixish enough. */
#undef HAS_GROUP
#define FAKE_BIT_BUCKET
#endif

/* [perl #22371] Algorimic Complexity Attack on Perl 5.6.1, 5.8.0.
 * Note that the USE_HASH_SEED and similar defines are *NOT* defined by
 * Configure, despite their names being similar to other defines like
 * USE_ITHREADS.  Configure in fact knows nothing about the randomised
 * hashes.  Therefore to enable/disable the hash randomisation defines
 * use the Configure -Accflags=... instead. */
#if !defined(NO_HASH_SEED) && !defined(USE_HASH_SEED)
#  define USE_HASH_SEED
#endif

#include "perly.h"


/* macros to define bit-fields in structs. */
#ifndef PERL_BITFIELD8
#  ifdef HAS_NON_INT_BITFIELDS
#  define PERL_BITFIELD8 U8
#  else
#    define PERL_BITFIELD8 unsigned
#  endif
#endif
#ifndef PERL_BITFIELD16
#  ifdef HAS_NON_INT_BITFIELDS
#  define PERL_BITFIELD16 U16
#  else
#    define PERL_BITFIELD16 unsigned
#  endif
#endif
#ifndef PERL_BITFIELD32
#  ifdef HAS_NON_INT_BITFIELDS
#  define PERL_BITFIELD32 U32
#  else
#    define PERL_BITFIELD32 unsigned
#  endif
#endif

#include "sv.h"
#include "regexp.h"
#include "util.h"
#include "form.h"
#include "gv.h"
#include "pad.h"
#include "cv.h"
#include "opnames.h"
#include "op.h"
#include "hv.h"
#include "cop.h"
#include "av.h"
#include "mg.h"
#include "scope.h"
#include "warnings.h"
#include "utf8.h"

/* these would be in doio.h if there was such a file */
#define my_stat()  my_stat_flags(SV_GMAGIC)
#define my_lstat() my_lstat_flags(SV_GMAGIC)

/* defined in sv.c, but also used in [ach]v.c */
#undef _XPV_HEAD
#undef _XPVMG_HEAD
#undef _XPVCV_COMMON

#include "parser.h"

typedef struct magic_state MGS;	/* struct magic_state defined in mg.c */

#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) \
 || defined(PERL_EXT_RE_BUILD)

/* These have to be predeclared, as they are used in proto.h which is #included
 * before their definitions in regcomp.h. */

struct scan_data_t;
typedef struct regnode_charclass regnode_charclass;

/* A hopefully less confusing name.  The sub-classes are all Posix classes only
 * used under /l matching */
typedef struct regnode_charclass_posixl regnode_charclass_class;
typedef struct regnode_charclass_posixl regnode_charclass_posixl;

typedef struct regnode_ssc regnode_ssc;
typedef struct RExC_state_t RExC_state_t;
struct _reg_trie_data;

#endif

struct ptr_tbl_ent {
    struct ptr_tbl_ent*		next;
    const void*			oldval;
    void*			newval;
};

struct ptr_tbl {
    struct ptr_tbl_ent**	tbl_ary;
    UV				tbl_max;
    UV				tbl_items;
    struct ptr_tbl_arena	*tbl_arena;
    struct ptr_tbl_ent		*tbl_arena_next;
    struct ptr_tbl_ent		*tbl_arena_end;
};

#if defined(htonl) && !defined(HAS_HTONL)
#define HAS_HTONL
#endif
#if defined(htons) && !defined(HAS_HTONS)
#define HAS_HTONS
#endif
#if defined(ntohl) && !defined(HAS_NTOHL)
#define HAS_NTOHL
#endif
#if defined(ntohs) && !defined(HAS_NTOHS)
#define HAS_NTOHS
#endif
#ifndef HAS_HTONL
#define HAS_HTONS
#define HAS_HTONL
#define HAS_NTOHS
#define HAS_NTOHL
#  if (BYTEORDER & 0xffff) == 0x4321
/* Big endian system, so ntohl, ntohs, htonl and htons do not need to
   re-order their values. However, to behave identically to the alternative
   implementations, they should truncate to the correct size.  */
#    define ntohl(x)    ((x)&0xFFFFFFFF)
#    define htonl(x)    ntohl(x)
#    define ntohs(x)    ((x)&0xFFFF)
#    define htons(x)    ntohs(x)
#  elif BYTEORDER == 0x1234 || BYTEORDER == 0x12345678

/* Note that we can't straight out declare our own htonl and htons because
   the Win32 build process forcibly undefines HAS_HTONL etc for its miniperl,
   to avoid the overhead of initialising the socket subsystem, but the headers
   that *declare* the various functions are still seen. If we declare our own
   htonl etc they will clash with the declarations in the Win32 headers.  */

PERL_STATIC_INLINE U32
my_swap32(const U32 x) {
    return ((x & 0xFF) << 24) | ((x >> 24) & 0xFF)
        | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8);
}

PERL_STATIC_INLINE U16
my_swap16(const U16 x) {
    return ((x & 0xFF) << 8) | ((x >> 8) & 0xFF);
}

#    define htonl(x)    my_swap32(x)
#    define ntohl(x)    my_swap32(x)
#    define ntohs(x)    my_swap16(x)
#    define htons(x)    my_swap16(x)
#  else
#    error "Unsupported byteorder"
/* The C pre-processor doesn't let us return the value of BYTEORDER as part of
   the error message. Please check the value of the macro BYTEORDER, as defined
   in config.h. The values of BYTEORDER we expect are

            big endian  little endian
   32 bit       0x4321  0x1234
   64 bit   0x87654321  0x12345678

   If you have a system with a different byte order, please see
   pod/perlhack.pod for how to submit a patch to add supporting code.
*/
#  endif
#endif

/*
 * Little-endian byte order functions - 'v' for 'VAX', or 'reVerse'.
 * -DWS
 */
#if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678
/* Little endian system, so vtohl, vtohs, htovl and htovs do not need to
   re-order their values. However, to behave identically to the alternative
   implementations, they should truncate to the correct size.  */
#  define vtohl(x)      ((x)&0xFFFFFFFF)
#  define vtohs(x)      ((x)&0xFFFF)
#  define htovl(x)      vtohl(x)
#  define htovs(x)      vtohs(x)
#elif BYTEORDER == 0x4321 || BYTEORDER == 0x87654321
#  define vtohl(x)	((((x)&0xFF)<<24)	\
                        +(((x)>>24)&0xFF)	\
                        +(((x)&0x0000FF00)<<8)	\
                        +(((x)&0x00FF0000)>>8)	)
#  define vtohs(x)	((((x)&0xFF)<<8) + (((x)>>8)&0xFF))
#  define htovl(x)	vtohl(x)
#  define htovs(x)	vtohs(x)
#else
#  error "Unsupported byteorder"
/* If you have need for current perl on PDP-11 or similar, and can help test
   that blead keeps working on a mixed-endian system, then see
   pod/perlhack.pod for how to submit patches to things working again.  */
#endif

/* *MAX Plus 1. A floating point value.
   Hopefully expressed in a way that dodgy floating point can't mess up.
   >> 2 rather than 1, so that value is safely less than I32_MAX after 1
   is added to it
   May find that some broken compiler will want the value cast to I32.
   [after the shift, as signed >> may not be as secure as unsigned >>]
*/
#define I32_MAX_P1 (2.0 * (1 + (((U32)I32_MAX) >> 1)))
#define U32_MAX_P1 (4.0 * (1 + ((U32_MAX) >> 2)))
/* For compilers that can't correctly cast NVs over 0x7FFFFFFF (or
   0x7FFFFFFFFFFFFFFF) to an unsigned integer. In the future, sizeof(UV)
   may be greater than sizeof(IV), so don't assume that half max UV is max IV.
*/
#define U32_MAX_P1_HALF (2.0 * (1 + ((U32_MAX) >> 2)))

#define UV_MAX_P1 (4.0 * (1 + ((UV_MAX) >> 2)))
#define IV_MAX_P1 (2.0 * (1 + (((UV)IV_MAX) >> 1)))
#define UV_MAX_P1_HALF (2.0 * (1 + ((UV_MAX) >> 2)))

/* This may look like unnecessary jumping through hoops, but converting
   out of range floating point values to integers *is* undefined behaviour,
   and it is starting to bite.

=for apidoc_section $casting
=for apidoc Am|I32|I_32|NV what
Cast an NV to I32 while avoiding undefined C behavior

=for apidoc Am|U32|U_32|NV what
Cast an NV to U32 while avoiding undefined C behavior

=for apidoc Am|IV|I_V|NV what
Cast an NV to IV while avoiding undefined C behavior

=for apidoc Am|UV|U_V|NV what
Cast an NV to UV while avoiding undefined C behavior

=cut
*/
#ifndef CAST_INLINE
#define I_32(what) (cast_i32((NV)(what)))
#define U_32(what) (cast_ulong((NV)(what)))
#define I_V(what) (cast_iv((NV)(what)))
#define U_V(what) (cast_uv((NV)(what)))
#else
#define I_32(n) ((n) < I32_MAX_P1 ? ((n) < I32_MIN ? I32_MIN : (I32) (n)) \
                  : ((n) < U32_MAX_P1 ? (I32)(U32) (n) \
                     : ((n) > 0 ? (I32) U32_MAX : 0 /* NaN */)))
#define U_32(n) ((n) < 0.0 ? ((n) < I32_MIN ? (UV) I32_MIN : (U32)(I32) (n)) \
                  : ((n) < U32_MAX_P1 ? (U32) (n) \
                     : ((n) > 0 ? U32_MAX : 0 /* NaN */)))
#define I_V(n) (LIKELY((n) < IV_MAX_P1) ? (UNLIKELY((n) < IV_MIN) ? IV_MIN : (IV) (n)) \
                  : (LIKELY((n) < UV_MAX_P1) ? (IV)(UV) (n) \
                     : ((n) > 0 ? (IV)UV_MAX : 0 /* NaN */)))
#define U_V(n) ((n) < 0.0 ? (UNLIKELY((n) < IV_MIN) ? (UV) IV_MIN : (UV)(IV) (n)) \
                  : (LIKELY((n) < UV_MAX_P1) ? (UV) (n) \
                     : ((n) > 0 ? UV_MAX : 0 /* NaN */)))
#endif

#define U_S(what) ((U16)U_32(what))
#define U_I(what) ((unsigned int)U_32(what))
#define U_L(what) U_32(what)

/*
=for apidoc_section $integer
=for apidoc Amn|IV|IV_MAX
The largest signed integer that fits in an IV on this platform.

=for apidoc Amn|IV|IV_MIN
The negative signed integer furthest away from 0 that fits in an IV on this
platform.

=for apidoc Amn|UV|UV_MAX
The largest unsigned integer that fits in a UV on this platform.

=for apidoc Amn|UV|UV_MIN
The smallest unsigned integer that fits in a UV on this platform.  It should
equal zero.

=cut
*/

#ifdef HAS_SIGNBIT
#  ifndef Perl_signbit
#    define Perl_signbit signbit
#  endif
#endif

/* These do not care about the fractional part, only about the range. */
#define NV_WITHIN_IV(nv) (I_V(nv) >= IV_MIN && I_V(nv) <= IV_MAX)
#define NV_WITHIN_UV(nv) ((nv)>=0.0 && U_V(nv) >= UV_MIN && U_V(nv) <= UV_MAX)

/* Used with UV/IV arguments: */
                                        /* XXXX: need to speed it up */
#define CLUMP_2UV(iv)	((iv) < 0 ? 0 : (UV)(iv))
#define CLUMP_2IV(uv)	((uv) > (UV)IV_MAX ? IV_MAX : (IV)(uv))

#ifndef MAXSYSFD
#   define MAXSYSFD 2
#endif

#ifndef __cplusplus
#if !defined(WIN32)
Uid_t getuid (void);
Uid_t geteuid (void);
Gid_t getgid (void);
Gid_t getegid (void);
#endif
#endif

#ifndef Perl_debug_log
#  define Perl_debug_log	PerlIO_stderr()
#endif

#ifndef Perl_error_log
#  define Perl_error_log	(PL_stderrgv			\
                                 && isGV(PL_stderrgv)		\
                                 && GvIOp(PL_stderrgv)          \
                                 && IoOFP(GvIOp(PL_stderrgv))	\
                                 ? IoOFP(GvIOp(PL_stderrgv))	\
                                 : PerlIO_stderr())
#endif


#define DEBUG_p_FLAG		0x00000001 /*      1 */
#define DEBUG_s_FLAG		0x00000002 /*      2 */
#define DEBUG_l_FLAG		0x00000004 /*      4 */
#define DEBUG_t_FLAG		0x00000008 /*      8 */
#define DEBUG_o_FLAG		0x00000010 /*     16 */
#define DEBUG_c_FLAG		0x00000020 /*     32 */
#define DEBUG_P_FLAG		0x00000040 /*     64 */
#define DEBUG_m_FLAG		0x00000080 /*    128 */
#define DEBUG_f_FLAG		0x00000100 /*    256 */
#define DEBUG_r_FLAG		0x00000200 /*    512 */
#define DEBUG_x_FLAG		0x00000400 /*   1024 */
#define DEBUG_u_FLAG		0x00000800 /*   2048 */
/* U is reserved for Unofficial, exploratory hacking */
#define DEBUG_U_FLAG		0x00001000 /*   4096 */
#define DEBUG_h_FLAG            0x00002000 /*   8192 */
#define DEBUG_X_FLAG		0x00004000 /*  16384 */
#define DEBUG_D_FLAG		0x00008000 /*  32768 */
#define DEBUG_S_FLAG		0x00010000 /*  65536 */
#define DEBUG_T_FLAG		0x00020000 /* 131072 */
#define DEBUG_R_FLAG		0x00040000 /* 262144 */
#define DEBUG_J_FLAG		0x00080000 /* 524288 */
#define DEBUG_v_FLAG		0x00100000 /*1048576 */
#define DEBUG_C_FLAG		0x00200000 /*2097152 */
#define DEBUG_A_FLAG		0x00400000 /*4194304 */
#define DEBUG_q_FLAG		0x00800000 /*8388608 */
#define DEBUG_M_FLAG		0x01000000 /*16777216*/
#define DEBUG_B_FLAG		0x02000000 /*33554432*/
#define DEBUG_L_FLAG		0x04000000 /*67108864*/
#define DEBUG_i_FLAG		0x08000000 /*134217728*/
#define DEBUG_y_FLAG		0x10000000 /*268435456*/
#define DEBUG_MASK		0x1FFFEFFF /* mask of all the standard flags */

#define DEBUG_DB_RECURSE_FLAG	0x40000000
#define DEBUG_TOP_FLAG		0x80000000 /* -D was given --> PL_debug |= FLAG */

/* Both flags have to be set */
#  define DEBUG_BOTH_FLAGS_TEST_(flag1, flag2)              \
            UNLIKELY((PL_debug & ((flag1)|(flag2)))         \
                              == ((flag1)|(flag2)))

#  define DEBUG_p_TEST_ UNLIKELY(PL_debug & DEBUG_p_FLAG)
#  define DEBUG_s_TEST_ UNLIKELY(PL_debug & DEBUG_s_FLAG)
#  define DEBUG_l_TEST_ UNLIKELY(PL_debug & DEBUG_l_FLAG)
#  define DEBUG_t_TEST_ UNLIKELY(PL_debug & DEBUG_t_FLAG)
#  define DEBUG_o_TEST_ UNLIKELY(PL_debug & DEBUG_o_FLAG)
#  define DEBUG_c_TEST_ UNLIKELY(PL_debug & DEBUG_c_FLAG)
#  define DEBUG_P_TEST_ UNLIKELY(PL_debug & DEBUG_P_FLAG)
#  define DEBUG_m_TEST_ UNLIKELY(PL_debug & DEBUG_m_FLAG)
#  define DEBUG_f_TEST_ UNLIKELY(PL_debug & DEBUG_f_FLAG)
#  define DEBUG_r_TEST_ UNLIKELY(PL_debug & DEBUG_r_FLAG)
#  define DEBUG_x_TEST_ UNLIKELY(PL_debug & DEBUG_x_FLAG)
#  define DEBUG_u_TEST_ UNLIKELY(PL_debug & DEBUG_u_FLAG)
#  define DEBUG_U_TEST_ UNLIKELY(PL_debug & DEBUG_U_FLAG)
#  define DEBUG_h_TEST_ UNLIKELY(PL_debug & DEBUG_h_FLAG)
#  define DEBUG_X_TEST_ UNLIKELY(PL_debug & DEBUG_X_FLAG)
#  define DEBUG_D_TEST_ UNLIKELY(PL_debug & DEBUG_D_FLAG)
#  define DEBUG_S_TEST_ UNLIKELY(PL_debug & DEBUG_S_FLAG)
#  define DEBUG_T_TEST_ UNLIKELY(PL_debug & DEBUG_T_FLAG)
#  define DEBUG_R_TEST_ UNLIKELY(PL_debug & DEBUG_R_FLAG)
#  define DEBUG_J_TEST_ UNLIKELY(PL_debug & DEBUG_J_FLAG)
#  define DEBUG_v_TEST_ UNLIKELY(PL_debug & DEBUG_v_FLAG)
#  define DEBUG_C_TEST_ UNLIKELY(PL_debug & DEBUG_C_FLAG)
#  define DEBUG_A_TEST_ UNLIKELY(PL_debug & DEBUG_A_FLAG)
#  define DEBUG_q_TEST_ UNLIKELY(PL_debug & DEBUG_q_FLAG)
#  define DEBUG_M_TEST_ UNLIKELY(PL_debug & DEBUG_M_FLAG)
#  define DEBUG_B_TEST_ UNLIKELY(PL_debug & DEBUG_B_FLAG)
#  define DEBUG_L_TEST_ UNLIKELY(PL_debug & DEBUG_L_FLAG)
#  define DEBUG_i_TEST_ UNLIKELY(PL_debug & DEBUG_i_FLAG)
#  define DEBUG_y_TEST_ UNLIKELY(PL_debug & DEBUG_y_FLAG)
#  define DEBUG_Xv_TEST_ DEBUG_BOTH_FLAGS_TEST_(DEBUG_X_FLAG, DEBUG_v_FLAG)
#  define DEBUG_Uv_TEST_ DEBUG_BOTH_FLAGS_TEST_(DEBUG_U_FLAG, DEBUG_v_FLAG)
#  define DEBUG_Pv_TEST_ DEBUG_BOTH_FLAGS_TEST_(DEBUG_P_FLAG, DEBUG_v_FLAG)
#  define DEBUG_Lv_TEST_ DEBUG_BOTH_FLAGS_TEST_(DEBUG_L_FLAG, DEBUG_v_FLAG)
#  define DEBUG_yv_TEST_ DEBUG_BOTH_FLAGS_TEST_(DEBUG_y_FLAG, DEBUG_v_FLAG)

#ifdef DEBUGGING

#  define DEBUG_p_TEST DEBUG_p_TEST_
#  define DEBUG_s_TEST DEBUG_s_TEST_
#  define DEBUG_l_TEST DEBUG_l_TEST_
#  define DEBUG_t_TEST DEBUG_t_TEST_
#  define DEBUG_o_TEST DEBUG_o_TEST_
#  define DEBUG_c_TEST DEBUG_c_TEST_
#  define DEBUG_P_TEST DEBUG_P_TEST_
#  define DEBUG_m_TEST DEBUG_m_TEST_
#  define DEBUG_f_TEST DEBUG_f_TEST_
#  define DEBUG_r_TEST DEBUG_r_TEST_
#  define DEBUG_x_TEST DEBUG_x_TEST_
#  define DEBUG_u_TEST DEBUG_u_TEST_
#  define DEBUG_U_TEST DEBUG_U_TEST_
#  define DEBUG_h_TEST DEBUG_h_TEST_
#  define DEBUG_X_TEST DEBUG_X_TEST_
#  define DEBUG_D_TEST DEBUG_D_TEST_
#  define DEBUG_S_TEST DEBUG_S_TEST_
#  define DEBUG_T_TEST DEBUG_T_TEST_
#  define DEBUG_R_TEST DEBUG_R_TEST_
#  define DEBUG_J_TEST DEBUG_J_TEST_
#  define DEBUG_v_TEST DEBUG_v_TEST_
#  define DEBUG_C_TEST DEBUG_C_TEST_
#  define DEBUG_A_TEST DEBUG_A_TEST_
#  define DEBUG_q_TEST DEBUG_q_TEST_
#  define DEBUG_M_TEST DEBUG_M_TEST_
#  define DEBUG_B_TEST DEBUG_B_TEST_
#  define DEBUG_L_TEST DEBUG_L_TEST_
#  define DEBUG_i_TEST DEBUG_i_TEST_
#  define DEBUG_y_TEST DEBUG_y_TEST_
#  define DEBUG_Xv_TEST DEBUG_Xv_TEST_
#  define DEBUG_Uv_TEST DEBUG_Uv_TEST_
#  define DEBUG_Pv_TEST DEBUG_Pv_TEST_
#  define DEBUG_Lv_TEST DEBUG_Lv_TEST_
#  define DEBUG_yv_TEST DEBUG_yv_TEST_

#  define PERL_DEB(a)                  a
#  define PERL_DEB2(a,b)               a
#  define PERL_DEBUG(a) if (PL_debug)  a
#  define DEBUG_p(a) if (DEBUG_p_TEST) a
#  define DEBUG_s(a) if (DEBUG_s_TEST) a
#  define DEBUG_l(a) if (DEBUG_l_TEST) a
#  define DEBUG_t(a) if (DEBUG_t_TEST) a
#  define DEBUG_o(a) if (DEBUG_o_TEST) a
#  define DEBUG_c(a) if (DEBUG_c_TEST) a
#  define DEBUG_P(a) if (DEBUG_P_TEST) a

     /* Temporarily turn off memory debugging in case the a
      * does memory allocation, either directly or indirectly. */
#  define DEBUG_m(a)  \
    STMT_START {					                \
        if (PERL_GET_INTERP) {                                          \
                                dTHX;                                   \
                                if (DEBUG_m_TEST) {                     \
                                    PL_debug &= ~DEBUG_m_FLAG;          \
                                    a;                                  \
                                    PL_debug |= DEBUG_m_FLAG;           \
                                }                                       \
                              }                                         \
    } STMT_END

/* These allow you to customize your debugging output  for specialized,
 * generally temporary ad-hoc purposes.  For example, if you need 'errno'
 * preserved, you can add definitions to these macros (either in this file for
 * the whole program, or before the #include "perl.h" in a particular .c file
 * you're trying to debug) and recompile:
 *
 * #define DEBUG_PRE_STMTS   dSAVE_ERRNO;
 * #define DEBUG_POST_STMTS  RESTORE_ERRNO;
 *
 * Other potential things include displaying timestamps, location information,
 * which thread, etc.  Heres an example with both errno and location info:
 *
 * #define DEBUG_PRE_STMTS   dSAVE_ERRNO;  \
 *              PerlIO_printf(Perl_debug_log, "%s:%d: ", __FILE__, __LINE__);
 * #define DEBUG_POST  RESTORE_ERRNO;
 *
 * All DEBUG statements in the compiled scope will be have these extra
 * statements compiled in; they will be executed only for the DEBUG statements
 * whose flags are turned on.
 */
#ifndef DEBUG_PRE_STMTS
#  define DEBUG_PRE_STMTS
#endif
#ifndef DEBUG_POST_STMTS
#  define DEBUG_POST_STMTS
#endif

#  define DEBUG__(t, a)                                                 \
        STMT_START {                                                    \
            if (t) STMT_START {                                         \
                DEBUG_PRE_STMTS a; DEBUG_POST_STMTS                     \
            } STMT_END;                                                 \
        } STMT_END

#  define DEBUG_f(a) DEBUG__(DEBUG_f_TEST, a)

/* For re_comp.c, re_exec.c, assume -Dr has been specified */
#  ifdef PERL_EXT_RE_BUILD
#    define DEBUG_r(a) STMT_START {                                     \
                            DEBUG_PRE_STMTS a; DEBUG_POST_STMTS         \
                       } STMT_END;
#  else
#    define DEBUG_r(a) DEBUG__(DEBUG_r_TEST, a)
#  endif /* PERL_EXT_RE_BUILD */

#  define DEBUG_x(a) DEBUG__(DEBUG_x_TEST, a)
#  define DEBUG_u(a) DEBUG__(DEBUG_u_TEST, a)
#  define DEBUG_U(a) DEBUG__(DEBUG_U_TEST, a)
#  define DEBUG_X(a) DEBUG__(DEBUG_X_TEST, a)
#  define DEBUG_D(a) DEBUG__(DEBUG_D_TEST, a)
#  define DEBUG_Xv(a) DEBUG__(DEBUG_Xv_TEST, a)
#  define DEBUG_Uv(a) DEBUG__(DEBUG_Uv_TEST, a)
#  define DEBUG_Pv(a) DEBUG__(DEBUG_Pv_TEST, a)
#  define DEBUG_Lv(a) DEBUG__(DEBUG_Lv_TEST, a)
#  define DEBUG_yv(a) DEBUG__(DEBUG_yv_TEST, a)

#  define DEBUG_S(a) DEBUG__(DEBUG_S_TEST, a)
#  define DEBUG_T(a) DEBUG__(DEBUG_T_TEST, a)
#  define DEBUG_R(a) DEBUG__(DEBUG_R_TEST, a)
#  define DEBUG_v(a) DEBUG__(DEBUG_v_TEST, a)
#  define DEBUG_C(a) DEBUG__(DEBUG_C_TEST, a)
#  define DEBUG_A(a) DEBUG__(DEBUG_A_TEST, a)
#  define DEBUG_q(a) DEBUG__(DEBUG_q_TEST, a)
#  define DEBUG_M(a) DEBUG__(DEBUG_M_TEST, a)
#  define DEBUG_B(a) DEBUG__(DEBUG_B_TEST, a)
#  define DEBUG_L(a) DEBUG__(DEBUG_L_TEST, a)
#  define DEBUG_i(a) DEBUG__(DEBUG_i_TEST, a)
#  define DEBUG_y(a) DEBUG__(DEBUG_y_TEST, a)

#else /* ! DEBUGGING below */

#  define DEBUG_p_TEST (0)
#  define DEBUG_s_TEST (0)
#  define DEBUG_l_TEST (0)
#  define DEBUG_t_TEST (0)
#  define DEBUG_o_TEST (0)
#  define DEBUG_c_TEST (0)
#  define DEBUG_P_TEST (0)
#  define DEBUG_m_TEST (0)
#  define DEBUG_f_TEST (0)
#  define DEBUG_r_TEST (0)
#  define DEBUG_x_TEST (0)
#  define DEBUG_u_TEST (0)
#  define DEBUG_U_TEST (0)
#  define DEBUG_h_TEST (0)
#  define DEBUG_X_TEST (0)
#  define DEBUG_D_TEST (0)
#  define DEBUG_S_TEST (0)
#  define DEBUG_T_TEST (0)
#  define DEBUG_R_TEST (0)
#  define DEBUG_J_TEST (0)
#  define DEBUG_v_TEST (0)
#  define DEBUG_C_TEST (0)
#  define DEBUG_A_TEST (0)
#  define DEBUG_q_TEST (0)
#  define DEBUG_M_TEST (0)
#  define DEBUG_B_TEST (0)
#  define DEBUG_L_TEST (0)
#  define DEBUG_i_TEST (0)
#  define DEBUG_y_TEST (0)
#  define DEBUG_Xv_TEST (0)
#  define DEBUG_Uv_TEST (0)
#  define DEBUG_Pv_TEST (0)
#  define DEBUG_Lv_TEST (0)
#  define DEBUG_yv_TEST (0)

#  define PERL_DEB(a)
#  define PERL_DEB2(a,b)               b
#  define PERL_DEBUG(a)
#  define DEBUG_p(a)
#  define DEBUG_s(a)
#  define DEBUG_l(a)
#  define DEBUG_t(a)
#  define DEBUG_o(a)
#  define DEBUG_c(a)
#  define DEBUG_P(a)
#  define DEBUG_m(a)
#  define DEBUG_f(a)
#  define DEBUG_r(a)
#  define DEBUG_x(a)
#  define DEBUG_u(a)
#  define DEBUG_U(a)
#  define DEBUG_X(a)
#  define DEBUG_D(a)
#  define DEBUG_S(a)
#  define DEBUG_T(a)
#  define DEBUG_R(a)
#  define DEBUG_v(a)
#  define DEBUG_C(a)
#  define DEBUG_A(a)
#  define DEBUG_q(a)
#  define DEBUG_M(a)
#  define DEBUG_B(a)
#  define DEBUG_L(a)
#  define DEBUG_i(a)
#  define DEBUG_y(a)
#  define DEBUG_Xv(a)
#  define DEBUG_Uv(a)
#  define DEBUG_Pv(a)
#  define DEBUG_Lv(a)
#  define DEBUG_yv(a)
#endif /* DEBUGGING */


#define DEBUG_SCOPE(where) \
    DEBUG_l( \
    Perl_deb(aTHX_ "%s scope %ld (savestack=%ld) at %s:%d\n",	\
                    where, (long)PL_scopestack_ix, (long)PL_savestack_ix, \
                    __FILE__, __LINE__));

/* Keep the old croak based assert for those who want it, and as a fallback if
   the platform is so heretically non-ANSI that it can't assert.  */

#define Perl_assert(what)	PERL_DEB2( 				\
        ((what) ? ((void) 0) :						\
            (Perl_croak_nocontext("Assertion %s failed: file \"" __FILE__ \
                        "\", line %d", STRINGIFY(what), __LINE__),	\
             (void) 0)), ((void)0))

/* assert() gets defined if DEBUGGING.
 * If no DEBUGGING, the <assert.h> has not been included. */
#ifndef assert
#  define assert(what)	Perl_assert(what)
#endif
#ifdef DEBUGGING
#  define assert_(what)	assert(what),
#else
#  define assert_(what)
#endif

struct ufuncs {
    I32 (*uf_val)(pTHX_ IV, SV*);
    I32 (*uf_set)(pTHX_ IV, SV*);
    IV uf_index;
};

/* In pre-5.7-Perls the PERL_MAGIC_uvar magic didn't get the thread context.
 * XS code wanting to be backward compatible can do something
 * like the following:

#ifndef PERL_MG_UFUNC
#define PERL_MG_UFUNC(name,ix,sv) I32 name(IV ix, SV *sv)
#endif

static PERL_MG_UFUNC(foo_get, index, val)
{
    sv_setsv(val, ...);
    return TRUE;
}

-- Doug MacEachern

*/

#ifndef PERL_MG_UFUNC
#define PERL_MG_UFUNC(name,ix,sv) I32 name(pTHX_ IV ix, SV *sv)
#endif

#include <math.h>
#ifdef __VMS
     /* isfinite and others are here rather than in math.h as C99 stipulates */
#    include <fp.h>
#endif

#ifndef __cplusplus
#  if !defined(WIN32) && !defined(VMS)
#ifndef crypt
char *crypt (const char*, const char*);
#endif
#  endif /* !WIN32 */
#  ifndef WIN32
#    ifndef getlogin
char *getlogin (void);
#    endif
#  endif /* !WIN32 */
#endif /* !__cplusplus */

/* Fixme on VMS.  This needs to be a run-time, not build time options */
/* Also rename() is affected by this */
#ifdef UNLINK_ALL_VERSIONS /* Currently only makes sense for VMS */
#define UNLINK unlnk
I32 unlnk (pTHX_ const char*);
#else
#define UNLINK PerlLIO_unlink
#endif

/* some versions of glibc are missing the setresuid() proto */
#if defined(HAS_SETRESUID) && !defined(HAS_SETRESUID_PROTO)
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
#endif
/* some versions of glibc are missing the setresgid() proto */
#if defined(HAS_SETRESGID) && !defined(HAS_SETRESGID_PROTO)
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
#endif

#ifndef HAS_SETREUID
#  ifdef HAS_SETRESUID
#    define setreuid(r,e) setresuid(r,e,(Uid_t)-1)
#    define HAS_SETREUID
#  endif
#endif
#ifndef HAS_SETREGID
#  ifdef HAS_SETRESGID
#    define setregid(r,e) setresgid(r,e,(Gid_t)-1)
#    define HAS_SETREGID
#  endif
#endif

/* Sighandler_t defined in iperlsys.h */

#ifdef HAS_SIGACTION
typedef struct sigaction Sigsave_t;
#else
typedef Sighandler_t Sigsave_t;
#endif

#define SCAN_DEF 0
#define SCAN_TR 1
#define SCAN_REPL 2

#ifdef DEBUGGING
# ifndef register
#  define register
# endif
# define RUNOPS_DEFAULT Perl_runops_debug
#else
# define RUNOPS_DEFAULT Perl_runops_standard
#endif

#if defined(USE_PERLIO)
EXTERN_C void PerlIO_teardown(void);
# ifdef USE_ITHREADS
#  define PERLIO_INIT MUTEX_INIT(&PL_perlio_mutex)
#  define PERLIO_TERM 				\
        STMT_START {				\
                PerlIO_teardown();		\
                MUTEX_DESTROY(&PL_perlio_mutex);\
        } STMT_END
# else
#  define PERLIO_INIT
#  define PERLIO_TERM	PerlIO_teardown()
# endif
#else
#  define PERLIO_INIT
#  define PERLIO_TERM
#endif

#ifdef MYMALLOC
#  ifdef MUTEX_INIT_CALLS_MALLOC
#    define MALLOC_INIT					\
        STMT_START {					\
                PL_malloc_mutex = NULL;			\
                MUTEX_INIT(&PL_malloc_mutex);		\
        } STMT_END
#    define MALLOC_TERM					\
        STMT_START {					\
                perl_mutex tmp = PL_malloc_mutex;	\
                PL_malloc_mutex = NULL;			\
                MUTEX_DESTROY(&tmp);			\
        } STMT_END
#  else
#    define MALLOC_INIT MUTEX_INIT(&PL_malloc_mutex)
#    define MALLOC_TERM MUTEX_DESTROY(&PL_malloc_mutex)
#  endif
#else
#  define MALLOC_INIT
#  define MALLOC_TERM
#endif

#if defined(MULTIPLICITY)

struct perl_memory_debug_header;
struct perl_memory_debug_header {
  tTHX	interpreter;
#  if defined(PERL_POISON) || defined(PERL_DEBUG_READONLY_COW)
  MEM_SIZE size;
#  endif
  struct perl_memory_debug_header *prev;
  struct perl_memory_debug_header *next;
#  ifdef PERL_DEBUG_READONLY_COW
  bool readonly;
#  endif
};

#elif defined(PERL_DEBUG_READONLY_COW)

struct perl_memory_debug_header;
struct perl_memory_debug_header {
  MEM_SIZE size;
};

#endif

#if defined (PERL_TRACK_MEMPOOL) || defined (PERL_DEBUG_READONLY_COW)

#  define PERL_MEMORY_DEBUG_HEADER_SIZE \
        (sizeof(struct perl_memory_debug_header) + \
        (MEM_ALIGNBYTES - sizeof(struct perl_memory_debug_header) \
         %MEM_ALIGNBYTES) % MEM_ALIGNBYTES)

#else
#  define PERL_MEMORY_DEBUG_HEADER_SIZE	0
#endif

#ifdef PERL_TRACK_MEMPOOL
# ifdef PERL_DEBUG_READONLY_COW
#  define INIT_TRACK_MEMPOOL(header, interp)			\
        STMT_START {						\
                (header).interpreter = (interp);		\
                (header).prev = (header).next = &(header);	\
                (header).readonly = 0;				\
        } STMT_END
# else
#  define INIT_TRACK_MEMPOOL(header, interp)			\
        STMT_START {						\
                (header).interpreter = (interp);		\
                (header).prev = (header).next = &(header);	\
        } STMT_END
# endif
# else
#  define INIT_TRACK_MEMPOOL(header, interp)
#endif

#ifdef I_MALLOCMALLOC
/* Needed for malloc_size(), malloc_good_size() on some systems */
#  include <malloc/malloc.h>
#endif

#ifdef MYMALLOC
#  define Perl_safesysmalloc_size(where)	Perl_malloced_size(where)
#else
#  if defined(HAS_MALLOC_SIZE) && !defined(PERL_DEBUG_READONLY_COW)
#    ifdef PERL_TRACK_MEMPOOL
#	define Perl_safesysmalloc_size(where)			\
            (malloc_size(((char *)(where)) - PERL_MEMORY_DEBUG_HEADER_SIZE) - PERL_MEMORY_DEBUG_HEADER_SIZE)
#    else
#	define Perl_safesysmalloc_size(where) malloc_size(where)
#    endif
#  endif
#  ifdef HAS_MALLOC_GOOD_SIZE
#    ifdef PERL_TRACK_MEMPOOL
#	define Perl_malloc_good_size(how_much)			\
            (malloc_good_size((how_much) + PERL_MEMORY_DEBUG_HEADER_SIZE) - PERL_MEMORY_DEBUG_HEADER_SIZE)
#    else
#	define Perl_malloc_good_size(how_much) malloc_good_size(how_much)
#    endif
#  else
/* Having this as the identity operation makes some code simpler.  */
#	define Perl_malloc_good_size(how_much)	(how_much)
#  endif
#endif

typedef int (*runops_proc_t)(pTHX);
typedef void (*share_proc_t) (pTHX_ SV *sv);
typedef int  (*thrhook_proc_t) (pTHX);
typedef OP* (*PPADDR_t[]) (pTHX);
typedef bool (*destroyable_proc_t) (pTHX_ SV *sv);
typedef void (*despatch_signals_proc_t) (pTHX);

#if defined(__DYNAMIC__) && defined(PERL_DARWIN) && defined(PERL_CORE)
#  include <crt_externs.h>	/* for the env array */
#  define environ (*_NSGetEnviron())
#elif defined(USE_ENVIRON_ARRAY) && !defined(environ)
   /* VMS and some other platforms don't use the environ array */
EXTERN_C char **environ;  /* environment variables supplied via exec */
#endif

#define PERL_PATCHLEVEL_H_IMPLICIT
#include "patchlevel.h"
#undef PERL_PATCHLEVEL_H_IMPLICIT

#define PERL_VERSION_STRING	STRINGIFY(PERL_REVISION) "." \
                                STRINGIFY(PERL_VERSION) "." \
                                STRINGIFY(PERL_SUBVERSION)

#define PERL_API_VERSION_STRING	STRINGIFY(PERL_API_REVISION) "." \
                                STRINGIFY(PERL_API_VERSION) "." \
                                STRINGIFY(PERL_API_SUBVERSION)

START_EXTERN_C

/* handy constants */
EXTCONST char PL_warn_uninit[]
  INIT("Use of uninitialized value%s%s%s");
EXTCONST char PL_warn_uninit_sv[]
  INIT("Use of uninitialized value%" SVf "%s%s");
EXTCONST char PL_warn_nosemi[]
  INIT("Semicolon seems to be missing");
EXTCONST char PL_warn_reserved[]
  INIT("Unquoted string \"%s\" may clash with future reserved word");
EXTCONST char PL_warn_nl[]
  INIT("Unsuccessful %s on filename containing newline");
EXTCONST char PL_no_wrongref[]
  INIT("Can't use %s ref as %s ref");
/* The core no longer needs this here. If you require the string constant,
   please inline a copy into your own code.  */
EXTCONST char PL_no_symref[] __attribute__deprecated__
  INIT("Can't use string (\"%.32s\") as %s ref while \"strict refs\" in use");
EXTCONST char PL_no_symref_sv[]
  INIT("Can't use string (\"%" SVf32 "\"%s) as %s ref while \"strict refs\" in use");

EXTCONST char PL_no_usym[]
  INIT("Can't use an undefined value as %s reference");
EXTCONST char PL_no_aelem[]
  INIT("Modification of non-creatable array value attempted, subscript %d");
EXTCONST char PL_no_helem_sv[]
  INIT("Modification of non-creatable hash value attempted, subscript \"%" SVf "\"");
EXTCONST char PL_no_modify[]
  INIT("Modification of a read-only value attempted");
EXTCONST char PL_no_mem[sizeof("Out of memory!\n")]
  INIT("Out of memory!\n");
EXTCONST char PL_no_security[]
  INIT("Insecure dependency in %s%s");
EXTCONST char PL_no_sock_func[]
  INIT("Unsupported socket function \"%s\" called");
EXTCONST char PL_no_dir_func[]
  INIT("Unsupported directory function \"%s\" called");
EXTCONST char PL_no_func[]
  INIT("The %s function is unimplemented");
EXTCONST char PL_no_myglob[]
  INIT("\"%s\" %s %s can't be in a package");
EXTCONST char PL_no_localize_ref[]
  INIT("Can't localize through a reference");
EXTCONST char PL_memory_wrap[]
  INIT("panic: memory wrap");
EXTCONST char PL_extended_cp_format[]
  INIT("Code point 0x%" UVXf " is not Unicode, requires a Perl extension,"
                             " and so is not portable");
EXTCONST char PL_Yes[]
  INIT("1");
EXTCONST char PL_No[]
  INIT("");
EXTCONST char PL_Zero[]
  INIT("0");

/*
=for apidoc_section $numeric
=for apidoc AmTuU|const char *|PL_hexdigit|U8 value

This array, indexed by an integer, converts that value into the character that
represents it.  For example, if the input is 8, the return will be a string
whose first character is '8'.  What is actually returned is a pointer into a
string.  All you are interested in is the first character of that string.  To
get uppercase letters (for the values 10..15), add 16 to the index.  Hence,
C<PL_hexdigit[11]> is C<'b'>, and C<PL_hexdigit[11+16]> is C<'B'>.  Adding 16
to an index whose representation is '0'..'9' yields the same as not adding 16.
Indices outside the range 0..31 result in (bad) undedefined behavior.

=cut
*/
EXTCONST char PL_hexdigit[]
  INIT("0123456789abcdef0123456789ABCDEF");

EXTCONST STRLEN PL_WARN_ALL
  INIT(0);
EXTCONST STRLEN PL_WARN_NONE
  INIT(0);

/* This is constant on most architectures, a global on OS/2 */
#ifndef OS2
EXTCONST char PL_sh_path[]
  INIT(SH_PATH); /* full path of shell */
#endif

#ifdef CSH
EXTCONST char PL_cshname[]
  INIT(CSH);
#  define PL_cshlen	(sizeof(CSH "") - 1)
#endif

/* These are baked at compile time into any shared perl library.
   In future releases this will allow us in main() to sanity test the
   library we're linking against.  */

EXTCONST U8 PL_revision
  INIT(PERL_REVISION);
EXTCONST U8 PL_version
  INIT(PERL_VERSION);
EXTCONST U8 PL_subversion
  INIT(PERL_SUBVERSION);

EXTCONST char PL_uuemap[65]
  INIT("`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_");

/* a special string address whose value is "isa", but which perl knows
 * to treat as if it were really "DOES" when printing the method name in
 *  the "Can't call method '%s'" error message */
EXTCONST char PL_isa_DOES[]
  INIT("isa");

#ifdef DOINIT
EXTCONST char PL_uudmap[256] =
#  ifdef PERL_MICRO
#    include "uuudmap.h"
#  else
#    include "uudmap.h"
#  endif
;
EXTCONST char PL_bitcount[256] =
#  ifdef PERL_MICRO
#    include "ubitcount.h"
#else
#    include "bitcount.h"
#  endif
;
EXTCONST char* const PL_sig_name[] = { SIG_NAME };
EXTCONST int         PL_sig_num[]  = { SIG_NUM };
#else
EXTCONST char PL_uudmap[256];
EXTCONST char PL_bitcount[256];
EXTCONST char* const PL_sig_name[];
EXTCONST int         PL_sig_num[];
#endif

/* fast conversion and case folding tables.  The folding tables complement the
 * fold, so that 'a' maps to 'A' and 'A' maps to 'a', ignoring more complicated
 * folds such as outside the range or to multiple characters. */

#ifdef DOINIT
#  ifndef EBCDIC

/* The EBCDIC fold table depends on the code page, and hence is found in
 * ebcdic_tables.h */

EXTCONST  unsigned char PL_fold[] = {
        0,	1,	2,	3,	4,	5,	6,	7,
        8,	9,	10,	11,	12,	13,	14,	15,
        16,	17,	18,	19,	20,	21,	22,	23,
        24,	25,	26,	27,	28,	29,	30,	31,
        32,	33,	34,	35,	36,	37,	38,	39,
        40,	41,	42,	43,	44,	45,	46,	47,
        48,	49,	50,	51,	52,	53,	54,	55,
        56,	57,	58,	59,	60,	61,	62,	63,
        64,	'a',	'b',	'c',	'd',	'e',	'f',	'g',
        'h',	'i',	'j',	'k',	'l',	'm',	'n',	'o',
        'p',	'q',	'r',	's',	't',	'u',	'v',	'w',
        'x',	'y',	'z',	91,	92,	93,	94,	95,
        96,	'A',	'B',	'C',	'D',	'E',	'F',	'G',
        'H',	'I',	'J',	'K',	'L',	'M',	'N',	'O',
        'P',	'Q',	'R',	'S',	'T',	'U',	'V',	'W',
        'X',	'Y',	'Z',	123,	124,	125,	126,	127,
        128,	129,	130,	131,	132,	133,	134,	135,
        136,	137,	138,	139,	140,	141,	142,	143,
        144,	145,	146,	147,	148,	149,	150,	151,
        152,	153,	154,	155,	156,	157,	158,	159,
        160,	161,	162,	163,	164,	165,	166,	167,
        168,	169,	170,	171,	172,	173,	174,	175,
        176,	177,	178,	179,	180,	181,	182,	183,
        184,	185,	186,	187,	188,	189,	190,	191,
        192,	193,	194,	195,	196,	197,	198,	199,
        200,	201,	202,	203,	204,	205,	206,	207,
        208,	209,	210,	211,	212,	213,	214,	215,
        216,	217,	218,	219,	220,	221,	222,	223,
        224,	225,	226,	227,	228,	229,	230,	231,
        232,	233,	234,	235,	236,	237,	238,	239,
        240,	241,	242,	243,	244,	245,	246,	247,
        248,	249,	250,	251,	252,	253,	254,	255
};

EXT unsigned char PL_fold_locale[] = { /* Unfortunately not EXTCONST. */
        0,	1,	2,	3,	4,	5,	6,	7,
        8,	9,	10,	11,	12,	13,	14,	15,
        16,	17,	18,	19,	20,	21,	22,	23,
        24,	25,	26,	27,	28,	29,	30,	31,
        32,	33,	34,	35,	36,	37,	38,	39,
        40,	41,	42,	43,	44,	45,	46,	47,
        48,	49,	50,	51,	52,	53,	54,	55,
        56,	57,	58,	59,	60,	61,	62,	63,
        64,	'a',	'b',	'c',	'd',	'e',	'f',	'g',
        'h',	'i',	'j',	'k',	'l',	'm',	'n',	'o',
        'p',	'q',	'r',	's',	't',	'u',	'v',	'w',
        'x',	'y',	'z',	91,	92,	93,	94,	95,
        96,	'A',	'B',	'C',	'D',	'E',	'F',	'G',
        'H',	'I',	'J',	'K',	'L',	'M',	'N',	'O',
        'P',	'Q',	'R',	'S',	'T',	'U',	'V',	'W',
        'X',	'Y',	'Z',	123,	124,	125,	126,	127,
        128,	129,	130,	131,	132,	133,	134,	135,
        136,	137,	138,	139,	140,	141,	142,	143,
        144,	145,	146,	147,	148,	149,	150,	151,
        152,	153,	154,	155,	156,	157,	158,	159,
        160,	161,	162,	163,	164,	165,	166,	167,
        168,	169,	170,	171,	172,	173,	174,	175,
        176,	177,	178,	179,	180,	181,	182,	183,
        184,	185,	186,	187,	188,	189,	190,	191,
        192,	193,	194,	195,	196,	197,	198,	199,
        200,	201,	202,	203,	204,	205,	206,	207,
        208,	209,	210,	211,	212,	213,	214,	215,
        216,	217,	218,	219,	220,	221,	222,	223,
        224,	225,	226,	227,	228,	229,	230,	231,
        232,	233,	234,	235,	236,	237,	238,	239,
        240,	241,	242,	243,	244,	245,	246,	247,
        248,	249,	250,	251,	252,	253,	254,	255
};

EXTCONST  unsigned char PL_fold_latin1[] = {
    /* Full latin1 complement folding, except for three problematic code points:
     *	Micro sign (181 = 0xB5) and y with diearesis (255 = 0xFF) have their
     *	fold complements outside the Latin1 range, so can't match something
     *	that isn't in utf8.
     *	German lower case sharp s (223 = 0xDF) folds to two characters, 'ss',
     *	not one, so can't be represented in this table.
     *
     * All have to be specially handled */
        0,	1,	2,	3,	4,	5,	6,	7,
        8,	9,	10,	11,	12,	13,	14,	15,
        16,	17,	18,	19,	20,	21,	22,	23,
        24,	25,	26,	27,	28,	29,	30,	31,
        32,	33,	34,	35,	36,	37,	38,	39,
        40,	41,	42,	43,	44,	45,	46,	47,
        48,	49,	50,	51,	52,	53,	54,	55,
        56,	57,	58,	59,	60,	61,	62,	63,
        64,	'a',	'b',	'c',	'd',	'e',	'f',	'g',
        'h',	'i',	'j',	'k',	'l',	'm',	'n',	'o',
        'p',	'q',	'r',	's',	't',	'u',	'v',	'w',
        'x',	'y',	'z',	91,	92,	93,	94,	95,
        96,	'A',	'B',	'C',	'D',	'E',	'F',	'G',
        'H',	'I',	'J',	'K',	'L',	'M',	'N',	'O',
        'P',	'Q',	'R',	'S',	'T',	'U',	'V',	'W',
        'X',	'Y',	'Z',	123,	124,	125,	126,	127,
        128,	129,	130,	131,	132,	133,	134,	135,
        136,	137,	138,	139,	140,	141,	142,	143,
        144,	145,	146,	147,	148,	149,	150,	151,
        152,	153,	154,	155,	156,	157,	158,	159,
        160,	161,	162,	163,	164,	165,	166,	167,
        168,	169,	170,	171,	172,	173,	174,	175,
        176,	177,	178,	179,	180,	181 /*micro */,	182,	183,
        184,	185,	186,	187,	188,	189,	190,	191,
        192+32,	193+32,	194+32,	195+32,	196+32,	197+32,	198+32,	199+32,
        200+32,	201+32,	202+32,	203+32,	204+32,	205+32,	206+32,	207+32,
        208+32,	209+32,	210+32,	211+32,	212+32,	213+32,	214+32,	215,
        216+32,	217+32,	218+32,	219+32,	220+32,	221+32,	222+32,	223 /* ss */,
        224-32,	225-32,	226-32,	227-32,	228-32,	229-32,	230-32,	231-32,
        232-32,	233-32,	234-32,	235-32,	236-32,	237-32,	238-32,	239-32,
        240-32,	241-32,	242-32,	243-32,	244-32,	245-32,	246-32,	247,
        248-32,	249-32,	250-32,	251-32,	252-32,	253-32,	254-32,
        255 /* y with diaeresis */
};

/* If these tables are accessed through ebcdic, the access will be converted to
 * latin1 first */
EXTCONST  unsigned char PL_latin1_lc[] = {  /* lowercasing */
        0,	1,	2,	3,	4,	5,	6,	7,
        8,	9,	10,	11,	12,	13,	14,	15,
        16,	17,	18,	19,	20,	21,	22,	23,
        24,	25,	26,	27,	28,	29,	30,	31,
        32,	33,	34,	35,	36,	37,	38,	39,
        40,	41,	42,	43,	44,	45,	46,	47,
        48,	49,	50,	51,	52,	53,	54,	55,
        56,	57,	58,	59,	60,	61,	62,	63,
        64,	'a',	'b',	'c',	'd',	'e',	'f',	'g',
        'h',	'i',	'j',	'k',	'l',	'm',	'n',	'o',
        'p',	'q',	'r',	's',	't',	'u',	'v',	'w',
        'x',	'y',	'z',	91,	92,	93,	94,	95,
        96,	97,	98,	99,	100,	101,	102,	103,
        104,	105,	106,	107,	108,	109,	110,	111,
        112,	113,	114,	115,	116,	117,	118,	119,
        120,	121,	122,	123,	124,	125,	126,	127,
        128,	129,	130,	131,	132,	133,	134,	135,
        136,	137,	138,	139,	140,	141,	142,	143,
        144,	145,	146,	147,	148,	149,	150,	151,
        152,	153,	154,	155,	156,	157,	158,	159,
        160,	161,	162,	163,	164,	165,	166,	167,
        168,	169,	170,	171,	172,	173,	174,	175,
        176,	177,	178,	179,	180,	181,	182,	183,
        184,	185,	186,	187,	188,	189,	190,	191,
        192+32,	193+32,	194+32,	195+32,	196+32,	197+32,	198+32,	199+32,
        200+32,	201+32,	202+32,	203+32,	204+32,	205+32,	206+32,	207+32,
        208+32,	209+32,	210+32,	211+32,	212+32,	213+32,	214+32,	215,
        216+32,	217+32,	218+32,	219+32,	220+32,	221+32,	222+32,	223,
        224,	225,	226,	227,	228,	229,	230,	231,
        232,	233,	234,	235,	236,	237,	238,	239,
        240,	241,	242,	243,	244,	245,	246,	247,
        248,	249,	250,	251,	252,	253,	254,	255
};

/* upper and title case of latin1 characters, modified so that the three tricky
 * ones are mapped to 255 (which is one of the three) */
EXTCONST  unsigned char PL_mod_latin1_uc[] = {
        0,	1,	2,	3,	4,	5,	6,	7,
        8,	9,	10,	11,	12,	13,	14,	15,
        16,	17,	18,	19,	20,	21,	22,	23,
        24,	25,	26,	27,	28,	29,	30,	31,
        32,	33,	34,	35,	36,	37,	38,	39,
        40,	41,	42,	43,	44,	45,	46,	47,
        48,	49,	50,	51,	52,	53,	54,	55,
        56,	57,	58,	59,	60,	61,	62,	63,
        64,	65,	66,	67,	68,	69,	70,	71,
        72,	73,	74,	75,	76,	77,	78,	79,
        80,	81,	82,	83,	84,	85,	86,	87,
        88,	89,	90,	91,	92,	93,	94,	95,
        96,	'A',	'B',	'C',	'D',	'E',	'F',	'G',
        'H',	'I',	'J',	'K',	'L',	'M',	'N',	'O',
        'P',	'Q',	'R',	'S',	'T',	'U',	'V',	'W',
        'X',	'Y',	'Z',	123,	124,	125,	126,	127,
        128,	129,	130,	131,	132,	133,	134,	135,
        136,	137,	138,	139,	140,	141,	142,	143,
        144,	145,	146,	147,	148,	149,	150,	151,
        152,	153,	154,	155,	156,	157,	158,	159,
        160,	161,	162,	163,	164,	165,	166,	167,
        168,	169,	170,	171,	172,	173,	174,	175,
        176,	177,	178,	179,	180,	255 /*micro*/,	182,	183,
        184,	185,	186,	187,	188,	189,	190,	191,
        192,	193,	194,	195,	196,	197,	198,	199,
        200,	201,	202,	203,	204,	205,	206,	207,
        208,	209,	210,	211,	212,	213,	214,	215,
        216,	217,	218,	219,	220,	221,	222,
#    if    UNICODE_MAJOR_VERSION > 2                                        \
       || (UNICODE_MAJOR_VERSION == 2 && UNICODE_DOT_VERSION >= 1           \
                                      && UNICODE_DOT_DOT_VERSION >= 8)
                                                                255 /*sharp s*/,
#    else   /* uc(sharp s) is 'sharp s' itself in early unicode */
                                                                223,
#    endif
        224-32,	225-32,	226-32,	227-32,	228-32,	229-32,	230-32,	231-32,
        232-32,	233-32,	234-32,	235-32,	236-32,	237-32,	238-32,	239-32,
        240-32,	241-32,	242-32,	243-32,	244-32,	245-32,	246-32,	247,
        248-32,	249-32,	250-32,	251-32,	252-32,	253-32,	254-32,	255
};
#  endif  /* !EBCDIC, but still in DOINIT */
#else	/* ! DOINIT */
#  ifndef EBCDIC
EXTCONST unsigned char PL_fold[];
EXTCONST unsigned char PL_fold_latin1[];
EXTCONST unsigned char PL_mod_latin1_uc[];
EXTCONST unsigned char PL_latin1_lc[];
EXT      unsigned char PL_fold_locale[]; /* Unfortunately not EXTCONST. */
#   endif
#endif

/* Although only used for debugging, these constants must be available in
 * non-debugging builds too, since they're used in ext/re/re_exec.c,
 * which has DEBUGGING enabled always */
#ifdef DOINIT
EXTCONST char* const PL_block_type[] = {
        "NULL",
        "WHEN",
        "BLOCK",
        "GIVEN",
        "LOOP_ARY",
        "LOOP_LAZYSV",
        "LOOP_LAZYIV",
        "LOOP_LIST",
        "LOOP_PLAIN",
        "SUB",
        "FORMAT",
        "EVAL",
        "SUBST",
        "DEFER"
};
#else
EXTCONST char* PL_block_type[];
#endif

/* These are all the compile time options that affect binary compatibility.
   Other compile time options that are binary compatible are in perl.c
   (in S_Internals_V()). Both are combined for the output of perl -V
   However, this string will be embedded in any shared perl library, which will
   allow us add a comparison check in perlmain.c in the near future.  */
#ifdef DOINIT
EXTCONST char PL_bincompat_options[] =
#  ifdef DEBUG_LEAKING_SCALARS
                             " DEBUG_LEAKING_SCALARS"
#  endif
#  ifdef DEBUG_LEAKING_SCALARS_FORK_DUMP
                             " DEBUG_LEAKING_SCALARS_FORK_DUMP"
#  endif
#  ifdef HAS_TIMES
                             " HAS_TIMES"
#  endif
#  ifdef HAVE_INTERP_INTERN
                             " HAVE_INTERP_INTERN"
#  endif
#  ifdef MULTIPLICITY
                             " MULTIPLICITY"
#  endif
#  ifdef MYMALLOC
                             " MYMALLOC"
#  endif
#  ifdef PERLIO_LAYERS
                             " PERLIO_LAYERS"
#  endif
#  ifdef PERL_DEBUG_READONLY_COW
                             " PERL_DEBUG_READONLY_COW"
#  endif
#  ifdef PERL_DEBUG_READONLY_OPS
                             " PERL_DEBUG_READONLY_OPS"
#  endif
#  ifdef PERL_IMPLICIT_SYS
                             " PERL_IMPLICIT_SYS"
#  endif
#  ifdef PERL_MICRO
                             " PERL_MICRO"
#  endif
#  ifdef PERL_POISON
                             " PERL_POISON"
#  endif
#  ifdef PERL_SAWAMPERSAND
                             " PERL_SAWAMPERSAND"
#  endif
#  ifdef PERL_TRACK_MEMPOOL
                             " PERL_TRACK_MEMPOOL"
#  endif
#  ifdef PERL_USES_PL_PIDSTATUS
                             " PERL_USES_PL_PIDSTATUS"
#  endif
#  ifdef USE_64_BIT_ALL
                             " USE_64_BIT_ALL"
#  endif
#  ifdef USE_64_BIT_INT
                             " USE_64_BIT_INT"
#  endif
#  ifdef USE_IEEE
                             " USE_IEEE"
#  endif
#  ifdef USE_ITHREADS
                             " USE_ITHREADS"
#  endif
#  ifdef USE_LARGE_FILES
                             " USE_LARGE_FILES"
#  endif
#  ifdef USE_LOCALE_COLLATE
                             " USE_LOCALE_COLLATE"
#  endif
#  ifdef USE_LOCALE_NUMERIC
                             " USE_LOCALE_NUMERIC"
#  endif
#  ifdef USE_LOCALE_TIME
                             " USE_LOCALE_TIME"
#  endif
#  ifdef USE_LONG_DOUBLE
                             " USE_LONG_DOUBLE"
#  endif
#  ifdef USE_PERLIO
                             " USE_PERLIO"
#  endif
#  ifdef USE_QUADMATH
                             " USE_QUADMATH"
#  endif
#  ifdef USE_REENTRANT_API
                             " USE_REENTRANT_API"
#  endif
#  ifdef USE_SOCKS
                             " USE_SOCKS"
#  endif
#  ifdef VMS_DO_SOCKETS
                             " VMS_DO_SOCKETS"
#  endif
#  ifdef VMS_SHORTEN_LONG_SYMBOLS
                             " VMS_SHORTEN_LONG_SYMBOLS"
#  endif
#  ifdef VMS_WE_ARE_CASE_SENSITIVE
                             " VMS_SYMBOL_CASE_AS_IS"
#  endif
  "";
#else
EXTCONST char PL_bincompat_options[];
#endif

#ifndef PERL_SET_PHASE
#  define PERL_SET_PHASE(new_phase) \
    PERL_DTRACE_PROBE_PHASE(new_phase); \
    PL_phase = new_phase;
#endif

/* The interpreter phases. If these ever change, PL_phase_names right below will
 * need to be updated accordingly. */
enum perl_phase {
    PERL_PHASE_CONSTRUCT	= 0,
    PERL_PHASE_START		= 1,
    PERL_PHASE_CHECK		= 2,
    PERL_PHASE_INIT		= 3,
    PERL_PHASE_RUN		= 4,
    PERL_PHASE_END		= 5,
    PERL_PHASE_DESTRUCT		= 6
};

#ifdef DOINIT
EXTCONST char *const PL_phase_names[] = {
    "CONSTRUCT",
    "START",
    "CHECK",
    "INIT",
    "RUN",
    "END",
    "DESTRUCT"
};
#else
EXTCONST char *const PL_phase_names[];
#endif

/*
=for apidoc_section $utility

=for apidoc phase_name

Returns the given phase's name as a NUL-terminated string.

For example, to print a stack trace that includes the current
interpreter phase you might do:

    const char* phase_name = phase_name(PL_phase);
    mess("This is weird. (Perl phase: %s)", phase_name);

=cut
*/

#define phase_name(phase) (PL_phase_names[phase])

#ifndef PERL_CORE
/* Do not use this macro. It only exists for extensions that rely on PL_dirty
 * instead of using the newer PL_phase, which provides everything PL_dirty
 * provided, and more. */
#  define PL_dirty cBOOL(PL_phase == PERL_PHASE_DESTRUCT)

#  define PL_amagic_generation PL_na
#  define PL_encoding ((SV *)NULL)
#endif /* !PERL_CORE */

#define PL_hints PL_compiling.cop_hints
#define PL_maxo  MAXO

END_EXTERN_C

/*****************************************************************************/
/* This lexer/parser stuff is currently global since yacc is hard to reenter */
/*****************************************************************************/
/* XXX This needs to be revisited, since BEGIN makes yacc re-enter... */

#ifdef __Lynx__
/* LynxOS defines these in scsi.h which is included via ioctl.h */
#ifdef FORMAT
#undef FORMAT
#endif
#ifdef SPACE
#undef SPACE
#endif
#endif

#define LEX_NOTPARSING		11	/* borrowed from toke.c */

typedef enum {
    XOPERATOR,
    XTERM,
    XREF,
    XSTATE,
    XBLOCK,
    XATTRBLOCK, /* next token should be an attribute or block */
    XATTRTERM,  /* next token should be an attribute, or block in a term */
    XTERMBLOCK,
    XBLOCKTERM,
    XPOSTDEREF,
    XTERMORDORDOR /* evil hack */
    /* update exp_name[] in toke.c if adding to this enum */
} expectation;

#define KEY_sigvar 0xFFFF /* fake keyword representing a signature var */

/* Hints are now stored in a dedicated U32, so the bottom 8 bits are no longer
   special and there is no need for HINT_PRIVATE_MASK for COPs.

    NOTE: The typical module using these has the bit value hard-coded, so don't
    blindly change the values of these.

   If we run out of bits, the 2 locale ones could be combined.  The PARTIAL one
   is for "use locale 'FOO'" which excludes some categories.  It requires going
   to %^H to find out which are in and which are out.  This could be extended
   for the normal case of a plain HINT_LOCALE, so that %^H would be used for
   any locale form. */
#define HINT_INTEGER		0x00000001 /* integer pragma */
#define HINT_STRICT_REFS	0x00000002 /* strict pragma */
#define HINT_LOCALE		0x00000004 /* locale pragma */
#define HINT_BYTES		0x00000008 /* bytes pragma */
#define HINT_LOCALE_PARTIAL	0x00000010 /* locale, but a subset of categories */

#define HINT_EXPLICIT_STRICT_REFS	0x00000020 /* strict.pm */
#define HINT_EXPLICIT_STRICT_SUBS	0x00000040 /* strict.pm */
#define HINT_EXPLICIT_STRICT_VARS	0x00000080 /* strict.pm */

#define HINT_BLOCK_SCOPE	0x00000100
#define HINT_STRICT_SUBS	0x00000200 /* strict pragma */
#define HINT_STRICT_VARS	0x00000400 /* strict pragma */
#define HINT_UNI_8_BIT		0x00000800 /* unicode_strings feature */

/* The HINT_NEW_* constants are used by the overload pragma */
#define HINT_NEW_INTEGER	0x00001000
#define HINT_NEW_FLOAT		0x00002000
#define HINT_NEW_BINARY		0x00004000
#define HINT_NEW_STRING		0x00008000
#define HINT_NEW_RE		0x00010000
#define HINT_LOCALIZE_HH	0x00020000 /* %^H needs to be copied */
#define HINT_LEXICAL_IO_IN	0x00040000 /* ${^OPEN} is set for input */
#define HINT_LEXICAL_IO_OUT	0x00080000 /* ${^OPEN} is set for output */

#define HINT_RE_TAINT		0x00100000 /* re pragma */
#define HINT_RE_EVAL		0x00200000 /* re pragma */

#define HINT_FILETEST_ACCESS	0x00400000 /* filetest pragma */
#define HINT_UTF8		0x00800000 /* utf8 pragma */

#define HINT_NO_AMAGIC		0x01000000 /* overloading pragma */

#define HINT_RE_FLAGS		0x02000000 /* re '/xism' pragma */

#define HINT_FEATURE_MASK	0x3c000000 /* 4 bits for feature bundles */

                                /* Note: Used for HINT_M_VMSISH_*,
                                   currently defined by vms/vmsish.h:
                                0x40000000
                                0x80000000
                                 */

#define HINT_ALL_STRICT       HINT_STRICT_REFS \
                            | HINT_STRICT_SUBS \
                            | HINT_STRICT_VARS

#ifdef USE_STRICT_BY_DEFAULT
#define HINTS_DEFAULT            HINT_ALL_STRICT
#else
#define HINTS_DEFAULT            0
#endif

/* flags for PL_sawampersand */

#define SAWAMPERSAND_LEFT       1   /* saw $` */
#define SAWAMPERSAND_MIDDLE     2   /* saw $& */
#define SAWAMPERSAND_RIGHT      4   /* saw $' */

#ifndef PERL_SAWAMPERSAND
# define PL_sawampersand \
        (SAWAMPERSAND_LEFT|SAWAMPERSAND_MIDDLE|SAWAMPERSAND_RIGHT)
#endif

/* Used for debugvar magic */
#define DBVARMG_SINGLE  0
#define DBVARMG_TRACE   1
#define DBVARMG_SIGNAL  2
#define DBVARMG_COUNT   3

#define PL_DBsingle_iv  (PL_DBcontrol[DBVARMG_SINGLE])
#define PL_DBtrace_iv   (PL_DBcontrol[DBVARMG_TRACE])
#define PL_DBsignal_iv  (PL_DBcontrol[DBVARMG_SIGNAL])

/* Various states of the input record separator SV (rs) */
#define RsSNARF(sv)   (! SvOK(sv))
#define RsSIMPLE(sv)  (SvOK(sv) && (! SvPOK(sv) || SvCUR(sv)))
#define RsPARA(sv)    (SvPOK(sv) && ! SvCUR(sv))
#define RsRECORD(sv)  (SvROK(sv) && (SvIV(SvRV(sv)) > 0))

/* A struct for keeping various DEBUGGING related stuff,
 * neatly packed.  Currently only scratch variables for
 * constructing debug output are included.  Needed always,
 * not just when DEBUGGING, though, because of the re extension. c*/
struct perl_debug_pad {
  SV pad[3];
};

#define PERL_DEBUG_PAD(i)	&(PL_debug_pad.pad[i])
#define PERL_DEBUG_PAD_ZERO(i)	(SvPVX(PERL_DEBUG_PAD(i))[0] = 0, \
        (((XPV*) SvANY(PERL_DEBUG_PAD(i)))->xpv_cur = 0), \
        PERL_DEBUG_PAD(i))

/* Enable variables which are pointers to functions */
typedef void (*peep_t)(pTHX_ OP* o);
typedef regexp* (*regcomp_t) (pTHX_ char* exp, char* xend, PMOP* pm);
typedef I32     (*regexec_t) (pTHX_ regexp* prog, char* stringarg,
                                      char* strend, char* strbeg, I32 minend,
                                      SV* screamer, void* data, U32 flags);
typedef char*   (*re_intuit_start_t) (pTHX_ regexp *prog, SV *sv,
                                                char *strpos, char *strend,
                                                U32 flags,
                                                re_scream_pos_data *d);
typedef SV*	(*re_intuit_string_t) (pTHX_ regexp *prog);
typedef void	(*regfree_t) (pTHX_ struct regexp* r);
typedef regexp* (*regdupe_t) (pTHX_ const regexp* r, CLONE_PARAMS *param);
typedef I32     (*re_fold_t)(const char *, char const *, I32);

typedef void (*DESTRUCTORFUNC_NOCONTEXT_t) (void*);
typedef void (*DESTRUCTORFUNC_t) (pTHX_ void*);
typedef void (*SVFUNC_t) (pTHX_ SV* const);
typedef I32  (*SVCOMPARE_t) (pTHX_ SV* const, SV* const);
typedef void (*XSINIT_t) (pTHX);
typedef void (*ATEXIT_t) (pTHX_ void*);
typedef void (*XSUBADDR_t) (pTHX_ CV *);

typedef OP* (*Perl_ppaddr_t)(pTHX);
typedef OP* (*Perl_check_t) (pTHX_ OP*);
typedef void(*Perl_ophook_t)(pTHX_ OP*);
typedef int (*Perl_keyword_plugin_t)(pTHX_ char*, STRLEN, OP**);
typedef void(*Perl_cpeep_t)(pTHX_ OP *, OP *);

typedef void(*globhook_t)(pTHX);

#define KEYWORD_PLUGIN_DECLINE 0
#define KEYWORD_PLUGIN_STMT    1
#define KEYWORD_PLUGIN_EXPR    2

/* Interpreter exitlist entry */
typedef struct exitlistentry {
    void (*fn) (pTHX_ void*);
    void *ptr;
} PerlExitListEntry;

/* if you only have signal() and it resets on each signal, FAKE_PERSISTENT_SIGNAL_HANDLERS fixes */
/* These have to be before perlvars.h */
#if !defined(HAS_SIGACTION) && defined(VMS)
#  define  FAKE_PERSISTENT_SIGNAL_HANDLERS
#endif
/* if we're doing kill() with sys$sigprc on VMS, FAKE_DEFAULT_SIGNAL_HANDLERS */
#if defined(KILL_BY_SIGPRC)
#  define  FAKE_DEFAULT_SIGNAL_HANDLERS
#endif

#if !defined(MULTIPLICITY)

struct interpreter {
    char broiled;
};

#else

/* If we have multiple interpreters define a struct
   holding variables which must be per-interpreter
   If we don't have threads anything that would have
   be per-thread is per-interpreter.
*/

/* Set up PERLVAR macros for populating structs */
#  define PERLVAR(prefix,var,type) type prefix##var;

/* 'var' is an array of length 'n' */
#  define PERLVARA(prefix,var,n,type) type prefix##var[n];

/* initialize 'var' to init' */
#  define PERLVARI(prefix,var,type,init) type prefix##var;

/* like PERLVARI, but make 'var' a const */
#  define PERLVARIC(prefix,var,type,init) type prefix##var;

struct interpreter {
#  include "intrpvar.h"
};

EXTCONST U16 PL_interp_size
  INIT(sizeof(struct interpreter));

#  define PERL_INTERPRETER_SIZE_UPTO_MEMBER(member)			\
    STRUCT_OFFSET(struct interpreter, member) +				\
    sizeof(((struct interpreter*)0)->member)

/* This will be useful for subsequent releases, because this has to be the
   same in your libperl as in main(), else you have a mismatch and must abort.
*/
EXTCONST U16 PL_interp_size_5_18_0
  INIT(PERL_INTERPRETER_SIZE_UPTO_MEMBER(PERL_LAST_5_18_0_INTERP_MEMBER));


/* Done with PERLVAR macros for now ... */
#  undef PERLVAR
#  undef PERLVARA
#  undef PERLVARI
#  undef PERLVARIC

#endif /* MULTIPLICITY */

struct tempsym; /* defined in pp_pack.c */

#include "thread.h"
#include "pp.h"

#undef PERL_CKDEF
#undef PERL_PPDEF
#define PERL_CKDEF(s)	PERL_CALLCONV OP *s (pTHX_ OP *o);
#define PERL_PPDEF(s)	PERL_CALLCONV OP *s (pTHX);

#ifdef MYMALLOC
#  include "malloc_ctl.h"
#endif

/*
 * This provides a layer of functions and macros to ensure extensions will
 * get to use the same RTL functions as the core.
 */
#if defined(WIN32)
#  include "win32iop.h"
#endif


#include "proto.h"

/* this has structure inits, so it cannot be included before here */
#include "opcode.h"

/* The following must follow proto.h as #defines mess up syntax */

#if !defined(PERL_FOR_X2P)
#  include "embedvar.h"
#endif

/* Now include all the 'global' variables
 * If we don't have threads or multiple interpreters
 * these include variables that would have been their struct-s
 */

#define PERLVAR(prefix,var,type) EXT type PL_##var;
#define PERLVARA(prefix,var,n,type) EXT type PL_##var[n];
#define PERLVARI(prefix,var,type,init) EXT type  PL_##var INIT(init);
#define PERLVARIC(prefix,var,type,init) EXTCONST type PL_##var INIT(init);

#if !defined(MULTIPLICITY)
START_EXTERN_C
#  include "intrpvar.h"
END_EXTERN_C
#  define PL_sv_yes   (PL_sv_immortals[0])
#  define PL_sv_undef (PL_sv_immortals[1])
#  define PL_sv_no    (PL_sv_immortals[2])
#  define PL_sv_zero  (PL_sv_immortals[3])
#endif

#ifdef PERL_CORE
/* All core uses now exterminated. Ensure no zombies can return:  */
#  undef PL_na
#endif

/* Now all the config stuff is setup we can include embed.h
   In particular, need the relevant *ish file included already, as it may
   define HAVE_INTERP_INTERN  */
#include "embed.h"

START_EXTERN_C

#  include "perlvars.h"

END_EXTERN_C

#undef PERLVAR
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC

#if !defined(MULTIPLICITY)
/* Set up PERLVAR macros for populating structs */
#  define PERLVAR(prefix,var,type) type prefix##var;
/* 'var' is an array of length 'n' */
#  define PERLVARA(prefix,var,n,type) type prefix##var[n];
/* initialize 'var' to init' */
#  define PERLVARI(prefix,var,type,init) type prefix##var;
/* like PERLVARI, but make 'var' a const */
#  define PERLVARIC(prefix,var,type,init) type prefix##var;

/* this is never instantiated, is it just used for sizeof(struct PerlHandShakeInterpreter) */
struct PerlHandShakeInterpreter {
#  include "intrpvar.h"
};
#  undef PERLVAR
#  undef PERLVARA
#  undef PERLVARI
#  undef PERLVARIC
#endif

START_EXTERN_C

/* dummy variables that hold pointers to both runops functions, thus forcing
 * them *both* to get linked in (useful for Peek.xs, debugging etc) */

EXTCONST runops_proc_t PL_runops_std
  INIT(Perl_runops_standard);
EXTCONST runops_proc_t PL_runops_dbg
  INIT(Perl_runops_debug);

#define EXT_MGVTBL EXTCONST MGVTBL

#define PERL_MAGIC_READONLY_ACCEPTABLE 0x40
#define PERL_MAGIC_VALUE_MAGIC 0x80
#define PERL_MAGIC_VTABLE_MASK 0x3F

/* can this type of magic be attached to a readonly SV? */
#define PERL_MAGIC_TYPE_READONLY_ACCEPTABLE(t) \
    (PL_magic_data[(U8)(t)] & PERL_MAGIC_READONLY_ACCEPTABLE)

/* Is this type of magic container magic (%ENV, $1 etc),
 * or value magic (pos, taint etc)?
 */
#define PERL_MAGIC_TYPE_IS_VALUE_MAGIC(t) \
    (PL_magic_data[(U8)(t)] & PERL_MAGIC_VALUE_MAGIC)

#include "mg_vtable.h"

#ifdef DOINIT
EXTCONST U8 PL_magic_data[256] =
#  ifdef PERL_MICRO
#    include "umg_data.h"
#  else
#    include "mg_data.h"
#  endif
;
#else
EXTCONST U8 PL_magic_data[256];
#endif

#ifdef DOINIT
                        /* NL IV NV PV INV PI PN MG RX GV LV AV HV CV FM IO */
EXTCONST bool
PL_valid_types_IVX[]    = { 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0 };
EXTCONST bool
PL_valid_types_NVX[]    = { 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0 };
EXTCONST bool
PL_valid_types_PVX[]    = { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1 };
EXTCONST bool
PL_valid_types_RV[]     = { 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1 };
EXTCONST bool
PL_valid_types_IV_set[] = { 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1 };
EXTCONST bool
PL_valid_types_NV_set[] = { 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };

EXTCONST U8
PL_deBruijn_bitpos_tab32[] = {
    /* https://graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn */
    0,   1, 28,  2, 29, 14, 24,  3, 30, 22, 20, 15, 25, 17,  4,  8,
    31, 27, 13, 23, 21, 19, 16,  7, 26, 12, 18,  6, 11,  5, 10,  9
};

EXTCONST U8
PL_deBruijn_bitpos_tab64[] = {
    /* https://stackoverflow.com/questions/11376288/fast-computing-of-log2-for-64-bit-integers */
    63,  0, 58,  1, 59, 47, 53,  2, 60, 39, 48, 27, 54, 33, 42,  3,
    61, 51, 37, 40, 49, 18, 28, 20, 55, 30, 34, 11, 43, 14, 22,  4,
    62, 57, 46, 52, 38, 26, 32, 41, 50, 36, 17, 19, 29, 10, 13, 21,
    56, 45, 25, 31, 35, 16,  9, 12, 44, 24, 15,  8, 23,  7,  6,  5
};

#else

EXTCONST bool PL_valid_types_IVX[];
EXTCONST bool PL_valid_types_NVX[];
EXTCONST bool PL_valid_types_PVX[];
EXTCONST bool PL_valid_types_RV[];
EXTCONST bool PL_valid_types_IV_set[];
EXTCONST bool PL_valid_types_NV_set[];
EXTCONST U8   PL_deBruijn_bitpos_tab32[];
EXTCONST U8   PL_deBruijn_bitpos_tab64[];

#endif

/* The constants for using PL_deBruijn_bitpos_tab */
#define PERL_deBruijnMagic32_  0x077CB531
#define PERL_deBruijnShift32_  27
#define PERL_deBruijnMagic64_  0x07EDD5E59A4E28C2
#define PERL_deBruijnShift64_  58

/* In C99 we could use designated (named field) union initializers.
 * In C89 we need to initialize the member declared first.
 * In C++ we need extern C initializers.
 *
 * With the U8_NV version you will want to have inner braces,
 * while with the NV_U8 use just the NV. */

#define INFNAN_U8_NV_DECL EXTCONST union { U8 u8[NVSIZE]; NV nv; }
#define INFNAN_NV_U8_DECL EXTCONST union { NV nv; U8 u8[NVSIZE]; }

/* if these never got defined, they need defaults */
#ifndef PERL_SET_CONTEXT
#  define PERL_SET_CONTEXT(i)		PERL_SET_INTERP(i)
#endif

#ifndef PERL_GET_CONTEXT
#  define PERL_GET_CONTEXT		PERL_GET_INTERP
#endif

#ifndef PERL_GET_THX
#  define PERL_GET_THX			((void*)NULL)
#endif

#ifndef PERL_SET_THX
#  define PERL_SET_THX(t)		NOOP
#endif

#ifndef EBCDIC

/* The tables below are adapted from
 * https://bjoern.hoehrmann.de/utf-8/decoder/dfa/, which requires this copyright
 * notice:

Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>

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.

*/

#  ifdef DOINIT
#    if 0       /* This is the original table given in
                   https://bjoern.hoehrmann.de/utf-8/decoder/dfa/ */
static U8 utf8d_C9[] = {
  /* The first part of the table maps bytes to character classes that
   * to reduce the size of the transition table and create bitmasks. */
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*-1F*/
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*-3F*/
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*-5F*/
   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*-7F*/
   1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, /*-9F*/
   7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,  7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, /*-BF*/
   8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2,  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, /*-DF*/
  10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, /*-FF*/

  /* The second part is a transition table that maps a combination
   * of a state of the automaton and a character class to a state. */
   0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,
  12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
  12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
  12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
  12,36,12,12,12,12,12,12,12,12,12,12
};

#    endif

/* This is a version of the above table customized for Perl that doesn't
 * exclude surrogates and accepts start bytes up through FD (FE on 64-bit
 * machines).  The classes have been renumbered so that the patterns are more
 * evident in the table.  The class numbers are structured so the values are:
 *
 *  a) UTF-8 invariant code points
 *          0
 *  b) Start bytes that always lead to either overlongs or some class of code
 *     point that needs outside intervention for handling (such as to raise a
 *     warning)
 *          1
 *  c) Start bytes that never lead to one of the above
 *      number of bytes in complete sequence
 *  d) Rest of start bytes (they can be resolved through this algorithm) and
 *     continuation bytes
 *          arbitrary class number chosen to not conflict with the above
 *          classes, and to index into the remaining table
 *
 * It would make the code simpler if start byte FF could also be handled, but
 * doing so would mean adding two more classes (one from splitting 80 from 81,
 * and one for FF), and nodes for each of 6 new continuation bytes.  The
 * current table has 436 entries; the new one would require 140 more = 576 (2
 * additional classes for each of the 10 existing nodes, and 20 for each of 6
 * new nodes.  The array would have to be made U16 instead of U8, not worth it
 * for this rarely encountered case
 *
 * The classes are
 *      00-7F           0   Always legal, single byte sequence
 *      80-81           7   Not legal immediately after start bytes E0 F0 F8 FC
 *                          FE
 *      82-83           8   Not legal immediately after start bytes E0 F0 F8 FC
 *      84-87           9   Not legal immediately after start bytes E0 F0 F8
 *      88-8F          10   Not legal immediately after start bytes E0 F0
 *      90-9F          11   Not legal immediately after start byte E0
 *      A0-BF          12   Always legal continuation byte
 *      C0,C1           1   Not legal: overlong
 *      C2-DF           2   Legal start byte for two byte sequences
 *      E0             13   Some sequences are overlong; others legal
 *      E1-EF           3   Legal start byte for three byte sequences
 *      F0             14   Some sequences are overlong; others legal
 *      F1-F7           4   Legal start byte for four byte sequences
 *      F8             15   Some sequences are overlong; others legal
 *      F9-FB           5   Legal start byte for five byte sequences
 *      FC             16   Some sequences are overlong; others legal
 *      FD              6   Legal start byte for six byte sequences
 *      FE             17   Some sequences are overlong; others legal
 *                          (is 1 on 32-bit machines, since it overflows)
 *      FF              1   Need to handle specially
 */

EXTCONST U8 PL_extended_utf8_dfa_tab[] = {
    /* The first part of the table maps bytes to character classes to reduce
     * the size of the transition table and create bitmasks. */
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*00-0F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*10-1F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*20-2F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*30-3F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*40-4F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*50-5F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*60-6F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*70-7F*/
   7, 7, 8, 8, 9, 9, 9, 9,10,10,10,10,10,10,10,10, /*80-8F*/
  11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, /*90-9F*/
  12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, /*A0-AF*/
  12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, /*B0-BF*/
   1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /*C0-CF*/
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /*D0-DF*/
  13, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /*E0-EF*/
  14, 4, 4, 4, 4, 4, 4, 4,15, 5, 5, 5,16, 6,       /*F0-FD*/
#    ifdef UV_IS_QUAD
                                            17,    /*FE*/
#    else
                                             1,    /*FE*/
#    endif
                                                1, /*FF*/

/* The second part is a transition table that maps a combination
 * of a state of the automaton and a character class to a new state, called a
 * node.  The nodes are:
 * N0     The initial state, and final accepting one.
 * N1     Any one continuation byte (80-BF) left.  This is transitioned to
 *        immediately when the start byte indicates a two-byte sequence
 * N2     Any two continuation bytes left.
 * N3     Any three continuation bytes left.
 * N4     Any four continuation bytes left.
 * N5     Any five continuation bytes left.
 * N6     Start byte is E0.  Continuation bytes 80-9F are illegal (overlong);
 *        the other continuations transition to N1
 * N7     Start byte is F0.  Continuation bytes 80-8F are illegal (overlong);
 *        the other continuations transition to N2
 * N8     Start byte is F8.  Continuation bytes 80-87 are illegal (overlong);
 *        the other continuations transition to N3
 * N9     Start byte is FC.  Continuation bytes 80-83 are illegal (overlong);
 *        the other continuations transition to N4
 * N10    Start byte is FE.  Continuation bytes 80-81 are illegal (overlong);
 *        the other continuations transition to N5
 * 1      Reject.  All transitions not mentioned above (except the single
 *        byte ones (as they are always legal)) are to this state.
 */

#    if defined(PERL_CORE)
#      define NUM_CLASSES 18
#      define N0 0
#      define N1 ((N0)   + NUM_CLASSES)
#      define N2 ((N1)   + NUM_CLASSES)
#      define N3 ((N2)   + NUM_CLASSES)
#      define N4 ((N3)   + NUM_CLASSES)
#      define N5 ((N4)   + NUM_CLASSES)
#      define N6 ((N5)   + NUM_CLASSES)
#      define N7 ((N6)   + NUM_CLASSES)
#      define N8 ((N7)   + NUM_CLASSES)
#      define N9 ((N8)   + NUM_CLASSES)
#      define N10 ((N9)  + NUM_CLASSES)

/*Class: 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17  */
/*N0*/   0, 1,N1,N2,N3,N4,N5, 1, 1, 1, 1, 1, 1,N6,N7,N8,N9,N10,
/*N1*/   1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
/*N2*/   1, 1, 1, 1, 1, 1, 1,N1,N1,N1,N1,N1,N1, 1, 1, 1, 1, 1,
/*N3*/   1, 1, 1, 1, 1, 1, 1,N2,N2,N2,N2,N2,N2, 1, 1, 1, 1, 1,
/*N4*/   1, 1, 1, 1, 1, 1, 1,N3,N3,N3,N3,N3,N3, 1, 1, 1, 1, 1,
/*N5*/   1, 1, 1, 1, 1, 1, 1,N4,N4,N4,N4,N4,N4, 1, 1, 1, 1, 1,

/*N6*/   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,N1, 1, 1, 1, 1, 1,
/*N7*/   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,N2,N2, 1, 1, 1, 1, 1,
/*N8*/   1, 1, 1, 1, 1, 1, 1, 1, 1, 1,N3,N3,N3, 1, 1, 1, 1, 1,
/*N9*/   1, 1, 1, 1, 1, 1, 1, 1, 1,N4,N4,N4,N4, 1, 1, 1, 1, 1,
/*N10*/  1, 1, 1, 1, 1, 1, 1, 1,N5,N5,N5,N5,N5, 1, 1, 1, 1, 1,
};

/* And below is a version of the above table that accepts only strict UTF-8.
 * Hence no surrogates nor non-characters, nor non-Unicode.  Thus, if the input
 * passes this dfa, it will be for a well-formed, non-problematic code point
 * that can be returned immediately.
 *
 * The "Implementation details" portion of
 * https://bjoern.hoehrmann.de/utf-8/decoder/dfa/ shows how
 * the first portion of the table maps each possible byte into a character
 * class.  And that the classes for those bytes which are start bytes have been
 * carefully chosen so they serve as well to be used as a shift value to mask
 * off the leading 1 bits of the start byte.  Unfortunately the addition of
 * being able to distinguish non-characters makes this not fully work.  This is
 * because, now, the start bytes E1-EF have to be broken into 3 classes instead
 * of 2:
 *  1) ED because it could be a surrogate
 *  2) EF because it could be a non-character
 *  3) the rest, which can never evaluate to a problematic code point.
 *
 * Each of E1-EF has three leading 1 bits, then a 0.  That means we could use a
 * shift (and hence class number) of either 3 or 4 to get a mask that works.
 * But that only allows two categories, and we need three.  khw made the
 * decision to therefore treat the ED start byte as an error, so that the dfa
 * drops out immediately for that.  In the dfa, classes 3 and 4 are used to
 * distinguish EF vs the rest.  Then special code is used to deal with ED,
 * that's executed only when the dfa drops out.  The code points started by ED
 * are half surrogates, and half hangul syllables.  This means that 2048 of
 * the hangul syllables (about 18%) take longer than all other non-problematic
 * code points to handle.
 *
 * The changes to handle non-characters requires the addition of states and
 * classes to the dfa.  (See the section on "Mapping bytes to character
 * classes" in the linked-to document for further explanation of the original
 * dfa.)
 *
 * The classes are
 *      00-7F           0
 *      80-8E           9
 *      8F             10
 *      90-9E          11
 *      9F             12
 *      A0-AE          13
 *      AF             14
 *      B0-B6          15
 *      B7             16
 *      B8-BD          15
 *      BE             17
 *      BF             18
 *      C0,C1           1
 *      C2-DF           2
 *      E0              7
 *      E1-EC           3
 *      ED              1
 *      EE              3
 *      EF              4
 *      F0              8
 *      F1-F3           6  (6 bits can be stripped)
 *      F4              5  (only 5 can be stripped)
 *      F5-FF           1
 */

EXTCONST U8 PL_strict_utf8_dfa_tab[] = {
    /* The first part of the table maps bytes to character classes to reduce
     * the size of the transition table and create bitmasks. */
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*00-0F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*10-1F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*20-2F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*30-3F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*40-4F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*50-5F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*60-6F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*70-7F*/
   9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,10, /*80-8F*/
  11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12, /*90-9F*/
  13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14, /*A0-AF*/
  15,15,15,15,15,15,15,16,15,15,15,15,15,15,17,18, /*B0-BF*/
   1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /*C0-CF*/
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /*D0-DF*/
   7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 4, /*E0-EF*/
   8, 6, 6, 6, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*F0-FF*/

/* The second part is a transition table that maps a combination
 * of a state of the automaton and a character class to a new state, called a
 * node.  The nodes are:
 * N0     The initial state, and final accepting one.
 * N1     Any one continuation byte (80-BF) left.  This is transitioned to
 *        immediately when the start byte indicates a two-byte sequence
 * N2     Any two continuation bytes left.
 * N3     Start byte is E0.  Continuation bytes 80-9F are illegal (overlong);
 *        the other continuations transition to state N1
 * N4     Start byte is EF.  Continuation byte B7 transitions to N8; BF to N9;
 *        the other continuations transitions to N1
 * N5     Start byte is F0.  Continuation bytes 80-8F are illegal (overlong);
 *        [9AB]F transition to N10; the other continuations to N2.
 * N6     Start byte is F[123].  Continuation bytes [89AB]F transition
 *        to N10; the other continuations to N2.
 * N7     Start byte is F4.  Continuation bytes 90-BF are illegal
 *        (non-unicode); 8F transitions to N10; the other continuations to N2
 * N8     Initial sequence is EF B7.  Continuation bytes 90-AF are illegal
 *        (non-characters); the other continuations transition to N0.
 * N9     Initial sequence is EF BF.  Continuation bytes BE and BF are illegal
 *        (non-characters); the other continuations transition to N0.
 * N10    Initial sequence is one of: F0 [9-B]F; F[123] [8-B]F; or F4 8F.
 *        Continuation byte BF transitions to N11; the other continuations to
 *        N1
 * N11    Initial sequence is the two bytes given in N10 followed by BF.
 *        Continuation bytes BE and BF are illegal (non-characters); the other
 *        continuations transition to N0.
 * 1      Reject.  All transitions not mentioned above (except the single
 *        byte ones (as they are always legal) are to this state.
 */

#      undef N0
#      undef N1
#      undef N2
#      undef N3
#      undef N4
#      undef N5
#      undef N6
#      undef N7
#      undef N8
#      undef N9
#      undef NUM_CLASSES
#      define NUM_CLASSES 19
#      define N0 0
#      define N1  ((N0)  + NUM_CLASSES)
#      define N2  ((N1)  + NUM_CLASSES)
#      define N3  ((N2)  + NUM_CLASSES)
#      define N4  ((N3)  + NUM_CLASSES)
#      define N5  ((N4)  + NUM_CLASSES)
#      define N6  ((N5)  + NUM_CLASSES)
#      define N7  ((N6)  + NUM_CLASSES)
#      define N8  ((N7)  + NUM_CLASSES)
#      define N9  ((N8)  + NUM_CLASSES)
#      define N10 ((N9)  + NUM_CLASSES)
#      define N11 ((N10) + NUM_CLASSES)

/*Class: 0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18 */
/*N0*/   0,  1, N1, N2, N4, N7, N6, N3, N5,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
/*N1*/   1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
/*N2*/   1,  1,  1,  1,  1,  1,  1,  1,  1, N1, N1, N1, N1, N1, N1, N1, N1, N1, N1,

/*N3*/   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, N1, N1, N1, N1, N1, N1,
/*N4*/   1,  1,  1,  1,  1,  1,  1,  1,  1, N1, N1, N1, N1, N1, N1, N1, N8, N1, N9,
/*N5*/   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, N2,N10, N2,N10, N2, N2, N2,N10,
/*N6*/   1,  1,  1,  1,  1,  1,  1,  1,  1, N2,N10, N2,N10, N2,N10, N2, N2, N2,N10,
/*N7*/   1,  1,  1,  1,  1,  1,  1,  1,  1, N2,N10,  1,  1,  1,  1,  1,  1,  1,  1,
/*N8*/   1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  1,  1,  1,  1,  0,  0,  0,  0,
/*N9*/   1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,
/*N10*/  1,  1,  1,  1,  1,  1,  1,  1,  1, N1, N1, N1, N1, N1, N1, N1, N1, N1,N11,
/*N11*/  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,
};

/* And below is yet another version of the above tables that accepts only UTF-8
 * as defined by Corregidum #9.  Hence no surrogates nor non-Unicode, but
 * it allows non-characters.  This is isomorphic to the original table
 * in https://bjoern.hoehrmann.de/utf-8/decoder/dfa/
 *
 * The classes are
 *      00-7F           0
 *      80-8F           9
 *      90-9F          10
 *      A0-BF          11
 *      C0,C1           1
 *      C2-DF           2
 *      E0              7
 *      E1-EC           3
 *      ED              4
 *      EE-EF           3
 *      F0              8
 *      F1-F3           6  (6 bits can be stripped)
 *      F4              5  (only 5 can be stripped)
 *      F5-FF           1
 */

EXTCONST U8 PL_c9_utf8_dfa_tab[] = {
    /* The first part of the table maps bytes to character classes to reduce
     * the size of the transition table and create bitmasks. */
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*00-0F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*10-1F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*20-2F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*30-3F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*40-4F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*50-5F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*60-6F*/
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*70-7F*/
   9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, /*80-8F*/
  10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, /*90-9F*/
  11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, /*A0-AF*/
  11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, /*B0-BF*/
   1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /*C0-CF*/
   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /*D0-DF*/
   7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, /*E0-EF*/
   8, 6, 6, 6, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*F0-FF*/

/* The second part is a transition table that maps a combination
 * of a state of the automaton and a character class to a new state, called a
 * node.  The nodes are:
 * N0     The initial state, and final accepting one.
 * N1     Any one continuation byte (80-BF) left.  This is transitioned to
 *        immediately when the start byte indicates a two-byte sequence
 * N2     Any two continuation bytes left.
 * N3     Any three continuation bytes left.
 * N4     Start byte is E0.  Continuation bytes 80-9F are illegal (overlong);
 *        the other continuations transition to state N1
 * N5     Start byte is ED.  Continuation bytes A0-BF all lead to surrogates,
 *        so are illegal.  The other continuations transition to state N1.
 * N6     Start byte is F0.  Continuation bytes 80-8F are illegal (overlong);
 *        the other continuations transition to N2
 * N7     Start byte is F4.  Continuation bytes 90-BF are illegal
 *        (non-unicode); the other continuations transition to N2
 * 1      Reject.  All transitions not mentioned above (except the single
 *        byte ones (as they are always legal) are to this state.
 */

#      undef N0
#      undef N1
#      undef N2
#      undef N3
#      undef N4
#      undef N5
#      undef N6
#      undef N7
#      undef NUM_CLASSES
#      define NUM_CLASSES 12
#      define N0 0
#      define N1  ((N0)  + NUM_CLASSES)
#      define N2  ((N1)  + NUM_CLASSES)
#      define N3  ((N2)  + NUM_CLASSES)
#      define N4  ((N3)  + NUM_CLASSES)
#      define N5  ((N4)  + NUM_CLASSES)
#      define N6  ((N5)  + NUM_CLASSES)
#      define N7  ((N6)  + NUM_CLASSES)

/*Class: 0   1   2   3   4   5   6   7   8   9  10  11 */
/*N0*/   0,  1, N1, N2, N5, N7, N3, N4, N6,  1,  1,  1,
/*N1*/   1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  0,
/*N2*/   1,  1,  1,  1,  1,  1,  1,  1,  1, N1, N1, N1,
/*N3*/   1,  1,  1,  1,  1,  1,  1,  1,  1, N2, N2, N2,

/*N4*/   1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, N1,
/*N5*/   1,  1,  1,  1,  1,  1,  1,  1,  1, N1, N1,  1,
/*N6*/   1,  1,  1,  1,  1,  1,  1,  1,  1,  1, N2, N2,
/*N7*/   1,  1,  1,  1,  1,  1,  1,  1,  1, N2,  1,  1,
};

#    endif /* defined(PERL_CORE) */
#  else     /* End of is DOINIT */

EXTCONST U8 PL_extended_utf8_dfa_tab[];
EXTCONST U8 PL_strict_utf8_dfa_tab[];
EXTCONST U8 PL_c9_utf8_dfa_tab[];

#  endif
#endif    /* end of isn't EBCDIC */

#include "overload.h"

END_EXTERN_C

struct am_table {
  U8 flags;
  U8 fallback;
  U16 spare;
  U32 was_ok_sub;
  CV* table[NofAMmeth];
};
struct am_table_short {
  U8 flags;
  U8 fallback;
  U16 spare;
  U32 was_ok_sub;
};
typedef struct am_table AMT;
typedef struct am_table_short AMTS;

#define AMGfallNEVER	1
#define AMGfallNO	2
#define AMGfallYES	3

#define AMTf_AMAGIC		1
#define AMT_AMAGIC(amt)		((amt)->flags & AMTf_AMAGIC)
#define AMT_AMAGIC_on(amt)	((amt)->flags |= AMTf_AMAGIC)
#define AMT_AMAGIC_off(amt)	((amt)->flags &= ~AMTf_AMAGIC)

#define StashHANDLER(stash,meth)	gv_handler((stash),CAT2(meth,_amg))

/*
 * some compilers like to redefine cos et alia as faster
 * (and less accurate?) versions called F_cos et cetera (Quidquid
 * latine dictum sit, altum viditur.)  This trick collides with
 * the Perl overloading (amg).  The following #defines fool both.
 */

#ifdef _FASTMATH
#   ifdef atan2
#       define F_atan2_amg  atan2_amg
#   endif
#   ifdef cos
#       define F_cos_amg    cos_amg
#   endif
#   ifdef exp
#       define F_exp_amg    exp_amg
#   endif
#   ifdef log
#       define F_log_amg    log_amg
#   endif
#   ifdef pow
#       define F_pow_amg    pow_amg
#   endif
#   ifdef sin
#       define F_sin_amg    sin_amg
#   endif
#   ifdef sqrt
#       define F_sqrt_amg   sqrt_amg
#   endif
#endif /* _FASTMATH */

#define PERLDB_ALL		(PERLDBf_SUB	| PERLDBf_LINE	|	\
                                 PERLDBf_NOOPT	| PERLDBf_INTER	|	\
                                 PERLDBf_SUBLINE| PERLDBf_SINGLE|	\
                                 PERLDBf_NAMEEVAL| PERLDBf_NAMEANON |   \
                                 PERLDBf_SAVESRC)
                                        /* No _NONAME, _GOTO */
#define PERLDBf_SUB		0x01	/* Debug sub enter/exit */
#define PERLDBf_LINE		0x02	/* Keep line # */
#define PERLDBf_NOOPT		0x04	/* Switch off optimizations */
#define PERLDBf_INTER		0x08	/* Preserve more data for
                                           later inspections  */
#define PERLDBf_SUBLINE		0x10	/* Keep subr source lines */
#define PERLDBf_SINGLE		0x20	/* Start with single-step on */
#define PERLDBf_NONAME		0x40	/* For _SUB: no name of the subr */
#define PERLDBf_GOTO		0x80	/* Report goto: call DB::goto */
#define PERLDBf_NAMEEVAL	0x100	/* Informative names for evals */
#define PERLDBf_NAMEANON	0x200	/* Informative names for anon subs */
#define PERLDBf_SAVESRC  	0x400	/* Save source lines into @{"_<$filename"} */
#define PERLDBf_SAVESRC_NOSUBS	0x800	/* Including evals that generate no subroutines */
#define PERLDBf_SAVESRC_INVALID	0x1000	/* Save source that did not compile */

#define PERLDB_SUB		(PL_perldb & PERLDBf_SUB)
#define PERLDB_LINE		(PL_perldb & PERLDBf_LINE)
#define PERLDB_NOOPT		(PL_perldb & PERLDBf_NOOPT)
#define PERLDB_INTER		(PL_perldb & PERLDBf_INTER)
#define PERLDB_SUBLINE		(PL_perldb & PERLDBf_SUBLINE)
#define PERLDB_SINGLE		(PL_perldb & PERLDBf_SINGLE)
#define PERLDB_SUB_NN		(PL_perldb & PERLDBf_NONAME)
#define PERLDB_GOTO		(PL_perldb & PERLDBf_GOTO)
#define PERLDB_NAMEEVAL 	(PL_perldb & PERLDBf_NAMEEVAL)
#define PERLDB_NAMEANON 	(PL_perldb & PERLDBf_NAMEANON)
#define PERLDB_SAVESRC  	(PL_perldb & PERLDBf_SAVESRC)
#define PERLDB_SAVESRC_NOSUBS	(PL_perldb & PERLDBf_SAVESRC_NOSUBS)
#define PERLDB_SAVESRC_INVALID	(PL_perldb & PERLDBf_SAVESRC_INVALID)

#define PERLDB_LINE_OR_SAVESRC (PL_perldb & (PERLDBf_LINE | PERLDBf_SAVESRC))

#ifdef USE_ITHREADS
#  define KEYWORD_PLUGIN_MUTEX_INIT    MUTEX_INIT(&PL_keyword_plugin_mutex)
#  define KEYWORD_PLUGIN_MUTEX_LOCK    MUTEX_LOCK(&PL_keyword_plugin_mutex)
#  define KEYWORD_PLUGIN_MUTEX_UNLOCK  MUTEX_UNLOCK(&PL_keyword_plugin_mutex)
#  define KEYWORD_PLUGIN_MUTEX_TERM    MUTEX_DESTROY(&PL_keyword_plugin_mutex)
#  define USER_PROP_MUTEX_INIT    MUTEX_INIT(&PL_user_prop_mutex)
#  define USER_PROP_MUTEX_LOCK    MUTEX_LOCK(&PL_user_prop_mutex)
#  define USER_PROP_MUTEX_UNLOCK  MUTEX_UNLOCK(&PL_user_prop_mutex)
#  define USER_PROP_MUTEX_TERM    MUTEX_DESTROY(&PL_user_prop_mutex)
#else
#  define KEYWORD_PLUGIN_MUTEX_INIT    NOOP
#  define KEYWORD_PLUGIN_MUTEX_LOCK    NOOP
#  define KEYWORD_PLUGIN_MUTEX_UNLOCK  NOOP
#  define KEYWORD_PLUGIN_MUTEX_TERM    NOOP
#  define USER_PROP_MUTEX_INIT    NOOP
#  define USER_PROP_MUTEX_LOCK    NOOP
#  define USER_PROP_MUTEX_UNLOCK  NOOP
#  define USER_PROP_MUTEX_TERM    NOOP
#endif

#ifdef USE_LOCALE /* These locale things are all subject to change */

   /* Returns TRUE if the plain locale pragma without a parameter is in effect.
    * */
#  define IN_LOCALE_RUNTIME	(PL_curcop                                  \
                              && CopHINTS_get(PL_curcop) & HINT_LOCALE)

   /* Returns TRUE if either form of the locale pragma is in effect */
#  define IN_SOME_LOCALE_FORM_RUNTIME                                       \
        cBOOL(CopHINTS_get(PL_curcop) & (HINT_LOCALE|HINT_LOCALE_PARTIAL))

#  define IN_LOCALE_COMPILETIME	cBOOL(PL_hints & HINT_LOCALE)
#  define IN_SOME_LOCALE_FORM_COMPILETIME                                   \
                        cBOOL(PL_hints & (HINT_LOCALE|HINT_LOCALE_PARTIAL))

/*
=for apidoc_section $locale

=for apidoc Amn|bool|IN_LOCALE

Evaluates to TRUE if the plain locale pragma without a parameter (S<C<use
locale>>) is in effect.

=for apidoc Amn|bool|IN_LOCALE_COMPILETIME

Evaluates to TRUE if, when compiling a perl program (including an C<eval>) if
the plain locale pragma without a parameter (S<C<use locale>>) is in effect.

=for apidoc Amn|bool|IN_LOCALE_RUNTIME

Evaluates to TRUE if, when executing a perl program (including an C<eval>) if
the plain locale pragma without a parameter (S<C<use locale>>) is in effect.

=cut
*/

#  define IN_LOCALE                                                         \
        (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
#  define IN_SOME_LOCALE_FORM                                               \
                    (IN_PERL_COMPILETIME ? IN_SOME_LOCALE_FORM_COMPILETIME  \
                                         : IN_SOME_LOCALE_FORM_RUNTIME)

#  define IN_LC_ALL_COMPILETIME   IN_LOCALE_COMPILETIME
#  define IN_LC_ALL_RUNTIME       IN_LOCALE_RUNTIME

#  define IN_LC_PARTIAL_COMPILETIME   cBOOL(PL_hints & HINT_LOCALE_PARTIAL)
#  define IN_LC_PARTIAL_RUNTIME                                             \
              (PL_curcop && CopHINTS_get(PL_curcop) & HINT_LOCALE_PARTIAL)

#  define IN_LC_COMPILETIME(category)                                       \
       (       IN_LC_ALL_COMPILETIME                                        \
        || (   IN_LC_PARTIAL_COMPILETIME                                    \
            && Perl__is_in_locale_category(aTHX_ TRUE, (category))))
#  define IN_LC_RUNTIME(category)                                           \
      (IN_LC_ALL_RUNTIME || (IN_LC_PARTIAL_RUNTIME                          \
                 && Perl__is_in_locale_category(aTHX_ FALSE, (category))))
#  define IN_LC(category)  \
                    (IN_LC_COMPILETIME(category) || IN_LC_RUNTIME(category))

#  if defined (PERL_CORE) || defined (PERL_IN_XSUB_RE)

     /* This internal macro should be called from places that operate under
      * locale rules.  If there is a problem with the current locale that
      * hasn't been raised yet, it will output a warning this time.  Because
      * this will so rarely  be true, there is no point to optimize for time;
      * instead it makes sense to minimize space used and do all the work in
      * the rarely called function */
#    ifdef USE_LOCALE_CTYPE
#      define _CHECK_AND_WARN_PROBLEMATIC_LOCALE                              \
                STMT_START {                                                  \
                    if (UNLIKELY(PL_warn_locale)) {                           \
                        Perl__warn_problematic_locale();                      \
                    }                                                         \
                }  STMT_END
#    else
#      define _CHECK_AND_WARN_PROBLEMATIC_LOCALE
#    endif


     /* These two internal macros are called when a warning should be raised,
      * and will do so if enabled.  The first takes a single code point
      * argument; the 2nd, is a pointer to the first byte of the UTF-8 encoded
      * string, and an end position which it won't try to read past */
#    define _CHECK_AND_OUTPUT_WIDE_LOCALE_CP_MSG(cp)                        \
        STMT_START {                                                        \
            if (! PL_in_utf8_CTYPE_locale && ckWARN(WARN_LOCALE)) {         \
                Perl_warner(aTHX_ packWARN(WARN_LOCALE),                    \
                                       "Wide character (U+%" UVXf ") in %s",\
                                       (UV) cp, OP_DESC(PL_op));            \
            }                                                               \
        }  STMT_END

#    define _CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG(s, send)                 \
        STMT_START { /* Check if to warn before doing the conversion work */\
            if (! PL_in_utf8_CTYPE_locale && ckWARN(WARN_LOCALE)) {         \
                UV cp = utf8_to_uvchr_buf((U8 *) (s), (U8 *) (send), NULL); \
                Perl_warner(aTHX_ packWARN(WARN_LOCALE),                    \
                    "Wide character (U+%" UVXf ") in %s",                   \
                    (cp == 0)                                               \
                     ? UNICODE_REPLACEMENT                                  \
                     : (UV) cp,                                             \
                    OP_DESC(PL_op));                                        \
            }                                                               \
        }  STMT_END

#  endif   /* PERL_CORE or PERL_IN_XSUB_RE */
#else   /* No locale usage */
#  define IN_LOCALE_RUNTIME                0
#  define IN_SOME_LOCALE_FORM_RUNTIME      0
#  define IN_LOCALE_COMPILETIME            0
#  define IN_SOME_LOCALE_FORM_COMPILETIME  0
#  define IN_LOCALE                        0
#  define IN_SOME_LOCALE_FORM              0
#  define IN_LC_ALL_COMPILETIME            0
#  define IN_LC_ALL_RUNTIME                0
#  define IN_LC_PARTIAL_COMPILETIME        0
#  define IN_LC_PARTIAL_RUNTIME            0
#  define IN_LC_COMPILETIME(category)      0
#  define IN_LC_RUNTIME(category)          0
#  define IN_LC(category)                  0
#  define _CHECK_AND_WARN_PROBLEMATIC_LOCALE
#  define _CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG(s, send)
#  define _CHECK_AND_OUTPUT_WIDE_LOCALE_CP_MSG(c)
#endif


/* Locale/thread synchronization macros. */
#if ! (   defined(USE_LOCALE)                                               \
       &&    defined(USE_ITHREADS)                                          \
       && (  ! defined(USE_THREAD_SAFE_LOCALE)                              \
           || (   defined(HAS_LOCALECONV)                                   \
               && (  ! defined(HAS_LOCALECONV_L)                            \
                   ||  defined(TS_W32_BROKEN_LOCALECONV)))                  \
           || (   defined(HAS_NL_LANGINFO)                                  \
               && ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L))                 \
           || (defined(HAS_MBLEN)  && ! defined(HAS_MBRLEN))                \
           || (defined(HAS_MBTOWC) && ! defined(HAS_MBRTOWC))               \
           || (defined(HAS_WCTOMB) && ! defined(HAS_WCRTOMB))))

/* The whole expression just above was complemented, so here we have no need
 * for thread synchronization, most likely it would be that this isn't a
 * threaded build. */
#  define LOCALE_INIT
#  define LOCALE_TERM
#  define LC_NUMERIC_LOCK(cond)     NOOP
#  define LC_NUMERIC_UNLOCK         NOOP
#  define LOCALECONV_LOCK           NOOP
#  define LOCALECONV_UNLOCK         NOOP
#  define LOCALE_READ_LOCK          NOOP
#  define LOCALE_READ_UNLOCK        NOOP
#  define MBLEN_LOCK                NOOP
#  define MBLEN_UNLOCK              NOOP
#  define MBTOWC_LOCK               NOOP
#  define MBTOWC_UNLOCK             NOOP
#  define NL_LANGINFO_LOCK          NOOP
#  define NL_LANGINFO_UNLOCK        NOOP
#  define SETLOCALE_LOCK            NOOP
#  define SETLOCALE_UNLOCK          NOOP
#  define WCTOMB_LOCK               NOOP
#  define WCTOMB_UNLOCK             NOOP
#else

   /* Here, we will need critical sections in locale handling, because one or
    * more of the above conditions are true.  This could be because the
    * platform doesn't have thread-safe locales, or that at least one of the
    * locale-dependent functions in the core isn't thread-safe.  The latter
    * case is generally because they return a pointer to a static buffer, which
    * may be per-process instead of per-thread.  There are supposedly
    * re-entrant, safe versions for all of them Perl currently uses (which the
    * #if above checks for), but most platforms don't have all the needed ones
    * available, and the Posix standard doesn't require nl_langinfo_l() to be
    * fully thread-safe, so a Configure probe was written.  localeconv_l() is
    * uncommon, and judging by bug reports on the web, some earlier library
    * localeconv_l versions were broken, so perhaps a probe is in order for
    * that, but it would be a pain to write.
    *
    * On non-thread-safe systems, some of the above functions are vulnerable to
    * races should another thread get control and change the locale in the
    * middle of their execution.
    *
    * We currently use a single mutex for all these cases.  This solves both
    * the problem of another thread changing the locale, and the buffer being
    * overwritten (the code copies the results to a safe place before releasing
    * the mutex).  Ideally, for locale thread-safe platforms where the only
    * issue is another thread clobbering the function's static buffer, there
    * would be a separate mutex for each such buffer.  Otherwise, things get
    * locked that don't need to.  But, it is not expected that any of these
    * will be called frequently, and the locked interval should be short, and
    * modern platforms will have reentrant versions (which don't lock) for
    * almost all of them, so khw thinks a single mutex should suffice. */
#  define LOCALE_LOCK_                                                      \
        STMT_START {                                                        \
            DEBUG_Lv(PerlIO_printf(Perl_debug_log,                          \
                    "%s: %d: locking locale\n", __FILE__, __LINE__));       \
            MUTEX_LOCK(&PL_locale_mutex);                                   \
        } STMT_END
#  define LOCALE_UNLOCK_                                                    \
        STMT_START {                                                        \
            DEBUG_Lv(PerlIO_printf(Perl_debug_log,                          \
                   "%s: %d: unlocking locale\n", __FILE__, __LINE__));      \
            MUTEX_UNLOCK(&PL_locale_mutex);                                 \
        } STMT_END

   /* We do define a different macro for each case; then if we want to have
    * separate mutexes for some of them, the only changes needed are here.
    * Define just the necessary macros.  The compiler should then croak if the
    * #ifdef's in the code are incorrect */
#  if defined(HAS_LOCALECONV) && (  ! defined(HAS_POSIX_2008_LOCALE)        \
                                 || ! defined(HAS_LOCALECONV_L)             \
                                 ||   defined(TS_W32_BROKEN_LOCALECONV))
#    define LOCALECONV_LOCK   LOCALE_LOCK_
#    define LOCALECONV_UNLOCK LOCALE_UNLOCK_
#  endif
#  if defined(HAS_NL_LANGINFO) && (   ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L) \
                                   || ! defined(HAS_POSIX_2008_LOCALE))
#    define NL_LANGINFO_LOCK   LOCALE_LOCK_
#    define NL_LANGINFO_UNLOCK LOCALE_UNLOCK_
#  endif
#  if defined(HAS_MBLEN) && ! defined(HAS_MBRLEN)
#    define MBLEN_LOCK   LOCALE_LOCK_
#    define MBLEN_UNLOCK LOCALE_UNLOCK_
#  endif
#  if defined(HAS_MBTOWC) && ! defined(HAS_MBRTOWC)
#    define MBTOWC_LOCK   LOCALE_LOCK_
#    define MBTOWC_UNLOCK LOCALE_UNLOCK_
#  endif
#  if defined(HAS_WCTOMB) && ! defined(HAS_WCRTOMB)
#    define WCTOMB_LOCK   LOCALE_LOCK_
#    define WCTOMB_UNLOCK LOCALE_UNLOCK_
#  endif
#  if defined(USE_THREAD_SAFE_LOCALE)
     /* On locale thread-safe systems, we don't need these workarounds */
#    define LOCALE_TERM_LC_NUMERIC_   NOOP
#    define LOCALE_INIT_LC_NUMERIC_   NOOP
#    define LC_NUMERIC_LOCK(cond)   NOOP
#    define LC_NUMERIC_UNLOCK       NOOP
#    define LOCALE_INIT_LC_NUMERIC_ NOOP
#    define LOCALE_TERM_LC_NUMERIC_ NOOP

     /* There may be instance core where we this is invoked yet should do
      * nothing.  Rather than have #ifdef's around them, define it here */
#    define SETLOCALE_LOCK    NOOP
#    define SETLOCALE_UNLOCK  NOOP
#  else
#    define SETLOCALE_LOCK   LOCALE_LOCK_
#    define SETLOCALE_UNLOCK LOCALE_UNLOCK_

    /* On platforms without per-thread locales, when another thread can switch
     * our locale, we need another mutex to create critical sections where we
     * want the LC_NUMERIC locale to be locked into either the C (standard)
     * locale, or the underlying locale, so that other threads interrupting
     * this one don't change it to the wrong state before we've had a chance to
     * complete our operation.  It can stay locked over an entire printf
     * operation, for example.  And so is made distinct from the LOCALE_LOCK
     * mutex.
     *
     * This simulates kind of a general semaphore.  The current thread will
     * lock the mutex if the per-thread variable is zero, and then increments
     * that variable.  Each corresponding UNLOCK decrements the variable until
     * it is 0, at which point it actually unlocks the mutex.  Since the
     * variable is per-thread, there is no race with other threads.
     *
     * The single argument is a condition to test for, and if true, to panic,
     * as this would be an attempt to complement the LC_NUMERIC state, and
     * we're not supposed to because it's locked.
     *
     * Clang improperly gives warnings for this, if not silenced:
     * https://clang.llvm.org/docs/ThreadSafetyAnalysis.html#conditional-locks
     *
     * If LC_NUMERIC_LOCK is combined with one of the LOCKs above, calls to
     * that and its corresponding unlock should be contained entirely within
     * the locked portion of LC_NUMERIC.  Those mutexes should be used only in
     * very short sections of code, while LC_NUMERIC_LOCK may span more
     * operations.  By always following this convention, deadlock should be
     * impossible.  But if necessary, the two mutexes could be combined. */
#    define LC_NUMERIC_LOCK(cond_to_panic_if_already_locked)                \
        CLANG_DIAG_IGNORE(-Wthread-safety)	     	                    \
        STMT_START {                                                        \
            if (PL_lc_numeric_mutex_depth <= 0) {                           \
                MUTEX_LOCK(&PL_lc_numeric_mutex);                           \
                PL_lc_numeric_mutex_depth = 1;                              \
                DEBUG_Lv(PerlIO_printf(Perl_debug_log,                      \
                         "%s: %d: locking lc_numeric; depth=1\n",           \
                         __FILE__, __LINE__));                              \
            }                                                               \
            else {                                                          \
                PL_lc_numeric_mutex_depth++;                                \
                DEBUG_Lv(PerlIO_printf(Perl_debug_log,                      \
                        "%s: %d: avoided lc_numeric_lock; new depth=%d\n",  \
                        __FILE__, __LINE__, PL_lc_numeric_mutex_depth));    \
                if (cond_to_panic_if_already_locked) {                      \
                    Perl_croak_nocontext("panic: %s: %d: Trying to change"  \
                                         " LC_NUMERIC incompatibly",        \
                                         __FILE__, __LINE__);               \
                }                                                           \
            }                                                               \
        } STMT_END

#    define LC_NUMERIC_UNLOCK                                               \
        STMT_START {                                                        \
            if (PL_lc_numeric_mutex_depth <= 1) {                           \
                MUTEX_UNLOCK(&PL_lc_numeric_mutex);                         \
                PL_lc_numeric_mutex_depth = 0;                              \
                DEBUG_Lv(PerlIO_printf(Perl_debug_log,                      \
                         "%s: %d: unlocking lc_numeric; depth=0\n",         \
                         __FILE__, __LINE__));                              \
            }                                                               \
            else {                                                          \
                PL_lc_numeric_mutex_depth--;                                \
                DEBUG_Lv(PerlIO_printf(Perl_debug_log,                      \
                        "%s: %d: avoided lc_numeric_unlock; new depth=%d\n",\
                        __FILE__, __LINE__, PL_lc_numeric_mutex_depth));    \
            }                                                               \
        } STMT_END                                                          \
        CLANG_DIAG_RESTORE

#    define LOCALE_INIT_LC_NUMERIC_   MUTEX_INIT(&PL_lc_numeric_mutex)
#    define LOCALE_TERM_LC_NUMERIC_   MUTEX_DESTROY(&PL_lc_numeric_mutex)
#  endif

#  ifdef USE_POSIX_2008_LOCALE
     /* We have a locale object holding the 'C' locale for Posix 2008 */
#    define LOCALE_TERM_POSIX_2008_                                         \
                    STMT_START {                                            \
                        if (PL_C_locale_obj) {                              \
                            /* Make sure we aren't using the locale         \
                             * space we are about to free */                \
                            uselocale(LC_GLOBAL_LOCALE);                    \
                            freelocale(PL_C_locale_obj);                    \
                            PL_C_locale_obj = (locale_t) NULL;              \
                        }                                                   \
                    } STMT_END
#  else
#    define LOCALE_TERM_POSIX_2008_  NOOP
#  endif

#  define LOCALE_INIT           STMT_START {                                \
                                    MUTEX_INIT(&PL_locale_mutex);           \
                                    LOCALE_INIT_LC_NUMERIC_;                \
                                } STMT_END

#  define LOCALE_TERM           STMT_START {                                \
                                    MUTEX_DESTROY(&PL_locale_mutex);        \
                                    LOCALE_TERM_LC_NUMERIC_;                \
                                    LOCALE_TERM_POSIX_2008_;                \
                                } STMT_END
#endif

#ifdef USE_LOCALE_NUMERIC

/* These macros are for toggling between the underlying locale (UNDERLYING or
 * LOCAL) and the C locale (STANDARD).  (Actually we don't have to use the C
 * locale if the underlying locale is indistinguishable from it in the numeric
 * operations used by Perl, namely the decimal point, and even the thousands
 * separator.)

=for apidoc_section $locale

=for apidoc Amn|void|DECLARATION_FOR_LC_NUMERIC_MANIPULATION

This macro should be used as a statement.  It declares a private variable
(whose name begins with an underscore) that is needed by the other macros in
this section.  Failing to include this correctly should lead to a syntax error.
For compatibility with C89 C compilers it should be placed in a block before
any executable statements.

=for apidoc Am|void|STORE_LC_NUMERIC_FORCE_TO_UNDERLYING

This is used by XS code that is C<LC_NUMERIC> locale-aware to force the
locale for category C<LC_NUMERIC> to be what perl thinks is the current
underlying locale.  (The perl interpreter could be wrong about what the
underlying locale actually is if some C or XS code has called the C library
function L<setlocale(3)> behind its back; calling L</sync_locale> before calling
this macro will update perl's records.)

A call to L</DECLARATION_FOR_LC_NUMERIC_MANIPULATION> must have been made to
declare at compile time a private variable used by this macro.  This macro
should be called as a single statement, not an expression, but with an empty
argument list, like this:

 {
    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
     ...
    STORE_LC_NUMERIC_FORCE_TO_UNDERLYING();
     ...
    RESTORE_LC_NUMERIC();
     ...
 }

The private variable is used to save the current locale state, so
that the requisite matching call to L</RESTORE_LC_NUMERIC> can restore it.

On threaded perls not operating with thread-safe functionality, this macro uses
a mutex to force a critical section.  Therefore the matching RESTORE should be
close by, and guaranteed to be called.

=for apidoc Am|void|STORE_LC_NUMERIC_SET_TO_NEEDED

This is used to help wrap XS or C code that is C<LC_NUMERIC> locale-aware.
This locale category is generally kept set to a locale where the decimal radix
character is a dot, and the separator between groups of digits is empty.  This
is because most XS code that reads floating point numbers is expecting them to
have this syntax.

This macro makes sure the current C<LC_NUMERIC> state is set properly, to be
aware of locale if the call to the XS or C code from the Perl program is
from within the scope of a S<C<use locale>>; or to ignore locale if the call is
instead from outside such scope.

This macro is the start of wrapping the C or XS code; the wrap ending is done
by calling the L</RESTORE_LC_NUMERIC> macro after the operation.  Otherwise
the state can be changed that will adversely affect other XS code.

A call to L</DECLARATION_FOR_LC_NUMERIC_MANIPULATION> must have been made to
declare at compile time a private variable used by this macro.  This macro
should be called as a single statement, not an expression, but with an empty
argument list, like this:

 {
    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
     ...
    STORE_LC_NUMERIC_SET_TO_NEEDED();
     ...
    RESTORE_LC_NUMERIC();
     ...
 }

On threaded perls not operating with thread-safe functionality, this macro uses
a mutex to force a critical section.  Therefore the matching RESTORE should be
close by, and guaranteed to be called; see L</WITH_LC_NUMERIC_SET_TO_NEEDED>
for a more contained way to ensure that.

=for apidoc Am|void|STORE_LC_NUMERIC_SET_TO_NEEDED_IN|bool in_lc_numeric

Same as L</STORE_LC_NUMERIC_SET_TO_NEEDED> with in_lc_numeric provided
as the precalculated value of C<IN_LC(LC_NUMERIC)>. It is the caller's
responsibility to ensure that the status of C<PL_compiling> and C<PL_hints>
cannot have changed since the precalculation.

=for apidoc Am|void|RESTORE_LC_NUMERIC

This is used in conjunction with one of the macros
L</STORE_LC_NUMERIC_SET_TO_NEEDED>
and L</STORE_LC_NUMERIC_FORCE_TO_UNDERLYING> to properly restore the
C<LC_NUMERIC> state.

A call to L</DECLARATION_FOR_LC_NUMERIC_MANIPULATION> must have been made to
declare at compile time a private variable used by this macro and the two
C<STORE> ones.  This macro should be called as a single statement, not an
expression, but with an empty argument list, like this:

 {
    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
     ...
    RESTORE_LC_NUMERIC();
     ...
 }

=for apidoc Am|void|WITH_LC_NUMERIC_SET_TO_NEEDED|block

This macro invokes the supplied statement or block within the context
of a L</STORE_LC_NUMERIC_SET_TO_NEEDED> .. L</RESTORE_LC_NUMERIC> pair
if required, so eg:

  WITH_LC_NUMERIC_SET_TO_NEEDED(
    SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis)
  );

is equivalent to:

  {
#ifdef USE_LOCALE_NUMERIC
    DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
    STORE_LC_NUMERIC_SET_TO_NEEDED();
#endif
    SNPRINTF_G(fv, ebuf, sizeof(ebuf), precis);
#ifdef USE_LOCALE_NUMERIC
    RESTORE_LC_NUMERIC();
#endif
  }

=for apidoc Am|void|WITH_LC_NUMERIC_SET_TO_NEEDED_IN|bool in_lc_numeric|block

Same as L</WITH_LC_NUMERIC_SET_TO_NEEDED> with in_lc_numeric provided
as the precalculated value of C<IN_LC(LC_NUMERIC)>. It is the caller's
responsibility to ensure that the status of C<PL_compiling> and C<PL_hints>
cannot have changed since the precalculation.

=cut

*/

/* If the underlying numeric locale has a non-dot decimal point or has a
 * non-empty floating point thousands separator, the current locale is instead
 * generally kept in the C locale instead of that underlying locale.  The
 * current status is known by looking at two words.  One is non-zero if the
 * current numeric locale is the standard C/POSIX one or is indistinguishable
 * from C.  The other is non-zero if the current locale is the underlying
 * locale.  Both can be non-zero if, as often happens, the underlying locale is
 * C or indistinguishable from it.
 *
 * khw believes the reason for the variables instead of the bits in a single
 * word is to avoid having to have masking instructions. */

#  define _NOT_IN_NUMERIC_STANDARD (! PL_numeric_standard)

/* We can lock the category to stay in the C locale, making requests to the
 * contrary be noops, in the dynamic scope by setting PL_numeric_standard to 2.
 * */
#  define _NOT_IN_NUMERIC_UNDERLYING                                        \
                    (! PL_numeric_underlying && PL_numeric_standard < 2)

#  define DECLARATION_FOR_LC_NUMERIC_MANIPULATION                           \
    void (*_restore_LC_NUMERIC_function)(pTHX) = NULL

#  define STORE_LC_NUMERIC_SET_TO_NEEDED_IN(in)                             \
        STMT_START {                                                        \
            bool _in_lc_numeric = (in);                                     \
            LC_NUMERIC_LOCK(                                                \
                    (   (  _in_lc_numeric && _NOT_IN_NUMERIC_UNDERLYING)    \
                     || (! _in_lc_numeric && _NOT_IN_NUMERIC_STANDARD)));   \
            if (_in_lc_numeric) {                                           \
                if (_NOT_IN_NUMERIC_UNDERLYING) {                           \
                    Perl_set_numeric_underlying(aTHX);                      \
                    _restore_LC_NUMERIC_function                            \
                                            = &Perl_set_numeric_standard;   \
                }                                                           \
            }                                                               \
            else {                                                          \
                if (_NOT_IN_NUMERIC_STANDARD) {                             \
                    Perl_set_numeric_standard(aTHX);                        \
                    _restore_LC_NUMERIC_function                            \
                                            = &Perl_set_numeric_underlying; \
                }                                                           \
            }                                                               \
        } STMT_END

#  define STORE_LC_NUMERIC_SET_TO_NEEDED() \
        STORE_LC_NUMERIC_SET_TO_NEEDED_IN(IN_LC(LC_NUMERIC))

#  define RESTORE_LC_NUMERIC()                                              \
        STMT_START {                                                        \
            if (_restore_LC_NUMERIC_function) {                             \
                _restore_LC_NUMERIC_function(aTHX);                         \
            }                                                               \
            LC_NUMERIC_UNLOCK;                                              \
        } STMT_END

/* The next two macros set unconditionally.  These should be rarely used, and
 * only after being sure that this is what is needed */
#  define SET_NUMERIC_STANDARD()                                            \
        STMT_START {                                                        \
            DEBUG_Lv(PerlIO_printf(Perl_debug_log,                          \
                               "%s: %d: lc_numeric standard=%d\n",          \
                                __FILE__, __LINE__, PL_numeric_standard));  \
            Perl_set_numeric_standard(aTHX);                                \
            DEBUG_Lv(PerlIO_printf(Perl_debug_log,                          \
                                 "%s: %d: lc_numeric standard=%d\n",        \
                                 __FILE__, __LINE__, PL_numeric_standard)); \
        } STMT_END

#  define SET_NUMERIC_UNDERLYING()                                          \
        STMT_START {                                                        \
            if (_NOT_IN_NUMERIC_UNDERLYING) {                               \
                Perl_set_numeric_underlying(aTHX);                          \
            }                                                               \
        } STMT_END

/* The rest of these LC_NUMERIC macros toggle to one or the other state, with
 * the RESTORE_foo ones called to switch back, but only if need be */
#  define STORE_LC_NUMERIC_SET_STANDARD()                                   \
        STMT_START {                                                        \
            LC_NUMERIC_LOCK(_NOT_IN_NUMERIC_STANDARD);                      \
            if (_NOT_IN_NUMERIC_STANDARD) {                                 \
                _restore_LC_NUMERIC_function = &Perl_set_numeric_underlying;\
                Perl_set_numeric_standard(aTHX);                            \
            }                                                               \
        } STMT_END

/* Rarely, we want to change to the underlying locale even outside of 'use
 * locale'.  This is principally in the POSIX:: functions */
#  define STORE_LC_NUMERIC_FORCE_TO_UNDERLYING()                            \
        STMT_START {                                                        \
            LC_NUMERIC_LOCK(_NOT_IN_NUMERIC_UNDERLYING);                    \
            if (_NOT_IN_NUMERIC_UNDERLYING) {                               \
                Perl_set_numeric_underlying(aTHX);                          \
                _restore_LC_NUMERIC_function = &Perl_set_numeric_standard;  \
            }                                                               \
        } STMT_END

/* Lock/unlock to the C locale until unlock is called.  This needs to be
 * recursively callable.  [perl #128207] */
#  define LOCK_LC_NUMERIC_STANDARD()                                        \
        STMT_START {                                                        \
            DEBUG_Lv(PerlIO_printf(Perl_debug_log,                          \
                    "%s: %d: lc_numeric_standard now locked to depth %d\n", \
                    __FILE__, __LINE__, PL_numeric_standard));              \
            __ASSERT_(PL_numeric_standard)                                  \
            PL_numeric_standard++;                                          \
        } STMT_END

#  define UNLOCK_LC_NUMERIC_STANDARD()                                      \
        STMT_START {                                                        \
            if (PL_numeric_standard > 1) {                                  \
                PL_numeric_standard--;                                      \
            }                                                               \
            else {                                                          \
                assert(0);                                                  \
            }                                                               \
            DEBUG_Lv(PerlIO_printf(Perl_debug_log,                          \
                                   "%s: %d: ",  __FILE__, __LINE__);        \
                    if (PL_numeric_standard <= 1)                           \
                        PerlIO_printf(Perl_debug_log,                       \
                                      "lc_numeric_standard now unlocked\n");\
                    else PerlIO_printf(Perl_debug_log,                      \
                     "lc_numeric_standard lock decremented to depth %d\n",  \
                                                     PL_numeric_standard););\
        } STMT_END

#  define WITH_LC_NUMERIC_SET_TO_NEEDED_IN(in_lc_numeric, block)            \
        STMT_START {                                                        \
            DECLARATION_FOR_LC_NUMERIC_MANIPULATION;                        \
            STORE_LC_NUMERIC_SET_TO_NEEDED_IN(in_lc_numeric);               \
            block;                                                          \
            RESTORE_LC_NUMERIC();                                           \
        } STMT_END;

#  define WITH_LC_NUMERIC_SET_TO_NEEDED(block) \
        WITH_LC_NUMERIC_SET_TO_NEEDED_IN(IN_LC(LC_NUMERIC), block)

#else /* !USE_LOCALE_NUMERIC */

#  define SET_NUMERIC_STANDARD()
#  define SET_NUMERIC_UNDERLYING()
#  define IS_NUMERIC_RADIX(a, b)		(0)
#  define DECLARATION_FOR_LC_NUMERIC_MANIPULATION  dNOOP
#  define STORE_LC_NUMERIC_SET_STANDARD()
#  define STORE_LC_NUMERIC_FORCE_TO_UNDERLYING()
#  define STORE_LC_NUMERIC_SET_TO_NEEDED_IN(in_lc_numeric)
#  define STORE_LC_NUMERIC_SET_TO_NEEDED()
#  define RESTORE_LC_NUMERIC()
#  define LOCK_LC_NUMERIC_STANDARD()
#  define UNLOCK_LC_NUMERIC_STANDARD()
#  define WITH_LC_NUMERIC_SET_TO_NEEDED_IN(in_lc_numeric, block) \
    STMT_START { block; } STMT_END
#  define WITH_LC_NUMERIC_SET_TO_NEEDED(block) \
    STMT_START { block; } STMT_END

#endif /* !USE_LOCALE_NUMERIC */

#ifdef USE_ITHREADS
#  define ENV_LOCK            PERL_WRITE_LOCK(&PL_env_mutex)
#  define ENV_UNLOCK          PERL_WRITE_UNLOCK(&PL_env_mutex)
#  define ENV_READ_LOCK       PERL_READ_LOCK(&PL_env_mutex)
#  define ENV_READ_UNLOCK     PERL_READ_UNLOCK(&PL_env_mutex)
#  define ENV_INIT            PERL_RW_MUTEX_INIT(&PL_env_mutex)
#  define ENV_TERM            PERL_RW_MUTEX_DESTROY(&PL_env_mutex)

   /* On platforms where the static buffer contained in getenv() is per-thread
    * rather than process-wide, another thread executing a getenv() at the same
    * time won't destroy ours before we have copied the result safely away and
    * unlocked the mutex.  On such platforms (which is most), we can have many
    * readers of the environment at the same time. */
#  ifdef GETENV_PRESERVES_OTHER_THREAD
#    define GETENV_LOCK    ENV_READ_LOCK
#    define GETENV_UNLOCK  ENV_READ_UNLOCK
#  else
     /* If, on the other hand, another thread could zap our getenv() return, we
      * need to keep them from executing until we are done */
#    define GETENV_LOCK    ENV_LOCK
#    define GETENV_UNLOCK  ENV_UNLOCK
#  endif
#else
#  define ENV_LOCK        NOOP
#  define ENV_UNLOCK      NOOP
#  define ENV_READ_LOCK   NOOP
#  define ENV_READ_UNLOCK NOOP
#  define ENV_INIT        NOOP
#  define ENV_TERM        NOOP
#  define GETENV_LOCK     NOOP
#  define GETENV_UNLOCK   NOOP
#endif

#ifndef PERL_NO_INLINE_FUNCTIONS
/* Static inline funcs that depend on includes and declarations above.
   Some of these reference functions in the perl object files, and some
   compilers aren't smart enough to eliminate unused static inline
   functions, so including this file in source code can cause link errors
   even if the source code uses none of the functions. Hence including these
   can be suppressed by setting PERL_NO_INLINE_FUNCTIONS. Doing this will
   (obviously) result in unworkable XS code, but allows simple probing code
   to continue to work, because it permits tests to include the perl headers
   for definitions without creating a link dependency on the perl library
   (which may not exist yet).
*/

START_EXTERN_C

#  include "inline.h"
#  include "sv_inline.h"

END_EXTERN_C

#endif

/* Some critical sections need to lock both the locale and the environment.
 * XXX khw intends to change this to lock both mutexes, but that brings up
 * issues of potential deadlock, so should be done at the beginning of a
 * development cycle.  So for now, it just locks the environment.  Note that
 * many modern platforms are locale-thread-safe anyway, so locking the locale
 * mutex is a no-op anyway */
#define ENV_LOCALE_LOCK     ENV_LOCK
#define ENV_LOCALE_UNLOCK   ENV_UNLOCK

/* And some critical sections care only that no one else is writing either the
 * locale nor the environment.  XXX Again this is for the future.  This can be
 * simulated with using COND_WAIT in thread.h */
#define ENV_LOCALE_READ_LOCK     ENV_LOCALE_LOCK
#define ENV_LOCALE_READ_UNLOCK   ENV_LOCALE_UNLOCK

#define Atof				my_atof

/*

=for apidoc_section $numeric

=for apidoc AmTR|NV|Strtod|NN const char * const s|NULLOK char ** e

This is a synonym for L</my_strtod>.

=for apidoc AmTR|NV|Strtol|NN const char * const s|NULLOK char ** e|int base

Platform and configuration independent C<strtol>.  This expands to the
appropriate C<strotol>-like function based on the platform and F<Configure>
options>.  For example it could expand to C<strtoll> or C<strtoq> instead of
C<strtol>.

=for apidoc AmTR|NV|Strtoul|NN const char * const s|NULLOK char ** e|int base

Platform and configuration independent C<strtoul>.  This expands to the
appropriate C<strotoul>-like function based on the platform and F<Configure>
options>.  For example it could expand to C<strtoull> or C<strtouq> instead of
C<strtoul>.

=cut

*/

#define Strtod                          my_strtod

#if    defined(HAS_STRTOD)                                          \
   ||  defined(USE_QUADMATH)                                        \
   || (defined(HAS_STRTOLD) && defined(HAS_LONG_DOUBLE)             \
                            && defined(USE_LONG_DOUBLE))
#  define Perl_strtod   Strtod
#endif

#if !defined(Strtol) && defined(USE_64_BIT_INT) && defined(IV_IS_QUAD) && \
        (QUADKIND == QUAD_IS_LONG_LONG || QUADKIND == QUAD_IS___INT64)
#    ifdef __hpux
#        define strtoll __strtoll	/* secret handshake */
#    endif
#    if defined(WIN64) && defined(_MSC_VER)
#        define strtoll _strtoi64	/* secret handshake */
#    endif
#   if !defined(Strtol) && defined(HAS_STRTOLL)
#       define Strtol	strtoll
#   endif
#    if !defined(Strtol) && defined(HAS_STRTOQ)
#       define Strtol	strtoq
#    endif
/* is there atoq() anywhere? */
#endif
#if !defined(Strtol) && defined(HAS_STRTOL)
#   define Strtol	strtol
#endif
#ifndef Atol
/* It would be more fashionable to use Strtol() to define atol()
 * (as is done for Atoul(), see below) but for backward compatibility
 * we just assume atol(). */
#   if defined(USE_64_BIT_INT) && defined(IV_IS_QUAD) && defined(HAS_ATOLL) && \
        (QUADKIND == QUAD_IS_LONG_LONG || QUADKIND == QUAD_IS___INT64)
#    ifdef WIN64
#       define atoll    _atoi64		/* secret handshake */
#    endif
#       define Atol	atoll
#   else
#       define Atol	atol
#   endif
#endif

#if !defined(Strtoul) && defined(USE_64_BIT_INT) && defined(UV_IS_QUAD) && \
        (QUADKIND == QUAD_IS_LONG_LONG || QUADKIND == QUAD_IS___INT64)
#    ifdef __hpux
#        define strtoull __strtoull	/* secret handshake */
#    endif
#    if defined(WIN64) && defined(_MSC_VER)
#        define strtoull _strtoui64	/* secret handshake */
#    endif
#    if !defined(Strtoul) && defined(HAS_STRTOULL)
#       define Strtoul	strtoull
#    endif
#    if !defined(Strtoul) && defined(HAS_STRTOUQ)
#       define Strtoul	strtouq
#    endif
/* is there atouq() anywhere? */
#endif
#if !defined(Strtoul) && defined(HAS_STRTOUL)
#   define Strtoul	strtoul
#endif
#if !defined(Strtoul) && defined(HAS_STRTOL) /* Last resort. */
#   define Strtoul(s, e, b)	strchr((s), '-') ? ULONG_MAX : (unsigned long)strtol((s), (e), (b))
#endif
#ifndef Atoul
#   define Atoul(s)	Strtoul(s, NULL, 10)
#endif

#define grok_bin(s,lp,fp,rp)                                                \
                    grok_bin_oct_hex(s, lp, fp, rp, 1, _CC_BINDIGIT, 'b')
#define grok_oct(s,lp,fp,rp)                                                \
                    (*(fp) |= PERL_SCAN_DISALLOW_PREFIX,                    \
                    grok_bin_oct_hex(s, lp, fp, rp, 3, _CC_OCTDIGIT, '\0'))
#define grok_hex(s,lp,fp,rp)                                                \
                    grok_bin_oct_hex(s, lp, fp, rp, 4, _CC_XDIGIT, 'x')

#ifndef PERL_SCRIPT_MODE
#define PERL_SCRIPT_MODE "r"
#endif

/* not used. Kept as a NOOP for backcompat */
#define PERL_STACK_OVERFLOW_CHECK()  NOOP

/*
 * Some nonpreemptive operating systems find it convenient to
 * check for asynchronous conditions after each op execution.
 * Keep this check simple, or it may slow down execution
 * massively.
 */

#ifndef PERL_MICRO
#	ifndef PERL_ASYNC_CHECK
#		define PERL_ASYNC_CHECK() if (UNLIKELY(PL_sig_pending)) PL_signalhook(aTHX)
#	endif
#endif

#ifndef PERL_ASYNC_CHECK
#   define PERL_ASYNC_CHECK()  NOOP
#endif

/*
 * On some operating systems, a memory allocation may succeed,
 * but put the process too close to the system's comfort limit.
 * In this case, PERL_ALLOC_CHECK frees the pointer and sets
 * it to NULL.
 */
#ifndef PERL_ALLOC_CHECK
#define PERL_ALLOC_CHECK(p)  NOOP
#endif

#ifdef HAS_SEM
#   include <sys/ipc.h>
#   include <sys/sem.h>
#   ifndef HAS_UNION_SEMUN	/* Provide the union semun. */
    union semun {
        int		val;
        struct semid_ds	*buf;
        unsigned short	*array;
    };
#   endif
#   ifdef USE_SEMCTL_SEMUN
#	ifdef IRIX32_SEMUN_BROKEN_BY_GCC
            union gccbug_semun {
                int             val;
                struct semid_ds *buf;
                unsigned short  *array;
                char            __dummy[5];
            };
#           define semun gccbug_semun
#	endif
#       define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
#   elif defined(USE_SEMCTL_SEMID_DS)
#           ifdef EXTRA_F_IN_SEMUN_BUF
#               define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun.buff)
#           else
#               define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun.buf)
#           endif
#   endif
#endif

/*
 * Boilerplate macros for initializing and accessing interpreter-local
 * data from C.  All statics in extensions should be reworked to use
 * this, if you want to make the extension thread-safe.  See
 * ext/XS/APItest/APItest.xs for an example of the use of these macros,
 * and perlxs.pod for more.
 *
 * Code that uses these macros is responsible for the following:
 * 1. #define MY_CXT_KEY to a unique string, e.g.
 *    "DynaLoader::_guts" XS_VERSION
 *    XXX in the current implementation, this string is ignored.
 * 2. Declare a typedef named my_cxt_t that is a structure that contains
 *    all the data that needs to be interpreter-local.
 * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
 * 4. Use the MY_CXT_INIT macro such that it is called exactly once
 *    (typically put in the BOOT: section).
 * 5. Use the members of the my_cxt_t structure everywhere as
 *    MY_CXT.member.
 * 6. Use the dMY_CXT macro (a declaration) in all the functions that
 *    access MY_CXT.
 */

#if defined(MULTIPLICITY)

/* START_MY_CXT must appear in all extensions that define a my_cxt_t structure,
 * right after the definition (i.e. at file scope).  The non-threads
 * case below uses it to declare the data as static. */
#    define START_MY_CXT static int my_cxt_index = -1;
#    define MY_CXT_INDEX my_cxt_index
#    define MY_CXT_INIT_ARG &my_cxt_index

/* Creates and zeroes the per-interpreter data.
 * (We allocate my_cxtp in a Perl SV so that it will be released when
 * the interpreter goes away.) */
#  define MY_CXT_INIT \
        my_cxt_t *my_cxtp = \
            (my_cxt_t*)Perl_my_cxt_init(aTHX_ MY_CXT_INIT_ARG, sizeof(my_cxt_t)); \
        PERL_UNUSED_VAR(my_cxtp)
#  define MY_CXT_INIT_INTERP(my_perl) \
        my_cxt_t *my_cxtp = \
            (my_cxt_t*)Perl_my_cxt_init(my_perl, MY_CXT_INIT_ARG, sizeof(my_cxt_t)); \
        PERL_UNUSED_VAR(my_cxtp)

/* This declaration should be used within all functions that use the
 * interpreter-local data. */
#  define dMY_CXT	\
        my_cxt_t *my_cxtp = (my_cxt_t *)PL_my_cxt_list[MY_CXT_INDEX]
#  define dMY_CXT_INTERP(my_perl)	\
        my_cxt_t *my_cxtp = (my_cxt_t *)(my_perl)->Imy_cxt_list[MY_CXT_INDEX]

/* Clones the per-interpreter data. */
#  define MY_CXT_CLONE \
        my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
        void * old_my_cxtp = PL_my_cxt_list[MY_CXT_INDEX];		\
        PL_my_cxt_list[MY_CXT_INDEX] = my_cxtp;				\
        Copy(old_my_cxtp, my_cxtp, 1, my_cxt_t);



/* This macro must be used to access members of the my_cxt_t structure.
 * e.g. MY_CXT.some_data */
#  define MY_CXT		(*my_cxtp)

/* Judicious use of these macros can reduce the number of times dMY_CXT
 * is used.  Use is similar to pTHX, aTHX etc. */
#  define pMY_CXT	my_cxt_t *my_cxtp
#  define pMY_CXT_	pMY_CXT,
#  define _pMY_CXT	,pMY_CXT
#  define aMY_CXT	my_cxtp
#  define aMY_CXT_	aMY_CXT,
#  define _aMY_CXT	,aMY_CXT

#else /* MULTIPLICITY */
#  define START_MY_CXT		static my_cxt_t my_cxt;
#  define dMY_CXT		dNOOP
#  define dMY_CXT_INTERP(my_perl) dNOOP
#  define MY_CXT_INIT		NOOP
#  define MY_CXT_CLONE		NOOP
#  define MY_CXT		my_cxt

#  define pMY_CXT		void
#  define pMY_CXT_
#  define _pMY_CXT
#  define aMY_CXT
#  define aMY_CXT_
#  define _aMY_CXT

#endif /* !defined(MULTIPLICITY) */

#ifdef I_FCNTL
#  include <fcntl.h>
#endif

#ifdef __Lynx__
#  include <fcntl.h>
#endif

#ifdef __amigaos4__
#  undef FD_CLOEXEC /* a lie in AmigaOS */
#endif

#ifdef I_SYS_FILE
#  include <sys/file.h>
#endif

#if defined(HAS_FLOCK) && !defined(HAS_FLOCK_PROTO)
EXTERN_C int flock(int fd, int op);
#endif

#ifndef O_RDONLY
/* Assume UNIX defaults */
#    define O_RDONLY	0000
#    define O_WRONLY	0001
#    define O_RDWR	0002
#    define O_CREAT	0100
#endif

#ifndef O_BINARY
#  define O_BINARY 0
#endif

#ifndef O_TEXT
#  define O_TEXT 0
#endif

#if O_TEXT != O_BINARY
    /* If you have different O_TEXT and O_BINARY and you are a CRLF shop,
     * that is, you are somehow DOSish. */
#   if defined(__HAIKU__) || defined(__VOS__) || defined(__CYGWIN__)
    /* Haiku has O_TEXT != O_BINARY but O_TEXT and O_BINARY have no effect;
     * Haiku is always UNIXoid (LF), not DOSish (CRLF). */
    /* VOS has O_TEXT != O_BINARY, and they have effect,
     * but VOS always uses LF, never CRLF. */
    /* If you have O_TEXT different from your O_BINARY but you still are
     * not a CRLF shop. */
#       undef PERLIO_USING_CRLF
#   else
    /* If you really are DOSish. */
#      define PERLIO_USING_CRLF 1
#   endif
#endif

#ifdef I_LIBUTIL
#   include <libutil.h>		/* setproctitle() in some FreeBSDs */
#endif

#ifndef EXEC_ARGV_CAST
#define EXEC_ARGV_CAST(x) (char **)x
#endif

#define IS_NUMBER_IN_UV		      0x01 /* number within UV range (maybe not
                                              int).  value returned in pointed-
                                              to UV */
#define IS_NUMBER_GREATER_THAN_UV_MAX 0x02 /* pointed to UV undefined */
#define IS_NUMBER_NOT_INT	      0x04 /* saw . or E notation or infnan */
#define IS_NUMBER_NEG		      0x08 /* leading minus sign */
#define IS_NUMBER_INFINITY	      0x10 /* this is big */
#define IS_NUMBER_NAN                 0x20 /* this is not */
#define IS_NUMBER_TRAILING            0x40 /* number has trailing trash */

/*
=for apidoc_section $numeric

=for apidoc AmdR|bool|GROK_NUMERIC_RADIX|NN const char **sp|NN const char *send

A synonym for L</grok_numeric_radix>

=cut
*/
#define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)

/* Number scan flags.  All are used for input, the ones used for output are so
 * marked */
#define PERL_SCAN_ALLOW_UNDERSCORES   0x01 /* grok_??? accept _ in numbers */
#define PERL_SCAN_DISALLOW_PREFIX     0x02 /* grok_??? reject 0x in hex etc */

/* grok_??? input: ignored; output: found overflow */
#define PERL_SCAN_GREATER_THAN_UV_MAX 0x04

/* grok_??? don't warn about illegal digits.  To preserve total backcompat,
 * this isn't set on output if one is found.  Instead, see
 * PERL_SCAN_NOTIFY_ILLDIGIT. */
#define PERL_SCAN_SILENT_ILLDIGIT     0x08

#define PERL_SCAN_TRAILING            0x10 /* grok_number_flags() allow trailing
                                              and set IS_NUMBER_TRAILING */

/* These are considered experimental, so not exposed publicly */
#if defined(PERL_CORE) || defined(PERL_EXT)
/* grok_??? don't warn about very large numbers which are <= UV_MAX;
 * output: found such a number */
#  define PERL_SCAN_SILENT_NON_PORTABLE 0x20

/* If this is set on input, and no illegal digit is found, it will be cleared
 * on output; otherwise unchanged */
#  define PERL_SCAN_NOTIFY_ILLDIGIT 0x40

/* Don't warn on overflow; output flag still set */
#  define PERL_SCAN_SILENT_OVERFLOW 0x80

/* Forbid a leading underscore, which the other one doesn't */
#  define PERL_SCAN_ALLOW_MEDIAL_UNDERSCORES (0x100|PERL_SCAN_ALLOW_UNDERSCORES)
#endif


/* to let user control profiling */
#ifdef PERL_GPROF_CONTROL
extern void moncontrol(int);
#define PERL_GPROF_MONCONTROL(x) moncontrol(x)
#else
#define PERL_GPROF_MONCONTROL(x)
#endif

/* ISO 6429 NEL - C1 control NExt Line */
/* See https://www.unicode.org/reports/tr13/ */
#define NEXT_LINE_CHAR	NEXT_LINE_NATIVE

#ifndef PIPESOCK_MODE
#  define PIPESOCK_MODE
#endif

#ifndef SOCKET_OPEN_MODE
#  define SOCKET_OPEN_MODE	PIPESOCK_MODE
#endif

#ifndef PIPE_OPEN_MODE
#  define PIPE_OPEN_MODE	PIPESOCK_MODE
#endif

#define PERL_MAGIC_UTF8_CACHESIZE	2

#ifdef PERL_CORE

#define PERL_UNICODE_STDIN_FLAG			0x0001
#define PERL_UNICODE_STDOUT_FLAG		0x0002
#define PERL_UNICODE_STDERR_FLAG		0x0004
#define PERL_UNICODE_IN_FLAG			0x0008
#define PERL_UNICODE_OUT_FLAG			0x0010
#define PERL_UNICODE_ARGV_FLAG			0x0020
#define PERL_UNICODE_LOCALE_FLAG		0x0040
#define PERL_UNICODE_WIDESYSCALLS_FLAG		0x0080 /* for Sarathy */
#define PERL_UNICODE_UTF8CACHEASSERT_FLAG	0x0100

#define PERL_UNICODE_STD_FLAG		\
        (PERL_UNICODE_STDIN_FLAG	| \
         PERL_UNICODE_STDOUT_FLAG	| \
         PERL_UNICODE_STDERR_FLAG)

#define PERL_UNICODE_INOUT_FLAG		\
        (PERL_UNICODE_IN_FLAG	| \
         PERL_UNICODE_OUT_FLAG)

#define PERL_UNICODE_DEFAULT_FLAGS	\
        (PERL_UNICODE_STD_FLAG		| \
         PERL_UNICODE_INOUT_FLAG	| \
         PERL_UNICODE_LOCALE_FLAG)

#define PERL_UNICODE_ALL_FLAGS			0x01ff

#define PERL_UNICODE_STDIN			'I'
#define PERL_UNICODE_STDOUT			'O'
#define PERL_UNICODE_STDERR			'E'
#define PERL_UNICODE_STD			'S'
#define PERL_UNICODE_IN				'i'
#define PERL_UNICODE_OUT			'o'
#define PERL_UNICODE_INOUT			'D'
#define PERL_UNICODE_ARGV			'A'
#define PERL_UNICODE_LOCALE			'L'
#define PERL_UNICODE_WIDESYSCALLS		'W'
#define PERL_UNICODE_UTF8CACHEASSERT		'a'

#endif

/*
=for apidoc_section $signals
=for apidoc Amn|U32|PERL_SIGNALS_UNSAFE_FLAG
If this bit in C<PL_signals> is set, the system is uing the pre-Perl 5.8
unsafe signals.  See L<perlrun/PERL_SIGNALS> and L<perlipc/Deferred Signals
(Safe Signals)>.

=cut
*/
#define PERL_SIGNALS_UNSAFE_FLAG	0x0001

/*
=for apidoc_section $numeric

=for apidoc Am|int|PERL_ABS|int x

Typeless C<abs> or C<fabs>, I<etc>.  (The usage below indicates it is for
integers, but it works for any type.)  Use instead of these, since the C
library ones force their argument to be what it is expecting, potentially
leading to disaster.  But also beware that this evaluates its argument twice,
so no C<x++>.

=cut
*/

#define PERL_ABS(x) ((x) < 0 ? -(x) : (x))

#if defined(__DECC) && defined(__osf__)
#pragma message disable (mainparm) /* Perl uses the envp in main(). */
#endif

#define do_open(g, n, l, a, rm, rp, sf) \
        do_openn(g, n, l, a, rm, rp, sf, (SV **) NULL, 0)
#ifdef PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION
#  define do_exec(cmd)			do_exec3(cmd,0,0)
#endif
#ifdef OS2
#  define do_aexec			Perl_do_aexec
#else
#  define do_aexec(really, mark,sp)	do_aexec5(really, mark, sp, 0, 0)
#endif


/*
=for apidoc_section $utility

=for apidoc Am|bool|IS_SAFE_SYSCALL|NN const char *pv|STRLEN len|NN const char *what|NN const char *op_name

Same as L</is_safe_syscall>.

=cut

Allows one ending \0
*/
#define IS_SAFE_SYSCALL(p, len, what, op_name) (Perl_is_safe_syscall(aTHX_ (p), (len), (what), (op_name)))

#define IS_SAFE_PATHNAME(p, len, op_name) IS_SAFE_SYSCALL((p), (len), "pathname", (op_name))

#if defined(OEMVS) || defined(__amigaos4__)
#define NO_ENV_ARRAY_IN_MAIN
#endif

/* These are used by Perl_pv_escape() and Perl_pv_pretty()
 * are here so that they are available throughout the core
 * NOTE that even though some are for _escape and some for _pretty
 * there must not be any clashes as the flags from _pretty are
 * passed straight through to _escape.
 */

#define PERL_PV_ESCAPE_QUOTE        0x000001
#define PERL_PV_PRETTY_QUOTE        PERL_PV_ESCAPE_QUOTE

#define PERL_PV_PRETTY_ELLIPSES     0x000002
#define PERL_PV_PRETTY_LTGT         0x000004
#define PERL_PV_PRETTY_EXACTSIZE    0x000008

#define PERL_PV_ESCAPE_UNI          0x000100
#define PERL_PV_ESCAPE_UNI_DETECT   0x000200
#define PERL_PV_ESCAPE_NONASCII     0x000400
#define PERL_PV_ESCAPE_FIRSTCHAR    0x000800

#define PERL_PV_ESCAPE_ALL            0x001000
#define PERL_PV_ESCAPE_NOBACKSLASH  0x002000
#define PERL_PV_ESCAPE_NOCLEAR      0x004000
#define PERL_PV_PRETTY_NOCLEAR      PERL_PV_ESCAPE_NOCLEAR
#define PERL_PV_ESCAPE_RE           0x008000

/* Escape PV with hex, except leave NULs as octal: */
#define PERL_PV_ESCAPE_DWIM         0x010000

/* Escape PV with all hex, including NUL. */
#define PERL_PV_ESCAPE_DWIM_ALL_HEX 0x020000


/* used by pv_display in dump.c*/
#define PERL_PV_PRETTY_DUMP  PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
#define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE|PERL_PV_ESCAPE_NONASCII

#if DOUBLEKIND == DOUBLE_IS_VAX_F_FLOAT || \
    DOUBLEKIND == DOUBLE_IS_VAX_D_FLOAT || \
    DOUBLEKIND == DOUBLE_IS_VAX_G_FLOAT
#  define DOUBLE_IS_VAX_FLOAT
#else
#  define DOUBLE_IS_IEEE_FORMAT
#endif

#if DOUBLEKIND == DOUBLE_IS_IEEE_754_32_BIT_LITTLE_ENDIAN || \
    DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_LITTLE_ENDIAN || \
    DOUBLEKIND == DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN
#  define DOUBLE_LITTLE_ENDIAN
#endif

#if DOUBLEKIND == DOUBLE_IS_IEEE_754_32_BIT_BIG_ENDIAN || \
    DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_BIG_ENDIAN || \
    DOUBLEKIND == DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN
#  define DOUBLE_BIG_ENDIAN
#endif

#if DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE || \
    DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE
#  define DOUBLE_MIX_ENDIAN
#endif

/* The VAX fp formats are neither consistently little-endian nor
 * big-endian, and neither are they really IEEE-mixed endian like
 * the mixed-endian ARM IEEE formats (with swapped bytes).
 * Ultimately, the VAX format came from the PDP-11.
 *
 * The ordering of the parts in VAX floats is quite vexing.
 * In the below the fraction_n are the mantissa bits.
 *
 * The fraction_1 is the most significant (numbering as by DEC/Digital),
 * while the rightmost bit in each fraction is the least significant:
 * in other words, big-endian bit order within the fractions.
 *
 * The fraction segments themselves would be big-endianly, except that
 * within 32 bit segments the less significant half comes first, the more
 * significant after, except that in the format H (used for long doubles)
 * the first fraction segment is alone, because the exponent is wider.
 * This means for example that both the most and the least significant
 * bits can be in the middle of the floats, not at either end.
 *
 * References:
 * http://nssdc.gsfc.nasa.gov/nssdc/formats/VAXFloatingPoint.htm
 * http://www.quadibloc.com/comp/cp0201.htm
 * http://h71000.www7.hp.com/doc/82final/6443/6443pro_028.html
 * (somebody at HP should be fired for the URLs)
 *
 * F   fraction_2:16 sign:1 exp:8  fraction_1:7
 *     (exponent bias 128, hidden first one-bit)
 *
 * D   fraction_2:16 sign:1 exp:8  fraction_1:7
 *     fraction_4:16               fraction_3:16
 *     (exponent bias 128, hidden first one-bit)
 *
 * G   fraction_2:16 sign:1 exp:11 fraction_1:4
 *     fraction_4:16               fraction_3:16
 *     (exponent bias 1024, hidden first one-bit)
 *
 * H   fraction_1:16 sign:1 exp:15
 *     fraction_3:16               fraction_2:16
 *     fraction_5:16               fraction_4:16
 *     fraction_7:16               fraction_6:16
 *     (exponent bias 16384, hidden first one-bit)
 *     (available only on VAX, and only on Fortran?)
 *
 * The formats S, T and X are available on the Alpha (and Itanium,
 * also known as I64/IA64) and are equivalent with the IEEE-754 formats
 * binary32, binary64, and binary128 (commonly: float, double, long double).
 *
 * S   sign:1 exp:8 mantissa:23
 *     (exponent bias 127, hidden first one-bit)
 *
 * T   sign:1 exp:11 mantissa:52
 *     (exponent bias 1022, hidden first one-bit)
 *
 * X   sign:1 exp:15 mantissa:112
 *     (exponent bias 16382, hidden first one-bit)
 *
 */

#ifdef DOUBLE_IS_VAX_FLOAT
#  define DOUBLE_VAX_ENDIAN
#endif

#ifdef DOUBLE_IS_IEEE_FORMAT
/* All the basic IEEE formats have the implicit bit,
 * except for the x86 80-bit extended formats, which will undef this.
 * Also note that the IEEE 754 subnormals (formerly known as denormals)
 * do not have the implicit bit of one. */
#  define NV_IMPLICIT_BIT
#endif

#if defined(LONG_DOUBLEKIND) && LONG_DOUBLEKIND != LONG_DOUBLE_IS_DOUBLE

#  if LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN || \
      LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN || \
      LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE
#    define LONGDOUBLE_LITTLE_ENDIAN
#  endif

#  if LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN || \
      LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN || \
      LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE
#    define LONGDOUBLE_BIG_ENDIAN
#  endif

#  if LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE || \
      LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE
#    define LONGDOUBLE_MIX_ENDIAN
#  endif

#  if LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN || \
      LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN
#    define LONGDOUBLE_X86_80_BIT
#    ifdef USE_LONG_DOUBLE
#      undef NV_IMPLICIT_BIT
#      define NV_X86_80_BIT
#    endif
#  endif

#  if LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE || \
      LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE || \
      LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE || \
      LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE
#    define LONGDOUBLE_DOUBLEDOUBLE
#  endif

#  if LONG_DOUBLEKIND == LONG_DOUBLE_IS_VAX_H_FLOAT
#    define LONGDOUBLE_VAX_ENDIAN
#  endif

#endif /* LONG_DOUBLEKIND */

#ifdef USE_QUADMATH /* assume quadmath endianness == native double endianness */
#  if defined(DOUBLE_LITTLE_ENDIAN)
#    define NV_LITTLE_ENDIAN
#  elif defined(DOUBLE_BIG_ENDIAN)
#    define NV_BIG_ENDIAN
#  elif defined(DOUBLE_MIX_ENDIAN) /* stretch */
#    define NV_MIX_ENDIAN
#  endif
#elif NVSIZE == DOUBLESIZE
#  ifdef DOUBLE_LITTLE_ENDIAN
#    define NV_LITTLE_ENDIAN
#  endif
#  ifdef DOUBLE_BIG_ENDIAN
#    define NV_BIG_ENDIAN
#  endif
#  ifdef DOUBLE_MIX_ENDIAN
#    define NV_MIX_ENDIAN
#  endif
#  ifdef DOUBLE_VAX_ENDIAN
#    define NV_VAX_ENDIAN
#  endif
#elif NVSIZE == LONG_DOUBLESIZE
#  ifdef LONGDOUBLE_LITTLE_ENDIAN
#    define NV_LITTLE_ENDIAN
#  endif
#  ifdef LONGDOUBLE_BIG_ENDIAN
#    define NV_BIG_ENDIAN
#  endif
#  ifdef LONGDOUBLE_MIX_ENDIAN
#    define NV_MIX_ENDIAN
#  endif
#  ifdef LONGDOUBLE_VAX_ENDIAN
#    define NV_VAX_ENDIAN
#  endif
#endif

/* We have somehow managed not to define the denormal/subnormal
 * detection.
 *
 * This may happen if the compiler doesn't expose the C99 math like
 * the fpclassify() without some special switches.  Perl tries to
 * stay C89, so for example -std=c99 is not an option.
 *
 * The Perl_isinf() and Perl_isnan() should have been defined even if
 * the C99 isinf() and isnan() are unavailable, and the NV_MIN becomes
 * from the C89 DBL_MIN or moral equivalent. */
#if !defined(Perl_fp_class_denorm) && defined(Perl_isinf) && defined(Perl_isnan) && defined(NV_MIN)
#  define Perl_fp_class_denorm(x) ((x) != 0.0 && !Perl_isinf(x) && !Perl_isnan(x) && PERL_ABS(x) < NV_MIN)
#endif

/* This is not a great fallback: subnormals tests will fail,
 * but at least Perl will link and 99.999% of tests will work. */
#if !defined(Perl_fp_class_denorm)
#  define Perl_fp_class_denorm(x) FALSE
#endif

#ifdef DOUBLE_IS_IEEE_FORMAT
#  define DOUBLE_HAS_INF
#  define DOUBLE_HAS_NAN
#endif

#ifdef DOUBLE_HAS_NAN

START_EXTERN_C

#ifdef DOINIT

/* PL_inf and PL_nan initialization.
 *
 * For inf and nan initialization the ultimate fallback is dividing
 * one or zero by zero: however, some compilers will warn or even fail
 * on divide-by-zero, but hopefully something earlier will work.
 *
 * If you are thinking of using HUGE_VAL for infinity, or using
 * <math.h> functions to generate NV_INF (e.g. exp(1e9), log(-1.0)),
 * stop.  Neither will work portably: HUGE_VAL can be just DBL_MAX,
 * and the math functions might be just generating DBL_MAX, or even zero.
 *
 * Also, do NOT try doing NV_NAN based on NV_INF and trying (NV_INF-NV_INF).
 * Though logically correct, some compilers (like Visual C 2003)
 * falsely misoptimize that to zero (x-x is always zero, right?)
 *
 * Finally, note that not all floating point formats define Inf (or NaN).
 * For the infinity a large number may be used instead.  Operations that
 * under the IEEE floating point would return Inf or NaN may return
 * either large numbers (positive or negative), or they may cause
 * a floating point exception or some other fault.
 */

/* The quadmath literals are anon structs which -Wc++-compat doesn't like. */
#  ifndef USE_CPLUSPLUS
GCC_DIAG_IGNORE_DECL(-Wc++-compat);
#  endif

#  ifdef USE_QUADMATH
/* Cannot use HUGE_VALQ for PL_inf because not a compile-time
 * constant. */
INFNAN_NV_U8_DECL PL_inf = { 1.0Q/0.0Q };
#  elif NVSIZE == LONG_DOUBLESIZE && defined(LONGDBLINFBYTES)
INFNAN_U8_NV_DECL PL_inf = { { LONGDBLINFBYTES } };
#  elif NVSIZE == DOUBLESIZE && defined(DOUBLEINFBYTES)
INFNAN_U8_NV_DECL PL_inf = { { DOUBLEINFBYTES } };
#  else
#    if NVSIZE == LONG_DOUBLESIZE && defined(USE_LONG_DOUBLE)
#      if defined(LDBL_INFINITY)
INFNAN_NV_U8_DECL PL_inf = { LDBL_INFINITY };
#      elif defined(LDBL_INF)
INFNAN_NV_U8_DECL PL_inf = { LDBL_INF };
#      elif defined(INFINITY)
INFNAN_NV_U8_DECL PL_inf = { (NV)INFINITY };
#      elif defined(INF)
INFNAN_NV_U8_DECL PL_inf = { (NV)INF };
#      else
INFNAN_NV_U8_DECL PL_inf = { 1.0L/0.0L }; /* keep last */
#      endif
#    else
#      if defined(DBL_INFINITY)
INFNAN_NV_U8_DECL PL_inf = { DBL_INFINITY };
#      elif defined(DBL_INF)
INFNAN_NV_U8_DECL PL_inf = { DBL_INF };
#      elif defined(INFINITY) /* C99 */
INFNAN_NV_U8_DECL PL_inf = { (NV)INFINITY };
#      elif defined(INF)
INFNAN_NV_U8_DECL PL_inf = { (NV)INF };
#      else
INFNAN_NV_U8_DECL PL_inf = { 1.0/0.0 }; /* keep last */
#      endif
#    endif
#  endif

#  ifdef USE_QUADMATH
/* Cannot use nanq("0") for PL_nan because not a compile-time
 * constant. */
INFNAN_NV_U8_DECL PL_nan = { 0.0Q/0.0Q };
#  elif NVSIZE == LONG_DOUBLESIZE && defined(LONGDBLNANBYTES)
INFNAN_U8_NV_DECL PL_nan = { { LONGDBLNANBYTES } };
#  elif NVSIZE == DOUBLESIZE && defined(DOUBLENANBYTES)
INFNAN_U8_NV_DECL PL_nan = { { DOUBLENANBYTES } };
#  else
#    if NVSIZE == LONG_DOUBLESIZE && defined(USE_LONG_DOUBLE)
#      if defined(LDBL_NAN)
INFNAN_NV_U8_DECL PL_nan = { LDBL_NAN };
#      elif defined(LDBL_QNAN)
INFNAN_NV_U8_DECL PL_nan = { LDBL_QNAN };
#      elif defined(NAN)
INFNAN_NV_U8_DECL PL_nan = { (NV)NAN };
#      else
INFNAN_NV_U8_DECL PL_nan = { 0.0L/0.0L }; /* keep last */
#      endif
#    else
#      if defined(DBL_NAN)
INFNAN_NV_U8_DECL PL_nan = { DBL_NAN };
#      elif defined(DBL_QNAN)
INFNAN_NV_U8_DECL PL_nan = { DBL_QNAN };
#      elif defined(NAN) /* C99 */
INFNAN_NV_U8_DECL PL_nan = { (NV)NAN };
#      else
INFNAN_NV_U8_DECL PL_nan = { 0.0/0.0 }; /* keep last */
#      endif
#    endif
#  endif

#  ifndef USE_CPLUSPLUS
GCC_DIAG_RESTORE_DECL;
#  endif

#else

/* The declarations here need to match the initializations done above,
   since a mismatch across compilation units causes undefined
   behavior.  It also prevents warnings from LTO builds.
*/
#  if !defined(USE_QUADMATH) && \
       (NVSIZE == LONG_DOUBLESIZE && defined(LONGDBLINFBYTES) ||   \
        NVSIZE == DOUBLESIZE && defined(DOUBLEINFBYTES))
INFNAN_U8_NV_DECL PL_inf;
#  else
INFNAN_NV_U8_DECL PL_inf;
#  endif

#  if !defined(USE_QUADMATH) && \
       (NVSIZE == LONG_DOUBLESIZE && defined(LONGDBLNANBYTES) ||   \
        NVSIZE == DOUBLESIZE && defined(DOUBLENANBYTES))
INFNAN_U8_NV_DECL PL_nan;
#  else
INFNAN_NV_U8_DECL PL_nan;
#  endif

#endif

END_EXTERN_C

/* If you have not defined NV_INF/NV_NAN (like for example win32/win32.h),
 * we will define NV_INF/NV_NAN as the nv part of the global const
 * PL_inf/PL_nan.  Note, however, that the preexisting NV_INF/NV_NAN
 * might not be a compile-time constant, in which case it cannot be
 * used to initialize PL_inf/PL_nan above. */
#ifndef NV_INF
#  define NV_INF PL_inf.nv
#endif
#ifndef NV_NAN
#  define NV_NAN PL_nan.nv
#endif

/* NaNs (not-a-numbers) can carry payload bits, in addition to
 * "nan-ness".  Part of the payload is the quiet/signaling bit.
 * To back up a bit (harhar):
 *
 * For IEEE 754 64-bit formats [1]:
 *
 * s 000 (mantissa all-zero)  zero
 * s 000 (mantissa non-zero)  subnormals (denormals)
 * s 001 ... 7fe              normals
 * s 7ff q                    nan
 *
 * For IEEE 754 128-bit formats:
 *
 * s 0000 (mantissa all-zero)  zero
 * s 0000 (mantissa non-zero)  subnormals (denormals)
 * s 0001 ... 7ffe             normals
 * s 7fff q                    nan
 *
 * [1] this looks like big-endian, but applies equally to little-endian.
 *
 * s = Sign bit.  Yes, zeros and nans can have negative sign,
 *     the interpretation is application-specific.
 *
 * q = Quietness bit, the interpretation is platform-specific.
 *     Most platforms have the most significant bit being one
 *     meaning quiet, but some (older mips, hppa) have the msb
 *     being one meaning signaling.  Note that the above means
 *     that on most platforms there cannot be signaling nan with
 *     zero payload because that is identical with infinity;
 *     while conversely on older mips/hppa there cannot be a quiet nan
 *     because that is identical with infinity.
 *
 *     Moreover, whether there is any behavioral difference
 *     between quiet and signaling NaNs, depends on the platform.
 *
 * x86 80-bit extended precision is different, the mantissa bits:
 *
 * 63 62 61   30387+    pre-387    visual c
 * --------   ----      --------   --------
 *  0  0  0   invalid   infinity
 *  0  0  1   invalid   snan
 *  0  1  0   invalid   snan
 *  0  1  1   invalid   snan
 *  1  0  0   infinity  snan        1.#INF
 *  1  0  1   snan                  1.#SNAN
 *  1  1  0   qnan                 -1.#IND  (x86 chooses this to negative)
 *  1  1  1   qnan                  1.#QNAN
 *
 * This means that in this format there are 61 bits available
 * for the nan payload.
 *
 * Note that the 32-bit x86 ABI cannot do signaling nans: the x87
 * simply cannot preserve the bit.  You can either use the 80-bit
 * extended precision (long double, -Duselongdouble), or use x86-64.
 *
 * In all platforms, the payload bytes (and bits, some of them are
 * often in a partial byte) themselves can be either all zero (x86),
 * all one (sparc or mips), or a mixture: in IEEE 754 128-bit double
 * or in a double-double, the first half of the payload can follow the
 * native double, while in the second half the payload can be all
 * zeros.  (Therefore the mask for payload bits is not necessarily
 * identical to bit complement of the NaN.)  Another way of putting
 * this: the payload for the default NaN might not be zero.
 *
 * For the x86 80-bit long doubles, the trailing bytes (the 80 bits
 * being 'packaged' in either 12 or 16 bytes) can be whatever random
 * garbage.
 *
 * Furthermore, the semantics of the sign bit on NaNs are platform-specific.
 * On normal floats, the sign bit being on means negative.  But this may,
 * or may not, be reverted on NaNs: in other words, the default NaN might
 * have the sign bit on, and therefore look like negative if you look
 * at it at the bit level.
 *
 * NaN payloads are not propagated even on copies, or in arithmetics.
 * They *might* be, according to some rules, on your particular
 * cpu/os/compiler/libraries, but no guarantees.
 *
 * To summarize, on most platforms, and for 64-bit doubles
 * (using big-endian ordering here):
 *
 * [7FF8000000000000..7FFFFFFFFFFFFFFF] quiet
 * [FFF8000000000000..FFFFFFFFFFFFFFFF] quiet
 * [7FF0000000000001..7FF7FFFFFFFFFFFF] signaling
 * [FFF0000000000001..FFF7FFFFFFFFFFFF] signaling
 *
 * The C99 nan() is supposed to generate *quiet* NaNs.
 *
 * Note the asymmetry:
 * The 7FF0000000000000 is positive infinity,
 * the FFF0000000000000 is negative infinity.
 */

/* NVMANTBITS is the number of _real_ mantissa bits in an NV.
 * For the standard IEEE 754 fp this number is usually one less that
 * *DBL_MANT_DIG because of the implicit (aka hidden) bit, which isn't
 * real.  For the 80-bit extended precision formats (x86*), the number
 * of mantissa bits... depends. For normal floats, it's 64.  But for
 * the inf/nan, it's different (zero for inf, 61 for nan).
 * NVMANTBITS works for normal floats. */

/* We do not want to include the quiet/signaling bit. */
#define NV_NAN_BITS (NVMANTBITS - 1)

#if defined(USE_LONG_DOUBLE) && NVSIZE > DOUBLESIZE
#  if LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 13
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 2
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 7
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 2
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE
#    define NV_NAN_QS_BYTE_OFFSET 13
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE
#    define NV_NAN_QS_BYTE_OFFSET 1
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE
#    define NV_NAN_QS_BYTE_OFFSET 9
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE
#    define NV_NAN_QS_BYTE_OFFSET 6
#  else
#    error "Unexpected long double format"
#  endif
#else
#  ifdef USE_QUADMATH
#    ifdef NV_LITTLE_ENDIAN
#      define NV_NAN_QS_BYTE_OFFSET 13
#    elif defined(NV_BIG_ENDIAN)
#      define NV_NAN_QS_BYTE_OFFSET 2
#    else
#      error "Unexpected quadmath format"
#    endif
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_32_BIT_LITTLE_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 2
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_32_BIT_BIG_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 1
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_LITTLE_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 6
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_BIG_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 1
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 13
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN
#    define NV_NAN_QS_BYTE_OFFSET 2
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE
#    define NV_NAN_QS_BYTE_OFFSET 2 /* bytes 4 5 6 7 0 1 2 3 (MSB 7) */
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE
#    define NV_NAN_QS_BYTE_OFFSET 5 /* bytes 3 2 1 0 7 6 5 4 (MSB 7) */
#  else
/* For example the VAX formats should never
 * get here because they do not have NaN. */
#    error "Unexpected double format"
#  endif
#endif
/* NV_NAN_QS_BYTE is the byte to test for the quiet/signaling */
#define NV_NAN_QS_BYTE(nvp) (((U8*)(nvp))[NV_NAN_QS_BYTE_OFFSET])
/* NV_NAN_QS_BIT is the bit to test in the NV_NAN_QS_BYTE_OFFSET
 * for the quiet/signaling */
#if defined(USE_LONG_DOUBLE) && \
  (LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN || \
   LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN)
#  define NV_NAN_QS_BIT_SHIFT 6 /* 0x40 */
#elif defined(USE_LONG_DOUBLE) && \
  (LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE || \
   LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE || \
   LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE || \
   LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE)
#  define NV_NAN_QS_BIT_SHIFT 3 /* 0x08, but not via NV_NAN_BITS */
#else
#  define NV_NAN_QS_BIT_SHIFT ((NV_NAN_BITS) % 8) /* usually 3, or 0x08 */
#endif
#define NV_NAN_QS_BIT (1 << (NV_NAN_QS_BIT_SHIFT))
/* NV_NAN_QS_BIT_OFFSET is the bit offset from the beginning of a NV
 * (bytes ordered big-endianly) for the quiet/signaling bit
 * for the quiet/signaling */
#define NV_NAN_QS_BIT_OFFSET \
    (8 * (NV_NAN_QS_BYTE_OFFSET) + (NV_NAN_QS_BIT_SHIFT))
/* NV_NAN_QS_QUIET (always defined) is true if the NV_NAN_QS_QS_BIT being
 * on indicates quiet NaN.  NV_NAN_QS_SIGNALING (also always defined)
 * is true if the NV_NAN_QS_BIT being on indicates signaling NaN. */
#define NV_NAN_QS_QUIET \
    ((NV_NAN_QS_BYTE(PL_nan.u8) & NV_NAN_QS_BIT) == NV_NAN_QS_BIT)
#define NV_NAN_QS_SIGNALING (!(NV_NAN_QS_QUIET))
#define NV_NAN_QS_TEST(nvp) (NV_NAN_QS_BYTE(nvp) & NV_NAN_QS_BIT)
/* NV_NAN_IS_QUIET() returns true if the NV behind nvp is a NaN,
 * whether it is a quiet NaN, NV_NAN_IS_SIGNALING() if a signaling NaN.
 * Note however that these do not check whether the nvp is a NaN. */
#define NV_NAN_IS_QUIET(nvp) \
    (NV_NAN_QS_TEST(nvp) == (NV_NAN_QS_QUIET ? NV_NAN_QS_BIT : 0))
#define NV_NAN_IS_SIGNALING(nvp) \
    (NV_NAN_QS_TEST(nvp) == (NV_NAN_QS_QUIET ? 0 : NV_NAN_QS_BIT))
#define NV_NAN_SET_QUIET(nvp) \
    (NV_NAN_QS_QUIET ? \
     (NV_NAN_QS_BYTE(nvp) |= NV_NAN_QS_BIT) : \
     (NV_NAN_QS_BYTE(nvp) &= ~NV_NAN_QS_BIT))
#define NV_NAN_SET_SIGNALING(nvp) \
    (NV_NAN_QS_QUIET ? \
     (NV_NAN_QS_BYTE(nvp) &= ~NV_NAN_QS_BIT) : \
     (NV_NAN_QS_BYTE(nvp) |= NV_NAN_QS_BIT))
#define NV_NAN_QS_XOR(nvp) (NV_NAN_QS_BYTE(nvp) ^= NV_NAN_QS_BIT)

/* NV_NAN_PAYLOAD_MASK: masking the nan payload bits.
 *
 * NV_NAN_PAYLOAD_PERM: permuting the nan payload bytes.
 * 0xFF means "don't go here".*/

/* Shorthands to avoid typoses. */
#define NV_NAN_PAYLOAD_MASK_SKIP_EIGHT \
  0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
#define NV_NAN_PAYLOAD_PERM_SKIP_EIGHT \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
#define NV_NAN_PAYLOAD_PERM_0_TO_7 \
  0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7
#define NV_NAN_PAYLOAD_PERM_7_TO_0 \
  0x7, 0x6, 0x5, 0x4, 0x3, 0x2, 0x1, 0x0
#define NV_NAN_PAYLOAD_MASK_IEEE_754_128_LE \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00
#define NV_NAN_PAYLOAD_PERM_IEEE_754_128_LE \
  NV_NAN_PAYLOAD_PERM_0_TO_7, \
  0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xFF, 0xFF
#define NV_NAN_PAYLOAD_MASK_IEEE_754_128_BE \
  0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
#define NV_NAN_PAYLOAD_PERM_IEEE_754_128_BE \
  0xFF, 0xFF, 0xd, 0xc, 0xb, 0xa, 0x9, 0x8, \
  NV_NAN_PAYLOAD_PERM_7_TO_0
#define NV_NAN_PAYLOAD_MASK_IEEE_754_64_LE \
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00
#define NV_NAN_PAYLOAD_PERM_IEEE_754_64_LE \
  0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0xFF
#define NV_NAN_PAYLOAD_MASK_IEEE_754_64_BE \
  0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
#define NV_NAN_PAYLOAD_PERM_IEEE_754_64_BE \
  0xFF, 0x6, 0x5, 0x4, 0x3, 0x2, 0x1, 0x0

#if defined(USE_LONG_DOUBLE) && NVSIZE > DOUBLESIZE
#  if LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN
#    define NV_NAN_PAYLOAD_MASK NV_NAN_PAYLOAD_MASK_IEEE_754_128_LE
#    define NV_NAN_PAYLOAD_PERM NV_NAN_PAYLOAD_PERM_IEEE_754_128_LE
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN
#    define NV_NAN_PAYLOAD_MASK NV_NAN_PAYLOAD_MASK_IEEE_754_128_BE
#    define NV_NAN_PAYLOAD_PERM NV_NAN_PAYLOAD_PERM_IEEE_754_128_BE
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN
#    if LONG_DOUBLESIZE == 10
#      define NV_NAN_PAYLOAD_MASK \
         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, \
         0x00, 0x00
#      define NV_NAN_PAYLOAD_PERM \
         NV_NAN_PAYLOAD_PERM_0_TO_7, 0xFF, 0xFF
#    elif LONG_DOUBLESIZE == 12
#      define NV_NAN_PAYLOAD_MASK \
         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, \
         0x00, 0x00, 0x00, 0x00
#      define NV_NAN_PAYLOAD_PERM \
         NV_NAN_PAYLOAD_PERM_0_TO_7, 0xFF, 0xFF, 0xFF, 0xFF
#    elif LONG_DOUBLESIZE == 16
#      define NV_NAN_PAYLOAD_MASK \
         0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, \
         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
#      define NV_NAN_PAYLOAD_PERM \
         NV_NAN_PAYLOAD_PERM_0_TO_7, \
         0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
#    else
#      error "Unexpected x86 80-bit little-endian long double format"
#    endif
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN
#    if LONG_DOUBLESIZE == 10
#      define NV_NAN_PAYLOAD_MASK \
         0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, \
         0xff, 0xff
#      define NV_NAN_PAYLOAD_PERM \
         NV_NAN_PAYLOAD_PERM_7_TO_0, 0xFF, 0xFF
#    elif LONG_DOUBLESIZE == 12
#      define NV_NAN_PAYLOAD_MASK \
         0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, \
         0xff, 0xff, 0x00, 0x00
#      define NV_NAN_PAYLOAD_PERM \
         NV_NAN_PAYLOAD_PERM_7_TO_0, 0xFF, 0xFF, 0xFF, 0xFF
#    elif LONG_DOUBLESIZE == 16
#      define NV_NAN_PAYLOAD_MASK \
         0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, \
         0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
#      define NV_NAN_PAYLOAD_PERM \
         NV_NAN_PAYLOAD_PERM_7_TO_0, \
         0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
#    else
#      error "Unexpected x86 80-bit big-endian long double format"
#    endif
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_LE
/* For double-double we assume only the first double (in LE or BE terms)
 * is used for NaN. */
#    define NV_NAN_PAYLOAD_MASK \
       NV_NAN_PAYLOAD_MASK_SKIP_EIGHT, NV_NAN_PAYLOAD_MASK_IEEE_754_64_LE
#    define NV_NAN_PAYLOAD_PERM \
       NV_NAN_PAYLOAD_PERM_SKIP_EIGHT, NV_NAN_PAYLOAD_PERM_IEEE_754_64_LE
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_BE
#    define NV_NAN_PAYLOAD_MASK \
       NV_NAN_PAYLOAD_MASK_IEEE_754_64_BE
#    define NV_NAN_PAYLOAD_PERM \
       NV_NAN_PAYLOAD_PERM_IEEE_754_64_BE
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LE_BE
#    define NV_NAN_PAYLOAD_MASK \
       NV_NAN_PAYLOAD_MASK_IEEE_754_64_LE
#    define NV_NAN_PAYLOAD_PERM \
       NV_NAN_PAYLOAD_PERM_IEEE_754_64_LE
#  elif LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BE_LE
#    define NV_NAN_PAYLOAD_MASK \
       NV_NAN_PAYLOAD_MASK_SKIP_EIGHT, NV_NAN_PAYLOAD_MASK_IEEE_754_64_BE
#    define NV_NAN_PAYLOAD_PERM \
       NV_NAN_PAYLOAD_PERM_SKIP_EIGHT, NV_NAN_PAYLOAD_PERM_IEEE_754_64_BE
#  else
#    error "Unexpected long double format"
#  endif
#else
#  ifdef USE_QUADMATH /* quadmath is not long double */
#    ifdef NV_LITTLE_ENDIAN
#      define NV_NAN_PAYLOAD_MASK NV_NAN_PAYLOAD_MASK_IEEE_754_128_LE
#      define NV_NAN_PAYLOAD_PERM NV_NAN_PAYLOAD_PERM_IEEE_754_128_LE
#    elif defined(NV_BIG_ENDIAN)
#      define NV_NAN_PAYLOAD_MASK NV_NAN_PAYLOAD_MASK_IEEE_754_128_BE
#      define NV_NAN_PAYLOAD_PERM NV_NAN_PAYLOAD_PERM_IEEE_754_128_BE
#    else
#      error "Unexpected quadmath format"
#    endif
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_32_BIT_LITTLE_ENDIAN
#    define NV_NAN_PAYLOAD_MASK 0xff, 0xff, 0x07, 0x00
#    define NV_NAN_PAYLOAD_PERM 0x0, 0x1, 0x2, 0xFF
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_32_BIT_BIG_ENDIAN
#    define NV_NAN_PAYLOAD_MASK 0x00, 0x07, 0xff, 0xff
#    define NV_NAN_PAYLOAD_PERM 0xFF, 0x2, 0x1, 0x0
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_LITTLE_ENDIAN
#    define NV_NAN_PAYLOAD_MASK NV_NAN_PAYLOAD_MASK_IEEE_754_64_LE
#    define NV_NAN_PAYLOAD_PERM NV_NAN_PAYLOAD_PERM_IEEE_754_64_LE
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_BIG_ENDIAN
#    define NV_NAN_PAYLOAD_MASK NV_NAN_PAYLOAD_MASK_IEEE_754_64_BE
#    define NV_NAN_PAYLOAD_PERM NV_NAN_PAYLOAD_PERM_IEEE_754_64_BE
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN
#    define NV_NAN_PAYLOAD_MASK NV_NAN_PAYLOAD_MASK_IEEE_754_128_LE
#    define NV_NAN_PAYLOAD_PERM NV_NAN_PAYLOAD_PERM_IEEE_754_128_LE
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN
#    define NV_NAN_PAYLOAD_MASK NV_NAN_PAYLOAD_MASK_IEEE_754_128_BE
#    define NV_NAN_PAYLOAD_PERM NV_NAN_PAYLOAD_PERM_IEEE_754_128_BE
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE
#    define NV_NAN_PAYLOAD_MASK 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0xff, 0xff
#    define NV_NAN_PAYLOAD_PERM 0x4, 0x5, 0x6, 0xFF, 0x0, 0x1, 0x2, 0x3
#  elif DOUBLEKIND == DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE
#    define NV_NAN_PAYLOAD_MASK 0xff, 0xff, 0xff, 0xff, 0x00, 0x07, 0xff, 0xff
#    define NV_NAN_PAYLOAD_PERM 0x3, 0x2, 0x1, 0x0, 0xFF, 0x6, 0x5, 0x4
#  else
#    error "Unexpected double format"
#  endif
#endif

#endif /* DOUBLE_HAS_NAN */


/*

   (KEEP THIS LAST IN perl.h!)

   Mention

   NV_PRESERVES_UV

   HAS_MKSTEMP
   HAS_MKSTEMPS
   HAS_MKDTEMP

   HAS_GETCWD

   HAS_MMAP
   HAS_MPROTECT
   HAS_MSYNC
   HAS_MADVISE
   HAS_MUNMAP
   I_SYSMMAN
   Mmap_t

   NVef
   NVff
   NVgf

   HAS_UALARM
   HAS_USLEEP

   HAS_SETITIMER
   HAS_GETITIMER

   HAS_SENDMSG
   HAS_RECVMSG
   HAS_READV
   HAS_WRITEV
   I_SYSUIO
   HAS_STRUCT_MSGHDR
   HAS_STRUCT_CMSGHDR

   HAS_NL_LANGINFO

   HAS_DIRFD

   so that Configure picks them up.

   (KEEP THIS LAST IN perl.h!)

*/

#endif /* Include guard */

/*
 * ex: set ts=8 sts=4 sw=4 et:
 */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    Ɛ&^$     6  ;o                Ɛ&$     (q  ;o      p          Ɛ&ؿ$     )q  ;o          j      Ɛ&$     *q  ;o      ^          Ɛ&J$       ;o          5      Ɛ&n$       ;o      L          Ɛ&$     	)  ;o                Ɛ&4$     0q  ;o          J      Ɛ&h$     .q  ;o                Ɛ&$     -q  ;o          j      Ɛ&$     +q  ;o          o      Ɛ&$     ,q  ;o      c    t      Ɛ&$       ;o                Ɛ&6$     2q  ;o      g          Ɛ&f$     3q  ;o                Ɛ&$     4q  ;o          .      Ɛ&$     6q  ;o                Ɛ&,$     =  ;o                Ɛ&P$     "  ;o      8          Ɛ&$     7q  ;o                Ɛ&$     5q  ;o                Ɛ&$     8q  ;o      8          Ɛ&$     q  ;o                Ɛ&($     F{  ;o                Ɛ&j$     
  ;o      J          Ɛ&$     9q  ;o      R          Ɛ&$     :q  ;o                Ɛ&$     ;q  ;o                Ɛ&P$     s  ;o      ^    s      Ɛ&t$     v  ;o                 Ɛ&$     =q  ;o          .      Ɛ&$     ׯ  ;o                Ɛ&$     >q  ;o                Ɛ&T$     \/  ;o                Ɛ&$     ?q  ;o                Ɛ&$       ;o                Ɛ&$     @q  ;o                Ɛ&F$     Aq  ;o      b          Ɛ&x$     Bq  ;o      S    .      Ɛ&$     g  ;o                Ɛ&$     Z  ;o      e           Ɛ&$     Cq  ;o                Ɛ&8$      Dq  ;o                Ɛ&\$       ;o      `          Ɛ&$       ;o      {
          Ɛ&$     ;  ;o      
    {      Ɛ&$     Eq  ;o                Ɛ&r$
     Gq   ;o      Z          Ɛ&$     Hq  ;o                Ɛ&$     Iq  ;o          r      Ɛ&<$     Jq  ;o           [      Ɛ&x$     Lq  ;o      \    T      Ɛ&$     Mq  ;o          ^      Ɛ&$     Nq  ;o          J      Ɛ&*$     Oq  ;o      [    a      Ɛ&$     Pq  ;o                Ɛ& $     Sq 	 ;o      A    i      Ɛ&l$     Uq 
 ;o           :      Ɛ&$         ;o      !    U      Ɛ&$"     Vq  ;o      <#          Ɛ&$$     Wq 
 ;o      $    u      Ɛ&\$&     Xq  ;o      X&    E      Ɛ&$(     q  ;o      (    "      Ɛ&
$*     Yq  ;o      *          Ɛ&.$,       ;o      ,          Ɛ&R$.     [q  ;o      .          Ɛ&$0       ;o      u0          Ɛ&$2     ^q  ;o      L2          Ɛ&&$4     aq  ;o      4    	      Ɛ&$6     bq  ;o      8          Ɛ&>$8     gq  ;o      9           Ɛ&b$:     DH  ;o      :          Ɛ&$<     hq  ;o      <          Ɛ&$>     iq  ;o      C>          Ɛ&$@     jq  ;o      A          Ɛ&2$B     kq  ;o      B          Ɛ&$D     lq  ;o      wD          Ɛ&$F     oq  ;o      7G          Ɛ&p$H     pq  ;o      H          Ɛ&$J     cq   ;o      J          Ɛ&$L     dq ! ;o      L          Ɛ&$N     qq " ;o      3N          Ɛ&$P     wq # ;o      O           Ɛ&<$R     rq $ ;o      P          Ɛ&`$T     vq % ;o      R    ^      Ɛ&$V     sq & ;o      U          Ɛ&$X     tq ' ;o      V    p      Ɛ&$Z     uq ( ;o      jY          Ɛ&$\     & ) ;o      [          Ɛ&B$^        * ;o      ]    c      Ɛ&$`     zq + ;o      wb          Ɛ&$b     {q , ;o      e          Ɛ&$d      - ;o      &h    -      Ɛ&Z$f     e . ;o      Tj          Ɛ&%%h     ~q / ;o      cl          Ɛ&%%j     q 0 ;o      m    H      Ɛ&&%l     k% 1 ;o      @p          Ɛ&B&%n      2 ;o      Hr    J      Ɛ&f&%p     q 3 ;o      t    G      Ɛ&&%r     H 4 ;o      v          Ɛ&&%t     q 5 ;o      x          Ɛ&2'%v     q 6 ;o      z          Ɛ&V'%x     p 7 ;o      j}          Ɛ&z'%z     q 8 ;o                Ɛ&'%|      9 ;o                Ɛ&'%~     q : ;o      ^    |      Ɛ&(%     	 ; ;o      ۆ          Ɛ&\(%     q < ;o                Ɛ&(%     v = ;o      ܋    A      Ɛ&(%     q > ;o          =      Ɛ&)%     q ? ;o      \           Ɛ&8)%     q @ ;o      E           Ɛ&t)%     DG A ;o                Ɛ&)%      B ;o      ԓ          Ɛ&)%     < C ;o          ~      Ɛ&)%     {R D ;o                Ɛ&X*%     q E ;o                Ɛ&|*%     q F ;o                Ɛ&*%     q G ;o                Ɛ&*%     q H ;o      
    q      Ɛ&+%     q I ;o                Ɛ&4+%      J ;o          [      Ɛ&X+%     q K ;o      m    r      Ɛ&{%     q L ;o                Ɛ&{%     L  M ;o      f    y      Ɛ&|%     q N ;o                Ɛ&^|%     q O ;o          1      Ɛ&|%     q P ;o                Ɛ&|%     q Q ;o                Ɛ&0}%      R ;o                Ɛ&`}%     5% S ;o      {          Ɛ&}%     q T ;o                Ɛ&}%      U ;o      J          Ɛ&}%      V ;o          
      Ɛ&~%     һ  W ;o                Ɛ&2~%      X ;o                 Ɛ&V~%     
 Y ;o                Ɛ&z~%      Z ;o      D    
      Ɛ&~%      [ ;o      O          Ɛ&~%     k \ ;o                Ɛ&%     
 ] ;o                Ɛ&:%     q ^ ;o      P          Ɛ&^%      _ ;o          o      Ɛ&%      ` ;o      X    &      Ɛ&%      a ;o                Ɛ&%      b ;o                Ɛ&%     q c ;o      S          Ɛ&,%     k d ;o          H      Ɛ&P%     
 e ;o      .    V      Ɛ&t%     P
 f ;o                Ɛ&%     q g ;o      ~    3      Ɛ&%     q h ;o                 Ɛ&%      i ;o      W          Ɛ&b%      j ;o      i          Ɛ&B      r  k ;o      /           Ɛ&%     3  l ;o      $          Ɛ&%     q m ;o      -          Ɛ&%     q n ;o          $      Ɛ&X%     q o ;o          V      Ɛ&%     q p ;o      V
           Ɛ&%     q q ;o      E    ^      Ɛ&%      r ;o      
    ]      Ɛ&2%     q s ;o          
      Ɛ&b%     q t ;o          T      Ɛ&%     q u ;o      e          Ɛ&<%     q v ;o      0    t      Ɛ&l%     q w ;o          2      Ɛ&%     q x ;o                Ɛ&%     q y ;o      !          Ɛ&%     q z ;o      w$          Ɛ&8%      q { ;o      '          Ɛ&%     q | ;o      *    W      Ɛ&%     ػ  } ;o      +          Ɛ&%     q ~ ;o      .          Ɛ&%     q  ;o      0          Ɛ&%
     q  ;o      )1    4      Ɛ&%     q  ;o      ^4          Ɛ&% :    ;o      7          Ɛ&8% = q  ;o      9    ~      Ɛ&% A q  ;o      ;          Ɛ&% D q  ;o      <          Ɛ&% H q  ;o      >          Ɛ&4% K q  ;o      @          Ɛ&n% N q  ;o      B          Ɛ&% Q   ;o      /D    `      Ɛ&% T q  ;o      F    '      Ɛ&%  W ;  ;o      H          Ɛ&$)&"       ;o      J          Ɛ&t)&$     .  ;o      L    F      Ɛ&*&&     /  ;o      M    +      Ɛ&>*&(     
  ;o      O    ;      Ɛ&z*&*     0  ;o      2Q          Ɛ&*&,     q  ;o      
S          Ɛ&+&.     q  ;o      'T    '      Ɛ&d+&0     q  ;o      OU    j      Ɛ&+&2     xP  ;o      V          Ɛ&*,&4     q  ;o      kX           Ɛ&\,&6     q  ;o      aY          Ɛ&,&8     q  ;o      $[          Ɛ&,&:     q  ;o      ]          Ɛ& -&<     q  ;o      ^    (      Ɛ&-&>     q  ;o      _          Ɛ&-&@     q  ;o      a          Ɛ&.&B     6   ;o      c          Ɛ&,.&D     q  ;o      ie    q      Ɛ&X.&F     q  ;o      f    <      Ɛ&.&H       ;o      i    9      Ɛ&.&J     q  ;o      Rk    L      Ɛ&.&L     q  ;o      l    =      Ɛ&,/&N     Tq  ;o      o           Ɛ&`/&P     m  ;o      p    6      Ɛ&/&R     Ւ   ;o      5s          Ɛ&/&T     q  ;o      +u    T      Ɛ&0&V     q  ;o      w    f      Ɛ&60&X     q  ;o      y    D      Ɛ&d&Z        ;o      ,|          Ɛ&&\     q  ;o          V      Ɛ&&^     q  ;o      q    )      Ɛ& &`     q  ;o          X      Ɛ&X&b     </  ;o                Ɛ&&d     q  ;o      t          Ɛ&&f     q  ;o                Ɛ&&h     q  ;o           "      Ɛ&@&j     q  ;o      C                                  Ɛ&&m     q  ;o      0           Ɛ&&o     q  ;o          l      Ɛ&4&q     q  ;o      M          Ɛ&j&s     q  ;o                Ɛ&&u     q  ;o                Ɛ&&w     q  ;o      	    S      Ɛ&X&y     q  ;o      ]    ]      Ɛ&&{     q  ;o          x      Ɛ&ڄ&}     q  ;o      4          Ɛ&&     q  ;o          T      Ɛ&D&     q  ;o      I    p      Ɛ&h&     q  ;o                Ɛ&&     q  ;o      S    "      Ɛ&&     q  ;o      v          Ɛ&&     q  ;o                Ɛ&N&     q  ;o                Ɛ&r&     q  ;o      ͯ          Ɛ&&     q  ;o      c          Ɛ&&     $  ;o      ?           Ɛ&&       ;o          S      Ɛ&f&     q  ;o      j          Ɛ&&     q  ;o                Ɛ&&     q  ;o          z      Ɛ&(&     q  ;o          ~      Ɛ&L&     }  ;o          F      Ɛ&p&     q  ;o      M    ~      Ɛ&&     q  ;o          9      Ɛ&"&     q  ;o          D      Ɛ&F&     q  ;o      K    5      Ɛ&&       ;o                Ɛ&&       ;o      (    \      Ɛ&&     q  ;o          (      Ɛ&0&     q  ;o          4      Ɛ&l&     q  ;o          C      Ɛ&&     q  ;o      '          Ɛ&&     n  ;o                Ɛ&
&     q  ;o      V           Ɛ&D&     q  ;o                Ɛ&|&     q  ;o                Ɛ&&     q  ;o      U    .      Ɛ&&     q  ;o          >      Ɛ&(&     q  ;o                Ɛ&f&      r  ;o                Ɛ&&     r  ;o                Ɛ&&     k  ;o      r          Ɛ&&     r  ;o      !           Ɛ&&       ;o                Ɛ&:&       ;o                Ɛ&^&     
  ;o      s          Ɛ&&     r  ;o      G          Ɛ&΍&     r  ;o      	          Ɛ& &     H  ;o      
          Ɛ&D&     r  ;o          (      Ɛ&h&     r  ;o          #      Ɛ&&     r  ;o                Ɛ&&       ;o          *      Ɛ&$&     r  ;o          f      Ɛ&X&     	r  ;o          F      Ɛ&&     
r  ;o      ^          Ɛ&ڏ&     r  ;o      v          Ɛ&2&     r  ;o          Y      <o                    <o            :      <o                  <o                  <o      P	            <o                  <o                  <o                  <o      c            <o      
            <o                  <o      l            <o                  <o      %"      C      <o      i%            <o      (            <o      +             *U D 7   <o      +            <o      -            <o      0      3      <o      4            <o      7            <o      0:            <o      <      i       *U  P 
r  <o      <      i      <o      [?             ,+U R r  <o      [?            <o      vB            <o      E            <o      G             d+U X r  <o      G            <o      gJ            <o      M             +U \ r  <o      M            <o      O      6      <o      
R            <o      T      |       
,U b r  <o      T      |      <o      \X             T,U d r  <o      \X            r >> ,U            r >>              <o      Z[             ,U f r  <o      Z[            r ?>                 <o      T^             -U h r  <o      T^            <o      Ta      ?      <o      d      n       H.U! l r  <o      d      n      <o      h      d      <o      hj            Ɛ& %     #   =o                    Ɛ&) '     &   =o                  Ɛ&) )     '   =o                   Ɛ&P* +     (   =o                  Ɛ&* -     *   =o            E      Ɛ&6+ /     ,   =o                  Ɛ&Z+ 1     #   =o            E      Ɛ&{ 3     .   =o      Z           Ɛ&{ 5     /    =o      '     9      Ɛ&| 7     0   =o      a     L      Ɛ&L| 9     1   =o      '           Ɛ&| ;     2   =o      *           Ɛ&| =     3   =o      0           Ɛ&~ ?     6   =o      x4     5      Ɛ&@~ A     :   =o      7     +      Ɛ&~ C     ;   =o      sc           Ɛ&*UE     7   =o      s           Ɛ&} G     -  	 =o      	u           Ɛ&F} I     4  
 =o      v           Ɛ&~ K     =   =o                 Ɛ& M     >   =o                 Ɛ&L O     ?  
 =o      V           Ɛ&*UQ     
r  =o                  Ɛ&,+US     r  =o                 Ɛ& U     @   =o      `)     Z      Ɛ& W     A   =o      0           Ɛ&d+UY     r  =o      hM           Ɛ& [     B   =o      GO     d      Ɛ&+U]     r  =o      Q           Ɛ&J _     C   =o      ;X     "      Ɛ&} a  (   =o      ^Y           Ɛ&
,Uc     r  =o      [     z      Ɛ&T,Ue     r  =o      \           Ɛ&,Ug     r  =o      H^     P      Ɛ&-Ui     r  =o      _     f      Ɛ& k     D   =o       a     n      Ɛ&H.Um     r  =o      ob     i      Ɛ&h o     F   =o      c           Ɛ&Ё q     G   =o      be           >o                    >o                  >o                  >o      Y      F      >o      
      /      >o                  >o                  >o            o      >o      x      
      >o            o      >o                  >o             S      >o      Z"      g      >o      $      g      >o      *'            >o      )      )      >o      +      *      >o      .      k      >o      0      R      >o      4            >o      6            >o      9            >o      <      .      >o      ?            >o      C            >o      F            >o      I      =      >o      M            >o      wP      Z      >o      S      &      >o      U            >o      X            >o      -\            >o      _            >o      a            >o      c      '       ~4      (  >o      c      '      >o      6e             ,4      3   >o      6e            >o       i      D       P4      ( ! >o       i      D      >o      ek             4      ( " >o      ek            >o      um      u       4      ( # >o      um      u      >o      o             4      ( $ >o      o            >o      r             64      ( % >o      r            >o      t             p4      ( & >o      t            >o      v      X       4      ( ' >o      v      X      ( J>              >o      y              4      ( ( >o      y             >o      
|      }       ~         ) >o      
|      }      >o      ~            >o      1      J      >o      |            >o                  >o                   p*>      g * >o                  >o      
      k      >o      y            >o                  >o                  >o            ;      >o      ͨ            >o      j            >o      o            >o      	            >o                  >o      r      M      >o                  >o      ̻      r      >o      ?            >o            K      >o             6      >o      W      m      >o                  >o                  >o            v      >o      S      x      >o                  >o                  >o            I      >o      
      -      >o      8      J      >o                  >o      V      ]      >o                   >o            	      >o                  >o                  >o                  >o      $            >o                  >o      \            >o      N      H      >o            y      >o            D      >o      V      9      >o           g      >o           j      >o      c     b      >o      	           >o      V     I      >o           @      >o           8      >o           I      >o      d     _      >o           u      >o      :     O      >o           Y      >o                  >o      "           >o      %           >o      '     b      >o      F*     [      >o      ,           >o      %/     )      >o      O1           >o      5           >o      8           >o      :     I      >o      <           >o      ?     U      >o      B           >o      D     E      t M>         b       M>         ΋  >o      G     N       A      -F + >o      G     N      >o      RN            A      t , >o      RN           >o      Q     $       A      t - >o      Q     $      >o      T            RA      t . >o      T           >o      Z     g       A      t / >o      Z     g      >o      ]            A      t 0 >o      ]           >o      _     T       A      t 1 >o      _     T      >o      f           >o      h     ]      >o      Vk           >o      n           >o      8p     ]      >o      r           >o      /u     i      >o      }     3      >o           A      >o           t       LF #       2 >o           t       U>         Q     >o           S       F '      3 >o           S      >o      ؈            F *      4 >o      ؈           >o           x       8F -      5 >o           x      >o      l     i       \F 0      6 >o      l     i      >o      ֏            F 3      7 >o      ֏           >o      n     g       ƚF 6      8 >o      n     g      >o      ֔            F 9      9 >o      ֔            \>         g      \>         h :  \>         i ;  \>         j < >o      {     9       F @      : >o      {     9       ]>         n     >o                  ΛF D      ; >o                 >o                  F G      < >o                 >o           Z      >o           W      >o      L           >o      k           >o      %           >o      ;           >o      G           >o                 >o                 >o           *      >o                 >o                 >o      &     t      >o                 >o      u           >o           d      >o      l     s      >o           q      >o      R           >o      %     q      >o           D      >o           1       N _       = >o           1      >o           G       Z b     U  > >o           G      >o      V     W       N e      ? >o      V     W      >o           Q       PN h       @ >o           Q      >o                   N k      A >o                   d>         B      d>         B l  d>         B m K d>         B n >o           H       ,N r     W  B >o           H       e>         l      e>         m s  e>         B t K e>         o u >o      *     8       tN y      C >o      *     8       f>         s      f>         t z  f>         B {  f>         B | K f>         v } >o      c     \       N       D >o      c     \      >o           t       N      G E >o           t      >o      5     s       N      K F >o      5     s      >o           Z       N      M G >o           Z      >o           k       z O      H H >o           k      >o      p     S        O      U I >o      p     S      >o      	             O      S J >o      	           . m>         D     >o                  O      O K >o                 >o                  2O      Q L >o                 W o>         H     >o                  pO      R M >o                  p>         R     >o                  O      P N >o                 >o      l            O      T O >o      l           >o      K            O      I P >o      K           >o      :     &      >o      a     c      >o      !     J      >o      $             pe      Ǚ Q >o      $            >o      &            e      G R >o      &           >o      
(            Ԫe      ř S >o      
(           >o      *            e      G T >o      *           >o      n-            Ze      G U >o      n-           >o      0     T       e      G V >o      0     T      >o      l2     `       ثe      G W >o      l2     `      >o      4            e        X >o      4           >o      7     d      >o      :           >o      ?           >o      ~B           >o      E           >o      G           >o      J           >o      aM           >o      CP           >o      1S     j      >o      U     _      >o      W     z      >o      wZ           >o      h]     e      >o      _     o      >o      >b           >o      e            &g      #S Y >o      e           >o      i     F       vg      $S Z >o      i     F      >o      Bv            g      7S [ >o      Bv           >o      x     "       Bh      DS \ >o      x     "      >o      Y            ZBh      FS ] >o      Y           >o      H            Bh      GS ^ >o      H           >o                  Bh      HS _ >o                 >o                  Bh      IS ` >o                 >o                  Bh      JS a >o                 >o                  Ch      S b >o                 >o      )            <Ch      S c >o      )           >o      Ѵ     I       `Ch      KS d >o      Ѵ     I      >o                  Ch      LS e >o                 >o                  Ch      MS f >o                 >o                  Ch       NS g >o                 >o           D       Ch      OS h >o           D      >o           1       Dh      S i >o           1      >o           /       BDh 	     S j >o           /      >o      I            fDh      PS k >o      I           >o      3            Dh      QS l >o      3           >o                  Dh      S m >o                 >o                  Dh      RS n >o                 >o           f        Eh      SS o >o           f      >o      B            $Eh      S p >o      B           >o      7            HEh      S q >o      7           >o                  lEh !     TS r >o                 >o                  Eh $     US s >o                 >o                  Eh '     S t >o                 >o           %       Eh *     VS u >o           %      >o           
       Fh -     S v >o           
      >o           <       6Fh 0     S w >o           <      >o           M       ZFh 3     S x >o           M      >o      j            Fh 6     S y >o      j           >o      $             Fh 9     S z >o      $            >o                  Fh <     S { >o                 >o                   Gh ?     S | >o                 >o           b       $Gh B     WS } >o           b      >o                  HGh E     S ~ >o                 >o                  lGh H     S  >o                 >o      z            Gh K     S  >o      z           >o      y            Gh N     S  >o      y           >o      5!            Gh Q     S  >o      5!           >o      &            h T     S  >o      &           >o      *            @h W     S  >o      *           >o      .     s       dh Z     S  >o      .     s      >o      53            h ]     S  >o      53           >o      
7            h `     S  >o      
7           >o      :            Иh c     S  >o      :           >o      z?            h f     S  >o      z?           >o      NC            h i     XS  >o      NC           >o      7G            <h l     S  >o      7G           >o      K     s       `h o     YS  >o      K     s      >o      N     a       h r     ZS  >o      N     a      >o      Q     3       h u     S  >o      Q     3      >o      V            ̙h x     S  >o      V           >o      Z            h {     S  >o      Z           >o      d_     ^       h ~     S  >o      d_     ^      >o      b     J       8h      S  >o      b     J      >o      f     J       \h      S  >o      f     J      >o      Yi     G       h      S  >o      Yi     G      >o      l            h      [S  >o      l           >o      o            Țh      ޙ  >o      o           >o      rr            h      \S  >o      rr           >o      
v            h      ߙ  >o      
v           >o      y     @       4h      S  >o      y     @      >o      ~     {       dh      S  >o      ~     {      >o      K     g       h      S  >o      K     g      >o           Z       h      S  >o           Z      >o           V       Лh      S  >o           V      >o      e     ^       h      S  >o      e     ^      >o      ė     _       h      S  >o      ė     _      >o      $            <h      ]S  >o      $           >o           X       `h      S  >o           X      >o                  h      ^S  >o                 >o           <       h      _S  >o           <      >o      >     O       ̜h      `S  >o      >     O      >o                  h      aS  >o                 >o      o            h      bS  >o      o           >o                  8h      cS  >o                           _ /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_non-free-firmware_binary-amd64_Packages     5de19f5665fffbb3fbe8d9daf675cc45   firmware-qcom-media    non-free-firmware/oldlibs    firmware-qcom-soc     c1e7b5258d2bcd95f7264264434911d0   20200421-1~     31d5e1ba4a12d1f1ec996774b7ba5446   firmware-samsung    d4a262eae47dafb2d5673546b66ce855   firmware-ti-connectivity    a9d441aeff30465d959a4213890f12b5   live-task-non-free-firmware-pc   live-tasks-non-free-firmware    39edf9ada4565dbd164ec44163f7b0a6  " live-task-non-free-firmware-server    2ed1607d198a8085c71bade15fa70773   firmware-nvidia-gsp    535.247.01-1~deb12u1   nvidia-graphics-drivers    firmware-nvidia-gsp-535.247.01  
 535.247.01    662e57a0e8a9d9abcd4ca747c6e5e11f   firmware-nvidia-tesla-gsp    525.147.05-15~deb12u1    nvidia-graphics-drivers-tesla    firmware-nvidia-gsp-525.147.05    3f151c5c845fe50a947f350b01607a27   raspi-firmware   1.20220830+ds-1    non-free-firmware/misc   linux-firmware-raspi3    1.20161123-2   raspi3-firmware   
 1.20190718-1~     1d52938bf8f18e15a1948e9778a9e310  ] /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_non-free-firmware_i18n_Translation-en   X /var/lib/apt/lists/security.debian.org_debian-security_dists_bookworm-security_InRelease   security.debian.org    stable-security    bookworm-security    Debian-Security   i /var/lib/apt/lists/security.debian.org_debian-security_dists_bookworm-security_main_binary-amd64_Packages    5.66-1+deb12u1   1:0.95-6~deb12u1   138.0.7204.183-1~deb12u1   138.0.7204.183-1~deb12u1.1~    287.1-0+deb12u2     ;N U> }       Wc" W> |   <N W> T      Wc" X>  	  vQ X> n 
   X> {      \ Y> }    Y> } 
  C Y> }   =N Y> B  	 7N Y> }  
 Wc" Y>    >N Y> <      Wc" Z>   
 ?N Z>          @N [> yd   AN [> Sd   Wc" [>     [> 
    [> m   BN [> Zd      Wc" \>    _
 \> 
    \>  z   CN \> {   DN \> }   EN \> pl    FN \> { !  S \> z "  GN \>  #  HN \>        ]>  %  V ]> \ &   Yc" ]> { ' ! R ]> O{ ( " IN ]> { ) # JN ]> (     $ \ ^> $ + % f ^> ^n , &  ^>  - ' ޣ ^> Rz . ( $ ^> n / ) C ^> 
 0 * KN ^> % 1 + LN ^>  2 , 8N ^> } 3 - أ ^> { 4 .  ^>  5 / MN ^>  6 0 NN ^> q 7 1 C ^>      2 \ _> * 9 3 `c" _> ! : 4  _> u}     5 ? `> v  < 6 \ `> 8 = 7 ޣ `> - > 8 $ `> . ? 9 , `> 4c @ : @ `> Yl A ; ɣ `>  B < A `>  C = B `> B D > C `> 2 E ? D `> _l F @  `> t} G A  `> : H B  `> n     C ? a> ; J D \ a> < K E $ a> > L F , a> ? M G @ a> @ N H A a> B O I ظ a> a} P J  a> b} Q K B a> C R L C a> D S M D a> E T N  a> F U O  a> G V P ۸ a>  W Q  a> H     R ? b> I Y S \ b> J Z T $ b> K [ U , b> L \ V @ b> M ] W A b> N ^ X B b> Q _ Y C b> R ` Z D b> S a [  b> { b \  b> T c ]  b> U d ^  b>  e _  b> W f `  b> d     a ac" d> Y
 h b  d> >
 i c  d> 9 j d  d>  k e  d> Z l f  d>  m g 	 d> n n h 
 d>  o i  d> z p j  d> O q k  d> | r l 
 d> y     m bc" e>  t n  e> ( u o  e> i v p  e> j w q  e> l x r 	 e> m y s 
 e> n z t  e> 9 { u  e> o | v  e> p } w  e> q ~ x 
 e> r     y `c" f> {  z  f> t  {  f> h  |  f>      }  f> v  ~  f> w   	 f> x   
 f> y    f> {    f> |    f> z    f> }   
 f> ~       g> y   cc" g>    \ g> Y   6 g> Kz    g>       dc" h>    ? h> X   \ h>     h> En    h> |   Ц h> Y    h> ]   % h> ;{   6 h> y    h>     h> m    h> a   
 h> Z   b h> p}    h> b   1 h> c       i> _   \ i>    6 i>     i>       f j> |   أ j> 3    j> >&   N j> R    j> ܖ    j> 0   W j> KN    j>    T j> |    j> 
O   Z j> ${   [ j> %{   6 j>    \ j>    (q j>     j>     j> [}    j>     j> y   Ц j>     j> Hn   @ j> \   % j>    Q j> ]l   6 j>     j>     j>    m j> H|   
 j>     j> Xo    j>     j> In   1 j>     j>     j> {    j> O    j> P    j> J    j> K    j>     j>     j>     j> L    j>        j>     j>     j>     j>     j>        j>       dc" k>    cc" k> 
    k> U      dc" m>    \ m>     m>    6 m>     m>    
 m>     m>    a m>     m>    q m> Z    m>       dc" n>    ec" n>    fc" n>    gc" n> e   \ n>    6 n>     n>    
 n>     n>       dc" o>    \ o>     o>    6 o>     o>    
 o>     o>     o>       dc" p>    \ p>     p>    6 p>    
 p>    r p> ZC      dc" q>    hc" q> c   fc" q> d   \ q>      q>    6 q>    
 q>     q>       e r> >m   : r> ?m     r>    % r>    Q r>  	  6 r>  
   r>     r>     r>  
  Ù r> h$      -O s>   	 8 s>      
 8 t>       \ u>    ic" u> b  
  u>    | u>     u> [   n u> |\   8 u>    8 u>    8 u>    8 u>    8 u>       8 v>    8 v>     8 v>    8 v>     8 v>  !  8 v>       \ w>  #  k w>  $   w>  %  | w>  &   8 w> k ' ! eq w> { ( " .2 w> W ) # 8 w> 7N * $  w> z     % ic" x> # , & m x>      ' 8 y>  . ( 8 y>  / ) 8 y> !     * \ z> " 1 +  z> $ 2 ,  z> _} 3 - | z> % 4 . jc" z>  5 / 8 z>  6 0 8 z> 5 7 1 8 z> /     2 = {>  9 3 : {>  : 4 O {> / ; 5 ^ {> ] < 6 ڧ {> 4O = 7  {> [| > 8  ; {> - ? 9 ; {> e @ : ; {> ; A ; ; {> ; B < ; {> ; C = ; {> ; D > ; {> ; E ? ; {> . F @ ; {> ; G A 	; {>  < H B 
; {> < I C ; {> < J D ; {> < K E 
; {> < L F ; {> < M G ; {> < N H ; {> < O I ; {> < P J ; {> < Q K ; {>  R L ; {>     S M ; {>     T N ; {> - U O ; {> - V P ; {> - W Q ; {> - X R ; {> - Y S ; {> - Z T ; {> - [ U ; {> - \ V ; {> - ] W ; {> - ^ X  ; {> - _ Y !; {> >     Z kc" |> - a [  |> 7 b \ #; |> \ c ] ^ |> n d ^ \ |> 0 e _ _ |> -I f ` x |> k g a $; |> 	d h b Ц |>  i c  |>  j d p |> y k e %; |> F l f lc" |>  m g '; |> ; n h (; |> ; o i ); |> ; p j *; |> : q k +; |> : r l ,; |> D s m mc" |> _ t n nc" |>  u o /; |> dF v p 0; |> ~E w q 1; |> : x r 2; |> : y s 3; |> CE z t oc" |>  { u pc" |> a | v 6; |> (: } w 7; |> ; ~ x 8; |> yF  y 9; |> 8:  z :; |> zF  { ;; |> e  | <; |> B:  } =; |> e  ~ >; |> ;   ?; |> F   @; |> N:   A; |> O:   B; |> D   C; |> Q:   D; |> D   E; |> e   F; |> F   G; |> U:   H; |> V:   I; |> ~F   J; |> X:   K; |> F   L; |> e   M; |> [:   qc" |>    O; |> @   P; |> ;   Q; |> ?   R; |>    S; |> e:   T; |> ;   U; |> B   V; |> ;   W; |> E   X; |> ;   Y; |> F   Z; |> H   [; |> <   \; |> <   ]; |> e   ^; |> :   _; |> D   `; |> F   a; |> :   b; |> D   c; |> F   d; |> :   e; |> E   f; |> F   g; |> E   h; |> :   i; |> :   j; |> e   k; |> \F   l; |> E   m; |> :   n; |> D   o; |> F   p; |> $F   q; |>     |>    r; |>    s; |>        }> N    }> q   t; }>     }> 	|   j }> 8    }> =      u; 1 W   FN 1 n   v; 1 ^   w; 1       x; 1       y; 1 $   z; 1       4 1 Y   {; 1 Ư
   |; 1 
   }; 1 1c   ' 1    ~; 1       5 1    rc" 1 %   sc" 1 	.   tc" 1    uc" 1    vc" 1    wc" 1    xc" 1    yc" 1    zc" 1    {c" 1    |c" 1 .   }c" 1 .   ~c" 1 T   c" 1 l   c" 1 w   c" 1    c" 1 B   c" 1    c" 1    c" 1    c" 1 "   c" 1 V   c" 1 .   c" 1    c" 1 .   c" 1    c" 1 (   c" 1 x   c" 1 *   c" 1 +   c" 1 ,   c" 1 -   c" 1    c" 1 .   c" 1 /   c" 1 0   c" 1 1   c" 1 2   c" 1 3   c" 1 4   c" 1 5   c" 1 6   c" 1 7   c" 1 8   c" 1 9   c" 1 :   c" 1 ;   c" 1    c" 1     c" 1 <   c" 1 =   c" 1 >   c" 1 ?   c" 1 @   c" 1 A    c" 1 B   c" 1    c" 1  	  c" 1  
  c" 1    c" 1 C   c" 1 D 
  c" 1 E   c" 1 F  	 c" 1 G  
 c" 1 H   c" 1 I   c" 1 J  
 c" 1 K   c" 1 )   c" 1 &   c" 1 '   c" 1    c" 1 )   c" 1 ,   c" 1    c" 1 +   c" 1 -   c" 1 .   c" 1    c" 1 0    c" 1 - !  c" 1  "  c" 1 3 #  c" 1 L $  c" 1  %  c" 1 6 &   c" 1 1. ' ! c" 1  ( " c" 1 Q ) # c" 1 R * $ c" 1  + % c" 1 . , & c" 1 . - ' c" 1 . . ( c" 1 . / ) c" 1 . 0 * c" 1 . 1 + c" 1 . 2 , c" 1 . 3 - c" 1 . 4 . c" 1 . 5 / c" 1 . 6 0 c" 1 . 7 1 c" 1  8 2 c" 1 = 9 3 c" 1 S : 4 c" 1 T ; 5 c" 1 U < 6 c" 1 V = 7 c" 1 W > 8 c" 1 X ? 9 c" 1 Y @ : c" 1 Z A ; c" 1 [ B < c" 1 \ C = c" 1 ] D > c" 1 ^ E ? c" 1 _ F @ c" 1 ` G A c" 1 a H B c" 1 b I C c" 1 c J D c" 1 d K E c" 1 e L F c" 1 f M G c" 1 g N H c" 1 h O I c" 1 i P J c" 1 v Q K c" 1 k R L c" 1 l S M c" 1 m T N c" 1 n U O c" 1 o V P c" 1 w W Q c" 1 q X R c" 1 r Y S c" 1 s Z T c" 1 t [ U c" 1 u \ V c" 1 v ] W  d" 1 w ^ X d" 1 x _ Y d" 1 y ` Z d" 1 z a [ d" 1 { b \ d" 1 | c ] d" 1 } d ^ d" 1 ~ e _ d" 1  f ` 	d" 1  g a 
d" 1  h b d" 1  i c d" 1  j d 
d" 1  k e d" 1  l f d" 1  m g d" 1  n h d" 1  o i d" 1  p j d" 1 u q k d" 1  r l d" 1  s m d" 1 x t n d" 1  u o d" 1 2 v p d" 1 { w q d" 1  x r d" 1  y s d" 1  z t d" 1  { u d" 1  | v d" 1  } w  d" 1  ~ x !d" 1   y "d" 1   z #d" 1   { $d" 1   | %d" 1   } &d" 1   ~ 'd" 1    (d" 1 o   )d" 1    *d" 1    +d" 1     ,d" 1    -d" 1 7   .d" 1    /d" 1    0d" 1    1d" 1       ^ 2 c   h 2 d   x 2 f    2 i   ;; 2 
0   9 2 1/   : 2 2/   ; 2 F      ^ 3     3    x 3     3    *; 3 s.   < 3 (8   ;; 3    9 3    = 3 </   > 3 =/   ? 3 C.   @ 3 ?/   : 3    ; 3       ^ 4     4    x 4     4    *; 4    < 4    A 4 H/   ;; 4    9 4    = 4    > 4    ? 4    @ 4    : 4    ; 4       ^ 5     5    x 5     5    *; 5    < 5    A 5    ;; 5    9 5    = 5    > 5    ? 5    @ 5    : 5    ; 5       ^ 6     6    x 6     6    *; 6    0; 6    ;; 6    I; 6    = 6    > 6    @ 6    : 6    ; 6       ^ 7     7    x 7     7    *; 7    0; 7    ;; 7    I; 7    = 7    > 7    j; 7    : 7    ; 7       ^ 8     8    x 8     8    *; 8    0; 8    ;; 8    I; 8    = 8    > 8    j; 8    : 8    ; 8       ^ 9     9    x 9     9    ;; 9    9 9    = 9    Q; 9    @ 9    : 9    ; 9       ^ :     :    x :    Ц : h    :    ;; :    =; : /   9 :    = :    > :    B : /    S; : .   C : /   @ :    : :    ; :       ^ ;     h ;    _ ; e   x ;  	   ;  
  ۧ ; j   ;; ;    =; ;  
  9 ;    L; ;   	 Q; ;   
 B ;    C ;    @ ;   
 : ;    ; ;       ^ <     <    x <     < 	   ;; <    I; < 
   : <       ^ =    \ =    x =     =     3; = . !  D = / "  ;; =  #  E =  $  F = / %  G = / &   9 =  ' ! L; =  ( " > =  ) # B =  * $ C =  + % H = / , & @ =  - ' : =  . ( I = /     ) ^ >  0 * \ >  1 + x >  2 ,  >  3 - 3; >   4 . D > ! 5 / ;; > " 6 0 E > # 7 1 F > $ 8 2 G > % 9 3 9 > & : 4 L; > ' ; 5 > > ( < 6 B > ) = 7 C > * > 8 H > + ? 9 @ > , @ : : > - A ; I > .     < ^ ? / C =  ? 0 D > x ? 1 E ?  ? 2 F @ ;; ? 5 G A I; ? 9 H B `; ?  I C e; ? ]> J D : ? @     E ^ @ B L F \ @ C M G x @ D N H  @ E O I ;; @ F P J I; @ G Q K ? @ H R L : @ J     M ^ A K T N  A L U O x A M V P  A N W Q ;; A O X R I; A P Y S : A R     T ^ B S [ U  B T \ V x B U ] W  B V ^ X ;; B W _ Y 9 B X ` Z : B Y     [ ^ C Z b \ h C [ c ] x C \ d ^  C ] e _ ;; C ^ f ` 9 C _ g a : C ` h b ; C      c ^ D a j d h D b k e x D c l f  D d m g J D e n h 9 D f o i = D : p j > D ; q k ]; D = r l @ D ? s m : D g t n ; D h     o ^ E i v p \ E j w q x E k x r  E l y s /; E  z t D E 4 { u ;; E m | v 9 E n } w = E o ~ x > E p  y C E q  z `; E Q  { H E >  | @ E r  } K E  8  ~ o; E s   ; E t      ^ F u   h F v   x F w    F x   D F z   ;; F {   9 F |   = F }   > F ~   `; F    H F    @ F    : F    ; F       ^ G     G    x G     G    ;; G    9 G    : G    ; G       ^ H     H    x H     H    ;; H    9 H    : H       ^ I     I    x I     I    ;; I    9 I    : I       L J b   ^ J    { J    x J    M J g    J    mc" J    < J y   ;; J    G J 8   I; J    = J    Q; J    C J    ? J    H J    @ J    : J       ^ K     K    x K     K    ;; K    9 K    : K    ; K       ^ L    h L    x L    N L     L    < L    6; L .   8; L    ;; L    9 L    = L    Q; L    ]; L    ? L    H L    @ L    K L    : L     L       ^ M    h M    x M     M    < M    ;; M    I; M    `; M    : M    ; M       ^ N     N    x N    O N 0    N    0; N    6; N    ;; N    9 N    = N    Q; N    j; N    : N    ; N       #; O    ^ O     O    x O    $; O     O    mc" O    /; O    pc" O    6; O    ;; O    G O    9 O    = O    > O    C O    `; O     H O    @ O    : O    ; O       ^ P       7.88.1-10+deb12u5    3.6.1-4+deb12u2    3.5.28-2.1~deb12u1   22.11.7-1~deb12u1    22.11.7                   Uw 0g U        eM  DS         -      hJ    bIP     }> t    U 0g U        hM  FS         |            <:Q     1 u    U 0g U        kM  GS                l     fR     2 v    U 0g U        nM  HS         _             13S     3 w    U 0g U        qM  IS         hV             aT     4 x    U 0g U        tM  JS         G              U     5 y    U 0g U        wM  S         E             F$V     6 z    U 0g U        zM  S         O             *	W     7 {    U 0g U        }M  KS         V             X     8 |    U 0g U        M  LS         7             +pY     9 }    U 0g U        M  MS                     }Z     : ~    U 0g U        M  NS         A             
0[     ;     U 0g U        M  OS         d            ސ\     <     U 0g U        M / S                     XFpf]     =     U 0g U        M B S         @             R\W^     >     U 0g U   
     M K PS         y       `     _     ?     U 0g U   
     M S QS         F             k`     @     U 0g U        M Z S         b             YC"a     A     U 0g U        M a RS         C             vb     B     U 0g U        M i SS         (h            J	c     C     U 0g U        M u S                    K|}d     D     U 0g U        M  S         O             x@pe     E     U 0g U        M  TS         P             #Jf     F     U 0g U   "     M  US         a       ,      g     G     U 0g U   %     M  S         O             GQh     H     U 0g U   (     M  VS         1      <     z\i     I     U 0g U   +     M  S         ;             +j     J     U 0g U   .     M  S                    vIk     K     U 0g U   1     M  S         O           Al     L     U 0g U   4     M  S         T             !Cm     M     U 0g U   7     M  S         L             n9-n     N     U 0g U   :     M  S         M             s\o     O     U 0g U   =     M  S         K             ʁyp     P     U 0g U   @     M ( WS         P             wq     Q     U 0g U   C     M 3 S         u       H     Y@r     R     U 0g U   F     M A S                     ?s     S     U 0g U   I     M X S                     4t     T     U 0g U   L     M i S                     ~Ywu     U     U 0g U   O     M  S         p            (v     V     U 0g U   R     M  S         )      `     w     W     U 0g U   U     M  S         $       T     {x     X     U 0g U   X     M  S         V             'y     Y     U 0g U   [     M  S         X             :应z     Z     U 0g U   ^     M  S         G             @{     [     U 0g U   a     M  S                    |     \     U 0g U   d     M  S         Hx       p     Vx}     ]     U 0g U   g     M  XS                     j~     ^     U 0g U   j     M # S         f             [     _     U 0g U   m     M 2 YS                T     0Ҁ     `     U 0g U   p     M > ZS         0J             K     a     U 0g U   s     M I S         t@             y     b     U 0g U   v     M \ S         p       P     6     c     U 0g U   y     N s S         `F             4xI     d     U 0g U   |     N  S         F             w1     e     U 0g U        N  S         0\                 f     U 0g U        
N  S         H             0:     g     U 0g U        
N  S         dY            3f     h     U 0g U        N  [S         M             }b     i     U 0g U        N  ޙ         R      h     k     j     U 0g U        N  \S         v             :,G     k     U 0g U        N  ߙ         $Y           ~     l     U 0g U        N  S         x           C     m     U 0g U        N  S         
           ^     n     U 0g U        "N  S         8i       @     H     o     U 0g U        %N + S         M             ¤G     p     U 0g U        (N G S         Hy       `     <     q     U 0g U        +N [ S         @             wj     r     U 0g U        .N v S                @     K     s     U 0g U        1N  ]S         =             de     t     U 0g U        4N  S                0     Nx     u     U 0g U        7N  ^S         6           ]
     v     U 0g U        :N  _S          f            S2     w     U 0g U        =N  `S         pM             )Tݘ     x     U 0g U        @N  aS         Ld            i3`     y     U 0g U        CN  bS         d\             e$6     z     U 0g U        FN  cS         J             VM     {     U 0g U   
     IN  dS                     3     |     U 0g U   
     LN 
 eS         dv             &     }     U 0g U        ON  fS                p     :     ~     U 0g U        RN * gS         7             W?=          U 0g U        UN 2 hS         8             yUs          U 0g U        XN 6 iS         ?             W          U 0g U        [N F jS         V             	Ԣ          U 0g U        ^N T kS         (}            '          U 0g U   "     aN ^ lS         Ќ            D          U 0g U   %     dN l S         T             ʶ          U 0g U   (     gN v S          K             c          U 0g U   +     jN  S         B             ҝ          U 0g U   .     mN  mS          @             })          U 0g U   1     pN  S         E             *          U 0g U   4     sN  &S         ?             }p/}          U 0g U   7     vN  nS         D9             AS          U 0g U   :     yN  %S         g       ,     k<@          U 0g U   =     |N  S         0       `      ԭ          U 0g U   @     N  CS         0       `      Ā          U 0g U   C     N  9S         $-       T      [ѯ          U 0g U   F     N  :S         -       T      :          U 0g U   I     N ! ;S         $-       T      &ۇ          U 0g U   L     N * <S         -       T      )4          U 0g U   O     N . =S         T-       T      {j          U 0g U   R     N < >S         -       T      \ô          U 0g U   U     N C ?S         $-       T      4          U 0g U   X     N L @S         -       T      !          U 0g U   [     N S AS         -       T      |Z          U 0g U   ^     N  BS         -       T      h
          U 0g U   a     N  oS         X8             
"t          U 0g U   d     N  pS         K             4          U 0g U   g     N  'S         @R             b          U 0g U   j     N  S         $j       @     G)          U 0g U   m     N  S         L{                      U 0g U   p     N  S                               U 0g U   s     N  S         y            IS          U 0g U   v     N  S         8                       U 0g U   y     N  S               P     9B          U 0g U   |     N   qS         p>      D'     L          U 0g U        N 1 (S                4     _          U 0g U        N F S               \     L          U 0g U        N _ S         8d           p          U 0g U        N p S         $)      x     (:f          U 0g U        N  rS                     r;)          U 0g U        N  )S                               U 0g U        N  S                      нO          U 0g U        N  S         P             5          U 0g U        N  S          U             Wf[          U 0g U        N  S         `(      P     J          U 0g U        N  S                p     
i          U 0g U        N  *S                     5          U 0g U        N  S         d            FUS          U 0g U        N . S         M           `          U 0g U        N A S         0'           h          U 0g U        N T +S         hQ      	                U 0g U        N g S                              U 0g U        N | sS         pl           օ          U 0g U        N  S                 @     )/          U 0g U        N  S         L            .          U 0g U        N  S         $            :B          U 0g U        N  S         8            Y%          U 0g U         O  ,S               d     A          U 0g U        O  S         P            C          U 0g U        O  S         А                       U 0g U        	O  -S                d     τr           U 0g U        O $ .S         
      '     /j          U 0g U        O < /S                     %          U 0g U        O M S         C           L+          U 0g U        O ` S                    |fo          U 0g U        O r tS         HV            p          U 0g U        O  S         ,l       @     C          U 0g U        O  S         $            3          U 0g U        !O  0S         Hz            NJ          U 0g U        $O  S         xo       0     ׁ      	    U 0g U        'O  S         tT           ai2j      
    U 0g U        *O  uS         N             xc          U 0g U        -O  S                    ;#          U 0g U        0O  S         y       p           
    U 0g U        3O % 1S         p            ҍ          U 0g U        6O 7 2S         L            }0          U 0g U        9O H S                     m          U 0g U        <O ] 3S         tK             n          U 0g U         ?O n 4S         8b            j.          U 0g U        BO  5S         H(           wl          U 0g U        EO  6S                     iM          U 0g U   	     HO  vS         xO             X          U 0g U        KO  wS         ȶ            䏣5          U 0g U        NO  xS         dG             <7          U 0g U        QO  yS         87             "`          U 0g U        TO  zS         L                       U 0g U        WO  {S         x      P
     EI*          U 0g U        ZO  |S         @       \               U 0g U        ]O  }S         0            FxS          U 0g U   !     `O ) S         K                       U 0g U   $     cO < S         tT            
          U 0g U   '     fO P S         ?             ~          U 0g U   *     iO h S         0M           \           U 0g U   -     lO  S         $            {      !    U 0g U   0     oO  S         O            [z      "    U 0g U   3     rO  ~S         F             {1      #    U 0g U   6     uO  S         I             xr       $    U 0g U   9     xO  S         J             v      %    U 0g U   <     {O  S         H^             (k"      &    U 0g U   ?     ~O  S         B                   '    U 0g U   B     O  S         A             N_      (    U 0g U   E     O  S         $L             ]T      )    U 0g U   H     O  S         =             1      *    U 0g U   K     O  S         v       4     s'      +    U 0g U   N     O 
 S         0B             Q      ,    U 0g U   Q     O  S         |:             1	      -    U 0g U   T     O   S                     N-
      .    U 0g U   W     O 9 S         [             &%W"      /    U 0g U   Z     O = S         D             L      0    U 0g U   ]     O E S         f       0     O
      1    U 0g U   `     O Y S         X            Nd      2    U 0g U   c     O s S         ta             f~[      3    U 0g U   f     O  S               $
     h      4    WX m W   i     -            Cu            k     ; 5    WX m W   l     0               M      @     ujz|      6    WX m W   o     3  9z         7             =      7    WX m W   r     6            &           :V      8    WX m W   u     9                          b}      9    2W  2W     w` e  K       h4)     ]    
     ` :    2W  2W    x` h  D         7      t     >7      ;    2W  2W    y` k  E                    U      <    2W  2W    z` n  .         t            
      =    2W  2W    {` q G F               $	     }      >    2W  2W    |` t J G         Ȼ      
     j#      ?    2W  2W    }` w M H                    ?y      @    2W  2W    ~` z O I         (           ?y      A    2W  2W    ` } Q J         :
      `     &z      B    2W  2W    `  T          	      8     d9      C    2W  2W    `  X K      lW      
     Cu\        D    2W  2W    `  ^ L         4      <
     !      E    2W  2W    `  a M               	     /j"      F    2W  2W    `  d N         :      h
     6#      G    2W  2W    `  g /         W      	     |$      H    2W  2W    `  i                @
     p?%      I    2W  2W    `  k          q	           
f&      J    2W  2W    `  n                     ?!'      K    2W  2W    `  p          4      
     G(      L    2W  2W    `  t          	      8     d9)     	 M    2W  2W    `  y          D	      p      yB*     
 N    2W  2W    `  {          ,x
           #}+      O    2W  2W    `            <2      h
     6,      P    2W  2W    `            3      h
     6-     
 Q    2W  2W    `            \      
     ,fF.      R    2W  2W     `            X           px/      S    2W  2W   # `            <            V&\0      T    2W  2W   & `                       px1      U    2W  2W   ) `                  $     ;2      V    2W  2W   , `            h      	     ?_3      W    2W  2W   / `            (y      
     4      X    2W  2W   2 `            hp      
     ]5      Y    2W  2W   5 `            w           œ6      Z    2W  2W   8 `            h      
     Ub7      [                                                                         P     x P  
  P P     P    < P    Q P 0   6; P    ;; P    9 P    = P   	 R P 0  
 Q; P    ? P    j; P   
 : P       ^ Q     Q    x Q     Q    0; Q    6; Q     ;; Q  !  9 Q  "  = Q  #  Q; Q  $  j; Q  %  : Q  &   Q  '  ; Q       ^ R  )   R  *  x R  +   R  ,   ;; R   - ! I; R ! . " = R " / # Q; R # 0 $ @ R $ 1 % : R % 2 & ; R '     ' ^ S ( 4 ( h S ) 5 ) x S * 6 *  S + 7 + 0; S  8 , S S  9 - ;; S , : . 9 S - ; / = S . < 0 Q; S / = 1 H S   > 2 @ S 0 ? 3 : S 1 @ 4 ; S 2     5 ^ T 3 B 6 h T 4 C 7 x T 5 D 8  T 6 E 9 nc" T  F : 0; T 7 G ; 3; T 3 H < S T 8 I = ;; T 9 J > E T 6 K ? F T 7 L @ G T  M A 9 T : N B = T ; O C Q; T < P D B T < Q E C T  R F H T = S G @ T > T H K T  U I : T ? V J I T A W K ; T @     L ^ U A Y M h U B Z N x U C [ O  U D \ P < U  ] Q A U F ^ R S U H _ S ;; U I ` T 9 U M a U = U N b V Q; U O c W ? U  d X H U R e Y j; U S f Z : U U g [  U  h \ ; U W     ] ^ V X j ^ h V Y k _ x V Z l `  V [ m a < V \ n b T V /E o c S V ^ p d ;; V _ q e E V J r f F V K s g G V L t h I; V ` u i = V a v j Q; V b w k B V P x l C V Q y m ? V c z n H V d { o @ V e | p K V T } q : V f ~ r I V V  s ; V h     t ^ W i  u h W j  v x W k  w  W l  x nc" W E  y 3; W G  z S W o  { ;; W p  | E W q  } F W r  ~ G W s   I; W t   L; W u   qc" W &   Q; W v   B W w   C W x   H W z   @ W {   K W |   : W }   I W ~   ; W       ^ X    h X    x X     X    U X 21   3; X    S X    ;; X    E X    F X    G X    I; X    L; X    2d" X ^   Q; X    B X    C X    H X    @ X    K X    : X    I X    ; X       ^ Y    h Y    x Y    N Y     Y    0; Y ]   8; Y    ;; Y    9 Y    = Y    Q; Y    C Y    H Y    j; Y    K Y    : Y       #; Z    ^ Z    h Z    x Z    $; Z     Z    mc" Z    /; Z m   pc" Z    S Z    ;; Z    G Z    9 Z    = Z    > Z    C Z    `; Z y   H Z    @ Z    : Z       ^ [    h [    x [     [    < [    S [    ;; [    9 [    = [    Q; [    ? [    H [    @ [    : [    ; [       ^ \     \    x \     \    0; \    S \    ;; \    9 \    = \    Q; \    H \    j; \    : \    ; \       ^ ]    \ ]    x ]     ]    < ]    A ]    W ] 7   8; ]    ;; ]    E ]    F ]    G ]    9 ]    = ]    Q; ]    B ]    C ]     ? ]    H ]    @ ]    : ]    I ]       ^ ^    h ^    x ^     ^  	  0; ^  
  S ^    ;; ^     9 ^  
  = ^    Q; ^    H ^    j; ^    : ^     ^ g   ; ^       ^ _   	  _   
 x _     _    0; _ 	  
 8; _ 
   ;; _    I; _    = _ 
   Q; _    H _    X _ I7    j; _  !  : _  "  ; _       ^ `  $   `  %  x `  &   `  '  < `  (  S `  )  ;; `  *  9 `  +  = `  ,   Q; `  - ! ? `   . " H `  / # @ `   0 $ : ` ! 1 % ; ` "     & ^ a # 3 '  a $ 4 ( x a % 5 )  a & 6 * ;; a ) 7 + I; a * 8 , = a + 9 - Q; a , : . f; a . ; / @ a / < 0 o; a 0 = 1 ; a 1     2 ^ b 2 ? 3  b 3 @ 4 x b 4 A 5  b 5 B 6 ;; b 6 C 7 9 b 7 D 8 = b 8 E 9 > b 9 F : @ b ; G ; : b < H < ; b =     = ^ c > J >  c ? K ? x c @ L @  c A M A < c ' N B Y c n O C D c ( P D :; c . Q E ;; c B R F 9 c C S G = c D T H > c E U I C c  V J ? c - W K H c : X L @ c F Y M K c  Z N : c G [ O ; c H     P ^ d I ] Q  d J ^ R x d K _ S  d L ` T Z d  a U 3; d  b V D d O c W :; d P d X ;; d Q e Y E d  f Z F d  g [ G d  h \ I; d R i ] = d S j ^ 2d" d % k _ Q; d T l ` B d  m a C d U n b H d W o c j; d X p d : d Z q e I d  r f ; d [     g ^ e \ t h  e ] u i x e ^ v j  e _ w k nc" e  x l 3; e a y m D e b z n :; e c { o ;; e d | p E e e } q F e f ~ r G e g  s 9 e h  t = e i  u > e k  v B e l  w C e m  x H e n  y @ e o  z : e p  { I e q  | ; e r     } ^ f s  ~  f t   x f u    f v   < f M   :; f z   ;; f {   9 f    ? f V   : f    ; f       ^ g     g    x g     g    < g    :; g    ;; g    9 g    ? g    : g    ; g       ^ h     h    x h     h    < h    :; h    ;; h    9 h    ? h    : h    ; h       ^ i    \ i    x i     i    0; i    :; i    ;; i    I; i    j; i    : i    ; i       ^ j     j    x j     j    ;; j    9 j    o; j    ; j       ^ k    \ k    x k     k    I; k    o; k    ; k       ^ l     l    x l     l    ;; l    G l ~   9 l    = l    > l    C l    H l    j; l    : l    ; l       ^ m     m    x m     m    ;; m    I; m    L; m    > m    B m    ]; m    @ m    o; m    ; m       ^ n    h n    x n     n    < n    A n    T n N   [ n .   D n y   ;; n    \ n |   ?; n }   G n    I; n    L; n    ] n .   Q; n    B n    ^ n 8   C n    ? n    H n    @ n    _ n Y   : n    I n    ; n       ^ o    \ o    x o     o    ` o    D o     ;; o    E o    ?; o    G o    I; o    L; o    Q; o    B o    C o  	  ? o  
  H o    @ o     : o  
  I o    ; o       ^ p     p    x p     p    U p `   /; p   	 0; p   
 3; p x   a p A8   D p   
 ;; p     =; p    ?; p    G p    9 p    L; p    2d" p j    Q; p  !  B p  "  b p . #  C p  $  `; p 	 %  H p 
 &  @ p  '  K p  (  : p  )  I p 
 *  ; p       ^ q  ,    q  - ! x q  . "  q  / # nc" q w 0 $ /; q  1 % 0; q  2 & 3; q  3 ' c q ]8 4 ( D q  5 ) ;; q  6 * =; q  7 + ?; q  8 , G q  9 - I; q  : . = q  ; / qc" q  < 0 > q   = 1 B q ! > 2 d q h8 ? 3 C q # @ 4 `; q $ A 5 H q % B 6 @ q & C 7 K q ' D 8 : q ( E 9 I q ) F : ; q *     ; ^ r + H < h r , I = x r - J >  r . K ? 0; r 1 L @ D r 4 M A ;; r 5 N B E r 6 O C ?; r 7 P D G r 8 Q E 9 r 9 R F = r : S G > r < T H B r = U I C r ? V J H r A W K j; r B X L : r D Y M I r E Z N ; r F     O ^ s G \ P  s H ] Q x s I ^ R  s J _ S < s 0 ` T 0; s K a U W s  b V Q s  c W e s 8 d X D s L e Y ;; s M f Z \ s package Unicode::Collate;

use 5.006;
use strict;
use warnings;
use Carp;
use File::Spec;

no warnings 'utf8';

our $VERSION = '1.31';
our $PACKAGE = __PACKAGE__;

### begin XS only ###
use XSLoader ();
XSLoader::load('Unicode::Collate', $VERSION);
### end XS only ###

my @Path = qw(Unicode Collate);
my $KeyFile = 'allkeys.txt';

# Perl's boolean
use constant TRUE  => 1;
use constant FALSE => "";
use constant NOMATCHPOS => -1;

# A coderef to get combining class imported from Unicode::Normalize
# (i.e. \&Unicode::Normalize::getCombinClass).
# This is also used as a HAS_UNICODE_NORMALIZE flag.
my $CVgetCombinClass;

# Supported Levels
use constant MinLevel => 1;
use constant MaxLevel => 4;

# Minimum weights at level 2 and 3, respectively
use constant Min2Wt => 0x20;
use constant Min3Wt => 0x02;

# Shifted weight at 4th level
use constant Shift4Wt => 0xFFFF;

# A boolean for Variable and 16-bit weights at 4 levels of Collation Element
use constant VCE_TEMPLATE => 'Cn4';

# A sort key: 16-bit weights
use constant KEY_TEMPLATE => 'n*';

# The tie-breaking: 32-bit weights
use constant TIE_TEMPLATE => 'N*';

# Level separator in a sort key:
# i.e. pack(KEY_TEMPLATE, 0)
use constant LEVEL_SEP => "\0\0";

# As Unicode code point separator for hash keys.
# A joined code point string (denoted by JCPS below)
# like "65;768" is used for internal processing
# instead of Perl's Unicode string like "\x41\x{300}",
# as the native code point is different from the Unicode code point
# on EBCDIC platform.
# This character must not be included in any stringified
# representation of an integer.
use constant CODE_SEP => ';';
	# NOTE: in regex /;/ is used for $jcps!

# boolean values of variable weights
use constant NON_VAR => 0; # Non-Variable character
use constant VAR     => 1; # Variable character

# specific code points
use constant Hangul_SIni   => 0xAC00;
use constant Hangul_SFin   => 0xD7A3;

# Logical_Order_Exception in PropList.txt
my $DefaultRearrange = [ 0x0E40..0x0E44, 0x0EC0..0x0EC4 ];

# for highestFFFF and minimalFFFE
my $HighestVCE = pack(VCE_TEMPLATE, 0, 0xFFFE, 0x20, 0x5, 0xFFFF);
my $minimalVCE = pack(VCE_TEMPLATE, 0,      1, 0x20, 0x5, 0xFFFE);

sub UCA_Version { '43' }

sub Base_Unicode_Version { '13.0.0' }

######

my $native_to_unicode = ($::IS_ASCII || $] < 5.008)
	? sub { return shift }
	: sub { utf8::native_to_unicode(shift) };

my $unicode_to_native = ($::IS_ASCII || $] < 5.008)
	? sub { return shift }
	: sub { utf8::unicode_to_native(shift) };

# pack_U() should get Unicode code points.
sub pack_U {
    return pack('U*', map $unicode_to_native->($_), @_);
}

# unpack_U() should return Unicode code points.
sub unpack_U {
    return map $native_to_unicode->($_), unpack('U*', shift(@_).pack('U*'));
}
# for older perl version, pack('U*') generates empty string with utf8 flag.

######

my (%VariableOK);
@VariableOK{ qw/
    blanked  non-ignorable  shifted  shift-trimmed
  / } = (); # keys lowercased

our @ChangeOK = qw/
    alternate backwards level normalization rearrange
    katakana_before_hiragana upper_before_lower ignore_level2
    overrideCJK overrideHangul overrideOut preprocess UCA_Version
    hangul_terminator variable identical highestFFFF minimalFFFE
    long_contraction
  /;

our @ChangeNG = qw/
    entry mapping table maxlength contraction
    ignoreChar ignoreName undefChar undefName rewrite
    versionTable alternateTable backwardsTable forwardsTable
    rearrangeTable variableTable
    derivCode normCode rearrangeHash backwardsFlag
    suppress suppressHash
    __useXS /; ### XS only
# The hash key 'ignored' was deleted at v 0.21.
# The hash key 'isShift' was deleted at v 0.23.
# The hash key 'combining' was deleted at v 0.24.
# The hash key 'entries' was deleted at v 0.30.
# The hash key 'L3_ignorable' was deleted at v 0.40.

sub version {
    my $self = shift;
    return $self->{versionTable} || 'unknown';
}

my (%ChangeOK, %ChangeNG);
@ChangeOK{ @ChangeOK } = ();
@ChangeNG{ @ChangeNG } = ();

sub change {
    my $self = shift;
    my %hash = @_;
    my %old;
    if (exists $hash{alternate}) {
	if (exists $hash{variable}) {
	    delete $hash{alternate};
	} else {
	    $hash{variable} = $hash{alternate};
	}
    }
    foreach my $k (keys %hash) {
	if (exists $ChangeOK{$k}) {
	    $old{$k} = $self->{$k};
	    $self->{$k} = $hash{$k};
	} elsif (exists $ChangeNG{$k}) {
	    croak "change of $k via change() is not allowed!";
	}
	# else => ignored
    }
    $self->checkCollator();
    return wantarray ? %old : $self;
}

sub _checkLevel {
    my $level = shift;
    my $key   = shift; # 'level' or 'backwards'
    MinLevel <= $level or croak sprintf
	"Illegal level %d (in value for key '%s') lower than %d.",
	    $level, $key, MinLevel;
    $level <= MaxLevel or croak sprintf
	"Unsupported level %d (in value for key '%s') higher than %d.",
	    $level, $key, MaxLevel;
}

my %DerivCode = (
    8 => \&_derivCE_8,
    9 => \&_derivCE_9,
   11 => \&_derivCE_9, # 11 == 9
   14 => \&_derivCE_14,
   16 => \&_derivCE_14, # 16 == 14
   18 => \&_derivCE_18,
   20 => \&_derivCE_20,
   22 => \&_derivCE_22,
   24 => \&_derivCE_24,
   26 => \&_derivCE_24, # 26 == 24
   28 => \&_derivCE_24, # 28 == 24
   30 => \&_derivCE_24, # 30 == 24
   32 => \&_derivCE_32,
   34 => \&_derivCE_34,
   36 => \&_derivCE_36,
   38 => \&_derivCE_38,
   40 => \&_derivCE_40,
   41 => \&_derivCE_40, # 41 == 40
   43 => \&_derivCE_43,
);

sub checkCollator {
    my $self = shift;
    _checkLevel($self->{level}, 'level');

    $self->{derivCode} = $DerivCode{ $self->{UCA_Version} }
	or croak "Illegal UCA version (passed $self->{UCA_Version}).";

    $self->{variable} ||= $self->{alternate} || $self->{variableTable} ||
				$self->{alternateTable} || 'shifted';
    $self->{variable} = $self->{alternate} = lc($self->{variable});
    exists $VariableOK{ $self->{variable} }
	or croak "$PACKAGE unknown variable parameter name: $self->{variable}";

    if (! defined $self->{backwards}) {
	$self->{backwardsFlag} = 0;
    } elsif (! ref $self->{backwards}) {
	_checkLevel($self->{backwards}, 'backwards');
	$self->{backwardsFlag} = 1 << $self->{backwards};
    } else {
	my %level;
	$self->{backwardsFlag} = 0;
	for my $b (@{ $self->{backwards} }) {
	    _checkLevel($b, 'backwards');
	    $level{$b} = 1;
	}
	for my $v (sort keys %level) {
	    $self->{backwardsFlag} += 1 << $v;
	}
    }

    defined $self->{rearrange} or $self->{rearrange} = [];
    ref $self->{rearrange}
	or croak "$PACKAGE: list for rearrangement must be store in ARRAYREF";

    # keys of $self->{rearrangeHash} are $self->{rearrange}.
    $self->{rearrangeHash} = undef;

    if (@{ $self->{rearrange} }) {
	@{ $self->{rearrangeHash} }{ @{ $self->{rearrange} } } = ();
    }

    $self->{normCode} = undef;

    if (defined $self->{normalization}) {
	eval { require Unicode::Normalize };
	$@ and croak "Unicode::Normalize is required to normalize strings";

	$CVgetCombinClass ||= \&Unicode::Normalize::getCombinClass;

	if ($self->{normalization} =~ /^(?:NF)D\z/) { # tweak for default
	    $self->{normCode} = \&Unicode::Normalize::NFD;
	}
	elsif ($self->{normalization} ne 'prenormalized') {
	    my $norm = $self->{normalization};
	    $self->{normCode} = sub {
		Unicode::Normalize::normalize($norm, shift);
	    };
	    eval { $self->{normCode}->("") }; # try
	    $@ and croak "$PACKAGE unknown normalization form name: $norm";
	}
    }
    return;
}

sub new
{
    my $class = shift;
    my $self = bless { @_ }, $class;

### begin XS only ###
    if (! exists $self->{table}     && !defined $self->{rewrite} &&
	!defined $self->{undefName} && !defined $self->{ignoreName} &&
	!defined $self->{undefChar} && !defined $self->{ignoreChar}) {
	$self->{__useXS} = \&_fetch_simple;
    } else {
	$self->{__useXS} = undef;
    }
### end XS only ###

    # keys of $self->{suppressHash} are $self->{suppress}.
    if ($self->{suppress} && @{ $self->{suppress} }) {
	@{ $self->{suppressHash} }{ @{ $self->{suppress} } } = ();
    } # before read_table()

    # If undef is passed explicitly, no file is read.
    $self->{table} = $KeyFile if ! exists $self->{table};
    $self->read_table() if defined $self->{table};

    if ($self->{entry}) {
	while ($self->{entry} =~ /([^\n]+)/g) {
	    $self->parseEntry($1, TRUE);
	}
    }

    # only in new(), not in change()
    $self->{level} ||= MaxLevel;
    $self->{UCA_Version} ||= UCA_Version();

    $self->{overrideHangul} = FALSE
	if ! exists $self->{overrideHangul};
    $self->{overrideCJK} = FALSE
	if ! exists $self->{overrideCJK};
    $self->{normalization} = 'NFD'
	if ! exists $self->{normalization};
    $self->{rearrange} = $self->{rearrangeTable} ||
	($self->{UCA_Version} <= 11 ? $DefaultRearrange : [])
	if ! exists $self->{rearrange};
    $self->{backwards} = $self->{backwardsTable}
	if ! exists $self->{backwards};
    exists $self->{long_contraction} or $self->{long_contraction}
	= 22 <= $self->{UCA_Version} && $self->{UCA_Version} <= 24;

    # checkCollator() will be called in change()
    $self->checkCollator();

    return $self;
}

sub parseAtmark {
    my $self = shift;
    my $line = shift; # after s/^\s*\@//

    if ($line =~ /^version\s*(\S*)/) {
	$self->{versionTable} ||= $1;
    }
    elsif ($line =~ /^variable\s+(\S*)/) { # since UTS #10-9
	$self->{variableTable} ||= $1;
    }
    elsif ($line =~ /^alternate\s+(\S*)/) { # till UTS #10-8
	$self->{alternateTable} ||= $1;
    }
    elsif ($line =~ /^backwards\s+(\S*)/) {
	push @{ $self->{backwardsTable} }, $1;
    }
    elsif ($line =~ /^forwards\s+(\S*)/) { # perhaps no use
	push @{ $self->{forwardsTable} }, $1;
    }
    elsif ($line =~ /^rearrange\s+(.*)/) { # (\S*) is NG
	push @{ $self->{rearrangeTable} }, _getHexArray($1);
    }
}

sub read_table {
    my $self = shift;

### begin XS only ###
    if ($self->{__useXS}) {
	my @rest = _fetch_rest(); # complex matter need to parse
	for my $line (@rest) {
	    next if $line =~ /^\s*#/;

	    if ($line =~ s/^\s*\@//) {
		$self->parseAtmark($line);
	    } else {
		$self->parseEntry($line);
	    }
	}
	return;
    }
### end XS only ###

    my($f, $fh);
    foreach my $d (@INC) {
	$f = File::Spec->catfile($d, @Path, $self->{table});
	last if open($fh, $f);
	$f = undef;
    }
    if (!defined $f) {
	$f = File::Spec->catfile(@Path, $self->{table});
	croak("$PACKAGE: Can't locate $f in \@INC (\@INC contains: @INC)");
    }

    while (my $line = <$fh>) {
	next if $line =~ /^\s*#/;

	if ($line =~ s/^\s*\@//) {
	    $self->parseAtmark($line);
	} else {
	    $self->parseEntry($line);
	}
    }
    close $fh;
}


##
## get $line, parse it, and write an entry in $self
##
sub parseEntry
{
    my $self = shift;
    my $line = shift;
    my $tailoring = shift;
    my($name, $entry, @uv, @key);

    if (defined $self->{rewrite}) {
	$line = $self->{rewrite}->($line);
    }

    return if $line !~ /^\s*[0-9A-Fa-f]/;

    # removes comment and gets name
    $name = $1
	if $line =~ s/[#%]\s*(.*)//;
    return if defined $self->{undefName} && $name =~ /$self->{undefName}/;

    # gets element
    my($e, $k) = split /;/, $line;
    croak "Wrong Entry: <charList> must be separated by ';' from <collElement>"
	if ! $k;

    @uv = _getHexArray($e);
    return if !@uv;
    return if @uv > 1 && $self->{suppressHash} && !$tailoring &&
		  exists $self->{suppressHash}{$uv[0]};
    $entry = join(CODE_SEP, @uv); # in JCPS

    if (defined $self->{undefChar} || defined $self->{ignoreChar}) {
	my $ele = pack_U(@uv);

	# regarded as if it were not stored in the table
	return
	    if defined $self->{undefChar} && $ele =~ /$self->{undefChar}/;

	# replaced as completely ignorable
	$k = '[.0000.0000.0000.0000]'
	    if defined $self->{ignoreChar} && $ele =~ /$self->{ignoreChar}/;
    }

    # replaced as completely ignorable
    $k = '[.0000.0000.0000.0000]'
	if defined $self->{ignoreName} && $name =~ /$self->{ignoreName}/;

    my $is_L3_ignorable = TRUE;

    foreach my $arr ($k =~ /\[([^\[\]]+)\]/g) { # SPACEs allowed
	my $var = $arr =~ /\*/; # exactly /^\*/ but be lenient.
	my @wt = _getHexArray($arr);
	push @key, pack(VCE_TEMPLATE, $var, @wt);
	$is_L3_ignorable = FALSE
	    if $wt[0] || $wt[1] || $wt[2];
	# Conformance Test for 3.1.1 and 4.0.0 shows Level 3 ignorable
	# is completely ignorable.
	# For expansion, an entry $is_L3_ignorable
	# if and only if "all" CEs are [.0000.0000.0000].
    }

    # mapping: be an array ref or not exists (any false value is disallowed)
    $self->{mapping}{$entry} = $is_L3_ignorable ? [] : \@key;

    # maxlength: be more than 1 or not exists (any false value is disallowed)
    if (@uv > 1) {
	if (!$self->{maxlength}{$uv[0]} || $self->{maxlength}{$uv[0]} < @uv) {
	    $self->{maxlength}{$uv[0]} = @uv;
	}
    }

    # contraction: be 1 or not exists (any false value is disallowed)
    while (@uv > 2) {
	pop @uv;
	my $fake_entry = join(CODE_SEP, @uv); # in JCPS
	$self->{contraction}{$fake_entry} = 1;
    }
}


sub viewSortKey
{
    my $self = shift;
    my $str  = shift;
    $self->visualizeSortKey($self->getSortKey($str));
}


sub process
{
    my $self = shift;
    my $str  = shift;
    my $prep = $self->{preprocess};
    my $norm = $self->{normCode};

    $str = &$prep($str) if ref $prep;
    $str = &$norm($str) if ref $norm;
    return $str;
}

##
## arrayref of JCPS   = splitEnt(string to be collated)
## arrayref of arrayref[JCPS, ini_pos, fin_pos] = splitEnt(string, TRUE)
##
sub splitEnt
{
    my $self = shift;
    my $str  = shift;
    my $wLen = shift; # with Length

    my $map  = $self->{mapping};
    my $max  = $self->{maxlength};
    my $reH  = $self->{rearrangeHash};
    my $vers = $self->{UCA_Version};
    my $ver9 = $vers >= 9 && $vers <= 11;
    my $long = $self->{long_contraction};
    my $uXS  = $self->{__useXS}; ### XS only

    my @buf;

    # get array of Unicode code point of string.
    my @src = unpack_U($str);

    # rearrangement:
    # Character positions are not kept if rearranged,
    # then neglected if $wLen is true.
    if ($reH && ! $wLen) {
	for (my $i = 0; $i < @src; $i++) {
	    if (exists $reH->{ $src[$i] } && $i + 1 < @src) {
		($src[$i], $src[$i+1]) = ($src[$i+1], $src[$i]);
		$i++;
	    }
	}
    }

    # remove a code point marked as a completely ignorable.
    for (my $i = 0; $i < @src; $i++) {
	if ($vers <= 20 && _isIllegal($src[$i])) {
	    $src[$i] = undef;
	} elsif ($ver9) {
	    $src[$i] = undef if exists $map->{ $src[$i] }
			   ? @{ $map->{ $src[$i] } } == 0
			   : $uXS && _ignorable_simple($src[$i]); ### XS only
	}
    }

    for (my $i = 0; $i < @src; $i++) {
	my $jcps = $src[$i];

	# skip removed code point
	if (! defined $jcps) {
	    if ($wLen && @buf) {
		$buf[-1][2] = $i + 1;
	    }
	    next;
	}

	my $i_orig = $i;

	# find contraction
	if (exists $max->{$jcps}) {
	    my $temp_jcps = $jcps;
	    my $jcpsLen = 1;
	    my $maxLen = $max->{$jcps};

	    for (my $p = $i + 1; $jcpsLen < $maxLen && $p < @src; $p++) {
		next if ! defined $src[$p];
		$temp_jcps .= CODE_SEP . $src[$p];
		$jcpsLen++;
		if (exists $map->{$temp_jcps}) {
		    $jcps = $temp_jcps;
		    $i = $p;
		}
	    }

	# discontiguous contraction with Combining Char (cf. UTS#10, S2.1).
	# This process requires Unicode::Normalize.
	# If "normalization" is undef, here should be skipped *always*
	# (in spite of bool value of $CVgetCombinClass),
	# since canonical ordering cannot be expected.
	# Blocked combining character should not be contracted.

	    # $self->{normCode} is false in the case of "prenormalized".
	    if ($self->{normalization}) {
		my $cont = $self->{contraction};
		my $preCC = 0;
		my $preCC_uc = 0;
		my $jcps_uc = $jcps;
		my(@out, @out_uc);

		for (my $p = $i + 1; $p < @src; $p++) {
		    next if ! defined $src[$p];
		    my $curCC = $CVgetCombinClass->($src[$p]);
		    last unless $curCC;
		    my $tail = CODE_SEP . $src[$p];

		    if ($preCC != $curCC && exists $map->{$jcps.$tail}) {
			$jcps .= $tail;
			push @out, $p;
		    } else {
			$preCC = $curCC;
		    }

		    next if !$long;

		    if ($preCC_uc != $curCC &&
			    (exists $map->{$jcps_uc.$tail} ||
			    exists $cont->{$jcps_uc.$tail})) {
			$jcps_uc .= $tail;
			push @out_uc, $p;
		    } else {
			$preCC_uc = $curCC;
		    }
		}

		if (@out_uc && exists $map->{$jcps_uc}) {
		    $jcps = $jcps_uc;
		    $src[$_] = undef for @out_uc;
		} else {
		    $src[$_] = undef for @out;
		}
	    }
	}

	# skip completely ignorable
	if (exists $map->{$jcps} ? @{ $map->{$jcps} } == 0 :
	    $uXS && $jcps !~ /;/ && _ignorable_simple($jcps)) { ### XS only
	    if ($wLen && @buf) {
		$buf[-1][2] = $i + 1;
	    }
	    next;
	}

	push @buf, $wLen ? [$jcps, $i_orig, $i + 1] : $jcps;
    }
    return \@buf;
}

##
## VCE = _pack_override(input, codepoint, derivCode)
##
sub _pack_override ($$$) {
    my $r = shift;
    my $u = shift;
    my $der = shift;

    if (ref $r) {
	return pack(VCE_TEMPLATE, NON_VAR, @$r);
    } elsif (defined $r) {
	return pack(VCE_TEMPLATE, NON_VAR, $r, Min2Wt, Min3Wt, $u);
    } else {
	$u = 0xFFFD if 0x10FFFF < $u;
	return $der->($u);
    }
}

##
## list of VCE = getWt(JCPS)
##
sub getWt
{
    my $self = shift;
    my $u    = shift;
    my $map  = $self->{mapping};
    my $der  = $self->{derivCode};
    my $out  = $self->{overrideOut};
    my $uXS  = $self->{__useXS}; ### XS only

    return if !defined $u;
    return $self->varCE($HighestVCE) if $u eq 0xFFFF && $self->{highestFFFF};
    return $self->varCE($minimalVCE) if $u eq 0xFFFE && $self->{minimalFFFE};
    $u = 0xFFFD if $u !~ /;/ && 0x10FFFF < $u && !$out;

    my @ce;
    if (exists $map->{$u}) {
	@ce = @{ $map->{$u} }; # $u may be a contraction
### begin XS only ###
    } elsif ($uXS && _exists_simple($u)) {
	@ce = _fetch_simple($u);
### end XS only ###
    } elsif (Hangul_SIni <= $u && $u <= Hangul_SFin) {
	my $hang = $self->{overrideHangul};
	if ($hang) {
	    @ce = map _pack_override($_, $u, $der), $hang->($u);
	} elsif (!defined $hang) {
	    @ce = $der->($u);
	} else {
	    my $max  = $self->{maxlength};
	    my @decH = _decompHangul($u);

	    if (@decH == 2) {
		my $contract = join(CODE_SEP, @decH);
		@decH = ($contract) if exists $map->{$contract};
	    } else { # must be <@decH == 3>
		if (exists $max->{$decH[0]}) {
		    my $contract = join(CODE_SEP, @decH);
		    if (exists $map->{$contract}) {
			@decH = ($contract);
		    } else {
			$contract = join(CODE_SEP, @decH[0,1]);
			exists $map->{$contract} and @decH = ($contract, $decH[2]);
		    }
		    # even if V's ignorable, LT contraction is not supported.
		    # If such a situation were required, NFD should be used.
		}
		if (@decH == 3 && exists $max->{$decH[1]}) {
		    my $contract = join(CODE_SEP, @decH[1,2]);
		    exists $map->{$contract} and @decH = ($decH[0], $contract);
		}
	    }

	    @ce = map({
		    exists $map->{$_} ? @{ $map->{$_} } :
		$uXS && _exists_simple($_) ? _fetch_simple($_) : ### XS only
		    $der->($_);
		} @decH);
	}
    } elsif ($out && 0x10FFFF < $u) {
	@ce = map _pack_override($_, $u, $der), $out->($u);
    } else {
	my $cjk  = $self->{overrideCJK};
	my $vers = $self->{UCA_Version};
	if ($cjk && _isUIdeo($u, $vers)) {
	    @ce = map _pack_override($_, $u, $der), $cjk->($u);
	} elsif ($vers == 8 && defined $cjk && _isUIdeo($u, 0)) {
	    @ce = _uideoCE_8($u);
	} else {
	    @ce = $der->($u);
	}
    }
    return map $self->varCE($_), @ce;
}


##
## string sortkey = getSortKey(string arg)
##
sub getSortKey
{
    my $self = shift;
    my $orig = shift;
    my $str  = $self->process($orig);
    my $rEnt = $self->splitEnt($str); # get an arrayref of JCPS
    my $vers = $self->{UCA_Version};
    my $term = $self->{hangul_terminator};
    my $lev  = $self->{level};
    my $iden = $self->{identical};

    my @buf; # weight arrays
    if ($term) {
	my $preHST = '';
	my $termCE = $self->varCE(pack(VCE_TEMPLATE, NON_VAR, $term, 0,0,0));
	foreach my $jcps (@$rEnt) {
	    # weird things like VL, TL-contraction are not considered!
	    my $curHST = join '', map getHST($_, $vers), split /;/, $jcps;
	    if ($preHST && !$curHST || # hangul before non-hangul
		$preHST =~ /L\z/ && $curHST =~ /^T/ ||
		$preHST =~ /V\z/ && $curHST =~ /^L/ ||
		$preHST =~ /T\z/ && $curHST =~ /^[LV]/) {
		push @buf, $termCE;
	    }
	    $preHST = $curHST;
	    push @buf, $self->getWt($jcps);
	}
	push @buf, $termCE if $preHST; # end at hangul
    } else {
	foreach my $jcps (@$rEnt) {
	    push @buf, $self->getWt($jcps);
	}
    }

    my $rkey = $self->mk_SortKey(\@buf); ### XS only

    if ($iden || $vers >= 26 && $lev == MaxLevel) {
	$rkey .= LEVEL_SEP;
	$rkey .= pack(TIE_TEMPLATE, unpack_U($str)) if $iden;
    }
    return $rkey;
}


##
## int compare = cmp(string a, string b)
##
sub cmp { $_[0]->getSortKey($_[1]) cmp $_[0]->getSortKey($_[2]) }
sub eq  { $_[0]->getSortKey($_[1]) eq  $_[0]->getSortKey($_[2]) }
sub ne  { $_[0]->getSortKey($_[1]) ne  $_[0]->getSortKey($_[2]) }
sub lt  { $_[0]->getSortKey($_[1]) lt  $_[0]->getSortKey($_[2]) }
sub le  { $_[0]->getSortKey($_[1]) le  $_[0]->getSortKey($_[2]) }
sub gt  { $_[0]->getSortKey($_[1]) gt  $_[0]->getSortKey($_[2]) }
sub ge  { $_[0]->getSortKey($_[1]) ge  $_[0]->getSortKey($_[2]) }

##
## list[strings] sorted = sort(list[strings] arg)
##
sub sort {
    my $obj = shift;
    return
	map { $_->[1] }
	    sort{ $a->[0] cmp $b->[0] }
		map [ $obj->getSortKey($_), $_ ], @_;
}


##
## bool _nonIgnorAtLevel(arrayref weights, int level)
##
sub _nonIgnorAtLevel($$)
{
    my $wt = shift;
    return if ! defined $wt;
    my $lv = shift;
    return grep($wt->[$_-1] != 0, MinLevel..$lv) ? TRUE : FALSE;
}

##
## bool _eqArray(
##    arrayref of arrayref[weights] source,
##    arrayref of arrayref[weights] substr,
##    int level)
## * comparison of graphemes vs graphemes.
##   @$source >= @$substr must be true (check it before call this);
##
sub _eqArray($$$)
{
    my $source = shift;
    my $substr = shift;
    my $lev = shift;

    for my $g (0..@$substr-1){
	# Do the $g'th graphemes have the same number of AV weights?
	return if @{ $source->[$g] } != @{ $substr->[$g] };

	for my $w (0..@{ $substr->[$g] }-1) {
	    for my $v (0..$lev-1) {
		return if $source->[$g][$w][$v] != $substr->[$g][$w][$v];
	    }
	}
    }
    return 1;
}

##
## (int position, int length)
## int position = index(string, substring, position, [undoc'ed global])
##
## With "global" (only for the list context),
##  returns list of arrayref[position, length].
##
sub index
{
    my $self = shift;
    $self->{preprocess} and
	croak "Don't use Preprocess with index(), match(), etc.";
    $self->{normCode} and
	croak "Don't use Normalization with index(), match(), etc.";

    my $str  = shift;
    my $len  = length($str);
    my $sub  = shift;
    my $subE = $self->splitEnt($sub);
    my $pos  = @_ ? shift : 0;
       $pos  = 0 if $pos < 0;
    my $glob = shift;

    my $lev  = $self->{level};
    my $v2i  = $self->{UCA_Version} >= 9 &&
		$self->{variable} ne 'non-ignorable';

    if (! @$subE) {
	my $temp = $pos <= 0 ? 0 : $len <= $pos ? $len : $pos;
	return $glob
	    ? map([$_, 0], $temp..$len)
	    : wantarray ? ($temp,0) : $temp;
    }
    $len < $pos
	and return wantarray ? () : NOMATCHPOS;
    my $strE = $self->splitEnt($pos ? substr($str, $pos) : $str, TRUE);
    @$strE
	or return wantarray ? () : NOMATCHPOS;

    my(@strWt, @iniPos, @finPos, @subWt, @g_ret);

    my $last_is_variable;
    for my $vwt (map $self->getWt($_), @$subE) {
	my($var, @wt) = unpack(VCE_TEMPLATE, $vwt);
	my $to_be_pushed = _nonIgnorAtLevel(\@wt,$lev);

	# "Ignorable (L1, L2) after Variable" since track. v. 9
	if ($v2i) {
	    if ($var) {
		$last_is_variable = TRUE;
	    }
	    elsif (!$wt[0]) { # ignorable
		$to_be_pushed = FALSE if $last_is_variable;
	    }
	    else {
		$last_is_variable = FALSE;
	    }
	}

	if (@subWt && !$var && !$wt[0]) {
	    push @{ $subWt[-1] }, \@wt if $to_be_pushed;
	} elsif ($to_be_pushed) {
	    push @subWt, [ \@wt ];
	}
	# else ===> skipped
    }

    my $count = 0;
    my $end = @$strE - 1;

    $last_is_variable = FALSE; # reuse
    for (my $i = 0; $i <= $end; ) { # no $i++
	my $found_base = 0;

	# fetch a grapheme
	while ($i <= $end && $found_base == 0) {
	    for my $vwt ($self->getWt($strE->[$i][0])) {
		my($var, @wt) = unpack(VCE_TEMPLATE, $vwt);
		my $to_be_pushed = _nonIgnorAtLevel(\@wt,$lev);

		# "Ignorable (L1, L2) after Variable" since track. v. 9
		if ($v2i) {
		    if ($var) {
			$last_is_variable = TRUE;
		    }
		    elsif (!$wt[0]) { # ignorable
			$to_be_pushed = FALSE if $last_is_variable;
		    }
		    else {
			$last_is_variable = FALSE;
		    }
		}

		if (@strWt && !$var && !$wt[0]) {
		    push @{ $strWt[-1] }, \@wt if $to_be_pushed;
		    $finPos[-1] = $strE->[$i][2];
		} elsif ($to_be_pushed) {
		    push @strWt, [ \@wt ];
		    push @iniPos, $found_base ? NOMATCHPOS : $strE->[$i][1];
		    $finPos[-1] = NOMATCHPOS if $found_base;
		    push @finPos, $strE->[$i][2];
		    $found_base++;
		}
		# else ===> no-op
	    }
	    $i++;
	}

	# try to match
	while ( @strWt > @subWt || (@strWt == @subWt && $i > $end) ) {
	    if ($iniPos[0] != NOMATCHPOS &&
		    $finPos[$#subWt] != NOMATCHPOS &&
			_eqArray(\@strWt, \@subWt, $lev)) {
		my $temp = $iniPos[0] + $pos;

		if ($glob) {
		    push @g_ret, [$temp, $finPos[$#subWt] - $iniPos[0]];
		    splice @strWt,  0, $#subWt;
		    splice @iniPos, 0, $#subWt;
		    splice @finPos, 0, $#subWt;
		}
		else {
		    return wantarray
			? ($temp, $finPos[$#subWt] - $iniPos[0])
			:  $temp;
		}
	    }
	    shift @strWt;
	    shift @iniPos;
	    shift @finPos;
	}
    }

    return $glob
	? @g_ret
	: wantarray ? () : NOMATCHPOS;
}

##
## scalarref to matching part = match(string, substring)
##
sub match
{
    my $self = shift;
    if (my($pos,$len) = $self->index($_[0], $_[1])) {
	my $temp = substr($_[0], $pos, $len);
	return wantarray ? $temp : \$temp;
	# An lvalue ref \substr should be avoided,
	# since its value is affected by modification of its referent.
    }
    else {
	return;
    }
}

##
## arrayref matching parts = gmatch(string, substring)
##
sub gmatch
{
    my $self = shift;
    my $str  = shift;
    my $sub  = shift;
    return map substr($str, $_->[0], $_->[1]),
		$self->index($str, $sub, 0, 'g');
}

##
## bool subst'ed = subst(string, substring, replace)
##
sub subst
{
    my $self = shift;
    my $code = ref $_[2] eq 'CODE' ? $_[2] : FALSE;

    if (my($pos,$len) = $self->index($_[0], $_[1])) {
	if ($code) {
	    my $mat = substr($_[0], $pos, $len);
	    substr($_[0], $pos, $len, $code->($mat));
	} else {
	    substr($_[0], $pos, $len, $_[2]);
	}
	return TRUE;
    }
    else {
	return FALSE;
    }
}

##
## int count = gsubst(string, substring, replace)
##
sub gsubst
{
    my $self = shift;
    my $code = ref $_[2] eq 'CODE' ? $_[2] : FALSE;
    my $cnt = 0;

    # Replacement is carried out from the end, then use reverse.
    for my $pos_len (reverse $self->index($_[0], $_[1], 0, 'g')) {
	if ($code) {
	    my $mat = substr($_[0], $pos_len->[0], $pos_len->[1]);
	    substr($_[0], $pos_len->[0], $pos_len->[1], $code->($mat));
	} else {
	    substr($_[0], $pos_len->[0], $pos_len->[1], $_[2]);
	}
	$cnt++;
    }
    return $cnt;
}

1;
__END__

=head1 NAME

Unicode::Collate - Unicode Collation Algorithm

=head1 SYNOPSIS

  use Unicode::Collate;

  #construct
  $Collator = Unicode::Collate->new(%tailoring);

  #sort
  @sorted = $Collator->sort(@not_sorted);

  #compare
  $result = $Collator->cmp($a, $b); # returns 1, 0, or -1.

B<Note:> Strings in C<@not_sorted>, C<$a> and C<$b> are interpreted
according to Perl's Unicode support. See L<perlunicode>,
L<perluniintro>, L<perlunitut>, L<perlunifaq>, L<utf8>.
Otherwise you can use C<preprocess> or should decode them before.

=head1 DESCRIPTION

This module is an implementation of Unicode Technical Standard #10
(a.k.a. UTS #10) - Unicode Collation Algorithm (a.k.a. UCA).

=head2 Constructor and Tailoring

The C<new> method returns a collator object. If new() is called
with no parameters, the collator should do the default collation.

   $Collator = Unicode::Collate->new(
      UCA_Version => $UCA_Version,
      alternate => $alternate, # alias for 'variable'
      backwards => $levelNumber, # or \@levelNumbers
      entry => $element,
      hangul_terminator => $term_primary_weight,
      highestFFFF => $bool,
      identical => $bool,
      ignoreName => qr/$ignoreName/,
      ignoreChar => qr/$ignoreChar/,
      ignore_level2 => $bool,
      katakana_before_hiragana => $bool,
      level => $collationLevel,
      long_contraction => $bool,
      minimalFFFE => $bool,
      normalization  => $normalization_form,
      overrideCJK => \&overrideCJK,
      overrideHangul => \&overrideHangul,
      preprocess => \&preprocess,
      rearrange => \@charList,
      rewrite => \&rewrite,
      suppress => \@charList,
      table => $filename,
      undefName => qr/$undefName/,
      undefChar => qr/$undefChar/,
      upper_before_lower => $bool,
      variable => $variable,
   );

=over 4

=item UCA_Version

If the revision (previously "tracking version") number of UCA is given,
behavior of that revision is emulated on collating.
If omitted, the return value of C<UCA_Version()> is used.

The following revisions are supported.  The default is 43.

     UCA       Unicode Standard         DUCET (@version)
   -------------------------------------------------------
      8              3.1                3.0.1 (3.0.1d9)
      9     3.1 with Corrigendum 3      3.1.1
     11             4.0.0
     14             4.1.0
     16             5.0.0
     18             5.1.0
     20             5.2.0
     22             6.0.0
     24             6.1.0
     26             6.2.0
     28             6.3.0
     30             7.0.0
     32             8.0.0
     34             9.0.0
     36            10.0.0
     38            11.0.0
     40            12.0.0
     41            12.1.0
     43            13.0.0

* See below for C<long_contraction> with C<UCA_Version> 22 and 24.

* Noncharacters (e.g. U+FFFF) are not ignored, and can be overridden
since C<UCA_Version> 22.

* Out-of-range codepoints (greater than U+10FFFF) are not ignored,
and can be overridden since C<UCA_Version> 22.

* Fully ignorable characters were ignored, and would not interrupt
contractions with C<UCA_Version> 9 and 11.

* Treatment of ignorables after variables and some behaviors
were changed at C<UCA_Version> 9.

* Characters regarded as CJK unified ideographs (cf. C<overrideCJK>)
depend on C<UCA_Version>.

* Many hangul jamo are assigned at C<UCA_Version> 20, that will affect
C<hangul_terminator>.

=item alternate

-- see 3.2.2 Alternate Weighting, version 8 of UTS #10

For backward compatibility, C<alternate> (old name) can be used
as an alias for C<variable>.

=item backwards

-- see 3.4 Backward Accents, UTS #10.

     backwards => $levelNumber or \@levelNumbers

Weights in reverse order; ex. level 2 (diacritic ordering) in French.
If omitted (or C<$levelNumber> is C<undef> or C<\@levelNumbers> is C<[]>),
forwards at all the levels.

=item entry

-- see 5 Tailoring; 9.1 Allkeys File Format, UTS #10.

If the same character (or a sequence of characters) exists
in the collation element table through C<table>,
mapping to collation elements is overridden.
If it does not exist, the mapping is defined additionally.

    entry => <<'ENTRY', # for DUCET v4.0.0 (allkeys-4.0.0.txt)
0063 0068 ; [.0E6A.0020.0002.0063] # ch
0043 0068 ; [.0E6A.0020.0007.0043] # Ch
0043 0048 ; [.0E6A.0020.0008.0043] # CH
006C 006C ; [.0F4C.0020.0002.006C] # ll
004C 006C ; [.0F4C.0020.0007.004C] # Ll
004C 004C ; [.0F4C.0020.0008.004C] # LL
00F1      ; [.0F7B.0020.0002.00F1] # n-tilde
006E 0303 ; [.0F7B.0020.0002.00F1] # n-tilde
00D1      ; [.0F7B.0020.0008.00D1] # N-tilde
004E 0303 ; [.0F7B.0020.0008.00D1] # N-tilde
ENTRY

    entry => <<'ENTRY', # for DUCET v4.0.0 (allkeys-4.0.0.txt)
00E6 ; [.0E33.0020.0002.00E6][.0E8B.0020.0002.00E6] # ae ligature as <a><e>
00C6 ; [.0E33.0020.0008.00C6][.0E8B.0020.0008.00C6] # AE ligature as <A><E>
ENTRY

B<NOTE:> The code point in the UCA file format (before C<';'>)
B<must> be a Unicode code point (defined as hexadecimal),
but not a native code point.
So C<0063> must always denote C<U+0063>,
but not a character of C<"\x63">.

Weighting may vary depending on collation element table.
So ensure the weights defined in C<entry> will be consistent with
those in the collation element table loaded via C<table>.

In DUCET v4.0.0, primary weight of C<C> is C<0E60>
and that of C<D> is C<0E6D>. So setting primary weight of C<CH> to C<0E6A>
(as a value between C<0E60> and C<0E6D>)
makes ordering as C<C E<lt> CH E<lt> D>.
Exactly speaking DUCET already has some characters between C<C> and C<D>:
C<small capital C> (C<U+1D04>) with primary weight C<0E64>,
C<c-hook/C-hook> (C<U+0188/U+0187>) with C<0E65>,
and C<c-curl> (C<U+0255>) with C<0E69>.
Then primary weight C<0E6A> for C<CH> makes C<CH>
ordered between C<c-curl> and C<D>.

=item hangul_terminator

-- see 7.1.4 Trailing Weights, UTS #10.

If a true value is given (non-zero but should be positive),
it will be added as a terminator primary weight to the end of
every standard Hangul syllable. Secondary and any higher weights
for terminator are set to zero.
If the value is false or C<hangul_terminator> key does not exist,
insertion of terminator weights will not be performed.

Boundaries of Hangul syllables are determined
according to conjoining Jamo behavior in F<the Unicode Standard>
and F<HangulSyllableType.txt>.

B<Implementation Note:>
(1) For expansion mapping (Unicode character mapped
to a sequence of collation elements), a terminator will not be added
between collation elements, even if Hangul syllable boundary exists there.
Addition of terminator is restricted to the next position
to the last collation element.

(2) Non-conjoining Hangul letters
(Compatibility Jamo, halfwidth Jamo, and enclosed letters) are not
automatically terminated with a terminator primary weight.
These characters may need terminator included in a collation element
table beforehand.

=item highestFFFF

-- see 2.4 Tailored noncharacter weights, UTS #35 (LDML) Part 5: Collation.

If the parameter is made true, C<U+FFFF> has a highest primary weight.
When a boolean of C<$coll-E<gt>ge($str, "abc")> and
C<$coll-E<gt>le($str, "abc\x{FFFF}")> is true, it is expected that C<$str>
begins with C<"abc">, or another primary equivalent.
C<$str> may be C<"abcd">, C<"abc012">, but should not include C<U+FFFF>
such as C<"abc\x{FFFF}xyz">.

C<$coll-E<gt>le($str, "abc\x{FFFF}")> works like C<$coll-E<gt>lt($str, "abd")>
almost, but the latter has a problem that you should know which letter is
next to C<c>. For a certain language where C<ch> as the next letter,
C<"abch"> is greater than C<"abc\x{FFFF}">, but less than C<"abd">.

Note:
This is equivalent to C<(entry =E<gt> 'FFFF ; [.FFFE.0020.0005.FFFF]')>.
Any other character than C<U+FFFF> can be tailored by C<entry>.

=item identical

-- see A.3 Deterministic Comparison, UTS #10.

By default, strings whose weights are equal should be equal,
even though their code points are not equal.
Completely ignorable characters are ignored.

If the parameter is made true, a final, tie-breaking level is used.
If no difference of weights is found after the comparison through
all the level specified by C<level>, the comparison with code points
will be performed.
For the tie-breaking comparison, the sort key has code points
of the original string appended.
Completely ignorable characters are not ignored.

If C<preprocess> and/or C<normalization> is applied, the code points
of the string after them (in NFD by default) are used.

=item ignoreChar

=item ignoreName

-- see 3.6 Variable Weighting, UTS #10.

Makes the entry in the table completely ignorable;
i.e. as if the weights were zero at all level.

Through C<ignoreChar>, any character matching C<qr/$ignoreChar/>
will be ignored. Through C<ignoreName>, any character whose name
(given in the C<table> file as a comment) matches C<qr/$ignoreName/>
will be ignored.

E.g. when 'a' and 'e' are ignorable,
'element' is equal to 'lament' (or 'lmnt').

=item ignore_level2

-- see 5.1 Parametric Tailoring, UTS #10.

By default, case-sensitive comparison (that is level 3 difference)
won't ignore accents (that is level 2 difference).

If the parameter is made true, accents (and other primary ignorable
characters) are ignored, even though cases are taken into account.

B<NOTE>: C<level> should be 3 or greater.

=item katakana_before_hiragana

-- see 7.2 Tertiary Weight Table, UTS #10.

By default, hiragana is before katakana.
If the parameter is made true, this is reversed.

B<NOTE>: This parameter simplemindedly assumes that any hiragana/katakana
distinctions must occur in level 3, and their weights at level 3 must be
same as those mentioned in 7.3.1, UTS #10.
If you define your collation elements which violate this requirement,
this parameter does not work validly.

=item level

-- see 4.3 Form Sort Key, UTS #10.

Set the maximum level.
Any higher levels than the specified one are ignored.

  Level 1: alphabetic ordering
  Level 2: diacritic ordering
  Level 3: case ordering
  Level 4: tie-breaking (e.g. in the case when variable is 'shifted')

  ex.level => 2,

If omitted, the maximum is the 4th.

B<NOTE:> The DUCET includes weights over 0xFFFF at the 4th level.
But this module only uses weights within 0xFFFF.
When C<variable> is 'blanked' or 'non-ignorable' (other than 'shifted'
and 'shift-trimmed'), the level 4 may be unreliable.

See also C<identical>.

=item long_contraction

-- see 3.8.2 Well-Formedness of the DUCET, 4.2 Produce Array, UTS #10.

If the parameter is made true, for a contraction with three or more
characters (here nicknamed "long contraction"), initial substrings
will be handled.
For example, a contraction ABC, where A is a starter, and B and C
are non-starters (character with non-zero combining character class),
will be detected even if there is not AB as a contraction.

B<Default:> Usually false.
If C<UCA_Version> is 22 or 24, and the value of C<long_contraction>
is not specified in C<new()>, a true value is set implicitly.
This is a workaround to pass Conformance Tests for Unicode 6.0.0 and 6.1.0.

C<change()> handles C<long_contraction> explicitly only.
If C<long_contraction> is not specified in C<change()>, even though
C<UCA_Version> is changed, C<long_contraction> will not be changed.

B<Limitation:> Scanning non-starters is one-way (no back tracking).
If AB is found but not ABC is not found, other long contraction where
the first character is A and the second is not B may not be found.

Under C<(normalization =E<gt> undef)>, detection step of discontiguous
contractions will be skipped.

B<Note:> The following contractions in DUCET are not considered
in steps S2.1.1 to S2.1.3, where they are discontiguous.

    0FB2 0F71 0F80 (TIBETAN VOWEL SIGN VOCALIC RR)
    0FB3 0F71 0F80 (TIBETAN VOWEL SIGN VOCALIC LL)

For example C<TIBETAN VOWEL SIGN VOCALIC RR> with C<COMBINING TILDE OVERLAY>
(C<U+0344>) is C<0FB2 0344 0F71 0F80> in NFD.
In this case C<0FB2 0F80> (C<TIBETAN VOWEL SIGN VOCALIC R>) is detected,
instead of C<0FB2 0F71 0F80>.
Inserted C<0344> makes C<0FB2 0F71 0F80> discontiguous and lack of
contraction C<0FB2 0F71> prohibits C<0FB2 0F71 0F80> from being detected.

=item minimalFFFE

-- see 1.1.1 U+FFFE, UTS #35 (LDML) Part 5: Collation.

If the parameter is made true, C<U+FFFE> has a minimal primary weight.
The comparison between C<"$a1\x{FFFE}$a2"> and C<"$b1\x{FFFE}$b2">
first compares C<$a1> and C<$b1> at level 1, and
then C<$a2> and C<$b2> at level 1, as followed.

        "ab\x{FFFE}a"
        "Ab\x{FFFE}a"
        "ab\x{FFFE}c"
        "Ab\x{FFFE}c"
        "ab\x{FFFE}xyz"
        "abc\x{FFFE}def"
        "abc\x{FFFE}xYz"
        "aBc\x{FFFE}xyz"
        "abcX\x{FFFE}def"
        "abcx\x{FFFE}xyz"
        "b\x{FFFE}aaa"
        "bbb\x{FFFE}a"

Note:
This is equivalent to C<(entry =E<gt> 'FFFE ; [.0001.0020.0005.FFFE]')>.
Any other character than C<U+FFFE> can be tailored by C<entry>.

=item normalization

-- see 4.1 Normalize, UTS #10.

If specified, strings are normalized before preparation of sort keys
(the normalization is executed after preprocess).

A form name C<Unicode::Normalize::normalize()> accepts will be applied
as C<$normalization_form>.
Acceptable names include C<'NFD'>, C<'NFC'>, C<'NFKD'>, and C<'NFKC'>.
See C<Unicode::Normalize::normalize()> for detail.
If omitted, C<'NFD'> is used.

C<normalization> is performed after C<preprocess> (if defined).

Furthermore, special values, C<undef> and C<"prenormalized">, can be used,
though they are not concerned with C<Unicode::Normalize::normalize()>.

If C<undef> (not a string C<"undef">) is passed explicitly
as the value for this key,
any normalization is not carried out (this may make tailoring easier
if any normalization is not desired). Under C<(normalization =E<gt> undef)>,
only contiguous contractions are resolved;
e.g. even if C<A-ring> (and C<A-ring-cedilla>) is ordered after C<Z>,
C<A-cedilla-ring> would be primary equal to C<A>.
In this point,
C<(normalization =E<gt> undef, preprocess =E<gt> sub { NFD(shift) })>
B<is not> equivalent to C<(normalization =E<gt> 'NFD')>.

In the case of C<(normalization =E<gt> "prenormalized")>,
any normalization is not performed, but
discontiguous contractions with combining characters are performed.
Therefore
C<(normalization =E<gt> 'prenormalized', preprocess =E<gt> sub { NFD(shift) })>
B<is> equivalent to C<(normalization =E<gt> 'NFD')>.
If source strings are finely prenormalized,
C<(normalization =E<gt> 'prenormalized')> may save time for normalization.

Except C<(normalization =E<gt> undef)>,
B<Unicode::Normalize> is required (see also B<CAVEAT>).

=item overrideCJK

-- see 7.1 Derived Collation Elements, UTS #10.

By default, CJK unified ideographs are ordered in Unicode codepoint
order, but those in the CJK Unified Ideographs block are less than
those in the CJK Unified Ideographs Extension A etc.

    In the CJK Unified Ideographs block:
    U+4E00..U+9FA5 if UCA_Version is 8, 9 or 11.
    U+4E00..U+9FBB if UCA_Version is 14 or 16.
    U+4E00..U+9FC3 if UCA_Version is 18.
    U+4E00..U+9FCB if UCA_Version is 20 or 22.
    U+4E00..U+9FCC if UCA_Version is 24 to 30.
    U+4E00..U+9FD5 if UCA_Version is 32 or 34.
    U+4E00..U+9FEA if UCA_Version is 36.
    U+4E00..U+9FEF if UCA_Version is 38, 40 or 41.
    U+4E00..U+9FFC if UCA_Version is 43.

    In the CJK Unified Ideographs Extension blocks:
    Ext.A (U+3400..U+4DB5)   if UCA_Version is  8 to 41.
    Ext.A (U+3400..U+4DBF)   if UCA_Version is 43.
    Ext.B (U+20000..U+2A6D6) if UCA_Version is  8 to 41.
    Ext.B (U+20000..U+2A6DD) if UCA_Version is 43.
    Ext.C (U+2A700..U+2B734) if UCA_Version is 20 or later.
    Ext.D (U+2B740..U+2B81D) if UCA_Version is 22 or later.
    Ext.E (U+2B820..U+2CEA1) if UCA_Version is 32 or later.
    Ext.F (U+2CEB0..U+2EBE0) if UCA_Version is 36 or later.
    Ext.G (U+30000..U+3134A) if UCA_Version is 43.

Through C<overrideCJK>, ordering of CJK unified ideographs (including
extensions) can be overridden.

ex. CJK unified ideographs in the JIS code point order.

  overrideCJK => sub {
      my $u = shift;             # get a Unicode codepoint
      my $b = pack('n', $u);     # to UTF-16BE
      my $s = your_unicode_to_sjis_converter($b); # convert
      my $n = unpack('n', $s);   # convert sjis to short
      [ $n, 0x20, 0x2, $u ];     # return the collation element
  },

The return value may be an arrayref of 1st to 4th weights as shown
above. The return value may be an integer as the primary weight
as shown below.  If C<undef> is returned, the default derived
collation element will be used.

  overrideCJK => sub {
      my $u = shift;             # get a Unicode codepoint
      my $b = pack('n', $u);     # to UTF-16BE
      my $s = your_unicode_to_sjis_converter($b); # convert
      my $n = unpack('n', $s);   # convert sjis to short
      return $n;                 # return the primary weight
  },

The return value may be a list containing zero or more of
an arrayref, an integer, or C<undef>.

ex. ignores all CJK unified ideographs.

  overrideCJK => sub {()}, # CODEREF returning empty list

   # where ->eq("Pe\x{4E00}rl", "Perl") is true
   # as U+4E00 is a CJK unified ideograph and to be ignorable.

If a false value (including C<undef>) is passed, C<overrideCJK>
has no effect.
C<$Collator-E<gt>change(overrideCJK =E<gt> 0)> resets the old one.

But assignment of weight for CJK unified ideographs
in C<table> or C<entry> is still valid.
If C<undef> is passed explicitly as the value for this key,
weights for CJK unified ideographs are treated as undefined.
However when C<UCA_Version> E<gt> 8, C<(overrideCJK =E<gt> undef)>
has no special meaning.

B<Note:> In addition to them, 12 CJK compatibility ideographs (C<U+FA0E>,
C<U+FA0F>, C<U+FA11>, C<U+FA13>, C<U+FA14>, C<U+FA1F>, C<U+FA21>, C<U+FA23>,
C<U+FA24>, C<U+FA27>, C<U+FA28>, C<U+FA29>) are also treated as CJK unified
ideographs. But they can't be overridden via C<overrideCJK> when you use
DUCET, as the table includes weights for them. C<table> or C<entry> has
priority over C<overrideCJK>.

=item overrideHangul

-- see 7.1 Derived Collation Elements, UTS #10.

By default, Hangul syllables are decomposed into Hangul Jamo,
even if C<(normalization =E<gt> undef)>.
But the mapping of Hangul syllables may be overridden.

This parameter works like C<overrideCJK>, so see there for examples.

If you want to override the mapping of Hangul syllables,
NFD and NFKD are not appropriate, since NFD and NFKD will decompose
Hangul syllables before overriding. FCD may decompose Hangul syllables
as the case may be.

If a false value (but not C<undef>) is passed, C<overrideHangul>
has no effect.
C<$Collator-E<gt>change(overrideHangul =E<gt> 0)> resets the old one.

If C<undef> is passed explicitly as the value for this key,
weight for Hangul syllables is treated as undefined
without decomposition into Hangul Jamo.
But definition of weight for Hangul syllables
in C<table> or C<entry> is still valid.

=item overrideOut

-- see 7.1.1 Handling Ill-Formed Code Unit Sequences, UTS #10.

Perl seems to allow out-of-range values (greater than 0x10FFFF).
By default, out-of-range values are replaced with C<U+FFFD>
(REPLACEMENT CHARACTER) when C<UCA_Version> E<gt>= 22,
or ignored when C<UCA_Version> E<lt>= 20.

When C<UCA_Version> E<gt>= 22, the weights of out-of-range values
can be overridden. Though C<table> or C<entry> are available for them,
out-of-range values are too many.

C<overrideOut> can perform it algorithmically.
This parameter works like C<overrideCJK>, so see there for examples.

ex. ignores all out-of-range values.

  overrideOut => sub {()}, # CODEREF returning empty list

If a false value (including C<undef>) is passed, C<overrideOut>
has no effect.
C<$Collator-E<gt>change(overrideOut =E<gt> 0)> resets the old one.

B<NOTE ABOUT U+FFFD:>

UCA recommends that out-of-range values should not be ignored for security
reasons. Say, C<"pe\x{110000}rl"> should not be equal to C<"perl">.
However, C<U+FFFD> is wrongly mapped to a variable collation element
in DUCET for Unicode 6.0.0 to 6.2.0, that means out-of-range values will be
ignored when C<variable> isn't C<Non-ignorable>.

The mapping of C<U+FFFD> is corrected in Unicode 6.3.0.
see L<http://www.unicode.org/reports/tr10/tr10-28.html#Trailing_Weights>
(7.1.4 Trailing Weights). Such a correction is reproduced by this.

  overrideOut => sub { 0xFFFD }, # CODEREF returning a very large integer

This workaround is unnecessary since Unicode 6.3.0.

=item preprocess

-- see 5.4 Preprocessing, UTS #10.

If specified, the coderef is used to preprocess each string
before the formation of sort keys.

ex. dropping English articles, such as "a" or "the".
Then, "the pen" is before "a pencil".

     preprocess => sub {
           my $str = shift;
           $str =~ s/\b(?:an?|the)\s+//gi;
           return $str;
        },

C<preprocess> is performed before C<normalization> (if defined).

ex. decoding strings in a legacy encoding such as shift-jis:

    $sjis_collator = Unicode::Collate->new(
        preprocess => \&your_shiftjis_to_unicode_decoder,
    );
    @result = $sjis_collator->sort(@shiftjis_strings);

B<Note:> Strings returned from the coderef will be interpreted
according to Perl's Unicode support. See L<perlunicode>,
L<perluniintro>, L<perlunitut>, L<perlunifaq>, L<utf8>.

=item rearrange

-- see 3.5 Rearrangement, UTS #10.

Characters that are not coded in logical order and to be rearranged.
If C<UCA_Version> is equal to or less than 11, default is:

    rearrange => [ 0x0E40..0x0E44, 0x0EC0..0x0EC4 ],

If you want to disallow any rearrangement, pass C<undef> or C<[]>
(a reference to empty list) as the value for this key.

If C<UCA_Version> is equal to or greater than 14, default is C<[]>
(i.e. no rearrangement).

B<According to the version 9 of UCA, this parameter shall not be used;
but it is not warned at present.>

=item rewrite

If specified, the coderef is used to rewrite lines in C<table> or C<entry>.
The coderef will get each line, and then should return a rewritten line
according to the UCA file format.
If the coderef returns an empty line, the line will be skipped.

e.g. any primary ignorable characters into tertiary ignorable:

    rewrite => sub {
        my $line = shift;
        $line =~ s/\[\.0000\..{4}\..{4}\./[.0000.0000.0000./g;
        return $line;
    },

This example shows rewriting weights. C<rewrite> is allowed to
affect code points, weights, and the name.

B<NOTE>: C<table> is available to use another table file;
preparing a modified table once would be more efficient than
rewriting lines on reading an unmodified table every time.

=item suppress

-- see 3.12 Special-Purpose Commands, UTS #35 (LDML) Part 5: Collation.

Contractions beginning with the specified characters are suppressed,
even if those contractions are defined in C<table>.

An example for Russian and some languages using the Cyrillic script:

    suppress => [0x0400..0x0417, 0x041A..0x0437, 0x043A..0x045F],

where 0x0400 stands for C<U+0400>, CYRILLIC CAPITAL LETTER IE WITH GRAVE.

B<NOTE>: Contractions via C<entry> will not be suppressed.

=item table

-- see 3.8 Default Unicode Collation Element Table, UTS #10.

You can use another collation element table if desired.

The table file should locate in the F<Unicode/Collate> directory
on C<@INC>. Say, if the filename is F<Foo.txt>,
the table file is searched as F<Unicode/Collate/Foo.txt> in C<@INC>.

By default, F<allkeys.txt> (as the filename of DUCET) is used.
If you will prepare your own table file, any name other than F<allkeys.txt>
may be better to avoid namespace conflict.

B<NOTE>: When XSUB is used, the DUCET is compiled on building this
module, and it may save time at the run time.
Explicit saying C<(table =E<gt> 'allkeys.txt')>, or using another table,
or using C<ignoreChar>, C<ignoreName>, C<undefChar>, C<undefName> or
C<rewrite> will prevent this module from using the compiled DUCET.

If C<undef> is passed explicitly as the value for this key,
no file is read (but you can define collation elements via C<entry>).

A typical way to define a collation element table
without any file of table:

   $onlyABC = Unicode::Collate->new(
       table => undef,
       entry => << 'ENTRIES',
0061 ; [.0101.0020.0002.0061] # LATIN SMALL LETTER A
0041 ; [.0101.0020.0008.0041] # LATIN CAPITAL LETTER A
0062 ; [.0102.0020.0002.0062] # LATIN SMALL LETTER B
0042 ; [.0102.0020.0008.0042] # LATIN CAPITAL LETTER B
0063 ; [.0103.0020.0002.0063] # LATIN SMALL LETTER C
0043 ; [.0103.0020.0008.0043] # LATIN CAPITAL LETTER C
ENTRIES
    );

If C<ignoreName> or C<undefName> is used, character names should be
specified as a comment (following C<#>) on each line.

=item undefChar

=item undefName

-- see 6.3.3 Reducing the Repertoire, UTS #10.

Undefines the collation element as if it were unassigned in the C<table>.
This reduces the size of the table.
If an unassigned character appears in the string to be collated,
the sort key is made from its codepoint
as a single-character collation element,
as it is greater than any other assigned collation elements
(in the codepoint order among the unassigned characters).
But, it'd be better to ignore characters
unfamiliar to you and maybe never used.

Through C<undefChar>, any character matching C<qr/$undefChar/>
will be undefined. Through C<undefName>, any character whose name
(given in the C<table> file as a comment) matches C<qr/$undefName/>
will be undefined.

ex. Collation weights for beyond-BMP characters are not stored in object:

    undefChar => qr/[^\0-\x{fffd}]/,

=item upper_before_lower

-- see 6.6 Case Comparisons, UTS #10.

By default, lowercase is before uppercase.
If the parameter is made true, this is reversed.

B<NOTE>: This parameter simplemindedly assumes that any lowercase/uppercase
distinctions must occur in level 3, and their weights at level 3 must be
same as those mentioned in 7.3.1, UTS #10.
If you define your collation elements which differs from this requirement,
this parameter doesn't work validly.

=item variable

-- see 3.6 Variable Weighting, UTS #10.

This key allows for variable weighting of variable collation elements,
which are marked with an ASTERISK in the table
(NOTE: Many punctuation marks and symbols are variable in F<allkeys.txt>).

   variable => 'blanked', 'non-ignorable', 'shifted', or 'shift-trimmed'.

These names are case-insensitive.
By default (if specification is omitted), 'shifted' is adopted.

   'Blanked'        Variable elements are made ignorable at levels 1 through 3;
                    considered at the 4th level.

   'Non-Ignorable'  Variable elements are not reset to ignorable.

   'Shifted'        Variable elements are made ignorable at levels 1 through 3
                    their level 4 weight is replaced by the old level 1 weight.
                    Level 4 weight for Non-Variable elements is 0xFFFF.

   'Shift-Trimmed'  Same as 'shifted', but all FFFF's at the 4th level
                    are trimmed.

=back

=head2 Methods for Collation

=over 4

=item C<@sorted = $Collator-E<gt>sort(@not_sorted)>

Sorts a list of strings.

=item C<$result = $Collator-E<gt>cmp($a, $b)>

Returns 1 (when C<$a> is greater than C<$b>)
or 0 (when C<$a> is equal to C<$b>)
or -1 (when C<$a> is less than C<$b>).

=item C<$result = $Collator-E<gt>eq($a, $b)>

=item C<$result = $Collator-E<gt>ne($a, $b)>

=item C<$result = $Collator-E<gt>lt($a, $b)>

=item C<$result = $Collator-E<gt>le($a, $b)>

=item C<$result = $Collator-E<gt>gt($a, $b)>

=item C<$result = $Collator-E<gt>ge($a, $b)>

They works like the same name operators as theirs.

   eq : whether $a is equal to $b.
   ne : whether $a is not equal to $b.
   lt : whether $a is less than $b.
   le : whether $a is less than $b or equal to $b.
   gt : whether $a is greater than $b.
   ge : whether $a is greater than $b or equal to $b.

=item C<$sortKey = $Collator-E<gt>getSortKey($string)>

-- see 4.3 Form Sort Key, UTS #10.

Returns a sort key.

You compare the sort keys using a binary comparison
and get the result of the comparison of the strings using UCA.

   $Collator->getSortKey($a) cmp $Collator->getSortKey($b)

      is equivalent to

   $Collator->cmp($a, $b)

=item C<$sortKeyForm = $Collator-E<gt>viewSortKey($string)>

Converts a sorting key into its representation form.
If C<UCA_Version> is 8, the output is slightly different.

   use Unicode::Collate;
   my $c = Unicode::Collate->new();
   print $c->viewSortKey("Perl"),"\n";

   # output:
   # [0B67 0A65 0B7F 0B03 | 0020 0020 0020 0020 | 0008 0002 0002 0002 | FFFF FFFF FFFF FFFF]
   #  Level 1               Level 2               Level 3               Level 4

=back

=head2 Methods for Searching

The C<match>, C<gmatch>, C<subst>, C<gsubst> methods work
like C<m//>, C<m//g>, C<s///>, C<s///g>, respectively,
but they are not aware of any pattern, but only a literal substring.

B<DISCLAIMER:> If C<preprocess> or C<normalization> parameter is true
for C<$Collator>, calling these methods (C<index>, C<match>, C<gmatch>,
C<subst>, C<gsubst>) is croaked, as the position and the length might
differ from those on the specified string.

C<rearrange> and C<hangul_terminator> parameters are neglected.
C<katakana_before_hiragana> and C<upper_before_lower> don't affect
matching and searching, as it doesn't matter whether greater or less.

=over 4

=item C<$position = $Collator-E<gt>index($string, $substring[, $position])>

=item C<($position, $length) = $Collator-E<gt>index($string, $substring[, $position])>

If C<$substring> matches a part of C<$string>, returns
the position of the first occurrence of the matching part in scalar context;
in list context, returns a two-element list of
the position and the length of the matching part.

If C<$substring> does not match any part of C<$string>,
returns C<-1> in scalar context and
an empty list in list context.

e.g. when the content of C<$str> is C<"Ich mu>E<szlig>C< studieren Perl.">,
you say the following where C<$sub> is C<"M>E<uuml>C<SS">,

  my $Collator = Unicode::Collate->new( normalization => undef, level => 1 );
                                     # (normalization => undef) is REQUIRED.
  my $match;
  if (my($pos,$len) = $Collator->index($str, $sub)) {
      $match = substr($str, $pos, $len);
  }

and get C<"mu>E<szlig>C<"> in C<$match>, since C<"mu>E<szlig>C<">
is primary equal to C<"M>E<uuml>C<SS">.

=item C<$match_ref = $Collator-E<gt>match($string, $substring)>

=item C<($match)   = $Collator-E<gt>match($string, $substring)>

If C<$substring> matches a part of C<$string>, in scalar context, returns
B<a reference to> the first occurrence of the matching part
(C<$match_ref> is always true if matches,
since every reference is B<true>);
in list context, returns the first occurrence of the matching part.

If C<$substring> does not match any part of C<$string>,
returns C<undef> in scalar context and
an empty list in list context.

e.g.

    if ($match_ref = $Collator->match($str, $sub)) { # scalar context
	print "matches [$$match_ref].\n";
    } else {
	print "doesn't match.\n";
    }

     or

    if (($match) = $Collator->match($str, $sub)) { # list context
	print "matches [$match].\n";
    } else {
	print "doesn't match.\n";
    }

=item C<@match = $Collator-E<gt>gmatch($string, $substring)>

If C<$substring> matches a part of C<$string>, returns
all the matching parts (or matching count in scalar context).

If C<$substring> does not match any part of C<$string>,
returns an empty list.

=item C<$count = $Collator-E<gt>subst($string, $substring, $replacement)>

If C<$substring> matches a part of C<$string>,
the first occurrence of the matching part is replaced by C<$replacement>
(C<$string> is modified) and C<$count> (always equals to C<1>) is returned.

C<$replacement> can be a C<CODEREF>,
taking the matching part as an argument,
and returning a string to replace the matching part
(a bit similar to C<s/(..)/$coderef-E<gt>($1)/e>).

=item C<$count = $Collator-E<gt>gsubst($string, $substring, $replacement)>

If C<$substring> matches a part of C<$string>,
all the occurrences of the matching part are replaced by C<$replacement>
(C<$string> is modified) and C<$count> is returned.

C<$replacement> can be a C<CODEREF>,
taking the matching part as an argument,
and returning a string to replace the matching part
(a bit similar to C<s/(..)/$coderef-E<gt>($1)/eg>).

e.g.

  my $Collator = Unicode::Collate->new( normalization => undef, level => 1 );
                                     # (normalization => undef) is REQUIRED.
  my $str = "Camel donkey zebra came\x{301}l CAMEL horse cam\0e\0l...";
  $Collator->gsubst($str, "camel", sub { "<b>$_[0]</b>" });

  # now $str is "<b>Camel</b> donkey zebra <b>came\x{301}l</b> <b>CAMEL</b> horse <b>cam\0e\0l</b>...";
  # i.e., all the camels are made bold-faced.

   Examples: levels and ignore_level2 - what does camel match?
  ---------------------------------------------------------------------------
   level  ignore_level2  |  camel  Camel  came\x{301}l  c-a-m-e-l  cam\0e\0l
  -----------------------|---------------------------------------------------
     1        false      |   yes    yes      yes          yes        yes
     2        false      |   yes    yes      no           yes        yes
     3        false      |   yes    no       no           yes        yes
     4        false      |   yes    no       no           no         yes
  -----------------------|---------------------------------------------------
     1        true       |   yes    yes      yes          yes        yes
     2        true       |   yes    yes      yes          yes        yes
     3        true       |   yes    no       yes          yes        yes
     4        true       |   yes    no       yes          no         yes
  ---------------------------------------------------------------------------
   note: if variable => non-ignorable, camel doesn't match c-a-m-e-l
         at any level.

=back

=head2 Other Methods

=over 4

=item C<%old_tailoring = $Collator-E<gt>change(%new_tailoring)>

=item C<$modified_collator = $Collator-E<gt>change(%new_tailoring)>

Changes the value of specified keys and returns the changed part.

    $Collator = Unicode::Collate->new(level => 4);

    $Collator->eq("perl", "PERL"); # false

    %old = $Collator->change(level => 2); # returns (level => 4).

    $Collator->eq("perl", "PERL"); # true

    $Collator->change(%old); # returns (level => 2).

    $Collator->eq("perl", "PERL"); # false

Not all C<(key,value)>s are allowed to be changed.
See also C<@Unicode::Collate::ChangeOK> and C<@Unicode::Collate::ChangeNG>.

In the scalar context, returns the modified collator
(but it is B<not> a clone from the original).

    $Collator->change(level => 2)->eq("perl", "PERL"); # true

    $Collator->eq("perl", "PERL"); # true; now max level is 2nd.

    $Collator->change(level => 4)->eq("perl", "PERL"); # false

=item C<$version = $Collator-E<gt>version()>

Returns the version number (a string) of the Unicode Standard
which the C<table> file used by the collator object is based on.
If the table does not include a version line (starting with C<@version>),
returns C<"unknown">.

=item C<UCA_Version()>

Returns the revision number of UTS #10 this module consults,
that should correspond with the DUCET incorporated.

=item C<Base_Unicode_Version()>

Returns the version number of UTS #10 this module consults,
that should correspond with the DUCET incorporated.

=back

=head1 EXPORT

No method will be exported.

=head1 INSTALL

Though this module can be used without any C<table> file,
to use this module easily, it is recommended to install a table file
in the UCA format, by copying it under the directory
<a place in @INC>/Unicode/Collate.

The most preferable one is "The Default Unicode Collation Element Table"
(aka DUCET), available from the Unicode Consortium's website:

   http://www.unicode.org/Public/UCA/

   http://www.unicode.org/Public/UCA/latest/allkeys.txt
   (latest version)

If DUCET is not installed, it is recommended to copy the file
from http://www.unicode.org/Public/UCA/latest/allkeys.txt
to <a place in @INC>/Unicode/Collate/allkeys.txt
manually.

=head1 CAVEATS

=over 4

=item Normalization

Use of the C<normalization> parameter requires the B<Unicode::Normalize>
module (see L<Unicode::Normalize>).

If you need not it (say, in the case when you need not
handle any combining characters),
assign C<(normalization =E<gt> undef)> explicitly.

-- see 6.5 Avoiding Normalization, UTS #10.

=item Conformance Test

The Conformance Test for the UCA is available
under L<http://www.unicode.org/Public/UCA/>.

For F<CollationTest_SHIFTED.txt>,
a collator via C<Unicode::Collate-E<gt>new( )> should be used;
for F<CollationTest_NON_IGNORABLE.txt>, a collator via
C<Unicode::Collate-E<gt>new(variable =E<gt> "non-ignorable", level =E<gt> 3)>.

If C<UCA_Version> is 26 or later, the C<identical> level is preferred;
C<Unicode::Collate-E<gt>new(identical =E<gt> 1)> and
C<Unicode::Collate-E<gt>new(identical =E<gt> 1,>
C<variable =E<gt> "non-ignorable", level =E<gt> 3)> should be used.

B<Unicode::Normalize is required to try The Conformance Test.>

B<EBCDIC-SUPPORT IS EXPERIMENTAL.>

=back

=head1 AUTHOR, COPYRIGHT AND LICENSE

The Unicode::Collate module for perl was written by SADAHIRO Tomoyuki,
<SADAHIRO@cpan.org>. This module is Copyright(C) 2001-2021,
SADAHIRO Tomoyuki. Japan. All rights reserved.

This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

The file Unicode/Collate/allkeys.txt was copied verbatim
from L<http://www.unicode.org/Public/UCA/13.0.0/allkeys.txt>.
For this file, Copyright (c) 2020 Unicode, Inc.; distributed
under the Terms of Use in L<http://www.unicode.org/terms_of_use.html>

=head1 SEE ALSO

=over 4

=item Unicode Collation Algorithm - UTS #10

L<http://www.unicode.org/reports/tr10/>

=item The Default Unicode Collation Element Table (DUCET)

L<http://www.unicode.org/Public/UCA/latest/allkeys.txt>

=item The conformance test for the UCA

L<http://www.unicode.org/Public/UCA/latest/CollationTest.html>

L<http://www.unicode.org/Public/UCA/latest/CollationTest.zip>

=item Hangul Syllable Type

L<http://www.unicode.org/Public/UNIDATA/HangulSyllableType.txt>

=item Unicode Normalization Forms - UAX #15

L<http://www.unicode.org/reports/tr15/>

=item Unicode Locale Data Markup Language (LDML) - UTS #35

L<http://www.unicode.org/reports/tr35/>

=back

=cut
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   m   0     1     2     3  -   4  ;   5  G        6   	    W 
  7     8  	   9  f 
  :  b      2022.11-6+deb12u1    128.13.0esr-1~deb12u1    128.13.0esr-1~deb12u1.1~      ~    ;     <     =     >     ?     @     A     B         	 C    
 D  )   E  E   F     
 G   !  H  n "  I  ^ #     $  J  p %  K   &  L   '     (  M   )     *  N  $ +     ,  O   -  Ɍ      .  ʌ      /  ˌ      0  P   1     2  ̌      3      4 ! Q  . 5 " R  r 6 # S   7 $     8 % ͌      9 & T   : ' U   ; ( Ό      < ) V  ( = * ό      > + W  7 ? , Ќ      @ - X  ? A . Y  ; B / Z  < C 0 [  J D 1 \  > E 2 ]   F 3 ^       4 3d"   H 5 4d"  G I 6 ь  C     7 3d"  H K 8 4d"  J L 9 Ҍ       : 3d"  K N ; 4d"  M     < 3d"  N P = 4d"  O     > 3d"  P R ? 4d"  Q S @ ӌ       A 3d"   R U B 4d"   T V C Ԍ    W D Ռ        E 3d"  U Y F 4d"  X Z G ֌   [ H ׌   \ I ،  Z ] J ٌ  [     K 3d"  Y _ L 4d"  ^ ` M ڌ  "     N 3d"  _ b O 4d"  a c P ی  ]     Q 3d"  b e R 4d"  d f S ܌  %     T 3d"  e h U 4d"  g     V 3d"  h j W 4d"  i     X 3d"  j l Y 4d"  k m Z ݌  +     [ 3d"  l o \ 4d"  n     ] 3d" 	 o q ^ 4d" 	 p r _ ތ 	 2 s ` ߌ 	 1     a 3d" 
 q u b 4d" 
 t v c  
 5 w d  
 6 x e  
 7     f 3d"  u z g 4d"  y     h 3d"  z | i 4d"  { } j   ? ~ k   @     l 3d" 
 |  m 4d" 
   n  
 F  o  
 ]     p 3d"    q 4d"    r     s        t 3d"    u 4d"    v        w 3d"    x 4d"    y   T  z   U     { 3d"    | 4d"    }     ~         3d"     4d"                  3d"     4d"                  3d"     4d"       X      3d"     4d"       [      3d"     4d"             3d"     4d"        3d"     4d"       _      3d"     4d"       b     c     d      3d"     4d"        3d"     4d"        3d"     4d"       p      3d"     4d"       k     l      3d"     4d"       p     o      3d"     4d"        3d"     4d"             3d"     4d"       s     t      3d"     4d"             3d"     4d"       w      3d"     4d"        3d"     4d"       ~           3d"     4d"             3d"     4d"        3d"     4d"             3d"     4d"             3d"     4d"              3d"     4d"        3d"     4d"        3d"     4d"        3d"     4d"             3d"     4d"        3d"     4d"        3d"     4d"             3d"     4d"        3d"     4d"             3d"     4d"                     3d"     4d"        3d"     4d"        3d"     4d"        3d"     4d"        3d"     4d"              3d"     4d"       ]      3d"     4d"             3d"   
  4d"  	   	        3d"  
 
  4d"     
  	      3d"  
   4d"        3d"     4d"                   3d"     4d"     
             3d"     4d"         	        
 3d"     4d"        3d"     
 4d"   !          3d"    #  4d"  " $     %          3d"  # '  4d"  &      3d"  ' )  4d"  (      3d"  ) +  4d"  *      3d"  + -  4d"  , .    (	      3d"  - 0  4d"  / 1     2           3d"  0 4 ! 4d"  3     " 3d"  4 6 # 4d"  5 7 $        % 3d"  6 9 & 4d"  8     ' 3d"  9 ; ( 4d"  : < )   t     * 3d"  ; > + 4d"  = ? ,        - 3d"  > A . 4d"  @ B /   .     0 3d"  A D 1 4d"  C     2 3d"  D F 3 4d"  E     4 3d"  F H 5 4d"  G I 6   C	     7 3d"  H K 8 4d"  J     9 3d"  K M : 4d"  L N ;        < 3d"  M P = 4d"  O     > 3d"  P R ? 4d"  Q     @ 3d"  R T A 4d"  S     B 3d"  T V C 4d"  U W D    X E        F 3d"  V Z G 4d"  Y     H 3d"  Z \ I 4d"  [ ] J        K 3d"  \ _ L 4d"  ^ ` M         N 3d"  _ b O 4d"  a     P 3d"  b d Q 4d"  c     R 3d"  d f S 4d"  e     T 5d"  $ h U \   i V T	       W T	  m k X Q  j l Y T	  g     Z 6d"  . n [ Q  8 o \ \  h p ] 9  i q ^   2 r _ i  f} s `    t a T	   u b 
  ^6 v c T	  t     d 7d"  "1 x e 5d"  k y f 8d"   z g T	  m { h m  , | i T	  { } j T	  | ~ k     l Q  n  m T	    n T	       o \  o  p R  x  q T	  p  r T	    s T	       t 	  @I  u 	    v 	    w 	    x   6o  y   }  z "  -*  { 	    |   T{  } f    ~ 	          n          	     	     	     	     	  t(   	  }]   	       ^}          q   C  /        	  |     V{   }   *   	  ,   I1  ÷   K1  |   	     	  5[   	  YG   i  r   	  m   8  F   m       s     G   	     "  n     >     ?          K        &o     i  {     M        	     	       (   	        	        	     i  Z   	     	     	          PI      	          	     	     	     	     	     	     	     	     	     	     	        \     9d"     	     	        	  I        	           
  N     z      \     ̣       v     \l   W  WF                                    z[          |     G          P(           մ     \     [     :d"  S)      	  [   :d"     ;d"     <d"     	     \P       w        5     	  =   	  
     id   	        ,O           \     :d"     	  :     Z        m      o   <      j   	   4       	  2   /, 
  -   .o   Q      OM   ) 
        \       ٧            :d"                   	         	           	        	        	        K  {               	        
   #i                
    !     i "             \   $    a %    ~ &      '    ! (    %      j   *  k   +  l  =n ,  m  K -  n  q .  o  =Z /  p  f 0  q  y 1  r      2  s  z 3   t      4 ! u   5 " v  K 6 # w  j2 7 $ x   8 % y  &O 9 & z   : ' {   ; ( |  h < ) }  . = * ~   \ > +   }y ? ,   G @ -       A .   < B /    C 0    D 1       E 2   [ F 3   !i G 4    H 5    I 6    J 7   9 K 8   #\ L 9       M :        ; =d"  k*     < =d" 	  P = >d" 	 ~ Q >  	 \ R ?  	     S @  	     T A  	     U B  	  V C  	  W D  	  X E  	  Y F  	     Z G  	 ~ [ H  	 U \ I  	  ] J  	     ^ K  	     _ L  	     ` M  	 ~ a N  	 ~ b O  	 J c P  	  d Q  	  e R  	     f S  	  g T  	 b h U  	  i V  	  j W  	     k X  	     l Y  	     m Z  	     n [  	 ~ o \  	 =F
 p ]  	 z q ^  	     r _  	     s `  	     t a  	  u b  	 ! v c  	 i w d  	  x e  	  y f  	     z g  	  { h  	 ~ | i  	 ' } j  	     ~ k  	 ~  l  	 ;  m  	   n  	      o  	      p  	      q  	      r   	      s  	      t  	      u  	      v  	 "g  w  	      x  	      y  	      z  	      { 	 	   | 
 	 ~  }  	      ~  	       
 	        	        	        	 ZB    	 [B    	 \B    	 ]B    	 ^B    	 _B    	 `B    	 aB    	 bB    	 cB    	 dB    	 eB    	 fB    	 gB    	 hB    	 iB     	 jB   ! 	 kB   " 	 lB   # 	 mB   $ 	 oB   % 	 pB   & 	 qB   ' 	 rB   ( 	 sB   ) 	 tB   * 	 uB   + 	 vB   , 	 xB   - 	 yB   . 	 zB   / 	 {B   0 	 |B   1 	 }B   2 	 ~B   3 	 B   4 	 B   5 	 B   6 	 B   7 	       8 	    9 	       : 	 |   ; 	       < 	       = 	       > 	       ? 	       @ 	       A 	 )    	 F   B 	 '   C 	 O      ?d" 
 y   @d" 
 
*   	 
 a      Ad"     Bd"     @d"  C   	        =d"     	     	  M   	     	     	     	     	     	     	     	     	     	     	  V      =d" 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
       ߧ       I   Z  G   [  H              f       8   N  QF               5{   W        \     *  /   0
  =   ѣ        0
     4  '   \     ޣ        Cd"  l*   \          	        Cd"  /   \        J     K  |   Dd"  5O 	  Ed"   
  Cd"     Fd"  /   0
  0+
 
  dT	     0
  i   0
  	f   0
  	9   ң  K   0
         0
        \     ȣ  y   ͣ  c   Σ  E   ϣ  A   У  l   ѣ     i    	 ң       
 Cd"  
   h       )   
 |        nL  \ "  M   #  oL   $  pL   %  	           '     (  tU	   )  Gd"   *  iL   +  jL  v; ,  rL  q -  sL   .    r /  tL  s 0  D   1    u 2     3     & 4 !     5 " 4  G 6 # Hd"  " 7 $ vL  G 8 % wL  W 9 & xL  7     '   ) ; (    < )    = *    > + \  & ? , R   @ - Q
   A . yL   c B / ,>   C 0 	   D 1 zL  ^ E 2 {  * F 3 {L  M G 4 |L  ) H 5   ) I 6   ) J 7 !o   K 8 6    L 9 }L  o M :   ' N ; tU	  ( O < ~L  
 P = |  [ Q > L   R ? Hd"  $ S @ iL  * T A jL  + U B L   V C 	   W D F1  | X E C   Y F L   Z G L   [ H 2  o \ I L  [ ] J R  r ^ K R  Q8 _ L >  ( ` M  	  t a N Y  * b O N  * c P L  i d Q L  j e R   Y f S L   g T   N h U I1   i V ]  c} j W    k X L   l Y L   m Z   d} n [ p    o \ R   p ] L   q ^ 7   r _    s ` C  _ t a 2   u b   y v c   FZ w d    x e @>   y f 7   z g    { h m  4 | i E  [] } j L  \] ~ k L  ,	  l   d^  m "  CH  n   aO  o     p 7    q L  t  r     s   G  t     u /
  om  v >  {  w L  |  x L  5  y L  G  z L  @	  { L  A	  | L    } L    ~ L     L     L     L     L        \  >   tU	  N   	  R   iL  S   jL  T   Id"  #   L  	      \       M   tU	     L  Q   iL     jL     |  {   L     L     L     L  (}   c  o}   4     Hd"                  tU	     iL     jL       .        L     L             L  F   tU	     L     iL     jL     L  [Q   L  *   L  }   "               o     p     L        Hd"      Gd"   	   W      V   d   Jd"   	   L   m   L         M ! "   pL ! $   L !    iL !       L "     "    R "    iL "    jL "    L " C      | #    Q #    7 # ?H   L #    iL #    jL #     #    i #     #    L # 	   L #        $    Ǣ $ D   R $    iL $    jL $     $ +m    $ m   p $ n   L $ /m   L $    L $ 0m   L $ 1m   L $    h $    L $       \ %    Q %    	 %    jL %    L %       h &     & ?   Q &    iL &    jL &    R & o   L & p    &     &     & ~M   'S & X8      h '    N '     2 ' {   2 ' Z}    ' *m   R '    L '    jL '    	 ' V    '    L ' bO 	  N ' $* 
   '     '     '  
  L '    H ' H   L ' 
       (    R (                                                                                             2W  2W   ; `            &	      L      >8      \    2W  2W   > `   0                    ?!9      ]    2W  2W   A `                       ?!:      ^    2W  2W   D `            |R           N;      _    2W  2W   G `            9      d
     %<      `    2W  2W   J `            U      
     /=      a    2W  2W   M `                        V&\>      b    2W  2W   P `            5      t	     A?      c    2W  2W   S `                       $Z@      d    2W  2W   V `            P      	     A      e    2W  2W   Y `                  
     _mB      f    2W  2W   \ `            6	      d     F-RC      g    2W  2W   _ `            I	      p      yBD      h    2W  2W   b `                        V&\E      i    2W  2W   e `            P      
     GF      j    2W  2W   h `            D      
     SG      k    2W  2W   k `                  
     _mH      l    2W  2W   n `                        t!I      m    2W  2W   q `            	           "lJ      n    2W  2W   t `            	           BHK      o    2W  2W   w ` 	           v      
     L      p    2W  2W   z `             $
      ,     g@M      q    2W  2W   } `                  L	     oN      r    2W  2W    `                       5O      s    2W  2W    `            Z	           9P      t    2W  2W    `            8           ZQ      u    2W  2W    `                   
      IR      v    2W  2W    `                  (
     S      w    2W  2W    ` !           ̛           ?yT      x    2W  2W    ` $           X@      x	     U      y    2W  2W    ` '           -      l     ;CV      z    2W  2W    ` *  	         X      H	     )]W      {    2W  2W    ` -   
         Lz      
     etaX      |    2W  2W    ` 0           x      X	     *Y      }    2W  2W    ` 3                  
     <
+Z      ~    2W  2W    ` 6 	                
     $[          2W  2W    ` 9  
         ~      
     S\          2W  2W    ` <           `	           R]          2W  2W    ` ?           	      H     ^          2W  2W    ` B           |           !Zs_          2W  2W    ` E                      \`          2W  2W    ` H                 
     Ļa          2W  2W    ` K           z      	     <[xsb          2W  2W    ` N "           O
      t     ]c          2W  2W    ` Q & 1         q	           td          2W  2W    ` T ( 2         !      L
     ( xe          2W  2W    ` W * 3               	     c͖f          2W  2W    ` Z ,          h      
     hxNg          2W  2W    ` ] /          T	      |     C)|h          2W  2W    ` ` 3 4         	           Ri          2W  2W    ` c 5                      _dj          2W  2W    ` f 8          D           =ZXk          2W  2W    ` i :          D	      <     śl          2W  2W    ` l =          ,/	      X     #}Hm          2W  2W    ` o @                
     <
+n          2W  2W    ` r C 5         !      \	     eo          2W  2W    ` u E          h      $	     }p          2W  2W    ` x G          8      	     gHq          2W  2W    ` { J 6         PO
      t     ]r          2W  2W    ` ~ L          	           s          2W  2W    `  O 7         @      t	     At          2W  2W    `  Q                $     ;u          2W  2W    `  S 8               	     ~v          2W  2W    `  U          *
      P     #w          2W  2W    `  Y                	     !'x          2W  2W    `  [          (l           y          2W  2W    `  ^          hK	      p      yBz          2W  2W    `  a          (           {          2W  2W    `  c          6	      h     ^|          2W  2W   
 `  e           A	      p      yB}          ıW  ıW    ) X #Y g j         W      7    \~     ^     ıW  ıW   - Y 'Y j   ,     l4             
          ıW  ıW   0 Z *Y m e                t     Eλ1          ıWw  ıW   3 [ -Y w V                 X     9K          ıW  ıW   6 \ 0Y  H         pE       ,     ܂          ıW  ıW   9 ] 3Y     j         h      P'     sby|          ıWr  ıW   < ^ 6Y                         x|          ޱW \ ޱW    G   =v            5D      6    e(q          ޱW \ ޱW   J  @v                   lH    R          ޱW \ ޱW   M  Cv  g         `z      C     }·          ޱWw \ ޱW    P  Fv  R                               ޱWr \ ޱW   S  Iv                      $          X  X        .            PZ      @     ZH2     q     XX  X        O  2          ȭ      8     [ċ          X  X        .               p           4}|          Xw  X        T  «          y           y          Xw  X        X           ,N      \
     
          Xr  X        [            l-      U    䜣          X  X         ^           Dp           kL          Xr N X        a  a          5      5     y|     z     X N X        d           4n7     ȋ    #          X N X                    C	                     Xw N X        0            ز       l     D\          X N X        0 #                       h_          X N X        -     b          $L
      C     sz|          X N X          ) 8          0*           v-          X! N X        n N       q           }          Xw N X        %0 O              غ     C          Xw N X         s  P      X      0j     ڹy     	     Xw N X         v  Q               w     + M     
     X N X         y  $         %           <po          X N X         |           n'      d     $<          X N X        -  U          <;           A     
     X N X          V          B      
    U7          X N X          Y                     ]M          *X  *X    m u            	      `     mEw     r     *Xr  *X    n x              I      x               *X  *X     o {                      J3          *X  *X     J               6           W[          *X  *X   # p   1         5           ?Ջ          *Xw  *X   ( q    '     t      Q     d>          *X  *X   + I  X            s      4     S          *X  *X   . r            (8       8     ,a          >X  >X   Y 1
 ~ !          `           R}8     8
     >X  >X   \ 2
 ~ & a         lY           	T@          >X  >X   f 3
 ~ :  e     -           ~ed          >X|  >X    i 4
 ~  u         L           eƮ          >X  >X   l 5
 ~  v                    +Dw\          >X  >X   o 6
 ~  b         @                     >X  >X   r 7
 ~  	               P%     tiů          >Xw  >X   u 8
 ~  ps               3     Ӛ낰          RX s RX   x     ~           XW           W     A
     RX s RX   }     ~  ` |     d}      <           !     RX s RX                `      <          "     RX s RX        	  c       dI      &     Ią     #     RX| s RX           x         j      H     mz?     $     RX s RX          zs      p"           K     %     RX s RX                         H
     Ө     &     RX s RX                    h?      5     ݻ     '     RXw s RX          )  qs               d]     <"     (     pRX P pRX         - <  %         4)      A     n̺          pRXr P pRX        0 I  %         \      C     mTz     *     pRX P pRX        3 M  %               p          +     RXw @ RX    } +	 N           #      4     j5|     }     RXr @ RX    } +	               -          U     -     RXw @ RX    } +	 V  :                   2ٺ      .     RX @ RX    S  - ]            |      (5    b     /     RX  RX        -	 c  ͷ                     ><          RX  RX        -	 d  k      d      d          1     RXr  RX        -	 k  r      d_x      Pb    H     2     RX  RX        -	 v  j      ,      	           3     RX  RX        -	   |          -      	     t     4     RX  RX        -	   l                8      O     5     RXr  RX        -	   s         P       4      $F     6     RX  RX	        -	   W      <            z"Y     7     RX  RX        -	         0                8     RX  RX        .	         <0      	     Ց     9     RXw  RX        .	                   (     G     :     RX  RX        .	   ʤ                    q     ;     RXw  RX        
.	         p           P     <     RX  RX        .	                       /v     =     RXw  RX        .	            T           (     >     RXw  RX        .	   r         T       0      =     ?     RXw  RX        .	                       0_     @     RXw  RX        .	                        xT      A     RX  RX        .	   ˤ         ;      f     m     B     RX  RX        >	  v 
           $     \:     C     RXw  RX        >	 )             O     M     D     RX  RX        >	 C }         j      0g     L!     E     RX  RX        >	 `             $     s     F     RXw  RX   "     >	 n          <      O     lmC     G     RXw  RX   %     >	  '         8       0      pgFZ     H     RXw  RX   (     >	           )       |     爯     I     RX  RX   +     >	  r         ;           tN     J     RXw  RX   0     >	   /     8      |)     G~     K      RX  RX   3     >	  ~         h=                L     RXw  RX   6     >	           9      d)     T
`w     M     RXw  RX   9     >	  gk         ,       0      r     N     RX  RX   <     >	  (         P       0      bs     O     RXr D RX   F  y	  o,               .     N     $     RXr D RX    I   y	  p,         P           (H     Q     RXw D RX   L ! y	  /                p     y     R     RX| D RX    O " y	  r,         6<      @    P     S     RX| D RX    R # y	  t,         DY      P9     '2     T 	    RX D RX   U $ y	                 @6     &$L     U 
    D," b D    ^  _	  = ]     p      `     p          D," b D    a  +	  =         H		      !          W     RX t RX   d     4	  .         m      0     }     } 
    RXr t RX   g     7	 +           ȓ*           o     Y     RX t RX    j     :	 / m         hn             f/     Z     RX t RX   m     =	 1 m         4J            e     [     RX t RX   p     @	 5 /         |      D     C~     \     RX t RX    s     C	 I 0         V                ]     RX t RX   v     F	 S m          z            ^
     ^     RX t RX   y                    d       @          _     RXw t RX   |     J	 a m         `           J     `     RX t RX        M	 i m         T            񠽻     a     RX t RX        P	 o n         <            tdU     b     RX t RX        S	 w                 l     C     c     RX t RX                    
           =1     d     RX t RX        W	  Z         |             r!     e     RX t RX                    3                f     RX t RX        [	  m                     k     g     RX t RX        ^	  m         x            7,     h     RX t RX        a	  m                P     W!U     i     RXw t RX        d	  n         ;       P     e     j     RX t RX        g	   n         ^            =w     k      RX t RX                    X           `]     l !    RX! t RX        k	  n         TH!      L'     Z%     m "    RXw t RX        n	  +\         9       L     wW     n #    RX t RX                    d            \J      o $    RX|   RX      <
  s,         L            GA      %    RXw   RX     <
                       t\     q &    RX   RX     <
           k             he     r '    RX   RX    S  /            p      ,     qQA     s (    RX | RX     *K
  `         U       l     uu      )    RXw | RX     -K
  c                L      6vw;     u *    RX | RX     0K
  d         1             ο     v +    RXw | RX     3K
  g                h      dt     w ,    RX | RX     6K
  p         G            ֟	     x -    RXw | RX     9K
   i               "     x
     y .    RXw | RX     <K
  j                D      o+]     z /    RX | RX     ?K
  k         0'             Gv     { 0    RXw | RX     BK
  l         `       l      F'r
     | 1    RX | RX     EK
  m         @Y       L     B[t     } 2    RXw | RX     HK
  p         l       L      FG     ~ 3    RX | RX     KK
  q         >             6e-      4    RXw | RX     NK
 ! r                D      ͛      5    RX | RX     QK
 $ s                       'lk      6    RXw | RX     TK
 ' t                4      0&      7    RX | RX     WK
 ( u         s            ğ      8    RXw | RX     ZK
 , v                x      }-      9    RX | RX     ]K
 / w         _       L     0}      :    RXw | RX     `K
 4 x                L      >*      ;    RX | RX      cK
 7          :             |      <    RXw | RX     fK
 < y         x       D      C      =    RX | RX     iK
 ? z         )             <G      >    RXw | RX   	  lK
 D {                H      ^,!      ?    RX | RX     oK
 G          d,                   @    RXw | RX     rK
 L                 T      Dd      A    RXw | RX     uK
 M                 4      ,      B    RX | RX     xK
 O o         \             o      C                                                                       2.42.10+dfsg-1+deb12u2   2.10.34-1+deb12u3                 >o                 >o                 >o           L      >o                 >o                 >o      `     L      >o           5      >o                 >o                 >o           k      >o                 >o      	            Z         >o      	           >o      	            2      2   >o      	           >o      =	     &       &         >o      =	     &      >o      d
	            ~2      «   >o      d
	           >o      	            2        >o      	           >o      	     A       2         >o      	     A      >o      	     p       3        >o      	     p      >o      	     !       P3      a   >o      	     !      >o      	            3        >o      	           >o      3	     k       
         >o      3	     k      >o      	     {       &w         >o      	     {      >o       	            v         >o       	           >o      "	            D      b   >o      "	           >o      $	                  8   >o      $	           j          k               l  >o      *	     .       3        >o      *	     .        	 X    #0     >o      X	     ;                >o      X	     ;       
         q     >o      j	             4      P  >o      j	           >o      m	            $4      Q  >o      m	           >o      $p	            5      $  >o      $p	           >o      s	            ,5 
       >o      s	           >o       v	     b       h 
     U   >o       v	     b      >o      cx	     >       P5      V   >o      cx	     >      >o      z	            t5      Y   >o      z	           >o      [}	           >o      I	           >o      	     I      >o      @	            ,         >o      @	           >o      Ǒ	            ^        >o      Ǒ	           >o      	     P               >o      	     P      >o      3	            t "        >o      3	           >o      	     Z        %     1  >o      	     Z                                & >o      	            D *       >o      	           >o      	            < -        >o      	           >o      	     w       h 0       >o      	     w      >o      	           >o      	           >o      	           >o      ;	           >o      1	           >o      	           >o      	           >o      p	     l      >o      ݾ	           >o      	     s      >o      m	           >o      ^	           >o      D	           >o      <	           >o      	     d      >o      (	           >o      	           >o      	           >o      f	     ?      >o      	           >o      n	           >o      ]	           >o      	           >o      	     s      >o      /	     N      >o      ~	           >o      4	           >o      	           >o      ~	     o      >o      	           >o      
           >o      
     s      >o      
     -      >o      =	
     _      >o      
           >o      
     K      >o      
     r      >o      v
     S      >o      
     I      >o      
           >o      
     F         [       >o      
     F      >o      ."
     ?         ^     a  >o      ."
     ?      P          "     q          # _ o          ~ ` p          ~ a r          2 b s          . c t          & d >o      n(
     ,       " h       >o      n(
     ,      >o      uT
     I       " k     u  >o      uT
     I      >o      W
     Y       s n     v  >o      W
     Y      >o      \
     {       @s q     b  >o      \
     {      >o      _
            ns t     	  >o      _
           >o      c
            s w     ps  >o      c
           >o      
g
            s z       >o      
g
           P "         _     q "         ` { >o      (j
     w       t      `  >o      (j
     w      r #         c     s #         d  >o      m
            *t        >o      m
           q $         |     s $           >o      t
            bt      c   >o      t
           >o      
            t      x  >o      
           r &              >o      
            t      zs  >o      
           >o      }
            t        >o      }
           >o      
            Vu         >o      
           >o      
     v       u      qs  >o      
     v      >o      
           >o      ɛ
     '      >o      
           >o      d
           >o      -
           >o      
     	      >o      
           >o      
           >o      1
     E      >o      w
           >o      

           >o      
           >o      \
     |      >o      
                  %  >o      
           >o      
     |             %  >o      
     |      >o      b
     "             %  >o      b
     "      >o      
     V      >o      
     -      >o      

     '      >o      2
     ~      >o      
            c        >o      
           >o                  c        >o                 >o                  c      :  >o                 >o      Z            ~         >o      Z           >o           c             ͷ   >o           c      l 2         -	     >o      A                   k  >o      A           s 3         -	     >o                        r  >o                 ͷ  4         -	     { 4         -	  >o                  P      j  >o                 >o      u                  |  >o      u           >o                        l  >o                 >o           $       X      s  >o           $       8         -	     ( 8         -	   8 RX    -	  >o      !     X             W  >o      !     X       9         -	      9         -	   9 RX      ( 9 RX       9 RX    -	  >o      4%            p        >o      4%            : RX     .	     >o      )                    >o      )           >o      ,     :       N        >o      ,     :      >o      /            r      ʤ  >o      /            =         
.	     r = RX    .	  >o      2     /               >o      2     /      >o      6            L        >o      6           >o      9                    >o      9           >o      =                  r  >o      =           >o      @            J        >o      @           >o      C            n        >o      C           >o      cF     
             ˤ  >o      cF     
       D         !.	      D         ".	   D         #.	 	  D         $.	 
  D         %.	  G D         >	  >o      qK            |/      v  >o      qK            E         >	     ' E RX    >	  >o      P            /        >o      P           >o      ;U            0      }  >o      ;U            G         >	      G         >	   G         >	   G         >	   G         >	  G G         
  >o      YZ            0 !       >o      YZ           >o      1_            
1 $       >o      1_           >o      d            .1 '     '  >o      d           >o      f            R1 *       >o      f           >o      i            v1 -     r  >o      i            L         >	     gk L RX    >	 . >o      l     A       1 2       >o      l     A      >o      q     (       1 5     ~  >o      q     (      >o      5t            2 8       >o      5t           >o      .x            ,2 ;     gk  >o      .x           >o      z            P2 >     (  >o      z           >o      }     Y      >o           8      >o      '     L      >o      t     k      >o                 >o                 >o                 >o      x     0       D H     o,  >o      x     0      >o                  D K     p,  >o                 >o      _            E N     /  >o      _           >o           ]       PE Q     r,  >o           ]      >o      F     ~       E T     t,  >o      F     ~      >o      ŝ            E W       >o      ŝ           >o      }           >o      /           >o      إ     j      >o      C     I      >o                   W              >o      \            + `     =  >o      \           >o           .       | c     =  >o           .      >o      =             f     .  >o      =           >o           9        i        >o           9      >o                   l     m  >o                 >o      <     R       2 o     m  >o      <     R      >o                   r     /  >o                 >o      O             u     0  >o      O           >o      A     {        x     m  >o      A     {      >o                  u {        >o                 >o                  R ~     m  >o                 >o                        m  >o                 >o      ^                  n  >o      ^           >o           1                 >o           1      >o      G            v         >o      G           >o            O       0      Z  >o            O      >o      p            du         >o      p           >o                  T      m  >o                 >o                  x      m  >o                 >o                        m  >o                 >o                   :      n  >o                  >o           V       ^       n  >o           V      >o      ;            xv        	 >o      ;           >o      W                  n 
 >o      W           >o      _                  +\  >o      _           >o                  u         >o                 >o                 >o           .      >o           !      >o            {      >o      |
           >o       
           >o           q      >o      C     R      >o           8      >o                 >o  7 l!           >o      q#     6      >o      &     K      >o      (     M      >o      B+           >o      .            l      s, 
 >o      .           >o      0     _               >o      0     _      >o      3                    >o      3           >o      6             !         >o      6           >o      8                  `  >o      8           >o      |;                   c  >o      |;           >o      7>            ^      d  >o      7>           >o      @                  g  >o      @           >o      {C                  p  >o      {C           >o      rF            
      i  >o      rF           >o      I            X      j  >o      I           >o      K                  k  >o      K           >o      N                  l  >o      N           >o      bQ            0      m  >o      bQ           >o      {T                  p  >o      {T           >o      >W                  q  >o      >W           >o      Z                  r  >o      Z           >o      \                  s  >o      \           >o      Q_            t      t  >o      Q_           >o      a                  u   >o      a           >o      d                  v ! >o      d           >o      Jg                  w " >o      Jg           >o      j            V      x # >o      j           >o      l            z       $ >o      l           >o      o                  y % >o      o           >o      ?r                  z & >o      ?r           >o      
u            `O      { ' >o      
u           >o      w            O       ( >o      w           >o      z            O       ) >o      z           >o      }            "P       * >o      }           >o                  FP      o + >o                 >o      A            jP       , >o      A           >o      !            P       - >o      !           >o      ҉            P        . >o      ҉           >o                   Q #      / >o                 >o      (            DQ &     e 0 >o      (           >o                  vQ )     a 1 >o                 >o      U            Q ,     b 2 >o      U           >o                  Q /      3 >o                 >o           "      >o                 >o           v       F 4       4 >o           v      >o      )           >o                 >o      ~           >o                 >o      +           >o      ¬     )      >o                 >o                 >o                 >o      =           >o      ߹           >o      {           >o      4           >o      
           >o           _      >o      r     \      >o                  >o                 >o                 >o                 >o                 >o      T           >o           9      >o           >      >o      P           >o                 >o                 >o                 >o      m     V      >o           1      >o           Z      >o      Q
     3      >o      
           >o      *
     `      >o      (
           >o      5-
           >o      /
           >o      2
           >o      k6
           >o      <
           >o      A
           >o      jE
           >o      I
           >o      N
     Q      >o      hQ
           >o      NT
     O      >o      W
     P      >o      Z
     P      >o      @^
     R      >o      a
     O      >o      d
     b      >o      Fh
     c      >o      k
     Q      >o      n
     R      >o      Or
     P      >o      u
     Q      >o      x
     P      >o      C|
     R      >o      
     O      >o      
     S      >o      :
     T      >o      
     Q      >o      
     R      >o      4
     O      >o      
     P      >o      Ֆ
     O      >o      %
     O      >o      u
     P      >o      Ơ
     T      >o      
     g      >o      
     Q      >o      ժ
     `      >o      6
     S      >o      
     Q      >o      ܴ
     Q      >o      .
     T      >o      
     e      >o      
     f      >o      P
           >o      E
     ?      >o      
           >o      j
           >o      p
     Z      >o      
     X      >o      $
           >o      
     {      >o      D
     a      >o      
     [      >o      
     Z      >o      ]
     d      >o      
     W      >o      
     X      >o      s
     Y      >o      
     V      >o      $
     V      >o      {
     W      >o           W      >o      +     i      >o      	     V      >o           x      >o      e     }      >o           Z      >o      >     X      >o           Y      >o           W      >o      I!     f      >o      $           >o      B(     W      >o      +     W      >o      .     `      >o      S2     Y      >o      5     e      >o      9     `      >o      t<     _      >o      ?     V      >o      +C     Y      >o      F     Z      >o      I     [      >o      <M     P      >o      P     Z      >o      S     X      >o      AW     Y      >o      Z     Y      >o      ]     W      >o      Ma     s      >o      d     S      >o      h     X      >o      nk     W      >o      n     [      >o      "r     X      >o      {u     [      >o      x     f      >o      >|     Z      >o           d      >o           a      >o      `     e      >o      Ɖ     V      >o           b      >o           z      >o           g      >o      c     X      >o           V      >o                 >o           |      >o           W      >o      l     [      >o      ȫ     }      >o      F     Y      >o           X      >o           q      >o      k     X      >o      ļ     W      >o           Z      >o      w     i      >o           d      >o      F     _      >o           X      >o           g      >o      g     b      >o           c      >o      .     V      >o           f      >o           e      >o      R     X      >o           e      >o           W      >o      i     Z      >o           V      >o           V      >o      r     [      >o           V      >o      %      ,      >o      R     {      >o           |      >o      K
     U      >o      
           >o      L           >o      -     S      >o                 >o      |     $      >o                  >o      $     o      >o      )           >o      -     W      >o      1           >o      5           >o      08           >o      <;           >o      =           >o      A           >o      fE           >o      H           >o      L           >o      ]O           >o      )R           >o      T           >o      vW           >o      Z           >o      (]           >o      _     b      >o      b     %      >o      De           >o      k     B      /*    handy.h
 *
 *    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000,
 *    2001, 2002, 2004, 2005, 2006, 2007, 2008, 2012 by Larry Wall and others
 *
 *    You may distribute under the terms of either the GNU General Public
 *    License or the Artistic License, as specified in the README file.
 *
 */

/* IMPORTANT NOTE: Everything whose name begins with an underscore is for
 * internal core Perl use only. */

#ifndef PERL_HANDY_H_ /* Guard against nested #inclusion */
#define PERL_HANDY_H_

#ifndef PERL_CORE
#  define Null(type) ((type)NULL)

/*
=for apidoc_section $string
=for apidoc AmnU||Nullch
Null character pointer.  (No longer available when C<PERL_CORE> is
defined.)

=for apidoc_section $SV
=for apidoc AmnU||Nullsv
Null SV pointer.  (No longer available when C<PERL_CORE> is defined.)

=cut

Below are signatures of functions from config.h which can't easily be gleaned
from it, and are very unlikely to change

=for apidoc_section $signals
=for apidoc Am|int|Sigsetjmp|jmp_buf env|int savesigs
=for apidoc Am|void|Siglongjmp|jmp_buf env|int val

=for apidoc_section $filesystem
=for apidoc Am|void *|FILE_ptr|FILE * f
=for apidoc Am|Size_t|FILE_cnt|FILE * f
=for apidoc Am|void *|FILE_base|FILE * f
=for apidoc Am|Size_t|FILE_bufsiz|FILE *f

=for apidoc_section $string
=for apidoc Amu|token|CAT2|token x|token y
=for apidoc Amu|string|STRINGIFY|token x

=for apidoc_section $numeric
=for apidoc Am|double|Drand01
=for apidoc Am|void|seedDrand01|Rand_seed_t x
=for apidoc Am|char *|Gconvert|double x|Size_t n|bool t|char * b

=cut
*/

#  define Nullch Null(char*)
#  define Nullfp Null(PerlIO*)
#  define Nullsv Null(SV*)
#endif

#ifdef TRUE
#undef TRUE
#endif
#ifdef FALSE
#undef FALSE
#endif
#define TRUE (1)
#define FALSE (0)

/*
=for apidoc_section $SV
=for apidoc Am|void *|MUTABLE_PTR|void * p
=for apidoc_item |AV *|MUTABLE_AV|AV * p
=for apidoc_item |CV *|MUTABLE_CV|CV * p
=for apidoc_item |GV *|MUTABLE_GV|GV * p
=for apidoc_item |HV *|MUTABLE_HV|HV * p
=for apidoc_item |IO *|MUTABLE_IO|IO * p
=for apidoc_item |SV *|MUTABLE_SV|SV * p

The C<MUTABLE_I<*>>() macros cast pointers to the types shown, in such a way
(compiler permitting) that casting away const-ness will give a warning;
e.g.:

 const SV *sv = ...;
 AV *av1 = (AV*)sv;        <== BAD:  the const has been silently
                                     cast away
 AV *av2 = MUTABLE_AV(sv); <== GOOD: it may warn

C<MUTABLE_PTR> is the base macro used to derive new casts.  The other
already-built-in ones return pointers to what their names indicate.

=cut
 */

#if defined(PERL_USE_GCC_BRACE_GROUPS)
#  define MUTABLE_PTR(p) ({ void *p_ = (p); p_; })
#else
#  define MUTABLE_PTR(p) ((void *) (p))
#endif

#define MUTABLE_AV(p)	((AV *)MUTABLE_PTR(p))
#define MUTABLE_CV(p)	((CV *)MUTABLE_PTR(p))
#define MUTABLE_GV(p)	((GV *)MUTABLE_PTR(p))
#define MUTABLE_HV(p)	((HV *)MUTABLE_PTR(p))
#define MUTABLE_IO(p)	((IO *)MUTABLE_PTR(p))
#define MUTABLE_SV(p)	((SV *)MUTABLE_PTR(p))

#ifndef __cplusplus
#  include <stdbool.h>
#endif

/*
=for apidoc_section $casting
=for apidoc Am|bool|cBOOL|bool expr

Cast-to-bool.  When Perl was able to be compiled on pre-C99 compilers, a
C<(bool)> cast didn't necessarily do the right thing, so this macro was
created (and made somewhat complicated to work around bugs in old
compilers).  Now, many years later, and C99 is used, this is no longer
required, but is kept for backwards compatibility.

=cut
*/
#define cBOOL(cbool) ((bool) (cbool))

/* Try to figure out __func__ or __FUNCTION__ equivalent, if any.
 * XXX Should really be a Configure probe, with HAS__FUNCTION__
 *     and FUNCTION__ as results.
 * XXX Similarly, a Configure probe for __FILE__ and __LINE__ is needed. */
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__SUNPRO_C)) /* C99 or close enough. */
#  define FUNCTION__ __func__
#elif (defined(__DECC_VER)) /* Tru64 or VMS, and strict C89 being used, but not modern enough cc (in Tur64, -c99 not known, only -std1). */
#  define FUNCTION__ ""
#else
#  define FUNCTION__ __FUNCTION__ /* Common extension. */
#endif

/* XXX A note on the perl source internal type system.  The
   original intent was that I32 be *exactly* 32 bits.

   Currently, we only guarantee that I32 is *at least* 32 bits.
   Specifically, if int is 64 bits, then so is I32.  (This is the case
   for the Cray.)  This has the advantage of meshing nicely with
   standard library calls (where we pass an I32 and the library is
   expecting an int), but the disadvantage that an I32 is not 32 bits.
   Andy Dougherty	August 1996

   There is no guarantee that there is *any* integral type with
   exactly 32 bits.  It is perfectly legal for a system to have
   sizeof(short) == sizeof(int) == sizeof(long) == 8.

   Similarly, there is no guarantee that I16 and U16 have exactly 16
   bits.

   For dealing with issues that may arise from various 32/64-bit
   systems, we will ask Configure to check out

        SHORTSIZE == sizeof(short)
        INTSIZE == sizeof(int)
        LONGSIZE == sizeof(long)
        LONGLONGSIZE == sizeof(long long) (if HAS_LONG_LONG)
        PTRSIZE == sizeof(void *)
        DOUBLESIZE == sizeof(double)
        LONG_DOUBLESIZE == sizeof(long double) (if HAS_LONG_DOUBLE).

*/

#ifdef I_INTTYPES /* e.g. Linux has int64_t without <inttypes.h> */
#   include <inttypes.h>
#   ifdef INT32_MIN_BROKEN
#       undef  INT32_MIN
#       define INT32_MIN (-2147483647-1)
#   endif
#   ifdef INT64_MIN_BROKEN
#       undef  INT64_MIN
#       define INT64_MIN (-9223372036854775807LL-1)
#   endif
#endif

typedef I8TYPE I8;
typedef U8TYPE U8;
typedef I16TYPE I16;
typedef U16TYPE U16;
typedef I32TYPE I32;
typedef U32TYPE U32;

#ifdef QUADKIND
typedef I64TYPE I64;
typedef U64TYPE U64;
#endif

/* I8_MAX and I8_MIN constants are not defined, as I8 is an ambiguous type.
   Please search CHAR_MAX in perl.h for further details. */
#ifdef UINT8_MAX
#  define U8_MAX UINT8_MAX
#else
#  define U8_MAX PERL_UCHAR_MAX
#endif
#ifdef UINT8_MIN
#  define U8_MIN UINT8_MIN
#else
#  define U8_MIN PERL_UCHAR_MIN
#endif

#ifdef INT16_MAX
#  define I16_MAX INT16_MAX
#else
#  define I16_MAX PERL_SHORT_MAX
#endif
#ifdef INT16_MIN
#  define I16_MIN INT16_MIN
#else
#  define I16_MIN PERL_SHORT_MIN
#endif
#ifdef UINT16_MAX
#  define U16_MAX UINT16_MAX
#else
#  define U16_MAX PERL_USHORT_MAX
#endif
#ifdef UINT16_MIN
#  define U16_MIN UINT16_MIN
#else
#  define U16_MIN PERL_USHORT_MIN
#endif

#ifdef INT32_MAX
#  define I32_MAX INT32_MAX
#elif LONGSIZE > 4
#  define I32_MAX PERL_INT_MAX
#else
#  define I32_MAX PERL_LONG_MAX
#endif
#ifdef INT32_MIN
#  define I32_MIN INT32_MIN
#elif LONGSIZE > 4
#  define I32_MIN PERL_INT_MIN
#else
#  define I32_MIN PERL_LONG_MIN
#endif
#ifdef UINT32_MAX
#  ifndef UINT32_MAX_BROKEN /* e.g. HP-UX with gcc messes this up */
#    define U32_MAX UINT_MAX
#  else
#    define U32_MAX 4294967295U
#  endif
#elif LONGSIZE > 4
#  define U32_MAX PERL_UINT_MAX
#else
#  define U32_MAX PERL_ULONG_MAX
#endif
#ifdef UINT32_MIN
#  define U32_MIN UINT32_MIN
#elif LONGSIZE > 4
#  define U32_MIN PERL_UINT_MIN
#else
#  define U32_MIN PERL_ULONG_MIN
#endif

/*
=for apidoc_section $integer
=for apidoc Ay|| PERL_INT_FAST8_T
=for apidoc_item PERL_INT_FAST16_T
=for apidoc_item PERL_UINT_FAST8_T
=for apidoc_item PERL_UINT_FAST16_T

These are equivalent to the correspondingly-named C99 typedefs on platforms
that have those; they evaluate to C<int> and C<unsigned int> on platforms that
don't, so that you can portably take advantage of this C99 feature.

=cut
*/
#  ifdef I_STDINT
    typedef  int_fast8_t  PERL_INT_FAST8_T;
    typedef uint_fast8_t  PERL_UINT_FAST8_T;
    typedef  int_fast16_t PERL_INT_FAST16_T;
    typedef uint_fast16_t PERL_UINT_FAST16_T;
#  else
    typedef int           PERL_INT_FAST8_T;
    typedef unsigned int  PERL_UINT_FAST8_T;
    typedef int           PERL_INT_FAST16_T;
    typedef unsigned int  PERL_UINT_FAST16_T;
#  endif

/* log(2) (i.e., log base 10 of 2) is pretty close to 0.30103, just in case
 * anyone is grepping for it.  So BIT_DIGITS gives the number of decimal digits
 * required to represent any possible unsigned number containing N bits.
 * TYPE_DIGITS gives the number of decimal digits required to represent any
 * possible unsigned number of type T. */
#define BIT_DIGITS(N)   (((N)*146)/485 + 1)  /* log10(2) =~ 146/485 */
#define TYPE_DIGITS(T)  BIT_DIGITS(sizeof(T) * 8)
#define TYPE_CHARS(T)   (TYPE_DIGITS(T) + 2) /* sign, NUL */

/* Unused by core; should be deprecated */
#define Ctl(ch) ((ch) & 037)

#if defined(PERL_CORE) || defined(PERL_EXT)
#  ifndef MIN
#    define MIN(a,b) ((a) < (b) ? (a) : (b))
#  endif
#  ifndef MAX
#    define MAX(a,b) ((a) > (b) ? (a) : (b))
#  endif
#endif

/* Returns a boolean as to whether the input unsigned number is a power of 2
 * (2**0, 2**1, etc).  In other words if it has just a single bit set.
 * If not, subtracting 1 would leave the uppermost bit set, so the & would
 * yield non-zero */
#if defined(PERL_CORE) || defined(PERL_EXT)
#  define isPOWER_OF_2(n) ((n) && ((n) & ((n)-1)) == 0)
#endif

/* Returns a mask with the lowest n bits set */
#define nBIT_MASK(n) ((UINTMAX_C(1) << (n)) - 1)

/* The largest unsigned number that will fit into n bits */
#define nBIT_UMAX(n)  nBIT_MASK(n)

/*
=for apidoc_section $directives
=for apidoc Am||__ASSERT_|bool expr

This is a helper macro to avoid preprocessor issues, replaced by nothing
unless under DEBUGGING, where it expands to an assert of its argument,
followed by a comma (hence the comma operator).  If we just used a straight
assert(), we would get a comma with nothing before it when not DEBUGGING.

=cut

We also use empty definition under Coverity since the __ASSERT_
checks often check for things that Really Cannot Happen, and Coverity
detects that and gets all excited. */

#if   defined(DEBUGGING) && !defined(__COVERITY__)                        \
 && ! defined(PERL_SMALL_MACRO_BUFFER)
#   define __ASSERT_(statement)  assert(statement),
#else
#   define __ASSERT_(statement)
#endif

/*
=for apidoc_section $SV

=for apidoc Ama|SV*|newSVpvs|"literal string"
Like C<newSVpvn>, but takes a literal string instead of a
string/length pair.

=for apidoc Ama|SV*|newSVpvs_flags|"literal string"|U32 flags
Like C<newSVpvn_flags>, but takes a literal string instead of
a string/length pair.

=for apidoc Ama|SV*|newSVpvs_share|"literal string"
Like C<newSVpvn_share>, but takes a literal string instead of
a string/length pair and omits the hash parameter.

=for apidoc Am|void|sv_catpvs_flags|SV* sv|"literal string"|I32 flags
Like C<sv_catpvn_flags>, but takes a literal string instead
of a string/length pair.

=for apidoc Am|void|sv_catpvs_nomg|SV* sv|"literal string"
Like C<sv_catpvn_nomg>, but takes a literal string instead of
a string/length pair.

=for apidoc Am|void|sv_catpvs|SV* sv|"literal string"
Like C<sv_catpvn>, but takes a literal string instead of a
string/length pair.

=for apidoc Am|void|sv_catpvs_mg|SV* sv|"literal string"
Like C<sv_catpvn_mg>, but takes a literal string instead of a
string/length pair.

=for apidoc Am|SV *|sv_setref_pvs|SV *const rv|const char *const classname|"literal string"
Like C<sv_setref_pvn>, but takes a literal string instead of
a string/length pair.

=for apidoc_section $string

=for apidoc Ama|char*|savepvs|"literal string"
Like C<savepvn>, but takes a literal string instead of a
string/length pair.

=for apidoc Ama|char*|savesharedpvs|"literal string"
A version of C<savepvs()> which allocates the duplicate string in memory
which is shared between threads.

=for apidoc_section $GV

=for apidoc Am|HV*|gv_stashpvs|"name"|I32 create
Like C<gv_stashpvn>, but takes a literal string instead of a
string/length pair.

=for apidoc_section $HV

=for apidoc Am|SV**|hv_fetchs|HV* tb|"key"|I32 lval
Like C<hv_fetch>, but takes a literal string instead of a
string/length pair.

=for apidoc Am|SV**|hv_stores|HV* tb|"key"|SV* val
Like C<hv_store>, but takes a literal string instead of a
string/length pair
and omits the hash parameter.

=for apidoc_section $lexer

=for apidoc Amx|void|lex_stuff_pvs|"pv"|U32 flags

Like L</lex_stuff_pvn>, but takes a literal string instead of
a string/length pair.

=cut
*/

#define ASSERT_IS_LITERAL(s) ("" s "")

/*
=for apidoc_section $string

=for apidoc Amu|pair|STR_WITH_LEN|"literal string"

Returns two comma separated tokens of the input literal string, and its length.
This is convenience macro which helps out in some API calls.
Note that it can't be used as an argument to macros or functions that under
some configurations might be macros, which means that it requires the full
Perl_xxx(aTHX_ ...) form for any API calls where it's used.

=cut
*/

#define STR_WITH_LEN(s)  ASSERT_IS_LITERAL(s), (sizeof(s)-1)

/* STR_WITH_LEN() shortcuts */
#define newSVpvs(str) Perl_newSVpvn(aTHX_ STR_WITH_LEN(str))
#define newSVpvs_flags(str,flags)	\
    Perl_newSVpvn_flags(aTHX_ STR_WITH_LEN(str), flags)
#define newSVpvs_share(str) Perl_newSVpvn_share(aTHX_ STR_WITH_LEN(str), 0)
#define sv_catpvs_flags(sv, str, flags) \
    Perl_sv_catpvn_flags(aTHX_ sv, STR_WITH_LEN(str), flags)
#define sv_catpvs_nomg(sv, str) \
    Perl_sv_catpvn_flags(aTHX_ sv, STR_WITH_LEN(str), 0)
#define sv_catpvs(sv, str) \
    Perl_sv_catpvn_flags(aTHX_ sv, STR_WITH_LEN(str), SV_GMAGIC)
#define sv_catpvs_mg(sv, str) \
    Perl_sv_catpvn_flags(aTHX_ sv, STR_WITH_LEN(str), SV_GMAGIC|SV_SMAGIC)
#define sv_setpvs(sv, str) Perl_sv_setpvn(aTHX_ sv, STR_WITH_LEN(str))
#define sv_setpvs_mg(sv, str) Perl_sv_setpvn_mg(aTHX_ sv, STR_WITH_LEN(str))
#define sv_setref_pvs(rv, classname, str) \
    Perl_sv_setref_pvn(aTHX_ rv, classname, STR_WITH_LEN(str))
#define savepvs(str) Perl_savepvn(aTHX_ STR_WITH_LEN(str))
#define savesharedpvs(str) Perl_savesharedpvn(aTHX_ STR_WITH_LEN(str))
#define gv_stashpvs(str, create) \
    Perl_gv_stashpvn(aTHX_ STR_WITH_LEN(str), create)

#define gv_fetchpvs(namebeg, flags, sv_type) \
    Perl_gv_fetchpvn_flags(aTHX_ STR_WITH_LEN(namebeg), flags, sv_type)
#define  gv_fetchpvn  gv_fetchpvn_flags
#define sv_catxmlpvs(dsv, str, utf8) \
    Perl_sv_catxmlpvn(aTHX_ dsv, STR_WITH_LEN(str), utf8)


#define lex_stuff_pvs(pv,flags) Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags)

#define get_cvs(str, flags)					\
        Perl_get_cvn_flags(aTHX_ STR_WITH_LEN(str), (flags))

/* internal helpers */
/* Transitional */
#ifndef PERL_VERSION_MAJOR
#  define PERL_VERSION_MAJOR  PERL_REVISION
#else
#  undef  PERL_REVISION     /* We don't want code to be using these */
#endif
#ifndef PERL_VERSION_MINOR
#  define PERL_VERSION_MINOR  PERL_VERSION
#else
#  undef  PERL_VERSION
#endif
#ifndef PERL_VERSION_PATCH
#  define PERL_VERSION_PATCH  PERL_SUBVERSION
#else
#  undef  PERL_SUBVERSION
#endif

#define PERL_JNP_TO_DECIMAL_(maJor,miNor,Patch)                             \
            /* '10*' leaves room for things like alpha, beta, releases */   \
                    (10 * ((maJor) * 1000000) + ((miNor) * 1000) + (Patch))
#define PERL_DECIMAL_VERSION_                                               \
        PERL_JNP_TO_DECIMAL_(PERL_VERSION_MAJOR, PERL_VERSION_MINOR,        \
                                                        PERL_VERSION_PATCH)

/*
=for apidoc_section $versioning
=for apidoc AmR|bool|PERL_VERSION_EQ|const U8 major|const U8 minor|const U8 patch
=for apidoc_item PERL_VERSION_NE
=for apidoc_item PERL_VERSION_LT
=for apidoc_item PERL_VERSION_LE
=for apidoc_item PERL_VERSION_GT
=for apidoc_item PERL_VERSION_GE

Returns whether or not the perl currently being compiled has the specified
relationship to the perl given by the parameters.  For example,

 #if PERL_VERSION_GT(5,24,2)
   code that will only be compiled on perls after v5.24.2
 #else
   fallback code
 #endif

Note that this is usable in making compile-time decisions

You may use the special value '*' for the final number to mean ALL possible
values for it.  Thus,

 #if PERL_VERSION_EQ(5,31,'*')

means all perls in the 5.31 series.  And

 #if PERL_VERSION_NE(5,24,'*')

means all perls EXCEPT 5.24 ones.  And

 #if PERL_VERSION_LE(5,9,'*')

is effectively

 #if PERL_VERSION_LT(5,10,0)

This means you don't have to think so much when converting from the existing
deprecated C<PERL_VERSION> to using this macro:

 #if PERL_VERSION <= 9

becomes

 #if PERL_VERSION_LE(5,9,'*')

=cut
*/

/* N.B. These don't work if the patch version is 42 or 92, as those are what
 * '*' is in ASCII and EBCDIC respectively */
# define PERL_VERSION_EQ(j,n,p)                                             \
              (((p) == '*')                                                 \
               ? (   (j) == PERL_VERSION_MAJOR                              \
                  && (n) == PERL_VERSION_MINOR)                             \
               : (PERL_DECIMAL_VERSION_ == PERL_JNP_TO_DECIMAL_(j,n,p)))
# define PERL_VERSION_NE(j,n,p) (! PERL_VERSION_EQ(j,n,p))

# define PERL_VERSION_LT(j,n,p) /* < '*' effectively means < 0 */           \
    (PERL_DECIMAL_VERSION_ < PERL_JNP_TO_DECIMAL_( (j),                     \
                                                   (n),                     \
                                                 (((p) == '*') ? 0 : p)))
# define PERL_VERSION_GE(j,n,p)  (! PERL_VERSION_LT(j,n,p))

# define PERL_VERSION_LE(j,n,p)  /* <= '*' effectively means < n+1 */       \
    (PERL_DECIMAL_VERSION_ < PERL_JNP_TO_DECIMAL_(                  (j),    \
                                          (((p) == '*') ? ((n)+1) : (n)),   \
                                          (((p) == '*') ? 0 : p)))
# define PERL_VERSION_GT(j,n,p) (! PERL_VERSION_LE(j,n,p))

/*
=for apidoc_section $string

=for apidoc Am|bool|strNE|char* s1|char* s2
Test two C<NUL>-terminated strings to see if they are different.  Returns true
or false.

=for apidoc Am|bool|strEQ|char* s1|char* s2
Test two C<NUL>-terminated strings to see if they are equal.  Returns true or
false.

=for apidoc Am|bool|strLT|char* s1|char* s2
Test two C<NUL>-terminated strings to see if the first, C<s1>, is less than the
second, C<s2>.  Returns true or false.

=for apidoc Am|bool|strLE|char* s1|char* s2
Test two C<NUL>-terminated strings to see if the first, C<s1>, is less than or
equal to the second, C<s2>.  Returns true or false.

=for apidoc Am|bool|strGT|char* s1|char* s2
Test two C<NUL>-terminated strings to see if the first, C<s1>, is greater than
the second, C<s2>.  Returns true or false.

=for apidoc Am|bool|strGE|char* s1|char* s2
Test two C<NUL>-terminated strings to see if the first, C<s1>, is greater than
or equal to the second, C<s2>.  Returns true or false.

=for apidoc Am|bool|strnNE|char* s1|char* s2|STRLEN len
Test two C<NUL>-terminated strings to see if they are different.  The C<len>
parameter indicates the number of bytes to compare.  Returns true or false.  (A
wrapper for C<strncmp>).

=for apidoc Am|bool|strnEQ|char* s1|char* s2|STRLEN len
Test two C<NUL>-terminated strings to see if they are equal.  The C<len>
parameter indicates the number of bytes to compare.  Returns true or false.  (A
wrapper for C<strncmp>).

=for apidoc Am|bool|memEQ|char* s1|char* s2|STRLEN len
Test two buffers (which may contain embedded C<NUL> characters, to see if they
are equal.  The C<len> parameter indicates the number of bytes to compare.
Returns true or false.  It is undefined behavior if either of the buffers
doesn't contain at least C<len> bytes.

=for apidoc Am|bool|memEQs|char* s1|STRLEN l1|"s2"
Like L</memEQ>, but the second string is a literal enclosed in double quotes,
C<l1> gives the number of bytes in C<s1>.
Returns true or false.

=for apidoc Am|bool|memNE|char* s1|char* s2|STRLEN len
Test two buffers (which may contain embedded C<NUL> characters, to see if they
are not equal.  The C<len> parameter indicates the number of bytes to compare.
Returns true or false.  It is undefined behavior if either of the buffers
doesn't contain at least C<len> bytes.

=for apidoc Am|bool|memNEs|char* s1|STRLEN l1|"s2"
Like L</memNE>, but the second string is a literal enclosed in double quotes,
C<l1> gives the number of bytes in C<s1>.
Returns true or false.

=for apidoc Am|bool|memCHRs|"list"|char c
Returns the position of the first occurence of the byte C<c> in the literal
string C<"list">, or NULL if C<c> doesn't appear in C<"list">.  All bytes are
treated as unsigned char.  Thus this macro can be used to determine if C<c> is
in a set of particular characters.  Unlike L<strchr(3)>, it works even if C<c>
is C<NUL> (and the set doesn't include C<NUL>).

=cut

New macros should use the following conventions for their names (which are
based on the underlying C library functions):

  (mem | str n? ) (EQ | NE | LT | GT | GE | (( BEGIN | END ) P? )) l? s?

  Each has two main parameters, string-like operands that are compared
  against each other, as specified by the macro name.  Some macros may
  additionally have one or potentially even two length parameters.  If a length
  parameter applies to both string parameters, it will be positioned third;
  otherwise any length parameter immediately follows the string parameter it
  applies to.

  If the prefix to the name is 'str', the string parameter is a pointer to a C
  language string.  Such a string does not contain embedded NUL bytes; its
  length may be unknown, but can be calculated by C<strlen()>, since it is
  terminated by a NUL, which isn't included in its length.

  The optional 'n' following 'str' means that there is a third parameter,
  giving the maximum number of bytes to look at in each string.  Even if both
  strings are longer than the length parameter, those extra bytes will be
  unexamined.

  The 's' suffix means that the 2nd byte string parameter is a literal C
  double-quoted string.  Its length will automatically be calculated by the
  macro, so no length parameter will ever be needed for it.

  If the prefix is 'mem', the string parameters don't have to be C strings;
  they may contain embedded NUL bytes, do not necessarily have a terminating
  NUL, and their lengths can be known only through other means, which in
  practice are additional parameter(s) passed to the function.  All 'mem'
  functions have at least one length parameter.  Barring any 'l' or 's' suffix,
  there is a single length parameter, in position 3, which applies to both
  string parameters.  The 's' suffix means, as described above, that the 2nd
  string is a literal double-quoted C string (hence its length is calculated by
  the macro, and the length parameter to the function applies just to the first
  string parameter, and hence is positioned just after it).  An 'l' suffix
  means that the 2nd string parameter has its own length parameter, and the
  signature will look like memFOOl(s1, l1, s2, l2).

  BEGIN (and END) are for testing if the 2nd string is an initial (or final)
  substring  of the 1st string.  'P' if present indicates that the substring
  must be a "proper" one in tha mathematical sense that the first one must be
  strictly larger than the 2nd.

*/


#define strNE(s1,s2) (strcmp(s1,s2) != 0)
#define strEQ(s1,s2) (strcmp(s1,s2) == 0)
#define strLT(s1,s2) (strcmp(s1,s2) < 0)
#define strLE(s1,s2) (strcmp(s1,s2) <= 0)
#define strGT(s1,s2) (strcmp(s1,s2) > 0)
#define strGE(s1,s2) (strcmp(s1,s2) >= 0)

#define strnNE(s1,s2,l) (strncmp(s1,s2,l) != 0)
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)

#define memEQ(s1,s2,l) (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
#define memNE(s1,s2,l) (! memEQ(s1,s2,l))

/* memEQ and memNE where second comparand is a string constant */
#define memEQs(s1, l, s2) \
        (((sizeof(s2)-1) == (l)) && memEQ((s1), ASSERT_IS_LITERAL(s2), (sizeof(s2)-1)))
#define memNEs(s1, l, s2) (! memEQs(s1, l, s2))

/* Keep these private until we decide it was a good idea */
#if defined(PERL_CORE) || defined(PERL_EXT) || defined(PERL_EXT_POSIX)

#define strBEGINs(s1,s2) (strncmp(s1,ASSERT_IS_LITERAL(s2), sizeof(s2)-1) == 0)

#define memBEGINs(s1, l, s2)                                                \
            (   (Ptrdiff_t) (l) >= (Ptrdiff_t) sizeof(s2) - 1               \
             && memEQ(s1, ASSERT_IS_LITERAL(s2), sizeof(s2)-1))
#define memBEGINPs(s1, l, s2)                                               \
            (   (Ptrdiff_t) (l) > (Ptrdiff_t) sizeof(s2) - 1                \
             && memEQ(s1, ASSERT_IS_LITERAL(s2), sizeof(s2)-1))
#define memENDs(s1, l, s2)                                                  \
            (   (Ptrdiff_t) (l) >= (Ptrdiff_t) sizeof(s2) - 1               \
             && memEQ(s1 + (l) - (sizeof(s2) - 1), ASSERT_IS_LITERAL(s2), sizeof(s2)-1))
#define memENDPs(s1, l, s2)                                                 \
            (   (Ptrdiff_t) (l) > (Ptrdiff_t) sizeof(s2)                    \
             && memEQ(s1 + (l) - (sizeof(s2) - 1), ASSERT_IS_LITERAL(s2), sizeof(s2)-1))
#endif  /* End of making macros private */

#define memLT(s1,s2,l) (memcmp(s1,s2,l) < 0)
#define memLE(s1,s2,l) (memcmp(s1,s2,l) <= 0)
#define memGT(s1,s2,l) (memcmp(s1,s2,l) > 0)
#define memGE(s1,s2,l) (memcmp(s1,s2,l) >= 0)

#define memCHRs(s1,c) ((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))

/*
 * Character classes.
 *
 * Unfortunately, the introduction of locales means that we
 * can't trust isupper(), etc. to tell the truth.  And when
 * it comes to /\w+/ with tainting enabled, we *must* be able
 * to trust our character classes.
 *
 * Therefore, the default tests in the text of Perl will be
 * independent of locale.  Any code that wants to depend on
 * the current locale will use the tests that begin with "lc".
 */

#ifdef USE_LOCALE
#  ifndef CTYPE256
#    define CTYPE256
#  endif
#endif

/*

=head1 Character classification
This section is about functions (really macros) that classify characters
into types, such as punctuation versus alphabetic, etc.  Most of these are
analogous to regular expression character classes.  (See
L<perlrecharclass/POSIX Character Classes>.)  There are several variants for
each class.  (Not all macros have all variants; each item below lists the
ones valid for it.)  None are affected by C<use bytes>, and only the ones
with C<LC> in the name are affected by the current locale.

The base function, e.g., C<isALPHA()>, takes any signed or unsigned value,
treating it as a code point, and returns a boolean as to whether or not the
character represented by it is (or on non-ASCII platforms, corresponds to) an
ASCII character in the named class based on platform, Unicode, and Perl rules.
If the input is a number that doesn't fit in an octet, FALSE is returned.

Variant C<isI<FOO>_A> (e.g., C<isALPHA_A()>) is identical to the base function
with no suffix C<"_A">.  This variant is used to emphasize by its name that
only ASCII-range characters can return TRUE.

Variant C<isI<FOO>_L1> imposes the Latin-1 (or EBCDIC equivalent) character set
onto the platform.  That is, the code points that are ASCII are unaffected,
since ASCII is a subset of Latin-1.  But the non-ASCII code points are treated
as if they are Latin-1 characters.  For example, C<isWORDCHAR_L1()> will return
true when called with the code point 0xDF, which is a word character in both
ASCII and EBCDIC (though it represents different characters in each).
If the input is a number that doesn't fit in an octet, FALSE is returned.
(Perl's documentation uses a colloquial definition of Latin-1, to include all
code points below 256.)

Variant C<isI<FOO>_uvchr> is exactly like the C<isI<FOO>_L1> variant, for
inputs below 256, but if the code point is larger than 255, Unicode rules are
used to determine if it is in the character class.  For example,
C<isWORDCHAR_uvchr(0x100)> returns TRUE, since 0x100 is LATIN CAPITAL LETTER A
WITH MACRON in Unicode, and is a word character.

Variants C<isI<FOO>_utf8> and C<isI<FOO>_utf8_safe> are like C<isI<FOO>_uvchr>,
but are used for UTF-8 encoded strings.  The two forms are different names for
the same thing.  Each call to one of these classifies the first character of
the string starting at C<p>.  The second parameter, C<e>, points to anywhere in
the string beyond the first character, up to one byte past the end of the
entire string.  Although both variants are identical, the suffix C<_safe> in
one name emphasizes that it will not attempt to read beyond S<C<e - 1>>,
provided that the constraint S<C<s E<lt> e>> is true (this is asserted for in
C<-DDEBUGGING> builds).  If the UTF-8 for the input character is malformed in
some way, the program may croak, or the function may return FALSE, at the
discretion of the implementation, and subject to change in future releases.

Variant C<isI<FOO>_LC> is like the C<isI<FOO>_A> and C<isI<FOO>_L1> variants,
but the result is based on the current locale, which is what C<LC> in the name
stands for.  If Perl can determine that the current locale is a UTF-8 locale,
it uses the published Unicode rules; otherwise, it uses the C library function
that gives the named classification.  For example, C<isDIGIT_LC()> when not in
a UTF-8 locale returns the result of calling C<isdigit()>.  FALSE is always
returned if the input won't fit into an octet.  On some platforms where the C
library function is known to be defective, Perl changes its result to follow
the POSIX standard's rules.

Variant C<isI<FOO>_LC_uvchr> acts exactly like C<isI<FOO>_LC> for inputs less
than 256, but for larger ones it returns the Unicode classification of the code
point.

Variants C<isI<FOO>_LC_utf8> and C<isI<FOO>_LC_utf8_safe> are like
C<isI<FOO>_LC_uvchr>, but are used for UTF-8 encoded strings.  The two forms
are different names for the same thing.  Each call to one of these classifies
the first character of the string starting at C<p>.  The second parameter,
C<e>, points to anywhere in the string beyond the first character, up to one
byte past the end of the entire string.  Although both variants are identical,
the suffix C<_safe> in one name emphasizes that it will not attempt to read
beyond S<C<e - 1>>, provided that the constraint S<C<s E<lt> e>> is true (this
is asserted for in C<-DDEBUGGING> builds).  If the UTF-8 for the input
character is malformed in some way, the program may croak, or the function may
return FALSE, at the discretion of the implementation, and subject to change in
future releases.

=for apidoc Am|bool|isALPHA|UV ch
=for apidoc_item ||isALPHA_A|UV ch
=for apidoc_item ||isALPHA_L1|UV ch
=for apidoc_item ||isALPHA_uvchr|UV ch
=for apidoc_item ||isALPHA_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isALPHA_utf8|U8 * s|U8 * end
=for apidoc_item ||isALPHA_LC|UV ch
=for apidoc_item ||isALPHA_LC_uvchr|UV ch
=for apidoc_item ||isALPHA_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified input is one of C<[A-Za-z]>,
analogous to C<m/[[:alpha:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=cut

Here and below, we add the prototypes of these macros for downstream programs
that would be interested in them, such as Devel::PPPort

=for apidoc Am|bool|isALPHANUMERIC|UV ch
=for apidoc_item ||isALPHANUMERIC_A|UV ch
=for apidoc_item ||isALPHANUMERIC_L1|UV ch
=for apidoc_item ||isALPHANUMERIC_uvchr|UV ch
=for apidoc_item ||isALPHANUMERIC_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isALPHANUMERIC_utf8|U8 * s|U8 * end
=for apidoc_item ||isALPHANUMERIC_LC|UV ch
=for apidoc_item ||isALPHANUMERIC_LC_uvchr|UV ch
=for apidoc_item ||isALPHANUMERIC_LC_utf8_safe|U8 * s| U8 *end
=for apidoc_item ||isALNUMC|UV ch
=for apidoc_item ||isALNUMC_A|UV ch
=for apidoc_item ||isALNUMC_L1|UV ch
=for apidoc_item ||isALNUMC_LC|UV ch
=for apidoc_item ||isALNUMC_LC_uvchr|UV ch
Returns a boolean indicating whether the specified character is one of
C<[A-Za-z0-9]>, analogous to C<m/[[:alnum:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

A (discouraged from use) synonym is C<isALNUMC> (where the C<C> suffix means
this corresponds to the C language alphanumeric definition).  Also
there are the variants
C<isALNUMC_A>, C<isALNUMC_L1>
C<isALNUMC_LC>, and C<isALNUMC_LC_uvchr>.

=for apidoc Am|bool|isASCII|UV ch
=for apidoc_item ||isASCII_A|UV ch
=for apidoc_item ||isASCII_L1|UV ch
=for apidoc_item ||isASCII_uvchr|UV ch
=for apidoc_item ||isASCII_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isASCII_utf8|U8 * s|U8 * end
=for apidoc_item ||isASCII_LC|UV ch
=for apidoc_item ||isASCII_LC_uvchr|UV ch
=for apidoc_item ||isASCII_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character is one of the 128
characters in the ASCII character set, analogous to C<m/[[:ascii:]]/>.
On non-ASCII platforms, it returns TRUE iff this
character corresponds to an ASCII character.  Variants C<isASCII_A()> and
C<isASCII_L1()> are identical to C<isASCII()>.
See the L<top of this section|/Character classification> for an explanation of
the variants.
Note, however, that some platforms do not have the C library routine
C<isascii()>.  In these cases, the variants whose names contain C<LC> are the
same as the corresponding ones without.

Also note, that because all ASCII characters are UTF-8 invariant (meaning they
have the exact same representation (always a single byte) whether encoded in
UTF-8 or not), C<isASCII> will give the correct results when called with any
byte in any string encoded or not in UTF-8.  And similarly C<isASCII_utf8> and
C<isASCII_utf8_safe> will work properly on any string encoded or not in UTF-8.

=for apidoc Am|bool|isBLANK|UV ch
=for apidoc_item ||isBLANK_A|UV ch
=for apidoc_item ||isBLANK_L1|UV ch
=for apidoc_item ||isBLANK_uvchr|UV ch
=for apidoc_item ||isBLANK_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isBLANK_utf8|U8 * s|U8 * end
=for apidoc_item ||isBLANK_LC|UV ch
=for apidoc_item ||isBLANK_LC_uvchr|UV ch
=for apidoc_item ||isBLANK_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character is a
character considered to be a blank, analogous to C<m/[[:blank:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.
Note,
however, that some platforms do not have the C library routine
C<isblank()>.  In these cases, the variants whose names contain C<LC> are
the same as the corresponding ones without.

=for apidoc Am|bool|isCNTRL|UV ch
=for apidoc_item ||isCNTRL_A|UV ch
=for apidoc_item ||isCNTRL_L1|UV ch
=for apidoc_item ||isCNTRL_uvchr|UV ch
=for apidoc_item ||isCNTRL_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isCNTRL_utf8|U8 * s|U8 * end
=for apidoc_item ||isCNTRL_LC|UV ch
=for apidoc_item ||isCNTRL_LC_uvchr|UV ch
=for apidoc_item ||isCNTRL_LC_utf8_safe|U8 * s| U8 *end

Returns a boolean indicating whether the specified character is a
control character, analogous to C<m/[[:cntrl:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.
On EBCDIC platforms, you almost always want to use the C<isCNTRL_L1> variant.

=for apidoc Am|bool|isDIGIT|UV ch
=for apidoc_item ||isDIGIT_A|UV ch
=for apidoc_item ||isDIGIT_L1|UV ch
=for apidoc_item ||isDIGIT_uvchr|UV ch
=for apidoc_item ||isDIGIT_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isDIGIT_utf8|U8 * s|U8 * end
=for apidoc_item ||isDIGIT_LC|UV ch
=for apidoc_item ||isDIGIT_LC_uvchr|UV ch
=for apidoc_item ||isDIGIT_LC_utf8_safe|U8 * s| U8 *end

Returns a boolean indicating whether the specified character is a
digit, analogous to C<m/[[:digit:]]/>.
Variants C<isDIGIT_A> and C<isDIGIT_L1> are identical to C<isDIGIT>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=for apidoc Am|bool|isGRAPH|UV ch
=for apidoc_item ||isGRAPH_A|UV ch
=for apidoc_item ||isGRAPH_L1|UV ch
=for apidoc_item ||isGRAPH_uvchr|UV ch
=for apidoc_item ||isGRAPH_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isGRAPH_utf8|U8 * s|U8 * end
=for apidoc_item ||isGRAPH_LC|UV ch
=for apidoc_item ||isGRAPH_LC_uvchr|UV ch
=for apidoc_item ||isGRAPH_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character is a
graphic character, analogous to C<m/[[:graph:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=for apidoc Am|bool|isLOWER|UV ch
=for apidoc_item ||isLOWER_A|UV ch
=for apidoc_item ||isLOWER_L1|UV ch
=for apidoc_item ||isLOWER_uvchr|UV ch
=for apidoc_item ||isLOWER_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isLOWER_utf8|U8 * s|U8 * end
=for apidoc_item ||isLOWER_LC|UV ch
=for apidoc_item ||isLOWER_LC_uvchr|UV ch
=for apidoc_item ||isLOWER_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character is a
lowercase character, analogous to C<m/[[:lower:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants

=for apidoc Am|bool|isOCTAL|UV ch
=for apidoc_item ||isOCTAL_A|UV ch
=for apidoc_item ||isOCTAL_L1|UV ch
Returns a boolean indicating whether the specified character is an
octal digit, [0-7].
The only two variants are C<isOCTAL_A> and C<isOCTAL_L1>; each is identical to
C<isOCTAL>.

=for apidoc Am|bool|isPUNCT|UV ch
=for apidoc_item ||isPUNCT_A|UV ch
=for apidoc_item ||isPUNCT_L1|UV ch
=for apidoc_item ||isPUNCT_uvchr|UV ch
=for apidoc_item ||isPUNCT_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isPUNCT_utf8|U8 * s|U8 * end
=for apidoc_item ||isPUNCT_LC|UV ch
=for apidoc_item ||isPUNCT_LC_uvchr|UV ch
=for apidoc_item ||isPUNCT_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character is a
punctuation character, analogous to C<m/[[:punct:]]/>.
Note that the definition of what is punctuation isn't as
straightforward as one might desire.  See L<perlrecharclass/POSIX Character
Classes> for details.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=for apidoc Am|bool|isSPACE|UV ch
=for apidoc_item ||isSPACE_A|UV ch
=for apidoc_item ||isSPACE_L1|UV ch
=for apidoc_item ||isSPACE_uvchr|UV ch
=for apidoc_item ||isSPACE_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isSPACE_utf8|U8 * s|U8 * end
=for apidoc_item ||isSPACE_LC|UV ch
=for apidoc_item ||isSPACE_LC_uvchr|UV ch
=for apidoc_item ||isSPACE_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character is a
whitespace character.  This is analogous
to what C<m/\s/> matches in a regular expression.  Starting in Perl 5.18
this also matches what C<m/[[:space:]]/> does.  Prior to 5.18, only the
locale forms of this macro (the ones with C<LC> in their names) matched
precisely what C<m/[[:space:]]/> does.  In those releases, the only difference,
in the non-locale variants, was that C<isSPACE()> did not match a vertical tab.
(See L</isPSXSPC> for a macro that matches a vertical tab in all releases.)
See the L<top of this section|/Character classification> for an explanation of
the variants.

=for apidoc Am|bool|isPSXSPC|UV ch
=for apidoc_item ||isPSXSPC_A|UV ch
=for apidoc_item ||isPSXSPC_L1|UV ch
=for apidoc_item ||isPSXSPC_uvchr|UV ch
=for apidoc_item ||isPSXSPC_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isPSXSPC_utf8|U8 * s|U8 * end
=for apidoc_item ||isPSXSPC_LC|UV ch
=for apidoc_item ||isPSXSPC_LC_uvchr|UV ch
=for apidoc_item ||isPSXSPC_LC_utf8_safe|U8 * s| U8 *end
(short for Posix Space)
Starting in 5.18, this is identical in all its forms to the
corresponding C<isSPACE()> macros.
The locale forms of this macro are identical to their corresponding
C<isSPACE()> forms in all Perl releases.  In releases prior to 5.18, the
non-locale forms differ from their C<isSPACE()> forms only in that the
C<isSPACE()> forms don't match a Vertical Tab, and the C<isPSXSPC()> forms do.
Otherwise they are identical.  Thus this macro is analogous to what
C<m/[[:space:]]/> matches in a regular expression.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=for apidoc Am|bool|isUPPER|UV ch
=for apidoc_item ||isUPPER_A|UV ch
=for apidoc_item ||isUPPER_L1|UV ch
=for apidoc_item ||isUPPER_uvchr|UV ch
=for apidoc_item ||isUPPER_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isUPPER_utf8|U8 * s|U8 * end
=for apidoc_item ||isUPPER_LC|UV ch
=for apidoc_item ||isUPPER_LC_uvchr|UV ch
=for apidoc_item ||isUPPER_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character is an
uppercase character, analogous to C<m/[[:upper:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=for apidoc Am|bool|isPRINT|UV ch
=for apidoc_item ||isPRINT_A|UV ch
=for apidoc_item ||isPRINT_L1|UV ch
=for apidoc_item ||isPRINT_uvchr|UV ch
=for apidoc_item ||isPRINT_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isPRINT_utf8|U8 * s|U8 * end
=for apidoc_item ||isPRINT_LC|UV ch
=for apidoc_item ||isPRINT_LC_uvchr|UV ch
=for apidoc_item ||isPRINT_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character is a
printable character, analogous to C<m/[[:print:]]/>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=for apidoc Am|bool|isWORDCHAR|UV ch
=for apidoc_item ||isWORDCHAR_A|UV ch
=for apidoc_item ||isWORDCHAR_L1|UV ch
=for apidoc_item ||isWORDCHAR_uvchr|UV ch
=for apidoc_item ||isWORDCHAR_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isWORDCHAR_utf8|U8 * s|U8 * end
=for apidoc_item ||isWORDCHAR_LC|UV ch
=for apidoc_item ||isWORDCHAR_LC_uvchr|UV ch
=for apidoc_item ||isWORDCHAR_LC_utf8_safe|U8 * s| U8 *end
=for apidoc_item ||isALNUM|UV ch
=for apidoc_item ||isALNUM_A|UV ch
=for apidoc_item ||isALNUM_LC|UV ch
=for apidoc_item ||isALNUM_LC_uvchr|UV ch
Returns a boolean indicating whether the specified character is a character
that is a word character, analogous to what C<m/\w/> and C<m/[[:word:]]/> match
in a regular expression.  A word character is an alphabetic character, a
decimal digit, a connecting punctuation character (such as an underscore), or
a "mark" character that attaches to one of those (like some sort of accent).
C<isALNUM()> is a synonym provided for backward compatibility, even though a
word character includes more than the standard C language meaning of
alphanumeric.
See the L<top of this section|/Character classification> for an explanation of
the variants.
C<isWORDCHAR_A>, C<isWORDCHAR_L1>, C<isWORDCHAR_uvchr>,
C<isWORDCHAR_LC>, C<isWORDCHAR_LC_uvchr>, C<isWORDCHAR_LC_utf8>, and
C<isWORDCHAR_LC_utf8_safe> are also as described there, but additionally
include the platform's native underscore.

=for apidoc Am|bool|isXDIGIT|UV ch
=for apidoc_item ||isXDIGIT_A|UV ch
=for apidoc_item ||isXDIGIT_L1|UV ch
=for apidoc_item ||isXDIGIT_uvchr|UV ch
=for apidoc_item ||isXDIGIT_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isXDIGIT_utf8|U8 * s|U8 * end
=for apidoc_item ||isXDIGIT_LC|UV ch
=for apidoc_item ||isXDIGIT_LC_uvchr|UV ch
=for apidoc_item ||isXDIGIT_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character is a hexadecimal
digit.  In the ASCII range these are C<[0-9A-Fa-f]>.  Variants C<isXDIGIT_A()>
and C<isXDIGIT_L1()> are identical to C<isXDIGIT()>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=for apidoc Am|bool|isIDFIRST|UV ch
=for apidoc_item ||isIDFIRST_A|UV ch
=for apidoc_item ||isIDFIRST_L1|UV ch
=for apidoc_item ||isIDFIRST_uvchr|UV ch
=for apidoc_item ||isIDFIRST_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isIDFIRST_utf8|U8 * s|U8 * end
=for apidoc_item ||isIDFIRST_LC|UV ch
=for apidoc_item ||isIDFIRST_LC_uvchr|UV ch
=for apidoc_item ||isIDFIRST_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character can be the first
character of an identifier.  This is very close to, but not quite the same as
the official Unicode property C<XID_Start>.  The difference is that this
returns true only if the input character also matches L</isWORDCHAR>.
See the L<top of this section|/Character classification> for an explanation of
the variants.

=for apidoc Am|bool|isIDCONT|UV ch
=for apidoc_item ||isIDCONT_A|UV ch
=for apidoc_item ||isIDCONT_L1|UV ch
=for apidoc_item ||isIDCONT_uvchr|UV ch
=for apidoc_item ||isIDCONT_utf8_safe|U8 * s|U8 * end
=for apidoc_item ||isIDCONT_utf8|U8 * s|U8 * end
=for apidoc_item ||isIDCONT_LC|UV ch
=for apidoc_item ||isIDCONT_LC_uvchr|UV ch
=for apidoc_item ||isIDCONT_LC_utf8_safe|U8 * s| U8 *end
Returns a boolean indicating whether the specified character can be the
second or succeeding character of an identifier.  This is very close to, but
not quite the same as the official Unicode property C<XID_Continue>.  The
difference is that this returns true only if the input character also matches
L</isWORDCHAR>.  See the L<top of this section|/Character classification> for
an explanation of the variants.

=for apidoc_section $numeric

=for apidoc Am|U8|READ_XDIGIT|char str*
Returns the value of an ASCII-range hex digit and advances the string pointer.
Behaviour is only well defined when isXDIGIT(*str) is true.

=head1 Character case changing
Perl uses "full" Unicode case mappings.  This means that converting a single
character to another case may result in a sequence of more than one character.
For example, the uppercase of C<E<223>> (LATIN SMALL LETTER SHARP S) is the two
character sequence C<SS>.  This presents some complications   The lowercase of
all characters in the range 0..255 is a single character, and thus
C<L</toLOWER_L1>> is furnished.  But, C<toUPPER_L1> can't exist, as it couldn't
return a valid result for all legal inputs.  Instead C<L</toUPPER_uvchr>> has
an API that does allow every possible legal result to be returned.)  Likewise
no other function that is crippled by not being able to give the correct
results for the full range of possible inputs has been implemented here.

=for apidoc Am|UV|toUPPER|UV cp
=for apidoc_item |UV|toUPPER_A|UV cp
=for apidoc_item |UV|toUPPER_uvchr|UV cp|U8* s|STRLEN* lenp
=for apidoc_item |UV|toUPPER_utf8|U8* p|U8* e|U8* s|STRLEN* lenp
=for apidoc_item |UV|toUPPER_utf8_safe|U8* p|U8* e|U8* s|STRLEN* lenp

These all return the uppercase of a character.  The differences are what domain
they operate on, and whether the input is specified as a code point (those
forms with a C<cp> parameter) or as a UTF-8 string (the others).  In the latter
case, the code point to use is the first one in the buffer of UTF-8 encoded
code points, delineated by the arguments S<C<p .. e - 1>>.

C<toUPPER> and C<toUPPER_A> are synonyms of each other.  They return the
uppercase of any lowercase ASCII-range code point.  All other inputs are
returned unchanged.  Since these are macros, the input type may be any integral
one, and the output will occupy the same number of bits as the input.

There is no C<toUPPER_L1> nor C<toUPPER_LATIN1> as the uppercase of some code
points in the 0..255 range is above that range or consists of multiple
characters.  Instead use C<toUPPER_uvchr>.

C<toUPPER_uvchr> returns the uppercase of any Unicode code point.  The return
value is identical to that of C<toUPPER_A> for input code points in the ASCII
range.  The uppercase of the vast majority of Unicode code points is the same
as the code point itself.  For these, and for code points above the legal
Unicode maximum, this returns the input code point unchanged.  It additionally
stores the UTF-8 of the result into the buffer beginning at C<s>, and its
length in bytes into C<*lenp>.  The caller must have made C<s> large enough to
contain at least C<UTF8_MAXBYTES_CASE+1> bytes to avoid possible overflow.

NOTE: the uppercase of a code point may be more than one code point.  The
return value of this function is only the first of these.  The entire uppercase
is returned in C<s>.  To determine if the result is more than a single code
point, you can do something like this:

 uc = toUPPER_uvchr(cp, s, &len);
 if (len > UTF8SKIP(s)) { is multiple code points }
 else { is a single code point }

C<toUPPER_utf8> and C<toUPPER_utf8_safe> are synonyms of each other.  The only
difference between these and C<toUPPER_uvchr> is that the source for these is
encoded in UTF-8, instead of being a code point.  It is passed as a buffer
starting at C<p>, with C<e> pointing to one byte beyond its end.  The C<p>
buffer may certainly contain more than one code point; but only the first one
(up through S<C<e - 1>>) is examined.  If the UTF-8 for the input character is
malformed in some way, the program may croak, or the function may return the
REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to
change in future releases.

=for apidoc Am|UV|toFOLD|UV cp
=for apidoc_item |UV|toFOLD_A|UV cp
=for apidoc_item |UV|toFOLD_uvchr|UV cp|U8* s|STRLEN* lenp
=for apidoc_item |UV|toFOLD_utf8|U8* p|U8* e|U8* s|STRLEN* lenp
=for apidoc_item |UV|toFOLD_utf8_safe|U8* p|U8* e|U8* s|STRLEN* lenp

These all return the foldcase of a character.  "foldcase" is an internal case
for C</i> pattern matching. If the foldcase of character A and the foldcase of
character B are the same, they match caselessly; otherwise they don't.

The differences in the forms are what domain they operate on, and whether the
input is specified as a code point (those forms with a C<cp> parameter) or as a
UTF-8 string (the others).  In the latter case, the code point to use is the
first one in the buffer of UTF-8 encoded code points, delineated by the
arguments S<C<p .. e - 1>>.

C<toFOLD> and C<toFOLD_A> are synonyms of each other.  They return the
foldcase of any ASCII-range code point.  In this range, the foldcase is
identical to the lowercase.  All other inputs are returned unchanged.  Since
these are macros, the input type may be any integral one, and the output will
occupy the same number of bits as the input.

There is no C<toFOLD_L1> nor C<toFOLD_LATIN1> as the foldcase of some code
points in the 0..255 range is above that range or consists of multiple
characters.  Instead use C<toFOLD_uvchr>.

C<toFOLD_uvchr> returns the foldcase of any Unicode code point.  The return
value is identical to that of C<toFOLD_A> for input code points in the ASCII
range.  The foldcase of the vast majority of Unicode code points is the same
as the code point itself.  For these, and for code points above the legal
Unicode maximum, this returns the input code point unchanged.  It additionally
stores the UTF-8 of the result into the buffer beginning at C<s>, and its
length in bytes into C<*lenp>.  The caller must have made C<s> large enough to
contain at least C<UTF8_MAXBYTES_CASE+1> bytes to avoid possible overflow.

NOTE: the foldcase of a code point may be more than one code point.  The
return value of this function is only the first of these.  The entire foldcase
is returned in C<s>.  To determine if the result is more than a single code
point, you can do something like this:

 uc = toFOLD_uvchr(cp, s, &len);
 if (len > UTF8SKIP(s)) { is multiple code points }
 else { is a single code point }

C<toFOLD_utf8> and C<toFOLD_utf8_safe> are synonyms of each other.  The only
difference between these and C<toFOLD_uvchr> is that the source for these is
encoded in UTF-8, instead of being a code point.  It is passed as a buffer
starting at C<p>, with C<e> pointing to one byte beyond its end.  The C<p>
buffer may certainly contain more than one code point; but only the first one
(up through S<C<e - 1>>) is examined.  If the UTF-8 for the input character is
malformed in some way, the program may croak, or the function may return the
REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to
change in future releases.

=for apidoc Am|UV|toLOWER|UV cp
=for apidoc_item |UV|toLOWER_A|UV cp
=for apidoc_item |UV|toLOWER_L1|UV cp
=for apidoc_item |UV|toLOWER_LATIN1|UV cp
=for apidoc_item |UV|toLOWER_LC|UV cp
=for apidoc_item |UV|toLOWER_uvchr|UV cp|U8* s|STRLEN* lenp
=for apidoc_item |UV|toLOWER_utf8|U8* p|U8* e|U8* s|STRLEN* lenp
=for apidoc_item |UV|toLOWER_utf8_safe|U8* p|U8* e|U8* s|STRLEN* lenp

These all return the lowercase of a character.  The differences are what domain
they operate on, and whether the input is specified as a code point (those
forms with a C<cp> parameter) or as a UTF-8 string (the others).  In the latter
case, the code point to use is the first one in the buffer of UTF-8 encoded
code points, delineated by the arguments S<C<p .. e - 1>>.

C<toLOWER> and C<toLOWER_A> are synonyms of each other.  They return the
lowercase of any uppercase ASCII-range code point.  All other inputs are
returned unchanged.  Since these are macros, the input type may be any integral
one, and the output will occupy the same number of bits as the input.

C<toLOWER_L1> and C<toLOWER_LATIN1> are synonyms of each other.  They behave
identically as C<toLOWER> for ASCII-range input.  But additionally will return
the lowercase of any uppercase code point in the entire 0..255 range, assuming
a Latin-1 encoding (or the EBCDIC equivalent on such platforms).

C<toLOWER_LC> returns the lowercase of the input code point according to the
rules of the current POSIX locale.  Input code points outside the range 0..255
are returned unchanged.

C<toLOWER_uvchr> returns the lowercase of any Unicode code point.  The return
value is identical to that of C<toLOWER_L1> for input code points in the 0..255
range.  The lowercase of the vast majority of Unicode code points is the same
as the code point itself.  For these, and for code points above the legal
Unicode maximum, this returns the input code point unchanged.  It additionally
stores the UTF-8 of the result into the buffer beginning at C<s>, and its
length in bytes into C<*lenp>.  The caller must have made C<s> large enough to
contain at least C<UTF8_MAXBYTES_CASE+1> bytes to avoid possible overflow.

NOTE: the lowercase of a code point may be more than one code point.  The
return value of this function is only the first of these.  The entire lowercase
is returned in C<s>.  To determine if the result is more than a single code
point, you can do something like this:

 uc = toLOWER_uvchr(cp, s, &len);
 if (len > UTF8SKIP(s)) { is multiple code points }
 else { is a single code point }

C<toLOWER_utf8> and C<toLOWER_utf8_safe> are synonyms of each other.  The only
difference between these and C<toLOWER_uvchr> is that the source for these is
encoded in UTF-8, instead of being a code point.  It is passed as a buffer
starting at C<p>, with C<e> pointing to one byte beyond its end.  The C<p>
buffer may certainly contain more than one code point; but only the first one
(up through S<C<e - 1>>) is examined.  If the UTF-8 for the input character is
malformed in some way, the program may croak, or the function may return the
REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to
change in future releases.

=for apidoc Am|UV|toTITLE|UV cp
=for apidoc_item |UV|toTITLE_A|UV cp
=for apidoc_item |UV|toTITLE_uvchr|UV cp|U8* s|STRLEN* lenp
=for apidoc_item |UV|toTITLE_utf8|U8* p|U8* e|U8* s|STRLEN* lenp
=for apidoc_item |UV|toTITLE_utf8_safe|U8* p|U8* e|U8* s|STRLEN* lenp

These all return the titlecase of a character.  The differences are what domain
they operate on, and whether the input is specified as a code point (those
forms with a C<cp> parameter) or as a UTF-8 string (the others).  In the latter
case, the code point to use is the first one in the buffer of UTF-8 encoded
code points, delineated by the arguments S<C<p .. e - 1>>.

C<toTITLE> and C<toTITLE_A> are synonyms of each other.  They return the
titlecase of any lowercase ASCII-range code point.  In this range, the
titlecase is identical to the uppercase.  All other inputs are returned
unchanged.  Since these are macros, the input type may be any integral one, and
the output will occupy the same number of bits as the input.

There is no C<toTITLE_L1> nor C<toTITLE_LATIN1> as the titlecase of some code
points in the 0..255 range is above that range or consists of multiple
characters.  Instead use C<toTITLE_uvchr>.

C<toTITLE_uvchr> returns the titlecase of any Unicode code point.  The return
value is identical to that of C<toTITLE_A> for input code points in the ASCII
range.  The titlecase of the vast majority of Unicode code points is the same
as the code point itself.  For these, and for code points above the legal
Unicode maximum, this returns the input code point unchanged.  It additionally
stores the UTF-8 of the result into the buffer beginning at C<s>, and its
length in bytes into C<*lenp>.  The caller must have made C<s> large enough to
contain at least C<UTF8_MAXBYTES_CASE+1> bytes to avoid possible overflow.

NOTE: the titlecase of a code point may be more than one code point.  The
return value of this function is only the first of these.  The entire titlecase
is returned in C<s>.  To determine if the result is more than a single code
point, you can do something like this:

 uc = toTITLE_uvchr(cp, s, &len);
 if (len > UTF8SKIP(s)) { is multiple code points }
 else { is a single code point }

C<toTITLE_utf8> and C<toTITLE_utf8_safe> are synonyms of each other.  The only
difference between these and C<toTITLE_uvchr> is that the source for these is
encoded in UTF-8, instead of being a code point.  It is passed as a buffer
starting at C<p>, with C<e> pointing to one byte beyond its end.  The C<p>
buffer may certainly contain more than one code point; but only the first one
(up through S<C<e - 1>>) is examined.  If the UTF-8 for the input character is
malformed in some way, the program may croak, or the function may return the
REPLACEMENT CHARACTER, at the discretion of the implementation, and subject to
change in future releases.

=cut

XXX Still undocumented isVERTWS_uvchr and _utf8; it's unclear what their names
really should be.  Also toUPPER_LC and toFOLD_LC, which are subject to change,
and aren't general purpose as they don't work on U+DF, and assert against that.

Note that these macros are repeated in Devel::PPPort, so should also be
patched there.  The file as of this writing is cpan/Devel-PPPort/parts/inc/misc

*/

/*
   void below because that's the best fit, and works for Devel::PPPort
=for apidoc_section $integer
=for apidoc AyT||WIDEST_UTYPE

Yields the widest unsigned integer type on the platform, currently either
C<U32> or C<U64>.  This can be used in declarations such as

 WIDEST_UTYPE my_uv;

or casts

 my_uv = (WIDEST_UTYPE) val;

=cut

*/
#ifdef QUADKIND
#   define WIDEST_UTYPE U64
#else
#   define WIDEST_UTYPE U32
#endif

/* Where there could be some confusion, use this as a static assert in macros
 * to make sure that a parameter isn't a pointer.  But some compilers can't
 * handle this.  The only one known so far that doesn't is gcc 3.3.6; the check
 * below isn't thorough for such an old compiler, so may have to be revised if
 * experience so dictates. */
#if  ! PERL_IS_GCC || PERL_GCC_VERSION_GT(3,3,6)
#  define ASSERT_NOT_PTR(x) ((x) | 0)
#else
#  define ASSERT_NOT_PTR(x) (x)
#endif

/* Likewise, this is effectively a static assert to be used to guarantee the
 * parameter is a pointer */
#define ASSERT_IS_PTR(x) (__ASSERT_(sizeof(*(x))) (x))

/* FITS_IN_8_BITS(c) returns true if c doesn't have  a bit set other than in
 * the lower 8.  It is designed to be hopefully bomb-proof, making sure that no
 * bits of information are lost even on a 64-bit machine, but to get the
 * compiler to optimize it out if possible.  This is because Configure makes
 * sure that the machine has an 8-bit byte, so if c is stored in a byte, the
 * sizeof() guarantees that this evaluates to a constant true at compile time.
 *
 * For Coverity, be always true, because otherwise Coverity thinks
 * it finds several expressions that are always true, independent
 * of operands.  Well, they are, but that is kind of the point.
 */
#ifndef __COVERITY__
  /* The '| 0' part in ASSERT_NOT_PTR ensures a compiler error if c is not
   * integer (like e.g., a pointer) */
#  define FITS_IN_8_BITS(c) (   (sizeof(c) == 1)                            \
                             || (((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) >> 8) == 0)
#else
#  define FITS_IN_8_BITS(c) (1)
#endif

/* Returns true if l <= c <= (l + n), where 'l' and 'n' are non-negative
 * Written this way so that after optimization, only one conditional test is
 * needed.  (The NV casts stop any warnings about comparison always being true
 * if called with an unsigned.  The cast preserves the sign, which is all we
 * care about.) */
#define withinCOUNT(c, l, n)  (__ASSERT_((NV) (l) >= 0)                 \
                               __ASSERT_((NV) (n) >= 0)                 \
                               withinCOUNT_KNOWN_VALID_((c), (l), (n)))

/* For internal use only, this can be used in places where it is known that the
 * parameters to withinCOUNT() are valid, to avoid the asserts.  For example,
 * inRANGE() below, calls this several times, but does all the necessary
 * asserts itself, once.  The reason that this is necessary is that the
 * duplicate asserts were exceeding the internal limits of some compilers */
#define withinCOUNT_KNOWN_VALID_(c, l, n)                                   \
    ((((WIDEST_UTYPE) (c)) - ASSERT_NOT_PTR(l))                             \
                                   <= ((WIDEST_UTYPE) ASSERT_NOT_PTR(n)))

/* Returns true if c is in the range l..u, where 'l' is non-negative
 * Written this way so that after optimization, only one conditional test is
 * needed. */
#define inRANGE(c, l, u) (__ASSERT_((NV) (l) >= 0) __ASSERT_((u) >= (l))    \
   (  (sizeof(c) == sizeof(U8))  ? inRANGE_helper_(U8, (c), (l), ((u)))     \
    : (sizeof(c) == sizeof(U16)) ? inRANGE_helper_(U16,(c), (l), ((u)))     \
    : (sizeof(c) == sizeof(U32)) ? inRANGE_helper_(U32,(c), (l), ((u)))     \
             : (__ASSERT_(sizeof(c) == sizeof(WIDEST_UTYPE))                \
                          inRANGE_helper_(WIDEST_UTYPE,(c), (l), ((u))))))

/* For internal use, this is used by machine-generated code which generates
 * known valid calls, with a known sizeof().  This avoids the extra code and
 * asserts that were exceeding internal limits of some compilers. */
#define inRANGE_helper_(cast, c, l, u)                                      \
                    withinCOUNT_KNOWN_VALID_(((cast) (c)), (l), ((u) - (l)))

#ifdef EBCDIC
#   ifndef _ALL_SOURCE
        /* The native libc isascii() et.al. functions return the wrong results
         * on at least z/OS unless this is defined. */
#       error   _ALL_SOURCE should probably be defined
#   endif
#else
    /* There is a simple definition of ASCII for ASCII platforms.  But the
     * EBCDIC one isn't so simple, so is defined using table look-up like the
     * other macros below.
     *
     * The cast here is used instead of '(c) >= 0', because some compilers emit
     * a warning that that test is always true when the parameter is an
     * unsigned type.  khw supposes that it could be written as
     *      && ((c) == '\0' || (c) > 0)
     * to avoid the message, but the cast will likely avoid extra branches even
     * with stupid compilers. */
#   define isASCII(c)    (((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) < 128)
#endif

/* Take the eight possible bit patterns of the lower 3 bits and you get the
 * lower 3 bits of the 8 octal digits, in both ASCII and EBCDIC, so those bits
 * can be ignored.  If the rest match '0', we have an octal */
#define isOCTAL_A(c)  ((((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) & ~7) == '0')

#ifdef H_PERL       /* If have access to perl.h, lookup in its table */

/* Character class numbers.  For internal core Perl use only.  The ones less
 * than 32 are used in PL_charclass[] and the ones up through the one that
 * corresponds to <_HIGHEST_REGCOMP_DOT_H_SYNC> are used by regcomp.h and
 * related files.  PL_charclass ones use names used in l1_char_class_tab.h but
 * their actual definitions are here.  If that file has a name not used here,
 * it won't compile.
 *
 * The first group of these is ordered in what I (khw) estimate to be the
 * frequency of their use.  This gives a slight edge to exiting a loop earlier
 * (in reginclass() in regexec.c).  Except \v should be last, as it isn't a
 * real Posix character class, and some (small) inefficiencies in regular
 * expression handling would be introduced by putting it in the middle of those
 * that are.  Also, cntrl and ascii come after the others as it may be useful
 * to group these which have no members that match above Latin1, (or above
 * ASCII in the latter case) */

#  define _CC_WORDCHAR           0      /* \w and [:word:] */
#  define _CC_DIGIT              1      /* \d and [:digit:] */
#  define _CC_ALPHA              2      /* [:alpha:] */
#  define _CC_LOWER              3      /* [:lower:] */
#  define _CC_UPPER              4      /* [:upper:] */
#  define _CC_PUNCT              5      /* [:punct:] */
#  define _CC_PRINT              6      /* [:print:] */
#  define _CC_ALPHANUMERIC       7      /* [:alnum:] */
#  define _CC_GRAPH              8      /* [:graph:] */
#  define _CC_CASED              9      /* [:lower:] or [:upper:] under /i */
#  define _CC_SPACE             10      /* \s, [:space:] */
#  define _CC_BLANK             11      /* [:blank:] */
#  define _CC_XDIGIT            12      /* [:xdigit:] */
#  define _CC_CNTRL             13      /* [:cntrl:] */
#  define _CC_ASCII             14      /* [:ascii:] */
#  define _CC_VERTSPACE         15      /* \v */

#  define _HIGHEST_REGCOMP_DOT_H_SYNC _CC_VERTSPACE

/* The members of the third group below do not need to be coordinated with data
 * structures in regcomp.[ch] and regexec.c. */
#  define _CC_IDFIRST                  16
#  define _CC_CHARNAME_CONT            17
#  define _CC_NONLATIN1_FOLD           18
#  define _CC_NONLATIN1_SIMPLE_FOLD    19
#  define _CC_QUOTEMETA                20
#  define _CC_NON_FINAL_FOLD           21
#  define _CC_IS_IN_SOME_FOLD          22
#  define _CC_BINDIGIT                 23
#  define _CC_OCTDIGIT                 24
#  define _CC_MNEMONIC_CNTRL           25

/* Unused: 26-31
 * If more bits are needed, one could add a second word for non-64bit
 * QUAD_IS_INT systems, using some #ifdefs to distinguish between having a 2nd
 * word or not.  The IS_IN_SOME_FOLD bit is the most easily expendable, as it
 * is used only for optimization (as of this writing), and differs in the
 * Latin1 range from the ALPHA bit only in two relatively unimportant
 * characters: the masculine and feminine ordinal indicators, so removing it
 * would just cause /i regexes which match them to run less efficiently.
 * Similarly the EBCDIC-only bits are used just for speed, and could be
 * replaced by other means */

#if defined(PERL_CORE) || defined(PERL_EXT)
/* An enum version of the character class numbers, to help compilers
 * optimize */
typedef enum {
    _CC_ENUM_ALPHA          = _CC_ALPHA,
    _CC_ENUM_ALPHANUMERIC   = _CC_ALPHANUMERIC,
    _CC_ENUM_ASCII          = _CC_ASCII,
    _CC_ENUM_BLANK          = _CC_BLANK,
    _CC_ENUM_CASED          = _CC_CASED,
    _CC_ENUM_CNTRL          = _CC_CNTRL,
    _CC_ENUM_DIGIT          = _CC_DIGIT,
    _CC_ENUM_GRAPH          = _CC_GRAPH,
    _CC_ENUM_LOWER          = _CC_LOWER,
    _CC_ENUM_PRINT          = _CC_PRINT,
    _CC_ENUM_PUNCT          = _CC_PUNCT,
    _CC_ENUM_SPACE          = _CC_SPACE,
    _CC_ENUM_UPPER          = _CC_UPPER,
    _CC_ENUM_VERTSPACE      = _CC_VERTSPACE,
    _CC_ENUM_WORDCHAR       = _CC_WORDCHAR,
    _CC_ENUM_XDIGIT         = _CC_XDIGIT
} _char_class_number;
#endif

#define POSIX_CC_COUNT    (_HIGHEST_REGCOMP_DOT_H_SYNC + 1)

START_EXTERN_C
#  ifdef DOINIT
EXTCONST  U32 PL_charclass[] = {
#    include "l1_char_class_tab.h"
};

#  else /* ! DOINIT */
EXTCONST U32 PL_charclass[];
#  endif
END_EXTERN_C

    /* The 1U keeps Solaris from griping when shifting sets the uppermost bit */
#   define _CC_mask(classnum) (1U << (classnum))

    /* For internal core Perl use only: the base macro for defining macros like
     * isALPHA */
#   define _generic_isCC(c, classnum) cBOOL(FITS_IN_8_BITS(c)    \
                && (PL_charclass[(U8) (c)] & _CC_mask(classnum)))

    /* The mask for the _A versions of the macros; it just adds in the bit for
     * ASCII. */
#   define _CC_mask_A(classnum) (_CC_mask(classnum) | _CC_mask(_CC_ASCII))

    /* For internal core Perl use only: the base macro for defining macros like
     * isALPHA_A.  The foo_A version makes sure that both the desired bit and
     * the ASCII bit are present */
#   define _generic_isCC_A(c, classnum) (FITS_IN_8_BITS(c)      \
        && ((PL_charclass[(U8) (c)] & _CC_mask_A(classnum))     \
                                   == _CC_mask_A(classnum)))

/* On ASCII platforms certain classes form a single range.  It's faster to
 * special case these.  isDIGIT is a single range on all platforms */
#   ifdef EBCDIC
#     define isALPHA_A(c)  _generic_isCC_A(c, _CC_ALPHA)
#     define isGRAPH_A(c)  _generic_isCC_A(c, _CC_GRAPH)
#     define isLOWER_A(c)  _generic_isCC_A(c, _CC_LOWER)
#     define isPRINT_A(c)  _generic_isCC_A(c, _CC_PRINT)
#     define isUPPER_A(c)  _generic_isCC_A(c, _CC_UPPER)
#   else
      /* By folding the upper and lowercase, we can use a single range */
#     define isALPHA_A(c)  inRANGE((~('A' ^ 'a') & (c)), 'A', 'Z')
#     define isGRAPH_A(c)  inRANGE(c, ' ' + 1, 0x7e)
#     define isLOWER_A(c)  inRANGE(c, 'a', 'z')
#     define isPRINT_A(c)  inRANGE(c, ' ', 0x7e)
#     define isUPPER_A(c)  inRANGE(c, 'A', 'Z')
#   endif
#   define isALPHANUMERIC_A(c) _generic_isCC_A(c, _CC_ALPHANUMERIC)
#   define isBLANK_A(c)  _generic_isCC_A(c, _CC_BLANK)
#   define isCNTRL_A(c)  _generic_isCC_A(c, _CC_CNTRL)
#   define isDIGIT_A(c)  inRANGE(c, '0', '9')
#   define isPUNCT_A(c)  _generic_isCC_A(c, _CC_PUNCT)
#   define isSPACE_A(c)  _generic_isCC_A(c, _CC_SPACE)
#   define isWORDCHAR_A(c) _generic_isCC_A(c, _CC_WORDCHAR)
#   define isXDIGIT_A(c)  _generic_isCC(c, _CC_XDIGIT) /* No non-ASCII xdigits
                                                        */
#   define isIDFIRST_A(c) _generic_isCC_A(c, _CC_IDFIRST)
#   define isALPHA_L1(c)  _generic_isCC(c, _CC_ALPHA)
#   define isALPHANUMERIC_L1(c) _generic_isCC(c, _CC_ALPHANUMERIC)
#   define isBLANK_L1(c)  _generic_isCC(c, _CC_BLANK)

    /* continuation character for legal NAME in \N{NAME} */
#   define isCHARNAME_CONT(c) _generic_isCC(c, _CC_CHARNAME_CONT)

#   define isCNTRL_L1(c)  _generic_isCC(c, _CC_CNTRL)
#   define isGRAPH_L1(c)  _generic_isCC(c, _CC_GRAPH)
#   define isLOWER_L1(c)  _generic_isCC(c, _CC_LOWER)
#   define isPRINT_L1(c)  _generic_isCC(c, _CC_PRINT)
#   define isPSXSPC_L1(c)  isSPACE_L1(c)
#   define isPUNCT_L1(c)  _generic_isCC(c, _CC_PUNCT)
#   define isSPACE_L1(c)  _generic_isCC(c, _CC_SPACE)
#   define isUPPER_L1(c)  _generic_isCC(c, _CC_UPPER)
#   define isWORDCHAR_L1(c) _generic_isCC(c, _CC_WORDCHAR)
#   define isIDFIRST_L1(c) _generic_isCC(c, _CC_IDFIRST)

#   ifdef EBCDIC
#       define isASCII(c) _generic_isCC(c, _CC_ASCII)
#   endif

    /* Participates in a single-character fold with a character above 255 */
#   if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C)
#     define HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE(c)                          \
        ((   ! cBOOL(FITS_IN_8_BITS(c)))                                    \
          || (PL_charclass[(U8) (c)] & _CC_mask(_CC_NONLATIN1_SIMPLE_FOLD)))

#   define IS_NON_FINAL_FOLD(c)   _generic_isCC(c, _CC_NON_FINAL_FOLD)
#   define IS_IN_SOME_FOLD_L1(c)  _generic_isCC(c, _CC_IS_IN_SOME_FOLD)
#  endif

    /* Like the above, but also can be part of a multi-char fold */
#   define HAS_NONLATIN1_FOLD_CLOSURE(c)                                    \
      (   (! cBOOL(FITS_IN_8_BITS(c)))                                      \
       || (PL_charclass[(U8) (c)] & _CC_mask(_CC_NONLATIN1_FOLD)))

#   define _isQUOTEMETA(c) _generic_isCC(c, _CC_QUOTEMETA)

/* is c a control character for which we have a mnemonic? */
#  if defined(PERL_CORE) || defined(PERL_EXT)
#     define isMNEMONIC_CNTRL(c) _generic_isCC(c, _CC_MNEMONIC_CNTRL)
#  endif
#else   /* else we don't have perl.h H_PERL */

    /* If we don't have perl.h, we are compiling a utility program.  Below we
     * hard-code various macro definitions that wouldn't otherwise be available
     * to it. Most are coded based on first principles.  These are written to
     * avoid EBCDIC vs. ASCII #ifdef's as much as possible. */
#   define isDIGIT_A(c)  inRANGE(c, '0', '9')
#   define isBLANK_A(c)  ((c) == ' ' || (c) == '\t')
#   define isSPACE_A(c)  (isBLANK_A(c)                                   \
                          || (c) == '\n'                                 \
                          || (c) == '\r'                                 \
                          || (c) == '\v'                                 \
                          || (c) == '\f')
    /* On EBCDIC, there are gaps between 'i' and 'j'; 'r' and 's'.  Same for
     * uppercase.  The tests for those aren't necessary on ASCII, but hurt only
     * performance (if optimization isn't on), and allow the same code to be
     * used for both platform types */
#   define isLOWER_A(c)  inRANGE((c), 'a', 'i')                         \
                      || inRANGE((c), 'j', 'r')                         \
                      || inRANGE((c), 's', 'z')
#   define isUPPER_A(c)  inRANGE((c), 'A', 'I')                         \
                      || inRANGE((c), 'J', 'R')                         \
                      || inRANGE((c), 'S', 'Z')
#   define isALPHA_A(c)  (isUPPER_A(c) || isLOWER_A(c))
#   define isALPHANUMERIC_A(c) (isALPHA_A(c) || isDIGIT_A(c))
#   define isWORDCHAR_A(c)   (isALPHANUMERIC_A(c) || (c) == '_')
#   define isIDFIRST_A(c)    (isALPHA_A(c) || (c) == '_')
#   define isXDIGIT_A(c) (   isDIGIT_A(c)                               \
                          || inRANGE((c), 'a', 'f')                     \
                          || inRANGE((c), 'A', 'F')
#   define isPUNCT_A(c)  ((c) == '-' || (c) == '!' || (c) == '"'        \
                       || (c) == '#' || (c) == '$' || (c) == '%'        \
                       || (c) == '&' || (c) == '\'' || (c) == '('       \
                       || (c) == ')' || (c) == '*' || (c) == '+'        \
                       || (c) == ',' || (c) == '.' || (c) == '/'        \
                       || (c) == ':' || (c) == ';' || (c) == '<'        \
                       || (c) == '=' || (c) == '>' || (c) == '?'        \
                       || (c) == '@' || (c) == '[' || (c) == '\\'       \
                       || (c) == ']' || (c) == '^' || (c) == '_'        \
                       || (c) == '`' || (c) == '{' || (c) == '|'        \
                       || (c) == '}' || (c) == '~')
#   define isGRAPH_A(c)  (isALPHANUMERIC_A(c) || isPUNCT_A(c))
#   define isPRINT_A(c)  (isGRAPH_A(c) || (c) == ' ')

#   ifdef EBCDIC
        /* The below is accurate for the 3 EBCDIC code pages traditionally
         * supported by perl.  The only difference between them in the controls
         * is the position of \n, and that is represented symbolically below */
#       define isCNTRL_A(c)  ((c) == '\0' || (c) == '\a' || (c) == '\b'     \
                          ||  (c) == '\f' || (c) == '\n' || (c) == '\r'     \
                          ||  (c) == '\t' || (c) == '\v'                    \
                          || inRANGE((c), 1, 3)     /* SOH, STX, ETX */     \
                          ||  (c) == 7F   /* U+7F DEL */                    \
                          || inRANGE((c), 0x0E, 0x13) /* SO SI DLE          \
                                                         DC[1-3] */         \
                          ||  (c) == 0x18 /* U+18 CAN */                    \
                          ||  (c) == 0x19 /* U+19 EOM */                    \
                          || inRANGE((c), 0x1C, 0x1F) /* [FGRU]S */         \
                          ||  (c) == 0x26 /* U+17 ETB */                    \
                          ||  (c) == 0x27 /* U+1B ESC */                    \
                          ||  (c) == 0x2D /* U+05 ENQ */                    \
                          ||  (c) == 0x2E /* U+06 ACK */                    \
                          ||  (c) == 0x32 /* U+16 SYN */                    \
                          ||  (c) == 0x37 /* U+04 EOT */                    \
                          ||  (c) == 0x3C /* U+14 DC4 */                    \
                          ||  (c) == 0x3D /* U+15 NAK */                    \
                          ||  (c) == 0x3F)/* U+1A SUB */
#       define isASCII(c)    (isCNTRL_A(c) || isPRINT_A(c))
#   else /* isASCII is already defined for ASCII platforms, so can use that to
            define isCNTRL */
#       define isCNTRL_A(c)  (isASCII(c) && ! isPRINT_A(c))
#   endif

    /* The _L1 macros may be unnecessary for the utilities; I (khw) added them
     * during debugging, and it seems best to keep them.  We may be called
     * without NATIVE_TO_LATIN1 being defined.  On ASCII platforms, it doesn't
     * do anything anyway, so make it not a problem */
#   if ! defined(EBCDIC) && ! defined(NATIVE_TO_LATIN1)
#       define NATIVE_TO_LATIN1(ch) (ch)
#   endif
#   define isALPHA_L1(c)     (isUPPER_L1(c) || isLOWER_L1(c))
#   define isALPHANUMERIC_L1(c) (isALPHA_L1(c) || isDIGIT_A(c))
#   define isBLANK_L1(c)     (isBLANK_A(c)                                   \
                              || (FITS_IN_8_BITS(c)                          \
                                  && NATIVE_TO_LATIN1((U8) c) == 0xA0))
#   define isCNTRL_L1(c)     (FITS_IN_8_BITS(c) && (! isPRINT_L1(c)))
#   define isGRAPH_L1(c)     (isPRINT_L1(c) && (! isBLANK_L1(c)))
#   define isLOWER_L1(c)     (isLOWER_A(c)                                   \
                              || (FITS_IN_8_BITS(c)                          \
                                  && ((   NATIVE_TO_LATIN1((U8) c) >= 0xDF   \
                                       && NATIVE_TO_LATIN1((U8) c) != 0xF7)  \
                                       || NATIVE_TO_LATIN1((U8) c) == 0xAA   \
                                       || NATIVE_TO_LATIN1((U8) c) == 0xBA   \
                                       || NATIVE_TO_LATIN1((U8) c) == 0xB5)))
#   define isPRINT_L1(c)     (isPRINT_A(c)                                   \
                              || (FITS_IN_8_BITS(c)                          \
                                  && NATIVE_TO_LATIN1((U8) c) >= 0xA0))
#   define isPUNCT_L1(c)     (isPUNCT_A(c)                                   \
                              || (FITS_IN_8_BITS(c)                          \
                                  && (   NATIVE_TO_LATIN1((U8) c) == 0xA1    \
                                      || NATIVE_TO_LATIN1((U8) c) == 0xA7    \
                                      || NATIVE_TO_LATIN1((U8) c) == 0xAB    \
                                      || NATIVE_TO_LATIN1((U8) c) == 0xB6    \
                                      || NATIVE_TO_LATIN1((U8) c) == 0xB7    \
                                      || NATIVE_TO_LATIN1((U8) c) == 0xBB    \
                                      || NATIVE_TO_LATIN1((U8) c) == 0xBF)))
#   define isSPACE_L1(c)     (isSPACE_A(c)                                   \
                              || (FITS_IN_8_BITS(c)                          \
                                  && (   NATIVE_TO_LATIN1((U8) c) == 0x85    \
                                      || NATIVE_TO_LATIN1((U8) c) == 0xA0)))
#   define isUPPER_L1(c)     (isUPPER_A(c)                                   \
                              || (FITS_IN_8_BITS(c)                          \
                                  && (   IN_RANGE(NATIVE_TO_LATIN1((U8) c),  \
                                                  0xC0, 0xDE)                \
                                      && NATIVE_TO_LATIN1((U8) c) != 0xD7)))
#   define isWORDCHAR_L1(c)  (isIDFIRST_L1(c) || isDIGIT_A(c))
#   define isIDFIRST_L1(c)   (isALPHA_L1(c) || NATIVE_TO_LATIN1(c) == '_')
#   define isCHARNAME_CONT(c) (isWORDCHAR_L1(c)                              \
                               || isBLANK_L1(c)                              \
                               || (c) == '-'                                 \
                               || (c) == '('                                 \
                               || (c) == ')')
    /* The following are not fully accurate in the above-ASCII range.  I (khw)
     * don't think it's necessary to be so for the purposes where this gets
     * compiled */
#   define _isQUOTEMETA(c)      (FITS_IN_8_BITS(c) && ! isWORDCHAR_L1(c))
#   define _IS_IN_SOME_FOLD_ONLY_FOR_USE_BY_REGCOMP_DOT_C(c) isALPHA_L1(c)

    /*  And these aren't accurate at all.  They are useful only for above
     *  Latin1, which utilities and bootstrapping don't deal with */
#   define _IS_NON_FINAL_FOLD_ONLY_FOR_USE_BY_REGCOMP_DOT_C(c) 0
#   define _HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) 0
#   define _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(c) 0

    /* Many of the macros later in this file are defined in terms of these.  By
     * implementing them with a function, which converts the class number into
     * a call to the desired macro, all of the later ones work.  However, that
     * function won't be actually defined when building a utility program (no
     * perl.h), and so a compiler error will be generated if one is attempted
     * to be used.  And the above-Latin1 code points require Unicode tables to
     * be present, something unlikely to be the case when bootstrapping */
#   define _generic_isCC(c, classnum)                                        \
         (FITS_IN_8_BITS(c) && S_bootstrap_ctype((U8) (c), (classnum), TRUE))
#   define _generic_isCC_A(c, classnum)                                      \
         (FITS_IN_8_BITS(c) && S_bootstrap_ctype((U8) (c), (classnum), FALSE))
#endif  /* End of no perl.h H_PERL */

#define isALPHANUMERIC(c)  isALPHANUMERIC_A(c)
#define isALPHA(c)   isALPHA_A(c)
#define isASCII_A(c)  isASCII(c)
#define isASCII_L1(c)  isASCII(c)
#define isBLANK(c)   isBLANK_A(c)
#define isCNTRL(c)   isCNTRL_A(c)
#define isDIGIT(c)   isDIGIT_A(c)
#define isGRAPH(c)   isGRAPH_A(c)
#define isIDFIRST(c) isIDFIRST_A(c)
#define isLOWER(c)   isLOWER_A(c)
#define isPRINT(c)   isPRINT_A(c)
#define isPSXSPC_A(c) isSPACE_A(c)
#define isPSXSPC(c)  isPSXSPC_A(c)
#define isPSXSPC_L1(c) isSPACE_L1(c)
#define isPUNCT(c)   isPUNCT_A(c)
#define isSPACE(c)   isSPACE_A(c)
#define isUPPER(c)   isUPPER_A(c)
#define isWORDCHAR(c) isWORDCHAR_A(c)
#define isXDIGIT(c)  isXDIGIT_A(c)

/* ASCII casing.  These could also be written as
    #define toLOWER(c) (isASCII(c) ? toLOWER_LATIN1(c) : (c))
    #define toUPPER(c) (isASCII(c) ? toUPPER_LATIN1_MOD(c) : (c))
   which uses table lookup and mask instead of subtraction.  (This would
   work because the _MOD does not apply in the ASCII range).

   These actually are UTF-8 invariant casing, not just ASCII, as any non-ASCII
   UTF-8 invariants are neither upper nor lower.  (Only on EBCDIC platforms are
   there non-ASCII invariants, and all of them are controls.) */
#define toLOWER(c)  (isUPPER(c) ? (U8)((c) + ('a' - 'A')) : (c))
#define toUPPER(c)  (isLOWER(c) ? (U8)((c) - ('a' - 'A')) : (c))

/* In the ASCII range, these are equivalent to what they're here defined to be.
 * But by creating these definitions, other code doesn't have to be aware of
 * this detail.  Actually this works for all UTF-8 invariants, not just the
 * ASCII range. (EBCDIC platforms can have non-ASCII invariants.) */
#define toFOLD(c)    toLOWER(c)
#define toTITLE(c)   toUPPER(c)

#define toLOWER_A(c) toLOWER(c)
#define toUPPER_A(c) toUPPER(c)
#define toFOLD_A(c)  toFOLD(c)
#define toTITLE_A(c) toTITLE(c)

/* Use table lookup for speed; returns the input itself if is out-of-range */
#define toLOWER_LATIN1(c)    ((! FITS_IN_8_BITS(c))                        \
                             ? (c)                                         \
                             : PL_latin1_lc[ (U8) (c) ])
#define toLOWER_L1(c)    toLOWER_LATIN1(c)  /* Synonym for consistency */

/* Modified uc.  Is correct uc except for three non-ascii chars which are
 * all mapped to one of them, and these need special handling; returns the
 * input itself if is out-of-range */
#define toUPPER_LATIN1_MOD(c) ((! FITS_IN_8_BITS(c))                       \
                               ? (c)                                       \
                               : PL_mod_latin1_uc[ (U8) (c) ])
#define IN_UTF8_CTYPE_LOCALE PL_in_utf8_CTYPE_locale

/* Use foo_LC_uvchr() instead  of these for beyond the Latin1 range */

/* For internal core Perl use only: the base macro for defining macros like
 * isALPHA_LC, which uses the current LC_CTYPE locale.  'c' is the code point
 * (0-255) to check.  In a UTF-8 locale, the result is the same as calling
 * isFOO_L1(); the 'utf8_locale_classnum' parameter is something like
 * _CC_UPPER, which gives the class number for doing this.  For non-UTF-8
 * locales, the code to actually do the test this is passed in 'non_utf8'.  If
 * 'c' is above 255, 0 is returned.  For accessing the full range of possible
 * code points under locale rules, use the macros based on _generic_LC_uvchr
 * instead of this. */
#define _generic_LC_base(c, utf8_locale_classnum, non_utf8)                    \
           (! FITS_IN_8_BITS(c)                                                \
           ? 0                                                                 \
           : IN_UTF8_CTYPE_LOCALE                                              \
             ? cBOOL(PL_charclass[(U8) (c)] & _CC_mask(utf8_locale_classnum))  \
             : cBOOL(non_utf8))

/* For internal core Perl use only: a helper macro for defining macros like
 * isALPHA_LC.  'c' is the code point (0-255) to check.  The function name to
 * actually do this test is passed in 'non_utf8_func', which is called on 'c',
 * casting 'c' to the macro _LC_CAST, which should not be parenthesized.  See
 * _generic_LC_base for more info */
#define _generic_LC(c, utf8_locale_classnum, non_utf8_func)                    \
                        _generic_LC_base(c,utf8_locale_classnum,               \
                                         non_utf8_func( (_LC_CAST) (c)))

/* For internal core Perl use only: like _generic_LC, but also returns TRUE if
 * 'c' is the platform's native underscore character */
#define _generic_LC_underscore(c,utf8_locale_classnum,non_utf8_func)           \
                        _generic_LC_base(c, utf8_locale_classnum,              \
                                         (non_utf8_func( (_LC_CAST) (c))       \
                                          || (char)(c) == '_'))

/* These next three are also for internal core Perl use only: case-change
 * helper macros.  The reason for using the PL_latin arrays is in case the
 * system function is defective; it ensures uniform results that conform to the
 * Unicod standard.   It does not handle the anomalies in UTF-8 Turkic locales */
#define _generic_toLOWER_LC(c, function, cast)  (! FITS_IN_8_BITS(c)           \
                                                ? (c)                          \
                                                : (IN_UTF8_CTYPE_LOCALE)       \
                                                  ? PL_latin1_lc[ (U8) (c) ]   \
                                                  : (cast)function((cast)(c)))

/* Note that the result can be larger than a byte in a UTF-8 locale.  It
 * returns a single value, so can't adequately return the upper case of LATIN
 * SMALL LETTER SHARP S in a UTF-8 locale (which should be a string of two
 * values "SS");  instead it asserts against that under DEBUGGING, and
 * otherwise returns its input.  It does not handle the anomalies in UTF-8
 * Turkic locales. */
#define _generic_toUPPER_LC(c, function, cast)                                 \
                    (! FITS_IN_8_BITS(c)                                       \
                    ? (c)                                                      \
                    : ((! IN_UTF8_CTYPE_LOCALE)                                \
                      ? (cast)function((cast)(c))                              \
                      : ((((U8)(c)) == MICRO_SIGN)                             \
                        ? GREEK_CAPITAL_LETTER_MU                              \
                        : ((((U8)(c)) == LATIN_SMALL_LETTER_Y_WITH_DIAERESIS)  \
                          ? LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS              \
                          : ((((U8)(c)) == LATIN_SMALL_LETTER_SHARP_S)         \
                            ? (__ASSERT_(0) (c))                               \
                            : PL_mod_latin1_uc[ (U8) (c) ])))))

/* Note that the result can be larger than a byte in a UTF-8 locale.  It
 * returns a single value, so can't adequately return the fold case of LATIN
 * SMALL LETTER SHARP S in a UTF-8 locale (which should be a string of two
 * values "ss"); instead it asserts against that under DEBUGGING, and
 * otherwise returns its input.  It does not handle the anomalies in UTF-8
 * Turkic locales */
#define _generic_toFOLD_LC(c, function, cast)                                  \
                    ((UNLIKELY((c) == MICRO_SIGN) && IN_UTF8_CTYPE_LOCALE)     \
                      ? GREEK_SMALL_LETTER_MU                                  \
                      : (__ASSERT_(! IN_UTF8_CTYPE_LOCALE                      \
                                   || (c) != LATIN_SMALL_LETTER_SHARP_S)       \
                         _generic_toLOWER_LC(c, function, cast)))

/* Use the libc versions for these if available. */
#if defined(HAS_ISASCII)
#   define isASCII_LC(c) (FITS_IN_8_BITS(c) && isascii( (U8) (c)))
#else
#   define isASCII_LC(c) isASCII(c)
#endif

#if defined(HAS_ISBLANK)
#   define isBLANK_LC(c) _generic_LC(c, _CC_BLANK, isblank)
#else /* Unlike isASCII, varies if in a UTF-8 locale */
#   define isBLANK_LC(c) ((IN_UTF8_CTYPE_LOCALE) ? isBLANK_L1(c) : isBLANK(c))
#endif

#define _LC_CAST U8

#ifdef WIN32
    /* The Windows functions don't bother to follow the POSIX standard, which
     * for example says that something can't both be a printable and a control.
     * But Windows treats the \t control as a printable, and does such things
     * as making superscripts into both digits and punctuation.  This tames
     * these flaws by assuming that the definitions of both controls and space
     * are correct, and then making sure that other definitions don't have
     * weirdnesses, by making sure that isalnum() isn't also ispunct(), etc.
     * Not all possible weirdnesses are checked for, just the ones that were
     * detected on actual Microsoft code pages */

#  define isCNTRL_LC(c)  _generic_LC(c, _CC_CNTRL, iscntrl)
#  define isSPACE_LC(c)  _generic_LC(c, _CC_SPACE, isspace)

#  define isALPHA_LC(c)  (_generic_LC(c, _CC_ALPHA, isalpha)                  \
                                                    && isALPHANUMERIC_LC(c))
#  define isALPHANUMERIC_LC(c)  (_generic_LC(c, _CC_ALPHANUMERIC, isalnum) && \
                                                              ! isPUNCT_LC(c))
#  define isDIGIT_LC(c)  (_generic_LC(c, _CC_DIGIT, isdigit) &&               \
                                                         isALPHANUMERIC_LC(c))
#  define isGRAPH_LC(c)  (_generic_LC(c, _CC_GRAPH, isgraph) && isPRINT_LC(c))
#  define isIDFIRST_LC(c) (((c) == '_')                                       \
                 || (_generic_LC(c, _CC_IDFIRST, isalpha) && ! isPUNCT_LC(c)))
#  define isLOWER_LC(c)  (_generic_LC(c, _CC_LOWER, islower) && isALPHA_LC(c))
#  define isPRINT_LC(c)  (_generic_LC(c, _CC_PRINT, isprint) && ! isCNTRL_LC(c))
#  define isPUNCT_LC(c)  (_generic_LC(c, _CC_PUNCT, ispunct) && ! isCNTRL_LC(c))
#  define isUPPER_LC(c)  (_generic_LC(c, _CC_UPPER, isupper) && isALPHA_LC(c))
#  define isWORDCHAR_LC(c) (((c) == '_') || isALPHANUMERIC_LC(c))
#  define isXDIGIT_LC(c) (_generic_LC(c, _CC_XDIGIT, isxdigit)                \
                                                    && isALPHANUMERIC_LC(c))

#  define toLOWER_LC(c) _generic_toLOWER_LC((c), tolower, U8)
#  define toUPPER_LC(c) _generic_toUPPER_LC((c), toupper, U8)
#  define toFOLD_LC(c)  _generic_toFOLD_LC((c), tolower, U8)

#elif defined(CTYPE256) || (!defined(isascii) && !defined(HAS_ISASCII))
    /* For most other platforms */

#  define isALPHA_LC(c)   _generic_LC(c, _CC_ALPHA, isalpha)
#  define isALPHANUMERIC_LC(c)  _generic_LC(c, _CC_ALPHANUMERIC, isalnum)
#  define isCNTRL_LC(c)    _generic_LC(c, _CC_CNTRL, iscntrl)
#  define isDIGIT_LC(c)    _generic_LC(c, _CC_DIGIT, isdigit)
#  ifdef OS390  /* This system considers NBSP to be a graph */
#    define isGRAPH_LC(c)    _generic_LC(c, _CC_GRAPH, isgraph)             \
                        && ! isSPACE_LC(c)
#  else
#    define isGRAPH_LC(c)    _generic_LC(c, _CC_GRAPH, isgraph)
#  endif
#  define isIDFIRST_LC(c)  _generic_LC_underscore(c, _CC_IDFIRST, isalpha)
#  define isLOWER_LC(c)    _generic_LC(c, _CC_LOWER, islower)
#  define isPRINT_LC(c)    _generic_LC(c, _CC_PRINT, isprint)
#  define isPUNCT_LC(c)    _generic_LC(c, _CC_PUNCT, ispunct)
#  define isSPACE_LC(c)    _generic_LC(c, _CC_SPACE, isspace)
#  define isUPPER_LC(c)    _generic_LC(c, _CC_UPPER, isupper)
#  define isWORDCHAR_LC(c) _generic_LC_underscore(c, _CC_WORDCHAR, isalnum)
#  define isXDIGIT_LC(c)   _generic_LC(c, _CC_XDIGIT, isxdigit)


#  define toLOWER_LC(c) _generic_toLOWER_LC((c), tolower, U8)
#  define toUPPER_LC(c) _generic_toUPPER_LC((c), toupper, U8)
#  define toFOLD_LC(c)  _generic_toFOLD_LC((c), tolower, U8)

#else  /* The final fallback position */

#  define isALPHA_LC(c)	        (isascii(c) && isalpha(c))
#  define isALPHANUMERIC_LC(c)  (isascii(c) && isalnum(c))
#  define isCNTRL_LC(c)	        (isascii(c) && iscntrl(c))
#  define isDIGIT_LC(c)	        (isascii(c) && isdigit(c))
#  define isGRAPH_LC(c)	        (isascii(c) && isgraph(c))
#  define isIDFIRST_LC(c)	(isascii(c) && (isalpha(c) || (c) == '_'))
#  define isLOWER_LC(c)	        (isascii(c) && islower(c))
#  define isPRINT_LC(c)	        (isascii(c) && isprint(c))
#  define isPUNCT_LC(c)	        (isascii(c) && ispunct(c))
#  define isSPACE_LC(c)	        (isascii(c) && isspace(c))
#  define isUPPER_LC(c)	        (isascii(c) && isupper(c))
#  define isWORDCHAR_LC(c)	(isascii(c) && (isalnum(c) || (c) == '_'))
#  define isXDIGIT_LC(c)        (isascii(c) && isxdigit(c))

#  define toLOWER_LC(c)	(isascii(c) ? tolower(c) : (c))
#  define toUPPER_LC(c)	(isascii(c) ? toupper(c) : (c))
#  define toFOLD_LC(c)	(isascii(c) ? tolower(c) : (c))

#endif

#define isIDCONT(c)             isWORDCHAR(c)
#define isIDCONT_A(c)           isWORDCHAR_A(c)
#define isIDCONT_L1(c)	        isWORDCHAR_L1(c)
#define isIDCONT_LC(c)	        isWORDCHAR_LC(c)
#define isPSXSPC_LC(c)		isSPACE_LC(c)

/* For internal core Perl use only: the base macros for defining macros like
 * isALPHA_uvchr.  'c' is the code point to check.  'classnum' is the POSIX class
 * number defined earlier in this file.  _generic_uvchr() is used for POSIX
 * classes where there is a macro or function 'above_latin1' that takes the
 * single argument 'c' and returns the desired value.  These exist for those
 * classes which have simple definitions, avoiding the overhead of an inversion
 * list binary search.  _generic_invlist_uvchr() can be used
 * for classes where that overhead is faster than a direct lookup.
 * _generic_uvchr() won't compile if 'c' isn't unsigned, as it won't match the
 * 'above_latin1' prototype. _generic_isCC() macro does bounds checking, so
 * have duplicate checks here, so could create versions of the macros that
 * don't, but experiments show that gcc optimizes them out anyway. */

/* Note that all ignore 'use bytes' */
#define _generic_uvchr(classnum, above_latin1, c) ((c) < 256                \
                                             ? _generic_isCC(c, classnum)   \
                                             : above_latin1(c))
#define _generic_invlist_uvchr(classnum, c) ((c) < 256                        \
                                             ? _generic_isCC(c, classnum)   \
                                             : _is_uni_FOO(classnum, c))
#define isALPHA_uvchr(c)      _generic_invlist_uvchr(_CC_ALPHA, c)
#define isALPHANUMERIC_uvchr(c) _generic_invlist_uvchr(_CC_ALPHANUMERIC, c)
#define isASCII_uvchr(c)      isASCII(c)
#define isBLANK_uvchr(c)      _generic_uvchr(_CC_BLANK, is_HORIZWS_cp_high, c)
#define isCNTRL_uvchr(c)      isCNTRL_L1(c) /* All controls are in Latin1 */
#define isDIGIT_uvchr(c)      _generic_invlist_uvchr(_CC_DIGIT, c)
#define isGRAPH_uvchr(c)      _generic_invlist_uvchr(_CC_GRAPH, c)
#define isIDCONT_uvchr(c)                                                   \
                    _generic_uvchr(_CC_WORDCHAR, _is_uni_perl_idcont, c)
#define isIDFIRST_uvchr(c)                                                  \
                    _generic_uvchr(_CC_IDFIRST, _is_uni_perl_idstart, c)
#define isLOWER_uvchr(c)      _generic_invlist_uvchr(_CC_LOWER, c)
#define isPRINT_uvchr(c)      _generic_invlist_uvchr(_CC_PRINT, c)

#define isPUNCT_uvchr(c)      _generic_invlist_uvchr(_CC_PUNCT, c)
#define isSPACE_uvchr(c)      _generic_uvchr(_CC_SPACE, is_XPERLSPACE_cp_high, c)
#define isPSXSPC_uvchr(c)     isSPACE_uvchr(c)

#define isUPPER_uvchr(c)      _generic_invlist_uvchr(_CC_UPPER, c)
#define isVERTWS_uvchr(c)     _generic_uvchr(_CC_VERTSPACE, is_VERTWS_cp_high, c)
#define isWORDCHAR_uvchr(c)   _generic_invlist_uvchr(_CC_WORDCHAR, c)
#define isXDIGIT_uvchr(c)     _generic_uvchr(_CC_XDIGIT, is_XDIGIT_cp_high, c)

#define toFOLD_uvchr(c,s,l)	to_uni_fold(c,s,l)
#define toLOWER_uvchr(c,s,l)	to_uni_lower(c,s,l)
#define toTITLE_uvchr(c,s,l)	to_uni_title(c,s,l)
#define toUPPER_uvchr(c,s,l)	to_uni_upper(c,s,l)

/* For backwards compatibility, even though '_uni' should mean official Unicode
 * code points, in Perl it means native for those below 256 */
#define isALPHA_uni(c)          isALPHA_uvchr(c)
#define isALPHANUMERIC_uni(c)   isALPHANUMERIC_uvchr(c)
#define isASCII_uni(c)          isASCII_uvchr(c)
#define isBLANK_uni(c)          isBLANK_uvchr(c)
#define isCNTRL_uni(c)          isCNTRL_uvchr(c)
#define isDIGIT_uni(c)          isDIGIT_uvchr(c)
#define isGRAPH_uni(c)          isGRAPH_uvchr(c)
#define isIDCONT_uni(c)         isIDCONT_uvchr(c)
#define isIDFIRST_uni(c)        isIDFIRST_uvchr(c)
#define isLOWER_uni(c)          isLOWER_uvchr(c)
#define isPRINT_uni(c)          isPRINT_uvchr(c)
#define isPUNCT_uni(c)          isPUNCT_uvchr(c)
#define isSPACE_uni(c)          isSPACE_uvchr(c)
#define isPSXSPC_uni(c)         isPSXSPC_uvchr(c)
#define isUPPER_uni(c)          isUPPER_uvchr(c)
#define isVERTWS_uni(c)         isVERTWS_uvchr(c)
#define isWORDCHAR_uni(c)       isWORDCHAR_uvchr(c)
#define isXDIGIT_uni(c)         isXDIGIT_uvchr(c)
#define toFOLD_uni(c,s,l)       toFOLD_uvchr(c,s,l)
#define toLOWER_uni(c,s,l)      toLOWER_uvchr(c,s,l)
#define toTITLE_uni(c,s,l)      toTITLE_uvchr(c,s,l)
#define toUPPER_uni(c,s,l)      toUPPER_uvchr(c,s,l)

/* For internal core Perl use only: the base macros for defining macros like
 * isALPHA_LC_uvchr.  These are like isALPHA_LC, but the input can be any code
 * point, not just 0-255.  Like _generic_uvchr, there are two versions, one for
 * simple class definitions; the other for more complex.  These are like
 * _generic_uvchr, so see it for more info. */
#define _generic_LC_uvchr(latin1, above_latin1, c)                            \
                                    (c < 256 ? latin1(c) : above_latin1(c))
#define _generic_LC_invlist_uvchr(latin1, classnum, c)                          \
                            (c < 256 ? latin1(c) : _is_uni_FOO(classnum, c))

#define isALPHA_LC_uvchr(c)  _generic_LC_invlist_uvchr(isALPHA_LC, _CC_ALPHA, c)
#define isALPHANUMERIC_LC_uvchr(c)  _generic_LC_invlist_uvchr(isALPHANUMERIC_LC, \
                                                         _CC_ALPHANUMERIC, c)
#define isASCII_LC_uvchr(c)   isASCII_LC(c)
#define isBLANK_LC_uvchr(c)  _generic_LC_uvchr(isBLANK_LC,                    \
                                                        is_HORIZWS_cp_high, c)
#define isCNTRL_LC_uvchr(c)  (c < 256 ? isCNTRL_LC(c) : 0)
#define isDIGIT_LC_uvchr(c)  _generic_LC_invlist_uvchr(isDIGIT_LC, _CC_DIGIT, c)
#define isGRAPH_LC_uvchr(c)  _generic_LC_invlist_uvchr(isGRAPH_LC, _CC_GRAPH, c)
#define isIDCONT_LC_uvchr(c) _generic_LC_uvchr(isIDCONT_LC,                   \
                                                  _is_uni_perl_idcont, c)
#define isIDFIRST_LC_uvchr(c) _generic_LC_uvchr(isIDFIRST_LC,                 \
                                                  _is_uni_perl_idstart, c)
#define isLOWER_LC_uvchr(c)  _generic_LC_invlist_uvchr(isLOWER_LC, _CC_LOWER, c)
#define isPRINT_LC_uvchr(c)  _generic_LC_invlist_uvchr(isPRINT_LC, _CC_PRINT, c)
#define isPSXSPC_LC_uvchr(c)  isSPACE_LC_uvchr(c)
#define isPUNCT_LC_uvchr(c)  _generic_LC_invlist_uvchr(isPUNCT_LC, _CC_PUNCT, c)
#define isSPACE_LC_uvchr(c)  _generic_LC_uvchr(isSPACE_LC,                    \
                                                    is_XPERLSPACE_cp_high, c)
#define isUPPER_LC_uvchr(c)  _generic_LC_invlist_uvchr(isUPPER_LC, _CC_UPPER, c)
#define isWORDCHAR_LC_uvchr(c) _generic_LC_invlist_uvchr(isWORDCHAR_LC,         \
                                                           _CC_WORDCHAR, c)
#define isXDIGIT_LC_uvchr(c) _generic_LC_uvchr(isXDIGIT_LC,                  \
                                                       is_XDIGIT_cp_high, c)

#define isBLANK_LC_uni(c)    isBLANK_LC_uvchr(UNI_TO_NATIVE(c))

/* The "_safe" macros make sure that we don't attempt to read beyond 'e', but
 * they don't otherwise go out of their way to look for malformed UTF-8.  If
 * they can return accurate results without knowing if the input is otherwise
 * malformed, they do so.  For example isASCII is accurate in spite of any
 * non-length malformations because it looks only at a single byte. Likewise
 * isDIGIT looks just at the first byte for code points 0-255, as all UTF-8
 * variant ones return FALSE.  But, if the input has to be well-formed in order
 * for the results to be accurate, the macros will test and if malformed will
 * call a routine to die
 *
 * Except for toke.c, the macros do assume that e > p, asserting that on
 * DEBUGGING builds.  Much code that calls these depends on this being true,
 * for other reasons.  toke.c is treated specially as using the regular
 * assertion breaks it in many ways.  All strings that these operate on there
 * are supposed to have an extra NUL character at the end,  so that *e = \0. A
 * bunch of code in toke.c assumes that this is true, so the assertion allows
 * for that */
#ifdef PERL_IN_TOKE_C
#  define _utf8_safe_assert(p,e) ((e) > (p) || ((e) == (p) && *(p) == '\0'))
#else
#  define _utf8_safe_assert(p,e) ((e) > (p))
#endif

#define _generic_utf8_safe(classnum, p, e, above_latin1)                    \
    ((! _utf8_safe_assert(p, e))                                            \
      ? (_force_out_malformed_utf8_message((U8 *) (p), (U8 *) (e), 0, 1), 0)\
      : (UTF8_IS_INVARIANT(*(p)))                                           \
          ? _generic_isCC(*(p), classnum)                                   \
          : (UTF8_IS_DOWNGRADEABLE_START(*(p))                              \
             ? ((LIKELY((e) - (p) > 1 && UTF8_IS_CONTINUATION(*((p)+1))))   \
                ? _generic_isCC(EIGHT_BIT_UTF8_TO_NATIVE(*(p), *((p)+1 )),  \
                                classnum)                                   \
                : (_force_out_malformed_utf8_message(                       \
                                        (U8 *) (p), (U8 *) (e), 0, 1), 0))  \
             : above_latin1))
/* Like the above, but calls 'above_latin1(p)' to get the utf8 value.
 * 'above_latin1' can be a macro */
#define _generic_func_utf8_safe(classnum, above_latin1, p, e)               \
                    _generic_utf8_safe(classnum, p, e, above_latin1(p, e))
#define _generic_non_invlist_utf8_safe(classnum, above_latin1, p, e)          \
          _generic_utf8_safe(classnum, p, e,                                \
                             (UNLIKELY((e) - (p) < UTF8SKIP(p))             \
                              ? (_force_out_malformed_utf8_message(         \
                                      (U8 *) (p), (U8 *) (e), 0, 1), 0)     \
                              : above_latin1(p)))
/* Like the above, but passes classnum to _isFOO_utf8(), instead of having an
 * 'above_latin1' parameter */
#define _generic_invlist_utf8_safe(classnum, p, e)                            \
            _generic_utf8_safe(classnum, p, e, _is_utf8_FOO(classnum, p, e))

/* Like the above, but should be used only when it is known that there are no
 * characters in the upper-Latin1 range (128-255 on ASCII platforms) which the
 * class is TRUE for.  Hence it can skip the tests for this range.
 * 'above_latin1' should include its arguments */
#define _generic_utf8_safe_no_upper_latin1(classnum, p, e, above_latin1)    \
         (__ASSERT_(_utf8_safe_assert(p, e))                                \
         (isASCII(*(p)))                                                    \
          ? _generic_isCC(*(p), classnum)                                   \
          : (UTF8_IS_DOWNGRADEABLE_START(*(p)))                             \
             ? 0 /* Note that doesn't check validity for latin1 */          \
             : above_latin1)


#define isALPHA_utf8(p, e)         isALPHA_utf8_safe(p, e)
#define isALPHANUMERIC_utf8(p, e)  isALPHANUMERIC_utf8_safe(p, e)
#define isASCII_utf8(p, e)         isASCII_utf8_safe(p, e)
#define isBLANK_utf8(p, e)         isBLANK_utf8_safe(p, e)
#define isCNTRL_utf8(p, e)         isCNTRL_utf8_safe(p, e)
#define isDIGIT_utf8(p, e)         isDIGIT_utf8_safe(p, e)
#define isGRAPH_utf8(p, e)         isGRAPH_utf8_safe(p, e)
#define isIDCONT_utf8(p, e)        isIDCONT_utf8_safe(p, e)
#define isIDFIRST_utf8(p, e)       isIDFIRST_utf8_safe(p, e)
#define isLOWER_utf8(p, e)         isLOWER_utf8_safe(p, e)
#define isPRINT_utf8(p, e)         isPRINT_utf8_safe(p, e)
#define isPSXSPC_utf8(p, e)        isPSXSPC_utf8_safe(p, e)
#define isPUNCT_utf8(p, e)         isPUNCT_utf8_safe(p, e)
#define isSPACE_utf8(p, e)         isSPACE_utf8_safe(p, e)
#define isUPPER_utf8(p, e)         isUPPER_utf8_safe(p, e)
#define isVERTWS_utf8(p, e)        isVERTWS_utf8_safe(p, e)
#define isWORDCHAR_utf8(p, e)      isWORDCHAR_utf8_safe(p, e)
#define isXDIGIT_utf8(p, e)        isXDIGIT_utf8_safe(p, e)

#define isALPHA_utf8_safe(p, e)  _generic_invlist_utf8_safe(_CC_ALPHA, p, e)
#define isALPHANUMERIC_utf8_safe(p, e)                                      \
                        _generic_invlist_utf8_safe(_CC_ALPHANUMERIC, p, e)
#define isASCII_utf8_safe(p, e)                                             \
    /* Because ASCII is invariant under utf8, the non-utf8 macro            \
    * works */                                                              \
    (__ASSERT_(_utf8_safe_assert(p, e)) isASCII(*(p)))
#define isBLANK_utf8_safe(p, e)                                             \
        _generic_non_invlist_utf8_safe(_CC_BLANK, is_HORIZWS_high, p, e)

#ifdef EBCDIC
    /* Because all controls are UTF-8 invariants in EBCDIC, we can use this
     * more efficient macro instead of the more general one */
#   define isCNTRL_utf8_safe(p, e)                                          \
                    (__ASSERT_(_utf8_safe_assert(p, e)) isCNTRL_L1(*(p)))
#else
#   define isCNTRL_utf8_safe(p, e)  _generic_utf8_safe(_CC_CNTRL, p, e, 0)
#endif

#define isDIGIT_utf8_safe(p, e)                                             \
            _generic_utf8_safe_no_upper_latin1(_CC_DIGIT, p, e,             \
                                            _is_utf8_FOO(_CC_DIGIT, p, e))
#define isGRAPH_utf8_safe(p, e)    _generic_invlist_utf8_safe(_CC_GRAPH, p, e)
#define isIDCONT_utf8_safe(p, e)   _generic_func_utf8_safe(_CC_WORDCHAR,    \
                                                 _is_utf8_perl_idcont, p, e)

/* To prevent S_scan_word in toke.c from hanging, we have to make sure that
 * IDFIRST is an alnum.  See
 * https://github.com/Perl/perl5/issues/10275 for more detail than you
 * ever wanted to know about.  (In the ASCII range, there isn't a difference.)
 * This used to be not the XID version, but we decided to go with the more
 * modern Unicode definition */
#define isIDFIRST_utf8_safe(p, e)                                           \
    _generic_func_utf8_safe(_CC_IDFIRST,                                    \
                            _is_utf8_perl_idstart, (U8 *) (p), (U8 *) (e))

#define isLOWER_utf8_safe(p, e)     _generic_invlist_utf8_safe(_CC_LOWER, p, e)
#define isPRINT_utf8_safe(p, e)     _generic_invlist_utf8_safe(_CC_PRINT, p, e)
#define isPSXSPC_utf8_safe(p, e)     isSPACE_utf8_safe(p, e)
#define isPUNCT_utf8_safe(p, e)     _generic_invlist_utf8_safe(_CC_PUNCT, p, e)
#define isSPACE_utf8_safe(p, e)                                             \
    _generic_non_invlist_utf8_safe(_CC_SPACE, is_XPERLSPACE_high, p, e)
#define isUPPER_utf8_safe(p, e)  _generic_invlist_utf8_safe(_CC_UPPER, p, e)
#define isVERTWS_utf8_safe(p, e)                                            \
        _generic_non_invlist_utf8_safe(_CC_VERTSPACE, is_VERTWS_high, p, e)
#define isWORDCHAR_utf8_safe(p, e)                                          \
                             _generic_invlist_utf8_safe(_CC_WORDCHAR, p, e)
#define isXDIGIT_utf8_safe(p, e)                                            \
                   _generic_utf8_safe_no_upper_latin1(_CC_XDIGIT, p, e,     \
                             (UNLIKELY((e) - (p) < UTF8SKIP(p))             \
                              ? (_force_out_malformed_utf8_message(         \
                                      (U8 *) (p), (U8 *) (e), 0, 1), 0)     \
                              : is_XDIGIT_high(p)))

#define toFOLD_utf8(p,e,s,l)	toFOLD_utf8_safe(p,e,s,l)
#define toLOWER_utf8(p,e,s,l)	toLOWER_utf8_safe(p,e,s,l)
#define toTITLE_utf8(p,e,s,l)	toTITLE_utf8_safe(p,e,s,l)
#define toUPPER_utf8(p,e,s,l)	toUPPER_utf8_safe(p,e,s,l)

/* For internal core use only, subject to change */
#define _toFOLD_utf8_flags(p,e,s,l,f)  _to_utf8_fold_flags (p,e,s,l,f)
#define _toLOWER_utf8_flags(p,e,s,l,f) _to_utf8_lower_flags(p,e,s,l,f)
#define _toTITLE_utf8_flags(p,e,s,l,f) _to_utf8_title_flags(p,e,s,l,f)
#define _toUPPER_utf8_flags(p,e,s,l,f) _to_utf8_upper_flags(p,e,s,l,f)

#define toFOLD_utf8_safe(p,e,s,l)   _toFOLD_utf8_flags(p,e,s,l, FOLD_FLAGS_FULL)
#define toLOWER_utf8_safe(p,e,s,l)  _toLOWER_utf8_flags(p,e,s,l, 0)
#define toTITLE_utf8_safe(p,e,s,l)  _toTITLE_utf8_flags(p,e,s,l, 0)
#define toUPPER_utf8_safe(p,e,s,l)  _toUPPER_utf8_flags(p,e,s,l, 0)

#define isALPHA_LC_utf8(p, e)         isALPHA_LC_utf8_safe(p, e)
#define isALPHANUMERIC_LC_utf8(p, e)  isALPHANUMERIC_LC_utf8_safe(p, e)
#define isASCII_LC_utf8(p, e)         isASCII_LC_utf8_safe(p, e)
#define isBLANK_LC_utf8(p, e)         isBLANK_LC_utf8_safe(p, e)
#define isCNTRL_LC_utf8(p, e)         isCNTRL_LC_utf8_safe(p, e)
#define isDIGIT_LC_utf8(p, e)         isDIGIT_LC_utf8_safe(p, e)
#define isGRAPH_LC_utf8(p, e)         isGRAPH_LC_utf8_safe(p, e)
#define isIDCONT_LC_utf8(p, e)        isIDCONT_LC_utf8_safe(p, e)
#define isIDFIRST_LC_utf8(p, e)       isIDFIRST_LC_utf8_safe(p, e)
#define isLOWER_LC_utf8(p, e)         isLOWER_LC_utf8_safe(p, e)
#define isPRINT_LC_utf8(p, e)         isPRINT_LC_utf8_safe(p, e)
#define isPSXSPC_LC_utf8(p, e)        isPSXSPC_LC_utf8_safe(p, e)
#define isPUNCT_LC_utf8(p, e)         isPUNCT_LC_utf8_safe(p, e)
#define isSPACE_LC_utf8(p, e)         isSPACE_LC_utf8_safe(p, e)
#define isUPPER_LC_utf8(p, e)         isUPPER_LC_utf8_safe(p, e)
#define isWORDCHAR_LC_utf8(p, e)      isWORDCHAR_LC_utf8_safe(p, e)
#define isXDIGIT_LC_utf8(p, e)        isXDIGIT_LC_utf8_safe(p, e)

/* For internal core Perl use only: the base macros for defining macros like
 * isALPHA_LC_utf8_safe.  These are like _generic_utf8, but if the first code
 * point in 'p' is within the 0-255 range, it uses locale rules from the
 * passed-in 'macro' parameter */
#define _generic_LC_utf8_safe(macro, p, e, above_latin1)                    \
         (__ASSERT_(_utf8_safe_assert(p, e))                                \
         (UTF8_IS_INVARIANT(*(p)))                                          \
          ? macro(*(p))                                                     \
          : (UTF8_IS_DOWNGRADEABLE_START(*(p))                              \
             ? ((LIKELY((e) - (p) > 1 && UTF8_IS_CONTINUATION(*((p)+1))))   \
                ? macro(EIGHT_BIT_UTF8_TO_NATIVE(*(p), *((p)+1)))           \
                : (_force_out_malformed_utf8_message(                       \
                                        (U8 *) (p), (U8 *) (e), 0, 1), 0))  \
              : above_latin1))

#define _generic_LC_invlist_utf8_safe(macro, classnum, p, e)                  \
            _generic_LC_utf8_safe(macro, p, e,                              \
                                            _is_utf8_FOO(classnum, p, e))

#define _generic_LC_func_utf8_safe(macro, above_latin1, p, e)               \
            _generic_LC_utf8_safe(macro, p, e, above_latin1(p, e))

#define _generic_LC_non_invlist_utf8_safe(classnum, above_latin1, p, e)       \
          _generic_LC_utf8_safe(classnum, p, e,                             \
                             (UNLIKELY((e) - (p) < UTF8SKIP(p))             \
                              ? (_force_out_malformed_utf8_message(         \
                                      (U8 *) (p), (U8 *) (e), 0, 1), 0)     \
                              : above_latin1(p)))

#define isALPHANUMERIC_LC_utf8_safe(p, e)                                   \
            _generic_LC_invlist_utf8_safe(isALPHANUMERIC_LC,                  \
                                        _CC_ALPHANUMERIC, p, e)
#define isALPHA_LC_utf8_safe(p, e)                                          \
            _generic_LC_invlist_utf8_safe(isALPHA_LC, _CC_ALPHA, p, e)
#define isASCII_LC_utf8_safe(p, e)                                          \
                    (__ASSERT_(_utf8_safe_assert(p, e)) isASCII_LC(*(p)))
#define isBLANK_LC_utf8_safe(p, e)                                          \
        _generic_LC_non_invlist_utf8_safe(isBLANK_LC, is_HORIZWS_high, p, e)
#define isCNTRL_LC_utf8_safe(p, e)                                          \
            _generic_LC_utf8_safe(isCNTRL_LC, p, e, 0)
#define isDIGIT_LC_utf8_safe(p, e)                                          \
            _generic_LC_invlist_utf8_safe(isDIGIT_LC, _CC_DIGIT, p, e)
#define isGRAPH_LC_utf8_safe(p, e)                                          \
            _generic_LC_invlist_utf8_safe(isGRAPH_LC, _CC_GRAPH, p, e)
#define isIDCONT_LC_utf8_safe(p, e)                                         \
            _generic_LC_func_utf8_safe(isIDCONT_LC,                         \
                                                _is_utf8_perl_idcont, p, e)
#define isIDFIRST_LC_utf8_safe(p, e)                                        \
            _generic_LC_func_utf8_safe(isIDFIRST_LC,                        \
                                               _is_utf8_perl_idstart, p, e)
#define isLOWER_LC_utf8_safe(p, e)                                          \
            _generic_LC_invlist_utf8_safe(isLOWER_LC, _CC_LOWER, p, e)
#define isPRINT_LC_utf8_safe(p, e)                                          \
            _generic_LC_invlist_utf8_safe(isPRINT_LC, _CC_PRINT, p, e)
#define isPSXSPC_LC_utf8_safe(p, e)    isSPACE_LC_utf8_safe(p, e)
#define isPUNCT_LC_utf8_safe(p, e)                                          \
            _generic_LC_invlist_utf8_safe(isPUNCT_LC, _CC_PUNCT, p, e)
#define isSPACE_LC_utf8_safe(p, e)                                          \
    _generic_LC_non_invlist_utf8_safe(isSPACE_LC, is_XPERLSPACE_high, p, e)
#define isUPPER_LC_utf8_safe(p, e)                                          \
            _generic_LC_invlist_utf8_safe(isUPPER_LC, _CC_UPPER, p, e)
#define isWORDCHAR_LC_utf8_safe(p, e)                                       \
            _generic_LC_invlist_utf8_safe(isWORDCHAR_LC, _CC_WORDCHAR, p, e)
#define isXDIGIT_LC_utf8_safe(p, e)                                         \
        _generic_LC_non_invlist_utf8_safe(isXDIGIT_LC, is_XDIGIT_high, p, e)

/* Macros for backwards compatibility and for completeness when the ASCII and
 * Latin1 values are identical */
#define isALPHAU(c)         isALPHA_L1(c)
#define isDIGIT_L1(c)       isDIGIT_A(c)
#define isOCTAL(c)          isOCTAL_A(c)
#define isOCTAL_L1(c)       isOCTAL_A(c)
#define isXDIGIT_L1(c)      isXDIGIT_A(c)
#define isALNUM(c)          isWORDCHAR(c)
#define isALNUM_A(c)        isALNUM(c)
#define isALNUMU(c)         isWORDCHAR_L1(c)
#define isALNUM_LC(c)       isWORDCHAR_LC(c)
#define isALNUM_uni(c)      isWORDCHAR_uni(c)
#define isALNUM_LC_uvchr(c) isWORDCHAR_LC_uvchr(c)
#define isALNUM_utf8(p,e)   isWORDCHAR_utf8(p,e)
#define isALNUM_utf8_safe(p,e) isWORDCHAR_utf8_safe(p,e)
#define isALNUM_LC_utf8(p,e)isWORDCHAR_LC_utf8(p,e)
#define isALNUM_LC_utf8_safe(p,e)isWORDCHAR_LC_utf8_safe(p,e)
#define isALNUMC_A(c)       isALPHANUMERIC_A(c)      /* Mnemonic: "C's alnum" */
#define isALNUMC_L1(c)      isALPHANUMERIC_L1(c)
#define isALNUMC(c)	    isALPHANUMERIC(c)
#define isALNUMC_LC(c)	    isALPHANUMERIC_LC(c)
#define isALNUMC_uni(c)     isALPHANUMERIC_uni(c)
#define isALNUMC_LC_uvchr(c) isALPHANUMERIC_LC_uvchr(c)
#define isALNUMC_utf8(p,e)  isALPHANUMERIC_utf8(p,e)
#define isALNUMC_utf8_safe(p,e)  isALPHANUMERIC_utf8_safe(p,e)
#define isALNUMC_LC_utf8_safe(p,e) isALPHANUMERIC_LC_utf8_safe(p,e)

/* On EBCDIC platforms, CTRL-@ is 0, CTRL-A is 1, etc, just like on ASCII,
 * except that they don't necessarily mean the same characters, e.g. CTRL-D is
 * 4 on both systems, but that is EOT on ASCII;  ST on EBCDIC.
 * '?' is special-cased on EBCDIC to APC, which is the control there that is
 * the outlier from the block that contains the other controls, just like
 * toCTRL('?') on ASCII yields DEL, the control that is the outlier from the C0
 * block.  If it weren't special cased, it would yield a non-control.
 * The conversion works both ways, so toCTRL('D') is 4, and toCTRL(4) is D,
 * etc. */
#ifndef EBCDIC
#  define toCTRL(c)    (__ASSERT_(FITS_IN_8_BITS(c)) toUPPER(((U8)(c))) ^ 64)
#else
#  define toCTRL(c)   (__ASSERT_(FITS_IN_8_BITS(c))                     \
                      ((isPRINT_A(c))                                   \
                       ? (UNLIKELY((c) == '?')                          \
                         ? QUESTION_MARK_CTRL                           \
                         : (NATIVE_TO_LATIN1(toUPPER((U8) (c))) ^ 64))  \
                       : (UNLIKELY((c) == QUESTION_MARK_CTRL)           \
                         ? '?'                                          \
                         : (LATIN1_TO_NATIVE(((U8) (c)) ^ 64)))))
#endif

/*
=for apidoc Ay||line_t
The typedef to use to declare variables that are to hold line numbers.

=cut

  Line numbers are unsigned, 32 bits.
*/
typedef U32 line_t;
#define NOLINE ((line_t) 4294967295UL)  /* = FFFFFFFF */

/* Helpful alias for version prescan */
#define is_LAX_VERSION(a,b) \
        (a != Perl_prescan_version(aTHX_ a, FALSE, b, NULL, NULL, NULL, NULL))

#define is_STRICT_VERSION(a,b) \
        (a != Perl_prescan_version(aTHX_ a, TRUE, b, NULL, NULL, NULL, NULL))

#define BADVERSION(a,b,c) \
        if (b) { \
            *b = c; \
        } \
        return a;

/* Converts a character KNOWN to represent a hexadecimal digit (0-9, A-F, or
 * a-f) to its numeric value without using any branches.  The input is
 * validated only by an assert() in DEBUGGING builds.
 *
 * It works by right shifting and isolating the bit that is 0 for the digits,
 * and 1 for at least the alphas A-F, a-f.  The bit is shifted to the ones
 * position, and then to the eights position.  Both are added together to form
 * 0 if the input is '0'-'9' and to form 9 if alpha.  This is added to the
 * final four bits of the input to form the correct value. */
#define XDIGIT_VALUE(c) (__ASSERT_(isXDIGIT(c))                             \
           ((NATIVE_TO_LATIN1(c) >> 6) & 1)  /* 1 if alpha; 0 if not */     \
         + ((NATIVE_TO_LATIN1(c) >> 3) & 8)  /* 8 if alpha; 0 if not */     \
         + ((c) & 0xF))   /* 0-9 if input valid hex digit */

/* The argument is a string pointer, which is advanced. */
#define READ_XDIGIT(s)  ((s)++, XDIGIT_VALUE(*((s) - 1)))

/* Converts a character known to represent an octal digit (0-7) to its numeric
 * value.  The input is validated only by an assert() in DEBUGGING builds.  In
 * both ASCII and EBCDIC the last 3 bits of the octal digits range from 0-7. */
#define OCTAL_VALUE(c) (__ASSERT_(isOCTAL(c)) (7 & (c)))

/* Efficiently returns a boolean as to if two native characters are equivalent
 * case-insensitively.  At least one of the characters must be one of [A-Za-z];
 * the ALPHA in the name is to remind you of that.  This is asserted() in
 * DEBUGGING builds.  Because [A-Za-z] are invariant under UTF-8, this macro
 * works (on valid input) for both non- and UTF-8-encoded bytes.
 *
 * When one of the inputs is a compile-time constant and gets folded by the
 * compiler, this reduces to an AND and a TEST.  On both EBCDIC and ASCII
 * machines, 'A' and 'a' differ by a single bit; the same with the upper and
 * lower case of all other ASCII-range alphabetics.  On ASCII platforms, they
 * are 32 apart; on EBCDIC, they are 64.  At compile time, this uses an
 * exclusive 'or' to find that bit and then inverts it to form a mask, with
 * just a single 0, in the bit position where the upper- and lowercase differ.
 * */
#define isALPHA_FOLD_EQ(c1, c2)                                         \
                      (__ASSERT_(isALPHA_A(c1) || isALPHA_A(c2))        \
                      ((c1) & ~('A' ^ 'a')) ==  ((c2) & ~('A' ^ 'a')))
#define isALPHA_FOLD_NE(c1, c2) (! isALPHA_FOLD_EQ((c1), (c2)))

/*
=for apidoc_section $memory

=for apidoc Am|void|Newx|void* ptr|int nitems|type
=for apidoc_item |void*|safemalloc|size_t size

The XSUB-writer's interface to the C C<malloc> function.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

In 5.9.3, Newx() and friends replace the older New() API, and drops
the first parameter, I<x>, a debug aid which allowed callers to identify
themselves.  This aid has been superseded by a new build option,
PERL_MEM_LOG (see L<perlhacktips/PERL_MEM_LOG>).  The older API is still
there for use in XS modules supporting older perls.

=for apidoc Am|void|Newxc|void* ptr|int nitems|type|cast
The XSUB-writer's interface to the C C<malloc> function, with
cast.  See also C<L</Newx>>.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

=for apidoc Am|void|Newxz|void* ptr|int nitems|type
=for apidoc_item |void*|safecalloc|size_t nitems|size_t item_size

The XSUB-writer's interface to the C C<malloc> function.  The allocated
memory is zeroed with C<memzero>.  See also C<L</Newx>>.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

=for apidoc Am|void|Renew|void* ptr|int nitems|type
=for apidoc_item |void*|saferealloc|void *ptr|size_t size

The XSUB-writer's interface to the C C<realloc> function.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

=for apidoc Am|void|Renewc|void* ptr|int nitems|type|cast
The XSUB-writer's interface to the C C<realloc> function, with
cast.

Memory obtained by this should B<ONLY> be freed with L</"Safefree">.

=for apidoc Am|void|Safefree|void* ptr
The XSUB-writer's interface to the C C<free> function.

This should B<ONLY> be used on memory obtained using L</"Newx"> and friends.

=for apidoc_section $string
=for apidoc    Am|void  |Move |void* src|void* dest|int nitems|type
=for apidoc_item |void *|MoveD|void* src|void* dest|int nitems|type
The XSUB-writer's interface to the C C<memmove> function.  The C<src> is the
source, C<dest> is the destination, C<nitems> is the number of items, and
C<type> is the type.  Can do overlapping moves.  See also C<L</Copy>>.

C<MoveD> is like C<Move> but returns C<dest>.  Useful
for encouraging compilers to tail-call
optimise.

=for apidoc    Am|void  |Copy |void* src|void* dest|int nitems|type
=for apidoc_item |void *|CopyD|void* src|void* dest|int nitems|type
The XSUB-writer's interface to the C C<memcpy> function.  The C<src> is the
source, C<dest> is the destination, C<nitems> is the number of items, and
C<type> is the type.  May fail on overlapping copies.  See also C<L</Move>>.

C<CopyD> is like C<Copy> but returns C<dest>.  Useful
for encouraging compilers to tail-call
optimise.

=for apidoc    Am|void  |Zero |void* dest|int nitems|type
=for apidoc_item |void *|ZeroD|void* dest|int nitems|type

The XSUB-writer's interface to the C C<memzero> function.  The C<dest> is the
destination, C<nitems> is the number of items, and C<type> is the type.

C<ZeroD> is like C<Zero> but returns C<dest>.  Useful
for encouraging compilers to tail-call
optimise.

=for apidoc_section $utility
=for apidoc Amu|void|StructCopy|type *src|type *dest|type
This is an architecture-independent macro to copy one structure to another.

=for apidoc Am|void|PoisonWith|void* dest|int nitems|type|U8 byte

Fill up memory with a byte pattern (a byte repeated over and over
again) that hopefully catches attempts to access uninitialized memory.

=for apidoc Am|void|PoisonNew|void* dest|int nitems|type

PoisonWith(0xAB) for catching access to allocated but uninitialized memory.

=for apidoc Am|void|PoisonFree|void* dest|int nitems|type

PoisonWith(0xEF) for catching access to freed memory.

=for apidoc Am|void|Poison|void* dest|int nitems|type

PoisonWith(0xEF) for catching access to freed memory.

=cut */

/* Maintained for backwards-compatibility only. Use newSV() instead. */
#ifndef PERL_CORE
#define NEWSV(x,len)	newSV(len)
#endif

#define MEM_SIZE_MAX ((MEM_SIZE)-1)

#define _PERL_STRLEN_ROUNDUP_UNCHECKED(n) (((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1))

#ifdef PERL_MALLOC_WRAP

/* This expression will be constant-folded at compile time.  It checks
 * whether or not the type of the count n is so small (e.g. U8 or U16, or
 * U32 on 64-bit systems) that there's no way a wrap-around could occur.
 * As well as avoiding the need for a run-time check in some cases, it's
 * designed to avoid compiler warnings like:
 *     comparison is always false due to limited range of data type
 * It's mathematically equivalent to
 *    max(n) * sizeof(t) > MEM_SIZE_MAX
 */

#  define _MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) \
    (  sizeof(MEM_SIZE) < sizeof(n) \
    || sizeof(t) > ((MEM_SIZE)1 << 8*(sizeof(MEM_SIZE) - sizeof(n))))

/* This is written in a slightly odd way to avoid various spurious
 * compiler warnings. We *want* to write the expression as
 *    _MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) && (n > C)
 * (for some compile-time constant C), but even when the LHS
 * constant-folds to false at compile-time, g++ insists on emitting
 * warnings about the RHS (e.g. "comparison is always false"), so instead
 * we write it as
 *
 *    (cond ? n : X) > C
 *
 * where X is a constant with X > C always false. Choosing a value for X
 * is tricky. If 0, some compilers will complain about 0 > C always being
 * false; if 1, Coverity complains when n happens to be the constant value
 * '1', that cond ? 1 : 1 has the same value on both branches; so use C
 * for X and hope that nothing else whines.
 */

#  define _MEM_WRAP_WILL_WRAP(n,t) \
      ((_MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) ? (MEM_SIZE)(n) : \
            MEM_SIZE_MAX/sizeof(t)) > MEM_SIZE_MAX/sizeof(t))

#  define MEM_WRAP_CHECK(n,t) \
        (void)(UNLIKELY(_MEM_WRAP_WILL_WRAP(n,t)) \
        && (croak_memory_wrap(),0))

#  define MEM_WRAP_CHECK_1(n,t,a) \
        (void)(UNLIKELY(_MEM_WRAP_WILL_WRAP(n,t)) \
        && (Perl_croak_nocontext("%s",(a)),0))

/* "a" arg must be a string literal */
#  define MEM_WRAP_CHECK_s(n,t,a) \
        (   (void) (UNLIKELY(_MEM_WRAP_WILL_WRAP(n,t))          \
         && (Perl_croak_nocontext(ASSERT_IS_LITERAL(a)), 0)))

#define MEM_WRAP_CHECK_(n,t) MEM_WRAP_CHECK(n,t),

#define PERL_STRLEN_ROUNDUP(n) ((void)(((n) > MEM_SIZE_MAX - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (croak_memory_wrap(),0) : 0), _PERL_STRLEN_ROUNDUP_UNCHECKED(n))
#else

#define MEM_WRAP_CHECK(n,t)
#define MEM_WRAP_CHECK_1(n,t,a)
#define MEM_WRAP_CHECK_s(n,t,a)
#define MEM_WRAP_CHECK_(n,t)

#define PERL_STRLEN_ROUNDUP(n) _PERL_STRLEN_ROUNDUP_UNCHECKED(n)

#endif

#ifdef PERL_MEM_LOG
/*
 * If PERL_MEM_LOG is defined, all Newx()s, Renew()s, and Safefree()s
 * go through functions, which are handy for debugging breakpoints, but
 * which more importantly get the immediate calling environment (file and
 * line number, and C function name if available) passed in.  This info can
 * then be used for logging the calls, for which one gets a sample
 * implementation unless -DPERL_MEM_LOG_NOIMPL is also defined.
 *
 * Known problems:
 * - not all memory allocs get logged, only those
 *   that go through Newx() and derivatives (while all
 *   Safefrees do get logged)
 * - __FILE__ and __LINE__ do not work everywhere
 * - __func__ or __FUNCTION__ even less so
 * - I think more goes on after the perlio frees but
 *   the thing is that STDERR gets closed (as do all
 *   the file descriptors)
 * - no deeper calling stack than the caller of the Newx()
 *   or the kind, but do I look like a C reflection/introspection
 *   utility to you?
 * - the function prototypes for the logging functions
 *   probably should maybe be somewhere else than handy.h
 * - one could consider inlining (macrofying) the logging
 *   for speed, but I am too lazy
 * - one could imagine recording the allocations in a hash,
 *   (keyed by the allocation address?), and maintain that
 *   through reallocs and frees, but how to do that without
 *   any News() happening...?
 * - lots of -Ddefines to get useful/controllable output
 * - lots of ENV reads
 */

# ifdef PERL_CORE
#  ifndef PERL_MEM_LOG_NOIMPL
enum mem_log_type {
  MLT_ALLOC,
  MLT_REALLOC,
  MLT_FREE,
  MLT_NEW_SV,
  MLT_DEL_SV
};
#  endif
#  if defined(PERL_IN_SV_C)  /* those are only used in sv.c */
void Perl_mem_log_new_sv(const SV *sv, const char *filename, const int linenumber, const char *funcname);
void Perl_mem_log_del_sv(const SV *sv, const char *filename, const int linenumber, const char *funcname);
#  endif
# endif

#endif

#ifdef PERL_MEM_LOG
#define MEM_LOG_ALLOC(n,t,a)     Perl_mem_log_alloc(n,sizeof(t),STRINGIFY(t),a,__FILE__,__LINE__,FUNCTION__)
#define MEM_LOG_REALLOC(n,t,v,a) Perl_mem_log_realloc(n,sizeof(t),STRINGIFY(t),v,a,__FILE__,__LINE__,FUNCTION__)
#define MEM_LOG_FREE(a)          Perl_mem_log_free(a,__FILE__,__LINE__,FUNCTION__)
#endif

#ifndef MEM_LOG_ALLOC
#define MEM_LOG_ALLOC(n,t,a)     (a)
#endif
#ifndef MEM_LOG_REALLOC
#define MEM_LOG_REALLOC(n,t,v,a) (a)
#endif
#ifndef MEM_LOG_FREE
#define MEM_LOG_FREE(a)          (a)
#endif

#define Newx(v,n,t)	(v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
#define Newxc(v,n,t,c)	(v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
#define Newxz(v,n,t)	(v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safecalloc((n),sizeof(t)))))

#ifndef PERL_CORE
/* pre 5.9.x compatibility */
#define New(x,v,n,t)	Newx(v,n,t)
#define Newc(x,v,n,t,c)	Newxc(v,n,t,c)
#define Newz(x,v,n,t)	Newxz(v,n,t)
#endif

#define Renew(v,n,t) \
          (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_REALLOC(n,t,v,saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t))))))
#define Renewc(v,n,t,c) \
          (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_REALLOC(n,t,v,saferealloc((Malloc_t)(v),(MEM_SIZE)((n)*sizeof(t))))))

#ifdef PERL_POISON
#define Safefree(d) \
  ((d) ? (void)(safefree(MEM_LOG_FREE((Malloc_t)(d))), Poison(&(d), 1, Malloc_t)) : (void) 0)
#else
#define Safefree(d)	safefree(MEM_LOG_FREE((Malloc_t)(d)))
#endif

/* assert that a valid ptr has been supplied - use this instead of assert(ptr)  *
 * as it handles cases like constant string arguments without throwing warnings *
 * the cast is required, as is the inequality check, to avoid warnings          */
#define perl_assert_ptr(p) assert( ((void*)(p)) != 0 )


#define Move(s,d,n,t)	(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define Copy(s,d,n,t)	(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define Zero(d,n,t)	(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), (void)memzero((char*)(d), (n) * sizeof(t)))

/* Like above, but returns a pointer to 'd' */
#define MoveD(s,d,n,t)	(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define CopyD(s,d,n,t)	(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define ZeroD(d,n,t)	(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), memzero((char*)(d), (n) * sizeof(t)))

#define PoisonWith(d,n,t,b)	(MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
#define PoisonNew(d,n,t)	PoisonWith(d,n,t,0xAB)
#define PoisonFree(d,n,t)	PoisonWith(d,n,t,0xEF)
#define Poison(d,n,t)		PoisonFree(d,n,t)

#ifdef PERL_POISON
#  define PERL_POISON_EXPR(x) x
#else
#  define PERL_POISON_EXPR(x)
#endif

/* Shallow copy */
#define StructCopy(s,d,t) (*((t*)(d)) = *((t*)(s)))

/*
=for apidoc_section $utility

=for apidoc Am|STRLEN|C_ARRAY_LENGTH|void *a

Returns the number of elements in the input C array (so you want your
zero-based indices to be less than but not equal to).

=for apidoc Am|void *|C_ARRAY_END|void *a

Returns a pointer to one element past the final element of the input C array.

=cut

C_ARRAY_END is one past the last: half-open/half-closed range, not
last-inclusive range.
*/
#define C_ARRAY_LENGTH(a)	(sizeof(a)/sizeof((a)[0]))
#define C_ARRAY_END(a)		((a) + C_ARRAY_LENGTH(a))

#ifdef NEED_VA_COPY
# ifdef va_copy
#  define Perl_va_copy(s, d) va_copy(d, s)
# elif defined(__va_copy)
#  define Perl_va_copy(s, d) __va_copy(d, s)
# else
#  define Perl_va_copy(s, d) Copy(s, d, 1, va_list)
# endif
#endif

/* convenience debug macros */
#ifdef USE_ITHREADS
#define pTHX_FORMAT  "Perl interpreter: 0x%p"
#define pTHX__FORMAT ", Perl interpreter: 0x%p"
#define pTHX_VALUE_   (void *)my_perl,
#define pTHX_VALUE    (void *)my_perl
#define pTHX__VALUE_ ,(void *)my_perl,
#define pTHX__VALUE  ,(void *)my_perl
#else
#define pTHX_FORMAT
#define pTHX__FORMAT
#define pTHX_VALUE_
#define pTHX_VALUE
#define pTHX__VALUE_
#define pTHX__VALUE
#endif /* USE_ITHREADS */

/* Perl_deprecate was not part of the public API, and did not have a deprecate()
   shortcut macro defined without -DPERL_CORE. Neither codesearch.google.com nor
   CPAN::Unpack show any users outside the core.  */
#ifdef PERL_CORE
#  define deprecate(s) Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),    \
                                            "Use of " s " is deprecated")
#  define deprecate_disappears_in(when,message) \
              Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),    \
                               message " is deprecated, and will disappear in Perl " when)
#  define deprecate_fatal_in(when,message) \
              Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),    \
                               message " is deprecated, and will become fatal in Perl " when)
#endif

/* Internal macros to deal with gids and uids */
#ifdef PERL_CORE

#  if Uid_t_size > IVSIZE
#    define sv_setuid(sv, uid)       sv_setnv((sv), (NV)(uid))
#    define SvUID(sv)                SvNV(sv)
#  elif Uid_t_sign <= 0
#    define sv_setuid(sv, uid)       sv_setiv((sv), (IV)(uid))
#    define SvUID(sv)                SvIV(sv)
#  else
#    define sv_setuid(sv, uid)       sv_setuv((sv), (UV)(uid))
#    define SvUID(sv)                SvUV(sv)
#  endif /* Uid_t_size */

#  if Gid_t_size > IVSIZE
#    define sv_setgid(sv, gid)       sv_setnv((sv), (NV)(gid))
#    define SvGID(sv)                SvNV(sv)
#  elif Gid_t_sign <= 0
#    define sv_setgid(sv, gid)       sv_setiv((sv), (IV)(gid))
#    define SvGID(sv)                SvIV(sv)
#  else
#    define sv_setgid(sv, gid)       sv_setuv((sv), (UV)(gid))
#    define SvGID(sv)                SvUV(sv)
#  endif /* Gid_t_size */

#endif

#endif  /* PERL_HANDY_H_ */

/*
 * ex: set ts=8 sts=4 sw=4 et:
 */
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Z  Z         ! ے          o       <     w֔          Z  Z         !           
      $     xrX          Z|  Z        $ ! ʺ          D            \_*ǖ          Z|  Z         !              M     G+ɗ          Z|  Z         !                       ߾          Z  Z        $ ! Ý          ~      |     xg          Zw  Z        $ ! i          \            T          Z|  Z         ! ڒ                      f9
3          Zw cG Z    j & ! Q            	     (Q     m     Z cG Z    k & !          |      P     FO          Z cG Z     l & !             L-               Zr cG Z    m & ! S         |      G     ן          $Z $Z   7  e ! /         D            ^          $Z $Z   :  e ! /         L            e4          $Z $Z   =  e " /                     Q          $Z $Z   @   f " /         )           UQ          $Z $Z   C  f "                x	     Zy,          $Z $Z   F  f "           p      x	               $Z $Z   I  	f " /          xi          ƃ`          $Z $Z    L  f " /         -      	     o          $Zw $Z   O  f !" /         A           
)1          $Z $Z   R  f $" |          i          ƃ`          $Zw $Z   U  f ," /         A           Is          $Z $Z   X  f /" /         th          ƃ`          $Zw $Z   [  f 7" /         	      	     [EI          $Z $Z   ^  f :"           <JS         Q>          $Zw $Z    a   !f z" -               tW     S          $Zr $Z   d  $f " /                    M          $Z $Z   g  'f "           d[S         ug          $Zw $Z    j  *f " (:               tW     }0.          $Z $Z   m  -f "          $O         ^          $Zw $Z    p  0f # /               $     v          $Z $Z    s  3f # /         ,           ʮд          8Z 6i3 8Z   v     x # c,         $      u     ||     G     LZ 6i3 LZ   y  x # c,         ,      Tv     !||          LZw 6i3 LZ    |     x "# 0         4
      G     gyz          LZ 6i3 LZ        x %#          Hl     p    a`          LZw 6i3 LZ         x ># 0         \            ](
          LZ 6i3 LZ        x ?# 0               
     	@          LZw 6i3 LZ         x E# 0         =           +	          LZ 6i3 LZ        x H# 0               0     Xڼ          LZ 6i3 LZ         x M#                H     ѽ          LZ 6i3 LZ         x V# '         Q             H          LZ 6i3 LZ         x W# R         p           OKs          LZ 6i3 LZ         x r# 0         H      L     6M          8Zr 6i3 8Z        x     0         د            ̐          LZr 6i3 LZ     x     0         ȭ            ̐          8Z 6i3 8Z          z# 0         K             ʥvP          LZ 6i3 LZ         x {# 0         h9@           |*          Zw  $Z          # E         n      hB     1     (     Z  $Z         # E         Ā       D     O          Z  $Z         #                 d     |*          Z  $Z         #          z       D     T           Z  $Z         #          |       D               Z  $Z         #          D       T     ?A          Z  $Z         # E                T     So          Z  $Z         #                     Uy          Z  $Z         #          x            F          Z  $Z         #          w       D     jn          Z  $Z         #          ~       D     *z          Zr  $Z              E         +      <N     1z|          Z  $Z         Ř # E      (#      h@     Njz|          Z!  $Z         Ș # E         4      9     Jq          Z  $Z         ˘ # E         |       4     Ԯ̊          Z  $Z         Ϙ #       `o             d@          Z  $Z         Ә # E            X     V          Z!  $Z         ֘ # E         >           i6          Z  $Z         ٘ # E         5      d
     ;Dq          Z  $Z         ܘ # E                      S          Z2 !Z     1  # Z      -      L>     u      1     Z2 !Z    1 ó     Z         8p      Lr     ||          Z2 !Z    1 Ƴ $          ]$      0&     
y          Z2 !Z      1 ʳ 
$ \      B2      J     Uթ           Z2 !Z     1 г ,$ P      8      _     C¿          Z2 !Z    	 1 ӳ R$ Y         8&      8     T$          Z2 !Z     1 ֳ Y$ Y         s$      &     ̥          Z2 !Z    1 ڳ a$       0      ,E     w+          Zw " Z    6 Z o$ p         H%      0     w     6     Z " Z    6 ] t$ p         k                     ZV " Z      6 ` }$           p      *     ~W          ZV #Z   # 6 f     p         "           qx|     6     Zr cG Z   9      $           H       "     ̐     = 	    Zr cG Z   <     	     q         o
      l    
=      
    Zw cG Z    @     
 $ q ?     .                     Z cG Z   C      $ q                     ^h          Zw cG Z    G      $ q F                ݜ      
    Z cG Z   J      $ q                X     b c          ZL cG Z    M      $ q         L^       |               Z cG Z   P      $                       vX          ZX cG Z    S       $ q         PP       $     "a-          Z cG Z   V     # $ ;         $             ao          Z  Z          $ #          8           J     W                                                                         5.8.0-1+deb12u1    1.9.13p3-1+deb12u2   252.38-1~deb12u1   6.6.2+dfsg1-1+deb12u1    1:128.13.0esr-1~deb12u1    1:128.13.0esr-1~deb12u1.1~                       |	      Y >o      P           >o      R            }	
      Z >o      R           >o      tU            &}	
      [ >o      tU           >o      X            J}	       \ >o      X           >o      Z            n}	      ] >o      Z           >o      j]            }	     ! ^ >o      j]           >o      `            }	      _ >o      `           >o      b            }	      ` >o      b           >o      Ae            }	      a >o      Ae           >o      g            "~	"     " b >o      g           >o      j            F~	%      c >o      j           >o      
m            j~	(      d >o      
m           >o      o            ~	+      e >o      o           >o      r            ~	.      f >o      r           >o      t            ~	1      g >o      t           >o      Nw            ~	4     # h >o      Nw           >o      y            	7      i >o      y           >o      |            B	:      j >o      |           >o                  f	=      k >o                 >o      Ӂ            	@     $ l >o      Ӂ           >o      z            	C      m >o      z           >o      5            	F      n >o      5           >o      ͉            	I     % o >o      ͉           >o      u            	L      p >o      u           >o      F            >	O     & q >o      F           >o                  b	R      r >o                 >o                  	U     ' s >o                 >o      9            	X      t >o      9           >o                  ΀	[     ( u >o                 >o                  	^     ) v >o                 >o      6            	a      w >o      6           >o                  :	d      x >o                 >o      W            	g     * y >o      W           >o                  	j      z >o                 >o                  	m      { >o                 >o      2            "	p      | >o      2           >o      ݮ            T	s      } >o      ݮ           >o                  x	v      ~ >o                 >o      #            	y       >o      #           >o                  	|       >o                 >o      N            F'
     [  >o      N           >o           =       z'
       >o           =      >o      (     \       '
       >o      (     \      >o           S       '
       >o           S      >o           d       (
     0   >o           d      >o      >            u         >o      >           >o           J       ((
     7<  >o           J      >o      R           >o           2      >o           c      >o                 >o           =      >o      ?     Y      >o                 >o      -     P      >o      ~     c      >o                 >o                 >o      v                     M     >o           )       X       >o           )      >o           I              >o           I      >o           i              >o           i      >o      g           >o           a      >o      N     A      >o                 >o      L           >o      1           >o      
           >o      '     y      >o                  R     k  >o                 >o      8     c       v     F  >o      8     c      >o                       c  >o                 >o      >                   >o      >           >o      &            2     d  >o      &           >o                  V     e  >o                 >o            \            g  >o            \      >o      "                   >o      "           >o      %            ހ     f  >o      %           >o      (     E      >o      *           >o      h-           >o      0           >o      !3           >o      5     P      >o      8                     >o      8           >o      :            \         >o      :           >o      h=     W       P0         >o      h=     W      >o      ?            2{         >o      ?           >o      B     p              >o      B     p      >o      E     -                >o      E     -      >o      9G                 E  >o      9G           >o      I     [       y         >o      I     [      >o      L                 oz  >o      L           >o      N     t       X         >o      N     t      >o      Q     ~       @     F  >o      Q     ~      >o      S     C                >o      S     C      >o      U     H       R      ے   >o      U     H      >o      X            F         >o      X           >o      Z     [       d     ʺ   >o      Z     [                      >o      -]            m         >o      -]           >o      a            @m         >o      a           >o      c     T            Ý   >o      c     T      >o      	f     w       
     i   >o      	f     w      >o      h            & 
     ڒ   >o      h           R          &     >o      [k                 Q  >o      [k           >o      m     F              >o      m     F      T          &     U          &  >o      .p     |       @       >o      .p     |      >o      s     8       d     S  >o      s     8      >o      u     -      >o      x     @      >o      S|           >o      b~           >o                 >o           3      >o           /      >o           g      >o      S     ?      >o                 >o      %     T      >o      z     3      >o                 >o                 >o                 >o           
      >o                 >o      <           >o      ׯ           >o           n      >o                 >o           \      >o                 >o                 >o                 >o      a           >o                  9     /  >o                 >o                  <     /  >o                 >o      f            `?     /  >o      f           >o                  B     /  >o                 >o                  E       >o                 >o                  H        >o                 >o                  K     /   >o                 >o           X       PN     /  >o           X      >o                  Q     /  >o                 >o                  T     |  >o                 >o                  W     /  >o                 >o                   Z     /  >o                 >o      x            d]     /  >o      x           >o      P            .`        >o      P           >o                  .c     -  >o                 >o           n       /f     /  >o           n      >o      T            :/i        >o      T           >o                  ^/l     (:  >o                 >o                  /o       >o                 >o                  /r     /  >o                 >o      t             0u     /  >o      t            >o                  x z c,  >o                 >o      &            {     c,  >o      &           >o           X       @~     0  >o           X      >o                         >o                 >o      !     .            0  >o      !     .      >o      #            ޟ     0  >o      #           >o      &                 0  >o      &           >o      	)            0     0  >o      	)           >o      +            T       >o      +           >o      n.                  '  >o      n.            >o      o0            Ԡ     R  >o      o0           >o      05     l       
     0  >o      05     l      >o      7            .  0  >o      7           >o      9            .     0  >o      9           >o      ;            `Z  0  >o      ;           >o      =            R     0  >o      =           >o      B     d      >o      F           >o      $H     >      >o      cJ     D      >o      L     >      >o      N     C      >o      +Q           >o      S     Q      >o      EV           >o      Y     >      >o      O\                 E  >o      O\           >o      `     u            E  >o      `     u      >o      b            
       >o      b           >o      7e     }       .       >o      7e     }      >o      g            R       >o      g           >o      Ij     ~       v       >o      Ij     ~      >o      l                 E  >o      l           >o      So                   >o      So           >o      fs     Q              >o      fs     Q      >o      u     .              >o      u     .      >o      w     )       *       >o      w     )      >o      z            Z     E  >o      z           E               E            E          Ø  >o      {            
     E  >o      {           >o      w~     f       P     E  >o      w~     f      >o      ހ     _            E  >o      ހ     _      E          ͘     >o      >     a              >o      >     a      E          ј     >o           e       R     E  >o           e      >o           s
            E  >o           s
      >o      z                 E  >o      z           >o      C                 E  >o      C           >o           -      >o      /     b      >o           &      >o           @                س     >o           0       $!     Z  >o           0      >o      +            ^!     Z  >o      +           >o      %            !       >o      %                          >o                  !     \  >o                 E          ̳     Z          ͳ  Z          γ  >o      ;            n!     P  >o      ;           >o      ܶ            !     Y  >o      ܶ           >o      h            !     Y  >o      h                          >o      [     3       !       >o      [     3      >o           7      >o                  >o  %      +      >o                 >o                 >o      ~     n      >o           /      >o                  X#     p  >o                 >o                  #     p  >o                 >o                  #"        >o                 >o      >     
       #%     p  >o      >     
      >o      L     F      >o           [      >o           q      >o      a           >o           s      >o      b           >o                 >o      s           >o      [     f      >o           p      >o      3           >o                 >o           *      >o                 >o      =      U      >o           S      >o                 >o           [      >o      
     U      >o      Z            %;        >o      Z           >o                  8%>     q  >o                 q               >o                  %B     q  >o                 >o           C       %E     q  >o           C      q          ?     >o                  %I     q  >o                 >o           D       4%L     q  >o           D      >o           y       n%O     q  >o           y      >o      k     U       %R       >o      k     U      >o            O       %U     q  >o            O      >o      #     U       %X     ;  >o      #     U      Ɛ&XZ     r  ?o      f	           Ɛ&HX\     r  ?o      |n	           Ɛ&lX^     r  ?o      r	           Ɛ&X`     r  ?o      vt	           Ɛ&Xb     r  ?o      	           Ɛ&BXd     r   ?o      =	     
      Ɛ&Xf      r  ?o      H	            Ɛ&Xh     "r  ?o      ̯	           Ɛ&nXj     #r  ?o      	           Ɛ&Xl     %r  ?o      o	           Ɛ&(Xn     &r  ?o      	     2      Ɛ&fXp     (r  ?o      H	           Ɛ&HYr     )r  ?o       
     -      Ɛ&HYt     +r  ?o      
     V      Ɛ&HYv     -r 	 ?o      Q
     x      Ɛ&|IYx     /r 
 ?o      
     -      Ɛ&IYz     1r  ?o      
     V      Ɛ&bJY|     3r  ?o      O
     x      Ɛ&JY~     5r 
 ?o      
     -      Ɛ&^KY     7r  ?o      	
     V      Ɛ&KY     9r  ?o      M
     x      Ɛ&KY     !r  ?o      
     -      Ɛ&LY     $r  ?o      
     V      Ɛ&:LY     'r  ?o      K
     x      Ɛ&`Z     0  ?o      T;            @o              _       Z  #   @o              _      @o      `             }      (   @o      `            Ɛ&Z     #   Ao                    Bo              u       t      <   Bo              u                 N	     Bo      v             Q      }   Bo      v                       R	     Bo                         [   Bo                  Bo                            Bo                  Bo                   `     v  Bo                  Bo                   `        Bo                             _	     Bo      -             `     ]  Bo      -            Bo                   `        Bo                  Bo            M       `     z  Bo            M      Bo            ;                 Bo            ;      Bo      (!                     ! Bo      (!            Bo      $                  D " Bo      $            Bo      (      :       N     D # Bo      (      :      Bo      +      V            D $ Bo      +      V      Bo      2/      u            D % Bo      2/      u      Bo      2             ^     D & Bo      2            Bo      -5                  D ' Bo      -5            Bo      L8                    ( Bo      L8            Bo      ;                  D ) Bo      ;            Bo      =              B     D * Bo      =             Bo      @      t       f     ; + Bo      @      t      Bo      WC                  D , Bo      WC            Bo      0F                  D - Bo      0F            Bo      H             (      . Bo      H            Bo      L             ^     D / Bo      L            Bo      O                  7 0 Bo      O            Bo      }U                  D 1 Bo      }U            Bo      bX      o       D     D 2 Bo      bX      o      Bo      Z             h      3 Bo      Z            Bo      ]                   4 Bo      ]            Bo      ob                  D 5 Bo      ob            Bo      ke      W            D 6 Bo      ke      W      Bo      h             P     D 7 Bo      h            Bo      \m             t     D 8 Bo      \m            Bo      q      V            D 9 Bo      q      V      D          E     Bo      Zt                  f  : Bo      Zt            D   [    I     Bo      jx      0            < ; Bo      jx      0      Bo  % }      Y      Do                    Do            J/      Do      .5      n      Do      ;            Do      >      6      Do      B            Do      yE            Do      J            Do      ,M      \      Do      Q            Do      "V            Do      a      t      Do      @f      d      Do      h            Do      Mn      t      Do      s            Do      ev      ,      Do      y            Do      ,|            Do      .            Do            T      Do      ?            Do      /      <      Do      l      (      Do            m      Do                  Do      	            Do            2      Do      ;      U      Do                  Do      l            Do      R            Do      Ӵ      n      Do      B            Do      '      x      Do            2      Do      Ӿ            Do                  Do                  Do                  Do      Y            Do                  Do      o      \      Do                  Do                  Do                  Do      V      E      Do            {      Do                  Do            d      Do      [            Do             w      Do      x            Do      r            Do            :      Do      I            Do                 Do           ^      Do      *           Do      
     t      Do      =           Do           =      Do      7           Do      H     X      Do                 Do      l           Do      !           Do      $     M      Do      '           Do      )     t      Do      ?,           Do      10     I      Do      {2           Do      '5     t      Do      8           Do      :     j      Do      #=           Do      ?           Do      ZC           Do      1F           Do      6K           Do      M            Do      Q                                        { ?       e" |     e" |      Q  |     Q  |          e" }      e" }       } N      e" ~      e" ~       	 e"      
 e"         W      X     
 e"       e"       Q   ]    Q            e"       e"          `      e"       e"         e"       e"         J      K      K
  Q    m  v    R  Oo    5  Ro          Je"  !     Ke"     ! 5     " xT	  Y   # h         $ i   ^   % j   _   & k      ' l       ( m       ) n         *    ! + c  M ! , j       - \   ! .    ! / á  N ! 0   ey     1 \  ! ! 2   ! 	! 3 o           4 p   ~ ! 5   :     6   ! 
! 7    ! 8   L ! 9    ! :   6 ! ;   r ! <   U ! =   z ! >        ?   ! ! @ |   ! A   !     B f  + ! C ?  
 ! D \  ! ! E    ! F :  8 ! G    ! H 
  y ! I {	     ! J    !! K T	  ! "! L U	   #! M O   $! N %   %! O   v &! P \  ! '! Q    (! R :   )! S $   *! T x  ! +! U T  3 ,! V أ   -! W 6  m .! X    0 /! Y    0 0! Z Le"  1! 1! [    0 2! \    /!     ] Me"  >!     ^ Ne"  0 5! _ \  ! 6! ` >  0 7! a   ! 8! b I  y 9! c Ц  
 :! d g  0 ;! e &O   <! f U	  "! =! g \  &! >! h    4!     i    @! j         k   5! B! l P       m Oe"  3d D! n Pe"  W!     o G  n F! p    \ G! q    ^ H! r 
   d I! s    h J! t 0  \ K! u X   L! v |   M! w S?  =d N! x E@  u O! y F@  X P! z \  A! Q! { P  B! R! | 	   S! }   s T! ~    } U!     } V!  Ҧ  x W!     & X!  B   Y!    | Z!     [!    Z \!     Z ]!     Md ^!    M _!  Ŧ  e `!  |  Pd a!  xo   b!     Rd c!     a d!    ; e!     Ud f!  :  ^ g!  
  Wd h!         i!         j!  BN   k!         l!  L  [)         ] n!  Qe"  ! o!  F@  O! p!    P! q!  P  Q! r!  	  R!         Y t!  Qe"  xd u!  F@  o! v!    p! w!  P  q! x!  	  r!      m   z!    jd {!             _ }!  Qe"  t! ~!    v! !  P  w! !  	  x!         m! !     I! !  Qe"  }! !  F@  u! !    ~! !  P  ! !  	  ! !     ! !     !      \  ! !    | !    '! !    L !    t !    ! !    ! !    !        ! !    V! !    .      \  ! !  N  S!      \  ! !  M  / !  N  ! !  O  #! !  P   !  Q  ! !    ! !  i        Re"  ! !  J    !  K    !  Q  Y)        !         !  J  ! !  K  ! !  Se"   !  Q  !      A  < !    ! !  B  X!        ! !  J  ! !  K  ! !  Te"  ! !            ! !  \  ! !  W   !    "      J  ! !  K  ! !  Ue"  !        !      i  ! !  j  )        ! !    ! !    hb !    ! !     !    _      \  ! !  !  !        ! !    ! !     !  	  l !    ! !    1 !    ! !    ! !    ! !  |  ! !     !  t  ! !    *! !        !    N !  i  ! !    Y! !      !    4 !     !      N   !  \  ! !    ! !    9 !    !      !  !      J  ! !  K  ! ! 	 Ve"  #     
 e   !  f  ! !  أ  ,! ! 
 \  ! !  g  ! !    ! !  h  !      We"  ! !    R !  !           \  ! !          f  ! !  \  ! !  S   !  
  8 !  O  ! !    ! !    ! !     !  أ  ! !  Q  [ !   J  ! ! ! !  W ! " K  ! ! # T  +! ! $ !          %    ! ! & j  !     ' Xe"  :" ! (   ?!     ) Ye"  $  " *   !     + Ze"  " " ,    "     - [e"  # " . 	   " / \e"  8" " 0 	       1 ]e"  z" " 2   /o 	" 3 ^e"  "" 
" 4        5 _e"  $ " 6   " 
" 7 `e"  -" " 8 	  "     9 ;  6 " : \  ! " ;   7! " < Q  ! " =    " > \  =! " ?   ! " @   !     A Xe"  ~ " B ;  " " C \  " " D   " " E   " " F   " " G \  " " H   " " I   "  " J }!          K Xe"  " "" L ^e"   #" M   p     N ;  " %" O \  " &" P   " '" Q Q  " (" R   " )" S \  " *" T   " +" U   "     V Ye"   -" W `e"   ." X   #"     Y ;  $" 0" Z \  %" 1" [   &" 2" \ Q  '" 3" ]   (" 4" ^ \  )" 5" _   *" 6" `   +"     a Ze"   8" b \e"   9" c   ."     d Xe"  !" ;" e 4  '  <" f 5   =" g 2  { >" h }!   ?" i }!   @" j 'M   A" k ;  /" B" l    C" m f  0" D" n R   E" o R   F" p   1 G" q   C H" r E1  M I" s   & J" t B=  J K" u    L" v +   M" w w   N" x }  1" O" y   n P" z    Q" {   2" R" | O  b
 S" } M  	 T" ~ 	  %  U"  	   V"  jL    W"  <   X"  
V  w9	 Y"  }!   Z"  +  . ["    3" \"  Z  ! ]"  [   ^"  N  2 _"     `"  S  7 a"  i   b"  :  t c"  X  | d"  }!  ' e"  _   f"  \  4" g"    5" h"  ѣ   i"     j"  N  	 k"  	   l"    ! m"  	  V n"  "  W o"     p"     q"     r"     s"    6" t"  H   u"  p  } v"     w"     x"  	  $  y"  }!  M      ]e"   {"  ae"   |"    Lm }"  Q   ~"  be"        }!      "    {!      Ye"  ," "  4  ;" "  5  <" "  2  =" "  }!  >" "  }!  ?" "  'M  @" "  ;  A" "    B" "  f  C" "  R  D" "  R  E" "    F" "    G" "  E1  H" "    I" "  B=  J" "    K" "  +  L" "  w  M" "  }  N" "    O" "    P" "    Q" "  O  R" "  M  S" "  	  T" "  	  U" "  jL  V" "  <  W" "  
V  X" "  }!  Y" "  +  Z" "    [" "  Z  \" "  [  ]" "  N  ^" "    _" "  S  `" "  i  a" "  :  b" "  X  c" "  ?  Z "  _  e" "  \  f" "    g" "  ѣ  h" "    i" "  N  j" "  	  k" "    l" "  	  m" "  "  n" "    o" "    p" "    q" "    r" "    s" "  H  t" "  p  u" "    v" "    w" "  	  x" "  }!  y"      _e"   "  ce"  
 "    |" "  0	   "  de"  
      Ze"  7" "  4  " "  5  " "  2  " "  }!  " "  }!  " "  ;  " "    " "  f  " "  R  " "  R  " "    " "    " "  E1  " "    " "  B=  " "     " "  +  " "  w  " "  }  " "    " "    " "    " "  O  " "  7   " 	 M  " " 
 	  " "  	  " "  jL  " " 
 (N   "  
V  " "  }!  " "  +  " "    " "  Z  " "  [  " "  N  " "    " "  S  " "  i  " "  :  " "  X  " "  ?  " "  _  " "  \  " "    " "  ѣ  " "    " "   N  " " ! 	  " " "   " " # 	  " " $ "  " " %   " " &   " " '   " " (   " " )   "  # * H  " # + p  " # ,   " # -   " # . 	  " # / }!  "     0 [e"   # 1 ee"  O # 2 O  P 	# 3 0	  " 
# 4 fe"  R     5 _e"  " # 6 ;  " 
# 7 \  " # 8   " # 9 7  " # :   " # ; ?  " # < \  " # =   " # >   " # ? }!          @ :  } # A U	  ~ # B ~!      # C ~!  \\ # D ~!   # E oq  ql     F :  # # G U	  # # H ~!  # # I ~!  #  # J ~!  # !# K oq  #     L ~!      ## M ~!   $# N ge"  #     O 
   &# P ?  ! '# Q X
  
 (# R \  
# )# S   " *# T R  # +# U   p ,# V O  " -# W {   .# X   y /# Y     0# Z   q 1# [ ~!  
 2# \   ! 3# ] 2  t 4# ^ .>   5# _ P   6# `   w 7# a ~!   8# b he"  # 9# c   " :# d   ! ;# e   # <# f ie"   =# g je"       h ke"  #     i   (# @# j R  *# A# k   0# B# l ~!   C# m   :# D# n O  ;#     o le"  B# F# p ~!   G# q ~!  F#     r   ?# I# s   )# J# t   @# K# u /  +# L# v   2#     w \  H# N# x   J# O# y p  $ P# z   L# Q# { ~!   R# | ~!   S# } ~!  E# T# ~   D# U#  me"  #      ne"  z#      \  M# X#    ! Y#    I# Z#  R  N# [#  U	  <! \#  $   ]#  Ƹ   ^#  p  O# _#    P# `#  r  x a#  0   b#    # c#  oe"  Q# d#  pe"  R# e#  ~!  S# f#    T# g#  Z   h#  [   i#  W  g# j#  b  I k#  ~!   l#  ~!   m#  ~!   n#  qe"  # o#  re"   p#  ~!   q#  ~!  m#      ~!      s#     t#    9" u#    ! v#  K   w#  ~!      x#  ~!  G# y#  ~!  ##      se"  q#      \  W# |#    # }#    Y# ~#  R  Z# #  E  `} #    \# #    ]# #  2  m #  p  ^# #    _# #  a   #  b   #  c   #    S] #  v   #     #  r  `# #    # #  ~!  c# #  ~!  d# #  ~!  e# #    f# #  me"   #  n  \ #  ~!  p# #  ~!  l# #     #  ~!  # #  ~!  #      te"  # #  ue"  # #  ve"  # #  we"  # #  xe"  # #  ye"  # #  ze"  # #  {e"  # #  |e"  # #  }e"  #        {# #  l   #  !        h  # #  !   #  l  # #  !  #        # #  l  # #  !  #      \  # #  l  # #  !  #      \  # #  l  # #  !  #      h  # #  !  # #  !  # #    #      \  # #    n #    !! #  B  ! #  !  # #  g   #  h   #  i   #  j   #  !   #  m   #  !  # #    \
 #    C# #    #      \  # #  l  #      }  #        #      !   #  !        ~e"  #      !      #  !      #  !           !   #  !  # #  !  #      f  # #  $  q[ #    ! #  !  # #   h  # #  i  # #  j  # #  k   #  m  # #  !  # #    # #    u# #    } # 	   # # 
 e"  # #  R  ) #  !      # 
 !      #  !  ] #  գ  - #  !  . #  ϣ  /      e"  0      sR  1 #  T  ! #  X  K! #  !      #  \  # #  !  # #  m  # #    # #     #  !  >      \  # #  m  # #  !  = #   !  # # ! !  #     " e"  a$ # # N  ! # $    # % \  # # &   }# # ' zg  ^O # ( W  ! # )   b#  $ * :  (! $ +   " $ ,   M $ -   M $ .    $ / {g  M $ 0    #     1 >  +M $ 2   E 	$ 3 R  E 
$ 4 N  z $ 5    $ 6 !  >L     7 e"  E $ 8 N  # $ 9   # $ : f  # $ ; o  " $ <   # $ =   ! $ > q  # $ ? W  # $ @   # $ A   ! $ B :   $ $ C   $ $ D    $ E   $ $ F d  F $ G 6}
  M $ H e  m $ I 	  dO  $ J   F !$ K q  eO "$ L g  F #$ M 
   $$ N h  fO %$ O j  Y &$ P !  F '$ Q    ($ R   $ )$ S {g  $ *$ T L  M +$ U    $     V e"  
$ -$ W !  G .$ X !  # /$ Y 2    0$ Z N  $ 1$ [   $ 2$ \ f  $ 3$ ] ٧   4$ ^   " 5$ _ !  $ 6$ ` W  " 7$ a   $ 8$ b   $ 9$ c !  K :$ d q  $ ;$ e W  $ <$ f   $ =$ g   $ >$ h :  $ ?$ i   $ @$ j   M A$ k   ($ B$ l {g  )$ C$ m L  *$ D$ n !      E$ o !  K F$ p !  +$ G$ q !   H$ r !  L I$ s !  F$ J$ t    K$ u    L$ v !      M$ w    z N$ x 
  z O$ y M   >F P$ z !  H$ Q$ { !  E$     | !  w S$ }   K T$ ~ !      U$  !  DF V$  _  EF W$  f  FF X$  b  GF      e"  ,$ Z$  \  2$ [$  Z  i# \$  [  h# ]$  !  $ ^$  !  $ _$  !  ]$ `$  !  ^$      e"  Y$ b$  N  0$ c$    1$ d$  f  Z$ e$    7$ f$    8$ g$  q  :$ h$  W  ;$ i$    <$ j$  :  >$ k$    ?$ l$    A$ m$  {g  B$ n$    $      e"  $ p$    " q$  8  Z r$  T!   s$  U!  Z         u$  h  d$ v$  ޡ  ~# w$  V!  " x$    # y$    " z$  W!  # {$    9# |$    "        " ~$    t$ $  \  u$ $  R  " $    " $    " $  ޡ  v$ $  V!  w$ $  9  Z $    " $  e"  " $  T	  x$ $    " $  S  " $  	  # $    y$ $  	O  z$ $  O  {$ $    |$ $  e"  Z $    # $    Z $    Z $    Z $  X!  Z $  Y!  Z $  ^9  Z $  +  Z      O  z $  w  z $  SN  z $  ]  z $  *  z $  +  z $  P  z $  
S  z $    z $  6   z $  
  z $  ֡  z $  P  `{ $  V  z $  !      $    z $  !           e"  $ $  !  z $  !  $      \  $      e"  z $  !  $ $  !  $      ǣ  $      e"  z $    # $    $ $  h  $      أ  ! $  O  z $  e"  z      e"  $ $  \  $      f  ! $  e"  z      \  u| $  ]  
 $  ^  \ $  _           m  H9 $  n      $  o  $      գ   $  Z  [$ $  [  \$ $  ֣  L $  ף  $      أ  $ $  j  V $    $ $  S  ! $     $  $   $  W  h$ $  e"  %! $    $ $     $    e $    n$ )     4.5.0-6+deb12u1    9.2.5+ds-0+deb12u3   2.9.4-4+deb12u1    2.38.1-5+deb12u1   1:2.38.1-5+deb12u1   7.1.1-2+deb12u1    2.48.3-1~deb12u1   4.0.6-1~deb12u1    4.0.11-1~deb12u1    1f317b04f78374dba7d1e14def0b7f80   4.17.5+23-ga4e5191dc0-1    2:21.1.7-3+deb12u10    42.2-1+deb12u1   42.1-2+deb12u1   3.8.0-11+deb12u1  g /var/lib/apt/lists/security.debian.org_debian-security_dists_bookworm-security_main_i18n_Translation-en   v /var/lib/apt/lists/security.debian.org_debian-security_dists_bookworm-security_non-free-firmware_binary-amd64_Packages   3.20230719.1~deb12u1    23fa6bfa66f5bae20d70af0ec3052425                                                          L3[  L3[     W  L $ (          t      \-    ֳ     W      4[X F 4[    I  d $ <          |^           '     I      4[ 2Q 4[    mS  W. $ }       @$      Z     Vu          4[ 2Q 4[    rS  g. ) [             (               4[ 2Q 4[    qS  c. ;)           X      d     !b2          4[ 2Q 4[     s C) v         4
      w     "MK          4[ 2Q 4[     v N)                                4[V 2Q 4[     z P) ]            p     <          [w  [      V)           <%           @          [r  [          z         W$      v     >!||          [  [    I  ^ X)           h      ^     tA>          [|  [    I  a Y)           x      #     {          [ S [    }  \) D         L
      :     Y/           $[| S [     ~  o) D                     6?      !    $[w S [      s) D                     |7O      "    $[ S [      y) D         z      	     Pڿ      #    [ S [     
 ) D         \            f       $    [ S [     
 ) D         $           HՁ      %    [ S [      )           0E           F]      &    [w S [      ) D         4       @     f      '    [w S [      ) D                     v      (    [ S [      ) ;         `                   )    $[L S [       ) D                     j͒!      *    $[w S [       ) D         |             v      +    [L S [      " )          H&+      V    ~      ,    [ S [      % ) D                t     4F%	      -    [ S [      ( ) 7         s      =     RW
      .    [ S [     + ) D         v             l      /    [ S [     . ) D         dW      T     +8      0    [ S [     1 )          Y      h     'ÿ

      1    [ S [      4 )                LE     (      2    [ S [     7 
* D         <      (     ߦ      3    [ S [     : * D               l     Q      4    [ S [     = "* D         JV          px>a      5    [ S [      @ ;* D         !      T     LN/      6    [ S [     C K* D               ,     7      7    [ S [       G X* f                  b      8    [ S [     K e* <      @`           셫      9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       3.20250512.1~deb12u1  t /var/lib/apt/lists/security.debian.org_debian-security_dists_bookworm-security_non-free-firmware_i18n_Translation-en  I /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_InRelease    stable-updates  
 12-updates   bookworm-updates  Z /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_main_binary-amd64_Packages   20230311+deb12u1   1:9.2p1-2+deb12u7                 a 
)     b )     )     )    $ )     )          f  $ )  أ  $ )  h   ) 	 3  6 ) 
 T  # )  e"  P) )     ) 
 ڧ  J )    # )  Z  $ )  [  $ )  <  s )  N  b$  )    $ !)    v ")  f  ! #)  $  $ $)  	  .# %)  V  ! &)  W  $ ')  e"  $ ()    i$ ))  
  ~ *)    $ +)    $ ,)     -)      .) ! 
   /) "   J$ 0) #   K$ 1) $ Ŧ  _! 2) %    3) &   $ 4) '    5) (   ) 6) )   ) 7) *    8) +   m 9) ,   ) :) -   )     . e"  8) <) / \   ) =) 0    >) 1   =) ?) 2    @) 3   >) A) 4   @) B) 5   ?)     6 e"  ;) D) 7 e"  O) E) 8 e"   F) 9   $ G) : W  ; H) ;   X I) <   <) J) = 8Q   K) > W  &) L) ?   ') M) @   *)     A e"  C) O) B e"       C *O  N) Q) D Z  9) R) E \  I) S) F Q  $ T) G 7  $ U) H [  Q)     I e"  Z) W) J ]       K \  R)     L \  X) Z) M ӣ   [) N ԣ       O j  N ]) P tR   ^) Q e"  x* _) R    `) S    a) T K  b b) U ^  c$ c) V \  Y) d) W Ԧ  [ e) X "T  o f) Y #T   g) Z $T  m h) [ (   i) \    j) ] F  # k) ^ %T  ? l) _ e"  wH m) ` :  z n) a B^       b \  c) p) c 'T  q q) d Ԧ  d) r) e "T  e)     f   ! t) g e"  @* u) h 	(  l v) i )T   w) j *T   x) k   !     l \  o) z) m @   {) n   2 |) o "T  r) }) p #T  f) ~) q $T  g) ) r +T   ) s ,T   ) t -T   ) u .T  Tq ) v /T          w e"  ) ) x ^  b) ) y \  y) ) z 1T  J     { 	  ) ) | 2T  %) ) } e"  X ) ~ ^  ) )  \  ) )  "T  |) )  3T  I      e"  ) )  ^  ) )  i  ) )  "T  ) )  $T  ~)      e"  `*      e"  h* )  6T  l )  7T  ) )  8T  )      ^  ) )  \  ) )  7T  )      e"   )    $ )    ) )    j) )  i  ) )    
 )  "T  )        s) )  9T  x )    x) )  e"  )      ;T  { )  <T  | )  e"  ) )    ) )    ) )    ) )  ^  ) )  \  ) )  /  K# )  =T  ) )    ) )  "T  ) )  $T  ) )  >T  + )  n   )  ?T  ) )  @T  )      e"  ) )  \  ) )  Ԧ  q) )  P  ! )  "T  )      f  ) )  j  $ )  h  ) )  ١  ) )  ڧ  ) )    ) )  2   )  e"  H* )  e"  f* )  e"  g* )    `) )    ) )  y  ) )  \  ) )  o  | )  /  ) )  @  z) )  DT  ) )  Ԧ  ) )  "T  ) )  ѣ  " )  #T  }) )  $T  ) )  e"  ) )  ET   )    U) )  iq  m) )  w8  ' )  FT  ) )  GT   )  HT  ) )  IT   )  JT   )  KT      )  LT  ) )  MT  { )  NT  , )    7) )     )    ) )  OT  )      e"  w* )  QT  ) )  RT  ) )  2  ) )  ET  ) )  ST  ) )  TT  ) )  HT  )      UT  G )  VT  )        ) )  Z  ) )  [  ) )    8        ) )  0   )  e"   )  e"  ) )    ) )  WT  ) )  \  ) )  o  ) )  /  ) )  Ц  9! )  @  ) )  $  #  *  Ԧ  ) *  P  ) *  "T  ) *  #T  ) *  $T  ) *    # *    	 *  XT  ) *  FT  ) 	*  
   
*    ) *  9  ) *  YT  *         ) *  ZT  ) *  P
   *  	(  u) *  *T  w) *  )T  v) *  [T   *  e"  ) *  \T  * * 	 ]T  *     
   c
 *  e"  * *  e"  ) * 
 ^  ) *    ) *  f  ") *  /  ) *  "T  * *  #T  *  *  $T  * !*  ^T  *      |  L! #*  ?  R $*  @  S %*  _T  * &*  \  * '*    X# (*  ޣ  * )*    # **  Ц  ) +*     ,*  @  ) -*   `T  !* .* ! V  ) /* " Ԧ   * 0* #   () 1* $ "T  * 2* % #T  * 3* & aT   * 4* ' (  h) 5* ( bT  * 6* )   M) 7* * cT  5* 8* + dT  * 9* , eT  7* :* - fT  8*     .   ) <* / e"  * =* 0 _T  %* >* 1 \  &* ?* 2 /  (* @* 3 `T  -* A* 4 Ԧ  /* B* 5 P  * C* 6 OO  h D* 7 "T  1* E* 8 #T  2* F* 9 aT  3* G* :   9* H* ; e"  ) I* < e"   J* = hT       > e"  <* L* ? ^  =* M* @   >* N* A /  ?* O* B "T  D* P* C #T  E* Q* D $T  F* R* E (  4* S* F 7  ' T* G iT  ( U* H jT  3$ V* I kT   W* J lT  :*     K e"  ) Y* L e"  K* Z* M =  d [* N ^  L* \* O \  M* ]* P /  N* ^* Q Ԧ  A* _* R P  B* `* S `  C* a* T "T  O* b* U $T  Q* c* V L  d d* W 
  	*     X f   ) f* Y e"   X* g* Z e"   ;* h* [ e"   G* i* \ j   ) j* ] y   [* k* ^ \   \* l* _ /   ]* m* ` @   ,* n* a Ԧ   ^* o* b "T   a* p* c #T   P* q* d $T   b* r* e e"   Y* s* f mT   W* t* g nT   r* u* h 3T   ) v* i 1T   ) w* j oT   s* x* k pT   t* y* l qT   M     m                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            3.0.17-1~deb12u1   2:4.17.12+dfsg-0+deb12u2  # 2:2.6.2+samba4.17.12+dfsg-0+deb12u2    2:4.17.12+dfsg-0+deb12u2~   X /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm-updates_main_i18n_Translation-en   /var/lib/dpkg/status   Debian dpkg status file    now                   Do      V     ,      Do      X           Do      [     q      Do      B^           Do      X`           Do      c           Do      f     U      Do      i           Do      j     8      Do      
o           Do      r           Do      u           Do      {x           Do      u{           Do      z}           Do                 Do                 Do      9           Do      ό     ?      Do                 Do      -     P      Do      ~     |      Do           G      Do      C     d      Do                 Do           E      Do      ڧ     9      Do                 Do           B      Do      E     P      Do           [      Do                 Do           G      Do      ?     T      Do                 Do      {           Do      `     %      Do                 Do      U     y      Do           J      Do           $      Do      ?           Do      ;           Do                 Do           j      Do      W           Do                 Do           !      Do           3      Do                 Do                 Do                 Do                 Do                 Do           ;      Do                  Do           &      Do                 Do                 Do      O           Do      
           Do                 Do      I     :      Do                 Do      Z     @      Do            b      Do      "           Do      '           Do      +           Do      >.           Do      	1           Do      5     2      Do      !:     _      Do      <           Do      e>           Do      xF     J      Do      K           Do      N     >      Do      P     H      Do      2S     	      Do      M\           Do      %_           Do      b     p      Do      |e     &      Do      g           Do      Oi           Do      k     $      Do      o           Do      &r           Do      3x     -      Do      a}           Do      F           Do                 Do                 Do      4     U      Do           -      Do                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ELF          >                    8\         @     @ 4 3          GNU ;n~N Fś        Linux                Linux   6.1.0-37-amd64      @  HiH8H(	  H   HH      f  f  f  fl  y    Q
w6   uNq   )yHc)Hc'uQI։HcHc11
    H  H  f  f      f  f      y    )Q  i 
  ڍ  	ff.     @                H  HP8@  HiH  H   Htx t1  u  f1        fD      H  HP8@  HiH  H   Htx t1  u  f1        fD      H  HP8@  HiH  H   Htx t
    1        D      H  HP8@  HiH  H  Htx t
    1        D      H  H@8Ht@@  Hiɐ=    H8uƀC  ƀE  HA(f  "tB1    @     HF   1    ff.         SHH  H   Hu[        H       H    [         AWAVAUATUSDÉH9LH  MH4$@G  HGhIAHHHD$    0  IcM   A@   H4$HL    LALDL    AărhI   HMMHHE ITHTH)I)r1I4H49rH|$    HD[]A\A]A^A_    uatA   E tADfD뺀=     :@   HH    H    HD$        HD$A   E ADDbAaAVf    AUATUSH  HP8@  HiH8    LH     f       ~D  L   L    HA   H       H    AD$ LAD$    xN1[]A\A]    H    H        uuAD$H    H        h@     AVAUATAUHSH  HP8@  HiH8L   LH  L    A      H    At5HH    L    A~
t5[]A\A]A^    HH    L    A~
uI  HtDH        H    H  eH%(   HD$HH  HL$fT$D$
 x u3   A   HL$
Ht$DHT$eH+%(   u-H     A   HL$
   H<$Ht$
H<$    f    ATUHSHH  HP8@  HiL8I$H  { t_H   Htw    x=U St2{ t,I$   H    C LHD$    D$H[]A\    {
CtE t01H[]A\    1HD$    H    H9ỹCH  Hx8C1D      AUATL   USHLH  L    HA   H    H       H    HEAEL    []A\A]        AWAVAAUIATAUSH=    @  ~fu<H[]A\A]A^A_    AAH    H    H        tHiC6DsI-8L   L        LH  ~D  AGE1Ʉ       DD%        5    D8rRAAƀA   HH       H    DL$D5    |DL$D	A uDL    EwAH    H        XHAAGSH	ff.         AUATUS@  HiH8    LH  ~fL   L    t6    LfAE    1[]A\A]    H    H        HA   H       H    pL    fAE    tff.     @     AWE1AVAUATUSHL   H4$I$   M$H  HHD$         IcHD7  f9  AUуɀ
      sV    36    f  SH=    HsH        McH$LIA@   H    H    N4CAV    I$H  S@/  AVI~H?    H    A    D9   H<$IcEwAUHHCA9f9   AM	ʈ    J  SL
    36
    f   f=    HsHH        I$H  SA@   H    H    L@8  ED9)H|$    HD[]A\A]A^A_    f   AES    <   B        ?        I$H  A@   LH       H    @x^SH{H?    H        3fuKqAUуɀ
    {    36|    ~fH|$A    H    H    A    H|$    ff.     @     ATUS@  HHiH8LH  AD$
<   wT<   H        HR  H(	     `   H       H    H           <   H        H   H(	  H   H        H    H        H<uDH        H   H(	  H   H        H    H        H            H        H   H(	  
   `   H       H    H        릿   H        H        H       H        H        H       H        H        H       H        H        H%            AWAVAUATUSHL   wXA@  HiM     H      D   A'   A   D$ H]`E1=    ~D  <   <w  <      ~D  AHE9 
  H    H    H2IH[]A\A]A^A_    t    tޅ    D   A'SAtNDKDDDH    H        <FAF
<   <  u#C D$CAFCAFCAFCD$uAfL=    D  5       D  A@  HiI  HS
    ʅ~D  1ɾ           f<XCD$CAFCAFCAF0A@  HiI  H;S1ɾ   ʉ    #HH    H        HH    H        HH    H        HH    H        H    H    T$    T$1ɾ   A@  HiI      r{tCAFCAF,CD$CAFCAFf.         AVAUATUSHHHW(LH  eH%(   HD$1H$      f="tRf="   f=    1I            HD$eH+%(     HL[]A\A]A^    A  L   I   LH    L       Aƅ  H<$I        A  L   I<tf<uHLH    L       Aƅ  H<$I    3Aƅ  1I    LH    L       LH    L    uAƅ  H<$I    LH    L    uAƅ  H<$I    Aƅ   H<$I    Aƅ   H<$I        Aƅ  H<$I        b    ff.     f    ATUS@  HHiL8I$H  EID$(  f="  f="_  f= n  H(	  H  H     H   H(	  H(  H   H(	  H0  H   H(	  H   H   H(	  H8  H  H(	  Hǀ      H(	  Hǀ(      H(	  Hǀ0      H(	  Hǀ       H(	  Hǀ8      H(	  Hǀh      @  HiH8H(	  HhLH  HH    HH    H=   tHH       HH    AD$
   HH4        1[]A\    EH        HO  I$   H        H    H        Hǃ(	      H    E    HX  I$   H        H    H        Hǃ(	      H    E    H   I$   H        H    H        Hǃ(	      EH        HtEI$   H        H    H        Hǃ(	      H               H        H        Hu       H        H        H       H        H        H       H        H        H        AW   AVAUATI
  UHSHH=        H             AUATIUSHHH  H(    HH{(   p           H=    
        H    H{(E1A  HŹ      7h   jP΀      H        ff.         ATUSHHeH%(   HD$1_ v-   AK   AG   D$H   D$H      Ht$H    H   D$Dd$H      Ht$H    H   D$T$Hti   Ht$H    H   D$ l$Ht@   Ht$H߁       H   D$!@l$Ht   Ht$H    HD$eH+%(   utH1[]A\    j v  v(w0AS   AO   AS   @EAQ@    H        AD$
    H4    H        @    1HiL8I$H      H   Hu`H        []A\    H            H            H            H            IL$(HH@ǀ      H   ʀ @Hǀ       PPHUHP`QuO      ǀ   IT$(H   H  GPuH@  HHu    w   @<u
 GPH         ÅtH       H        H            A  LH    E1        H    D$
    A      HHL$H        H(	  H              E`E
fE  ƅ     L    H  H(	  H      1H(	  ID$    H        H        H(	  H            E`E
fEH(	  Hh  H  H(	  H        H            H(	  H              E`E
fE   ƅ     L    H   H(	  H        H(	  H              E`E
fE   ƅ     L    H   H(	  H        H(	  H        H(	  H{    H            H        1H(	      H        1H(	      H(	  H        H(	  H            H(	  H        H(	  H    H    HE1A       1A   MD$LsEAHl$DMD$ILfD9   D$HS)ȃ1   E&2   LHAF1A1   5   A1   IN41AH@rAu=     @1~D  H|$A   LL    1A>2	D$_H        H[]A\A]A^A_    IHl$LMA   E*A   A   EEDA)ȀEAABEF~~H           H
I~
HIHt
ItLHH)H)HA1AHcL      Hٺ   HA   H          |$tH        H       H        ݨu&w
AiLfALY
ALALFARAJH    D$HcHcA4EAVH        D$#H    H    H    []A\A]    DmH    H    H    ADt
AGu11H    I$       H    H    H        H                         lme2510_download_firmware       lme2510_i2c_xfer                lme2510_pid_filter_ctrl         lme2510_enable_pid              lme2510_pid_filter      strnlen strscpy                                                                         lme2510_int_response                                                                            lme2510_streaming_ctrl                           D3"                           D3                            D3"                                                                                                                                                          dvb-usb-lme2510-s0194.fw        dvb-usb-lme2510-lg.fw           dvb-usb-lme2510c-rs2000.fw      dvb-usb-lme2510c-s0194.fw       dvb-usb-lme2510c-lg.fw          dvb-usb-lme2510c-s7395.fw       adapter_nr                                                    pid     firmware debug                                                                                                                                                                                                                  6LME2510(C): Interrupt Service Stopped field "st->usb_buffer" at drivers/media/usb/dvb-usb-v2/lmedm04.c:153    memcpy: detected field-spanning write (size %zu) of single %s (size %zu)
       drivers/media/usb/dvb-usb-v2/lmedm04.c  LME2510(C): %s PID=%04x Index=%04x onoff=%02x   LME2510(C): PID Setting Pid %04x        LME2510(C): PID Clearing Filter LME2510(C): i2c transfer failed.        3DVB: Unable to find symbol tda826x_attach()
  3DVB: Unable to find symbol ix2505v_attach()
  3DVB: Unable to find symbol dvb_pll_attach()
  3DVB: Unable to find symbol ts2020_attach()
   6LME2510(C): TUN Found %s tuner        6LME2510(C): INT Interrupt Service Started     6LME2510(C): TUN No tuner found        6LME2510(C): INT Unable to start Interrupt Service     LME2510(C): INT O/S C =%02x C/O=%02x Type =%02x%02x     LME2510(C): INT Remote data snippet (%8phN)     LME2510(C): INT Remote data snippet in (%8phN)  LME2510(C): INT Control data snippet (%8phN)    LME2510(C): INT Unknown data snippet (%8phN)    6LME2510(C): FRM Changing to %s firmware       6LME2510(C): FRM Firmware Cold Reset   3DVB: Unable to find symbol tda10086_attach()
 6LME2510(C): TUN Found Frontend TDA10086       6LME2510(C): FE Found Stv0299  3DVB: Unable to find symbol stv0299_attach()
  6LME2510(C): FE Found Stv0288  3DVB: Unable to find symbol stv0288_attach()
  6LME2510(C): FE Found M88RS2000        3DVB: Unable to find symbol m88rs2000_attach()
        6LME2510(C): DM04/QQBOX Not Powered up or not Supported        6LME2510(C): FRM Could not start Firmware Download(Buffer allocation failed)   6LME2510(C): FRM Starting Firmware Download    LME2510(C): Data S=%02x:E=%02x CS= %02x 6LME2510(C): FRM Firmware Download Failed (%04x)       6LME2510(C): FRM Firmware Download Completed - Resetting Device        6LME2510(C): Firmware Status: %6ph LME2510(C): STM  (%02x) LME2510(C): STM Steam Off memcpy tda826x_attach symbol:tda826x_attach ix2505v_attach symbol:ix2505v_attach dvb_pll_attach symbol:dvb_pll_attach ts2020_attach symbol:ts2020_attach 6LME2510(C): Error %x LME2510(C): INT Key = 0x%08x tda10086_attach symbol:tda10086_attach stv0299_attach symbol:stv0299_attach stv0288_attach symbol:stv0288_attach m88rs2000_attach symbol:m88rs2000_attach dvb_usb_lmedm04   LG TDQY-P001F  SHARP:BS2F7HZ7395  SHARP:BS2F7HZ0194  RS2000 TDA8263 IX2505V DVB_PLL_OPERA RS2000 DM04_LME2510C_DVB-S RS2000 rc-lme2510 DM04_LME2510C_DVB-S DM04_LME2510_DVB-S firmware=dvb-usb-lme2510-s0194.fw firmware=dvb-usb-lme2510-lg.fw firmware=dvb-usb-lme2510c-rs2000.fw firmware=dvb-usb-lme2510c-s0194.fw firmware=dvb-usb-lme2510c-lg.fw firmware=dvb-usb-lme2510c-s7395.fw license=GPL version=2.07 description=LME2510(C) DVB-S USB2.0 author=Malcolm Priestley <tvboxspy@gmail.com> parm=adapter_nr:DVB adapter numbers parmtype=adapter_nr:array of short parm=pid:set default 0=default 1=off 2=on parmtype=pid:int parm=firmware:set default firmware 0=Sharp7395 1=LG parmtype=firmware:int parm=debug:set debugging level (1=info (or-able)). parmtype=debug:int srcversion=35DBA3A7D5C3F49758290A4 alias=usb:v3344p22F0d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v3344p1120d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v3344p1122d*dc*dsc*dp*ic*isc*ip*in* depends=usbcore,dvb_usb_v2,rc-core,dvb-core retpoline=Y intree=Y name=dvb_usb_lmedm04 vermagic=6.1.0-37-amd64 SMP preempt mod_unload modversions                              $                                                                                                                                                                                                                                                                                                                                                                                                                                                   (    0  8  P  8  0  (                     P                       (                 (                         (  0  (                   0      (        (                       0               0               0                       (                              (    0  8  @  8  0  (                     @                       (                 (                         (    0  8  H  8  0  (                     H                                            (    0  8  @  8  0  (                     @                         (  0  H  0  (                   H                                                         (    0  8  P                       (  0  8  @  (                     0               0        H                  @  H     P  8  0  (                     P  (                 (                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        @=    usb_alloc_urb                                               release_firmware                                        H>    usb_free_urb                                            ֝n    __symbol_put                                            2    request_firmware                                        vg    usb_register_driver                                     j    param_array_ops                                         8߬i    memcpy                                                  z    kfree                                                       fortify_panic                                           m    __fentry__                                              pHe    __x86_indirect_thunk_rax                                ~    _printk                                                 V
    __stack_chk_fail                                            strnlen                                                 |c    __x86_indirect_thunk_rdx                                E8    usb_submit_urb                                          ]\!    dvb_usbv2_disconnect                                    ˄    __symbol_get                                            KM    mutex_lock                                              $96    usb_control_msg                                         	D    rc_keydown                                              PX    dvb_usbv2_probe                                         A6    usb_set_interface                                       u    mutex_lock_interruptible                                C3    usb_deregister                                          Kd    dvb_usbv2_generic_rw_locked                             TV    param_ops_short                                         c    strlcat                                                 9[    __x86_return_thunk                                      &t    dvb_frontend_detach                                     P    jiffies                                                 9d    strscpy                                                 82    mutex_unlock                                            iK    usb_reset_configuration                                 eb,    __dynamic_pr_debug                                      {    usb_kill_urb                                            GV    __warn_printk                                           wX    kmalloc_trace                                                param_ops_int                                               msleep                                                  -    kmalloc_caches                                          #O    __request_module                                        zR    module_layout                                                    		                                                                                                                                                                                                                          ::                                                                                                                                                                                                                                                                                                        	                                                                                                                                                 
                                                                                                                                                            `       8                                                      h                               h                >   d                       `  d           h                                                                                                                            0 }5@ @	 Q
#?     P  ! " # ( )*+,	-.1234R                    	 
  
 TzH  !T"#(F)f*+,0 1234	567/89: ;<=0@cAB C D E F G J PQ6R!STU)VdW+XTYZ [\]^_p q r t u v  ??            H :                                                                                                           F                                                     @                                                                                                                                                                                                                    f                                                     c                                                     `                                                     6                                                     -                                                     (                                                                                                                                                           dvb_usb_lmedm04                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          GCC: (Debian 12.2.0-14+deb12u1) 12.2.0  GCC: (Debian 12.2.0-14+deb12u1) 12.2.0         U  U   2         
9             X    ,          
Y A= 
      O=        `       i        [=    0   h=    @   #    P   0    X   @    `   k    h   {    p       x   :       z             
[        
v  u=      4  *        `   @   =      u        =      =     V           c @   -  e    	  g    !  i    )  k @  ' k   = k   = k     b @    %    - ^   = _   =    @ =    A =    B =    C       
             b        \        a       
                 d       
                    k          f       
                      h       
                j 	>      >     #>    2>    ?>    P>    `>    m>    }>    >    > 	   > 
   >    >    > 
   >    >    ?    ?    1?    D?    U?    d?    q?    ~?    ?    ?    ?    ?    ?    ?      x -       x *   @   ?   (   ? o          @   4&     `   3.        	> l    V        4  *            m ?      @     @    '@    ;@        *         *       N@ ;  X  :"        U@ K   @  `  *D   Ϡ      c@       x Y  @         O      ? n    4  G  @  _    @  V u   S{ 0Y    n@ p      K      z@ K   (  @ -   @  @ -     @ -     @ l    @ q    @ q `  @ *     P  *     Z  k      
A *  @  A K   `  A      +A I    7A I   !  DA *   @"  QA l `"  _A -   "  mA $   "  O  *   "  yA *    #  A *    #  A *   @#  A *   `#  A   #  A   :  A H   >  A *  @>  A `   >  _ K    ?  A w @?  	  y ?  0  { ?  A }  @  A } @@  B } @  B  @  )B   A  /B  @A  6B  A  JB  A  [B   B  dB  @B  tB  B         r ~B               t       
       s              v       
       s        x       
        s        z       
       s     *          |       
       s     *       *          ~       
       s                             
        s     K                 
       s                      
       s             q               
       s                B   @            k	  '  @   p	  )     	  1     M  3     	  3  @  	  1    	  1           
 B     B      s   @   :"                    _    @  ]       	     B     :"           @   x              BP       \      B *     B -      x   *   @  B F7    B       C `   @  ݽ `     A `   @    `     C `   @  +C G    7C  	  EC k     QC ň   _C ǈ    )  Ȉ @  nC G    ~C ]                           
                         C       C      x   *   @     `      C               C    @            C      \v  a   @   C   x   C      V        i  @  %  *   `  ]       C &     C &     C &     C       A  @    `     )          @  P   `          C     r
       D     s
                        D   (   J K       C  @   A `      #D               /D   @   C      C     ,  &   @  C &   P  -  `  ]       e            
                  9D      (                     ?D   8   C        `      c  *     ]  *                      OD      UD      C      ZD   X   C        `                    	      ]     @  eD K             qD      D     D    D    D    D       D      D  @   D     E            
       
                            
                      *                         
                      
K                              E      .E     EE    dE             *  *       _ *                :"               E   @         *  *     _ *     E   (   E      E  @   E     E È    E            
       
            *                  E 
  p   C      I$  0  @   E   `      @  E    `  F      ˛	 `     F    @  Ч D    4  *  @        
                            
                       
                      
                    Ĉ       
                ƈ         'F      /F     <F    RF    aF    pF    F    F     F @   F    F    F    F    F    F    G     G  @  G    .G    >G    \G    rG    G    G     G   @ G    G    G    G    
H     H    @*H    9H       =      }    0   OH             }        O     @   fH      uH     H    H    H      H     H    H      H     H    H      H     I    I    "I    1I    =I    II     UI @   _I      uI     I    I    I 
     I     I    I    I    I    I    I    I    I    I 	   I 
   J    J    J      %J     *J    1J    8J    ?J    GJ    OJ    XJ    ^J    eJ 	   kJ 
   sJ    {J    J 
   J 	     J     J    J    J    J    K    K    2K    GK    _K      qK     K    K    K    K    K    K    K    L    )L 	   >L 
   SL      `L     oL    {L    L    L    L      L     L    L    L    L      M     
M    M    M      *M     5M    @M    KM    XM      kM     yM    M    M    M    M    M    M    M    M 	   M 
   M    M    M 
   N    N    N    N    (N    9N      LN     cN    tN    N             T !       [        N   	   _            ۈ    N   %   4&         O  ވ               ܈       N 	     N     N    N    N    O    O    O    /O    @O    OO      b           `   @    `      V     @  [O 	    Z  k                 @  hO      sO    ~O G     O G     C     ^s	  @  O    O        `       e/  0     s       W     c  ߈ @  _    `  x   *     <U       DU       P         D     O    V        O  @  O      C    O     A  @  O    Z  k                           
                    k                   O      P        P        P    @   'P      V        6P *      GP *      XP *   @  jP *   `  xP *     P *     P      a         "         P    @   V
 -      P      P    P    P    P    P      	Q    #Q    <Q    UQ    oQ    Q    Q      P       	             @  !     )     Q     Q  @  $    Q    Q     Q  @  am    Q    R     R  @  R    'R          
                 5R       0      )  	 @   BR  @  FR k     WR k     bR k      pR k   @  yR k     R    Qg  /  (  x      @(  
	     `(                
                      
                                   
            k                 
                             
            '                
            %                
                                    
            *            R      V  ?       R 	  H   P       Q  @   R     R     R     R  @  	     R    $           
                            
                       R 	     V        6P *      GP *      
S *   @   S *   `  7S *     GS *     WS *     a Ɉ   mS "     P       ~S *     \   @  	     S            @  !     )     p	      S  @  S    S    S     S  @      S    S   	  S  @	  S  	  	T  	  T   
  6T  @
  NT ! 
  `T # 
  k %    iT ' @  T )   R    T     T  @  }
 +   T    T          
            O-                
       
            K                     
        ψ               
                    
                                   
                     T 2    a  *       T ҈     sk ̈ @   T ͈ `   T Ј    T ш    	U ӈ    U *      (U Ԉ    M Ո    7U *   @  CU ш `  PU ш   ]U ׈   cU ؈   kU و   {U ֈ    U $      U $   (  U $   0  U *   @  U *   `  U $     V -   V *      V *   @  "V $   `  1V $   h  BV $   p  MV $   x  YV $     dV $     oV $     V $     V $     V $     V $     V $     V $     W $     ,W $     DW *     HW ݈    QW ݈ (  UW ݈ P  cW ݈ x  qW ݈ 	  W ݈ 
  W ݈    ݈ 
                
            
               
                    ʈ               
                    ˈ               
            Έ                
            ͈        "       
            ̈        $       
            2          &       
                      (       
             *          W $       j ш     T ҈ @   {U $   `              ,             
       k                               . W      W     W    W    W    W      W     
X    X      #X     2X    AX    SX    eX    rX    X    X    X    X 	   X 
   X    X    X 
   Y    Y    Y    .Y    @Y    RY    _Y    mY   0                   "       xY   <   }            3    O       ]       Y      }           1       0 @   Y 2 `   ]        Y      Y    Y    Y    Z    ;Z    cZ      rZ    |Z    Z    Z    Z   0   Z          : @   Z  k      G	  =    Z ?    Z ? @  Z      Q  V      W @   Z  k      	  Y    0  Y    p	  [ @  Z ^   Z `   [ c    [ e @  .[ g   ;[ g   K[ i    Y[ g @  j[ Y   ~[ k   [ m           9       
       <     &              2     H         8        ;       
       <        > [   H   [ j       j     [ j       B   Z  k      [     Z          : @   Z  k      [       [ *      [       [ C @  [ &      l &   0  [ &   @  G	  E   \ I   \ K    Z M @  Z M          A            $              
       B     &                 D       
       B     G        H        @        F       
       B     H        J       
       B        L $\    O        P       
       O-      Q       O-      Q       <        .\    R        S       
       O-      Q       O-      Q       H        =\      Q\     _\    n\      {\ `       (  T    \      \    \    \           U       
       :        X       
       :            Q          Z       
       :     ]     N        <        \       
       :     <        _       
       :     b     Q        B        a       
       :     B        d       
       :     W        f       
a       :        h       
       :     '         j       
       :                            l \      \     \    ]      ]     (]    <]    L]    Y] 
        @     j] j  @  v] j    ] K   `    q   ] s   ,          o    c  n @  ] &   `         p ]     ] t     eg  u   ] w    Z  k   @  c  n     o   }  &     O  H        q @  ] *     ] 7   Y 2   H      ] K      ] &       `   @  ,              r         8X 8     H A              8X N     H Q     ]     ] 9     Z  k   @  ]      ]      ] y    ^ y    
^ { @  ^ }   '^    P           q @  ] s   /^ `     =^  @  fJ   @  G^ `   
  Q^     W^    `  %  G    4  *    ^^ w    j^ H     z^ T   @  ^    `  ^             v       
       s        x       
       s     O-      Q          z       
*       s     O-      Q          |       
        s            O-      Q          ~            s                  &                    $         ^      ^         @     k   
	       ] : @  ^ G    ^ G               %     
   ^   H              R   @   ^ R      ^ R              x  D  @  4  *     ^      ^     _    +_    F_    c_    _    _    _   (          CJ  @   x           	             
       
                _   0   )       Z  k   @          `      I$  0  @  { K   `                
                         _   x   3.         %  @   _     _     ` %       %  @  S %    `    "` %     0`   @  ;` %    )     m     H`  @  	            
       
k                             R`      ]`      ,     @   c     `   1        g`       T  -            r`  @       -          z`     `     `     `     ` `      ` `                   

           k                        
k                                          
k                  
                       
k            k                 
       k                 
       k                           "         &        #         `   0   ` k        
  @   `       `       ơ        a       cK     ~<    @  a      $a     ;a    Ta    la    a    a    a    ]` 2  X  c         a        :"    @   a       a      a      a      b      b      Gb      Yb      kb      ub      b      b      4  n       k   @  )         b     b k   @  b *     b      b *     Rh X     b *      b  @  J4  G  @  1     @   D  `  U  É   c      c `     c    @  *c ]   `   `     =c *     Gc D  @  Oc      Yc           pc     c     c     c     c     c     c ŉ @  c ǉ   V                                 c   `   c      c  @   d     d      d     )d  @  5d    @d    Ld     \d  @  kd    ud           
       
                                 ]                
                       
                      
                       
                       d   (   d      d  @   d     d     c            
       
            l                 
             k                 
                                   
             l                                                                         d               ĉ d               Ɖ d      
e     $e    ;e    Re     
        `      ]e     ie      %  G    7 *    ne `      [  ˉ   "       L              te       |e    @  0
    `  ]  6     *     V  a           ɉ e      e     e    e    e      e     e    e    f    f    *f             H H              8X `       H B           <   H 4     @f 5     Df        Ή     ] ω @    Љ    c  ̉     ͉   :"  Ӊ       @  Rf ʉ   %  G     %  I     gt    @  Zf ~   `  df 
  x  ^      kf  @      ԉ    ] :    ]       Q        vf    @ 
	     A f W   f    f ʉ    %  G    4  *           ҉        щ f      V         ?    @    ؉    f                    @    ;     : $      f       f $      f $     g         ݉ @  -     7g    {       Fg  @  Xg    ag      ng ݉    W  @  g    g ݉    g  @  g    g    g     g  @  g    g      ݉    
	   @  g    
h           
։        ׉ h   0   O        *h -   @   A w     ݉    9        n@ p    9h K   @  O     `        
       ۉ        ܉ Ch   P   ؉     V     @   ?       Rh K            dh   @  } ى   ih       qh G  @  {h G  @  h `  @  W  @&  N@ s @  h      h R    Z  k   @         ډ          h                 h        h        9     @            h މ     h ߉     h      c  $         $      # $             h   (   a $       i $      i  @   'i     z            
       
                       2i   p	        z  @   x   $    
  ] $   
  Bi K   
  Xi K   
  fi $    
  qi $   (
  i #   0
  i    @
  i  
  df ҉ @  ] v  ,  ^  B  i  @I  i   J  i  J                
                   &                        
        ۉ               
       ۉ                      
       ۉ     L                 `                          
       ۉ                      
                             
                      
       ۉ             ى               
                                    i   8  dh         @     $            =#  @  i      `         @  -     i    @	  i    `	  i k   	        
                     Q                                   
                    
              W      
                                                                            $         i      j     j    %j      5j $       = $      Cj $      Oj 
            
 Yj       5j $       hj    @   P       pj            

 ~j      j $       j $      j $      P        j $   @          
 j   0   5j $       hj O-  @   j *      = $     j $     j $     j $     k $     P       k     pj  @         
       
            *       *                      $      N   k       ,k $       hj    @   P       pj            
 7k 	  (   j $       Ek *       Sk K   @  `k $   A  hk $   C  tk K   H  i     ~k $     k            
       
                                           k      k        k ψ @   x   $   `   k $   h   k $   p   k $   x   k $      k $      k $      l $      l $      %l $      4l $      >l $      Gl $      Ol ?G     Zl      bl    @  ml  @  |l    l    l     l  @  l %   l $                \              
        `               
                 `                "       
          %     `                 $       
                 `                '       
          *     `                 )       
     -     `                 ,       
     0     `                 /       
     3     `                 2       
     6     `                 5        ] l       l    p         
      ۉ 
m    ;       
     ۉ }  m    =       
   i  ]    z  0m    ?       
     ۉ V     Jm    A       
     ۉ am    gm    C       
   3  wm    E m    E       
   i  m    m    H       
   i  m    m    J       
   i  m '  m    L       
   i  HW '  m    N       
   i    
 n    P       
   i  sk ̈ n    R       
     ۉ +n    0n    T       
     ۉ o~ L  Dn    V       
   i  am    ^n    X       
*   W `  un    Z       
   3 `   a  b     n    \       
   3  ,     }  &   am    n    ^       
   3  am    n    `       
    Zl   n    b       
    3  n    d       
     ۉ n    f       
     ۉ o        o        
o    h       
   i  o *    *   $o    j usb_device_id match_flags bcdDevice_lo bcdDevice_hi usb_dynids usbdrv_wrap for_devices usb_driver pre_reset post_reset drvwrap no_dynamic_id supports_autosuspend disable_hub_initiated_lpm soft_unbind rc_proto RC_PROTO_UNKNOWN RC_PROTO_OTHER RC_PROTO_RC5 RC_PROTO_RC5X_20 RC_PROTO_RC5_SZ RC_PROTO_JVC RC_PROTO_SONY12 RC_PROTO_SONY15 RC_PROTO_SONY20 RC_PROTO_NEC RC_PROTO_NECX RC_PROTO_NEC32 RC_PROTO_SANYO RC_PROTO_MCIR2_KBD RC_PROTO_MCIR2_MSE RC_PROTO_RC6_0 RC_PROTO_RC6_6A_20 RC_PROTO_RC6_6A_24 RC_PROTO_RC6_6A_32 RC_PROTO_RC6_MCE RC_PROTO_SHARP RC_PROTO_XMP RC_PROTO_CEC RC_PROTO_IMON RC_PROTO_RCMM12 RC_PROTO_RCMM24 RC_PROTO_RCMM32 RC_PROTO_XBOX_DVD RC_PROTO_MAX rc_map_table rc_map scan rc_driver_type RC_DRIVER_SCANCODE RC_DRIVER_IR_RAW RC_DRIVER_IR_RAW_TX rc_scancode_filter rc_dev managed_alloc input_phys driver_type encode_wakeup allowed_protocols enabled_protocols allowed_wakeup_protocols wakeup_protocol scancode_filter scancode_wakeup_filter scancode_mask keylock keypressed keyup_jiffies timer_keyup timer_repeat last_keycode last_protocol last_scancode last_toggle min_timeout max_timeout rx_resolution tx_resolution lirc_dev lirc_cdev gap_start lirc_fh_lock lirc_fh change_protocol s_tx_mask s_tx_carrier s_tx_duty_cycle s_rx_carrier_range tx_ir s_idle s_wideband_receiver s_carrier_report s_filter s_wakeup_filter s_timeout ir_raw_event_ctrl media_file_operations media_devnode media_dev media_device hw_revision topology_version entity_internal_idx entity_internal_idx_max entities entity_notify graph_mutex pm_count_walk source_priv enable_source disable_source req_queue_mutex request_id media_gobj mdev media_entity_enum idx_max entity media_entity graph_obj num_pads num_links num_backlinks internal_idx media_graph ent_enum media_pipeline start_count media_pad gobj0 media_interface gobj1 sink media_link is_backlink media_pad_signal_type PAD_SIGNAL_DEFAULT PAD_SIGNAL_ANALOG PAD_SIGNAL_DV PAD_SIGNAL_AUDIO media_entity_operations get_fwnode_pad link_setup link_validate has_pad_interdep media_entity_type MEDIA_ENTITY_TYPE_BASE MEDIA_ENTITY_TYPE_VIDEO_DEVICE MEDIA_ENTITY_TYPE_V4L2_SUBDEV media_intf_devnode media_device_ops link_notify req_alloc req_free req_validate req_queue media_request debug_str updating_count access_count num_incomplete_objects fe_caps FE_IS_STUPID FE_CAN_INVERSION_AUTO FE_CAN_FEC_1_2 FE_CAN_FEC_2_3 FE_CAN_FEC_3_4 FE_CAN_FEC_4_5 FE_CAN_FEC_5_6 FE_CAN_FEC_6_7 FE_CAN_FEC_7_8 FE_CAN_FEC_8_9 FE_CAN_FEC_AUTO FE_CAN_QPSK FE_CAN_QAM_16 FE_CAN_QAM_32 FE_CAN_QAM_64 FE_CAN_QAM_128 FE_CAN_QAM_256 FE_CAN_QAM_AUTO FE_CAN_TRANSMISSION_MODE_AUTO FE_CAN_BANDWIDTH_AUTO FE_CAN_GUARD_INTERVAL_AUTO FE_CAN_HIERARCHY_AUTO FE_CAN_8VSB FE_CAN_16VSB FE_HAS_EXTENDED_CAPS FE_CAN_MULTISTREAM FE_CAN_TURBO_FEC FE_CAN_2G_MODULATION FE_NEEDS_BENDING FE_CAN_RECOVER FE_CAN_MUTE_TS dvb_diseqc_master_cmd dvb_diseqc_slave_reply fe_sec_voltage SEC_VOLTAGE_13 SEC_VOLTAGE_18 SEC_VOLTAGE_OFF fe_sec_tone_mode SEC_TONE_ON SEC_TONE_OFF fe_sec_mini_cmd SEC_MINI_A SEC_MINI_B fe_status FE_NONE FE_HAS_SIGNAL FE_HAS_CARRIER FE_HAS_VITERBI FE_HAS_SYNC FE_HAS_LOCK FE_TIMEDOUT FE_REINIT fe_spectral_inversion INVERSION_OFF INVERSION_ON INVERSION_AUTO fe_code_rate FEC_NONE FEC_1_2 FEC_2_3 FEC_3_4 FEC_4_5 FEC_5_6 FEC_6_7 FEC_7_8 FEC_8_9 FEC_AUTO FEC_3_5 FEC_9_10 FEC_2_5 fe_modulation QPSK QAM_16 QAM_32 QAM_64 QAM_128 QAM_256 QAM_AUTO VSB_8 VSB_16 PSK_8 APSK_16 APSK_32 DQPSK QAM_4_NR fe_transmit_mode TRANSMISSION_MODE_2K TRANSMISSION_MODE_8K TRANSMISSION_MODE_AUTO TRANSMISSION_MODE_4K TRANSMISSION_MODE_1K TRANSMISSION_MODE_16K TRANSMISSION_MODE_32K TRANSMISSION_MODE_C1 TRANSMISSION_MODE_C3780 fe_guard_interval GUARD_INTERVAL_1_32 GUARD_INTERVAL_1_16 GUARD_INTERVAL_1_8 GUARD_INTERVAL_1_4 GUARD_INTERVAL_AUTO GUARD_INTERVAL_1_128 GUARD_INTERVAL_19_128 GUARD_INTERVAL_19_256 GUARD_INTERVAL_PN420 GUARD_INTERVAL_PN595 GUARD_INTERVAL_PN945 fe_hierarchy HIERARCHY_NONE HIERARCHY_1 HIERARCHY_2 HIERARCHY_4 HIERARCHY_AUTO fe_interleaving INTERLEAVING_NONE INTERLEAVING_AUTO INTERLEAVING_240 INTERLEAVING_720 fe_pilot PILOT_ON PILOT_OFF PILOT_AUTO fe_rolloff ROLLOFF_35 ROLLOFF_20 ROLLOFF_25 ROLLOFF_AUTO fe_delivery_system SYS_UNDEFINED SYS_DVBC_ANNEX_A SYS_DVBC_ANNEX_B SYS_DVBT SYS_DSS SYS_DVBS SYS_DVBS2 SYS_DVBH SYS_ISDBT SYS_ISDBS SYS_ISDBC SYS_ATSC SYS_ATSCMH SYS_DTMB SYS_CMMB SYS_DAB SYS_DVBT2 SYS_TURBO SYS_DVBC_ANNEX_C fecap_scale_params FE_SCALE_NOT_AVAILABLE FE_SCALE_DECIBEL FE_SCALE_RELATIVE FE_SCALE_COUNTER dtv_stats dtv_fe_stats dvb_device_type DVB_DEVICE_SEC DVB_DEVICE_FRONTEND DVB_DEVICE_DEMUX DVB_DEVICE_DVR DVB_DEVICE_CA DVB_DEVICE_NET DVB_DEVICE_VIDEO DVB_DEVICE_AUDIO DVB_DEVICE_OSD dvb_adapter proposed_mac mfe_shared mfe_dvbdev mfe_lock mdev_lock conn_pads dvb_device kernel_ioctl intf_devnode tsout_num_entities tsout_entity tsout_pads dvb_frontend_tune_settings min_delay_ms step_size max_drift dvb_tuner_info frequency_min_hz frequency_max_hz frequency_step_hz bandwidth_min bandwidth_max bandwidth_step analog_parameters audmode dvbfe_algo DVBFE_ALGO_HW DVBFE_ALGO_SW DVBFE_ALGO_CUSTOM DVBFE_ALGO_RECOVERY dvbfe_search DVBFE_ALGO_SEARCH_SUCCESS DVBFE_ALGO_SEARCH_ASLEEP DVBFE_ALGO_SEARCH_FAILED DVBFE_ALGO_SEARCH_INVALID DVBFE_ALGO_SEARCH_AGAIN DVBFE_ALGO_SEARCH_ERROR dvb_tuner_ops set_params set_analog_params get_frequency get_bandwidth get_if_frequency get_rf_strength get_afc calc_regs set_frequency set_bandwidth dvb_frontend dvb demodulator_priv tuner_priv frontend_priv sec_priv analog_demod_priv dtv_property_cache analog_demod_info analog_demod_ops has_signal tuner_status standby i2c_gate_ctrl dvb_frontend_internal_info frequency_stepsize_hz frequency_tolerance_hz symbol_rate_min symbol_rate_max symbol_rate_tolerance dvb_frontend_ops delsys release_sec tune get_frontend_algo set_frontend get_tune_settings get_frontend read_ber read_signal_strength read_snr read_ucblocks diseqc_reset_overload diseqc_send_master_cmd diseqc_recv_slave_reply diseqc_send_burst set_tone enable_high_lnb_voltage dishnetwork_send_legacy_command ts_bus_ctrl set_lna tuner_ops analog_ops dtv_frontend_properties modulation sectone inversion fec_inner transmission_mode bandwidth_hz guard_interval symbol_rate code_rate_HP code_rate_LP pilot rolloff delivery_system interleaving isdbt_partial_reception isdbt_sb_mode isdbt_sb_subchannel isdbt_sb_segment_idx isdbt_sb_segment_count isdbt_layer_enabled layer scrambling_sequence_index atscmh_fic_ver atscmh_parade_id atscmh_nog atscmh_tnog atscmh_sgn atscmh_prc atscmh_rs_frame_mode atscmh_rs_frame_ensemble atscmh_rs_code_mode_pri atscmh_rs_code_mode_sec atscmh_sccc_block_mode atscmh_sccc_code_mode_a atscmh_sccc_code_mode_b atscmh_sccc_code_mode_c atscmh_sccc_code_mode_d lna strength cnr pre_bit_error pre_bit_count post_bit_error post_bit_count block_error segment_count dmx_output DMX_OUT_DECODER DMX_OUT_TAP DMX_OUT_TS_TAP DMX_OUT_TSDEMUX_TAP dmx_input DMX_IN_FRONTEND DMX_IN_DVR dmx_ts_pes DMX_PES_AUDIO0 DMX_PES_VIDEO0 DMX_PES_TELETEXT0 DMX_PES_SUBTITLE0 DMX_PES_PCR0 DMX_PES_AUDIO1 DMX_PES_VIDEO1 DMX_PES_TELETEXT1 DMX_PES_SUBTITLE1 DMX_PES_PCR1 DMX_PES_AUDIO2 DMX_PES_VIDEO2 DMX_PES_TELETEXT2 DMX_PES_SUBTITLE2 DMX_PES_PCR2 DMX_PES_AUDIO3 DMX_PES_VIDEO3 DMX_PES_TELETEXT3 DMX_PES_SUBTITLE3 DMX_PES_PCR3 DMX_PES_OTHER dmx_filter dmx_sct_filter_params dmx_pes_filter_params pes_type dmx_buffer_flags DMX_BUFFER_FLAG_HAD_CRC32_DISCARD DMX_BUFFER_FLAG_TEI DMX_BUFFER_PKT_COUNTER_MISMATCH DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR ts_filter_type TS_PACKET TS_PAYLOAD_ONLY TS_DECODER TS_DEMUX dmx_ts_feed is_filtering start_filtering stop_filtering dmx_demux allocate_ts_feed release_ts_feed allocate_section_feed release_section_feed add_frontend remove_frontend get_frontends connect_frontend disconnect_frontend get_pes_pids get_stc dmx_section_filter filter_value filter_mode dmx_section_feed check_crc crc_val secbuf secbuf_base secbufp tsfeedp allocate_filter release_filter dmx_ts_cb dmx_section_cb dmx_frontend_source DMX_MEMORY_FE DMX_FRONTEND_0 dmx_frontend connectivity_list dmx_demux_caps DMX_TS_FILTERING DMX_SECTION_FILTERING DMX_MEMORY_BASED_FILTERING dvb_dmx_filter_type DMX_TYPE_TS DMX_TYPE_SEC dvb_dmx_state DMX_STATE_FREE DMX_STATE_ALLOCATED DMX_STATE_READY DMX_STATE_GO dvb_demux_filter maskandmode maskandnotmode doneq feed hw_handle dvb_demux_feed demux buffer_flags ts_type pusi_seen peslen dvb_demux dmx filternum feednum start_feed stop_feed write_to_decoder check_crc32 memcopy frontend_list pesfilter feed_list tsbuf tsbufp cnt_storage speed_last_time speed_pkts_cnt playing recording dvb_net dvbdev ioctl_mutex remove_mutex dvb_ringbuffer pread pwrite media_request_state MEDIA_REQUEST_STATE_IDLE MEDIA_REQUEST_STATE_VALIDATING MEDIA_REQUEST_STATE_QUEUED MEDIA_REQUEST_STATE_COMPLETE MEDIA_REQUEST_STATE_CLEANING MEDIA_REQUEST_STATE_UPDATING NR_OF_MEDIA_REQUEST_STATE media_request_object_ops media_request_object vb2_mem_ops get_dmabuf get_userptr put_userptr attach_dmabuf detach_dmabuf map_dmabuf unmap_dmabuf num_users vb2_buffer vb2_queue num_planes req_obj copied_timestamp skip_cache_sync_on_prepare skip_cache_sync_on_finish planes queued_entry done_entry vb2_plane mem_priv dbuf_mapped bytesused min_length vb2_buffer_state VB2_BUF_STATE_DEQUEUED VB2_BUF_STATE_IN_REQUEST VB2_BUF_STATE_PREPARING VB2_BUF_STATE_QUEUED VB2_BUF_STATE_ACTIVE VB2_BUF_STATE_DONE VB2_BUF_STATE_ERROR io_modes dma_attrs bidirectional fileio_read_once fileio_write_immediately allow_zero_bytesused quirk_poll_must_check_waiting_for_buffers supports_requests requires_requests uses_qbuf uses_requests allow_cache_hints non_coherent_mem buf_ops drv_priv subsystem_flags buf_struct_size timestamp_flags min_buffers_needed alloc_devs num_buffers queued_list queued_count owned_by_drv_count done_lock done_wq streaming start_streaming_called waiting_for_buffers waiting_in_dqbuf is_multiplanar is_output copy_timestamp last_buffer_dequeued fileio threadio vb2_ops queue_setup wait_prepare wait_finish buf_out_validate buf_init buf_prepare buf_finish buf_cleanup start_streaming stop_streaming buf_queue buf_request_complete vb2_buf_ops verify_planes_array init_buffer fill_user_buffer fill_vb2_buffer vb2_fileio_data vb2_threadio_data v4l2_preemphasis V4L2_PREEMPHASIS_DISABLED V4L2_PREEMPHASIS_50_uS V4L2_PREEMPHASIS_75_uS dvb_buffer dvb_vb2_ctx vb_q dvb_q buf_siz buf_cnt dmxdev_type DMXDEV_TYPE_NONE DMXDEV_TYPE_SEC DMXDEV_TYPE_PES dmxdev_state DMXDEV_STATE_FREE DMXDEV_STATE_ALLOCATED DMXDEV_STATE_SET DMXDEV_STATE_GO DMXDEV_STATE_DONE DMXDEV_STATE_TIMEDOUT pes dmxdev_filter vb2_ctx secheader dmxdev dvr_dvbdev may_do_mmap dvr_orig_fe dvr_buffer dvr_vb2_ctx dvb_usb_driver_info dvb_usb_device_properties size_of_priv generic_bulk_ctrl_endpoint generic_bulk_ctrl_endpoint_response generic_bulk_ctrl_delay identify_state download_firmware i2c_algo num_adapters get_adapter_count power_ctrl read_config read_mac_address frontend_attach frontend_detach tuner_attach tuner_detach frontend_ctrl streaming_ctrl get_rc_config get_stream_config dvb_usb_rc allowed_protos bulk_mode dvb_usb_device rc_polling_active udev powered usb_mutex i2c_mutex i2c_adap rc_phys rc_query_work buffersize framesperurb framesize bulk isoc usb_data_stream_properties dvb_usb_adapter_properties pid_filter_count pid_filter_ctrl pid_filter dvb_usb_adapter suspend_resume_active pid_filtering feed_count max_feed_count active_fe state_bits dvb_adap fe fe_init fe_sleep usb_data_stream buf_num urbs_initialized urbs_submitted user_priv tda10086_xtal TDA10086_XTAL_16M TDA10086_XTAL_4M tda10086_config demod_address diseqc_tone xtal_freq stv0288_config inittab set_ts_params ix2505v_config tuner_address tuner_gain tuner_chargepump tuner_write_only stv0299_config mclk skip_reinit lock_output volt13_op0_op1 op0_off set_symbol_rate m88rs2000_config demod_addr ts2020_config frequency_div loop_through clk_out clk_out_div dont_poll attach_in_use get_agc_pwm lme2510_state int_urb_due lock_status tuner_config signal_level signal_sn time_key i2c_talk_onoff i2c_gate i2c_tuner_gate_w i2c_tuner_gate_r i2c_tuner_addr stream_on pid_size pid_off int_buffer lme_urb usb_buffer fe_read_status fe_read_signal_strength fe_read_snr fe_read_ber fe_read_ucblocks fe_set_voltage dvb_usb_lme2510_firmware lme2510_driver_exit lme2510_driver_init lme2510_exit lme2510_get_rc_config lme2510_get_stream_config lme2510_identify_state onoff lme2510_powerup dm04_lme2510_tuner dm04_lme2510_frontend_attach ucblocks dm04_read_ucblocks ber dm04_read_ber snr dm04_read_snr dm04_read_signal_strength dm04_read_status dm04_lme2510_set_voltage cold lme_firmware_switch lme2510_download_firmware lme2510_streaming_ctrl lme2510_i2c_func lme2510_i2c_xfer lme2510_pid_filter lme2510_pid_filter_ctrl lme2510_int_response lme2510_update_stats lme2510_stream_restart wbuf rbuf lme2510_usb_talk srate sharp_z0194a_set_symbol_rate dvb-usb-lmedm04.ko  R                                                                                               	                                                                                        !                      '                      )                      ,                      H      #            k      .       0           .       E           .       Z           ,       q                    ~     !                  -      	            6                  K      <                                       $                    1           @                 P      Z       *          Z       8          K       F    `      K       Y          \          ,               s                     0      =           p               )                                     ,                  ' p       8          ' 8       8          ,                  !                -                  F   ,               N   !               ]   !               m                     p                 p      p          !                  !                  ,                         u         '        8                            '       8          !                  ,               &    `
             >   '       8       W   ,               _   !                p    0      a         , @       @          ,         @          '        8                                    )         !       (          !                                          (       
          v      "   ' h      8       ;   ' P      8       T   '       8       m   ' 0      8          '       8          '       8                            P                                  `                                                                                           Q       8   ,               Q    p            n           (       y   ! @                !       0          !                   !                                                                        
                                     ! @                	                /           =       I                h   '         8           `                 ;      h                                                                 @                  `                                     P                         "       0    "              H    A       $       `    e       #       x                              #                                    
                  $                 .          #                3   %                \                 m    @                                                    ! `             .	   !                  ! `      (          !       N          !                   6      $       	    Z      #       &	            (       9	                  P	    @              g	    }      *       z	                 	    (       (       	    `             	          4       	                 	    P       (       	    h      	       
          3       
    5             5
    x       (       C
    q             U
                     Z
                    _
                    e
                    k
                    p
                    v
                    |
                     
                     
                     
   *               
                     
                     
                     
   	                
                                                                                    "                     -                   9                     
                     R                     c                     k                                                                                                                                                                                                                                       %                     A                     Q                     Y                     l                                                                                                                                                                                         
                     
                     (
                     /
                     >
                      __UNIQUE_ID_srcversion197 __UNIQUE_ID_alias196 __UNIQUE_ID_alias195 __UNIQUE_ID_alias194 __UNIQUE_ID_depends193 ____versions __UNIQUE_ID_retpoline192 __UNIQUE_ID_intree191 __UNIQUE_ID_name190 __UNIQUE_ID_vermagic189 _note_10 _note_9 lme2510_update_stats lme2510_i2c_func dm04_read_signal_strength dm04_read_snr dm04_read_ber dm04_read_ucblocks lme2510_get_stream_config lme2510_get_rc_config lme2510_exit lme2510_usb_talk __already_done.19 lme2510_streaming_ctrl dvb_usb_lme2510_debug __UNIQUE_ID_ddebug453.3 __UNIQUE_ID_ddebug455.2 rbuf.55 clear_reg_3.54 dm04_lme2510_set_voltage rbuf.60 voltage_low.61 voltage_high.59 lme2510_stream_restart dm04_read_status lme2510_powerup lnb_on.65 lnb_off.66 rbuf.67 lme2510_pid_filter __UNIQUE_ID_ddebug449.9 __func__.68 __UNIQUE_ID_ddebug433.17 pid_buff.69 rbuf.70 lme2510_pid_filter_ctrl __UNIQUE_ID_ddebug447.10 rbuf.73 clear_pid_reg.72 lme2510_i2c_xfer obuf.75 ibuf.76 __UNIQUE_ID_ddebug451.6 lme2510_i2c_xfer.cold dm04_lme2510_tuner ts2020_config lme_tuner dm04_lme2510_tuner.cold tun_msg.57 lme2510_int_response __UNIQUE_ID_ddebug435.16 __UNIQUE_ID_ddebug445.11 __UNIQUE_ID_ddebug441.13 __UNIQUE_ID_ddebug437.15 __UNIQUE_ID_ddebug439.14 __UNIQUE_ID_ddebug443.12 lme2510_int_response.cold lme_firmware_switch fw_c_s7395 fw_s0194 fw_c_s0194 fw_c_rs2000 fw_c_lg fw_lg lme_firmware_switch.cold dvb_usb_lme2510_firmware dm04_lme2510_frontend_attach fe_name.62 tda10086_config sharp_z0194_config lme_config m88rs2000_config dm04_lme2510_frontend_attach.cold __func__.63 __func__.64 .LC52 lme2510_driver_init lme2510_driver lme2510_driver_exit lme2510_download_firmware lme2510_download_firmware.cold __UNIQUE_ID_ddebug457.0 lme2510_identify_state lme2510_identify_state.cold sharp_z0194a_set_symbol_rate __func__.78 __func__.77 __func__.74 __func__.71 __func__.58 __func__.56 __UNIQUE_ID_firmware470 __UNIQUE_ID_firmware469 __UNIQUE_ID_firmware468 __UNIQUE_ID_firmware467 __UNIQUE_ID_firmware466 __UNIQUE_ID_firmware465 __UNIQUE_ID_license464 __UNIQUE_ID_version463 __UNIQUE_ID_description462 __UNIQUE_ID_author461 __UNIQUE_ID___addressable_cleanup_module460 __UNIQUE_ID___addressable_init_module459 lme2510_id_table __compound_literal.0 __compound_literal.1 __compound_literal.2 lme2510_props lme2510_i2c_algo sharp_z0194a_inittab s7395_inittab __UNIQUE_ID_adapter_nr430 __UNIQUE_ID_adapter_nrtype429 __param_adapter_nr __param_str_adapter_nr __param_arr_adapter_nr __UNIQUE_ID_pid428 __UNIQUE_ID_pidtype427 __param_pid __param_str_pid __UNIQUE_ID_firmware426 __UNIQUE_ID_firmwaretype425 __param_firmware __param_str_firmware __UNIQUE_ID_debug424 __UNIQUE_ID_debugtype423 __param_debug __param_str_debug .LC0 .LC1 .LC12 .LC11 .LC5 .LC48 .LC61 usb_alloc_urb release_firmware usb_free_urb __this_module __symbol_put request_firmware usb_register_driver cleanup_module param_array_ops memcpy kfree fortify_panic __fentry__ init_module __x86_indirect_thunk_rax __stack_chk_fail strnlen __x86_indirect_thunk_rdx usb_submit_urb dvb_usbv2_disconnect __symbol_get mutex_lock usb_control_msg rc_keydown dvb_usbv2_probe usb_set_interface mutex_lock_interruptible usb_deregister dvb_usbv2_generic_rw_locked param_ops_short strlcat __x86_return_thunk dvb_frontend_detach jiffies strscpy mutex_unlock __mod_usb__lme2510_id_table_device_table usb_reset_configuration __dynamic_pr_debug usb_kill_urb __warn_printk kmalloc_trace param_ops_int msleep kmalloc_caches __request_module               5                                                    A            K            Q                                                                                     Q            V            a                                                                                                        1            K            P            \            c                    i            q                                                P            f                     
               (                   p                
                           0                   P                   h            x                                                                        	   p                                                                   	   8                               F            X                   h                   w                                                                               A            j            q                                                
            .            B            q                                                                                                                      	                   %	            5	                   <	                   C	         	          H	            r	            x	                   	                   	                   	                   	            	       	                   	                   	                   	
            
                  &
         	         +
            a
            
                   
            
            
            
            
            @      
         	         
            
                   
                                            1            l                        <                   =                   >                               C                                                   @       "            C       X            _                   h                        <                   =                   >                               C       
            
                    "
            @       R
            h
            
            <       
            =       
            >       
            <       
            >       
                    
            @       
            
                               )            <       8            <       J                   `            l            `      s         	          ~                                                9                                                              9       $            8                   =            [                  `            i                   p                   u                        ^                                                                                ^                                                             l                                                                                                    %                   *            1                   6            D                   P            H       U            \            9       a            o                   {            m                               ^                                                                                                                |                   G                   p                                                                                                                       	   h      	            n                                                                                        Q            `                  g         	         l            {            8               	   0                                             	   P                              h               	                                                 	                                 Q                                                                                     `                  )            `      .            T                  \            w                                                                                                                                                                                     3                  8            P                   U            _            q            M            p      _            P      q                                                `                                                                                     "                   '            2            =                   B            Z            @      _            h                  o                   t                        &                                                                              &                              K                                                             t      	            K                  $            p      )            =                  B            K                  R            p      W            i                  n            s                                                            p                                                                                                                               Z                              K                              .                  5                              &      
                              !            F            4       K            T                  Y                  a            }                                                                                      N                              ^                  7                                                                  4            S                                     2                                                           %             H      *             T             g                   l             |                                                                                                                                                                                                                                            M                                                p                                                                                                                                (                              l                        '                  ,            3            `            L      ~                        )                                                                                P                                          b                                          
                                                "            )         b   V            L      o            b      t                                                          b               L                  b                                    b                                    b      
            P                              t                  x                   .            b      5                   :            H                  X            b      ]                  m            b      r                  w            b                  b                                    b                  @                  O                   r            l                                                            2                   b            {            l                                                                                                   	           )            p      .            >                  F            N            ^            j                  r            z                        L                                                                        @                                 @                                                                                                                                      (                  0                  8                  @                              @                                                                           '                  `                   2      (            '      0            `      @            F      H            '      P            `      P                    X                                                     @                   P                                             (             `      0                   8                   @             0      H             p      P                    X                    `                   h             p      p             p      x                                `
                   0                                                         P                   p                                                            `                                                                                                      @      (             `      0                     8                     H                    P             h      X                     `                     p                    x             q                                                                                                                        U                                                                                               _                          $                   (             ^      ,                   0                   4             A      8                   <                   @                   D                   H             3                                                            J                                                         P                                                                $             J      (             e      ,                   0                   4             @      8             	      <             -      @                   D             $	      H             
      L             g
      P                   T                   X             1      \             R      `             {       d                   h             ]                                         1                   @                   O                   P                                                         	                          $             Z      (             `      ,                   0                   4                   8                   <             $      @             0      D             6      H             J      L             O      P             h      T             m      X             p      \             w      `             y      d             {      h             }      l             ~      p                   t                   x             X      |             \                   ]                   _                   a                   c                   e                   j                                                                             	                   
                                                                                                                                                                                               	                                                                                                                                                                                                                                    @                  E                  n                  p                  w                  x                  |                                           $                  (                  ,            	      0                  4            )      8            *      <            +      @            -      D            2      H            k      L            p      P            w      T            y      X                  \                  `                  d                  h                  l                  p                  t                  x                  |                                                                                    	                  	                  	                  	                   	                  "	                  $	                  )	                  U
                  `
                  g
                  i
                  j
                  k
                  
                  
                  
                  
                  
                  !                  0                  7                  <                  >                  @                  A                  D                  H                  Z
                   ^
                  _
                  a
                  c
                  e
                  g
                  l
                                           $                  (                  ,                  0                  4                  8                  <                  @                  D                  H                  L                  P                  T                  X                  \                  `                  d                  h                  l                  p                  t            F      x            P      |            W                  Y                  [                  \                  _                  f                                                                                                                                                c                  p                  w                  x                  y                  .                  /                  1                  6                                                       '                  .                  0                  2                  ;                  ?                  C                  ]                  `                   g                  i                  m                  n                                                                                                 $                  (                  ,                  0                  4            "      8            L      <            O      @            P      D            R      H            W      L                  P                    T                   X            x       \            y       `            {       d                   h                  l                  p                  t                  x                  |                                                                                                                                          ;                  X                  Y                  [                  ]                  b                                                                                                                                                             C                                   	                       X                                   	   b                     	      $             )	      (          	   
      0             	      4             
      8          	         @             
      D             
      H          	   B      P             R      T             i      X          	          `             N      d                   h          	         p             x      t                   x          	   z                   y                                   	                                         u                	   Z                                                      	   "                                      Z                	                      Y                                   	   *       @                   H                     P                                        `                  h                    p                              `                                     `                  `
                                    p      0            p      @                  X                   h            0      p                  x                                                       (                   `            0                  @                                                                                                                            p      8                   @             P      H                    P                    p                   x             P                                                                                                                        `                                                                                                                    @       (                   0            @      P                  X                   `                   h                                                                                                                                                                h                                                                                  0                  8                   @                   H            8      h                  p                   x                                                                    `                                            8                    P                     .symtab .strtab .shstrtab .note.gnu.build-id .note.Linux .rela.text .rela.text.unlikely .rela.init.text .rela.exit.text .rela.rodata .rela__mcount_loc .rodata.str1.8 .rodata.str1.1 .modinfo .rela__param .rodata.cst2 .rela.retpoline_sites .rela.return_sites .orc_unwind .rela.orc_unwind_ip __versions .rela__bug_table .rela__jump_table .rela.data .rela.exit.data .rela.init.data .rela__dyndbg .data.once .rela.gnu.linkonce.this_module .bss .comment .note.GNU-stack .BTF .gnu_debuglink                                                                                         @       $                              .                     d       <                              ?                                                         :      @               (     0!      1                    J                     a                                   E      @               X"     
      1                    ^                     %                                    Y      @               8-     x       1                    n                     #%                                    i      @               -     0       1   	                 ~                     @%      w                              y      @               -     @      1                                         (                                          @                0     p      1   
                       2               )      <                                  2               0      Y                                                 3                                                        6                                          @               2           1                                         H7                                                        V7      L                                    @               4           1                                         7      l                                    @               5           1                                        8                                                       =                                        @               `8           1                    "                    A                                     2                    L                                    -     @               N     0       1                    C                    L                                    >     @               (O           1                    U                    `M                                    P     @               R     @      1   !                 `                    `R                                    [     @               U            1   #                 p                    hR                                    k     @               (U            1   %                                     pR                                   {     @               @U           1   '                                     HU                                                        U                    @                    @                Z     0       1   *                                      Y                                          0                Y      P                                                  PY                                                          PY                                                         p                                                                P      2                    	                            O
                                                   PZ                                  0	*H
01
0	`He0	*H
1a0]080 10UDebian Secure Boot CA2(oe:B&C0	`He0
	*H
  9ߨAl#p5V{=0򮣔=l.n6e	aEB?lZf?b(_~Yw $l!WxiQfʙ!YYC:!N;=<`1jBQ@]&㚮B5uN]a!	WZuTAc
Gcv O\3+^kƒЈ)}v.ABnu*Ně0         ~Module signature appended~
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ELF          >                    X         @     @ 0 /          GNU \#0Qz#w/
V        Linux                Linux   6.1.0-37-amd64                 @  HiH  H(	     t
H       H       ff.         @  @HiH  H(	     t
H       H       @     AWAVAUIATLghUSHHH  L    Cf=     DKAz  Hs   HH}HHU HTHTHH)H)HI}(@   1A@   7h  CP   UDDK    A@   H    AHfE   AuH{SH    LE1    D[]A\A]A^A_    5  iU [TfTLDKKIu(UAQAWDHƨ   E1fWH    PfPfQH    PRH        HHE/L    f[D]A\A]A^A_    I}(   A7h  PUD   ʀ  fE1    A   H    AHIu DH    H    H0    D[]A\A]A^A_    U TT*ff.         USHH HH  eH%(   HD$1HD$   HD$    fHt$HZt}          fH      H  1HT$eH+%(   uLH []    HG H    H    Hp0    HC H    H    Hp0    똹       ff.         S@  HiH8HH  fH   Ht    H   HtH   Hx    H    1[    Hp H    H    H0    릐    US@  HiH8HH  fH   HtH   Hx    H    H   HtH   Hx    H    1[]    Hp H    H    H0    ff.         AW
   AVAUATUHSH   eH%(   H$   1@  Ld$(HiL81LHIH  L   D     't+  $t	&  E1L   H    LH   L
   ǃ    t   HL       L   ft$>H    Ll$HM       LL    IH]  H= Q  H   HA  Hx    (  LH       LH(	  H       L   H   H(	  Hǀ             Ld$x
   LLH    M     H0	  LH    Hl$H$    Hd$HD$      d   L   f$   HD$H$       LL    HH   H=    H   H   Hx       H   ƃ   1H$   eH+%(   Z  H   []A\A]A^A_    !    +w)wM    ,    IF H    H    Hp0    H       l*   H    D$   HD$       Hb  LH|$    H0  H0	  ǀ     Hǃ             LH0	  H    Hl$HD$    HD$    HD$     fL$    HD$ 8D$      HD$L   f$   H$       LL    HHH= H   HHx    H   8H0	     H    LHl$HD$       [L    fH        Hǅ0	      b   H        H        Hx    Iv H    H    H0            AVAUATUHSHXeH%(   HD$P1@  HiL8IH     t%HD$PeH+%(   3  HX[]A\A]A^I
   1LL   HD     <P  <D  Hǃ       ?   >   Hǃ       Hǃ       Hǃ       Hǃ       ǃ    t   L
         1H    Hƃ   L    L   H       fD$Lt$     LI       IH  H=    H   H   Hx       LH       LH(	  H       L   H   1HT$PeH+%(      HX[]A\A]A^    <uLH t       Hǃ       H   -   Hǃ       Hǃ       Hǃ           IE H    H    Hp0    0L    fRIu H    H    H0        f.         AVAUATUHSH L   eH%(   HD$1HD$    M   MH  HD$    L    ,  tpu9EE   fw%U fa  A      f
  L    HT$eH+%(   x  H []A\A]A^    EuEtEfwMfwU f?  fv  ftHEA   fL$fDL$
 	fT$HEHt$LHD$1M 	fT$   fT$
fD$HEHt$LHD$uL    LD$    D$D HM1	  fT$ft$
HHt$LHL$fD$8fHM   fALA          ҹ  fT$fL$
"fXfOHEHuA       L       -fD$HEHt$A  LfT$fDD$
HD$ruFE    f|$
fD$EfD$^ fT$A   fT$
LD$    D$Ht$LHt$ fT$
fL$fD$C    f    AVAUIATAUSH eH%(   HT$1Lt$D$ t_HD$    ˸   f/   Lt$fD$
   LHD$Lfl$fT$HD$]uTA!"\$\$D	D$  HD$    f/wJfD$
   LLfD$HD$fl$HD$HT$eH+%(   u4H []A\A]A^    1f?f1f?f 6    ff.         AUATUSHHH  HP8@  HiL8M$H  fA   t'  u.ݹH    0  L҃Hdu51H[]A\A]    u1I   I   @    tfID$   AH    H    Hp0    lIt$ D$H    H    H0    D$tf    AU
   ATUSHH0  eH%(   H$(  1@  H$   HD$    HD$    HD$    HiHD$     HD$(    L81HHMH  D  A$   1
   HHHD$    HD$    HD$    HD$     HD$(    )     &)    !/  H$   
   H(	  H    HH$   HD$0    HT$8   HD$@        V      H    HD$0f$   H$       I$   H$       HH2  H= &  H   H  Hx      I$   HHD$@    HI$     +
  ,9  H(	     HH    HD$8    HD$@    HD$0    `   H   f$   HD$0H$       HI       HH!  H=   H   H  Hx      I$   H0	  H   H  H(	  H  H  H(	  H0	  H  H  H  HǨ  HOH  H  HH)   H)ƉHI$   g  $  H$   
   0  H(	  HHHT$0   1Lo]  D    '  H(	     HH    HD$8 tHD$0    d      f$   HD$0HH$       I$   H    HH  H=   H   H  Hx      I$   H   \*  H        H6  I$   H(	  H        HH  H(	  H  H(  1A$   +3  H      H  H       L$A$   H    Ll$(D$I$   Hl$ HD$H(	  HD$    1
   IU H|$8HH0HD$H|$0HT$0HD$H    D$PHD$hHD$p(       H= wHxx tI$   1H$(  eH+%(     H0  []A\A]    IE H    H    Hp0    Iu D$H    H    H0    D$됹      0  LH   H        `      H    HD$0f$   H$       I$   H    HHR  H= F  H   H6  Hx      I$   H    I$   1HH    I$   1H    I$   1fIu H    H    H0    fH        Hd  I$   H(	  H        H  H(	  H  H(  H0	   6H        Hp  I$   H0	  H        HH  H0	  H  H(  H        H   I$   H(	  1ɺc   A       HHH        H(	  H  H(  I$   |H        H   I$   H(	  H        HHH        H(	  H  H(  I$      H        H        H       H        H        H       H        H        H/    H        H(	  H  H(  H0	  HI$   SH        H(	  H  H(  I$   %   H        H        Hv    I$   1H        H0	  H  H(  I$      H        H        Hj    H1    I$   {                ff.         ATUS@  HHiL8I$H     t	[]A\D     <   <uCH        H  H   H(	  H        H   1[]A\    <    H        H  H   H(	  H        HuH        pID$ H    H    Hp0       <DH        Ht|H   H(	    H        HGH        D  .H           H        H        H       H        H        H^       H        H        H    It$ H    H    H0    Aff.         H~    AT1H    UHSH    H@  LH  H    eH%(   H$8  1H$6  H\$PH     f$6  H     H$HT$H¦HT$ HT$0HH$   H4     HD$(HD$8HD$HHD$XHD$hHD$xH$   H$   H$   HL  H$   H$   H  H$   HD$    HD$    HT$@HT$`HT$pH$   H$   H$   H  H$   H$   H$   H$  H$  H$(  H     H$   H$   H$   H$   H$  H$   f@   1Ҿ0  HÅtgfH$8  eH+%(     H@  []A\    HE H    H    Hp0    Hu H    H    H0    뛹H   H   0  H0ÅxHHÅcIǄ$       Ht$ Hu$6  2  Ht$0Hu$6  G  Ht$@Hu$6  Q  Ht$PH{uY$6  VuOAƄ$   !IǄ$       D  A$   <+M  <,_  Ht$H-Ht$`Hu$6  <  Ht$pHu$6  8  H$   Hu$6  #s  H$   Hu$6    H$   Hu$6  @  H$   Heu$6  5  $7  `'  H$   H5u$6  im  H$   Hu$6  ie  1ҹ!   0  H
1ҹ!   0  H2       !   !   H0  {!   !   0  H\2       HH$  g$6   AƄ$   ,IǄ$       AƄ$    IǄ$       HE I$   H    H    Hp0    1ҹ   0  H1ҹ   0  H2             H0  o1ҹ   0  HS      0  H4       HH$   ?u$6    H$   Hu$6    H$   Hu$6    A$   H$   H$6   {D  A$   A$   ZAƄ$   &IǄ$       "AƄ$   "IǄ$       AƄ$   )IǄ$       $7  (AƄ$   $IǄ$       AƄ$   (IǄ$       AƄ$   #IǄ$       AƄ$   %IǄ$       xAƄ$   'IǄ$       ^AƄ$   *IǄ$       DAƄ$   +IǄ$       *HE H    H    Hp0        fA$   A$   fA$   A$   fA$   A$   HE H    H    Hp0    HE H    H    Hp0    HE H    H    Hp0    ff.         AW   AVAUATIUSH   LH  eH%(   H$   1Lt$H$    LA    Hu8H    I    KSL3JŅu|HI9uAƇ      Ht$LHD$    Lt$D$fT$Ņu8|$tUH$   eH+%(   `  HĠ   []A\A]A^A_    fIt$ H    H    H0    뫸   Ht$LHD$    Lt$D$fD$Wu\$wHt$LLt$HD$    D$ fD$l        LM      	  L .        LtACH\AT$HII$  k3	ʈT$$    I9uI$          ff.     f    AUATUSHHXLH  eH%(   HD$P1A   t#HD$PeH+%(   ,  HX[]A\A]HD$OD$O H     H     HD$ HD$0H    HD$    HL$HT$HD$(f   Ld$Ht$8HHD$8    D$
D$80fT$<Ld$@wŅtJD  HD$PeH+%(   {  HX[]A\A]    HG H    H    Hp0    y   Ht$8HHD$8    D$D$80fD$<Ld$@Ņz       HIǅ       Ht$ŅNHt$(Hu|$O,   Ht$H   Ht$H   |$OcH    H    |$OcHDA   I   fHs H    H    H0    Hs H    H    H0       H    딸   H                 H eH%(   HD$HH     u=H    HF   HF    F   1HT$eH+%(      H         u6H> t'H      HF HF    HF F,
&  H    и   Ht$D$ HD$    fD$HD$D$ HD$j    ff.          UHSH eH%(   HD$1D$ f   HD$HHD$    ft$Ht$D$   HD$Åt_fHD$eH+%(     H []    HG H    H    Hp0    Hu H    H    H0    D$   Ht$HHD$    	D$  D$D$HD$fL$HD$ÅU   Ht$HHD$    HD$    D$X!fT$Å   Ht$HHD$    HD$    D$`!fD$lÅ             AWAVAUATUSHH0LH  eH%(   HD$(1Lt$D$#    A    D$'    I    Lt$Hl$I    AWAI    IF    T$  f=/v1f=?f   HHl$ft$	LD$A0  IM9uAƅ      HD$#LHHD$    HD$D$40 fL$GA   D$'   T$&D$%t$#L$$8   T$#   H  1DD$       LHHl$D$HD$    Hl$D$80fT$u_   LHD$HD$    Hl$D$80fD$DD$u&HD$(eH+%(   u~H0D[]A\A]A^A_    AfHs DH    H    DD$H0    DD$@8tD$#
   f	ɾ	   	    ff.          AUATAUHSH(eH%(   HD$ HH        D  EtK      0  HÅ  D  HD$ eH+%(     H([]A\A]          0  H]Åu   1Ҿ 0  HCÅu   Ht$HHD$    HD$    D$H!fD$Åd1bHG DH    H    Hp0    E`E1D$ D$ fDT$fA   HD$Ht$HHD$    HD$D$ 0 fDL$fÅtOD  Hu H    H    H0    HG DH    H    Hp0    wA   HD$Ht$HHD$    HD$D$0 fDD$ÅsD  DD$L$E  A11ADD$L$T$D$D     Ll$Ht$HD$    f|$HL$D$ 0Ll$\ÅD$   HLl$HD$    ft$Ht$D$D$0Å   HD$Ht$HHD$    HD$D$H!fL$ÅvETH}(7΀@    ;Hu H    H    H0       1Ҿ0  HÅ       0  H}Å         0  H\Å   Ht$HHD$    HD$    D$H!fT$ÅyH}(7΀@    Å[1YHE EH    H    Hp0    L$A?      AHE L$H    H    DD$Hp0        ff.         AVAUATUSH(eH%(   HD$ H   H,  HxX      L`xAM$H  D  t'1HT$ eH+%(     H([]A\A]A^    A   <$/  <&uD$ D        HD$Ht$LHD$    HD$D$0 fT$suUD$Ht$LHD$    D$0@EED$D$   fD$HD$HD$"%fID$ AɉAH    H    Hp0    ID$ EH    H    Hp0    
It$ D$H    H    H0    D$ftX1E    0  Lef`ID$ EH    H    Hp0    1E   It$ D$H    H    H0    D$     IE H    AHx0        HS H    D$Hz0    D$f    Hs D$H    H    H0    D$    H            IF H   H    Hx0        IE H   H    Hx0        H        H(	  H  H(  H0	  H    I$       H    1    H0	  H  H(  I$       H    1    H(	  H  H(  I$       IE H    1Hx0    I$       H    1    H(	  H  H(  I$       H    1    H(	  H  H(  I$       ID$ H    Hx0        H            H            H                H    H    H        H                                              rtl28xxu_identify_state         rtl2832u_power_ctrl             rtl2831u_power_ctrl             rtl2832u_read_config            rtl2831u_read_config                            rtl2832u_tua9001_tuner_callback rtl2832u_fc0012_tuner_callback  rtl2832u_frontend_callback      rtl2832u_frontend_attach        rtl2831u_frontend_attach        rtl28xxu_frontend_detach        rtl2832u_tuner_attach           rtl2831u_tuner_attach           rtl28xxu_tuner_detach           rtl28xxu_frontend_ctrl  rtl28xxu_init           rtl2832u_rc_query                               0 0    0 00 	rtl28xxu_ctrl_msg               rtl2831u_rc_query               30  0C !0 "0 #0Z $0- %0 &0 (0 )0 ,0 .0 00 10          1(                           `                           a                           2(                           8(                                                       M                                                                                                               M                                                      f                           o                           o                                                                                                                                                                                               [                            [P                                                      j                           M                           Xp                                                                                                                                                                  M                           1                           TVB                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  :    $                           t               c              adapter_nr                                            disable_rc                                                                                                                                                                                         >>> <<< too large message %u
 failed=%d
 
 chip_id=%u
 unknown tuner %s
 rtl2832 %s mn88472 mn88473 cxd2841er_attach_t_c symbol:cxd2841er_attach_t_c si2168 rtl2830 dvb_usb_rtl28xxu fe=%d onoff=%d
 fc0012_attach symbol:fc0012_attach fc0013_attach symbol:fc0013_attach e4000 fc2580 tua9001 r820t_attach symbol:r820t_attach si2157 unknown tuner %d
 rtl2832_sdr no SDR for tuner=%d
 qt1010_attach symbol:qt1010_attach mt2060_attach symbol:mt2060_attach mxl5005s_attach symbol:mxl5005s_attach   NONE FC0012 FC0013 MT2266 FC2580 MT2063 MAX3543 TUA9001 MXL5007T E4000 TDA18272 R820T R828D SI2157 tuner=%s
 MN88472 found
 MN88473 found
 CXD2837ER found
 Si2168 found
 QT1010 MT2060 MXL5005S  rc-empty onoff=%d
  component=%d cmd=%d arg=%d
 cmd=%d arg=%d
 GoTView MasterHD 3 Astrometa DVB-T2 rc-astrometa-t2hybrid PROlectrix DV107669 Sveon STV27 Sveon STV21 Sveon STV20 Peak DVB-T USB Genius TVGo DVB-T03 Crypto ReDi PC 50 A MaxMedia HU394-T Compro VideoMate U650F Compro VideoMate U620F MSI DIGIVOX Micro HD GIGABYTE U7300 TerraTec Cinergy T Stick+ Dexatek DK mini DVB-T Dongle rc-leadtek-y04g0051 Dexatek DK DVB-T Dongle TerraTec NOXON DAB Stick rc-terratec-slim Freecom USB2.0 DVB-T        %s: %02x %02x %02x %02x %02x %02x %02x %02x %s %*ph
    chip type detection failed %d
  3DVB: Unable to find symbol cxd2841er_attach_t_c()
    3DVB: Unable to find symbol fc0012_attach()
   3DVB: Unable to find symbol fc0013_attach()
   3DVB: Unable to find symbol r820t_attach()
    3DVB: Unable to find symbol qt1010_attach()
   3DVB: Unable to find symbol mt2060_attach()
   3DVB: Unable to find symbol mxl5005s_attach()
 RD SYS0=%02x GPIO_OUT_VAL=%02x
 WR SYS0=%02x GPIO_OUT_VAL=%02x
 TURBO-X Pure TV Tuner DTT-2000  Leadtek WinFast DTV Dongle mini ASUS My Cinema-U3100Mini Plus V2        TerraTec Cinergy T Stick RC (Rev. 3)    Leadtek WinFast DTV2000DS Plus  Leadtek Winfast DTV Dongle Mini D       DigitalNow Quad DVB-T Receiver  Trekstor DVB-T Stick Terres 2.0 TerraTec NOXON DAB Stick (rev 3)        TerraTec NOXON DAB Stick (rev 2)        G-Tek Electronics Group Lifeview LV5TDLX DVB-T  TerraTec Cinergy T Stick Black  Realtek RTL2832U reference design       Realtek RTL2831U reference design       drivers/media/usb/dvb-usb-v2/rtl28xxu.c license=GPL author=Thomas Mair <thomas.mair86@googlemail.com> author=Antti Palosaari <crope@iki.fi> description=Realtek RTL28xxU DVB USB driver parm=adapter_nr:DVB adapter numbers parmtype=adapter_nr:array of short parm=disable_rc:disable RTL2832U remote controller parmtype=disable_rc:int alias=usb:v5654pCA42d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v15F4p0131d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1F4DpD803d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1B80pD3A4d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1B80pD3AFd*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1B80pD3B0d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1B80pD39Dd*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1B80pD395d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0458p707Fd*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1F4DpA803d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0413p6A03d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1B80pD394d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v185Bp0650d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v185Bp0620d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1D19p1104d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1B80pD393d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1B80pD3A8d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0CCDp00D7d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1D19p1102d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0CCDp00D3d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0413p6F12d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0413p6F0Fd*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0413p6680d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1D19p1101d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1F4DpC803d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0CCDp00B4d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0CCDp00E0d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0CCDp00B3d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v1F4DpB803d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0CCDp00A9d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0BDAp2838d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0BDAp2832d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v14AAp0161d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v14AAp0160d*dc*dsc*dp*ic*isc*ip*in* alias=usb:v0BDAp2831d*dc*dsc*dp*ic*isc*ip*in* depends=dvb_usb_v2,rc-core,usbcore retpoline=Y intree=Y name=dvb_usb_rtl28xxu vermagic=6.1.0-37-amd64 SMP preempt mod_unload modversions                            $                                                                                                                                                                                                                                                                                         (    0  8  @  H  P  8  0  (                     8  @  H  P  X  `  h  p  x    8  0  (                     8  @  H  P  8  0  (                     8                8          8                                                                     (    0  8   8  0  (                                             (  0    0  (                     0  (                                            (  0  P  0  (                   P                         (  0  P  0  (                   P                       (  0  (                 0                       (  X (                 X                                                                 `              `                        (    0  8    8  0  (                                            (    (                   (                             (        (                  8          8                         (    0  8  h  8  0  (                     h                       (  P  (                 P                         (  0  X  0  (                   X        8  8     X                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Y@c    try_module_get                                          J^    dvb_usbv2_reset_resume                                      ir_raw_event_handle                                     ֝n    __symbol_put                                            vg    usb_register_driver                                     j    param_array_ops                                         8߬i    memcpy                                                  n    __dynamic_dev_dbg                                       m    __fentry__                                              `8\    dvb_usbv2_suspend                                       pHe    __x86_indirect_thunk_rax                                ~    _printk                                                 }    usb_clear_halt                                          V
    __stack_chk_fail                                        k    module_put                                              뼬    i2c_adapter_type                                        ]\!    dvb_usbv2_disconnect                                    ˄    __symbol_get                                            9I    _dev_err                                                Ȕ    i2c_unregister_device                                       platform_device_unregister                              KM    mutex_lock                                              $96    usb_control_msg                                         	D    rc_keydown                                              PX    dvb_usbv2_probe                                         s.$    i2c_new_client_device                                   u    mutex_lock_interruptible                                C3    usb_deregister                                          TV    param_ops_short                                         9[    __x86_return_thunk                                      9d    strscpy                                                 &    platform_device_register_full                           82    mutex_unlock                                            2    dvb_usbv2_resume                                             param_ops_int                                           $x    ir_raw_event_store_with_filter                              msleep                                                  #O    __request_module                                        zR    module_layout                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   	                       c   E  $             ` b                                                                                                                                                                                                                                                       f                                                     N                                                     8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                     w                                                                                                                                                               x                                                     D                                                     (                                                                                                          {                                                     `                                                     ?                                                     5                                                                                                                                                                                                                                                                                                                                                                                   s                                                     e                                                     \                                                     U                                                     N                                                     ,                                                                                                          w                                                     s                                                     5                                                     D                                                      6                                                      dvb_usb_rtl28xxu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         GCC: (Debian 12.2.0-14+deb12u1) 12.2.0  GCC: (Debian 12.2.0-14+deb12u1) 12.2.0         }  }  SD         
9             X    '          
Y                      A= 
      O=        `       i        [=    0   h=    @   #    P   0    X   @    `   k    h   {    p       x   :       z             
\ u=      4  *        `   @   =      u        =      =     V           c @   -  e    	  g    !  i    )  k @  ' k   = k   = k     b @    %    - ^   = _   =    @ =    A =    B =    C       
             b        ]        a       
                 d       
                    k          f       
                      h       
                j 	>      >     #>    2>    ?>    P>    `>    m>    }>    >    > 	   > 
   >    >    > 
   >    >    ?    ?    1?    D?    U?    d?    q?    ~?    ?    ?    ?    ?    ?    ?      x -       x *   @   ?   (   ? o          @   4&     `   3.        	> l    V        4  *            m ?      @     @    '@    ;@        *         *       N@ ;  X  :"        U@ K   @  `  *D   Ϡ      c@       x Y  @         O      ? n    4  G  @  _    @  V u   S{ 0Y    n@ p      K      z@ K   (  @ -   @  @ -     @ -     @ l    @ q    @ q `  @ *     P  *     Z  k      
A *  @  A K   `  A      +A I    7A I   !  DA *   @"  QA l `"  _A -   "  mA $   "  O  *   "  yA *    #  A *    #  A *   @#  A *   `#  A   #  A   :  A H   >  A *  @>  A `   >  _ K    ?  A w @?  	  y ?  0  { ?  A }  @  A } @@  B } @  B  @  )B   A  /B  @A  6B  A  JB  A  [B   B  dB  @B  tB  B         r ~B               t       
       s              v       
       s        x       
        s        z       
       s     *          |       
       s     *       *          ~       
       s                             
        s     K                 
       s                      
       s             q               
       s                          *       B *       B                 $       B    (      )  O     *  B    +  B   @            k	  '  @   p	  )     	  1     M  3     	  3  @  	  1    	  1           
 B     B      s   @   :"                    _    @  ]       	     B     :"           @   x              BP       \      B *     C -      x   *   @  C F7    &C       >C `   @  ݽ `     A `   @    `     GC `   @  UC G    aC  	  oC k     {C Ȉ   C ʈ    )  ˈ @  C G    C ]                           
                                          	   C       C      x   *   @     `      C               C    @            C      \v  a   @   C   x   C      V        i  @  %  *   `  ]       C &     D &     D &     D       A  @    `     )          @  P   `          )D     r
       5D     s
                        >D   (   J K       C  @   A `      MD               YD   @   C      C     ,  &   @  D &   P  -  `  ]       e            
                  cD      (                     iD   8   C        `      c  *     ]  *                      yD      D      C      D   X   C        `                    	      ]     @  D K             D      D     D    D    D    D       
E      E  @   'E     5E            
       
                            
                      *                         
                      
K                              FE      XE     oE    E             *  *       _ *                :"               E   @         *  *     _ *     E   (   E      E  @   E Ĉ    E ƈ    E Ĉ           
       
            *                  F 
  p   C      I$  0  @   F   `      @  F    `  -F      ˛	 `     :F    @  Ч D    4  *  @        
                            
                È       
               ň       
                    ǈ       
                Ɉ         QF      YF     fF    |F    F    F    F    F     F @   F    F    F    G    G    G    ,G     :G  @  IG    XG    hG    G    G    G    G     G   @ G    G    H    H    4H     EH    @TH    cH       =      }    0   yH             }        O     @   H      H     H    H    H      H     H    H      I     I    I      'I     /I    =I    LI    [I    gI    sI     I @   I      I     I    I    I 
     I     I    I    I    I    I    J    J    J    J 	   (J 
   0J    9J    AJ      OJ     TJ    [J    bJ    iJ    qJ    yJ    J    J    J 	   J 
   J    J    J 
   J 	     J     J    J    K    K    0K    FK    \K    qK    K      K     K    K    K    K    K    L    (L    >L    SL 	   hL 
   }L      L     L    L    L    L    L      L     L     M    M    "M      +M     4M    >M    IM      TM     _M    jM    uM    M      M     M    M    M    M    M    M    M    M    M 	   N 
   N    N    $N 
   -N    6N    >N    HN    RN             T !       [        cN   	   _            ݈    mN   %   4&         O                 ވ       zN 	     N     N    N    N    N    N    N    N    O    O      b           `   @    `      V     @  'O 	    Z  k                 @  4O      ?O    JO G     SO G     C     ^s	  @  ]O    gO        `       e/  0     s       W     c   @  _    `  x   *     <U       DU       P         D     rO    V        O  @  O      C    O     A  @  O    Z  k                           
                    k                   O      O        O        O    @   O      V        P *      P *      $P *   @  6P *   `  DP *     RP *     aP      a         "         sP    @   V
 -      {P      P    P    P    P    P      P    P    Q    !Q    ;Q    SQ    kQ      P       	             @  !     )     yQ     Q  @  $    Q    Q     Q  @  am    Q    Q     Q  @  Q    Q          
                 R       0      )   @   R  @  R k     #R k     .R k      <R k   @  ER k     WR    Qg  1  (  x      @(  
	     `(                
                      
                                   
            k                 
                             
            '                
            %                
                                     
            *           jR      V  ?       |R 	  H   P       yQ  @   R     Q     R     R  @  	     R 	   $           
                            
                       R 	     V        P *      P *      R *   @  R *   `  S *     S *     #S *     a ̈   9S "     P  
     JS *     \   @  	     QS            @  !     )     p	  
    ]S  @  bS    tS    S     S  @      S    S   	  S  @	  S  	  S  	  S   
  T ! @
  T # 
  ,T % 
  k '    5T ) @  MT +   R 	   mT 	    yT  @  }
 -   T    T          
            O-                       
            K                             ҈               
                    
                                   
                     T 2    a  *       T Ո     sk ψ @   T Ј `   T ӈ    T Ԉ    T ֈ    T *      T ׈    M ؈    U *   @  U Ԉ `  U Ԉ   )U ڈ   /U ۈ   7U ܈   GU و    TU $      lU $   (  zU $   0  U *   @  U *   `  U $     U /   V *      U *   @  U $   `  U $   h  V $   p  V $   x  %V $     0V $     ;V $     PV $     iV $     V $     V $     V $     V $     V $     V $     W *     W ߈    W ߈ (  !W ߈ P  /W ߈ x  =W ߈ 	  LW ߈ 
  [W ߈    ߈ 
                
                           
                    ͈               
                     Έ               
            ш        "       
            Ј        $       
            ψ        &       
            2          (       
                      *       
             ,          gW $       j Ԉ     T Ո @   GU $   `              .             
       k                               0 uW      W     W    W    W    W      W     W    W      W     W    
X    X    1X    >X    MX    \X    nX    X 	   X 
   X    X    X 
   X    X    X    X    Y    Y    +Y    9Y   0                   "       DY   <   }            5    O       ]       ZY      }           3       2 @   pY 4 `   ]        yY      Y    Y    Y    Y    Z    /Z      >Z    HZ    XZ    cZ    lZ   0   xZ          < @   Z  k      G	  ?    Z A    Z A @  Z      Q  X      Y @   Z  k      	  [    0  [    p	  ] @  Z `   Z b   Z e    Z g @  Z i   [ i   [ k    %[ i @  6[ [   J[ m   W[ o           ;       
       >     &              4     H         :        =       
       >        @ _[   H   r[ j       j     [ j       D   Z  k      [     xZ          < @   Z  k      [       [ *      [       [ E @  [ &      l &   0  [ &   @  G	  G   [ K   [ M    Z O @  Z O          C            $              
       D     &                 F       
       D     I        J        B        H       
       D     J        L       
       D        N [    Q        R       
       O-      Q       O-      Q       >        [    T        U       
       O-      Q       O-      Q       J        	\      \     +\    :\      G\ `       (  V    Y\      h\    y\    \           W       
       <        Z       
       <            Q          \       
       <     _     P        >        ^       
       <     >        a       
       <     d     S        D        c       
       <     D        f       
       <     Y        h       
a       <        j       
       <     '         l       
       <                            n \      \     \    \      \     \    ]    ]    %] 
        B     6] j  @  B] j    Q] K   `    s   W] u   ,          q    c  p @  \] &   `         r f]     W] v     eg  w   u] y    Z  k   @  c  p     q   }  &     O  H        s @  {] *     ] 9   pY 4   H      ] K      ] &       `   @  ,              t         8X :     H C              8X P     H S     ]     ] ;     Z  k   @  ]      ]      ] {   ] {    ] } @  ]    ]    P           s @  W] u   ] `     	^  @  fJ   @  ^ `   
  ^     #^    `  %  G    4  *    *^ w    6^ H     F^ T   @  U^    `  ]^             x       
       u        z       
       u     O-      Q          |       
*       u     O-      Q          ~       
        u            O-      Q                      u                  &                    $         g^      o^         @     k   
	       u] < @  v^ G    ^ G               %     
   ^   H              R   @   ^ R      ^ R              x  D  @  4  *     ^      ^     ^    ^    _    /_    L_    i_    _   (          CJ  @   x           	             
       
                _   0   )       Z  k   @          `      I$  0  @  { K   `                
                         _   x   3.         %  @   _     _     _ %       %  @  S %    _    _ %     _   @  ` %    )     m     `  @  	            
       
k                             `      )`      ,     @   c     `   1        3`       T  -            >`  @       -          F`     W`     r`     `     ` `      ` `                   

           k                        
k                                          
k                  
                       
k            k                 
       k                 
       k                           "         &        #         `   0   ` k        
  @   `       `       ơ        `       cK     ~<    @  `      `     a     a    8a    Ma    ba    ua    )` 2  X  c         a        :"    @   a       a      a      a      a      a      b      %b      7b      Ab      Ob      ab      4  n       k   @  )         rb É    zb k   @  b *     b      b *     Rh X     b *      b ĉ @  J4  G  @  1     @   D  `  U  ŉ   b      b `     b    @  b ]   `   `     	c *     c D  @  c      %c           <c     Pc     ac     pc     zc     c     c ǉ @  c ɉ   V                                 c   `   c      c  @   c     c     c     c  @  d    d    d     (d  @  7d    Ad           
       
                                 ]                
                       
                      
                       
                       Vd   (   bd      vd  @   d     d     zc            
       
            l                 
             k                 
                                   
             l                                                                         d               Ɖ d               ȉ d   (   hS        p        c"     @     
  `   6 <     d      d     d    e    (e      6e     Je    ce    }e    e    e      %        s
        w    @   }    `   e      4        4        e    !   e   |   w        }        e    @   e    `    !      e              e       f           @  f    `  f      ,f      5f      Cf      ]        3 Ή    Mf    `  Xf    h    щ p                   .            c Љ       [     af      c             ҉     qf      ,         hS            @    Ӊ    f 	  h   f        f        f    @   f    `   f !      f !      Cf       Q            @           c Չ     $D [     f      c         hS            @       ։    f   T   ,         V  w	      c            @  g    `  
g      g      sP      [       g                      
؉ #g   D   ,         V  w	             g    @  
g    `  2g      c         >           
ډ =g   ,   Lg        c         a     @       `          
܉ Rg   @   Lg        c         ,     @       `   g       
g       T             fg   ,   ګ        "         vg    @   g    `                ]                                   g   p   g        g     W           @                   0   g   t   g        g     c          >  @  g   @   x          t        
     @        `                 
 g       c         x          ]     @     
  `   h     
        `      h     h      %  G    7 *    #h `      [     "       L              )h       1h    @  0
    `  ]  8     *     V  a            9h      Eh     Vh    fh    vh      h     h    h    h    h    h             H J              8X `       H D           <   H 6     h 7     h             W]  @        c          :"         @  i    %  G     %  I     gt    @  i ~   `  i 
  x  o^       i  @          u] <    ]       Q        +i    @ 
	     A 7i Y   Ci    Ni     %  G    4  *                    Zi      V         ?    @        ni                    @    ;     : $      i       i $      i $     i          @  -  	   i    {       i 
 @  
j    j      #j     W  @  5j    @j     Lj  @  ]j    mj    }j     j  @  j 	   j 	         
	  	 @  j    j           
         j   0   O        j -   @   A w         9        n@ p    j K   @  O     `        
                j   P        V     @   ?       k K            k   @  }    k       &k G  @  0k G  @  :k `  @  W & @&  N@ s @  Ck      Kk R    Z  k   @                   Yk                 dk        qk        9     @            {k      k      k      c  $         $      # $             k   (   a $       k $      k  @   k     z            
        
                       k   p	   #     z  @   x   $    
  ] $   
  k K   
  
l K   
  l $    
  &l $   (
  5l #   0
  ?l    @
  Jl  
  i  @  u] x  ,  g^  B  Sl $ @I  Vl %  J  ^l % J                
                   &                        
                       
                      
       
            L                 `                           
                             
                             
                      
                                   
                                    gl   8  k         @     $            =#   @  wl      `        ! @  -  "   l    @	  l    `	  l k   	        
                    Q                                   
                    
              W      
                                                                 l 	  (   a *       l K       l $   (   l $   0   l $   8   l * @   l ,    k .    k 	           
'       
     `         )       
`      `         +       
            $       &                 - l   8   a *       Lg $       l * @   l ,    m 2    k .    k 	 @  A U           
/       
       `      K          1          #m        -m        5m 
  0   w        }        {     @   t    `              3    Hm       Um       ]          5                     
   _m   X    D        hS        
_ 4 @         rm   0   hS        ,         {     @    D    `   ]          ,;     m 	  @   ,         hS        {     @   f    `   f       f       f        D              m   0   hS        9  Ή        `   m   @   ,         hS        {     @   w    `   }       9  Ή     D              m   @    D        hS             @   ]     `   T ͉           m      n     %n             =n                          T         =     Hn   0   
 <       > @     `      Zn `      cn       o
 H       J @    L    m   N           
@       
       C     E     G        D n   `   )  O     n Q @   a  E      C    Zn `      n `     %  `        `            F n   H  C        `          @  n K     ]  *     n Q   )      n  @  n Z   V       n *      k      n k   @    ]   :"      T        `   @  n G   m% C  	  n C @	  Y_   	  # n  	  o   
         ?        B       
       C        I       
        C     E     G        K       
        G        M        A o               P o      +o     :o    Go    Vo    fo    so    o    o      o     o    o    o      o SB      o 
  P            k	  '  @   p	  )     	  1     	  3     o 3  @  
      	  5    	  1     	  1  @         
U p   `  C      O    e      s  X @  T *     :"             n Q @  p     n Z   x      
  [ @  V       p R   "p S   _      b  &     ]         ,     @   *p *  `   2p `      :p     !  Dp ω @!  	  ^ !  Lp a !  Vp    "  4  n  "         V cp               Y        T       
        ]        W        \ up               
_        ` p      Lg        Z  k   @          
b p        `       ; ]    n Z    
  ̉    %  D  @  p G     p `      J `     p       k*  *      p f @  p               e p      ]         p 
      q    `   q    h   q h p              K      	   +q      ]         A        Eq    (   Pq      kq       uq      |q B     q       q        q 	     q     q    q    q    q    q    
r    r    ,r             ? i     >r j     Hr g     Rr      c  k       l     cr      xr *            @   
  *      c  *      r      ]  *       
 $       %  $   (   ^  $   0   W $   8   r 
  h   r s     r v @     x    r s    B x    r x @  " z   M  z   o |    r ~ @  r    s    s            
p       
       E        r       
       E     Q       u        o        t       
       E     *          w       
2       E            k          y       
2       E                      {       
       E               }       
       E     *                       
       E                  d                 %s   X   R s     ;s s @   Cs     Os     [s     ks  @  ss    {s    s     s  @  s           
       
       E             ݉               
       E             ܉               
       E             މ               
       E             ؉               
       E             ى               
       E             ډ               
       E             ۉ               
       E              s                      
       E             c         s       s x     s x @   s     s ~           
       
       E     *       *       *           s       $       ^ $      t      6t    Vt             st      xt      ]       t *       ơ  *   @      `   t      t     t    t    u      c       <%                                2u      s      Hu  @   Wu     ]u     cu     pu  @  }u    u    u     u  @  s ~   u    u     u  @  u    u    u     v Ê @  v x   $v s          
       
       E     *       *                 
       E             ω               
       E     ω               
       E                      
       E             Ή               
       E             9               
       E             Ӊ               
       E     k                  3v   8   Gv Ȋ     Wv ˊ @   bv Ί    mv ъ    ~v Ԋ    v ׊ @  v ׊          
Ċ       
       E     Ǌ        n        Ɗ       
       E     ʊ                Ɋ       
       E     ͊                ̊       
       E     Њ                ϊ       
       E     ӊ        ߉        Ҋ       
       E     ֊                Պ v      v      v  @          
؊ v      v     w   ,   &w        "  ڊ     5 K   @   J K   H   Ŗ  K   P   T K   X   =w *   `   Mw               Zw K      gw K      |w *      w       w       X *   @  w   0   w ߊ     w  @   w     w ߊ    w     x  @         
܊       
       E            Q       4         ފ       
       E             ۊ         x   P   6x 4     >x ͉   Gx ͉    Sx   0   ex G      4  n     A  @          kx      x      x  @   x     x     x     x  @  x    x    x     x  @  x    y    'E     y  @  'y    6y 
          
       
       E                            
       E                  7               
       E                  8               
       E                  :               
       E                  6               
       E                  ;               
       E             ʉ               
       E             ׉               
       E             ԉ                
       E                              
       E                                   
       E            	        m         Fy   @   +  
     Lg  @        Vy     \y     `y  @  4    hS           
        q                                Ŋ        ݊        ي         cy   (   _ s     |y  @   	      0      	             
       
        E               
       E              y      @
 d                         y      `0 X      y    @   n k                              y   (   a *       Lg $       A U  @   R     n E    j     y       y        y        y    @    z &   `   Sl #    l *            z       z &       y *       Sl # @   z      )z     9z    Iz    Yz      jz $       y %     ]  *   @   sz      J $       z      J $       z $      z       J $       z *       z *   @   z $   `   z $   h   z $   p   z $   x   z $      z $      z *      s
 *      z $      { $      { $      { $      '{      8{     G{    X{    g{      {     {      J $       z *     { K   @   { K   H   z K   P          
, {      Sl         *   @   {      a *       R  @   { 1          
E     `         0 {      R      |      |     "|    -|    8|    B|    M|    X|      jz $       y *       e| 3 @   q|    `   | K      | K             
4 |      Sl #      7 @   y $      |      |      |             `  |      Sl      C  @   T      |      
  $            8   l '     l /     |     [  ?G      M $      Lg $     } ?   @  '  $     } `    %} K      /} K     =} `  @  N} `    _} `    v}      }    @     9   }      }     }    }    }      }     }    ~    ~    1~     F~ !   [~ "   p~ #   ~ $   ~ %   ~ &   ~ '   ~ (   ~ )    *    +   0 ,   E      ^  &       ,  &        &            @   R      S &         $             
> c      S &         $        $             
@                                ]    $          
C        `                :        '        /            A              
J            A              
L            ?              
N       
          `      Q        -        P       
          `      $              *        S       
          `      V        5        U       
          `      Y        '        X       
          `      \     &          (        [       
          `      _        )        ^       
     b     `         &        a        = y           p         
   3  ,     }  &           g       
   3          i       
      }      k       
          m     m       
   Sl          p       
          0    r D    m       
   3  R    u h    u ~    u     u     u ƀ    u       
   ߀ k       :    b         |       
      V         ~     m 4    m       
*   W `  I           
   3 `   a  b     [           
      S &     $     $   m           
       d      usb_device_id match_flags bcdDevice_lo bcdDevice_hi usb_dynids usbdrv_wrap for_devices usb_driver pre_reset post_reset drvwrap no_dynamic_id supports_autosuspend disable_hub_initiated_lpm soft_unbind rc_proto RC_PROTO_UNKNOWN RC_PROTO_OTHER RC_PROTO_RC5 RC_PROTO_RC5X_20 RC_PROTO_RC5_SZ RC_PROTO_JVC RC_PROTO_SONY12 RC_PROTO_SONY15 RC_PROTO_SONY20 RC_PROTO_NEC RC_PROTO_NECX RC_PROTO_NEC32 RC_PROTO_SANYO RC_PROTO_MCIR2_KBD RC_PROTO_MCIR2_MSE RC_PROTO_RC6_0 RC_PROTO_RC6_6A_20 RC_PROTO_RC6_6A_24 RC_PROTO_RC6_6A_32 RC_PROTO_RC6_MCE RC_PROTO_SHARP RC_PROTO_XMP RC_PROTO_CEC RC_PROTO_IMON RC_PROTO_RCMM12 RC_PROTO_RCMM24 RC_PROTO_RCMM32 RC_PROTO_XBOX_DVD RC_PROTO_MAX rc_map_table rc_map scan rc_driver_type RC_DRIVER_SCANCODE RC_DRIVER_IR_RAW RC_DRIVER_IR_RAW_TX rc_scancode_filter rc_dev managed_alloc input_phys driver_type encode_wakeup allowed_protocols enabled_protocols allowed_wakeup_protocols wakeup_protocol scancode_filter scancode_wakeup_filter scancode_mask keylock keypressed keyup_jiffies timer_keyup timer_repeat last_keycode last_protocol last_scancode last_toggle min_timeout max_timeout rx_resolution tx_resolution lirc_dev lirc_cdev gap_start lirc_fh_lock lirc_fh change_protocol s_tx_mask s_tx_carrier s_tx_duty_cycle s_rx_carrier_range tx_ir s_idle s_wideband_receiver s_carrier_report s_filter s_wakeup_filter s_timeout ir_raw_event_ctrl carrier ir_raw_event pulse carrier_report media_file_operations media_devnode media_dev media_device hw_revision topology_version entity_internal_idx entity_internal_idx_max entities entity_notify graph_mutex pm_count_walk source_priv enable_source disable_source req_queue_mutex request_id media_gobj mdev media_entity_enum idx_max entity media_entity graph_obj num_pads num_links num_backlinks internal_idx media_graph ent_enum media_pipeline start_count media_pad gobj0 media_interface gobj1 sink media_link is_backlink media_pad_signal_type PAD_SIGNAL_DEFAULT PAD_SIGNAL_ANALOG PAD_SIGNAL_DV PAD_SIGNAL_AUDIO media_entity_operations get_fwnode_pad link_setup link_validate has_pad_interdep media_entity_type MEDIA_ENTITY_TYPE_BASE MEDIA_ENTITY_TYPE_VIDEO_DEVICE MEDIA_ENTITY_TYPE_V4L2_SUBDEV media_intf_devnode media_device_ops link_notify req_alloc req_free req_validate req_queue media_request debug_str updating_count access_count num_incomplete_objects fe_caps FE_IS_STUPID FE_CAN_INVERSION_AUTO FE_CAN_FEC_1_2 FE_CAN_FEC_2_3 FE_CAN_FEC_3_4 FE_CAN_FEC_4_5 FE_CAN_FEC_5_6 FE_CAN_FEC_6_7 FE_CAN_FEC_7_8 FE_CAN_FEC_8_9 FE_CAN_FEC_AUTO FE_CAN_QPSK FE_CAN_QAM_16 FE_CAN_QAM_32 FE_CAN_QAM_64 FE_CAN_QAM_128 FE_CAN_QAM_256 FE_CAN_QAM_AUTO FE_CAN_TRANSMISSION_MODE_AUTO FE_CAN_BANDWIDTH_AUTO FE_CAN_GUARD_INTERVAL_AUTO FE_CAN_HIERARCHY_AUTO FE_CAN_8VSB FE_CAN_16VSB FE_HAS_EXTENDED_CAPS FE_CAN_MULTISTREAM FE_CAN_TURBO_FEC FE_CAN_2G_MODULATION FE_NEEDS_BENDING FE_CAN_RECOVER FE_CAN_MUTE_TS dvb_diseqc_master_cmd dvb_diseqc_slave_reply fe_sec_voltage SEC_VOLTAGE_13 SEC_VOLTAGE_18 SEC_VOLTAGE_OFF fe_sec_tone_mode SEC_TONE_ON SEC_TONE_OFF fe_sec_mini_cmd SEC_MINI_A SEC_MINI_B fe_status FE_NONE FE_HAS_SIGNAL FE_HAS_CARRIER FE_HAS_VITERBI FE_HAS_SYNC FE_HAS_LOCK FE_TIMEDOUT FE_REINIT fe_spectral_inversion INVERSION_OFF INVERSION_ON INVERSION_AUTO fe_code_rate FEC_NONE FEC_1_2 FEC_2_3 FEC_3_4 FEC_4_5 FEC_5_6 FEC_6_7 FEC_7_8 FEC_8_9 FEC_AUTO FEC_3_5 FEC_9_10 FEC_2_5 fe_modulation QPSK QAM_16 QAM_32 QAM_64 QAM_128 QAM_256 QAM_AUTO VSB_8 VSB_16 PSK_8 APSK_16 APSK_32 DQPSK QAM_4_NR fe_transmit_mode TRANSMISSION_MODE_2K TRANSMISSION_MODE_8K TRANSMISSION_MODE_AUTO TRANSMISSION_MODE_4K TRANSMISSION_MODE_1K TRANSMISSION_MODE_16K TRANSMISSION_MODE_32K TRANSMISSION_MODE_C1 TRANSMISSION_MODE_C3780 fe_guard_interval GUARD_INTERVAL_1_32 GUARD_INTERVAL_1_16 GUARD_INTERVAL_1_8 GUARD_INTERVAL_1_4 GUARD_INTERVAL_AUTO GUARD_INTERVAL_1_128 GUARD_INTERVAL_19_128 GUARD_INTERVAL_19_256 GUARD_INTERVAL_PN420 GUARD_INTERVAL_PN595 GUARD_INTERVAL_PN945 fe_hierarchy HIERARCHY_NONE HIERARCHY_1 HIERARCHY_2 HIERARCHY_4 HIERARCHY_AUTO fe_interleaving INTERLEAVING_NONE INTERLEAVING_AUTO INTERLEAVING_240 INTERLEAVING_720 fe_pilot PILOT_ON PILOT_OFF PILOT_AUTO fe_rolloff ROLLOFF_35 ROLLOFF_20 ROLLOFF_25 ROLLOFF_AUTO fe_delivery_system SYS_UNDEFINED SYS_DVBC_ANNEX_A SYS_DVBC_ANNEX_B SYS_DVBT SYS_DSS SYS_DVBS SYS_DVBS2 SYS_DVBH SYS_ISDBT SYS_ISDBS SYS_ISDBC SYS_ATSC SYS_ATSCMH SYS_DTMB SYS_CMMB SYS_DAB SYS_DVBT2 SYS_TURBO SYS_DVBC_ANNEX_C dtv_stats dtv_fe_stats dvb_device_type DVB_DEVICE_SEC DVB_DEVICE_FRONTEND DVB_DEVICE_DEMUX DVB_DEVICE_DVR DVB_DEVICE_CA DVB_DEVICE_NET DVB_DEVICE_VIDEO DVB_DEVICE_AUDIO DVB_DEVICE_OSD dvb_adapter proposed_mac mfe_shared mfe_dvbdev mfe_lock mdev_lock conn_pads dvb_device kernel_ioctl intf_devnode tsout_num_entities tsout_entity tsout_pads dvb_frontend_tune_settings min_delay_ms step_size max_drift dvb_tuner_info frequency_min_hz frequency_max_hz frequency_step_hz bandwidth_min bandwidth_max bandwidth_step analog_parameters audmode dvbfe_algo DVBFE_ALGO_HW DVBFE_ALGO_SW DVBFE_ALGO_CUSTOM DVBFE_ALGO_RECOVERY dvbfe_search DVBFE_ALGO_SEARCH_SUCCESS DVBFE_ALGO_SEARCH_ASLEEP DVBFE_ALGO_SEARCH_FAILED DVBFE_ALGO_SEARCH_INVALID DVBFE_ALGO_SEARCH_AGAIN DVBFE_ALGO_SEARCH_ERROR dvb_tuner_ops set_params set_analog_params get_frequency get_bandwidth get_if_frequency get_rf_strength get_afc calc_regs set_frequency set_bandwidth dvb_frontend dvb demodulator_priv tuner_priv frontend_priv sec_priv analog_demod_priv dtv_property_cache analog_demod_info analog_demod_ops has_signal tuner_status standby i2c_gate_ctrl dvb_frontend_internal_info frequency_stepsize_hz frequency_tolerance_hz symbol_rate_min symbol_rate_max symbol_rate_tolerance dvb_frontend_ops delsys release_sec tune get_frontend_algo set_frontend get_tune_settings get_frontend read_ber read_signal_strength read_snr read_ucblocks diseqc_reset_overload diseqc_send_master_cmd diseqc_recv_slave_reply diseqc_send_burst set_tone enable_high_lnb_voltage dishnetwork_send_legacy_command ts_bus_ctrl set_lna tuner_ops analog_ops dtv_frontend_properties modulation sectone inversion fec_inner transmission_mode bandwidth_hz guard_interval symbol_rate code_rate_HP code_rate_LP pilot rolloff delivery_system interleaving isdbt_partial_reception isdbt_sb_mode isdbt_sb_subchannel isdbt_sb_segment_idx isdbt_sb_segment_count isdbt_layer_enabled layer scrambling_sequence_index atscmh_fic_ver atscmh_parade_id atscmh_nog atscmh_tnog atscmh_sgn atscmh_prc atscmh_rs_frame_mode atscmh_rs_frame_ensemble atscmh_rs_code_mode_pri atscmh_rs_code_mode_sec atscmh_sccc_block_mode atscmh_sccc_code_mode_a atscmh_sccc_code_mode_b atscmh_sccc_code_mode_c atscmh_sccc_code_mode_d lna strength cnr pre_bit_error pre_bit_count post_bit_error post_bit_count block_error segment_count dmx_output DMX_OUT_DECODER DMX_OUT_TAP DMX_OUT_TS_TAP DMX_OUT_TSDEMUX_TAP dmx_input DMX_IN_FRONTEND DMX_IN_DVR dmx_ts_pes DMX_PES_AUDIO0 DMX_PES_VIDEO0 DMX_PES_TELETEXT0 DMX_PES_SUBTITLE0 DMX_PES_PCR0 DMX_PES_AUDIO1 DMX_PES_VIDEO1 DMX_PES_TELETEXT1 DMX_PES_SUBTITLE1 DMX_PES_PCR1 DMX_PES_AUDIO2 DMX_PES_VIDEO2 DMX_PES_TELETEXT2 DMX_PES_SUBTITLE2 DMX_PES_PCR2 DMX_PES_AUDIO3 DMX_PES_VIDEO3 DMX_PES_TELETEXT3 DMX_PES_SUBTITLE3 DMX_PES_PCR3 DMX_PES_OTHER dmx_filter dmx_sct_filter_params dmx_pes_filter_params pes_type dmx_buffer_flags DMX_BUFFER_FLAG_HAD_CRC32_DISCARD DMX_BUFFER_FLAG_TEI DMX_BUFFER_PKT_COUNTER_MISMATCH DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED DMX_BUFFER_FLAG_DISCONTINUITY_INDICATOR ts_filter_type TS_PACKET TS_PAYLOAD_ONLY TS_DECODER TS_DEMUX dmx_ts_feed is_filtering start_filtering stop_filtering dmx_demux allocate_ts_feed release_ts_feed allocate_section_feed release_section_feed add_frontend remove_frontend get_frontends connect_frontend disconnect_frontend get_pes_pids get_stc dmx_section_filter filter_value filter_mode dmx_section_feed check_crc crc_val secbuf secbuf_base secbufp tsfeedp allocate_filter release_filter dmx_ts_cb dmx_section_cb dmx_frontend_source DMX_MEMORY_FE DMX_FRONTEND_0 dmx_frontend connectivity_list dmx_demux_caps DMX_TS_FILTERING DMX_SECTION_FILTERING DMX_MEMORY_BASED_FILTERING dvb_dmx_filter_type DMX_TYPE_TS DMX_TYPE_SEC dvb_dmx_state DMX_STATE_FREE DMX_STATE_ALLOCATED DMX_STATE_READY DMX_STATE_GO dvb_demux_filter maskandmode maskandnotmode doneq feed hw_handle dvb_demux_feed demux buffer_flags ts_type pusi_seen peslen dvb_demux dmx filternum feednum start_feed stop_feed write_to_decoder check_crc32 memcopy frontend_list pesfilter feed_list tsbuf tsbufp cnt_storage speed_last_time speed_pkts_cnt playing recording dvb_net dvbdev ioctl_mutex remove_mutex dvb_ringbuffer pread pwrite media_request_state MEDIA_REQUEST_STATE_IDLE MEDIA_REQUEST_STATE_VALIDATING MEDIA_REQUEST_STATE_QUEUED MEDIA_REQUEST_STATE_COMPLETE MEDIA_REQUEST_STATE_CLEANING MEDIA_REQUEST_STATE_UPDATING NR_OF_MEDIA_REQUEST_STATE media_request_object_ops media_request_object vb2_mem_ops get_dmabuf get_userptr put_userptr attach_dmabuf detach_dmabuf map_dmabuf unmap_dmabuf num_users vb2_buffer vb2_queue num_planes req_obj copied_timestamp skip_cache_sync_on_prepare skip_cache_sync_on_finish planes queued_entry done_entry vb2_plane mem_priv dbuf_mapped bytesused min_length vb2_buffer_state VB2_BUF_STATE_DEQUEUED VB2_BUF_STATE_IN_REQUEST VB2_BUF_STATE_PREPARING VB2_BUF_STATE_QUEUED VB2_BUF_STATE_ACTIVE VB2_BUF_STATE_DONE VB2_BUF_STATE_ERROR io_modes dma_attrs bidirectional fileio_read_once fileio_write_immediately allow_zero_bytesused quirk_poll_must_check_waiting_for_buffers supports_requests requires_requests uses_qbuf uses_requests allow_cache_hints non_coherent_mem buf_ops drv_priv subsystem_flags buf_struct_size timestamp_flags min_buffers_needed alloc_devs num_buffers queued_list queued_count owned_by_drv_count done_lock done_wq streaming start_streaming_called waiting_for_buffers waiting_in_dqbuf is_multiplanar is_output copy_timestamp last_buffer_dequeued fileio threadio vb2_ops queue_setup wait_prepare wait_finish buf_out_validate buf_init buf_prepare buf_finish buf_cleanup start_streaming stop_streaming buf_queue buf_request_complete vb2_buf_ops verify_planes_array init_buffer fill_user_buffer fill_vb2_buffer vb2_fileio_data vb2_threadio_data v4l2_edid v4l2_preemphasis V4L2_PREEMPHASIS_DISABLED V4L2_PREEMPHASIS_50_uS V4L2_PREEMPHASIS_75_uS v4l2_priority V4L2_PRIORITY_UNSET V4L2_PRIORITY_BACKGROUND V4L2_PRIORITY_INTERACTIVE V4L2_PRIORITY_RECORD V4L2_PRIORITY_DEFAULT v4l2_rect v4l2_fract v4l2_std_id v4l2_bt_timings interlaced polarities hfrontporch hbackporch vfrontporch vbackporch il_vfrontporch il_vsync il_vbackporch standards cea861_vic hdmi_vic v4l2_dv_timings v4l2_enum_dv_timings v4l2_bt_timings_cap min_width max_width min_height max_height min_pixelclock max_pixelclock v4l2_dv_timings_cap v4l2_tuner rangelow rangehigh rxsubchans afc v4l2_modulator txsubchans v4l2_frequency tuner v4l2_frequency_band v4l2_vbi_format samples_per_line sample_format v4l2_sliced_vbi_format service_set service_lines v4l2_sliced_vbi_cap v4l2_sliced_vbi_data v4l2_event_subscription dvb_buffer dvb_vb2_ctx vb_q dvb_q buf_siz buf_cnt dmxdev_type DMXDEV_TYPE_NONE DMXDEV_TYPE_SEC DMXDEV_TYPE_PES dmxdev_state DMXDEV_STATE_FREE DMXDEV_STATE_ALLOCATED DMXDEV_STATE_SET DMXDEV_STATE_GO DMXDEV_STATE_DONE DMXDEV_STATE_TIMEDOUT pes dmxdev_filter vb2_ctx secheader dmxdev dvr_dvbdev may_do_mmap dvr_orig_fe dvr_buffer dvr_vb2_ctx dvb_usb_driver_info dvb_usb_device_properties size_of_priv generic_bulk_ctrl_endpoint generic_bulk_ctrl_endpoint_response generic_bulk_ctrl_delay identify_state download_firmware i2c_algo num_adapters get_adapter_count power_ctrl read_config read_mac_address frontend_attach frontend_detach tuner_attach tuner_detach frontend_ctrl streaming_ctrl get_rc_config get_stream_config dvb_usb_rc allowed_protos bulk_mode dvb_usb_device rc_polling_active udev powered usb_mutex i2c_mutex i2c_adap rc_phys rc_query_work buffersize framesperurb framesize bulk isoc usb_data_stream_properties dvb_usb_adapter_properties pid_filter_count pid_filter_ctrl pid_filter dvb_usb_adapter suspend_resume_active pid_filtering feed_count max_feed_count active_fe state_bits dvb_adap fe fe_init fe_sleep usb_data_stream buf_num urbs_initialized urbs_submitted user_priv rtl2830_platform_data spec_inv vtop krf agc_targ_val get_dvb_frontend get_i2c_adapter rtl2832_platform_data slave_ts_ctrl ycbcr_enc hsv_enc v4l2_mbus_framefmt quantization xfer_func v4l2_subdev_format v4l2_subdev_mbus_code_enum v4l2_subdev_frame_size_enum v4l2_subdev_frame_interval v4l2_subdev_frame_interval_enum v4l2_subdev_selection v4l2_async_match_type V4L2_ASYNC_MATCH_I2C V4L2_ASYNC_MATCH_FWNODE adapter_id v4l2_async_subdev asd_list v4l2_async_notifier_operations v4l2_async_notifier v4l2_dev waiting v4l2_subdev owner_v4l2_dev internal_ops ctrl_handler grp_id host_priv asd subdev_notifier active_state v4l2_device vfl_devnode_type VFL_TYPE_VIDEO VFL_TYPE_VBI VFL_TYPE_RADIO VFL_TYPE_SUBDEV VFL_TYPE_SDR VFL_TYPE_TOUCH VFL_TYPE_MAX vfl_devnode_direction VFL_DIR_RX VFL_DIR_TX VFL_DIR_M2M v4l2_prio_state prios v4l2_file_operations compat_ioctl32 video_device dev_parent vfl_type vfl_dir fh_lock fh_list dev_debug tvnorms ioctl_ops valid_ioctls v4l2_ctrl_handler v4l2_ioctl_ops v4l2_priv_tun_config v4l2_fh subscribe_lock subscribed navailable m2m_ctx v4l2_m2m_ctx v4l2_mbus_config_mipi_csi2 data_lanes clock_lane num_data_lanes lane_polarities v4l2_mbus_config_parallel data_shift v4l2_mbus_config_mipi_csi1 clock_inv strobe lane_polarity data_lane v4l2_mbus_type V4L2_MBUS_UNKNOWN V4L2_MBUS_PARALLEL V4L2_MBUS_BT656 V4L2_MBUS_CSI1 V4L2_MBUS_CCP2 V4L2_MBUS_CSI2_DPHY V4L2_MBUS_CSI2_CPHY V4L2_MBUS_DPI V4L2_MBUS_INVALID mipi_csi1 mipi_csi2 v4l2_mbus_config v4l2_decode_vbi_line is_second_field v4l2_subdev_io_pin_config v4l2_subdev_core_ops log_status s_io_pin_config load_fw s_gpio s_power interrupt_service_routine subscribe_event unsubscribe_event v4l2_subdev_tuner_ops s_radio s_frequency g_frequency enum_freq_bands g_tuner s_tuner g_modulator s_modulator s_type_addr s_config tuner_setup v4l2_subdev_audio_ops s_clock_freq s_i2s_clock_freq s_routing s_stream v4l2_mbus_frame_desc_entry_csi2 v4l2_mbus_frame_desc_flags V4L2_MBUS_FRAME_DESC_FL_LEN_MAX V4L2_MBUS_FRAME_DESC_FL_BLOB csi2 v4l2_mbus_frame_desc_entry pixelcode v4l2_mbus_frame_desc_type V4L2_MBUS_FRAME_DESC_TYPE_UNDEFINED V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL V4L2_MBUS_FRAME_DESC_TYPE_CSI2 v4l2_mbus_frame_desc v4l2_subdev_video_ops s_crystal_freq g_std s_std s_std_output g_std_output querystd g_tvnorms g_tvnorms_output g_input_status g_pixelaspect g_frame_interval s_frame_interval s_dv_timings g_dv_timings query_dv_timings s_rx_buffer pre_streamon post_streamoff v4l2_subdev_vbi_ops decode_vbi_line s_vbi_data g_vbi_data g_sliced_vbi_cap s_raw_fmt g_sliced_fmt s_sliced_fmt v4l2_subdev_sensor_ops g_skip_top_lines g_skip_frames v4l2_subdev_ir_mode V4L2_SUBDEV_IR_MODE_PULSE_WIDTH v4l2_subdev_ir_parameters bytes_per_data_element max_pulse_width carrier_freq invert_level invert_carrier_sense noise_filter_min_width carrier_range_lower carrier_range_upper v4l2_subdev_ir_ops rx_read rx_g_parameters rx_s_parameters tx_write tx_g_parameters tx_s_parameters v4l2_subdev_pad_config try_fmt try_crop try_compose v4l2_subdev_state _lock v4l2_subdev_pad_ops init_cfg enum_mbus_code enum_frame_size enum_frame_interval get_fmt set_fmt get_selection set_selection get_edid set_edid dv_timings_cap enum_dv_timings get_frame_desc set_frame_desc get_mbus_config v4l2_subdev_ops video vbi ir v4l2_subdev_internal_ops unregistered v4l2_subdev_fh v4l2_subdev_platform_data num_regulators rtl2832_sdr_platform_data mn88472_config xtal ts_mode ts_clock i2c_wr_max mn88473_config cxd2841er_xtal SONY_XTAL_20500 SONY_XTAL_24000 SONY_XTAL_41000 cxd2841er_config i2c_addr qt1010_config mt2060_config clock_out mxl5005s_config if_freq xtal_freq agc_mode tracking_filter rssi_enable cap_select div_out output_load mod_mode if_mode qam_gain AgcMasterByte fc001x_xtal_freq FC_XTAL_27_MHZ FC_XTAL_28_8_MHZ FC_XTAL_36_MHZ fc001x_fe_callback_commands FC_FE_CALLBACK_VHF_ENABLE fc0012_config dual_master loop_through e4000_config fc2580_platform_data get_v4l2_subdev tua9001_platform_data r820t_chip CHIP_R820T CHIP_R620D CHIP_R828D CHIP_R828 CHIP_R828S CHIP_R820C r820t_config rafael_chip max_i2c_msg_len use_diplexer use_predetect si2168_config ts_clock_inv ts_clock_gapped spectral_inversion si2157_config dont_load_firmware rtl28xxu_dev tuner_name demod_i2c_adapter rc_active new_i2c_write i2c_client_demod i2c_client_tuner i2c_client_slave_demod platform_device_sdr slave_demod rtl28xxu_chip_id CHIP_ID_NONE CHIP_ID_RTL2831U CHIP_ID_RTL2832U rtl28xxu_tuner TUNER_NONE TUNER_RTL2830_QT1010 TUNER_RTL2830_MT2060 TUNER_RTL2830_MXL5005S TUNER_RTL2832_MT2266 TUNER_RTL2832_FC2580 TUNER_RTL2832_MT2063 TUNER_RTL2832_MAX3543 TUNER_RTL2832_TUA9001 TUNER_RTL2832_MXL5007T TUNER_RTL2832_FC0012 TUNER_RTL2832_E4000 TUNER_RTL2832_TDA18272 TUNER_RTL2832_FC0013 TUNER_RTL2832_R820T TUNER_RTL2832_R828D TUNER_RTL2832_SI2157 rtl28xxu_req rtl28xxu_reg_val rtl28xxu_reg_val_mask rtl28xxu_usb_driver_exit rtl28xxu_usb_driver_init onoff rtl28xxu_pid_filter rtl28xxu_pid_filter_ctrl rtl28xxu_get_rc_config rtl2832u_rc_query rtl2831u_rc_query rtl28xxu_frontend_ctrl rtl28xxu_power_ctrl rtl28xxu_init rtl28xxu_tuner_detach rtl28xxu_tuner_attach rtl2832u_tuner_attach rtl28xxu_frontend_detach rtl28xxu_frontend_attach rtl2832u_frontend_attach adapter_priv rtl2832u_frontend_callback rtl28xxu_identify_state rtl28xxu_read_config rtl2832u_read_config rtl28xxu_i2c_func rtl28xxu_i2c_xfer rtl28xxu_wr_reg_mask rtl28xxu_ctrl_msg  dvb-usb-rtl28xxu.ko                                                                                                	                                                                                                              $                      (                      "      .            P      .       +     ~      .       @           .       U           .       j           .            6      .            d      .                  .                  .                  .                  .            J      .           x      .       '          .       <          .       Q          .       f    0      .       {    ^      .                 .                 .                 .                 .           D      .           r      .                 .       #          .       8          .       M    *      .       b    X      .       w          .                 .                 .                 .           >      .           l      #                   	                                 	       3                 G          <       _                   h           $       p                              E           `       L                  T         $ 0	      8                           $       8                   "                        .   $       8       G   $ X      8       `    "       O       }   $        8                           $       8           p                $       8                          $ `      8       )    `5      j      D   $ (      8       ]    q       1       {    	               $       8          $       8                                    >                                           #   	                <          $      Q                  h   $        8          $ p       8                  %
         $ H      8          $       8            
                $       8            
             %    8
             <           !      W    0            m   $       8                              B                 @                $       8                 P           P               $       8       /   $       8       H   $       8       a   $        8       z   $       8          $ p      8          $ 8      8           '      C          @      @          $         8           `)      x      	   $       8       )	   $ P      8       B	   $       8       [	    +             r	    `.      b      	   (                	    ,            	   $ h      8       	   $ 0      8       	          8       	   $ 8       8       	    0            
   $       8       *
   $        8       B
   $       8       Z
   $ P      8       r
   $       8       
   $       8       
   $       8       
   $ x      8       
   $ @      8       
   $       8          $       8                         ,    0              9    P              F    p              S                  _                   k                  w                                        @                 `                                                                                                                                                                  2       (    >       &       >    d       ,       Y                       "                                                                                        `             
    @             )
                  >
                  S
    
             h
    
             }
    
             
    
             
    `
             
    @
             
     
             
     
                  	                 	             ,    	             B    	             X    `	             n    @	                  	                  	                                                                                     `                 @             4                  J                  `                 v                                                                                          `      (                  $                  #                   (       $    H
             ;    `
              R           3       l    
                 (       (           
                                                                                                &               &                     3                     G   	                V                     f                     m                                                                                                                                                                                                                                                          '                     0                     F                     a                     l                     |                                                                                                                                                                                                                   +                     <                     J                     i                     p                      __UNIQUE_ID_alias228 __UNIQUE_ID_alias227 __UNIQUE_ID_alias226 __UNIQUE_ID_alias225 __UNIQUE_ID_alias224 __UNIQUE_ID_alias223 __UNIQUE_ID_alias222 __UNIQUE_ID_alias221 __UNIQUE_ID_alias220 __UNIQUE_ID_alias219 __UNIQUE_ID_alias218 __UNIQUE_ID_alias217 __UNIQUE_ID_alias216 __UNIQUE_ID_alias215 __UNIQUE_ID_alias214 __UNIQUE_ID_alias213 __UNIQUE_ID_alias212 __UNIQUE_ID_alias211 __UNIQUE_ID_alias210 __UNIQUE_ID_alias209 __UNIQUE_ID_alias208 __UNIQUE_ID_alias207 __UNIQUE_ID_alias206 __UNIQUE_ID_alias205 __UNIQUE_ID_alias204 __UNIQUE_ID_alias203 __UNIQUE_ID_alias202 __UNIQUE_ID_alias201 __UNIQUE_ID_alias200 __UNIQUE_ID_alias199 __UNIQUE_ID_alias198 __UNIQUE_ID_alias197 __UNIQUE_ID_alias196 __UNIQUE_ID_alias195 __UNIQUE_ID_alias194 __UNIQUE_ID_depends193 ____versions __UNIQUE_ID_retpoline192 __UNIQUE_ID_intree191 __UNIQUE_ID_name190 __UNIQUE_ID_vermagic189 _note_10 _note_9 rtl28xxu_i2c_func rtl28xxu_pid_filter_ctrl rtl28xxu_pid_filter rtl28xxu_ctrl_msg __UNIQUE_ID_ddebug429.44 __func__.82 __UNIQUE_ID_ddebug431.42 rtl28xxu_ctrl_msg.cold rtl28xxu_identify_state __UNIQUE_ID_ddebug453.31 __UNIQUE_ID_ddebug455.30 rtl28xxu_identify_state.cold __UNIQUE_ID_ddebug457.29 rtl28xxu_tuner_detach __UNIQUE_ID_ddebug489.12 rtl28xxu_frontend_detach __UNIQUE_ID_ddebug477.19 rtl2832u_frontend_attach __UNIQUE_ID_ddebug473.21 rtl2832u_frontend_callback __UNIQUE_ID_ddebug475.20 rtl2832u_frontend_attach.cold rtl28xxu_frontend_attach __UNIQUE_ID_ddebug459.28 __UNIQUE_ID_ddebug461.27 rtl28xxu_frontend_attach.cold rtl28xxu_i2c_xfer rtl28xxu_usb_driver_init rtl28xxu_usb_driver rtl28xxu_usb_driver_exit rtl28xxu_wr_reg_mask rtl28xxu_frontend_ctrl __UNIQUE_ID_ddebug507.3 __UNIQUE_ID_ddebug509.2 rtl2832u_tuner_attach __UNIQUE_ID_ddebug483.16 __UNIQUE_ID_ddebug487.13 rtl2832u_r820t_config __UNIQUE_ID_ddebug485.14 rtl2832u_r828d_config rtl2832u_fc0012_config rtl2832u_tuner_attach.cold rtl28xxu_tuner_attach __UNIQUE_ID_ddebug479.18 rtl28xxu_mxl5005s_config rtl28xxu_qt1010_config rtl28xxu_mt2060_config __UNIQUE_ID_ddebug481.17 rtl28xxu_tuner_attach.cold rtl2832u_read_config __UNIQUE_ID_ddebug439.38 __UNIQUE_ID_ddebug451.32 __UNIQUE_ID_ddebug441.37 __UNIQUE_ID_ddebug449.33 __UNIQUE_ID_ddebug443.36 __UNIQUE_ID_ddebug445.35 __UNIQUE_ID_ddebug447.34 rtl2832u_rc_query init_tab.83 __UNIQUE_ID_ddebug513.0 rtl28xxu_read_config __UNIQUE_ID_ddebug433.41 __UNIQUE_ID_ddebug437.39 __UNIQUE_ID_ddebug435.40 rtl28xxu_get_rc_config rtl2831u_rc_query rtl28xxu_disable_rc rtl28xxu_init __UNIQUE_ID_ddebug491.11 __UNIQUE_ID_ddebug493.10 rc_nec_tab.80 __UNIQUE_ID_ddebug511.1 rtl28xxu_power_ctrl __UNIQUE_ID_ddebug503.5 __UNIQUE_ID_ddebug505.4 __UNIQUE_ID_ddebug495.9 __UNIQUE_ID_ddebug501.6 __UNIQUE_ID_ddebug497.8 __UNIQUE_ID_ddebug499.7 __UNIQUE_ID_ddebug471.22 __UNIQUE_ID_ddebug463.26 __UNIQUE_ID_ddebug465.25 __UNIQUE_ID_ddebug467.24 __UNIQUE_ID_ddebug469.23 __func__.103 __func__.102 __func__.101 __func__.100 __func__.99 __func__.98 __func__.97 __func__.96 __func__.95 __func__.94 __func__.93 __func__.90 __func__.89 __func__.88 __func__.87 __func__.86 __func__.85 __func__.81 __UNIQUE_ID_license520 __UNIQUE_ID_author519 __UNIQUE_ID_author518 __UNIQUE_ID_description517 __UNIQUE_ID___addressable_cleanup_module516 __UNIQUE_ID___addressable_init_module515 rtl28xxu_id_table __compound_literal.0 __compound_literal.1 __compound_literal.2 __compound_literal.3 __compound_literal.4 __compound_literal.5 __compound_literal.6 __compound_literal.7 __compound_literal.8 __compound_literal.9 __compound_literal.10 __compound_literal.11 __compound_literal.12 __compound_literal.13 __compound_literal.14 __compound_literal.15 __compound_literal.16 __compound_literal.17 __compound_literal.18 __compound_literal.19 __compound_literal.20 __compound_literal.21 __compound_literal.22 __compound_literal.23 __compound_literal.24 __compound_literal.25 __compound_literal.26 __compound_literal.27 __compound_literal.28 __compound_literal.29 __compound_literal.30 __compound_literal.31 __compound_literal.32 __compound_literal.33 __compound_literal.34 rtl28xxu_props rtl28xxu_i2c_algo __UNIQUE_ID_adapter_nr428 __UNIQUE_ID_adapter_nrtype427 __param_adapter_nr __param_str_adapter_nr __param_arr_adapter_nr __UNIQUE_ID_disable_rc426 __UNIQUE_ID_disable_rctype425 __param_disable_rc __param_str_disable_rc try_module_get dvb_usbv2_reset_resume ir_raw_event_handle __mod_usb__rtl28xxu_id_table_device_table __this_module __symbol_put usb_register_driver cleanup_module param_array_ops memcpy __dynamic_dev_dbg __fentry__ init_module dvb_usbv2_suspend __x86_indirect_thunk_rax _printk usb_clear_halt __stack_chk_fail module_put i2c_adapter_type dvb_usbv2_disconnect __symbol_get _dev_err i2c_unregister_device platform_device_unregister mutex_lock usb_control_msg rc_keydown dvb_usbv2_probe i2c_new_client_device mutex_lock_interruptible usb_deregister param_ops_short __x86_return_thunk strscpy platform_device_register_full mutex_unlock dvb_usbv2_resume param_ops_int ir_raw_event_store_with_filter msleep __request_module                                               C             P             a                                                                              _            l                                                                 	   0	      1                  =                    B            W            k                                                                       	                                             _                                           )                	                                 +                	   X                                          "            >            F            N            Y            )       `         	         i            q                                                                                    )                	                                             I                               Q                               9            P            f                        `5                                     !            ,            ]                                    ~                   ~                   ~                   )                	   `                                          d       .            D                        T                                           '	            N	            \       d	            q	            	            d       	            	            y       	            	            d       	            	            m       	                   	         	   (      	            	            	            
                   
                        Q       0            ?            p                                                '                   2            )       9         	         B            O            k                   r         	         {                                                4
            ^
                        +                                                                                                            }                                                    	                                                  	   p                               
                  9            J                  d            y                                                A                  B            Q                                                                              	            2                   7            V             
      [                        Z                  Q                               Z      9            {                        )                	   H                                              	                                                                                  0            a            ~                                                f               	                                                                 
                  M                   R            q             
      v                                                                                                                     7            8
      <            O                   T                        -                                                                                                                                                                                                                             ,                                     <                   A            o            -      t            {                                                                                             -                                                                                                         \                  \      !            \      1                                                                                                                   {                              B                              {                              )                 	         )            ?                  D            c            @      h            x                  }                                                                                                                  
                                                                                                                              {      
                              ,                   3         	         <            Q            a                  j                  I             T             )       [          	         d             s                    z          	                                         T!                  "            5#            p#            H      #                  #            O      #         	         #            #            ]$            -%                  G%            
      a%                  %                  %            3      %                  %            $      %            -      &            <      %&            B      5&                  <&         	          E&            O&            &            Y      &         	         &            &            h      &         	   p      &            &            w      &         	   8      &            '            h'            @      o'                  (            (                   (         	           &(            3)            E)            O)            a)            )                  e*            p*            )       w*         	         *            *            *                  ?+                  F+                  w+                   ~+         	   P      +            +            O      +         	         +            +                  +                  +            +            
,                  ,            `.      @,            F,         
   j,            '      ~,                  ,            ,            L-            W-            )       ^-         	   h      g-            v-                   }-         	   0      -            -                    ..                   T.            a.            .                  .                  /            Q0            f0                   m0         	   8       {0            0            0            X1            1                  1                  1         	         1            c2                   j2         	          s2            2                  2         	         2            3            4                   4         	   P      4            4            
       4            4                  4         	         4            05                  75         	         F5            P5            a5            5                    5            6         	         6                  6            6                  6         	   x      6            7                   	7         	   @      7            h7                  o7         	         x7            7                   7         	         7            7            
                                              O      )             8       8             C                   T                    [          	          d             m                   t             X       y             ~             	                   7                                 q	                   7                                 O                                                    F                                            
            ,                  3                   :            \                  g            H      r                                                                                                                                            H                              }                  P                  
            }                                                }      %                   *            /            }                                                                                                                                                  8                  X                  x            `                  @                                                        
                  
      8            
      X            
      x            `
                  @
                   
                   
                  	                  	      8            	      X            	      x            `	                  @	                   	                   	                                          8                  X                  x            `                  @                                                                                8                  X                                                                                                                        *                                                                         >                                     J      0                  @            V      P                  `            b      p                              q                                                                                                                                     	                  	                   	                  0	                  @	                  P	                  `	                  p	                  	            0      	                  	                  	                  	                  	                  	            X      	                   
                  
            3      
                   
                  0
                  @
                  P
                  `
            G      p
                  
                  
                  
                  
                  
            0      
                  
            _      
                               X                                           (            x      0                  @                  P                  `                  p                                                                                                                                                                                                         0            `      P                   X            `                   0                  `)                  	                  p                  0                                                       ,                  +      p
                    x
                                                                         `                                               (                   0             p      8                   @             	      H                   P                     X                   `                    h                    p             0      x             P                   '                   `)                   +                   ,                   `.                   0                   `5                    H
                                                              `
      (             
      0                     8                     H          
                         B                    O                                                            O                   e                   C                                             $                   (                   ,             Z      0                   4             u      8                   <             ;      @                   D                   H             g                    
                                       j                                                         M                                                                $             ]
      (                   ,             |      0             z      4                   8             H       <             (      @             d*      D             ?,      H             K-      L             P0      P             W1      T             5                                                                                 G                    H                    T                    `                                                $                    (                    ,                    0                    4                    8                    <                    @                    D             F      H             N      L             U      P             w      T                   X                   \                   `                   d                   h                   l                   p                   t                   x                   |                                                   $                   .                   9                   :                   J                   ^                   b                   d                   f                   h                   j                   o                                                                                                                                                                                                                                                                                                                                                                                                                                                                    M                  R                  o                  p                   v      $            w      (                  ,                  0                  4                  8                  <                  @                  D                   H            "      L            #      P            '      T            .      X                  \                  `                  d                  h                  l                  p                  t                  x            	      |            	                  	                  	                  	                  	                   
                  
                  R
                  S
                  T
                  V
                  X
                  Z
                  _
                                                                                                                                                                                                                                                                                                U
                  V
                  W
                  Y
                   [
                  ]
                  b
                                                                                                                   $                  (                  ,                  0                  4                  8                  <                  @                  D                  H                  L                   P                  T            	      X            
      \            
      `                  d            v      h            w      l            x      p            z      t            |      x                  |                                                                                                                                           t                  u                  v                  x                  z                                    %                  0                  7                  8                  9                  d                  e                  g                  l                                                                                          E                  P                  a                  n                  r                                    B                    E                   F                   H                   M                   '                  '                  '                  '                    '      $            "'      (            &'      ,            ''      0            .'      4            '      8            '      <            '      @            '      D            '      H            '      L            (      P            (      T            S)      X            `)      \            g)      `            i)      d            j)      h            k)      l            r)      p            )      t            )      x            )      |            )                  )                  )                  \*                  _*                  `*                  b*                  d*                  i*                  +                  +                  +                  ?,                  D,                  ,                  ,                  ,                  ,                  ,                  G-                  J-                  K-                  P-                  X.                  `.                  g.                  i.                  k.                  m.                  n.                  o.                  v.                  C0                   G0                  H0                  J0                  L0                  N0                  P0                  U0                  0                   0      $            0      (            0      ,            0      0            0      4            0      8            O1      <            R1      @            S1      D            U1      H            W1      L            \1      P            T5      T            `5      X            g5      \            i5      `            k5      d            l5      h            m5      l            q5      p            5      t            5      x            5      |            5                  5                  5                  5                  7                                      "                   q                                                                           3                                                                                                  w                                   	   Z	                   [                                   	   "	                    G      $                   (          	         0             n      4                   8          	         @             @       D             G       H          	   J      P                   T             R      X          	         `                   d                   h          	         p             r      t                   x          	                      u	                   	                	   R                   v
                   +                	                      S                   _                	                      =                                   	                                                          	                                                          	   r                   i                                   	                                                         	   :                   l                                 	                                                      	                             $            M       (         	   B      0            "       4            j       8         	         @            X!      D            #      H         	   
      P            $      T            .&      X         	   *      `            S&      d            &      h         	         p            q&      t            &      x         	                     &                  &               	   b                  (                  (               	   *                    *                  i*               	                     ?*                  n+               	   z                  g+                  +               	                     ,                  P-               	                     --                  m-               	   Z                  X0                  \0               	   b                    1                  1               	   B                  21                  Z2               	   
                   2      $            |2      (         	   "      0            P2      4            3      8         	   z      @            2      D            $5      H         	         P            3      T            4      X         	         `            5      d            6      h         	         p            5      t            6      x         	                     6                  6               	   j                  7                  [7               	   2                  T7                  7               	                                                                                              (                     0                     H                    `                                                                                                                                                                 8                    @                   H                   P                    p                    x                                                                                                                                                                         0                                                                              0       (                  0                  P                   X            P       `                  h                                                  P                                                                          P                                                                           P                                           0                   8                  @                  H                   h                   p                  x                              )                                                                          )                                                                                                                                         (            f      H                   P                  X                  `            )                                                                                                                                                    )                                      `                                     )       (                   0                   8                  @                   `                   h                   p                  x            )                                                                                                                                                                                                                                       @                   H                   P                  X                   x                                                                                                         @                                                                          @                                     )                           (                   0                  8                   X                   `                   h                  p            +                                                                           )                                      p                                                                            p                                           8                   @            p       H                  P            w      p                   x            p                                     h                                     p                                     Y                                     p                                     O                                      p       (                  0            )       P                   X                   `                  h                                                                                       O                                                                          )                           	                  	                  	                   0	                   8	                  @	                  H	                    8                    P                     .symtab .strtab .shstrtab .note.gnu.build-id .note.Linux .rela.text .rela.text.unlikely .rela.init.text .rela.exit.text .rela.rodata .rela__mcount_loc .rodata.str1.1 .rodata.str1.8 .modinfo .rela__param .rela.retpoline_sites .rela.return_sites .orc_unwind .rela.orc_unwind_ip __versions .rela__jump_table .rela.data .rela.exit.data .rela.init.data .rela__dyndbg .rela.gnu.linkonce.this_module .bss .comment .note.GNU-stack .BTF .gnu_debuglink                                                                                          @       $                              .                     d       <                              ?                            7                             :      @               o     8(      -                    J                     j8      3                             E      @               ؗ           -                    ^                     :                                    Y      @                    x       -                    n                     :                                    i      @                     0       -   	                 ~                     :      
                              y      @               0           -                                         kH                                          @                     (      -   
                       2               #I                                        2               M                                                        Q                                                        Y      P                                    @               (            -                                         0Z      L                                    @                          -                                         |Z      X                                    @                          -                                         Z                                                       a                                        @                    h      -                                        f      	                              %                    p                                         @               (           -                    7                    @s                                    2     @               @            -                    B                     u                                    =     @                           -                     R                    u                                    M     @               0            -   "                 b                    u      h	                             ]     @               H            -   $                 p                    ~                    @               k     @               h     0       -   &                                                                               0                      P                                                  P                                                          P                                                        `D                                                         xD           .                    	                      \                                                                                          0	*H
01
0	`He0	*H
1a0]080 10UDebian Secure Boot CA2(oe:B&C0	`He0
	*H
  oV!-a[,ryw,CR+	!2:02R^hKl=n.xm(*'fHgW?N7вzWNz:{
&<c)3Hċ$YK.s	-[}$C^g_e0kl){YS	(˔Z;J2
ɂN.GYY--Ym0hU U:K8D         ~Module signature appended~
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     